diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index b59fb9e..3aff557 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -8,8 +8,11 @@ copyrights, licenses, and trademarks remain with their respective owners. | NexBox | Local source under `参考/NexBox-main` | GPL-3.0 | Reference implementation for hardware monitoring, optimization, overlays, music, network diagnostics, and installer workflows. NexBox branding and site assets are not included. | | LibreHardwareMonitor | LibreHardwareMonitorLib 0.9.6 | MPL-2.0 | Optional sensor provider in the isolated hardware-monitor host. | | QRCoder | 1.8.0 | MIT | QR code rendering for provider login. | -| MoeKoeMusic | Commit [`4581660209c9cdd07669e8bd5bcbe136b7d91e02`](https://github.com/MoeKoeMusic/MoeKoeMusic/tree/4581660209c9cdd07669e8bd5bcbe136b7d91e02) | GPL-3.0 | Reference for the KuGou client login and account workflow. No MoeKoeMusic code or branding is bundled. | -| KuGouMusicApi | Commit [`06560e3e053bda1ab830750db6f645bab703f824`](https://github.com/MakcRe/KuGouMusicApi/tree/06560e3e053bda1ab830750db6f645bab703f824) | MIT | Protocol reference for KuGou request signing, device registration, QR login, account playlists, and entitlement-aware HTTPS playback. The required protocol subset is independently implemented in C#. | +| MoeKoeMusic | Commit [`4581660209c9cdd07669e8bd5bcbe136b7d91e02`](https://github.com/MoeKoeMusic/MoeKoeMusic/tree/4581660209c9cdd07669e8bd5bcbe136b7d91e02) | GPL-2.0 at the pinned commit | Pinned upstream project, README, license, and original disclaimer distributed with the local KuGou API integration. The fixed commit identifies `api` as the KuGouMusicApi submodule below. | +| KuGouMusicApi | Commit [`06560e3e053bda1ab830750db6f645bab703f824`](https://github.com/MakcRe/KuGouMusicApi/tree/06560e3e053bda1ab830750db6f645bab703f824) | MIT | Bundled and modified local random-port API service for KuGou requests, login/account workflows, playback resolution, and KRC lyrics. Original source, lockfile, MIT license, README/disclaimer, and `YMhut_PATCHES.md` are distributed in `music-api`. | +| Binaryify/NeteaseCloudMusicApi | [Repository](https://github.com/Binaryify/NeteaseCloudMusicApi) | Upstream project license | Attribution for the two-minute API response cache mechanism inherited by KuGouMusicApi. YMhut restricts the cache to an explicit anonymous public GET allowlist. | +| Node.js | 22.18.0 x64 | Node.js license | Bundled runtime for the loopback-only music API child process. Production does not depend on a system Node installation. | +| MoeKoeMusic API npm dependencies | Exact versions in `api/pnpm-lock.yaml` | Package-specific licenses | Production dependencies include axios, express, pako, qrcode, crypto-js, node-forge, big-integer, dotenv, safe-decode-uri-component, and url. | | Microsoft Windows App SDK | 1.8.260416003 | Microsoft license | WinUI 3 desktop application and installer bootstrap. | | Microsoft WebView2 | 1.0.3967.48 | Microsoft license | Embedded browser and tool surfaces. | | Microsoft.Data.Sqlite | 10.0.9 | MIT | Local application data and logs. | diff --git a/assets/data/tool-ui/age_calculator.dat b/assets/data/tool-ui/age_calculator.dat new file mode 100644 index 0000000..dca91d3 Binary files /dev/null and b/assets/data/tool-ui/age_calculator.dat differ diff --git a/assets/data/tool-ui/ai_latest_news.dat b/assets/data/tool-ui/ai_latest_news.dat new file mode 100644 index 0000000..00b7976 Binary files /dev/null and b/assets/data/tool-ui/ai_latest_news.dat differ diff --git a/assets/data/tool-ui/ai_translation.dat b/assets/data/tool-ui/ai_translation.dat new file mode 100644 index 0000000..8eded05 Binary files /dev/null and b/assets/data/tool-ui/ai_translation.dat differ diff --git a/assets/data/tool-ui/archive_tool.dat b/assets/data/tool-ui/archive_tool.dat new file mode 100644 index 0000000..46fad0e Binary files /dev/null and b/assets/data/tool-ui/archive_tool.dat differ diff --git a/assets/data/tool-ui/area_converter.dat b/assets/data/tool-ui/area_converter.dat new file mode 100644 index 0000000..7966b8a Binary files /dev/null and b/assets/data/tool-ui/area_converter.dat differ diff --git a/assets/data/tool-ui/ascii_art.dat b/assets/data/tool-ui/ascii_art.dat new file mode 100644 index 0000000..cbd33d2 Binary files /dev/null and b/assets/data/tool-ui/ascii_art.dat differ diff --git a/assets/data/tool-ui/average_calculator.dat b/assets/data/tool-ui/average_calculator.dat new file mode 100644 index 0000000..6e14346 Binary files /dev/null and b/assets/data/tool-ui/average_calculator.dat differ diff --git a/assets/data/tool-ui/baidu_hot.dat b/assets/data/tool-ui/baidu_hot.dat new file mode 100644 index 0000000..396070a Binary files /dev/null and b/assets/data/tool-ui/baidu_hot.dat differ diff --git a/assets/data/tool-ui/base64_codec.dat b/assets/data/tool-ui/base64_codec.dat new file mode 100644 index 0000000..f820b52 Binary files /dev/null and b/assets/data/tool-ui/base64_codec.dat differ diff --git a/assets/data/tool-ui/batch_rename_preview.dat b/assets/data/tool-ui/batch_rename_preview.dat new file mode 100644 index 0000000..9f2e82d Binary files /dev/null and b/assets/data/tool-ui/batch_rename_preview.dat differ diff --git a/assets/data/tool-ui/bili_hot.dat b/assets/data/tool-ui/bili_hot.dat new file mode 100644 index 0000000..179f9cd Binary files /dev/null and b/assets/data/tool-ui/bili_hot.dat differ diff --git a/assets/data/tool-ui/blank_line_cleaner.dat b/assets/data/tool-ui/blank_line_cleaner.dat new file mode 100644 index 0000000..6e210c6 Binary files /dev/null and b/assets/data/tool-ui/blank_line_cleaner.dat differ diff --git a/assets/data/tool-ui/bmi_calculator.dat b/assets/data/tool-ui/bmi_calculator.dat new file mode 100644 index 0000000..aa428df Binary files /dev/null and b/assets/data/tool-ui/bmi_calculator.dat differ diff --git a/assets/data/tool-ui/calculator_tool.dat b/assets/data/tool-ui/calculator_tool.dat new file mode 100644 index 0000000..5508a87 Binary files /dev/null and b/assets/data/tool-ui/calculator_tool.dat differ diff --git a/assets/data/tool-ui/car_info.dat b/assets/data/tool-ui/car_info.dat new file mode 100644 index 0000000..536f5e5 Binary files /dev/null and b/assets/data/tool-ui/car_info.dat differ diff --git a/assets/data/tool-ui/case_converter.dat b/assets/data/tool-ui/case_converter.dat new file mode 100644 index 0000000..0b1664c Binary files /dev/null and b/assets/data/tool-ui/case_converter.dat differ diff --git a/assets/data/tool-ui/cctv_news.dat b/assets/data/tool-ui/cctv_news.dat new file mode 100644 index 0000000..504e4b4 Binary files /dev/null and b/assets/data/tool-ui/cctv_news.dat differ diff --git a/assets/data/tool-ui/charset_lookup.dat b/assets/data/tool-ui/charset_lookup.dat new file mode 100644 index 0000000..4c6319b Binary files /dev/null and b/assets/data/tool-ui/charset_lookup.dat differ diff --git a/assets/data/tool-ui/chinese_converter.dat b/assets/data/tool-ui/chinese_converter.dat new file mode 100644 index 0000000..74a5746 Binary files /dev/null and b/assets/data/tool-ui/chinese_converter.dat differ diff --git a/assets/data/tool-ui/cidr_subnet_calculator.dat b/assets/data/tool-ui/cidr_subnet_calculator.dat new file mode 100644 index 0000000..761895d Binary files /dev/null and b/assets/data/tool-ui/cidr_subnet_calculator.dat differ diff --git a/assets/data/tool-ui/city_route_query.dat b/assets/data/tool-ui/city_route_query.dat new file mode 100644 index 0000000..bc1ef1e Binary files /dev/null and b/assets/data/tool-ui/city_route_query.dat differ diff --git a/assets/data/tool-ui/color_contrast_checker.dat b/assets/data/tool-ui/color_contrast_checker.dat new file mode 100644 index 0000000..d395269 Binary files /dev/null and b/assets/data/tool-ui/color_contrast_checker.dat differ diff --git a/assets/data/tool-ui/color_picker.dat b/assets/data/tool-ui/color_picker.dat new file mode 100644 index 0000000..c1b8f57 Binary files /dev/null and b/assets/data/tool-ui/color_picker.dat differ diff --git a/assets/data/tool-ui/column_extractor.dat b/assets/data/tool-ui/column_extractor.dat new file mode 100644 index 0000000..a8a8165 Binary files /dev/null and b/assets/data/tool-ui/column_extractor.dat differ diff --git a/assets/data/tool-ui/combination_calculator.dat b/assets/data/tool-ui/combination_calculator.dat new file mode 100644 index 0000000..787d025 Binary files /dev/null and b/assets/data/tool-ui/combination_calculator.dat differ diff --git a/assets/data/tool-ui/compound_interest_calculator.dat b/assets/data/tool-ui/compound_interest_calculator.dat new file mode 100644 index 0000000..41aa443 Binary files /dev/null and b/assets/data/tool-ui/compound_interest_calculator.dat differ diff --git a/assets/data/tool-ui/compression_codec.dat b/assets/data/tool-ui/compression_codec.dat new file mode 100644 index 0000000..7eee023 Binary files /dev/null and b/assets/data/tool-ui/compression_codec.dat differ diff --git a/assets/data/tool-ui/cron_helper.dat b/assets/data/tool-ui/cron_helper.dat new file mode 100644 index 0000000..30b4948 Binary files /dev/null and b/assets/data/tool-ui/cron_helper.dat differ diff --git a/assets/data/tool-ui/csv_json_converter.dat b/assets/data/tool-ui/csv_json_converter.dat new file mode 100644 index 0000000..ac86fd2 Binary files /dev/null and b/assets/data/tool-ui/csv_json_converter.dat differ diff --git a/assets/data/tool-ui/csv_tsv_converter.dat b/assets/data/tool-ui/csv_tsv_converter.dat new file mode 100644 index 0000000..ecf377b Binary files /dev/null and b/assets/data/tool-ui/csv_tsv_converter.dat differ diff --git a/assets/data/tool-ui/data_size_converter.dat b/assets/data/tool-ui/data_size_converter.dat new file mode 100644 index 0000000..1860182 Binary files /dev/null and b/assets/data/tool-ui/data_size_converter.dat differ diff --git a/assets/data/tool-ui/date_difference_calculator.dat b/assets/data/tool-ui/date_difference_calculator.dat new file mode 100644 index 0000000..121e8bc Binary files /dev/null and b/assets/data/tool-ui/date_difference_calculator.dat differ diff --git a/assets/data/tool-ui/delimiter_converter.dat b/assets/data/tool-ui/delimiter_converter.dat new file mode 100644 index 0000000..abe6a1b Binary files /dev/null and b/assets/data/tool-ui/delimiter_converter.dat differ diff --git a/assets/data/tool-ui/dev_environment_config.dat b/assets/data/tool-ui/dev_environment_config.dat new file mode 100644 index 0000000..656f479 Binary files /dev/null and b/assets/data/tool-ui/dev_environment_config.dat differ diff --git a/assets/data/tool-ui/discount_calculator.dat b/assets/data/tool-ui/discount_calculator.dat new file mode 100644 index 0000000..9596ba0 Binary files /dev/null and b/assets/data/tool-ui/discount_calculator.dat differ diff --git a/assets/data/tool-ui/dns_query.dat b/assets/data/tool-ui/dns_query.dat new file mode 100644 index 0000000..cb8000d Binary files /dev/null and b/assets/data/tool-ui/dns_query.dat differ diff --git a/assets/data/tool-ui/dns_record_lookup.dat b/assets/data/tool-ui/dns_record_lookup.dat new file mode 100644 index 0000000..4a9a7a8 Binary files /dev/null and b/assets/data/tool-ui/dns_record_lookup.dat differ diff --git a/assets/data/tool-ui/domain_extractor.dat b/assets/data/tool-ui/domain_extractor.dat new file mode 100644 index 0000000..07b4f80 Binary files /dev/null and b/assets/data/tool-ui/domain_extractor.dat differ diff --git a/assets/data/tool-ui/domain_price.dat b/assets/data/tool-ui/domain_price.dat new file mode 100644 index 0000000..96864b5 Binary files /dev/null and b/assets/data/tool-ui/domain_price.dat differ diff --git a/assets/data/tool-ui/duplicate_detector.dat b/assets/data/tool-ui/duplicate_detector.dat new file mode 100644 index 0000000..388c78d Binary files /dev/null and b/assets/data/tool-ui/duplicate_detector.dat differ diff --git a/assets/data/tool-ui/earthquake_info.dat b/assets/data/tool-ui/earthquake_info.dat new file mode 100644 index 0000000..60a1438 Binary files /dev/null and b/assets/data/tool-ui/earthquake_info.dat differ diff --git a/assets/data/tool-ui/extension_extractor.dat b/assets/data/tool-ui/extension_extractor.dat new file mode 100644 index 0000000..2260770 Binary files /dev/null and b/assets/data/tool-ui/extension_extractor.dat differ diff --git a/assets/data/tool-ui/extension_statistics.dat b/assets/data/tool-ui/extension_statistics.dat new file mode 100644 index 0000000..7641a12 Binary files /dev/null and b/assets/data/tool-ui/extension_statistics.dat differ diff --git a/assets/data/tool-ui/external-tool-host.dat b/assets/data/tool-ui/external-tool-host.dat new file mode 100644 index 0000000..9f4a79c Binary files /dev/null and b/assets/data/tool-ui/external-tool-host.dat differ diff --git a/assets/data/tool-ui/file_manifest_builder.dat b/assets/data/tool-ui/file_manifest_builder.dat new file mode 100644 index 0000000..82420e2 Binary files /dev/null and b/assets/data/tool-ui/file_manifest_builder.dat differ diff --git a/assets/data/tool-ui/filename_formatter.dat b/assets/data/tool-ui/filename_formatter.dat new file mode 100644 index 0000000..bbad27f Binary files /dev/null and b/assets/data/tool-ui/filename_formatter.dat differ diff --git a/assets/data/tool-ui/football_news.dat b/assets/data/tool-ui/football_news.dat new file mode 100644 index 0000000..55148f3 Binary files /dev/null and b/assets/data/tool-ui/football_news.dat differ diff --git a/assets/data/tool-ui/form_urlencoded_builder.dat b/assets/data/tool-ui/form_urlencoded_builder.dat new file mode 100644 index 0000000..3b8442a Binary files /dev/null and b/assets/data/tool-ui/form_urlencoded_builder.dat differ diff --git a/assets/data/tool-ui/gcd_lcm_calculator.dat b/assets/data/tool-ui/gcd_lcm_calculator.dat new file mode 100644 index 0000000..5393016 Binary files /dev/null and b/assets/data/tool-ui/gcd_lcm_calculator.dat differ diff --git a/assets/data/tool-ui/gold_price.dat b/assets/data/tool-ui/gold_price.dat new file mode 100644 index 0000000..dcc1046 Binary files /dev/null and b/assets/data/tool-ui/gold_price.dat differ diff --git a/assets/data/tool-ui/hardware.dat b/assets/data/tool-ui/hardware.dat new file mode 100644 index 0000000..d5abe59 Binary files /dev/null and b/assets/data/tool-ui/hardware.dat differ diff --git a/assets/data/tool-ui/hash_generator.dat b/assets/data/tool-ui/hash_generator.dat new file mode 100644 index 0000000..43efb45 Binary files /dev/null and b/assets/data/tool-ui/hash_generator.dat differ diff --git a/assets/data/tool-ui/hash_manifest_builder.dat b/assets/data/tool-ui/hash_manifest_builder.dat new file mode 100644 index 0000000..9e17b9b Binary files /dev/null and b/assets/data/tool-ui/hash_manifest_builder.dat differ diff --git a/assets/data/tool-ui/hash_manifest_verify.dat b/assets/data/tool-ui/hash_manifest_verify.dat new file mode 100644 index 0000000..b9dbc10 Binary files /dev/null and b/assets/data/tool-ui/hash_manifest_verify.dat differ diff --git a/assets/data/tool-ui/history_today.dat b/assets/data/tool-ui/history_today.dat new file mode 100644 index 0000000..5aeb681 Binary files /dev/null and b/assets/data/tool-ui/history_today.dat differ diff --git a/assets/data/tool-ui/hmac_generator.dat b/assets/data/tool-ui/hmac_generator.dat new file mode 100644 index 0000000..0e7a5b6 Binary files /dev/null and b/assets/data/tool-ui/hmac_generator.dat differ diff --git a/assets/data/tool-ui/hotboard.dat b/assets/data/tool-ui/hotboard.dat new file mode 100644 index 0000000..b3618de Binary files /dev/null and b/assets/data/tool-ui/hotboard.dat differ diff --git a/assets/data/tool-ui/html_entity.dat b/assets/data/tool-ui/html_entity.dat new file mode 100644 index 0000000..a6fd70f Binary files /dev/null and b/assets/data/tool-ui/html_entity.dat differ diff --git a/assets/data/tool-ui/html_js_playground.dat b/assets/data/tool-ui/html_js_playground.dat new file mode 100644 index 0000000..44bdeb1 Binary files /dev/null and b/assets/data/tool-ui/html_js_playground.dat differ diff --git a/assets/data/tool-ui/html_minifier.dat b/assets/data/tool-ui/html_minifier.dat new file mode 100644 index 0000000..aaeccf6 Binary files /dev/null and b/assets/data/tool-ui/html_minifier.dat differ diff --git a/assets/data/tool-ui/html_text_extractor.dat b/assets/data/tool-ui/html_text_extractor.dat new file mode 100644 index 0000000..d5571fa Binary files /dev/null and b/assets/data/tool-ui/html_text_extractor.dat differ diff --git a/assets/data/tool-ui/http_diagnostic.dat b/assets/data/tool-ui/http_diagnostic.dat new file mode 100644 index 0000000..ead112d Binary files /dev/null and b/assets/data/tool-ui/http_diagnostic.dat differ diff --git a/assets/data/tool-ui/http_status_lookup.dat b/assets/data/tool-ui/http_status_lookup.dat new file mode 100644 index 0000000..d0cb74c Binary files /dev/null and b/assets/data/tool-ui/http_status_lookup.dat differ diff --git a/assets/data/tool-ui/image_metadata_inspector.dat b/assets/data/tool-ui/image_metadata_inspector.dat new file mode 100644 index 0000000..939c358 Binary files /dev/null and b/assets/data/tool-ui/image_metadata_inspector.dat differ diff --git a/assets/data/tool-ui/image_processor.dat b/assets/data/tool-ui/image_processor.dat new file mode 100644 index 0000000..8bf0686 Binary files /dev/null and b/assets/data/tool-ui/image_processor.dat differ diff --git a/assets/data/tool-ui/indexed_rename_preview.dat b/assets/data/tool-ui/indexed_rename_preview.dat new file mode 100644 index 0000000..180b64a Binary files /dev/null and b/assets/data/tool-ui/indexed_rename_preview.dat differ diff --git a/assets/data/tool-ui/ip_info.dat b/assets/data/tool-ui/ip_info.dat new file mode 100644 index 0000000..3a0cf99 Binary files /dev/null and b/assets/data/tool-ui/ip_info.dat differ diff --git a/assets/data/tool-ui/ip_lookup.dat b/assets/data/tool-ui/ip_lookup.dat new file mode 100644 index 0000000..eef2ea9 Binary files /dev/null and b/assets/data/tool-ui/ip_lookup.dat differ diff --git a/assets/data/tool-ui/js_obfuscator.dat b/assets/data/tool-ui/js_obfuscator.dat new file mode 100644 index 0000000..90f5692 Binary files /dev/null and b/assets/data/tool-ui/js_obfuscator.dat differ diff --git a/assets/data/tool-ui/json_formatter.dat b/assets/data/tool-ui/json_formatter.dat new file mode 100644 index 0000000..b0b2b93 Binary files /dev/null and b/assets/data/tool-ui/json_formatter.dat differ diff --git a/assets/data/tool-ui/json_path_helper.dat b/assets/data/tool-ui/json_path_helper.dat new file mode 100644 index 0000000..48e0916 Binary files /dev/null and b/assets/data/tool-ui/json_path_helper.dat differ diff --git a/assets/data/tool-ui/jwt_decoder.dat b/assets/data/tool-ui/jwt_decoder.dat new file mode 100644 index 0000000..1ec58c0 Binary files /dev/null and b/assets/data/tool-ui/jwt_decoder.dat differ diff --git a/assets/data/tool-ui/key_value_converter.dat b/assets/data/tool-ui/key_value_converter.dat new file mode 100644 index 0000000..11958dc Binary files /dev/null and b/assets/data/tool-ui/key_value_converter.dat differ diff --git a/assets/data/tool-ui/keyword_counter.dat b/assets/data/tool-ui/keyword_counter.dat new file mode 100644 index 0000000..94f3cac Binary files /dev/null and b/assets/data/tool-ui/keyword_counter.dat differ diff --git a/assets/data/tool-ui/length_converter.dat b/assets/data/tool-ui/length_converter.dat new file mode 100644 index 0000000..0e1647d Binary files /dev/null and b/assets/data/tool-ui/length_converter.dat differ diff --git a/assets/data/tool-ui/line_column_transformer.dat b/assets/data/tool-ui/line_column_transformer.dat new file mode 100644 index 0000000..c774366 Binary files /dev/null and b/assets/data/tool-ui/line_column_transformer.dat differ diff --git a/assets/data/tool-ui/line_length_analyzer.dat b/assets/data/tool-ui/line_length_analyzer.dat new file mode 100644 index 0000000..6f47f65 Binary files /dev/null and b/assets/data/tool-ui/line_length_analyzer.dat differ diff --git a/assets/data/tool-ui/line_pair_zipper.dat b/assets/data/tool-ui/line_pair_zipper.dat new file mode 100644 index 0000000..c342b3e Binary files /dev/null and b/assets/data/tool-ui/line_pair_zipper.dat differ diff --git a/assets/data/tool-ui/list_chunker.dat b/assets/data/tool-ui/list_chunker.dat new file mode 100644 index 0000000..e5728e8 Binary files /dev/null and b/assets/data/tool-ui/list_chunker.dat differ diff --git a/assets/data/tool-ui/list_difference.dat b/assets/data/tool-ui/list_difference.dat new file mode 100644 index 0000000..d04ea92 Binary files /dev/null and b/assets/data/tool-ui/list_difference.dat differ diff --git a/assets/data/tool-ui/list_group_statistics.dat b/assets/data/tool-ui/list_group_statistics.dat new file mode 100644 index 0000000..10ce050 Binary files /dev/null and b/assets/data/tool-ui/list_group_statistics.dat differ diff --git a/assets/data/tool-ui/list_intersection.dat b/assets/data/tool-ui/list_intersection.dat new file mode 100644 index 0000000..c2073af Binary files /dev/null and b/assets/data/tool-ui/list_intersection.dat differ diff --git a/assets/data/tool-ui/list_sampler.dat b/assets/data/tool-ui/list_sampler.dat new file mode 100644 index 0000000..95185ac Binary files /dev/null and b/assets/data/tool-ui/list_sampler.dat differ diff --git a/assets/data/tool-ui/list_union.dat b/assets/data/tool-ui/list_union.dat new file mode 100644 index 0000000..cb93739 Binary files /dev/null and b/assets/data/tool-ui/list_union.dat differ diff --git a/assets/data/tool-ui/loan_emi_calculator.dat b/assets/data/tool-ui/loan_emi_calculator.dat new file mode 100644 index 0000000..401e3f8 Binary files /dev/null and b/assets/data/tool-ui/loan_emi_calculator.dat differ diff --git a/assets/data/tool-ui/magic_number_lookup.dat b/assets/data/tool-ui/magic_number_lookup.dat new file mode 100644 index 0000000..d6aff9f Binary files /dev/null and b/assets/data/tool-ui/magic_number_lookup.dat differ diff --git a/assets/data/tool-ui/manifest_deduplicator.dat b/assets/data/tool-ui/manifest_deduplicator.dat new file mode 100644 index 0000000..f978737 Binary files /dev/null and b/assets/data/tool-ui/manifest_deduplicator.dat differ diff --git a/assets/data/tool-ui/manifest_sorter.dat b/assets/data/tool-ui/manifest_sorter.dat new file mode 100644 index 0000000..a7cafab Binary files /dev/null and b/assets/data/tool-ui/manifest_sorter.dat differ diff --git a/assets/data/tool-ui/manifest_template_export.dat b/assets/data/tool-ui/manifest_template_export.dat new file mode 100644 index 0000000..49f4b20 Binary files /dev/null and b/assets/data/tool-ui/manifest_template_export.dat differ diff --git a/assets/data/tool-ui/markdown_list_cleaner.dat b/assets/data/tool-ui/markdown_list_cleaner.dat new file mode 100644 index 0000000..cedc97f Binary files /dev/null and b/assets/data/tool-ui/markdown_list_cleaner.dat differ diff --git a/assets/data/tool-ui/markdown_preview.dat b/assets/data/tool-ui/markdown_preview.dat new file mode 100644 index 0000000..563307a Binary files /dev/null and b/assets/data/tool-ui/markdown_preview.dat differ diff --git a/assets/data/tool-ui/markdown_table_normalizer.dat b/assets/data/tool-ui/markdown_table_normalizer.dat new file mode 100644 index 0000000..39a4433 Binary files /dev/null and b/assets/data/tool-ui/markdown_table_normalizer.dat differ diff --git a/assets/data/tool-ui/media_player.dat b/assets/data/tool-ui/media_player.dat new file mode 100644 index 0000000..5cb7bf0 Binary files /dev/null and b/assets/data/tool-ui/media_player.dat differ diff --git a/assets/data/tool-ui/median_calculator.dat b/assets/data/tool-ui/median_calculator.dat new file mode 100644 index 0000000..2d2829d Binary files /dev/null and b/assets/data/tool-ui/median_calculator.dat differ diff --git a/assets/data/tool-ui/mime_lookup.dat b/assets/data/tool-ui/mime_lookup.dat new file mode 100644 index 0000000..00d173d Binary files /dev/null and b/assets/data/tool-ui/mime_lookup.dat differ diff --git a/assets/data/tool-ui/movie_box_office.dat b/assets/data/tool-ui/movie_box_office.dat new file mode 100644 index 0000000..23c903d Binary files /dev/null and b/assets/data/tool-ui/movie_box_office.dat differ diff --git a/assets/data/tool-ui/music.dat b/assets/data/tool-ui/music.dat new file mode 100644 index 0000000..fcb9f35 Binary files /dev/null and b/assets/data/tool-ui/music.dat differ diff --git a/assets/data/tool-ui/nex_ace_optimize.dat b/assets/data/tool-ui/nex_ace_optimize.dat new file mode 100644 index 0000000..7fa7c8b Binary files /dev/null and b/assets/data/tool-ui/nex_ace_optimize.dat differ diff --git a/assets/data/tool-ui/nex_audio_eq.dat b/assets/data/tool-ui/nex_audio_eq.dat new file mode 100644 index 0000000..aa56ba3 Binary files /dev/null and b/assets/data/tool-ui/nex_audio_eq.dat differ diff --git a/assets/data/tool-ui/nex_crosshair.dat b/assets/data/tool-ui/nex_crosshair.dat new file mode 100644 index 0000000..a5462f1 Binary files /dev/null and b/assets/data/tool-ui/nex_crosshair.dat differ diff --git a/assets/data/tool-ui/nex_delta_force.dat b/assets/data/tool-ui/nex_delta_force.dat new file mode 100644 index 0000000..2875104 Binary files /dev/null and b/assets/data/tool-ui/nex_delta_force.dat differ diff --git a/assets/data/tool-ui/nex_disk_health.dat b/assets/data/tool-ui/nex_disk_health.dat new file mode 100644 index 0000000..3572239 Binary files /dev/null and b/assets/data/tool-ui/nex_disk_health.dat differ diff --git a/assets/data/tool-ui/nex_display_filter.dat b/assets/data/tool-ui/nex_display_filter.dat new file mode 100644 index 0000000..0de213e Binary files /dev/null and b/assets/data/tool-ui/nex_display_filter.dat differ diff --git a/assets/data/tool-ui/nex_epic_free.dat b/assets/data/tool-ui/nex_epic_free.dat new file mode 100644 index 0000000..9a2d28c Binary files /dev/null and b/assets/data/tool-ui/nex_epic_free.dat differ diff --git a/assets/data/tool-ui/nex_event_log_diagnostics.dat b/assets/data/tool-ui/nex_event_log_diagnostics.dat new file mode 100644 index 0000000..302ff2d Binary files /dev/null and b/assets/data/tool-ui/nex_event_log_diagnostics.dat differ diff --git a/assets/data/tool-ui/nex_file_lock_analysis.dat b/assets/data/tool-ui/nex_file_lock_analysis.dat new file mode 100644 index 0000000..ba2e804 Binary files /dev/null and b/assets/data/tool-ui/nex_file_lock_analysis.dat differ diff --git a/assets/data/tool-ui/nex_gpu_rename.dat b/assets/data/tool-ui/nex_gpu_rename.dat new file mode 100644 index 0000000..ff89ca9 Binary files /dev/null and b/assets/data/tool-ui/nex_gpu_rename.dat differ diff --git a/assets/data/tool-ui/nex_installed_apps.dat b/assets/data/tool-ui/nex_installed_apps.dat new file mode 100644 index 0000000..d37ceaf Binary files /dev/null and b/assets/data/tool-ui/nex_installed_apps.dat differ diff --git a/assets/data/tool-ui/nex_memory_cleanup.dat b/assets/data/tool-ui/nex_memory_cleanup.dat new file mode 100644 index 0000000..af9b93a Binary files /dev/null and b/assets/data/tool-ui/nex_memory_cleanup.dat differ diff --git a/assets/data/tool-ui/nex_memory_limit.dat b/assets/data/tool-ui/nex_memory_limit.dat new file mode 100644 index 0000000..d5aac54 Binary files /dev/null and b/assets/data/tool-ui/nex_memory_limit.dat differ diff --git a/assets/data/tool-ui/nex_mood.dat b/assets/data/tool-ui/nex_mood.dat new file mode 100644 index 0000000..45b4d5f Binary files /dev/null and b/assets/data/tool-ui/nex_mood.dat differ diff --git a/assets/data/tool-ui/nex_network_optimizer.dat b/assets/data/tool-ui/nex_network_optimizer.dat new file mode 100644 index 0000000..2c3a1ba Binary files /dev/null and b/assets/data/tool-ui/nex_network_optimizer.dat differ diff --git a/assets/data/tool-ui/nex_nvidia_driver.dat b/assets/data/tool-ui/nex_nvidia_driver.dat new file mode 100644 index 0000000..2323e9d Binary files /dev/null and b/assets/data/tool-ui/nex_nvidia_driver.dat differ diff --git a/assets/data/tool-ui/nex_optional_features.dat b/assets/data/tool-ui/nex_optional_features.dat new file mode 100644 index 0000000..7757b17 Binary files /dev/null and b/assets/data/tool-ui/nex_optional_features.dat differ diff --git a/assets/data/tool-ui/nex_other_gun_codes.dat b/assets/data/tool-ui/nex_other_gun_codes.dat new file mode 100644 index 0000000..f11b362 Binary files /dev/null and b/assets/data/tool-ui/nex_other_gun_codes.dat differ diff --git a/assets/data/tool-ui/nex_overlay.dat b/assets/data/tool-ui/nex_overlay.dat new file mode 100644 index 0000000..50c3d7a Binary files /dev/null and b/assets/data/tool-ui/nex_overlay.dat differ diff --git a/assets/data/tool-ui/nex_peripheral_optimize.dat b/assets/data/tool-ui/nex_peripheral_optimize.dat new file mode 100644 index 0000000..7f734cc Binary files /dev/null and b/assets/data/tool-ui/nex_peripheral_optimize.dat differ diff --git a/assets/data/tool-ui/nex_power_management.dat b/assets/data/tool-ui/nex_power_management.dat new file mode 100644 index 0000000..0e61b85 Binary files /dev/null and b/assets/data/tool-ui/nex_power_management.dat differ diff --git a/assets/data/tool-ui/nex_resolution_converter.dat b/assets/data/tool-ui/nex_resolution_converter.dat new file mode 100644 index 0000000..9b96dc8 Binary files /dev/null and b/assets/data/tool-ui/nex_resolution_converter.dat differ diff --git a/assets/data/tool-ui/nex_restore_points.dat b/assets/data/tool-ui/nex_restore_points.dat new file mode 100644 index 0000000..b0986a5 Binary files /dev/null and b/assets/data/tool-ui/nex_restore_points.dat differ diff --git a/assets/data/tool-ui/nex_shader_cache.dat b/assets/data/tool-ui/nex_shader_cache.dat new file mode 100644 index 0000000..9263f15 Binary files /dev/null and b/assets/data/tool-ui/nex_shader_cache.dat differ diff --git a/assets/data/tool-ui/nex_startup_manager.dat b/assets/data/tool-ui/nex_startup_manager.dat new file mode 100644 index 0000000..6fd8050 Binary files /dev/null and b/assets/data/tool-ui/nex_startup_manager.dat differ diff --git a/assets/data/tool-ui/nex_storage_clean.dat b/assets/data/tool-ui/nex_storage_clean.dat new file mode 100644 index 0000000..8170d6b Binary files /dev/null and b/assets/data/tool-ui/nex_storage_clean.dat differ diff --git a/assets/data/tool-ui/nex_system_optimizer.dat b/assets/data/tool-ui/nex_system_optimizer.dat new file mode 100644 index 0000000..c91827b Binary files /dev/null and b/assets/data/tool-ui/nex_system_optimizer.dat differ diff --git a/assets/data/tool-ui/nex_third_party_tools.dat b/assets/data/tool-ui/nex_third_party_tools.dat new file mode 100644 index 0000000..f1aaae4 Binary files /dev/null and b/assets/data/tool-ui/nex_third_party_tools.dat differ diff --git a/assets/data/tool-ui/nex_tray_island.dat b/assets/data/tool-ui/nex_tray_island.dat new file mode 100644 index 0000000..a72d04b Binary files /dev/null and b/assets/data/tool-ui/nex_tray_island.dat differ diff --git a/assets/data/tool-ui/nex_vertical_overlay.dat b/assets/data/tool-ui/nex_vertical_overlay.dat new file mode 100644 index 0000000..a6e06c3 Binary files /dev/null and b/assets/data/tool-ui/nex_vertical_overlay.dat differ diff --git a/assets/data/tool-ui/nex_windows_repair.dat b/assets/data/tool-ui/nex_windows_repair.dat new file mode 100644 index 0000000..2337b6c Binary files /dev/null and b/assets/data/tool-ui/nex_windows_repair.dat differ diff --git a/assets/data/tool-ui/nex_windows_update.dat b/assets/data/tool-ui/nex_windows_update.dat new file mode 100644 index 0000000..262bd12 Binary files /dev/null and b/assets/data/tool-ui/nex_windows_update.dat differ diff --git a/assets/data/tool-ui/number_base.dat b/assets/data/tool-ui/number_base.dat new file mode 100644 index 0000000..aa7564d Binary files /dev/null and b/assets/data/tool-ui/number_base.dat differ diff --git a/assets/data/tool-ui/number_base_converter.dat b/assets/data/tool-ui/number_base_converter.dat new file mode 100644 index 0000000..22c658f Binary files /dev/null and b/assets/data/tool-ui/number_base_converter.dat differ diff --git a/assets/data/tool-ui/oil_price.dat b/assets/data/tool-ui/oil_price.dat new file mode 100644 index 0000000..024e192 Binary files /dev/null and b/assets/data/tool-ui/oil_price.dat differ diff --git a/assets/data/tool-ui/optimization.dat b/assets/data/tool-ui/optimization.dat new file mode 100644 index 0000000..f458688 Binary files /dev/null and b/assets/data/tool-ui/optimization.dat differ diff --git a/assets/data/tool-ui/password_generator.dat b/assets/data/tool-ui/password_generator.dat new file mode 100644 index 0000000..7d466be Binary files /dev/null and b/assets/data/tool-ui/password_generator.dat differ diff --git a/assets/data/tool-ui/path_breakdown.dat b/assets/data/tool-ui/path_breakdown.dat new file mode 100644 index 0000000..c5c2668 Binary files /dev/null and b/assets/data/tool-ui/path_breakdown.dat differ diff --git a/assets/data/tool-ui/path_normalizer.dat b/assets/data/tool-ui/path_normalizer.dat new file mode 100644 index 0000000..a6ce35b Binary files /dev/null and b/assets/data/tool-ui/path_normalizer.dat differ diff --git a/assets/data/tool-ui/pc_benchmark.dat b/assets/data/tool-ui/pc_benchmark.dat new file mode 100644 index 0000000..96160f7 Binary files /dev/null and b/assets/data/tool-ui/pc_benchmark.dat differ diff --git a/assets/data/tool-ui/percentage_calculator.dat b/assets/data/tool-ui/percentage_calculator.dat new file mode 100644 index 0000000..7388256 Binary files /dev/null and b/assets/data/tool-ui/percentage_calculator.dat differ diff --git a/assets/data/tool-ui/percentage_change_calculator.dat b/assets/data/tool-ui/percentage_change_calculator.dat new file mode 100644 index 0000000..76d5f5d Binary files /dev/null and b/assets/data/tool-ui/percentage_change_calculator.dat differ diff --git a/assets/data/tool-ui/permutation_calculator.dat b/assets/data/tool-ui/permutation_calculator.dat new file mode 100644 index 0000000..5179bfd Binary files /dev/null and b/assets/data/tool-ui/permutation_calculator.dat differ diff --git a/assets/data/tool-ui/plugin-host.dat b/assets/data/tool-ui/plugin-host.dat new file mode 100644 index 0000000..d64ca32 Binary files /dev/null and b/assets/data/tool-ui/plugin-host.dat differ diff --git a/assets/data/tool-ui/port_lookup.dat b/assets/data/tool-ui/port_lookup.dat new file mode 100644 index 0000000..89378ba Binary files /dev/null and b/assets/data/tool-ui/port_lookup.dat differ diff --git a/assets/data/tool-ui/prefix_suffix_batch.dat b/assets/data/tool-ui/prefix_suffix_batch.dat new file mode 100644 index 0000000..ea8cff1 Binary files /dev/null and b/assets/data/tool-ui/prefix_suffix_batch.dat differ diff --git a/assets/data/tool-ui/profanity_check.dat b/assets/data/tool-ui/profanity_check.dat new file mode 100644 index 0000000..535270a Binary files /dev/null and b/assets/data/tool-ui/profanity_check.dat differ diff --git a/assets/data/tool-ui/punycode_codec.dat b/assets/data/tool-ui/punycode_codec.dat new file mode 100644 index 0000000..b6799b5 Binary files /dev/null and b/assets/data/tool-ui/punycode_codec.dat differ diff --git a/assets/data/tool-ui/qq_avatar.dat b/assets/data/tool-ui/qq_avatar.dat new file mode 100644 index 0000000..5f14233 Binary files /dev/null and b/assets/data/tool-ui/qq_avatar.dat differ diff --git a/assets/data/tool-ui/qr_generator.dat b/assets/data/tool-ui/qr_generator.dat new file mode 100644 index 0000000..a2785c5 Binary files /dev/null and b/assets/data/tool-ui/qr_generator.dat differ diff --git a/assets/data/tool-ui/qrcode_scanner.dat b/assets/data/tool-ui/qrcode_scanner.dat new file mode 100644 index 0000000..eef28e6 Binary files /dev/null and b/assets/data/tool-ui/qrcode_scanner.dat differ diff --git a/assets/data/tool-ui/query_builder.dat b/assets/data/tool-ui/query_builder.dat new file mode 100644 index 0000000..65e45a5 Binary files /dev/null and b/assets/data/tool-ui/query_builder.dat differ diff --git a/assets/data/tool-ui/random_cinema.dat b/assets/data/tool-ui/random_cinema.dat new file mode 100644 index 0000000..84a8535 Binary files /dev/null and b/assets/data/tool-ui/random_cinema.dat differ diff --git a/assets/data/tool-ui/random_generator.dat b/assets/data/tool-ui/random_generator.dat new file mode 100644 index 0000000..76e0edb Binary files /dev/null and b/assets/data/tool-ui/random_generator.dat differ diff --git a/assets/data/tool-ui/ratio_simplifier.dat b/assets/data/tool-ui/ratio_simplifier.dat new file mode 100644 index 0000000..f155a46 Binary files /dev/null and b/assets/data/tool-ui/ratio_simplifier.dat differ diff --git a/assets/data/tool-ui/rdap_domain_lookup.dat b/assets/data/tool-ui/rdap_domain_lookup.dat new file mode 100644 index 0000000..0dbcab7 Binary files /dev/null and b/assets/data/tool-ui/rdap_domain_lookup.dat differ diff --git a/assets/data/tool-ui/rdap_ip_lookup.dat b/assets/data/tool-ui/rdap_ip_lookup.dat new file mode 100644 index 0000000..e27c6b5 Binary files /dev/null and b/assets/data/tool-ui/rdap_ip_lookup.dat differ diff --git a/assets/data/tool-ui/regex_preset_lookup.dat b/assets/data/tool-ui/regex_preset_lookup.dat new file mode 100644 index 0000000..c87e5a2 Binary files /dev/null and b/assets/data/tool-ui/regex_preset_lookup.dat differ diff --git a/assets/data/tool-ui/regex_tool.dat b/assets/data/tool-ui/regex_tool.dat new file mode 100644 index 0000000..46db02d Binary files /dev/null and b/assets/data/tool-ui/regex_tool.dat differ diff --git a/assets/data/tool-ui/safe_browser.dat b/assets/data/tool-ui/safe_browser.dat new file mode 100644 index 0000000..0955443 Binary files /dev/null and b/assets/data/tool-ui/safe_browser.dat differ diff --git a/assets/data/tool-ui/sanguosha_skin.dat b/assets/data/tool-ui/sanguosha_skin.dat new file mode 100644 index 0000000..0277eab Binary files /dev/null and b/assets/data/tool-ui/sanguosha_skin.dat differ diff --git a/assets/data/tool-ui/serial_terminal.dat b/assets/data/tool-ui/serial_terminal.dat new file mode 100644 index 0000000..aadc81c Binary files /dev/null and b/assets/data/tool-ui/serial_terminal.dat differ diff --git a/assets/data/tool-ui/shelf_life.dat b/assets/data/tool-ui/shelf_life.dat new file mode 100644 index 0000000..2e26bba Binary files /dev/null and b/assets/data/tool-ui/shelf_life.dat differ diff --git a/assets/data/tool-ui/simple_interest_calculator.dat b/assets/data/tool-ui/simple_interest_calculator.dat new file mode 100644 index 0000000..0f6dec6 Binary files /dev/null and b/assets/data/tool-ui/simple_interest_calculator.dat differ diff --git a/assets/data/tool-ui/slug_generator.dat b/assets/data/tool-ui/slug_generator.dat new file mode 100644 index 0000000..140d4dd Binary files /dev/null and b/assets/data/tool-ui/slug_generator.dat differ diff --git a/assets/data/tool-ui/smart_search.dat b/assets/data/tool-ui/smart_search.dat new file mode 100644 index 0000000..7c5cf34 Binary files /dev/null and b/assets/data/tool-ui/smart_search.dat differ diff --git a/assets/data/tool-ui/speed_converter.dat b/assets/data/tool-ui/speed_converter.dat new file mode 100644 index 0000000..ce546c0 Binary files /dev/null and b/assets/data/tool-ui/speed_converter.dat differ diff --git a/assets/data/tool-ui/sql_formatter.dat b/assets/data/tool-ui/sql_formatter.dat new file mode 100644 index 0000000..f63f28f Binary files /dev/null and b/assets/data/tool-ui/sql_formatter.dat differ diff --git a/assets/data/tool-ui/system_info.dat b/assets/data/tool-ui/system_info.dat new file mode 100644 index 0000000..be7284b Binary files /dev/null and b/assets/data/tool-ui/system_info.dat differ diff --git a/assets/data/tool-ui/system_tool.dat b/assets/data/tool-ui/system_tool.dat new file mode 100644 index 0000000..71ecba0 Binary files /dev/null and b/assets/data/tool-ui/system_tool.dat differ diff --git a/assets/data/tool-ui/tax_calculator.dat b/assets/data/tool-ui/tax_calculator.dat new file mode 100644 index 0000000..c0e59ca Binary files /dev/null and b/assets/data/tool-ui/tax_calculator.dat differ diff --git a/assets/data/tool-ui/tech_news.dat b/assets/data/tool-ui/tech_news.dat new file mode 100644 index 0000000..fd1a734 Binary files /dev/null and b/assets/data/tool-ui/tech_news.dat differ diff --git a/assets/data/tool-ui/temperature_converter.dat b/assets/data/tool-ui/temperature_converter.dat new file mode 100644 index 0000000..6ef79b2 Binary files /dev/null and b/assets/data/tool-ui/temperature_converter.dat differ diff --git a/assets/data/tool-ui/template_filler.dat b/assets/data/tool-ui/template_filler.dat new file mode 100644 index 0000000..305ae22 Binary files /dev/null and b/assets/data/tool-ui/template_filler.dat differ diff --git a/assets/data/tool-ui/text_deduplicator.dat b/assets/data/tool-ui/text_deduplicator.dat new file mode 100644 index 0000000..ddbe3c7 Binary files /dev/null and b/assets/data/tool-ui/text_deduplicator.dat differ diff --git a/assets/data/tool-ui/text_diff.dat b/assets/data/tool-ui/text_diff.dat new file mode 100644 index 0000000..6b74f0c Binary files /dev/null and b/assets/data/tool-ui/text_diff.dat differ diff --git a/assets/data/tool-ui/text_filter.dat b/assets/data/tool-ui/text_filter.dat new file mode 100644 index 0000000..8d0af4e Binary files /dev/null and b/assets/data/tool-ui/text_filter.dat differ diff --git a/assets/data/tool-ui/text_merger.dat b/assets/data/tool-ui/text_merger.dat new file mode 100644 index 0000000..433a4aa Binary files /dev/null and b/assets/data/tool-ui/text_merger.dat differ diff --git a/assets/data/tool-ui/text_numbering.dat b/assets/data/tool-ui/text_numbering.dat new file mode 100644 index 0000000..c793ea7 Binary files /dev/null and b/assets/data/tool-ui/text_numbering.dat differ diff --git a/assets/data/tool-ui/text_reverser.dat b/assets/data/tool-ui/text_reverser.dat new file mode 100644 index 0000000..5f686ae Binary files /dev/null and b/assets/data/tool-ui/text_reverser.dat differ diff --git a/assets/data/tool-ui/text_sorter.dat b/assets/data/tool-ui/text_sorter.dat new file mode 100644 index 0000000..4b3b267 Binary files /dev/null and b/assets/data/tool-ui/text_sorter.dat differ diff --git a/assets/data/tool-ui/text_splitter.dat b/assets/data/tool-ui/text_splitter.dat new file mode 100644 index 0000000..508f4ca Binary files /dev/null and b/assets/data/tool-ui/text_splitter.dat differ diff --git a/assets/data/tool-ui/text_statistics.dat b/assets/data/tool-ui/text_statistics.dat new file mode 100644 index 0000000..cff05a1 Binary files /dev/null and b/assets/data/tool-ui/text_statistics.dat differ diff --git a/assets/data/tool-ui/text_trimmer.dat b/assets/data/tool-ui/text_trimmer.dat new file mode 100644 index 0000000..4786bff Binary files /dev/null and b/assets/data/tool-ui/text_trimmer.dat differ diff --git a/assets/data/tool-ui/time_duration_converter.dat b/assets/data/tool-ui/time_duration_converter.dat new file mode 100644 index 0000000..340a86d Binary files /dev/null and b/assets/data/tool-ui/time_duration_converter.dat differ diff --git a/assets/data/tool-ui/timestamp_converter.dat b/assets/data/tool-ui/timestamp_converter.dat new file mode 100644 index 0000000..4e20d65 Binary files /dev/null and b/assets/data/tool-ui/timestamp_converter.dat differ diff --git a/assets/data/tool-ui/timezone_abbr_lookup.dat b/assets/data/tool-ui/timezone_abbr_lookup.dat new file mode 100644 index 0000000..4ad984f Binary files /dev/null and b/assets/data/tool-ui/timezone_abbr_lookup.dat differ diff --git a/assets/data/tool-ui/totp_generator.dat b/assets/data/tool-ui/totp_generator.dat new file mode 100644 index 0000000..16da476 Binary files /dev/null and b/assets/data/tool-ui/totp_generator.dat differ diff --git a/assets/data/tool-ui/train_query.dat b/assets/data/tool-ui/train_query.dat new file mode 100644 index 0000000..99b5b6b Binary files /dev/null and b/assets/data/tool-ui/train_query.dat differ diff --git a/assets/data/tool-ui/ulid_generator.dat b/assets/data/tool-ui/ulid_generator.dat new file mode 100644 index 0000000..67f4216 Binary files /dev/null and b/assets/data/tool-ui/ulid_generator.dat differ diff --git a/assets/data/tool-ui/unicode_block_lookup.dat b/assets/data/tool-ui/unicode_block_lookup.dat new file mode 100644 index 0000000..b6f6389 Binary files /dev/null and b/assets/data/tool-ui/unicode_block_lookup.dat differ diff --git a/assets/data/tool-ui/unicode_codec.dat b/assets/data/tool-ui/unicode_codec.dat new file mode 100644 index 0000000..6946e1f Binary files /dev/null and b/assets/data/tool-ui/unicode_codec.dat differ diff --git a/assets/data/tool-ui/unit_converter.dat b/assets/data/tool-ui/unit_converter.dat new file mode 100644 index 0000000..87164f0 Binary files /dev/null and b/assets/data/tool-ui/unit_converter.dat differ diff --git a/assets/data/tool-ui/url_codec.dat b/assets/data/tool-ui/url_codec.dat new file mode 100644 index 0000000..a0ca94d Binary files /dev/null and b/assets/data/tool-ui/url_codec.dat differ diff --git a/assets/data/tool-ui/url_inspector.dat b/assets/data/tool-ui/url_inspector.dat new file mode 100644 index 0000000..e00b2e3 Binary files /dev/null and b/assets/data/tool-ui/url_inspector.dat differ diff --git a/assets/data/tool-ui/url_redirect_trace.dat b/assets/data/tool-ui/url_redirect_trace.dat new file mode 100644 index 0000000..5fa5063 Binary files /dev/null and b/assets/data/tool-ui/url_redirect_trace.dat differ diff --git a/assets/data/tool-ui/uuid_generator.dat b/assets/data/tool-ui/uuid_generator.dat new file mode 100644 index 0000000..93a9c46 Binary files /dev/null and b/assets/data/tool-ui/uuid_generator.dat differ diff --git a/assets/data/tool-ui/volume_converter.dat b/assets/data/tool-ui/volume_converter.dat new file mode 100644 index 0000000..b71e2d8 Binary files /dev/null and b/assets/data/tool-ui/volume_converter.dat differ diff --git a/assets/data/tool-ui/weather.dat b/assets/data/tool-ui/weather.dat new file mode 100644 index 0000000..0d51680 Binary files /dev/null and b/assets/data/tool-ui/weather.dat differ diff --git a/assets/data/tool-ui/weight_converter.dat b/assets/data/tool-ui/weight_converter.dat new file mode 100644 index 0000000..06939bf Binary files /dev/null and b/assets/data/tool-ui/weight_converter.dat differ diff --git a/assets/data/tool-ui/whitespace_normalizer.dat b/assets/data/tool-ui/whitespace_normalizer.dat new file mode 100644 index 0000000..f722155 Binary files /dev/null and b/assets/data/tool-ui/whitespace_normalizer.dat differ diff --git a/assets/data/tool-ui/workday_calculator.dat b/assets/data/tool-ui/workday_calculator.dat new file mode 100644 index 0000000..c85f4f3 Binary files /dev/null and b/assets/data/tool-ui/workday_calculator.dat differ diff --git a/assets/data/tool-ui/wx_domain_check.dat b/assets/data/tool-ui/wx_domain_check.dat new file mode 100644 index 0000000..6770201 Binary files /dev/null and b/assets/data/tool-ui/wx_domain_check.dat differ diff --git a/assets/data/tool-ui/xml_formatter.dat b/assets/data/tool-ui/xml_formatter.dat new file mode 100644 index 0000000..91d0e09 Binary files /dev/null and b/assets/data/tool-ui/xml_formatter.dat differ diff --git a/assets/data/tool-ui/yaml_json_converter.dat b/assets/data/tool-ui/yaml_json_converter.dat new file mode 100644 index 0000000..f647fff Binary files /dev/null and b/assets/data/tool-ui/yaml_json_converter.dat differ diff --git a/assets/data/tool-ui/ymhut_uutool_suite.dat b/assets/data/tool-ui/ymhut_uutool_suite.dat new file mode 100644 index 0000000..9f999d4 Binary files /dev/null and b/assets/data/tool-ui/ymhut_uutool_suite.dat differ diff --git a/assets/data/tool-ui/zhihu_hot.dat b/assets/data/tool-ui/zhihu_hot.dat new file mode 100644 index 0000000..c57ad9f Binary files /dev/null and b/assets/data/tool-ui/zhihu_hot.dat differ diff --git a/installer/YMhutBox-EULA.zh-CN.txt b/installer/YMhutBox-EULA.zh-CN.txt index 7daa498..3bb5b77 100644 --- a/installer/YMhutBox-EULA.zh-CN.txt +++ b/installer/YMhutBox-EULA.zh-CN.txt @@ -46,3 +46,13 @@ YMhut Box 软件许可与服务协议 八、联系与反馈 您可以通过 YMhut Box 内置反馈页面提交功能建议、问题报告或协议相关咨询。 + +九、网络音乐播放器特别声明 + +1. 网络音乐播放器仅供学习、研究和个人非商业使用。请尊重音乐作品、表演、录音、歌词、封面和视频的著作权及相关权利。 +2. 您不得利用本软件从事商业行为、公开传播、批量抓取、倒卖数据、绕过会员或地区限制,或以任何方式破坏、规避第三方平台的版权保护和访问控制。 +3. 酷狗数据由随包的 MoeKoeMusic API 与 KuGouMusicApi 修改组件承接。客户端启动的 API 仅绑定随机回环端口并由主程序内部令牌保护,不向插件、浏览器或外部网络公开;该端口不构成任何对第三方服务的授权或保证。 +4. API 对公共匿名幂等 GET 使用约两分钟缓存;登录、二维码、账户、会员权益、个人歌单、收藏、播放地址和写操作不使用缓存。POST 请求会附加时间戳以避免重复 URL 被缓存。缓存可能导致内容短暂延迟,账户能力以平台实时返回为准。 +5. 请勿频繁调用登录接口。登录状态存在时软件会优先使用本地 DPAPI 保护的登录快照,仅在账户功能需要且快照过期时尝试刷新;平台可能因异常频率、设备或网络环境实施风控。 +6. MoeKoeMusic 使用固定提交 4581660209c9cdd07669e8bd5bcbe136b7d91e02,适用 GPL-2.0;KuGouMusicApi 使用固定提交 06560e3e053bda1ab830750db6f645bab703f824,适用 MIT。对应源码、锁文件、许可证、原始声明和 YMhut 修改说明随包分发,并在第三方声明页面列出。 +7. 软件不承诺歌曲、歌词、封面、MV、播放地址、会员权益或地区可用性,也不提供任何绕过平台付费、地区或版权限制的功能。因第三方服务规则、账户状态、网络或版权变化导致的不可用由相应服务规则决定。 diff --git a/scripts/build-winui.ps1 b/scripts/build-winui.ps1 index f902fb4..ad28815 100644 --- a/scripts/build-winui.ps1 +++ b/scripts/build-winui.ps1 @@ -388,6 +388,30 @@ function Find-WindowsSdkTool([string] $Name) { ($candidates | Sort-Object FullName -Descending | Select-Object -First 1).FullName } +function Assert-PerMonitorV2Manifest([string] $Executable) { + if (-not (Test-Path -LiteralPath $Executable)) { + throw "DPI manifest validation target does not exist: $Executable" + } + + $mt = Find-WindowsSdkTool 'mt.exe' + if (-not $mt) { + throw 'Windows SDK mt.exe was not found, so the PerMonitorV2 application manifest cannot be validated.' + } + + $manifestPath = Join-Path ([IO.Path]::GetTempPath()) ("ymhut-dpi-{0}.manifest" -f [Guid]::NewGuid().ToString('N')) + try { + Invoke-ToolQuiet $mt @("-inputresource:$Executable;#1", "-out:$manifestPath") 'DPI manifest extraction failed' + $manifest = Get-Content -LiteralPath $manifestPath -Raw -Encoding UTF8 + if ($manifest -notmatch ']*>\s*PerMonitorV2\s*' -or + $manifest -notmatch ']*>\s*true/pm\s*') { + throw "Executable is missing the required PerMonitorV2 DPI declarations: $Executable" + } + Write-Host " DPI manifest: PerMonitorV2 ($Executable)" + } finally { + Remove-Item -LiteralPath $manifestPath -Force -ErrorAction SilentlyContinue + } +} + function Find-InnoSetupCompiler { $envCandidates = @() if ($env:YMHUT_INNO_SETUP) { @@ -1221,11 +1245,54 @@ function Remove-RootHelperDuplicates([string] $Directory) { } } +function Assert-MusicApiPayload([string] $Directory) { + $required = @( + 'music-api\node.exe', + 'music-api\NODE_LICENSE', + 'music-api\MOEKOE_LICENSE', + 'music-api\UPSTREAM_COMMIT', + 'music-api\API_SUBMODULE_COMMIT', + 'music-api\YMhut_PATCHES.md', + 'music-api\api\ymhut-sidecar.js', + 'music-api\api\server.js', + 'music-api\api\package.json', + 'music-api\api\pnpm-lock.yaml', + 'music-api\api\LICENSE', + 'music-api\api\README.md', + 'music-api\api\node_modules\express\package.json' + ) + $missing = $required | Where-Object { -not (Test-Path -LiteralPath (Join-Path $Directory $_) -PathType Leaf) } + if ($missing.Count -gt 0) { + throw "Release music-api payload is incomplete in '$Directory': $($missing -join ', ')" + } +} + +function Assert-ToolUiPayload([string] $Directory) { + $folder = Join-Path $Directory 'Assets\data\tool-ui' + if (-not (Test-Path -LiteralPath $folder -PathType Container)) { + throw "Release tool UI payload is missing: $folder" + } + + $files = @(Get-ChildItem -LiteralPath $folder -Filter '*.dat' -File -ErrorAction SilentlyContinue) + if ($files.Count -lt 202) { + throw "Release tool UI payload is incomplete in '$Directory': expected at least 202 .dat definitions, found $($files.Count)" + } + + foreach ($file in $files) { + $bytes = [IO.File]::ReadAllBytes($file.FullName) + if ($bytes.Length -lt 60 -or [Text.Encoding]::ASCII.GetString($bytes, 0, 8) -ne 'YMHUTUI1' -or $bytes[8] -ne 2) { + throw "Tool UI definition has an invalid header: $($file.FullName)" + } + } +} + function Copy-PublishToLatest { Stop-ProcessesFromDirectory $LatestRoot Reset-DirectoryInsideRepo $LatestRoot Copy-Item -Path (Join-Path $PublishRoot '*') -Destination $LatestRoot -Recurse -Force Normalize-PublishLayout $LatestRoot + Assert-MusicApiPayload $LatestRoot + Assert-ToolUiPayload $LatestRoot Write-LayoutManifests $LatestRoot } @@ -1245,6 +1312,9 @@ function Publish-UnpackagedApp([object] $VersionInfo) { '-o', $PublishRoot ) Normalize-PublishLayout $PublishRoot + Assert-MusicApiPayload $PublishRoot + Assert-ToolUiPayload $PublishRoot + Assert-PerMonitorV2Manifest (Join-Path $PublishRoot 'YMhutBox.exe') Write-LayoutManifests $PublishRoot Copy-PublishToLatest } @@ -1311,6 +1381,7 @@ function Build-InstallerBootstrap([object] $VersionInfo, [string] $SignTool) { if ($SignTool) { Sign-Artifact $SignTool $setupPath } + Assert-PerMonitorV2Manifest $setupPath Invoke-ToolQuiet $setupPath @('/SELFTEST') 'WinUI installer bootstrap self-test failed' " Installer self-test: $setupPath" Invoke-ToolQuiet $setupPath @('/WINDOWSELFTEST') 'WinUI installer window navigation self-test failed' " Installer window self-test: $setupPath" @@ -1430,6 +1501,9 @@ function Build-MsixPackage([object] $VersionInfo, [string] $MakeAppx, [string] $ Reset-DirectoryInsideRepo $MsixStageRoot Copy-Item -Path (Join-Path $PublishRoot '*') -Destination $MsixStageRoot -Recurse -Force + Assert-MusicApiPayload $MsixStageRoot + Assert-ToolUiPayload $MsixStageRoot + Assert-PerMonitorV2Manifest (Join-Path $MsixStageRoot 'YMhutBox.exe') Expand-SatelliteResourcePackages $MsixStageRoot -RemovePackages Restore-LangResourceLayoutForMsix $MsixStageRoot Write-AppxManifest $MsixStageRoot $VersionInfo.PackageVersion @@ -1442,7 +1516,7 @@ function Build-MsixPackage([object] $VersionInfo, [string] $MakeAppx, [string] $ $stageAssets = Join-Path $MsixStageRoot 'Assets' New-Directory $stageAssets - Copy-Item -LiteralPath (Join-Path $ProjectAssets '*') -Destination $stageAssets -Recurse -Force + Copy-Item -Path (Join-Path $ProjectAssets '*') -Destination $stageAssets -Recurse -Force Repair-MsixStageThirdPartyPayloads Invoke-ToolQuiet $MakeAppx @('pack', '/d', $MsixStageRoot, '/p', $msixPath, '/o') 'MakeAppx packaging failed' " MSIX package: $msixPath" diff --git a/scripts/generate-tool-ui-dat.ps1 b/scripts/generate-tool-ui-dat.ps1 new file mode 100644 index 0000000..5a34285 --- /dev/null +++ b/scripts/generate-tool-ui-dat.ps1 @@ -0,0 +1,221 @@ +param( + [string]$Root = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path +) + +$ErrorActionPreference = 'Stop' + +$catalogPath = Join-Path $Root 'src\YMhut.Box.Core\Tools\ToolCatalog.cs' +$nexPath = Join-Path $Root 'src\YMhut.Box.Core\Tools\NexNativeTools.cs' +$outputRoot = Join-Path $Root 'assets\data\tool-ui' +New-Item -ItemType Directory -Force -Path $outputRoot | Out-Null + +$catalogText = Get-Content -LiteralPath $catalogPath -Raw -Encoding UTF8 +$rawMatch = [regex]::Match($catalogText, 'private const string RawToolData = """(?.*?)""";', [Text.RegularExpressions.RegexOptions]::Singleline) +if (-not $rawMatch.Success) { throw 'RawToolData was not found.' } + +$ids = [Collections.Generic.HashSet[string]]::new([StringComparer]::OrdinalIgnoreCase) +$metadata = @{} +foreach ($line in ($rawMatch.Groups['data'].Value -split "`r?`n")) { + if ([string]::IsNullOrWhiteSpace($line)) { continue } + $parts = $line -split "`t" + if ($parts.Count -lt 4) { continue } + $id = $parts[0].Trim() + if ([string]::IsNullOrWhiteSpace($id)) { continue } + [void]$ids.Add($id) + $metadata[$id] = [ordered]@{ + zh = $parts[1].Trim() + en = $parts[1].Trim() + descriptionZh = $parts[2].Trim() + descriptionEn = $parts[2].Trim() + category = $parts[3].Trim() + offline = ($parts.Count -gt 4 -and $parts[4].Trim() -eq 'true') + } +} + +foreach ($match in [regex]::Matches((Get-Content -LiteralPath $nexPath -Raw -Encoding UTF8), 'Tool\("(?[^"]+)"')) { + $id = $match.Groups['id'].Value + [void]$ids.Add($id) + if (-not $metadata.ContainsKey($id)) { + $metadata[$id] = [ordered]@{ zh = $id; en = $id; descriptionZh = ''; descriptionEn = ''; category = 'system'; offline = $true } + } +} +[void]$ids.Add('dev_environment_config') +if (-not $metadata.ContainsKey('dev_environment_config')) { + $metadata['dev_environment_config'] = [ordered]@{ zh = 'Development environment'; en = 'Development environment'; descriptionZh = 'Inspect and configure the local development environment.'; descriptionEn = 'Inspect and configure the local development environment.'; category = 'dev'; offline = $false } +} +[void]$ids.Add('plugin-host') +$metadata['plugin-host'] = [ordered]@{ zh = '插件安全宿主'; en = 'Plugin security host'; descriptionZh = '隔离第三方 WebView 内容、权限和运行状态。'; descriptionEn = 'Isolates third-party WebView content, permissions, and runtime status.'; category = 'plugin'; offline = $false } +[void]$ids.Add('external-tool-host') +$metadata['external-tool-host'] = [ordered]@{ zh = '外部工具宿主'; en = 'External tool host'; descriptionZh = '显示外部程序来源、风险、启动选项和运行结果。'; descriptionEn = 'Shows source, risk, launch options, and results for external programs.'; category = 'external'; offline = $true } + +$sha = [Security.Cryptography.SHA256]::Create() +try { $keyBytes = $sha.ComputeHash([Text.Encoding]::UTF8.GetBytes('YMhut.Box.ToolUiDefinition.v1')) } finally { $sha.Dispose() } +$aes = [Security.Cryptography.Aes]::Create() +try { + $aes.Key = $keyBytes + $aes.Mode = [Security.Cryptography.CipherMode]::CBC + $aes.Padding = [Security.Cryptography.PaddingMode]::PKCS7 + foreach ($id in ($ids | Sort-Object)) { + $meta = $metadata[$id] + $category = [string]$meta.category + $risk = if ($category -in @('security', 'system', 'plugin', 'external')) { 'high' } else { 'normal' } + $primaryKind = switch ($category) { + 'image' { 'FilePicker'; break } + 'calculator' { 'Number'; break } + 'network' { 'Query'; break } + 'security' { 'MultilineText'; break } + 'text' { 'MultilineText'; break } + 'dev' { 'MultilineText'; break } + 'plugin' { 'WebView'; break } + 'external' { 'ExternalSurface'; break } + default { 'Text' } + } + + $maxLength = 4096 + if ($category -eq 'text' -or $category -eq 'dev' -or $category -eq 'security') { $maxLength = 200000 } + $placeholder = '输入此工具所需的值' + if ($category -eq 'network') { $placeholder = '关键词、URL、域名或 IP' } + $primaryControls = [Collections.Generic.List[object]]::new() + $primaryControls.Add([ordered]@{ + id = 'primary' + kind = $primaryKind + label = [ordered]@{ zh = '主要输入'; en = 'Primary input' } + placeholder = $placeholder + defaultValue = '' + required = $false + isReadOnly = $false + validation = [ordered]@{ maxLength = $maxLength } + }) + + $sections = [Collections.Generic.List[object]]::new() + $primaryTitle = switch ($category) { + 'calculator' { [ordered]@{ zh = '计算参数'; en = 'Calculation parameters' } } + 'network' { [ordered]@{ zh = '查询条件'; en = 'Query criteria' } } + 'image' { [ordered]@{ zh = '文件与媒体'; en = 'Files and media' } } + 'security' { [ordered]@{ zh = '安全输入'; en = 'Security input' } } + 'dev' { [ordered]@{ zh = '代码与数据'; en = 'Code and data' } } + 'text' { [ordered]@{ zh = '文本工作区'; en = 'Text workspace' } } + 'system' { [ordered]@{ zh = '系统入口'; en = 'System entry' } } + 'plugin' { [ordered]@{ zh = '插件安全容器'; en = 'Plugin security container' } } + 'external' { [ordered]@{ zh = '外部程序运行'; en = 'External program launch' } } + default { [ordered]@{ zh = '主要操作'; en = 'Primary operation' } } + } + + if ($category -eq 'calculator') { + $primaryControls.Clear() + foreach ($numberId in @('number-primary', 'number-secondary', 'number-third', 'number-fourth')) { + $primaryControls.Add([ordered]@{ id = $numberId; kind = 'Number'; label = [ordered]@{ zh = '数值参数'; en = 'Numeric parameter' }; defaultValue = '1'; required = $true; isReadOnly = $false; validation = [ordered]@{ minimum = -100000000; maximum = 100000000 } }) + } + } elseif ($category -eq 'network') { + $primaryControls.Add([ordered]@{ id = 'parameter'; kind = 'ComboBox'; label = [ordered]@{ zh = '来源或分类'; en = 'Source or category' }; defaultValue = ''; required = $false; isReadOnly = $false }) + } elseif ($category -eq 'image') { + $primaryControls.Add([ordered]@{ id = 'file'; kind = 'FilePicker'; label = [ordered]@{ zh = '文件'; en = 'File' }; placeholder = '选择本地文件'; defaultValue = ''; required = $false; isReadOnly = $false }) + } + + $sections.Add([ordered]@{ + id = 'primary' + title = $primaryTitle + description = [ordered]@{ zh = [string]$meta.descriptionZh; en = [string]$meta.descriptionEn } + controls = @($primaryControls) + isAdvanced = $false + layout = $(if ($category -eq 'calculator') { 'grid' } else { 'stack' }) + }) + + if ($category -in @('text', 'dev', 'security', 'network', 'design')) { + $advancedControls = [Collections.Generic.List[object]]::new() + if ($category -in @('text', 'dev', 'security')) { + $advancedControls.Add([ordered]@{ id = 'rules'; kind = 'ComboBox'; label = [ordered]@{ zh = '处理规则'; en = 'Processing rules' }; defaultValue = ''; required = $false; isReadOnly = $false }) + $advancedControls.Add([ordered]@{ id = 'auxiliary'; kind = 'Text'; label = [ordered]@{ zh = '附加参数'; en = 'Additional parameter' }; defaultValue = ''; required = $false; isReadOnly = $false }) + } elseif ($category -eq 'network') { + $advancedControls.Add([ordered]@{ id = 'rules'; kind = 'ComboBox'; label = [ordered]@{ zh = '筛选与显示'; en = 'Filtering and display' }; defaultValue = ''; required = $false; isReadOnly = $false }) + } else { + $advancedControls.Add([ordered]@{ id = 'rules'; kind = 'ComboBox'; label = [ordered]@{ zh = '预览设置'; en = 'Preview settings' }; defaultValue = ''; required = $false; isReadOnly = $false }) + } + $advancedControls.Add([ordered]@{ id = 'advanced-toggle'; kind = 'Toggle'; label = [ordered]@{ zh = '启用高级选项'; en = 'Enable advanced options' }; defaultValue = 'false'; required = $false; isReadOnly = $false }) + $sections.Add([ordered]@{ + id = 'advanced' + title = [ordered]@{ zh = '高级选项'; en = 'Advanced options' } + description = [ordered]@{ zh = '按需展开,不改变默认安全行为。'; en = 'Expand when needed without changing the safe defaults.' } + controls = @($advancedControls) + isAdvanced = $true + layout = 'stack' + }) + } + + $resultKind = switch ($category) { + 'calculator' { 'calculator-table' } + 'image' { 'image-preview' } + 'data' { 'ranked-list' } + 'network' { 'link-cards' } + 'dev' { if ($id -like '*json*') { 'json-tree' } else { 'code-preview' } } + 'security' { 'status-list' } + 'system' { 'system-cards' } + 'plugin' { 'status-list' } + 'external' { 'status-list' } + default { 'text' } + } + $actions = [Collections.Generic.List[object]]::new() + $actionLabel = switch ($category) { + 'calculator' { [ordered]@{ zh = '计算'; en = 'Calculate' } } + 'network' { [ordered]@{ zh = '查询'; en = 'Query' } } + 'image' { [ordered]@{ zh = '处理'; en = 'Process' } } + 'security' { [ordered]@{ zh = '分析'; en = 'Analyze' } } + 'dev' { [ordered]@{ zh = '运行'; en = 'Run' } } + default { [ordered]@{ zh = '执行'; en = 'Run' } } + } + if ($category -eq 'plugin') { + $actions.Add([ordered]@{ id = 'reload'; label = [ordered]@{ zh = '安全重新加载'; en = 'Safe reload' }; requiresConfirmation = $false; isEnabled = $true }) + $actions.Add([ordered]@{ id = 'cancel'; label = [ordered]@{ zh = '停用'; en = 'Disable' }; requiresConfirmation = $true; isEnabled = $true }) + } elseif ($category -eq 'external') { + $actions.Add([ordered]@{ id = 'run'; label = [ordered]@{ zh = '启动'; en = 'Launch' }; requiresConfirmation = $true; isEnabled = $true }) + } else { + $actions.Add([ordered]@{ id = 'run'; label = $actionLabel; requiresConfirmation = ($risk -eq 'high'); isEnabled = $true }) + if ($category -eq 'image') { $actions.Add([ordered]@{ id = 'choose-file'; label = [ordered]@{ zh = '选择文件'; en = 'Choose file' }; requiresConfirmation = $false; isEnabled = $true }) } + $actions.Add([ordered]@{ id = 'clear'; label = [ordered]@{ zh = '清空'; en = 'Clear' }; requiresConfirmation = $false; isEnabled = $true }) + $actions.Add([ordered]@{ id = 'copy-result'; label = [ordered]@{ zh = '复制结果'; en = 'Copy result' }; requiresConfirmation = $false; isEnabled = $true }) + } + + $definition = [ordered]@{ + toolId = $id + schemaVersion = 1 + title = [ordered]@{ zh = [string]$meta.zh; en = [string]$meta.en } + description = [ordered]@{ zh = [string]$meta.descriptionZh; en = [string]$meta.descriptionEn } + riskLevel = $risk + capabilities = @($(if ($meta.offline) { 'offline' } else { 'network' })) + sections = @($sections) + actions = @($actions) + result = [ordered]@{ kind = $resultKind; title = [ordered]@{ zh = '结果'; en = 'Result' }; isScrollable = $true; isCopyable = $true } + isFallback = $false + diagnostic = $null + responsiveHint = [ordered]@{ zh = '窄屏自动单列,宽屏采用输入与结果双栏。'; en = 'Narrow layouts stack controls; wide layouts use input and result columns.' } + advancedExpandedByDefault = $false + } + $json = [Text.Encoding]::UTF8.GetBytes(($definition | ConvertTo-Json -Depth 10 -Compress)) + $toolIdBytes = [Text.Encoding]::UTF8.GetBytes($id) + if ($toolIdBytes.Length -eq 0 -or $toolIdBytes.Length -gt 512) { throw "Tool ID length is invalid: $id" } + $digest = [Security.Cryptography.SHA256]::Create() + try { $digestBytes = $digest.ComputeHash($json) } finally { $digest.Dispose() } + $aes.GenerateIV() + $encryptor = $aes.CreateEncryptor() + try { $cipher = $encryptor.TransformFinalBlock($json, 0, $json.Length) } finally { $encryptor.Dispose() } + $magic = [Text.Encoding]::ASCII.GetBytes('YMHUTUI1') + $output = [byte[]]::new($magic.Length + 1 + 2 + $toolIdBytes.Length + $digestBytes.Length + $aes.IV.Length + $cipher.Length) + [Array]::Copy($magic, 0, $output, 0, $magic.Length) + $output[$magic.Length] = 2 + $lengthBytes = [BitConverter]::GetBytes([uint16]$toolIdBytes.Length) + [Array]::Copy($lengthBytes, 0, $output, $magic.Length + 1, 2) + $offset = $magic.Length + 3 + [Array]::Copy($toolIdBytes, 0, $output, $offset, $toolIdBytes.Length) + $offset += $toolIdBytes.Length + [Array]::Copy($digestBytes, 0, $output, $offset, $digestBytes.Length) + $offset += $digestBytes.Length + [Array]::Copy($aes.IV, 0, $output, $offset, $aes.IV.Length) + $offset += $aes.IV.Length + [Array]::Copy($cipher, 0, $output, $offset, $cipher.Length) + [IO.File]::WriteAllBytes((Join-Path $outputRoot "$id.dat"), $output) + } +} finally { + $aes.Dispose() +} + +Write-Host "Generated $($ids.Count) tool UI definitions in $outputRoot" diff --git a/scripts/prepare-music-api.ps1 b/scripts/prepare-music-api.ps1 new file mode 100644 index 0000000..d3781ae --- /dev/null +++ b/scripts/prepare-music-api.ps1 @@ -0,0 +1,130 @@ +param( + [string]$Destination, + [string]$NodeVersion = '22.18.0', + [switch]$Force +) + +$ErrorActionPreference = 'Stop' +function Get-Sha256Hex([string]$Path) { + $stream = [IO.File]::OpenRead($Path) + $algorithm = [Security.Cryptography.SHA256]::Create() + try { + return ([BitConverter]::ToString($algorithm.ComputeHash($stream))).Replace('-', '') + } finally { + $algorithm.Dispose() + $stream.Dispose() + } +} + +$RepoRoot = Split-Path -Parent $PSScriptRoot +$SourceRoot = Join-Path $RepoRoot 'third_party\MoeKoeMusic' +$ApiSource = Join-Path $SourceRoot 'api' +if ([string]::IsNullOrWhiteSpace($Destination)) { + $Destination = Join-Path $RepoRoot 'build\music-api' +} +$Destination = [IO.Path]::GetFullPath($Destination) +$BuildRoot = [IO.Path]::GetFullPath((Join-Path $RepoRoot 'build')) +if (-not $Destination.StartsWith($BuildRoot + [IO.Path]::DirectorySeparatorChar, [StringComparison]::OrdinalIgnoreCase)) { + throw "Music API destination must be inside $BuildRoot" +} + +$requiredSource = @( + (Join-Path $SourceRoot 'UPSTREAM_COMMIT'), + (Join-Path $SourceRoot 'API_SUBMODULE_COMMIT'), + (Join-Path $SourceRoot 'MOEKOE_LICENSE'), + (Join-Path $SourceRoot 'MOEKOE_README.md'), + (Join-Path $ApiSource 'package.json'), + (Join-Path $ApiSource 'pnpm-lock.yaml'), + (Join-Path $ApiSource 'LICENSE'), + (Join-Path $ApiSource 'README.md'), + (Join-Path $ApiSource 'ymhut-sidecar.js') +) +foreach ($path in $requiredSource) { + if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { throw "Required music API source is missing: $path" } +} + +$fingerprintLines = Get-ChildItem -LiteralPath $SourceRoot -Recurse -File | + Where-Object { $_.FullName -notlike '*\node_modules\*' } | + Sort-Object FullName | + ForEach-Object { + $relative = $_.FullName.Substring($SourceRoot.TrimEnd('\').Length + 1).Replace('\', '/') + "$relative|$(Get-Sha256Hex $_.FullName)" + } +$fingerprintBytes = [Text.Encoding]::UTF8.GetBytes(($fingerprintLines -join "`n")) +$sha256 = [Security.Cryptography.SHA256]::Create() +try { + $fingerprint = ([BitConverter]::ToString($sha256.ComputeHash($fingerprintBytes))).Replace('-', '') +} finally { + $sha256.Dispose() +} +$markerPath = Join-Path $Destination 'payload.json' +if (-not $Force -and (Test-Path -LiteralPath $markerPath)) { + try { + $marker = Get-Content -LiteralPath $markerPath -Raw | ConvertFrom-Json + if ($marker.nodeVersion -eq $NodeVersion -and $marker.sourceFingerprint -eq $fingerprint -and + (Test-Path -LiteralPath (Join-Path $Destination 'node.exe')) -and + (Test-Path -LiteralPath (Join-Path $Destination 'api\node_modules\express\package.json') -PathType Leaf) -and + (Test-Path -LiteralPath (Join-Path $Destination 'api\pnpm-lock.yaml')) -and + (Test-Path -LiteralPath (Join-Path $Destination 'api\LICENSE'))) { + return + } + } catch { + } +} + +$CacheRoot = Join-Path $RepoRoot '.cache\node-runtime' +New-Item -ItemType Directory -Force -Path $CacheRoot | Out-Null +$archiveName = "node-v$NodeVersion-win-x64.zip" +$archivePath = Join-Path $CacheRoot $archiveName +$checksumsPath = Join-Path $CacheRoot "SHASUMS256-$NodeVersion.txt" +$distRoot = "https://nodejs.org/dist/v$NodeVersion" +if (-not (Test-Path -LiteralPath $archivePath)) { + Invoke-WebRequest -UseBasicParsing "$distRoot/$archiveName" -OutFile $archivePath +} +if (-not (Test-Path -LiteralPath $checksumsPath)) { + Invoke-WebRequest -UseBasicParsing "$distRoot/SHASUMS256.txt" -OutFile $checksumsPath +} +$checksumLine = Get-Content -LiteralPath $checksumsPath | Where-Object { $_ -match "\s$([regex]::Escape($archiveName))$" } | Select-Object -First 1 +if (-not $checksumLine) { throw "Node checksum was not found for $archiveName" } +$expectedHash = ($checksumLine -split '\s+')[0].ToUpperInvariant() +$actualHash = (Get-Sha256Hex $archivePath).ToUpperInvariant() +if ($actualHash -ne $expectedHash) { throw "Node runtime checksum mismatch for $archiveName" } + +$staging = Join-Path $BuildRoot ("music-api.staging." + $PID) +if (Test-Path -LiteralPath $staging) { Remove-Item -LiteralPath $staging -Recurse -Force } +New-Item -ItemType Directory -Force -Path $staging | Out-Null +$extractRoot = Join-Path $staging '_node' +Expand-Archive -LiteralPath $archivePath -DestinationPath $extractRoot -Force +$nodeRoot = Join-Path $extractRoot "node-v$NodeVersion-win-x64" +Copy-Item -LiteralPath (Join-Path $nodeRoot 'node.exe') -Destination (Join-Path $staging 'node.exe') +Copy-Item -LiteralPath (Join-Path $nodeRoot 'LICENSE') -Destination (Join-Path $staging 'NODE_LICENSE') +Copy-Item -LiteralPath (Join-Path $nodeRoot 'README.md') -Destination (Join-Path $staging 'NODE_README.md') +Remove-Item -LiteralPath $extractRoot -Recurse -Force + +$apiDestination = Join-Path $staging 'api' +robocopy $ApiSource $apiDestination /E /XD node_modules .git /NFL /NDL /NJH /NJS /NP | Out-Null +if ($LASTEXITCODE -ge 8) { throw "Failed to copy music API source (robocopy exit $LASTEXITCODE)." } +Copy-Item -LiteralPath (Join-Path $SourceRoot 'MOEKOE_LICENSE') -Destination (Join-Path $staging 'MOEKOE_LICENSE') +Copy-Item -LiteralPath (Join-Path $SourceRoot 'MOEKOE_README.md') -Destination (Join-Path $staging 'MOEKOE_README.md') +Copy-Item -LiteralPath (Join-Path $SourceRoot 'UPSTREAM_COMMIT') -Destination (Join-Path $staging 'UPSTREAM_COMMIT') +Copy-Item -LiteralPath (Join-Path $SourceRoot 'API_SUBMODULE_COMMIT') -Destination (Join-Path $staging 'API_SUBMODULE_COMMIT') +Copy-Item -LiteralPath (Join-Path $SourceRoot 'YMhut_PATCHES.md') -Destination (Join-Path $staging 'YMhut_PATCHES.md') + +Push-Location $apiDestination +try { + & corepack pnpm install --prod --frozen-lockfile --ignore-scripts --package-import-method=copy --config.node-linker=hoisted --store-dir (Join-Path $RepoRoot '.cache\pnpm-store-music') + if ($LASTEXITCODE -ne 0) { throw "pnpm failed to install the locked music API dependencies." } +} finally { + Pop-Location +} + +[ordered]@{ + protocolVersion = 1 + moekoeCommit = '4581660209c9cdd07669e8bd5bcbe136b7d91e02' + apiCommit = '06560e3e053bda1ab830750db6f645bab703f824' + nodeVersion = $NodeVersion + sourceFingerprint = $fingerprint +} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $staging 'payload.json') -Encoding utf8 + +if (Test-Path -LiteralPath $Destination) { Remove-Item -LiteralPath $Destination -Recurse -Force } +Move-Item -LiteralPath $staging -Destination $Destination diff --git a/src/YMhut.Box.Core/App/OpenSourceReferenceService.cs b/src/YMhut.Box.Core/App/OpenSourceReferenceService.cs index e513607..1a646f2 100644 --- a/src/YMhut.Box.Core/App/OpenSourceReferenceService.cs +++ b/src/YMhut.Box.Core/App/OpenSourceReferenceService.cs @@ -9,7 +9,9 @@ public sealed record OpenSourceReferenceItem( string Version, string Usage, string Attribution, - string Path = ""); + string Path = "", + string SourceUrl = "", + string LicensePath = ""); public interface IOpenSourceReferenceService { @@ -50,6 +52,8 @@ public sealed class OpenSourceReferenceService(AppPaths paths, ILogService? logS "Microsoft and .NET contributors retain their original rights.") }; + AddMusicApiReferences(references); + await AddPackageReferencesSafelyAsync(references, cancellationToken).ConfigureAwait(false); await AddBundledToolNoticesSafelyAsync(references, cancellationToken).ConfigureAwait(false); @@ -67,6 +71,75 @@ public sealed class OpenSourceReferenceService(AppPaths paths, ILogService? logS .ToArray(); } + private void AddMusicApiReferences(List references) + { + var moekoeLicense = FindReferenceFile("music-api/MOEKOE_LICENSE", "third_party/MoeKoeMusic/MOEKOE_LICENSE"); + var moekoeReadme = FindReferenceFile("music-api/MOEKOE_README.md", "third_party/MoeKoeMusic/MOEKOE_README.md"); + var apiLicense = FindReferenceFile("music-api/api/LICENSE", "third_party/MoeKoeMusic/api/LICENSE"); + var apiReadme = FindReferenceFile("music-api/api/README.md", "third_party/MoeKoeMusic/api/README.md"); + var nodeLicense = FindReferenceFile("music-api/NODE_LICENSE"); + var packageJson = FindReferenceFile("music-api/api/package.json", "third_party/MoeKoeMusic/api/package.json"); + var thirdPartyNotices = FindReferenceFile("THIRD_PARTY_NOTICES.md"); + + references.Add(new OpenSourceReferenceItem( + "MoeKoeMusic", + "Bundled music API source", + "4581660209c9cdd07669e8bd5bcbe136b7d91e02 · GPL-2.0", + "Pinned upstream project and original disclaimer retained with the bundled local KuGou API integration.", + "MoeKoeMusic contributors retain copyright, license, project name, and original statements.", + moekoeReadme, + "https://github.com/MoeKoeMusic/MoeKoeMusic/tree/4581660209c9cdd07669e8bd5bcbe136b7d91e02", + moekoeLicense)); + references.Add(new OpenSourceReferenceItem( + "KuGouMusicApi", + "Bundled modified component", + "1.6.0 · 06560e3e053bda1ab830750db6f645bab703f824 · MIT", + "Local random-port API, KuGou protocol modules, KRC decoding, and the two-minute public GET cache base.", + "Original MIT notice and disclaimer are distributed beside the modified source; YMhut changes are documented in YMhut_PATCHES.md.", + apiReadme, + "https://github.com/MakcRe/KuGouMusicApi/tree/06560e3e053bda1ab830750db6f645bab703f824", + apiLicense)); + references.Add(new OpenSourceReferenceItem( + "Node.js", + "Bundled runtime", + "22.18.0", + "Runs the loopback-only music API child process without requiring a system Node installation.", + "Node.js contributors retain their original rights and license.", + nodeLicense, + "https://github.com/nodejs/node/tree/v22.18.0", + nodeLicense)); + references.Add(new OpenSourceReferenceItem( + "Binaryify/NeteaseCloudMusicApi", + "Cache mechanism attribution", + "upstream attribution", + "The KuGouMusicApi response cache mechanism identifies this project as its source; YMhut limits it to an explicit public GET allowlist.", + "Original project authors and contributors retain their rights.", + thirdPartyNotices, + "https://github.com/Binaryify/NeteaseCloudMusicApi")); + references.Add(new OpenSourceReferenceItem( + "MoeKoeMusic API npm dependencies", + "Bundled npm dependencies", + "pnpm lockfile", + "axios, express, pako, qrcode, crypto-js, node-forge, big-integer, dotenv, safe-decode-uri-component, and url production dependencies.", + "Exact versions and transitive packages are recorded in the bundled pnpm-lock.yaml; each package keeps its upstream license.", + packageJson, + "https://github.com/MakcRe/KuGouMusicApi/blob/06560e3e053bda1ab830750db6f645bab703f824/package.json", + apiLicense)); + } + + private string FindReferenceFile(params string[] relativePaths) + { + foreach (var root in CandidateRoots().Distinct(PathComparer)) + { + foreach (var relative in relativePaths) + { + var path = Path.Combine(root, relative.Replace('/', Path.DirectorySeparatorChar)); + if (File.Exists(path)) return path; + } + } + return string.Empty; + } + private async Task AddPackageReferencesSafelyAsync(List references, CancellationToken cancellationToken) { try @@ -344,9 +417,14 @@ public sealed class OpenSourceReferenceService(AppPaths paths, ILogService? logS { "Application" => 0, "Reference project attribution" => 1, - "Runtime" => 2, - "NuGet package" => 3, - _ => 4 + "Bundled music API source" => 2, + "Bundled modified component" => 3, + "Cache mechanism attribution" => 4, + "Runtime" => 5, + "Bundled npm dependencies" => 6, + "NuGet package" => 7, + "Third-party tool notice" => 8, + _ => 9 }; } diff --git a/src/YMhut.Box.Core/DevEnvironments/DevTerminalSetupService.cs b/src/YMhut.Box.Core/DevEnvironments/DevTerminalSetupService.cs index 37b87ea..7453fb6 100644 --- a/src/YMhut.Box.Core/DevEnvironments/DevTerminalSetupService.cs +++ b/src/YMhut.Box.Core/DevEnvironments/DevTerminalSetupService.cs @@ -62,6 +62,8 @@ public interface IDevTerminalPlatform Task ResolveCommandAsync(string command, CancellationToken cancellationToken = default); + Task GetWindowsTerminalVersionAsync(CancellationToken cancellationToken = default); + Task RunAsync(string fileName, string arguments, CancellationToken cancellationToken = default); Task InstallWindowsTerminalFallbackAsync(CancellationToken cancellationToken = default); @@ -98,14 +100,15 @@ public sealed class DevTerminalSetupService( { var wingetPathTask = platform.ResolveCommandAsync("winget.exe", cancellationToken); var terminalPathTask = platform.ResolveCommandAsync("wt.exe", cancellationToken); + var terminalVersionTask = platform.GetWindowsTerminalVersionAsync(cancellationToken); var powerShellPathTask = platform.ResolveCommandAsync("pwsh.exe", cancellationToken); - await Task.WhenAll(wingetPathTask, terminalPathTask, powerShellPathTask).ConfigureAwait(false); + await Task.WhenAll(wingetPathTask, terminalPathTask, terminalVersionTask, powerShellPathTask).ConfigureAwait(false); var terminalPath = await terminalPathTask.ConfigureAwait(false); var powerShellPath = await powerShellPathTask.ConfigureAwait(false); var terminalVersion = string.IsNullOrWhiteSpace(terminalPath) ? string.Empty - : await ReadVersionAsync(terminalPath, "--version", cancellationToken).ConfigureAwait(false); + : NormalizeTerminalVersion(await terminalVersionTask.ConfigureAwait(false)); var powerShellVersion = string.IsNullOrWhiteSpace(powerShellPath) ? string.Empty : await ReadVersionAsync(powerShellPath, "-NoLogo -NoProfile -Command \"$PSVersionTable.PSVersion.ToString()\"", cancellationToken).ConfigureAwait(false); @@ -254,6 +257,15 @@ public sealed class DevTerminalSetupService( : string.Empty; } + private static string NormalizeTerminalVersion(string value) + { + var normalized = (value ?? string.Empty).Trim(); + return string.IsNullOrWhiteSpace(normalized) || + normalized.StartsWith("Windows Terminal", StringComparison.OrdinalIgnoreCase) + ? normalized + : $"Windows Terminal {normalized}"; + } + private static bool ContainsNoUpgrade(DevTerminalCommandResult result) { var message = result.Output + Environment.NewLine + result.Error; @@ -341,6 +353,47 @@ public sealed class WindowsDevTerminalPlatform : IDevTerminalPlatform, IDisposab return KnownCommandPaths(command).FirstOrDefault(File.Exists) ?? string.Empty; } + public async Task GetWindowsTerminalVersionAsync(CancellationToken cancellationToken = default) + { + const string query = "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command \"$package = Get-AppxPackage -Name Microsoft.WindowsTerminal -ErrorAction SilentlyContinue | Sort-Object Version -Descending | Select-Object -First 1; if ($null -ne $package) { $package.Version.ToString() }\""; + var packageResult = await RunAsync("powershell.exe", query, cancellationToken).ConfigureAwait(false); + var packageVersion = FirstVersionLine(packageResult.Output); + if (packageResult.Succeeded && !string.IsNullOrWhiteSpace(packageVersion)) + { + return packageVersion; + } + + var command = await ResolveCommandAsync("wt.exe", cancellationToken).ConfigureAwait(false); + if (string.IsNullOrWhiteSpace(command)) + { + return string.Empty; + } + + try + { + var info = FileVersionInfo.GetVersionInfo(command); + return FirstVersionLine(info.ProductVersion) ?? FirstVersionLine(info.FileVersion) ?? string.Empty; + } + catch + { + return string.Empty; + } + } + + private static string? FirstVersionLine(string? value) + { + var line = (value ?? string.Empty) + .Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) + .FirstOrDefault(); + if (string.IsNullOrWhiteSpace(line)) + { + return null; + } + + var match = Regex.Match(line, @"\d+(?:\.\d+)+", RegexOptions.CultureInvariant); + return match.Success ? match.Value : line; + } + private static IEnumerable KnownCommandPaths(string command) { var local = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); @@ -478,10 +531,10 @@ public sealed class WindowsDevTerminalPlatform : IDevTerminalPlatform, IDisposab var configured = false; var terminalPath = await ResolveCommandAsync("wt.exe", cancellationToken).ConfigureAwait(false); var terminalVersion = string.IsNullOrWhiteSpace(terminalPath) - ? new DevTerminalCommandResult(-1, string.Empty, string.Empty) - : await RunAsync(terminalPath, "--version", cancellationToken).ConfigureAwait(false); + ? string.Empty + : await GetWindowsTerminalVersionAsync(cancellationToken).ConfigureAwait(false); if (DevTerminalSetupService.SupportsDefaultTerminal(WindowsBuild, WindowsRevision) && - DevTerminalSetupService.SupportsWindowsTerminalVersion(terminalVersion.Output)) + DevTerminalSetupService.SupportsWindowsTerminalVersion(terminalVersion)) { BackupDefaultTerminalRegistry(); using var key = Registry.CurrentUser.CreateSubKey(ConsoleStartupKey, writable: true); @@ -534,25 +587,34 @@ public sealed class WindowsDevTerminalPlatform : IDevTerminalPlatform, IDisposab public async Task OpenTerminalAsync(CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); - var command = await ResolveCommandAsync("wt.exe", cancellationToken).ConfigureAwait(false); - if (string.IsNullOrWhiteSpace(command)) + var candidates = new[] { - command = await ResolveCommandAsync("pwsh.exe", cancellationToken).ConfigureAwait(false); - } - if (string.IsNullOrWhiteSpace(command)) + await ResolveCommandAsync("wt.exe", cancellationToken).ConfigureAwait(false), + await ResolveCommandAsync("pwsh.exe", cancellationToken).ConfigureAwait(false), + "powershell.exe" + }; + foreach (var command in candidates.Where(value => !string.IsNullOrWhiteSpace(value)).Distinct(StringComparer.OrdinalIgnoreCase)) { - command = "powershell.exe"; + try + { + var process = Process.Start(new ProcessStartInfo + { + FileName = command, + UseShellExecute = false, + CreateNoWindow = false, + ErrorDialog = false + }); + if (process is not null) + { + return true; + } + } + catch + { + } } - try - { - _ = Process.Start(new ProcessStartInfo { FileName = command, UseShellExecute = true }); - return true; - } - catch - { - return false; - } + return false; } public void Dispose() diff --git a/src/YMhut.Box.Core/Music/DpapiMusicCredentialStore.cs b/src/YMhut.Box.Core/Music/DpapiMusicCredentialStore.cs index 735a676..84f4794 100644 --- a/src/YMhut.Box.Core/Music/DpapiMusicCredentialStore.cs +++ b/src/YMhut.Box.Core/Music/DpapiMusicCredentialStore.cs @@ -53,9 +53,9 @@ public sealed class DpapiMusicCredentialStore(AppPaths paths) : IMusicCredential return Path.Combine(Root, string.IsNullOrWhiteSpace(safe) ? "provider.bin" : safe + ".bin"); } - private static byte[] Protect(byte[] input) => Transform(input, encrypt: true); + internal static byte[] Protect(byte[] input) => Transform(input, encrypt: true); - private static byte[] Unprotect(byte[] input) => Transform(input, encrypt: false); + internal static byte[] Unprotect(byte[] input) => Transform(input, encrypt: false); private static byte[] Transform(byte[] input, bool encrypt) { diff --git a/src/YMhut.Box.Core/Music/KugouLocalApiProxyHandler.cs b/src/YMhut.Box.Core/Music/KugouLocalApiProxyHandler.cs new file mode 100644 index 0000000..ebdb493 --- /dev/null +++ b/src/YMhut.Box.Core/Music/KugouLocalApiProxyHandler.cs @@ -0,0 +1,172 @@ +using System.Globalization; +using System.Net; +using System.Net.Http.Json; +using System.Text.Json; +using System.Text.Json.Nodes; + +namespace YMhut.Box.Core.Music; + +public sealed record LocalMusicApiEndpoint(Uri BaseAddress, string Token, int ProtocolVersion, string Commit); + +public interface ILocalMusicApiEndpoint +{ + bool IsAvailable { get; } + + Task GetEndpointAsync(CancellationToken cancellationToken = default); +} + +public sealed class LocalMusicApiUnavailableException(string message, Exception? innerException = null) + : InvalidOperationException(message, innerException); + +public sealed class KugouLocalApiProxyHandler : HttpMessageHandler +{ + private static long _lastTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web); + private readonly ILocalMusicApiEndpoint _endpoint; + private readonly HttpClient _loopbackClient; + private readonly CookieContainer _providerCookies = new(); + + public KugouLocalApiProxyHandler(ILocalMusicApiEndpoint endpoint) + { + _endpoint = endpoint; + _loopbackClient = new HttpClient(new HttpClientHandler + { + AllowAutoRedirect = false, + UseCookies = true, + CookieContainer = new CookieContainer(), + UseProxy = false + }) + { + Timeout = TimeSpan.FromSeconds(20) + }; + } + + public async Task SendApiAsync( + string path, + IReadOnlyDictionary? query = null, + bool forceFresh = false, + HttpMethod? method = null, + JsonNode? body = null, + CancellationToken cancellationToken = default) + { + var endpoint = await _endpoint.GetEndpointAsync(cancellationToken).ConfigureAwait(false); + method ??= HttpMethod.Get; + var values = new List>(); + if (query is not null) values.AddRange(query); + if (method == HttpMethod.Post || forceFresh) + { + values.Add(new("timestamp", NextTimestamp().ToString(CultureInfo.InvariantCulture))); + } + var queryText = string.Join("&", values.Select(pair => + $"{Uri.EscapeDataString(pair.Key)}={Uri.EscapeDataString(pair.Value)}")); + var relative = path.TrimStart('/') + (queryText.Length == 0 ? string.Empty : "?" + queryText); + using var request = new HttpRequestMessage(method, new Uri(endpoint.BaseAddress, relative)); + request.Headers.TryAddWithoutValidation("x-ymhut-internal-token", endpoint.Token); + if (body is not null) request.Content = JsonContent.Create(body, options: JsonOptions); + using var response = await _loopbackClient.SendAsync(request, HttpCompletionOption.ResponseContentRead, cancellationToken).ConfigureAwait(false); + var text = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + if (!response.IsSuccessStatusCode) + { + throw new LocalMusicApiUnavailableException($"本地酷狗 API 请求失败(HTTP {(int)response.StatusCode})。"); + } + return JsonNode.Parse(text) as JsonObject + ?? throw new LocalMusicApiUnavailableException("本地酷狗 API 返回了无效数据。"); + } + + internal static long NextTimestamp() + { + while (true) + { + var current = Volatile.Read(ref _lastTimestamp); + var next = Math.Max(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), current + 1); + if (Interlocked.CompareExchange(ref _lastTimestamp, next, current) == current) return next; + } + } + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + var target = request.RequestUri ?? throw new InvalidOperationException("KuGou request has no target URI."); + if (target.Scheme != Uri.UriSchemeHttps || + !(target.Host.Equals("kugou.com", StringComparison.OrdinalIgnoreCase) || target.Host.EndsWith(".kugou.com", StringComparison.OrdinalIgnoreCase))) + { + throw new InvalidOperationException("Only HTTPS KuGou endpoints can use the local API bridge."); + } + + var endpoint = await _endpoint.GetEndpointAsync(cancellationToken).ConfigureAwait(false); + var body = request.Content is null + ? null + : Convert.ToBase64String(await request.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false)); + var headers = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var header in request.Headers) headers[header.Key] = string.Join(", ", header.Value); + if (request.Content is not null) + { + foreach (var header in request.Content.Headers) headers[header.Key] = string.Join(", ", header.Value); + } + var cookie = _providerCookies.GetCookieHeader(target); + if (!string.IsNullOrWhiteSpace(cookie)) headers["Cookie"] = cookie; + + var payload = new + { + method = request.Method.Method, + url = target.AbsoluteUri, + headers, + bodyBase64 = body + }; + var timestamp = NextTimestamp().ToString(CultureInfo.InvariantCulture); + using var bridgeRequest = new HttpRequestMessage( + HttpMethod.Post, + new Uri(endpoint.BaseAddress, $"ymhut/proxy?timestamp={timestamp}")) + { + Content = JsonContent.Create(payload, options: JsonOptions) + }; + bridgeRequest.Headers.TryAddWithoutValidation("x-ymhut-internal-token", endpoint.Token); + + using var bridgeResponse = await _loopbackClient.SendAsync( + bridgeRequest, + HttpCompletionOption.ResponseContentRead, + cancellationToken).ConfigureAwait(false); + var responseJson = await bridgeResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + if (!bridgeResponse.IsSuccessStatusCode) + { + throw new LocalMusicApiUnavailableException($"本地酷狗 API 请求失败(HTTP {(int)bridgeResponse.StatusCode})。"); + } + + var envelope = JsonNode.Parse(responseJson) as JsonObject + ?? throw new LocalMusicApiUnavailableException("本地酷狗 API 返回了无效响应。"); + var status = envelope["status"]?.GetValue() ?? 502; + var responseBody = envelope["bodyBase64"]?.GetValue() ?? string.Empty; + var response = new HttpResponseMessage((HttpStatusCode)status) + { + RequestMessage = request, + Content = new ByteArrayContent(string.IsNullOrEmpty(responseBody) ? [] : Convert.FromBase64String(responseBody)) + }; + + if (envelope["headers"] is JsonObject responseHeaders) + { + foreach (var pair in responseHeaders) + { + var values = pair.Value is JsonArray array + ? array.Select(item => item?.GetValue() ?? string.Empty).Where(value => value.Length > 0).ToArray() + : [pair.Value?.GetValue() ?? string.Empty]; + if (pair.Key.Equals("set-cookie", StringComparison.OrdinalIgnoreCase)) + { + foreach (var value in values) + { + try { _providerCookies.SetCookies(target, value); } catch (CookieException) { } + } + } + if (!response.Headers.TryAddWithoutValidation(pair.Key, values)) + { + response.Content.Headers.TryAddWithoutValidation(pair.Key, values); + } + } + } + return response; + } + + protected override void Dispose(bool disposing) + { + if (disposing) _loopbackClient.Dispose(); + base.Dispose(disposing); + } +} diff --git a/src/YMhut.Box.Core/Music/KugouMusicProvider.cs b/src/YMhut.Box.Core/Music/KugouMusicProvider.cs index 447e426..1b5cc74 100644 --- a/src/YMhut.Box.Core/Music/KugouMusicProvider.cs +++ b/src/YMhut.Box.Core/Music/KugouMusicProvider.cs @@ -37,8 +37,10 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable ]; private readonly IMusicCredentialStore _credentials; + private readonly IMusicAccountSessionStore? _sessions; private readonly HttpClient _publicClient; private readonly KugouApiClient _api; + private readonly KugouLocalApiProxyHandler? _localApi; private readonly SemaphoreSlim _initialization = new(1, 1); private readonly SemaphoreSlim _accountCacheGate = new(1, 1); private readonly Dictionary _playlistData = new(StringComparer.OrdinalIgnoreCase); @@ -51,19 +53,33 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable private bool _accountCacheLoaded; private bool _favoriteCacheLoaded; private bool _initialized; + private readonly object _refreshSync = new(); + private Task? _refreshTask; + private DateTimeOffset? _lastRefreshFailure; public KugouMusicProvider(IMusicCredentialStore credentials, HttpMessageHandler? handler = null) - : this(credentials, handler, null) + : this(credentials, handler, null, null) + { + } + + public KugouMusicProvider( + IMusicCredentialStore credentials, + HttpMessageHandler handler, + IMusicAccountSessionStore sessions) + : this(credentials, handler, null, sessions) { } internal KugouMusicProvider( IMusicCredentialStore credentials, HttpMessageHandler? handler, - Func? playlistKeyFactory) + Func? playlistKeyFactory, + IMusicAccountSessionStore? sessions = null) { _credentials = credentials; + _sessions = sessions; _api = new KugouApiClient(handler, playlistKeyFactory); + _localApi = handler as KugouLocalApiProxyHandler; _publicClient = handler is null ? new HttpClient() : new HttpClient(handler, disposeHandler: false); _publicClient.Timeout = TimeSpan.FromSeconds(12); _publicClient.DefaultRequestHeaders.UserAgent.ParseAdd(WebUserAgent); @@ -76,6 +92,8 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable public MusicLoginState LoginState { get; private set; } = new(false); + public IReadOnlyList QualityOptions => BuildQualityOptions(LoginState); + public async Task InitializeAsync(CancellationToken cancellationToken = default) { if (_initialized) return; @@ -85,6 +103,24 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable if (_initialized) return; await EnsureDeviceCoreAsync(cancellationToken).ConfigureAwait(false); var secret = await _credentials.LoadAsync(Id, cancellationToken).ConfigureAwait(false); + if (_sessions is not null) + { + var session = await _sessions.LoadAsync(Id, cancellationToken).ConfigureAwait(false); + var cachedAccount = session is null ? null : ParseStoredAccount(session.Credential, out _); + if (session is not null && cachedAccount is not null && session.LoginState.LoggedIn) + { + _account = cachedAccount; + var refreshedAt = session.LoginState.RefreshedAt ?? session.SavedAt; + LoginState = session.LoginState with + { + RefreshedAt = refreshedAt, + IsCached = true, + IsStale = DateTimeOffset.UtcNow - refreshedAt >= TimeSpan.FromHours(12) + }; + _initialized = true; + return; + } + } if (!string.IsNullOrWhiteSpace(secret)) { var account = ParseStoredAccount(secret, out var migrated); @@ -113,6 +149,54 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable } } + public Task RefreshLoginStateAsync(bool force = false, CancellationToken cancellationToken = default) + { + lock (_refreshSync) + { + if (!force && LoginState.LoggedIn && !LoginState.IsStale) return Task.FromResult(LoginState); + if (!force && _lastRefreshFailure is { } failedAt && DateTimeOffset.UtcNow - failedAt < TimeSpan.FromMinutes(2)) + { + return Task.FromResult(LoginState with { IsCached = true, IsStale = true }); + } + return _refreshTask ??= RefreshLoginStateCoreAsync(cancellationToken); + } + } + + private async Task RefreshLoginStateCoreAsync(CancellationToken cancellationToken) + { + try + { + await InitializeAsync(cancellationToken).ConfigureAwait(false); + if (_account is null) return LoginState; + await ValidateAccountAsync(_account, cancellationToken).ConfigureAwait(false); + LoginState = EnrichLoginState(ToLoginState(_account)); + var entitlements = await LoadEntitlementsAsync(_account, cancellationToken).ConfigureAwait(false); + if (entitlements.Count > 0) LoginState = LoginState with { Entitlements = entitlements }; + _lastRefreshFailure = null; + await SaveSessionAsync(_account, LoginState, cancellationToken).ConfigureAwait(false); + return LoginState; + } + catch (KugouApiException exception) when (exception.AuthenticationFailure) + { + await ClearAccountAsync(cancellationToken).ConfigureAwait(false); + return LoginState; + } + catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) + { + throw; + } + catch + { + _lastRefreshFailure = DateTimeOffset.UtcNow; + LoginState = LoginState with { IsCached = true, IsStale = true }; + return LoginState; + } + finally + { + lock (_refreshSync) _refreshTask = null; + } + } + public async Task LoginWithCookieAsync(string cookie, CancellationToken cancellationToken = default) { await EnsureDeviceAsync(cancellationToken).ConfigureAwait(false); @@ -358,66 +442,71 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable string? lastReason = null; foreach (var candidate in candidates) { - try + var freePartModes = _account is null ? new[] { true } : new[] { false, true }; + foreach (var freePart in freePartModes) { - var response = await _api.SendAndroidAsync( - HttpMethod.Get, - "/v5/url", - new Dictionary - { - ["album_id"] = identity.AlbumId, - ["area_code"] = "1", - ["hash"] = candidate.Hash.ToLowerInvariant(), - ["ssa_flag"] = "is_fromtrack", - ["version"] = "11430", - ["page_id"] = "151369488", - ["quality"] = candidate.Value, - ["album_audio_id"] = metadata?.MixSongId.ToString(CultureInfo.InvariantCulture) ?? "0", - ["behavior"] = "play", - ["pid"] = "2", - ["cmd"] = "26", - ["pidversion"] = "3001", - ["IsFreePart"] = "0", - ["ppage_id"] = "463467626,350369493,788954147", - ["cdnBackup"] = "1", - ["module"] = "", - ["clientver"] = "11430" - }, - null, - _account, - "trackercdn.kugou.com", - cancellationToken, - addTrackKey: true).ConfigureAwait(false); - - foreach (var data in PlaybackResponseNodes(response.Json)) + try { - var extension = KugouApiClient.Text(data, "extName") ?? KugouApiClient.Text(data, "ext_name"); - if (string.Equals(extension, "mp4", StringComparison.OrdinalIgnoreCase)) - { - lastReason = "当前音质返回了视频容器,已尝试较低音质。"; - continue; - } - if (!TryGetHttpsPlaybackUri(data, out var streamUri)) continue; + var response = await _api.SendAndroidAsync( + HttpMethod.Get, + "/v5/url", + new Dictionary + { + ["album_id"] = identity.AlbumId, + ["area_code"] = "1", + ["hash"] = candidate.Hash.ToLowerInvariant(), + ["ssa_flag"] = "is_fromtrack", + ["version"] = "11430", + ["page_id"] = "151369488", + ["quality"] = candidate.Value, + ["album_audio_id"] = metadata?.MixSongId.ToString(CultureInfo.InvariantCulture) ?? "0", + ["behavior"] = "play", + ["pid"] = "2", + ["cmd"] = "26", + ["pidversion"] = "3001", + ["IsFreePart"] = freePart ? "1" : "0", + ["ppage_id"] = "463467626,350369493,788954147", + ["cdnBackup"] = "1", + ["module"] = "", + ["clientver"] = "11430" + }, + null, + _account, + "trackercdn.kugou.com", + cancellationToken, + addTrackKey: true).ConfigureAwait(false); - var bitrate = FirstInteger(data, "bitRate", "bitrate", "bit_rate"); - if (bitrate <= 0) bitrate = candidate.Bitrate; - var trial = FirstInteger(data, "is_free_part", "isFreePart") == 1; - return new MusicStreamResult( - streamUri, - true, - trial, - candidate.Quality, - bitrate * 1000L, - trial ? "提供方仅允许试听片段。" : candidate.Quality == quality ? null : $"已回退到 {candidate.Quality} 音质。"); + foreach (var data in PlaybackResponseNodes(response.Json)) + { + var extension = KugouApiClient.Text(data, "extName") ?? KugouApiClient.Text(data, "ext_name"); + if (string.Equals(extension, "mp4", StringComparison.OrdinalIgnoreCase)) + { + lastReason = "当前音质返回了视频容器,已尝试较低音质。"; + continue; + } + if (!TryGetHttpsPlaybackUri(data, out var streamUri)) continue; + + var bitrate = FirstInteger(data, "bitRate", "bitrate", "bit_rate"); + if (bitrate <= 0) bitrate = candidate.Bitrate; + var fullAudio = FirstInteger(data, "is_full_audio", "isFullAudio") == 1; + var trial = FirstInteger(data, "is_free_part", "isFreePart") == 1 || (freePart && !fullAudio); + return new MusicStreamResult( + streamUri, + true, + trial, + candidate.Quality, + bitrate * 1000L, + trial ? "提供方仅允许试听片段。" : candidate.Quality == quality ? null : $"已回退到 {candidate.Quality} 音质。"); + } + lastReason = KugouApiClient.Text(response.Json, "error") ?? + KugouApiClient.Text(response.Json, "msg") ?? + lastReason ?? + "提供方未返回可用的 HTTPS 播放地址。"; + } + catch (KugouApiException exception) when (!exception.AuthenticationFailure) + { + lastReason = exception.Message; } - lastReason = KugouApiClient.Text(response.Json, "error") ?? - KugouApiClient.Text(response.Json, "msg") ?? - lastReason ?? - "提供方未返回可用的 HTTPS 播放地址。"; - } - catch (KugouApiException exception) when (!exception.AuthenticationFailure) - { - lastReason = exception.Message; } } return new MusicStreamResult(null, false, false, quality, 0, @@ -514,21 +603,32 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable private static bool TryGetHttpsPlaybackUri(JsonNode? node, out Uri? result) { - foreach (var property in new[] { "url", "play_url", "backup_url", "backupurl" }) + foreach (var property in new[] { "url", "play_url", "backupUrl", "backup_url", "backupurl" }) { foreach (var address in TextValues(node?[property])) { - if (Uri.TryCreate(address, UriKind.Absolute, out var uri) && uri.Scheme == Uri.UriSchemeHttps) + if (!Uri.TryCreate(address, UriKind.Absolute, out var uri)) continue; + if (uri.Scheme == Uri.UriSchemeHttps) { result = uri; return true; } + if (uri.Scheme == Uri.UriSchemeHttp && uri.IsDefaultPort && IsKugouMediaHost(uri.Host)) + { + var secure = new UriBuilder(uri) { Scheme = Uri.UriSchemeHttps, Port = -1 }.Uri; + result = secure; + return true; + } } } result = null; return false; } + private static bool IsKugouMediaHost(string host) + => host.EndsWith(".kugou.com", StringComparison.OrdinalIgnoreCase) || + string.Equals(host, "kugou.com", StringComparison.OrdinalIgnoreCase); + private static IEnumerable TextValues(JsonNode? node) { if (node is JsonValue value && value.TryGetValue(out var valueText) && !string.IsNullOrWhiteSpace(valueText)) @@ -576,6 +676,40 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable public async Task GetLyricsAsync(string songId, CancellationToken cancellationToken = default) { var identity = SplitSongId(songId); + if (_localApi is not null) + { + try + { + var searchResult = await _localApi.SendApiAsync("/search/lyric", new Dictionary + { + ["hash"] = identity.Hash, + ["man"] = "yes" + }, cancellationToken: cancellationToken).ConfigureAwait(false); + var localCandidate = KugouApiClient.Array(searchResult["candidates"] ?? searchResult["data"]?["candidates"]).FirstOrDefault(); + var localLyricId = KugouApiClient.Text(localCandidate, "id"); + var localAccessKey = KugouApiClient.Text(localCandidate, "accesskey"); + if (!string.IsNullOrWhiteSpace(localLyricId) && !string.IsNullOrWhiteSpace(localAccessKey)) + { + var krc = await _localApi.SendApiAsync("/lyric", new Dictionary + { + ["id"] = localLyricId, + ["accesskey"] = localAccessKey, + ["fmt"] = "krc", + ["decode"] = "true" + }, cancellationToken: cancellationToken).ConfigureAwait(false); + var decoded = KugouApiClient.Text(krc, "decodeContent") ?? KugouApiClient.Text(krc["data"], "decodeContent"); + if (!string.IsNullOrWhiteSpace(decoded)) + { + var parsed = MusicLyricsParser.ParseKrc(decoded); + if (parsed.Lines.Count > 0) return parsed; + } + } + } + catch (Exception exception) when (exception is not OperationCanceledException) + { + // Fall through to the plain LRC compatibility path. + } + } var search = await GetPublicJsonAsync( "https://lyrics.kugou.com/search?ver=1&man=yes&client=pc&hash=" + Uri.EscapeDataString(identity.Hash), cancellationToken).ConfigureAwait(false); @@ -810,24 +944,13 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable device ??= KugouApiClient.CreateDeviceCredential(); _api.Device = device; await _credentials.SaveAsync(DeviceCredentialKey, JsonSerializer.Serialize(device, CredentialJsonOptions), cancellationToken).ConfigureAwait(false); - if (string.IsNullOrWhiteSpace(device.Dfid) || device.Dfid == "-") - { - try - { - device = await _api.RegisterDeviceAsync(cancellationToken).ConfigureAwait(false); - await _credentials.SaveAsync(DeviceCredentialKey, JsonSerializer.Serialize(device, CredentialJsonOptions), cancellationToken).ConfigureAwait(false); - } - catch (KugouApiException) - { - _api.Device = device; - } - } _deviceInitialized = true; } private async Task RequireAccountAsync(CancellationToken cancellationToken) { await InitializeAsync(cancellationToken).ConfigureAwait(false); + if (LoginState.IsStale) await RefreshLoginStateAsync(false, cancellationToken).ConfigureAwait(false); return _account ?? throw new InvalidOperationException("请先登录酷狗音乐账户。"); } @@ -863,12 +986,15 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable private async Task CommitAccountAsync(KugouAccountCredential account, bool save, CancellationToken cancellationToken) { _account = account with { Version = 2 }; - LoginState = ToLoginState(_account); + LoginState = EnrichLoginState(ToLoginState(_account)); + var entitlements = await LoadEntitlementsAsync(_account, cancellationToken).ConfigureAwait(false); + if (entitlements.Count > 0) LoginState = LoginState with { Entitlements = entitlements }; InvalidateAccountCaches(); if (save) { await _credentials.SaveAsync(Id, JsonSerializer.Serialize(_account, CredentialJsonOptions), cancellationToken).ConfigureAwait(false); } + await SaveSessionAsync(_account, LoginState, cancellationToken).ConfigureAwait(false); } private async Task ClearAccountAsync(CancellationToken cancellationToken) @@ -877,6 +1003,7 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable LoginState = new MusicLoginState(false); InvalidateAccountCaches(); await _credentials.ClearAsync(Id, cancellationToken).ConfigureAwait(false); + if (_sessions is not null) await _sessions.ClearAsync(Id, cancellationToken).ConfigureAwait(false); } private async Task ExpireAccountAsync(CancellationToken cancellationToken) @@ -1324,6 +1451,102 @@ public sealed class KugouMusicProvider : IMusicProvider, IDisposable private static MusicLoginState ToLoginState(KugouAccountCredential account) => new(true, account.UserId, account.Nickname, account.AvatarUrl, account.VipLevel); + private async Task SaveSessionAsync(KugouAccountCredential account, MusicLoginState state, CancellationToken cancellationToken) + { + if (_sessions is null || !state.LoggedIn) return; + await _sessions.SaveAsync(new MusicAccountSession( + DpapiMusicAccountSessionStore.CurrentVersion, + Id, + JsonSerializer.Serialize(account, CredentialJsonOptions), + state, + DateTimeOffset.UtcNow), cancellationToken).ConfigureAwait(false); + } + + private async Task> LoadEntitlementsAsync( + KugouAccountCredential account, + CancellationToken cancellationToken) + { + if (_localApi is null) return []; + try + { + var cookie = $"token={account.Token};userid={account.UserId}"; + if (!string.IsNullOrWhiteSpace(account.VipToken)) cookie += $";vip_token={account.VipToken}"; + if (!string.IsNullOrWhiteSpace(account.T1)) cookie += $";t1={account.T1}"; + var response = await _localApi.SendApiAsync( + "/user/vip/detail", + method: HttpMethod.Post, + body: new JsonObject { ["cookie"] = cookie }, + cancellationToken: cancellationToken).ConfigureAwait(false); + var grants = new List(); + var index = 0; + foreach (var node in KugouApiClient.Array(response["data"]?["busi_vip"] ?? response["busi_vip"])) + { + var product = KugouApiClient.Text(node, "product_type") ?? KugouApiClient.Text(node, "vip_type") ?? $"group-{index}"; + var groupCode = KugouApiClient.Text(node, "busi_type") ?? $"group-{index}"; + var groupName = index switch + { + 0 => "概念版", + 1 => "畅听版", + _ => groupCode + }; + var enabled = KugouApiClient.Integer(node, "is_vip") == 1; + var expiryText = KugouApiClient.Text(node, "vip_end_time") ?? KugouApiClient.Text(node, "end_time"); + DateTimeOffset? expiresAt = DateTimeOffset.TryParse(expiryText, out var parsedExpiry) ? parsedExpiry : null; + grants.Add(new MusicEntitlementGrant( + product, + $"{groupName} {product}", + groupCode, + enabled, + expiresAt)); + index++; + } + return grants; + } + catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) + { + throw; + } + catch + { + return []; + } + } + + private static MusicLoginState EnrichLoginState(MusicLoginState state) + { + if (!state.LoggedIn) return state; + var raw = string.IsNullOrWhiteSpace(state.VipLevel) ? "none" : state.VipLevel.Trim(); + var known = raw.ToLowerInvariant() switch + { + "1" or "vip" => new MusicEntitlementGrant(raw, "酷狗 VIP", "membership", true), + "2" or "svip" => new MusicEntitlementGrant(raw, "酷狗 SVIP", "membership", true), + "music" or "musicpack" => new MusicEntitlementGrant(raw, "音乐包", "music-package", true), + "none" or "0" => null, + _ => new MusicEntitlementGrant(raw, raw, "unknown", true) + }; + return state with + { + Entitlements = known is null ? [] : [known], + RefreshedAt = DateTimeOffset.UtcNow, + IsCached = false, + IsStale = false + }; + } + + private static IReadOnlyList BuildQualityOptions(MusicLoginState state) + { + var vip = state.Entitlements.Any(item => item.Enabled && + (item.Group == "membership" || item.PlatformCode.Contains("vip", StringComparison.OrdinalIgnoreCase))); + return + [ + new(MusicPlaybackQuality.Master, "蝰蛇母带", "FLAC", 1000, "酷狗 SVIP", vip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, vip ? null : "需要酷狗会员权益"), + new(MusicPlaybackQuality.HiRes, "Hi-Res", "FLAC", 900, "酷狗 VIP", vip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, vip ? null : "需要酷狗会员权益"), + new(MusicPlaybackQuality.Lossless, "无损音质", "FLAC", 800, "酷狗 VIP", vip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, vip ? null : "需要酷狗会员权益"), + new(MusicPlaybackQuality.High, "高品音质", "MP3", 320, "", MusicQualityAvailability.Available), + new(MusicPlaybackQuality.Standard, "标准音质", "MP3", 128, "", MusicQualityAvailability.Available) + ]; + } + private sealed record KugouSongData(string Hash, long AlbumId, long MixSongId, long FileId); private sealed record KugouPlaybackCandidate(MusicPlaybackQuality Quality, string Value, string Hash, int Bitrate); diff --git a/src/YMhut.Box.Core/Music/MusicAccountSessionStore.cs b/src/YMhut.Box.Core/Music/MusicAccountSessionStore.cs new file mode 100644 index 0000000..7025d7e --- /dev/null +++ b/src/YMhut.Box.Core/Music/MusicAccountSessionStore.cs @@ -0,0 +1,82 @@ +using System.Text; +using System.Text.Json; +using YMhut.Box.Core.App; + +namespace YMhut.Box.Core.Music; + +public sealed record MusicAccountSession( + int Version, + string Provider, + string Credential, + MusicLoginState LoginState, + DateTimeOffset SavedAt); + +public interface IMusicAccountSessionStore +{ + Task LoadAsync(string provider, CancellationToken cancellationToken = default); + + Task SaveAsync(MusicAccountSession session, CancellationToken cancellationToken = default); + + Task ClearAsync(string provider, CancellationToken cancellationToken = default); +} + +public sealed class DpapiMusicAccountSessionStore(AppPaths paths) : IMusicAccountSessionStore +{ + public const int CurrentVersion = 1; + private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web); + private readonly SemaphoreSlim _writeGate = new(1, 1); + private string Root => Path.Combine(paths.Data, "Music", "Sessions"); + + public async Task LoadAsync(string provider, CancellationToken cancellationToken = default) + { + var path = PathFor(provider); + if (!OperatingSystem.IsWindows() || !File.Exists(path)) return null; + try + { + var encrypted = await File.ReadAllBytesAsync(path, cancellationToken).ConfigureAwait(false); + var json = Encoding.UTF8.GetString(DpapiMusicCredentialStore.Unprotect(encrypted)); + var session = JsonSerializer.Deserialize(json, JsonOptions); + return session is { Version: CurrentVersion } && + string.Equals(session.Provider, provider, StringComparison.OrdinalIgnoreCase) + ? session + : null; + } + catch + { + return null; + } + } + + public async Task SaveAsync(MusicAccountSession session, CancellationToken cancellationToken = default) + { + if (!OperatingSystem.IsWindows()) throw new PlatformNotSupportedException("Windows DPAPI is required for music sessions."); + await _writeGate.WaitAsync(cancellationToken).ConfigureAwait(false); + var path = PathFor(session.Provider); + var temporary = path + $".{Guid.NewGuid():N}.tmp"; + try + { + Directory.CreateDirectory(Root); + var normalized = session with { Version = CurrentVersion }; + var encrypted = DpapiMusicCredentialStore.Protect(Encoding.UTF8.GetBytes(JsonSerializer.Serialize(normalized, JsonOptions))); + await File.WriteAllBytesAsync(temporary, encrypted, cancellationToken).ConfigureAwait(false); + File.Move(temporary, path, true); + } + finally + { + try { if (File.Exists(temporary)) File.Delete(temporary); } catch { } + _writeGate.Release(); + } + } + + public Task ClearAsync(string provider, CancellationToken cancellationToken = default) + { + try { File.Delete(PathFor(provider)); } catch { } + return Task.CompletedTask; + } + + private string PathFor(string provider) + { + var safe = string.Concat(provider.Where(character => char.IsLetterOrDigit(character) || character is '-' or '_')); + return Path.Combine(Root, (string.IsNullOrWhiteSpace(safe) ? "provider" : safe) + ".bin"); + } +} diff --git a/src/YMhut.Box.Core/Music/MusicModels.cs b/src/YMhut.Box.Core/Music/MusicModels.cs index 8b7b6e9..a0c705a 100644 --- a/src/YMhut.Box.Core/Music/MusicModels.cs +++ b/src/YMhut.Box.Core/Music/MusicModels.cs @@ -19,6 +19,13 @@ public enum MusicPlaybackQuality Standard } +public enum MusicQualityAvailability +{ + Available, + RequiresEntitlement, + Unavailable +} + public enum MusicPlayMode { List, @@ -59,12 +66,58 @@ public sealed record MusicPlaylist( internal object? ProviderData { get; init; } } +public sealed record MusicEntitlementGrant( + string PlatformCode, + string DisplayName, + string Group, + bool Enabled, + DateTimeOffset? ExpiresAt = null); + +/// +/// Shared presentation settings for timed lyrics in both music providers. +/// Values are persisted by the application settings service, not by a provider. +/// +public sealed class MusicLyricsSettings +{ + public bool WordHighlightEnabled { get; set; } = true; + + public bool ShowTranslation { get; set; } = true; + + public bool ShowRomanized { get; set; } + + public double FontScale { get; set; } = 1.0; + + public double LineSpacing { get; set; } = 12.0; + + public int ActiveWordColor { get; set; } = unchecked((int)0xFF5E6D44); + + public bool DesktopSyncEnabled { get; set; } = true; +} + +public sealed record MusicQualityOption( + MusicPlaybackQuality Quality, + string DisplayName, + string Format, + int BitrateKbps, + string RequiredEntitlement, + MusicQualityAvailability Availability, + string? UnavailableReason = null); + public sealed record MusicLoginState( bool LoggedIn, string UserId = "", string Nickname = "", string AvatarUrl = "", - string VipLevel = "none"); + string VipLevel = "none") +{ + public IReadOnlyList Entitlements { get; init; } = []; + + public DateTimeOffset? RefreshedAt { get; init; } + + public bool IsCached { get; init; } + + public bool IsStale { get; init; } +} public sealed record MusicQrSession(string Key, string LoginUrl, DateTimeOffset ExpiresAt) { @@ -119,7 +172,12 @@ public sealed record TimedLyricLine( TimeSpan Duration, string Text, string? Translation, - IReadOnlyList Words); + IReadOnlyList Words) +{ + public string? Romanized { get; init; } +} + +public sealed record MusicLyricCursor(int LineIndex, int WordIndex, double WordProgress); public sealed record TimedLyrics(IReadOnlyList Lines, string Raw, string? TranslationRaw, string? RomanizedRaw); @@ -148,8 +206,12 @@ public interface IMusicProvider MusicLoginState LoginState { get; } + IReadOnlyList QualityOptions { get; } + Task InitializeAsync(CancellationToken cancellationToken = default); + Task RefreshLoginStateAsync(bool force = false, CancellationToken cancellationToken = default); + Task LoginWithCookieAsync(string cookie, CancellationToken cancellationToken = default); Task CreateQrSessionAsync(CancellationToken cancellationToken = default); diff --git a/src/YMhut.Box.Core/Music/NeteaseMusicProvider.cs b/src/YMhut.Box.Core/Music/NeteaseMusicProvider.cs index 8dcbad3..74b5ba1 100644 --- a/src/YMhut.Box.Core/Music/NeteaseMusicProvider.cs +++ b/src/YMhut.Box.Core/Music/NeteaseMusicProvider.cs @@ -33,16 +33,25 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable ]; private readonly IMusicCredentialStore _credentials; + private readonly IMusicAccountSessionStore? _sessions; private readonly ILogService? _logService; private readonly HttpClient _client; private readonly SemaphoreSlim _initialization = new(1, 1); private readonly string _deviceId = Convert.ToHexStringLower(RandomNumberGenerator.GetBytes(16)); private string _cookie = string.Empty; private bool _initialized; + private readonly object _refreshSync = new(); + private Task? _refreshTask; + private DateTimeOffset? _lastRefreshFailure; - public NeteaseMusicProvider(IMusicCredentialStore credentials, ILogService? logService = null, HttpMessageHandler? handler = null) + public NeteaseMusicProvider( + IMusicCredentialStore credentials, + ILogService? logService = null, + HttpMessageHandler? handler = null, + IMusicAccountSessionStore? sessions = null) { _credentials = credentials; + _sessions = sessions; _logService = logService; _client = handler is null ? new HttpClient() : new HttpClient(handler, disposeHandler: false); _client.Timeout = TimeSpan.FromSeconds(12); @@ -56,6 +65,8 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable public MusicLoginState LoginState { get; private set; } = new(false); + public IReadOnlyList QualityOptions => BuildQualityOptions(LoginState); + public async Task InitializeAsync(CancellationToken cancellationToken = default) { if (_initialized) return; @@ -64,6 +75,23 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable { if (_initialized) return; _cookie = await _credentials.LoadAsync(Id, cancellationToken).ConfigureAwait(false); + if (_sessions is not null) + { + var session = await _sessions.LoadAsync(Id, cancellationToken).ConfigureAwait(false); + if (session is not null && !string.IsNullOrWhiteSpace(session.Credential) && session.LoginState.LoggedIn) + { + _cookie = session.Credential; + var refreshedAt = session.LoginState.RefreshedAt ?? session.SavedAt; + LoginState = session.LoginState with + { + RefreshedAt = refreshedAt, + IsCached = true, + IsStale = DateTimeOffset.UtcNow - refreshedAt >= TimeSpan.FromHours(12) + }; + _initialized = true; + return; + } + } if (string.IsNullOrWhiteSpace(_cookie)) { LoginState = new MusicLoginState(false); @@ -77,6 +105,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable await _credentials.ClearAsync(Id, cancellationToken).ConfigureAwait(false); } _initialized = true; + if (LoginState.LoggedIn) await SaveSessionAsync(_cookie, LoginState, cancellationToken).ConfigureAwait(false); } finally { @@ -84,6 +113,53 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable } } + public Task RefreshLoginStateAsync(bool force = false, CancellationToken cancellationToken = default) + { + lock (_refreshSync) + { + if (!force && LoginState.LoggedIn && !LoginState.IsStale) return Task.FromResult(LoginState); + if (!force && _lastRefreshFailure is { } failedAt && DateTimeOffset.UtcNow - failedAt < TimeSpan.FromMinutes(2)) + { + return Task.FromResult(LoginState with { IsCached = true, IsStale = true }); + } + return _refreshTask ??= RefreshLoginStateCoreAsync(cancellationToken); + } + } + + private async Task RefreshLoginStateCoreAsync(CancellationToken cancellationToken) + { + try + { + await InitializeAsync(cancellationToken).ConfigureAwait(false); + if (string.IsNullOrWhiteSpace(_cookie)) return LoginState; + var state = await GetLoginStateAsync(_cookie, cancellationToken).ConfigureAwait(false); + if (!state.LoggedIn) + { + await LogoutAsync(cancellationToken).ConfigureAwait(false); + return LoginState; + } + state = EnrichLoginState(state); + LoginState = state; + _lastRefreshFailure = null; + await SaveSessionAsync(_cookie, state, cancellationToken).ConfigureAwait(false); + return state; + } + catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) + { + throw; + } + catch + { + _lastRefreshFailure = DateTimeOffset.UtcNow; + LoginState = LoginState with { IsCached = true, IsStale = true }; + return LoginState; + } + finally + { + lock (_refreshSync) _refreshTask = null; + } + } + public async Task LoginWithCookieAsync(string cookie, CancellationToken cancellationToken = default) { var normalized = NormalizeCookie(cookie); @@ -196,9 +272,10 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable private async Task CommitLoginAsync(string cookie, MusicLoginState state, CancellationToken cancellationToken) { _cookie = cookie; - LoginState = state; + LoginState = EnrichLoginState(state); _initialized = true; await _credentials.SaveAsync(Id, cookie, cancellationToken).ConfigureAwait(false); + await SaveSessionAsync(cookie, LoginState, cancellationToken).ConfigureAwait(false); } public async Task LogoutAsync(CancellationToken cancellationToken = default) @@ -206,6 +283,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable _cookie = string.Empty; LoginState = new MusicLoginState(false); await _credentials.ClearAsync(Id, cancellationToken).ConfigureAwait(false); + if (_sessions is not null) await _sessions.ClearAsync(Id, cancellationToken).ConfigureAwait(false); } public async Task SearchAsync(string keywords, MusicSearchKind kind, int limit = 30, CancellationToken cancellationToken = default) @@ -230,6 +308,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable public async Task> GetUserPlaylistsAsync(CancellationToken cancellationToken = default) { await InitializeAsync(cancellationToken).ConfigureAwait(false); + if (LoginState.IsStale) await RefreshLoginStateAsync(false, cancellationToken).ConfigureAwait(false); if (!LoginState.LoggedIn) return []; var result = await GetAsync("https://music.163.com/api/user/playlist", new Dictionary { @@ -267,6 +346,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable public async Task> GetDailySongsAsync(CancellationToken cancellationToken = default) { await InitializeAsync(cancellationToken).ConfigureAwait(false); + if (LoginState.IsStale) await RefreshLoginStateAsync(false, cancellationToken).ConfigureAwait(false); if (!LoginState.LoggedIn) return []; var result = await GetAsync("https://music.163.com/api/v3/discovery/recommend/songs", new Dictionary { ["csrf_token"] = CsrfToken() }, cancellationToken).ConfigureAwait(false); return Array(result["data"]?["dailySongs"]).Select(MapSong).Where(song => !string.IsNullOrWhiteSpace(song.Id)).ToArray(); @@ -426,6 +506,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable public async Task SetFavoriteAsync(MusicSong song, bool favorite, CancellationToken cancellationToken = default) { + if (LoginState.IsStale) await RefreshLoginStateAsync(false, cancellationToken).ConfigureAwait(false); EnsureLoggedIn(); var result = await PostApiAsync("/api/song/like", new Dictionary { @@ -438,6 +519,7 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable public async Task SetPlaylistSubscribedAsync(MusicPlaylist playlist, bool subscribed, CancellationToken cancellationToken = default) { + if (LoginState.IsStale) await RefreshLoginStateAsync(false, cancellationToken).ConfigureAwait(false); EnsureLoggedIn(); var result = await PostApiAsync(subscribed ? "/api/playlist/subscribe" : "/api/playlist/unsubscribe", new Dictionary { @@ -463,12 +545,59 @@ public sealed partial class NeteaseMusicProvider : IMusicProvider, IDisposable var userId = Text(profile, "userId") ?? Text(profile, "id") ?? Text(account, "userId") ?? Text(account, "id") ?? ""; if (string.IsNullOrWhiteSpace(userId)) return new MusicLoginState(false); var vip = Math.Max(Integer(profile, "vipType"), Integer(account, "vipType")); - return new MusicLoginState( + return EnrichLoginState(new MusicLoginState( true, userId, Text(profile, "nickname") ?? Text(account, "userName") ?? Text(account, "nickname") ?? "网易云用户", Text(profile, "avatarUrl") ?? Text(account, "avatarUrl") ?? "", - vip >= 10 ? "svip" : vip >= 1 ? "vip" : "none"); + vip >= 10 ? "svip" : vip >= 1 ? "vip" : "none")); + } + + private async Task SaveSessionAsync(string credential, MusicLoginState state, CancellationToken cancellationToken) + { + if (_sessions is null || string.IsNullOrWhiteSpace(credential) || !state.LoggedIn) return; + await _sessions.SaveAsync(new MusicAccountSession( + DpapiMusicAccountSessionStore.CurrentVersion, + Id, + credential, + state, + DateTimeOffset.UtcNow), cancellationToken).ConfigureAwait(false); + } + + private static MusicLoginState EnrichLoginState(MusicLoginState state) + { + if (!state.LoggedIn) return state; + IReadOnlyList grants = state.VipLevel switch + { + "svip" => + [ + new("svip", "黑胶 SVIP", "membership", true), + new("vip", "黑胶 VIP", "membership", true) + ], + "vip" => [new("vip", "黑胶 VIP", "membership", true)], + _ => [] + }; + return state with + { + Entitlements = grants, + RefreshedAt = DateTimeOffset.UtcNow, + IsCached = false, + IsStale = false + }; + } + + private static IReadOnlyList BuildQualityOptions(MusicLoginState state) + { + var vip = state.Entitlements.Any(item => item.Enabled && item.PlatformCode is "vip" or "svip"); + var svip = state.Entitlements.Any(item => item.Enabled && item.PlatformCode == "svip"); + return + [ + new(MusicPlaybackQuality.Master, "超清母带", "FLAC", 2000, "黑胶 SVIP", svip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, svip ? null : "需要黑胶 SVIP"), + new(MusicPlaybackQuality.HiRes, "Hi-Res", "FLAC", 1200, "黑胶 VIP", vip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, vip ? null : "需要黑胶 VIP"), + new(MusicPlaybackQuality.Lossless, "无损", "FLAC", 900, "黑胶 VIP", vip ? MusicQualityAvailability.Available : MusicQualityAvailability.RequiresEntitlement, vip ? null : "需要黑胶 VIP"), + new(MusicPlaybackQuality.High, "极高", "MP3", 320, "", MusicQualityAvailability.Available), + new(MusicPlaybackQuality.Standard, "标准", "AAC", 128, "", MusicQualityAvailability.Available) + ]; } private async Task GetPlaylistDetailAsync(string id, CancellationToken cancellationToken) @@ -745,6 +874,7 @@ public static partial class MusicLyricsParser public static TimedLyrics Parse(string raw, string? translated = null, string? romanized = null, string? yrc = null) { var translations = ParseLrc(translated ?? "").ToDictionary(line => line.Start, line => line.Text); + var romanizations = ParseLrc(romanized ?? "").ToDictionary(line => line.Start, line => line.Text); var lines = string.IsNullOrWhiteSpace(yrc) ? ParseLrc(raw) : ParseYrc(yrc); if (lines.Count == 0 && !string.IsNullOrWhiteSpace(raw)) lines = ParseLrc(raw); var ordered = lines.OrderBy(line => line.Start).ToArray(); @@ -756,7 +886,8 @@ public static partial class MusicLyricsParser completed.Add(line with { Duration = line.Duration > TimeSpan.Zero ? line.Duration : next - line.Start, - Translation = translations.GetValueOrDefault(line.Start) + Translation = translations.GetValueOrDefault(line.Start), + Romanized = romanizations.GetValueOrDefault(line.Start) }); } return new TimedLyrics(completed, raw, translated, romanized); @@ -807,6 +938,67 @@ public static partial class MusicLyricsParser return lines.Count > 0 ? lines : ParseLrc(raw); } + public static TimedLyrics ParseKrc(string raw) + { + var translations = Array.Empty(); + var romanizations = Array.Empty(); + var language = KrcLanguageRegex().Match(raw); + if (language.Success) + { + try + { + var json = JsonNode.Parse(Encoding.UTF8.GetString(Convert.FromBase64String(language.Groups[1].Value))); + foreach (var block in json?["content"]?.AsArray() ?? []) + { + var values = block?["lyricContent"]?.AsArray() + .Select(item => item?.AsArray().FirstOrDefault()?.GetValue() ?? string.Empty) + .ToArray() ?? []; + if (block?["type"]?.GetValue() == 1) translations = values; + else if (block?["type"]?.GetValue() == 0) romanizations = values; + } + } + catch (Exception exception) when (exception is FormatException or JsonException) + { + } + } + + var parsed = new List(); + foreach (var rawLine in raw.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries)) + { + var lineMatch = KrcLineRegex().Match(rawLine); + if (!lineMatch.Success) continue; + var lineStartMs = long.Parse(lineMatch.Groups[1].Value, global::System.Globalization.CultureInfo.InvariantCulture); + var lineDurationMs = long.Parse(lineMatch.Groups[2].Value, global::System.Globalization.CultureInfo.InvariantCulture); + var text = new StringBuilder(); + var words = new List(); + foreach (Match wordMatch in KrcWordRegex().Matches(lineMatch.Groups[3].Value)) + { + var word = wordMatch.Groups[3].Value; + if (word.Length == 0) continue; + var characterStart = text.Length; + text.Append(word); + words.Add(new TimedLyricWord( + word, + TimeSpan.FromMilliseconds(lineStartMs + long.Parse(wordMatch.Groups[1].Value, global::System.Globalization.CultureInfo.InvariantCulture)), + TimeSpan.FromMilliseconds(long.Parse(wordMatch.Groups[2].Value, global::System.Globalization.CultureInfo.InvariantCulture)), + characterStart, + text.Length)); + } + if (text.Length == 0) continue; + var index = parsed.Count; + parsed.Add(new TimedLyricLine( + TimeSpan.FromMilliseconds(lineStartMs), + TimeSpan.FromMilliseconds(lineDurationMs), + text.ToString(), + index < translations.Length && !string.IsNullOrWhiteSpace(translations[index]) ? translations[index] : null, + words) + { + Romanized = index < romanizations.Length && !string.IsNullOrWhiteSpace(romanizations[index]) ? romanizations[index] : null + }); + } + return parsed.Count > 0 ? new TimedLyrics(parsed, raw, null, null) : Parse(raw); + } + [GeneratedRegex(@"\[(\d{1,3}):([0-5]?\d(?:\.\d{1,3})?)\]")] private static partial Regex LrcTimeRegex(); @@ -815,4 +1007,13 @@ public static partial class MusicLyricsParser [GeneratedRegex(@"\((\d+),(\d+),\d+\)([^()]*)")] private static partial Regex YrcWordRegex(); + + [GeneratedRegex(@"\[language:([A-Za-z0-9+/=]+)\]", RegexOptions.CultureInvariant)] + private static partial Regex KrcLanguageRegex(); + + [GeneratedRegex(@"^\[(\d+),(\d+)\](.*)$", RegexOptions.CultureInvariant)] + private static partial Regex KrcLineRegex(); + + [GeneratedRegex(@"<(\d+),(\d+),\d+>([^<]*)", RegexOptions.CultureInvariant)] + private static partial Regex KrcWordRegex(); } diff --git a/src/YMhut.Box.Core/Settings/AgreementDocument.cs b/src/YMhut.Box.Core/Settings/AgreementDocument.cs index 0c5609d..84cb43b 100644 --- a/src/YMhut.Box.Core/Settings/AgreementDocument.cs +++ b/src/YMhut.Box.Core/Settings/AgreementDocument.cs @@ -10,9 +10,9 @@ public static class AgreementDocument public const string MusicProviderDisclaimerId = "music-provider-disclaimer"; - public const string MusicProviderDisclaimerVersion = "1.0"; + public const string MusicProviderDisclaimerVersion = "2.1"; - public const int MusicProviderDisclaimerRevision = 1; + public const int MusicProviderDisclaimerRevision = 3; public const string CurrentVersion = "2.0.6.2"; public const int CurrentRevision = 1; diff --git a/src/YMhut.Box.Core/Settings/AppSettings.cs b/src/YMhut.Box.Core/Settings/AppSettings.cs index 9b1c44c..90537fe 100644 --- a/src/YMhut.Box.Core/Settings/AppSettings.cs +++ b/src/YMhut.Box.Core/Settings/AppSettings.cs @@ -1,5 +1,16 @@ +using YMhut.Box.Core.Music; + namespace YMhut.Box.Core.Settings; +public sealed class ToolUiPageState +{ + public Dictionary Values { get; set; } = new(StringComparer.OrdinalIgnoreCase); + + public Dictionary ExpandedSections { get; set; } = new(StringComparer.OrdinalIgnoreCase); + + public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow; +} + public sealed class AppSettings { public string Theme { get; set; } = "System"; @@ -46,6 +57,8 @@ public sealed class AppSettings public List PinnedToolIds { get; set; } = []; + public Dictionary ToolUiStates { get; set; } = new(StringComparer.OrdinalIgnoreCase); + public double? WindowX { get; set; } public double? WindowY { get; set; } @@ -80,6 +93,8 @@ public sealed class AppSettings public bool RequireRiskConfirmation { get; set; } = true; + public MusicLyricsSettings Lyrics { get; set; } = new(); + public string HomePageMode { get; set; } = "dashboard"; public string CloseBehavior { get; set; } = "ask"; diff --git a/src/YMhut.Box.Core/Settings/AppSettingsService.cs b/src/YMhut.Box.Core/Settings/AppSettingsService.cs index 47af02f..e43e34e 100644 --- a/src/YMhut.Box.Core/Settings/AppSettingsService.cs +++ b/src/YMhut.Box.Core/Settings/AppSettingsService.cs @@ -81,6 +81,38 @@ public sealed class AppSettingsService(AppSettingsStore store) : ISettingsServic }, cancellationToken).ConfigureAwait(false); } + public ToolUiPageState GetToolUiState(string toolId) + { + if (string.IsNullOrWhiteSpace(toolId) + || _current.ToolUiStates is null + || !_current.ToolUiStates.TryGetValue(toolId, out var state)) + { + return new ToolUiPageState(); + } + + return CloneToolUiState(state); + } + + public Task SaveToolUiStateAsync( + string toolId, + ToolUiPageState state, + CancellationToken cancellationToken = default) + { + if (string.IsNullOrWhiteSpace(toolId)) + { + throw new ArgumentException("Tool ID is required.", nameof(toolId)); + } + + ArgumentNullException.ThrowIfNull(state); + var snapshot = CloneToolUiState(state); + snapshot.UpdatedAt = DateTimeOffset.UtcNow; + return UpdateAsync(settings => + { + settings.ToolUiStates ??= new Dictionary(StringComparer.OrdinalIgnoreCase); + settings.ToolUiStates[toolId] = snapshot; + }, cancellationToken); + } + public Task SaveWindowBoundsAsync( double x, double y, @@ -103,4 +135,14 @@ public sealed class AppSettingsService(AppSettingsStore store) : ISettingsServic { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } + + private static ToolUiPageState CloneToolUiState(ToolUiPageState state) + { + return new ToolUiPageState + { + Values = new Dictionary(state.Values, StringComparer.OrdinalIgnoreCase), + ExpandedSections = new Dictionary(state.ExpandedSections, StringComparer.OrdinalIgnoreCase), + UpdatedAt = state.UpdatedAt + }; + } } diff --git a/src/YMhut.Box.Core/Settings/AppSettingsStore.cs b/src/YMhut.Box.Core/Settings/AppSettingsStore.cs index f2c94e0..a288aea 100644 --- a/src/YMhut.Box.Core/Settings/AppSettingsStore.cs +++ b/src/YMhut.Box.Core/Settings/AppSettingsStore.cs @@ -70,6 +70,8 @@ public sealed class AppSettingsStore settings.FeedbackDefaultType = NormalizeFeedbackType(settings.FeedbackDefaultType); settings.FeedbackDefaultSeverity = NormalizeFeedbackSeverity(settings.FeedbackDefaultSeverity); settings.GlobalHotkeys = HotkeySettingsDefaults.Normalize(settings.GlobalHotkeys); + NormalizeLyrics(settings); + NormalizeToolUiStates(settings); if (!settings.LegacyDatabaseImportCompleted) { @@ -100,11 +102,45 @@ public sealed class AppSettingsStore settings.FeedbackDefaultType = NormalizeFeedbackType(settings.FeedbackDefaultType); settings.FeedbackDefaultSeverity = NormalizeFeedbackSeverity(settings.FeedbackDefaultSeverity); settings.GlobalHotkeys = HotkeySettingsDefaults.Normalize(settings.GlobalHotkeys); + NormalizeLyrics(settings); + NormalizeToolUiStates(settings); Directory.CreateDirectory(Path.GetDirectoryName(_settingsPath)!); await using var stream = File.Create(_settingsPath); await JsonSerializer.SerializeAsync(stream, settings, JsonOptions, cancellationToken); } + private static void NormalizeLyrics(AppSettings settings) + { + settings.Lyrics ??= new YMhut.Box.Core.Music.MusicLyricsSettings(); + settings.Lyrics.FontScale = Math.Clamp(settings.Lyrics.FontScale, 0.75, 1.75); + settings.Lyrics.LineSpacing = Math.Clamp(settings.Lyrics.LineSpacing, 4, 32); + if ((settings.Lyrics.ActiveWordColor & unchecked((int)0xFF000000)) == 0) + { + settings.Lyrics.ActiveWordColor = unchecked((int)0xFF5E6D44); + } + } + + private static void NormalizeToolUiStates(AppSettings settings) + { + var normalized = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var entry in settings.ToolUiStates ?? []) + { + if (string.IsNullOrWhiteSpace(entry.Key) || entry.Value is null) + { + continue; + } + + normalized[entry.Key] = new ToolUiPageState + { + Values = new Dictionary(entry.Value.Values ?? [], StringComparer.OrdinalIgnoreCase), + ExpandedSections = new Dictionary(entry.Value.ExpandedSections ?? [], StringComparer.OrdinalIgnoreCase), + UpdatedAt = entry.Value.UpdatedAt + }; + } + + settings.ToolUiStates = normalized; + } + public async Task RecordRecentToolAsync(string toolId, CancellationToken cancellationToken = default) { var settings = await LoadAsync(cancellationToken); diff --git a/src/YMhut.Box.Core/Settings/ISettingsService.cs b/src/YMhut.Box.Core/Settings/ISettingsService.cs index fedf0ee..5c2630f 100644 --- a/src/YMhut.Box.Core/Settings/ISettingsService.cs +++ b/src/YMhut.Box.Core/Settings/ISettingsService.cs @@ -16,6 +16,13 @@ public interface ISettingsService : INotifyPropertyChanged Task RecordRecentToolAsync(string toolId, CancellationToken cancellationToken = default); + ToolUiPageState GetToolUiState(string toolId); + + Task SaveToolUiStateAsync( + string toolId, + ToolUiPageState state, + CancellationToken cancellationToken = default); + Task SaveWindowBoundsAsync( double x, double y, diff --git a/src/YMhut.Box.Core/Tools/ToolUiDefinition.cs b/src/YMhut.Box.Core/Tools/ToolUiDefinition.cs new file mode 100644 index 0000000..377bcba --- /dev/null +++ b/src/YMhut.Box.Core/Tools/ToolUiDefinition.cs @@ -0,0 +1,307 @@ +using System.Security.Cryptography; +using System.Buffers.Binary; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using YMhut.Box.Core.Data; +using YMhut.Box.Core.Logging; + +namespace YMhut.Box.Core.Tools; + +public enum ToolUiControlKind +{ + Text, + MultilineText, + Query, + ComboBox, + Toggle, + Number, + Date, + FilePicker, + Button, + Output, + WebView, + ExternalSurface +} + +public sealed record ToolUiText(string Zh, string En) +{ + public string ForLanguage(string? language) + => string.Equals(language, "en-US", StringComparison.OrdinalIgnoreCase) ? En : Zh; +} + +public sealed record ToolUiValidation( + string? Pattern = null, + double? Minimum = null, + double? Maximum = null, + int? MaxLength = null, + ToolUiText? Error = null); + +public sealed record ToolUiControl( + string Id, + ToolUiControlKind Kind, + ToolUiText Label, + string? Placeholder = null, + string? DefaultValue = null, + bool Required = false, + bool IsReadOnly = false, + ToolUiValidation? Validation = null); + +public sealed record ToolUiSection( + string Id, + ToolUiText Title, + ToolUiText Description, + IReadOnlyList Controls, + bool IsAdvanced = false, + string Layout = "stack"); + +public sealed record ToolUiAction( + string Id, + ToolUiText Label, + bool RequiresConfirmation = false, + bool IsEnabled = true); + +public sealed record ToolUiResultDefinition( + string Kind, + ToolUiText Title, + bool IsScrollable = true, + bool IsCopyable = true); + +public sealed record ToolUiDefinition( + string ToolId, + int SchemaVersion, + ToolUiText Title, + ToolUiText Description, + string RiskLevel, + IReadOnlyList Capabilities, + IReadOnlyList Sections, + IReadOnlyList Actions, + ToolUiResultDefinition Result, + bool IsFallback = false, + string? Diagnostic = null, + ToolUiText? ResponsiveHint = null, + bool AdvancedExpandedByDefault = false); + +public interface IToolUiDefinitionStore +{ + Task GetAsync(IToolModule module, CancellationToken cancellationToken = default); + + ToolUiDefinition GetFallback(IToolModule module, string? diagnostic = null); +} + +/// +/// Loads one immutable UI definition per tool. Definitions are data, while the +/// WinUI layer only owns safe rendering primitives and tool execution. +/// +public sealed class ToolUiDefinitionStore( + IReferenceDataService referenceDataService, + ILogService? logService = null) : IToolUiDefinitionStore +{ + private const string Magic = "YMHUTUI1"; + private static readonly HashSet AllowedActions = new(StringComparer.OrdinalIgnoreCase) + { + "run", "execute", "query", "format", "convert", "generate", "process", + "chooseFile", "choose-file", "clear", "copyResult", "copy-result", "reload", "cancel" + }; + private readonly Dictionary _cache = new(StringComparer.OrdinalIgnoreCase); + private readonly object _sync = new(); + + public async Task GetAsync(IToolModule module, CancellationToken cancellationToken = default) + { + if (module is null) throw new ArgumentNullException(nameof(module)); + lock (_sync) + { + if (_cache.TryGetValue(module.Id, out var cached)) return cached; + } + + var definitionId = module switch + { + ExternalToolModule => "external-tool-host", + _ when module.Metadata.Category == ToolCategory.Plugin => "plugin-host", + _ => module.Id + }; + var path = $"data/tool-ui/{definitionId}.dat"; + try + { + var resolution = referenceDataService.Resolve(path); + if (!resolution.Exists || string.IsNullOrWhiteSpace(resolution.FullPath) || !File.Exists(resolution.FullPath)) + { + return Cache(module.Id, GetFallback(module, $"Missing UI definition: {path}")); + } + + var bytes = await File.ReadAllBytesAsync(resolution.FullPath, cancellationToken).ConfigureAwait(false); + var definition = ToolUiDefinitionCodec.Decode(bytes); + if (!string.Equals(definitionId, module.Id, StringComparison.OrdinalIgnoreCase)) + { + definition = definition with + { + ToolId = module.Id, + Title = new ToolUiText(module.Metadata.Name, module.Metadata.Name), + Description = new ToolUiText(module.Metadata.Description, module.Metadata.Description) + }; + } + Validate(module, definition); + return Cache(module.Id, definition); + } + catch (Exception exception) when (exception is IOException or InvalidDataException or JsonException or CryptographicException or InvalidOperationException) + { + if (logService is not null) + { + await logService.WriteAsync("Warning", "tool-ui", "Tool UI definition was rejected", $"{module.Id}; {exception.Message}").ConfigureAwait(false); + } + + return Cache(module.Id, GetFallback(module, exception.Message)); + } + } + + public ToolUiDefinition GetFallback(IToolModule module, string? diagnostic = null) + { + var spec = ToolPageSpecCatalog.For(module); + var risky = module.Metadata.Category is ToolCategory.Security or ToolCategory.System; + var primary = spec.PrimaryInput switch + { + ToolPrimaryInputKind.MultilineText => ToolUiControlKind.MultilineText, + ToolPrimaryInputKind.Query or ToolPrimaryInputKind.Url or ToolPrimaryInputKind.Token => ToolUiControlKind.Query, + ToolPrimaryInputKind.Number or ToolPrimaryInputKind.NumberPair or ToolPrimaryInputKind.NumberTriple or ToolPrimaryInputKind.NumberQuad => ToolUiControlKind.Number, + ToolPrimaryInputKind.FilePath => ToolUiControlKind.FilePicker, + ToolPrimaryInputKind.None => ToolUiControlKind.Output, + _ => ToolUiControlKind.Text + }; + var title = new ToolUiText(module.Metadata.Name, module.Metadata.Name); + var description = new ToolUiText(module.Metadata.Description, module.Metadata.Description); + return new ToolUiDefinition( + module.Id, + 1, + title, + description, + risky ? "high" : "normal", + [module.Metadata.OfflineCapable ? "offline" : "network"], + [new ToolUiSection( + "safe-input", + new ToolUiText("安全输入", "Safe input"), + new ToolUiText("页面定义不可用时的最小安全入口。", "Minimal safe entry when the page definition is unavailable."), + [new ToolUiControl("primary", primary, new ToolUiText("输入", "Input"), Required: false)])], + [new ToolUiAction("run", new ToolUiText("执行", "Run"), risky, IsEnabled: string.IsNullOrWhiteSpace(diagnostic))], + new ToolUiResultDefinition("status", new ToolUiText("结果", "Result")), + IsFallback: true, + Diagnostic: diagnostic); + } + + private ToolUiDefinition Cache(string id, ToolUiDefinition definition) + { + lock (_sync) _cache[id] = definition; + return definition; + } + + private static void Validate(IToolModule module, ToolUiDefinition definition) + { + if (!string.Equals(module.Id, definition.ToolId, StringComparison.OrdinalIgnoreCase)) + throw new InvalidDataException("Tool UI definition ID does not match the requested tool."); + if (definition.SchemaVersion != 1) + throw new InvalidDataException($"Unsupported tool UI schema version: {definition.SchemaVersion}"); + if (definition.Sections.Count == 0 || definition.Actions.Count == 0) + throw new InvalidDataException("Tool UI definition must contain sections and actions."); + if (definition.Sections.SelectMany(section => section.Controls).Any(control => string.IsNullOrWhiteSpace(control.Id))) + throw new InvalidDataException("Tool UI controls must have IDs."); + if (definition.Sections.SelectMany(section => section.Controls).GroupBy(control => control.Id, StringComparer.OrdinalIgnoreCase).Any(group => group.Count() > 1)) + throw new InvalidDataException("Tool UI control IDs must be unique within a definition."); + if (definition.Sections.Any(section => section.Layout is not ("stack" or "grid" or "columns"))) + throw new InvalidDataException("Tool UI section layout is not supported."); + if (definition.Actions.Any(action => string.IsNullOrWhiteSpace(action.Id))) + throw new InvalidDataException("Tool UI actions must have IDs."); + if (definition.Actions.Any(action => !AllowedActions.Contains(action.Id))) + throw new InvalidDataException("Tool UI definition requests an unsupported action capability."); + if (definition.Actions.GroupBy(action => action.Id, StringComparer.OrdinalIgnoreCase).Any(group => group.Count() > 1)) + throw new InvalidDataException("Tool UI action IDs must be unique within a definition."); + } +} + +public static class ToolUiDefinitionCodec +{ + private const string Magic = "YMHUTUI1"; + private static readonly byte[] Key = SHA256.HashData(Encoding.UTF8.GetBytes("YMhut.Box.ToolUiDefinition.v1")); + private static readonly JsonSerializerOptions JsonOptions = CreateJsonOptions(); + + private static JsonSerializerOptions CreateJsonOptions() + { + var options = new JsonSerializerOptions(JsonSerializerDefaults.Web); + options.Converters.Add(new JsonStringEnumConverter()); + return options; + } + + public static byte[] Encode(ToolUiDefinition definition, bool encrypt = true) + { + var json = JsonSerializer.SerializeToUtf8Bytes(definition, JsonOptions); + if (!encrypt) return json; + + using var aes = Aes.Create(); + aes.Key = Key; + aes.GenerateIV(); + aes.Mode = CipherMode.CBC; + aes.Padding = PaddingMode.PKCS7; + using var encryptor = aes.CreateEncryptor(); + var cipher = encryptor.TransformFinalBlock(json, 0, json.Length); + var toolId = Encoding.UTF8.GetBytes(definition.ToolId); + if (toolId.Length is 0 or > 512) throw new InvalidDataException("Tool UI definition ID length is invalid."); + var digest = SHA256.HashData(json); + var output = new byte[Magic.Length + 1 + sizeof(ushort) + toolId.Length + digest.Length + aes.IV.Length + cipher.Length]; + Encoding.ASCII.GetBytes(Magic).CopyTo(output, 0); + output[Magic.Length] = 2; + BinaryPrimitives.WriteUInt16LittleEndian(output.AsSpan(Magic.Length + 1, sizeof(ushort)), checked((ushort)toolId.Length)); + var offset = Magic.Length + 1 + sizeof(ushort); + toolId.CopyTo(output, offset); + offset += toolId.Length; + digest.CopyTo(output, offset); + offset += digest.Length; + aes.IV.CopyTo(output, offset); + offset += aes.IV.Length; + cipher.CopyTo(output, offset); + return output; + } + + public static ToolUiDefinition Decode(byte[] bytes) + { + if (bytes is null || bytes.Length == 0) throw new InvalidDataException("Tool UI definition is empty."); + ReadOnlySpan payload = bytes; + string? envelopeToolId = null; + byte[]? expectedDigest = null; + if (bytes.Length >= Magic.Length + 1 + 16 && Encoding.ASCII.GetString(bytes, 0, Magic.Length) == Magic) + { + var version = bytes[Magic.Length]; + var offset = Magic.Length + 1; + if (version == 2) + { + if (bytes.Length < offset + sizeof(ushort)) throw new InvalidDataException("Tool UI v2 envelope is truncated."); + var toolIdLength = BinaryPrimitives.ReadUInt16LittleEndian(bytes.AsSpan(offset, sizeof(ushort))); + offset += sizeof(ushort); + if (toolIdLength is 0 or > 512 || bytes.Length < offset + toolIdLength + 32 + 16 + 1) + throw new InvalidDataException("Tool UI v2 envelope has invalid lengths."); + envelopeToolId = Encoding.UTF8.GetString(bytes, offset, toolIdLength); + offset += toolIdLength; + expectedDigest = bytes.AsSpan(offset, 32).ToArray(); + offset += 32; + } + else if (version != 1) + { + throw new InvalidDataException("Unsupported tool UI payload version."); + } + + using var aes = Aes.Create(); + aes.Key = Key; + aes.IV = bytes.AsSpan(offset, 16).ToArray(); + aes.Mode = CipherMode.CBC; + aes.Padding = PaddingMode.PKCS7; + using var decryptor = aes.CreateDecryptor(); + offset += 16; + payload = decryptor.TransformFinalBlock(bytes, offset, bytes.Length - offset); + if (expectedDigest is not null && !CryptographicOperations.FixedTimeEquals(expectedDigest, SHA256.HashData(payload))) + throw new InvalidDataException("Tool UI definition digest does not match the encrypted payload."); + } + + var definition = JsonSerializer.Deserialize(payload, JsonOptions); + if (definition is null) throw new InvalidDataException("Tool UI definition JSON is invalid."); + if (envelopeToolId is not null && !string.Equals(envelopeToolId, definition.ToolId, StringComparison.OrdinalIgnoreCase)) + throw new InvalidDataException("Tool UI envelope ID does not match its definition."); + return definition; + } +} diff --git a/src/YMhut.Box.InstallerBootstrap/InstallerWindow.cs b/src/YMhut.Box.InstallerBootstrap/InstallerWindow.cs index 1a6b367..6a3a30f 100644 --- a/src/YMhut.Box.InstallerBootstrap/InstallerWindow.cs +++ b/src/YMhut.Box.InstallerBootstrap/InstallerWindow.cs @@ -3,6 +3,7 @@ using Microsoft.UI; using Microsoft.UI.Text; using Microsoft.UI.Windowing; using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Automation; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Media.Imaging; @@ -28,6 +29,11 @@ public sealed class InstallerWindow : Window private static readonly SolidColorBrush WarningBrush = Brush("#FF9A6700"); private static readonly SolidColorBrush ErrorBrush = Brush("#FFB42318"); private static readonly SolidColorBrush WhiteBrush = Brush("#FFFFFF"); + private static readonly SolidColorBrush DisabledSurfaceBrush = Brush("#FFE7E4DE"); + private static readonly SolidColorBrush DisabledTextBrush = Brush("#FFA7A39B"); + private static readonly SolidColorBrush HoverSurfaceBrush = Brush("#FFECE9E3"); + private static readonly SolidColorBrush PressedSurfaceBrush = Brush("#FFDDD9D1"); + private static readonly SolidColorBrush FocusStrokeBrush = Brush("#FF6B675F"); private static readonly FontFamily ContentFont = new("MiSans VF, Microsoft YaHei UI, Segoe UI"); private readonly ContentControl _pageHost = new(); private readonly Border _titleDragArea = new(); @@ -41,7 +47,7 @@ public sealed class InstallerWindow : Window private readonly Button _cancelButton; private readonly TextBox _directory = new(); private readonly TextBlock _diskSpace = Text("正在检查磁盘空间", 12, foreground: SecondaryBrush); - private readonly CheckBox _licenseAccepted = new() { Content = "我已阅读并接受 GPL-3.0 许可条款" }; + private readonly CheckBox _licenseAccepted = new() { Content = "我已阅读并同意《YMhut Box 软件许可与服务协议》" }; private readonly CheckBox _desktopShortcut = new() { Content = "创建桌面快捷方式", IsChecked = true }; private readonly CheckBox _startMenuShortcut = new() { Content = "创建开始菜单快捷方式", IsChecked = true }; private readonly CheckBox _autoStart = new() { Content = "登录 Windows 后自动启动" }; @@ -363,14 +369,7 @@ public sealed class InstallerWindow : Window Background = SurfaceBrush, BorderBrush = StrokeBrush, BorderThickness = new Thickness(1), - Child = new ScrollViewer - { - VerticalScrollBarVisibility = ScrollBarVisibility.Auto, - HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, - HorizontalContentAlignment = HorizontalAlignment.Stretch, - Padding = new Thickness(0, 0, 10, 0), - Content = document - } + Child = PageScroll(document, new Thickness(0, 0, 10, 0), "许可协议") }; _licenseAccepted.Content = "我已阅读并同意《YMhut Box 软件许可与服务协议》"; _licenseAccepted.HorizontalAlignment = HorizontalAlignment.Left; @@ -436,16 +435,7 @@ public sealed class InstallerWindow : Window private UIElement EnvironmentCheckPage() { _preflightPanel.HorizontalAlignment = HorizontalAlignment.Stretch; - return new ScrollViewer - { - HorizontalAlignment = HorizontalAlignment.Stretch, - VerticalAlignment = VerticalAlignment.Stretch, - HorizontalContentAlignment = HorizontalAlignment.Stretch, - VerticalScrollBarVisibility = ScrollBarVisibility.Auto, - HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, - Padding = new Thickness(0, 0, 8, 0), - Content = _preflightPanel - }; + return PageScroll(_preflightPanel, new Thickness(0, 0, 8, 0), "环境检查"); } private void BeginEnvironmentCheck() @@ -601,16 +591,7 @@ public sealed class InstallerWindow : Window UpdateWorkspaceLayout(800); workspace.SizeChanged += (_, args) => UpdateWorkspaceLayout(args.NewSize.Width); - var workspaceScroll = new ScrollViewer - { - HorizontalAlignment = HorizontalAlignment.Stretch, - VerticalAlignment = VerticalAlignment.Stretch, - HorizontalContentAlignment = HorizontalAlignment.Stretch, - VerticalScrollBarVisibility = ScrollBarVisibility.Auto, - HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, - Padding = new Thickness(0, 0, 8, 0), - Content = workspace - }; + var workspaceScroll = PageScroll(workspace, new Thickness(0, 0, 8, 0), "安装进度"); var page = new Grid { @@ -760,6 +741,9 @@ public sealed class InstallerWindow : Window RefreshCompletePage(); } await Task.Delay(20); + var pageScroll = FindDescendant(_pageHost) + ?? throw new InvalidOperationException($"Installer page {step} does not expose a scroll surface."); + pageScroll.ChangeView(null, Math.Min(24, pageScroll.ScrollableHeight), null, disableAnimation: true); } await Task.Delay(100); return InstallerDiagnostics.ErrorCount == initialErrorCount; @@ -1176,11 +1160,53 @@ public sealed class InstallerWindow : Window return new DiskSpaceResult(new DriveInfo(root!).AvailableFreeSpace); } - private static StackPanel PageStack(params UIElement[] children) + private static ScrollViewer PageStack(params UIElement[] children) { var panel = new StackPanel { Spacing = 16, HorizontalAlignment = HorizontalAlignment.Stretch }; foreach (var child in children) panel.Children.Add(child); - return panel; + return PageScroll(panel, new Thickness(0, 0, 8, 0), "安装步骤"); + } + + private static ScrollViewer PageScroll(UIElement content, Thickness padding, string automationName) + { + var scroll = new ScrollViewer + { + HorizontalAlignment = HorizontalAlignment.Stretch, + VerticalAlignment = VerticalAlignment.Stretch, + HorizontalContentAlignment = HorizontalAlignment.Stretch, + VerticalContentAlignment = VerticalAlignment.Top, + VerticalScrollBarVisibility = ScrollBarVisibility.Auto, + HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, + VerticalScrollMode = ScrollMode.Enabled, + HorizontalScrollMode = ScrollMode.Disabled, + IsTabStop = true, + Padding = padding, + Content = content + }; + AutomationProperties.SetName(scroll, automationName); + scroll.PointerWheelChanged += (_, args) => + { + if (args.Handled || scroll.ScrollableHeight <= 0) + { + return; + } + + var delta = args.GetCurrentPoint(scroll).Properties.MouseWheelDelta; + if (delta == 0) + { + return; + } + + var target = Math.Clamp(scroll.VerticalOffset - delta, 0, scroll.ScrollableHeight); + if (Math.Abs(target - scroll.VerticalOffset) < 0.5) + { + return; + } + + scroll.ChangeView(null, target, null, disableAnimation: true); + args.Handled = true; + }; + return scroll; } private static Border PreflightBand(PreflightItem item) @@ -1263,12 +1289,16 @@ public sealed class InstallerWindow : Window private Button CommandButton(string title, string glyph, Func action, bool primary = false) { + var text = Text(title, 13, FontWeights.SemiBold, primary ? WhiteBrush : TextBrush); + var icon = new FontIcon { Glyph = glyph, FontSize = 13, Foreground = primary ? WhiteBrush : TextBrush }; var button = new Button { Padding = new Thickness(14, 8, 14, 8), CornerRadius = new CornerRadius(6), MinHeight = 38, FontFamily = ContentFont, + IsTabStop = true, + UseSystemFocusVisuals = true, Background = primary ? AccentBrush : SurfaceBrush, Foreground = primary ? WhiteBrush : TextBrush, BorderBrush = primary ? AccentBrush : StrokeBrush, @@ -1276,9 +1306,23 @@ public sealed class InstallerWindow : Window { Orientation = Orientation.Horizontal, Spacing = 7, - Children = { Text(title, 13, FontWeights.SemiBold, primary ? WhiteBrush : TextBrush), new FontIcon { Glyph = glyph, FontSize = 13 } } + Children = { text, icon } } }; + AutomationProperties.SetName(button, title); + button.Resources["ButtonBackground"] = primary ? AccentBrush : SurfaceBrush; + button.Resources["ButtonBackgroundPointerOver"] = HoverSurfaceBrush; + button.Resources["ButtonBackgroundPressed"] = PressedSurfaceBrush; + button.Resources["ButtonBackgroundDisabled"] = DisabledSurfaceBrush; + button.Resources["ButtonForegroundDisabled"] = DisabledTextBrush; + button.Resources["ButtonBorderBrushFocused"] = FocusStrokeBrush; + button.Resources["ButtonBorderBrushDisabled"] = DisabledSurfaceBrush; + button.IsEnabledChanged += (_, _) => + { + var foreground = button.IsEnabled ? (primary ? WhiteBrush : TextBrush) : DisabledTextBrush; + text.Foreground = foreground; + icon.Foreground = foreground; + }; button.Click += async (_, _) => await ExecuteCommandAsync(action); return button; } diff --git a/src/YMhut.Box.InstallerBootstrap/YMhut.Box.InstallerBootstrap.csproj b/src/YMhut.Box.InstallerBootstrap/YMhut.Box.InstallerBootstrap.csproj index bd26077..f6d8818 100644 --- a/src/YMhut.Box.InstallerBootstrap/YMhut.Box.InstallerBootstrap.csproj +++ b/src/YMhut.Box.InstallerBootstrap/YMhut.Box.InstallerBootstrap.csproj @@ -21,6 +21,7 @@ YMhutBoxSetup YMhut.Box.InstallerBootstrap ..\box-winUI\Assets\app_icon.ico + app.manifest diff --git a/src/YMhut.Box.InstallerBootstrap/app.manifest b/src/YMhut.Box.InstallerBootstrap/app.manifest new file mode 100644 index 0000000..fe28872 --- /dev/null +++ b/src/YMhut.Box.InstallerBootstrap/app.manifest @@ -0,0 +1,10 @@ + + + + + + true/pm + PerMonitorV2 + + + diff --git a/src/YMhut.Box.Tests/AppSettingsStoreTests.cs b/src/YMhut.Box.Tests/AppSettingsStoreTests.cs index 0b5cb74..a3254c2 100644 --- a/src/YMhut.Box.Tests/AppSettingsStoreTests.cs +++ b/src/YMhut.Box.Tests/AppSettingsStoreTests.cs @@ -36,6 +36,35 @@ public sealed class AppSettingsStoreTests settings.RecentToolIds); } + [TestMethod] + public async Task ToolUiStateIsPersistedPerToolWithoutChangingTheDefinitionPayload() + { + var root = Path.Combine(Path.GetTempPath(), "ymhut-box-tests", Guid.NewGuid().ToString("N")); + var service = new AppSettingsService(new AppSettingsStore(root)); + await service.LoadAsync(); + + await service.SaveToolUiStateAsync("json_formatter", new ToolUiPageState + { + Values = new Dictionary { ["input"] = "{\"value\":1}" }, + ExpandedSections = new Dictionary { ["advanced"] = true } + }); + await service.SaveToolUiStateAsync("safe_browser", new ToolUiPageState + { + Values = new Dictionary { ["input"] = "https://example.com" } + }); + + var reloadedService = new AppSettingsService(new AppSettingsStore(root)); + await reloadedService.LoadAsync(); + var formatter = reloadedService.GetToolUiState("json_formatter"); + var browser = reloadedService.GetToolUiState("safe_browser"); + + Assert.AreEqual("{\"value\":1}", formatter.Values["input"]); + Assert.IsTrue(formatter.ExpandedSections["advanced"]); + Assert.AreEqual("https://example.com", browser.Values["input"]); + Assert.IsFalse(browser.Values.ContainsKey("advanced")); + Assert.IsFalse(reloadedService.GetToolUiState("missing").Values.Any()); + } + [TestMethod] public async Task LoadAsyncImportsLegacySettingsOnce() { diff --git a/src/YMhut.Box.Tests/DevTerminalAndSerialTests.cs b/src/YMhut.Box.Tests/DevTerminalAndSerialTests.cs index 60f60bd..d238c53 100644 --- a/src/YMhut.Box.Tests/DevTerminalAndSerialTests.cs +++ b/src/YMhut.Box.Tests/DevTerminalAndSerialTests.cs @@ -33,6 +33,7 @@ public sealed class DevTerminalAndSerialTests Assert.IsTrue(snapshot.IsWindowsTerminalDefault); Assert.IsTrue(snapshot.IsPowerShellDefaultProfile); Assert.IsTrue(snapshot.IsAdministrator); + Assert.IsFalse(platform.RunCalls.Any(call => call.Contains("wt.exe --version", StringComparison.OrdinalIgnoreCase))); } [TestMethod] @@ -194,6 +195,8 @@ public sealed class DevTerminalAndSerialTests public bool PowerShellDefaultProfile { get; set; } + public string TerminalVersion { get; set; } = "Windows Terminal 1.23.0"; + public bool TerminalFallbackResult { get; set; } = true; public bool PowerShellFallbackResult { get; set; } = true; @@ -210,6 +213,12 @@ public sealed class DevTerminalAndSerialTests return Task.FromResult(Commands.TryGetValue(command, out var path) ? path : string.Empty); } + public Task GetWindowsTerminalVersionAsync(CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + return Task.FromResult(TerminalVersion); + } + public Task RunAsync( string fileName, string arguments, @@ -235,7 +244,7 @@ public sealed class DevTerminalAndSerialTests } if (fileName.EndsWith("wt.exe", StringComparison.OrdinalIgnoreCase)) { - return Task.FromResult(new DevTerminalCommandResult(0, "Windows Terminal 1.23.0", string.Empty)); + return Task.FromResult(new DevTerminalCommandResult(0, TerminalVersion, string.Empty)); } if (fileName.EndsWith("pwsh.exe", StringComparison.OrdinalIgnoreCase)) { diff --git a/src/YMhut.Box.Tests/KugouMusicProviderTests.cs b/src/YMhut.Box.Tests/KugouMusicProviderTests.cs index 372b292..fbade58 100644 --- a/src/YMhut.Box.Tests/KugouMusicProviderTests.cs +++ b/src/YMhut.Box.Tests/KugouMusicProviderTests.cs @@ -363,8 +363,8 @@ public sealed class KugouMusicProviderTests Assert.IsTrue(stream.Playable); Assert.AreEqual(MusicPlaybackQuality.HiRes, stream.Quality); Assert.AreEqual(new Uri("https://media.test/song.flac"), stream.Uri); - CollectionAssert.AreEqual(new[] { "viper_tape", "high" }, qualities); - CollectionAssert.AreEqual(new[] { "master-hash", "hires-hash" }, hashes); + CollectionAssert.AreEqual(new[] { "viper_tape", "viper_tape", "high" }, qualities); + CollectionAssert.AreEqual(new[] { "master-hash", "master-hash", "hires-hash" }, hashes); StringAssert.Contains(stream.ProviderReason, "回退"); } @@ -374,6 +374,7 @@ public sealed class KugouMusicProviderTests CapturedRequest? privilegeRequest = null; string? privilegeRouter = null; string? playbackHash = null; + Dictionary? playbackQuery = null; using var provider = new KugouMusicProvider(AccountStore(), new StubHttpHandler(async (request, _) => { if (request.RequestUri!.AbsolutePath == "/v7/get_all_list") return JsonResponse(UserLists()); @@ -389,7 +390,8 @@ public sealed class KugouMusicProviderTests } if (request.RequestUri.AbsolutePath == "/v5/url") { - playbackHash = ParseQuery(request.RequestUri)["hash"]; + playbackQuery = ParseQuery(request.RequestUri); + playbackHash = playbackQuery["hash"]; return JsonResponse(""" {"status":1,"data":[{"url":["http://media.test/song.flac","https://media.test/song.flac"],"bitrate":800}]} """); @@ -405,6 +407,10 @@ public sealed class KugouMusicProviderTests StringAssert.Contains(privilegeRequest.Body, "\"qualities\""); StringAssert.Contains(privilegeRequest.Body, "\"album_id\":17"); Assert.AreEqual("lossless-hash", playbackHash); + Assert.IsNotNull(playbackQuery); + Assert.AreEqual("1005", playbackQuery["appid"]); + Assert.AreEqual("151369488", playbackQuery["page_id"]); + Assert.AreEqual("2", playbackQuery["pid"]); Assert.AreEqual(new Uri("https://media.test/song.flac"), stream.Uri); Assert.AreEqual(800_000L, stream.Bitrate); } @@ -435,6 +441,67 @@ public sealed class KugouMusicProviderTests Assert.IsTrue(stream.Playable); } + [TestMethod] + public async Task PlaybackFallsBackToOfficialTrialWhenFullUrlIsUnavailable() + { + var freePartValues = new List(); + using var provider = new KugouMusicProvider(AccountStore(), new StubHttpHandler((request, _) => + { + if (request.RequestUri!.AbsolutePath == "/v7/get_all_list") + { + return Task.FromResult(JsonResponse(UserLists())); + } + if (request.RequestUri.AbsolutePath == "/v2/get_res_privilege/lite") + { + return Task.FromResult(JsonResponse("{\"status\":1}")); + } + + var freePart = ParseQuery(request.RequestUri)["IsFreePart"]; + freePartValues.Add(freePart); + return Task.FromResult(JsonResponse(freePart == "1" + ? "{\"status\":1,\"url\":[\"https://media.test/trial.mp3\"],\"bitRate\":128}" + : "{\"status\":1,\"url\":[]}")); + })); + await provider.InitializeAsync(); + + var stream = await provider.ResolveStreamAsync("HASH|1", MusicPlaybackQuality.Standard); + + CollectionAssert.AreEqual(new[] { "0", "1" }, freePartValues); + Assert.IsTrue(stream.Playable); + Assert.IsTrue(stream.Trial); + Assert.AreEqual(new Uri("https://media.test/trial.mp3"), stream.Uri); + StringAssert.Contains(stream.ProviderReason, "试听"); + } + + [TestMethod] + public async Task PlaybackUpgradesTrustedKugouMediaAddressToHttps() + { + using var provider = new KugouMusicProvider(DeviceStore(), new StubHttpHandler((request, _) => + Task.FromResult(JsonResponse(request.RequestUri!.AbsolutePath == "/v2/get_res_privilege/lite" + ? "{\"status\":1}" + : "{\"status\":1,\"url\":[\"http://fsmobile.kugou.com/audio/song.mp3\"],\"bitRate\":128,\"is_full_audio\":1}")))); + + var stream = await provider.ResolveStreamAsync("HASH|1", MusicPlaybackQuality.Standard); + + Assert.IsTrue(stream.Playable); + Assert.IsFalse(stream.Trial); + Assert.AreEqual(new Uri("https://fsmobile.kugou.com/audio/song.mp3"), stream.Uri); + } + + [TestMethod] + public async Task PlaybackRejectsUntrustedHttpMediaAddress() + { + using var provider = new KugouMusicProvider(DeviceStore(), new StubHttpHandler((request, _) => + Task.FromResult(JsonResponse(request.RequestUri!.AbsolutePath == "/v2/get_res_privilege/lite" + ? "{\"status\":1}" + : "{\"status\":1,\"url\":[\"http://media.example.test/song.mp3\"]}")))); + + var stream = await provider.ResolveStreamAsync("HASH|1", MusicPlaybackQuality.Standard); + + Assert.IsFalse(stream.Playable); + Assert.IsNull(stream.Uri); + } + [TestMethod] public async Task FavoriteAndUnfavoriteUseLikedListAndRefreshedFileId() { diff --git a/src/YMhut.Box.Tests/MusicAndHotkeyTests.cs b/src/YMhut.Box.Tests/MusicAndHotkeyTests.cs index 01068f6..7bf6c00 100644 --- a/src/YMhut.Box.Tests/MusicAndHotkeyTests.cs +++ b/src/YMhut.Box.Tests/MusicAndHotkeyTests.cs @@ -113,6 +113,45 @@ public sealed class MusicAndHotkeyTests Assert.AreEqual(TimeSpan.FromMilliseconds(500), lines[0].Words[0].Duration); } + [TestMethod] + public void LyricsParserAlignsTranslationAndRomanizationByTimestamp() + { + var lyrics = MusicLyricsParser.Parse( + "[00:01.00]原文", + "[00:01.00]translation", + "[00:01.00]romanized"); + + Assert.HasCount(1, lyrics.Lines); + Assert.AreEqual("translation", lyrics.Lines[0].Translation); + Assert.AreEqual("romanized", lyrics.Lines[0].Romanized); + } + + [TestMethod] + public void KrcParserKeepsWordsTranslationAndRomanization() + { + var language = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes( + "{\"content\":[{\"type\":1,\"lyricContent\":[[\"translation\"]]},{\"type\":0,\"lyricContent\":[[\"romanized\"]]}]}")); + var lyrics = MusicLyricsParser.ParseKrc($"[language:{language}]\n[1000,1200]<0,500,0>逐<500,700,0>字"); + + Assert.HasCount(1, lyrics.Lines); + Assert.AreEqual("逐字", lyrics.Lines[0].Text); + Assert.AreEqual("translation", lyrics.Lines[0].Translation); + Assert.AreEqual("romanized", lyrics.Lines[0].Romanized); + Assert.HasCount(2, lyrics.Lines[0].Words); + Assert.AreEqual(TimeSpan.FromMilliseconds(1500), lyrics.Lines[0].Words[1].Start); + } + + [TestMethod] + public void LocalApiPostTimestampsAreStrictlyIncreasing() + { + var first = KugouLocalApiProxyHandler.NextTimestamp(); + var second = KugouLocalApiProxyHandler.NextTimestamp(); + var third = KugouLocalApiProxyHandler.NextTimestamp(); + + Assert.IsGreaterThan(first, second); + Assert.IsGreaterThan(second, third); + } + [TestMethod] public void HotkeyNormalizationRestoresDefaultsAndTrimsOverrides() { diff --git a/src/YMhut.Box.Tests/MusicSessionStoreTests.cs b/src/YMhut.Box.Tests/MusicSessionStoreTests.cs index 548f7b3..b8b5e40 100644 --- a/src/YMhut.Box.Tests/MusicSessionStoreTests.cs +++ b/src/YMhut.Box.Tests/MusicSessionStoreTests.cs @@ -7,6 +7,35 @@ namespace YMhut.Box.Tests; [TestClass] public sealed class MusicSessionStoreTests { + [TestMethod] + public async Task AccountSnapshotIsDpapiEncryptedAndRoundTripsEntitlements() + { + if (!OperatingSystem.IsWindows()) Assert.Inconclusive("DPAPI is Windows-only."); + var root = Path.Combine(Path.GetTempPath(), "ymhut-music-account-tests", Guid.NewGuid().ToString("N")); + try + { + var store = new DpapiMusicAccountSessionStore(new AppPaths(root)); + var login = new MusicLoginState(true, "42", "Listener", VipLevel: "vip") + { + Entitlements = [new("vip", "VIP", "membership", true, DateTimeOffset.UtcNow.AddDays(10))], + RefreshedAt = DateTimeOffset.UtcNow + }; + await store.SaveAsync(new MusicAccountSession(1, "netease", "MUSIC_U=secret-token", login, DateTimeOffset.UtcNow)); + + var restored = await store.LoadAsync("netease"); + var encrypted = await File.ReadAllBytesAsync(Path.Combine(root, "Data", "Music", "Sessions", "netease.bin")); + + Assert.IsNotNull(restored); + Assert.AreEqual("MUSIC_U=secret-token", restored.Credential); + Assert.HasCount(1, restored.LoginState.Entitlements); + Assert.IsFalse(System.Text.Encoding.UTF8.GetString(encrypted).Contains("secret-token", StringComparison.Ordinal)); + } + finally + { + if (Directory.Exists(root)) Directory.Delete(root, recursive: true); + } + } + [TestMethod] public async Task ConcurrentSavesAreSerializedAndLeaveNoTemporaryFiles() { diff --git a/src/YMhut.Box.Tests/NeteaseMusicProviderTests.cs b/src/YMhut.Box.Tests/NeteaseMusicProviderTests.cs index 38a2fee..1709dc2 100644 --- a/src/YMhut.Box.Tests/NeteaseMusicProviderTests.cs +++ b/src/YMhut.Box.Tests/NeteaseMusicProviderTests.cs @@ -9,6 +9,109 @@ namespace YMhut.Box.Tests; [TestClass] public sealed class NeteaseMusicProviderTests { + [TestMethod] + public async Task FreshAccountSnapshotInitializesWithoutNetworkRequest() + { + var requests = 0; + var sessions = new MemoryAccountSessionStore(AccountSession(DateTimeOffset.UtcNow)); + using var provider = new NeteaseMusicProvider( + new MemoryCredentialStore(), + handler: new StubHttpHandler(_ => + { + requests++; + throw new InvalidOperationException("A fresh snapshot must not touch the network."); + }), + sessions: sessions); + + await provider.InitializeAsync(); + + Assert.AreEqual(0, requests); + Assert.IsTrue(provider.LoginState.LoggedIn); + Assert.IsTrue(provider.LoginState.IsCached); + Assert.IsFalse(provider.LoginState.IsStale); + } + + [TestMethod] + public async Task StaleAccountSnapshotRefreshesOnDemandAfterTwelveHours() + { + var requests = 0; + var sessions = new MemoryAccountSessionStore(AccountSession(DateTimeOffset.UtcNow.AddHours(-13))); + using var provider = new NeteaseMusicProvider( + new MemoryCredentialStore(), + handler: new StubHttpHandler(_ => + { + requests++; + return Task.FromResult(JsonResponse("{\"code\":200,\"account\":{\"id\":42,\"userName\":\"Updated User\",\"vipType\":1},\"profile\":null}")); + }), + sessions: sessions); + + await provider.InitializeAsync(); + Assert.AreEqual(0, requests); + Assert.IsTrue(provider.LoginState.IsStale); + + var refreshed = await provider.RefreshLoginStateAsync(); + + Assert.AreEqual(1, requests); + Assert.AreEqual("Updated User", refreshed.Nickname); + Assert.IsFalse(refreshed.IsCached); + Assert.IsFalse(refreshed.IsStale); + Assert.IsNotNull(sessions.Session); + Assert.AreEqual("Updated User", sessions.Session.LoginState.Nickname); + } + + [TestMethod] + public async Task ConcurrentAccountRefreshesShareOneNetworkRequest() + { + var requests = 0; + var entered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var release = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var sessions = new MemoryAccountSessionStore(AccountSession(DateTimeOffset.UtcNow.AddHours(-13))); + using var provider = new NeteaseMusicProvider( + new MemoryCredentialStore(), + handler: new StubHttpHandler(async _ => + { + requests++; + entered.TrySetResult(); + await release.Task; + return JsonResponse("{\"code\":200,\"account\":{\"id\":42,\"userName\":\"Updated User\",\"vipType\":1},\"profile\":null}"); + }), + sessions: sessions); + await provider.InitializeAsync(); + + var first = provider.RefreshLoginStateAsync(); + await entered.Task; + var second = provider.RefreshLoginStateAsync(); + release.TrySetResult(); + await Task.WhenAll(first, second); + + Assert.AreEqual(1, requests); + } + + [TestMethod] + public async Task TransientAccountRefreshFailureIsThrottledAndKeepsSnapshot() + { + var requests = 0; + var sessions = new MemoryAccountSessionStore(AccountSession(DateTimeOffset.UtcNow.AddHours(-13))); + using var provider = new NeteaseMusicProvider( + new MemoryCredentialStore(), + handler: new StubHttpHandler(_ => + { + requests++; + throw new HttpRequestException("offline"); + }), + sessions: sessions); + await provider.InitializeAsync(); + + var first = await provider.RefreshLoginStateAsync(); + var second = await provider.RefreshLoginStateAsync(); + + Assert.AreEqual(1, requests); + Assert.IsTrue(first.LoggedIn); + Assert.IsTrue(first.IsCached); + Assert.IsTrue(first.IsStale); + Assert.AreEqual(first, second); + } + [TestMethod] public async Task SearchUsesConsistentDesktopWebHeaders() { @@ -300,6 +403,18 @@ public sealed class NeteaseMusicProviderTests private static HttpResponseMessage JsonResponse(string json) => new(HttpStatusCode.OK) { Content = new StringContent(json, Encoding.UTF8, "application/json") }; + private static MusicAccountSession AccountSession(DateTimeOffset refreshedAt) + => new( + DpapiMusicAccountSessionStore.CurrentVersion, + "netease", + "MUSIC_U=cached-token; __csrf=cached-csrf", + new MusicLoginState(true, "42", "Cached User", VipLevel: "vip") + { + RefreshedAt = refreshedAt, + Entitlements = [new("vip", "黑胶 VIP", "membership", true)] + }, + refreshedAt); + private sealed class StubHttpHandler(Func> responseFactory) : HttpMessageHandler { protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) @@ -328,6 +443,26 @@ public sealed class NeteaseMusicProviderTests } } + private sealed class MemoryAccountSessionStore(MusicAccountSession? session) : IMusicAccountSessionStore + { + public MusicAccountSession? Session { get; private set; } = session; + + public Task LoadAsync(string provider, CancellationToken cancellationToken = default) + => Task.FromResult(Session?.Provider.Equals(provider, StringComparison.OrdinalIgnoreCase) == true ? Session : null); + + public Task SaveAsync(MusicAccountSession updated, CancellationToken cancellationToken = default) + { + Session = updated; + return Task.CompletedTask; + } + + public Task ClearAsync(string provider, CancellationToken cancellationToken = default) + { + if (Session?.Provider.Equals(provider, StringComparison.OrdinalIgnoreCase) == true) Session = null; + return Task.CompletedTask; + } + } + private sealed record CapturedRequest( HttpMethod Method, Uri Uri, diff --git a/src/YMhut.Box.Tests/ToolExecutorTests.cs b/src/YMhut.Box.Tests/ToolExecutorTests.cs index 056e6b0..3fe2db5 100644 --- a/src/YMhut.Box.Tests/ToolExecutorTests.cs +++ b/src/YMhut.Box.Tests/ToolExecutorTests.cs @@ -741,6 +741,26 @@ public sealed class ToolExecutorTests Assert.IsFalse(string.IsNullOrWhiteSpace(latest.GetProperty("release_notes").GetString())); Assert.AreEqual(latestVersion, totalRoot.GetProperty("versions")[0].GetProperty("version").GetString()); Assert.IsFalse(string.IsNullOrWhiteSpace(totalRoot.GetProperty("versions")[0].GetProperty("summary").GetString())); + + Assert.AreEqual("2.0.7.14", latestVersion); + Assert.AreEqual("2026-08-18", noticeRoot.GetProperty("release_date").GetString()); + Assert.IsTrue(noticeRoot.GetProperty("download_url").GetString()!.Contains("2.0.7.14", StringComparison.Ordinal)); + Assert.AreEqual("2.0.7.14", totalRoot.GetProperty("versions")[0].GetProperty("version").GetString()); + Assert.AreEqual("2.0.7.13", totalRoot.GetProperty("versions")[1].GetProperty("version").GetString()); + Assert.AreEqual("2026-08-17", JsonDocument.Parse(File.ReadAllText(Path.Combine(repoRoot, "update-notice", "2.0.7.13.json"))).RootElement.GetProperty("release_date").GetString()); + Assert.IsTrue(File.ReadAllText(Path.Combine(repoRoot, "update-notice", "2.0.7.13.json")).Contains("MoeKoeMusic", StringComparison.Ordinal)); + Assert.IsTrue(File.ReadAllText(Path.Combine(repoRoot, "update-notice", "2.0.7.14.json")).Contains("PerMonitorV2", StringComparison.Ordinal)); + + foreach (var manifestPath in new[] + { + Path.Combine(repoRoot, "src", "box-winUI", "app.manifest"), + Path.Combine(repoRoot, "src", "YMhut.Box.InstallerBootstrap", "app.manifest") + }) + { + var manifest = File.ReadAllText(manifestPath); + StringAssert.Contains(manifest, "PerMonitorV2"); + StringAssert.Contains(manifest, "true/pm"); + } } [TestMethod] diff --git a/src/YMhut.Box.Tests/ToolUiDefinitionTests.cs b/src/YMhut.Box.Tests/ToolUiDefinitionTests.cs new file mode 100644 index 0000000..611882e --- /dev/null +++ b/src/YMhut.Box.Tests/ToolUiDefinitionTests.cs @@ -0,0 +1,237 @@ +using YMhut.Box.Core.Data; +using YMhut.Box.Core.Plugins; +using YMhut.Box.Core.Tools; + +namespace YMhut.Box.Tests; + +[TestClass] +public sealed class ToolUiDefinitionTests +{ + [TestMethod] + public void EncryptedPayloadRoundTripsDefinition() + { + var definition = new ToolUiDefinition( + "sample", + 1, + new ToolUiText("示例", "Sample"), + new ToolUiText("描述", "Description"), + "normal", + ["offline"], + [new ToolUiSection( + "input", + new ToolUiText("输入", "Input"), + new ToolUiText("说明", "Description"), + [new ToolUiControl("value", ToolUiControlKind.Text, new ToolUiText("值", "Value"))])], + [new ToolUiAction("run", new ToolUiText("执行", "Run"))], + new ToolUiResultDefinition("status", new ToolUiText("结果", "Result"))); + + var decoded = ToolUiDefinitionCodec.Decode(ToolUiDefinitionCodec.Encode(definition)); + + Assert.AreEqual(definition.ToolId, decoded.ToolId); + Assert.AreEqual(definition.Sections[0].Controls[0].Kind, decoded.Sections[0].Controls[0].Kind); + Assert.AreEqual(definition.Actions[0].Id, decoded.Actions[0].Id); + } + + [TestMethod] + public void CodecAcceptsDevelopmentJsonPayload() + { + var definition = new ToolUiDefinition( + "json_tool", + 1, + new ToolUiText("JSON", "JSON"), + new ToolUiText("描述", "Description"), + "normal", + [], + [new ToolUiSection("input", new ToolUiText("输入", "Input"), new ToolUiText("", ""), [])], + [new ToolUiAction("run", new ToolUiText("执行", "Run"))], + new ToolUiResultDefinition("status", new ToolUiText("结果", "Result"))); + + var json = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(definition); + var decoded = ToolUiDefinitionCodec.Decode(json); + + Assert.AreEqual("json_tool", decoded.ToolId); + } + + [TestMethod] + public void GeneratedToolDefinitionPayloadIsReadable() + { + var path = Path.Combine(FindRepositoryRoot(), "assets", "data", "tool-ui", "json_formatter.dat"); + Assert.IsTrue(File.Exists(path), "The generated tool UI payload is missing from the repository."); + var definition = ToolUiDefinitionCodec.Decode(File.ReadAllBytes(path)); + + Assert.AreEqual("json_formatter", definition.ToolId); + Assert.IsGreaterThanOrEqualTo(2, definition.Sections.Count); + Assert.IsTrue(definition.Sections.SelectMany(section => section.Controls).Any(control => control.Id == "rules")); + Assert.AreEqual("json-tree", definition.Result.Kind); + } + + [TestMethod] + public void EveryGeneratedToolDefinitionHasAValidV2Envelope() + { + var folder = Path.Combine(FindRepositoryRoot(), "assets", "data", "tool-ui"); + var files = Directory.GetFiles(folder, "*.dat", SearchOption.TopDirectoryOnly); + + Assert.IsGreaterThanOrEqualTo(202, files.Length); + foreach (var file in files) + { + var bytes = File.ReadAllBytes(file); + Assert.IsGreaterThan(9, bytes.Length, file); + Assert.AreEqual(2, bytes[8], file); + var definition = ToolUiDefinitionCodec.Decode(bytes); + Assert.AreEqual(Path.GetFileNameWithoutExtension(file), definition.ToolId, true, file); + Assert.IsNotEmpty(definition.Sections, file); + Assert.IsNotEmpty(definition.Actions, file); + Assert.HasCount( + definition.Sections.SelectMany(section => section.Controls).Select(control => control.Id).Distinct(StringComparer.OrdinalIgnoreCase).Count(), + definition.Sections.SelectMany(section => section.Controls), + file); + } + } + + [TestMethod] + public void EncryptedPayloadRejectsTampering() + { + var definition = new ToolUiDefinition( + "tamper-test", + 1, + new ToolUiText("测试", "Test"), + new ToolUiText("摘要校验", "Digest validation"), + "normal", + [], + [new ToolUiSection("input", new ToolUiText("输入", "Input"), new ToolUiText("", ""), + [new ToolUiControl("primary", ToolUiControlKind.Text, new ToolUiText("值", "Value"))])], + [new ToolUiAction("run", new ToolUiText("执行", "Run"))], + new ToolUiResultDefinition("text", new ToolUiText("结果", "Result"))); + var bytes = ToolUiDefinitionCodec.Encode(definition); + bytes[11 + "tamper-test".Length] ^= 0x01; + + Assert.ThrowsExactly(() => ToolUiDefinitionCodec.Decode(bytes)); + } + + [TestMethod] + public async Task MissingDefinitionReturnsDisabledSafeFallback() + { + var module = new ToolModule(new ToolMetadata( + "missing-definition", + "Missing definition", + "Fallback test", + ToolCategory.Text, + [], + true, + "\uE8D2")); + var store = new ToolUiDefinitionStore(new MissingReferenceDataService()); + + var definition = await store.GetAsync(module); + + Assert.IsTrue(definition.IsFallback); + Assert.IsNotNull(definition.Diagnostic); + Assert.IsFalse(definition.Actions.Single().IsEnabled); + } + + [TestMethod] + public async Task PluginAndExternalModulesUseHostDefinitionsWithTheirOwnIds() + { + var root = FindRepositoryRoot(); + var store = new ToolUiDefinitionStore(new RepositoryReferenceDataService(root)); + var manifest = new PluginManifest( + "demo-plugin", + "Demo plugin", + "1.0.0", + "tester", + "Plugin test", + "index.html", + [], + [new PluginSurface(PluginSurfaceKind.ToolboxTool, "tool", "Demo tool", "Tool")], + []); + var plugin = new LoadedPlugin( + manifest, + root, + new PluginRuntimeState("demo-plugin", true, new HashSet(), new HashSet(), null), + []); + var pluginDefinition = await store.GetAsync(new PluginToolModule(plugin, manifest.Surfaces[0])); + + var external = new ExternalToolModule(new ExternalToolItem( + "external:demo", + "Demo external", + "External test", + "test", + ToolCategory.Dev, + root, + "demo.exe", + "demo.exe", + ".exe", + "tester", + "1.0", + null, + null, + "x64", + [], + [], + ReferenceToolRiskLevel.None, + false)); + var externalDefinition = await store.GetAsync(external); + + Assert.IsFalse(pluginDefinition.IsFallback); + Assert.AreEqual("plugin:demo-plugin:tool", pluginDefinition.ToolId); + Assert.IsFalse(externalDefinition.IsFallback); + Assert.AreEqual("external:demo", externalDefinition.ToolId); + Assert.AreEqual("Demo external", externalDefinition.Title.Zh); + } + + private static string FindRepositoryRoot() + { + var directory = new DirectoryInfo(AppContext.BaseDirectory); + while (directory is not null) + { + if (File.Exists(Path.Combine(directory.FullName, "YMhut.Box.Native.sln"))) + { + return directory.FullName; + } + + directory = directory.Parent; + } + + throw new DirectoryNotFoundException("Repository root was not found from the test output directory."); + } + + private sealed class MissingReferenceDataService : IReferenceDataService + { + public Task ReadTextAsync(string relativePath, CancellationToken cancellationToken = default) + => Task.FromResult(null); + + public ReferenceDataResolution Resolve(string relativePath) + => new(relativePath, null, false, [relativePath]); + + public Task ReadJsonAsync(string relativePath, CancellationToken cancellationToken = default) + => Task.FromResult(default(T)); + + public bool Exists(string relativePath) => false; + + public IReadOnlyList EnumerateFiles(string relativeDirectory, string searchPattern = "*.*") => []; + + public ReferenceDataValidationResult ValidateRequiredAssets(params string[] relativePaths) + => new([], relativePaths); + } + + private sealed class RepositoryReferenceDataService(string root) : IReferenceDataService + { + public Task ReadTextAsync(string relativePath, CancellationToken cancellationToken = default) + => Task.FromResult(null); + + public ReferenceDataResolution Resolve(string relativePath) + { + var fullPath = Path.Combine(root, "assets", relativePath.Replace('/', Path.DirectorySeparatorChar)); + return new ReferenceDataResolution(relativePath, fullPath, File.Exists(fullPath), [fullPath]); + } + + public Task ReadJsonAsync(string relativePath, CancellationToken cancellationToken = default) + => Task.FromResult(default(T)); + + public bool Exists(string relativePath) => Resolve(relativePath).Exists; + + public IReadOnlyList EnumerateFiles(string relativeDirectory, string searchPattern = "*.*") => []; + + public ReferenceDataValidationResult ValidateRequiredAssets(params string[] relativePaths) + => new([], relativePaths.Where(path => !Exists(path)).ToArray()); + } +} diff --git a/src/box-winUI/AgreementWindow.cs b/src/box-winUI/AgreementWindow.cs index 65aed19..0b58614 100644 --- a/src/box-winUI/AgreementWindow.cs +++ b/src/box-winUI/AgreementWindow.cs @@ -39,7 +39,7 @@ public sealed class AgreementWindow : Window _acceptanceStore = acceptanceStore; _appVersion = appVersion; _accepted = accepted; - _requestedTheme = ResolveElementTheme(settingsService.Current.Theme); + _requestedTheme = ThemeService.ResolveElementTheme(settingsService.Current.Theme); Title = $"YMhut Box 使用声明 · {AgreementDocument.CurrentVersion}"; WindowIconService.ApplyAppIcon(this); ModernUi.SetPalette(ShouldUseDarkPalette(settingsService.Current.Theme)); @@ -124,6 +124,7 @@ public sealed class AgreementWindow : Window var root = new Grid { Background = ThemeBrush("ApplicationPageBackgroundThemeBrush", ModernUi.AppBackground), + RequestedTheme = _requestedTheme, Padding = new Thickness(24), RowSpacing = 14, RowDefinitions = @@ -388,22 +389,7 @@ public sealed class AgreementWindow : Window return Math.Max(1, (int)Math.Round(dips * scale)); } - private Brush ThemeBrush(string resourceKey, Brush fallback) - { - return Application.Current.Resources.TryGetValue(resourceKey, out var value) && value is Brush brush - ? brush - : fallback; - } - - private static ElementTheme ResolveElementTheme(string? theme) - { - return (theme ?? string.Empty).Trim().ToLowerInvariant() switch - { - "light" => ElementTheme.Light, - "dark" => ElementTheme.Dark, - _ => ElementTheme.Default - }; - } + private static Brush ThemeBrush(string resourceKey, Brush fallback) => fallback; private static bool ShouldUseDarkPalette(string? theme) { diff --git a/src/box-winUI/App.xaml.cs b/src/box-winUI/App.xaml.cs index cf3568c..0a57940 100644 --- a/src/box-winUI/App.xaml.cs +++ b/src/box-winUI/App.xaml.cs @@ -169,6 +169,9 @@ public partial class App : Application } Trace($"IndependentWindowHost:before-window:{options.Kind}"); + ModernUi.SetPalette( + ThemeService.ShouldUseDarkPalette(settingsService.Current.Theme), + settingsService.Current.SeedColor); CurrentWindow = options.Kind switch { IndependentWindowKind.Browser => new SafeBrowserWindow(options.InitialUrl), diff --git a/src/box-winUI/Assets/LockScreenLogo.png b/src/box-winUI/Assets/LockScreenLogo.png index f56993c..c0e57c6 100644 Binary files a/src/box-winUI/Assets/LockScreenLogo.png and b/src/box-winUI/Assets/LockScreenLogo.png differ diff --git a/src/box-winUI/Assets/Square150x150Logo.png b/src/box-winUI/Assets/Square150x150Logo.png index 1432f18..f482e4e 100644 Binary files a/src/box-winUI/Assets/Square150x150Logo.png and b/src/box-winUI/Assets/Square150x150Logo.png differ diff --git a/src/box-winUI/Assets/Square44x44Logo.png b/src/box-winUI/Assets/Square44x44Logo.png index a9c7f8f..3a37741 100644 Binary files a/src/box-winUI/Assets/Square44x44Logo.png and b/src/box-winUI/Assets/Square44x44Logo.png differ diff --git a/src/box-winUI/Assets/StoreLogo.png b/src/box-winUI/Assets/StoreLogo.png index 664681a..f1cdf82 100644 Binary files a/src/box-winUI/Assets/StoreLogo.png and b/src/box-winUI/Assets/StoreLogo.png differ diff --git a/src/box-winUI/Assets/Wide310x150Logo.png b/src/box-winUI/Assets/Wide310x150Logo.png index 6897305..6530c38 100644 Binary files a/src/box-winUI/Assets/Wide310x150Logo.png and b/src/box-winUI/Assets/Wide310x150Logo.png differ diff --git a/src/box-winUI/MainWindow.xaml.cs b/src/box-winUI/MainWindow.xaml.cs index 781bb3d..defcb6f 100644 --- a/src/box-winUI/MainWindow.xaml.cs +++ b/src/box-winUI/MainWindow.xaml.cs @@ -54,6 +54,7 @@ public sealed partial class MainWindow : Window, IShellNavigationHost private readonly IShellDialogService _shellDialogService = AppServices.GetRequiredService(); private readonly IShellNotificationService _shellNotificationService = AppServices.GetRequiredService(); private readonly WebView2EnvironmentFactory _webViewEnvironmentFactory = AppServices.GetRequiredService(); + private readonly MusicApiProcessService _musicApiProcessService = AppServices.GetRequiredService(); private readonly IToolPageFactory _toolPageFactory = ToolPageRegistry.Current; private readonly ToolboxSurfacePageFactory _toolboxSurfacePageFactory = new(); private readonly PropertyChangedEventHandler _settingsChangedHandler; @@ -121,7 +122,15 @@ public sealed partial class MainWindow : Window, IShellNavigationHost public MainWindow() { StartupTrace.Write("MainWindow.ctor:start"); + var initialSettings = _settingsService.Current; + ModernUi.SetPalette(ThemeService.ShouldUseDarkPalette(initialSettings.Theme), initialSettings.SeedColor); BuildShellContent(); + ThemeService.ApplyTheme( + this, + initialSettings.Theme, + initialSettings.HardwareAccelerationEnabled ? initialSettings.WindowBackdrop : "solid", + initialSettings.SeedColor); + ThemeService.ApplyFontScale(initialSettings.FontSize); Title = "YMhut Box"; WindowIconService.ApplyAppIcon(this); ExtendsContentIntoTitleBar = true; @@ -187,6 +196,7 @@ public sealed partial class MainWindow : Window, IShellNavigationHost _settingsService.PropertyChanged += _settingsChangedHandler; RootLayout.Loaded += MainWindow_Loaded; + _ = _musicApiProcessService.StartAsync(); Closed += (_, _) => { _isClosed = true; @@ -200,6 +210,7 @@ public sealed partial class MainWindow : Window, IShellNavigationHost _movePerformanceHelper?.Dispose(); _moveLightModeScope?.Dispose(); _pluginHost.Dispose(); + _musicApiProcessService.Dispose(); if (_downloadManager is IDisposable disposableDownloadManager) { disposableDownloadManager.Dispose(); diff --git a/src/box-winUI/Services/AppServices.cs b/src/box-winUI/Services/AppServices.cs index 7538bbf..09923df 100644 --- a/src/box-winUI/Services/AppServices.cs +++ b/src/box-winUI/Services/AppServices.cs @@ -95,11 +95,18 @@ public static class AppServices provider.GetService())); services.AddSingleton(); services.AddSingleton(provider => new DpapiMusicCredentialStore(provider.GetRequiredService())); + services.AddSingleton(provider => new DpapiMusicAccountSessionStore(provider.GetRequiredService())); + services.AddSingleton(provider => new MusicApiProcessService(provider.GetService())); + services.AddSingleton(provider => provider.GetRequiredService()); + services.AddSingleton(provider => new KugouLocalApiProxyHandler(provider.GetRequiredService())); services.AddSingleton(provider => new NeteaseMusicProvider( provider.GetRequiredService(), - provider.GetService())); + provider.GetService(), + sessions: provider.GetRequiredService())); services.AddSingleton(provider => new KugouMusicProvider( - provider.GetRequiredService())); + provider.GetRequiredService(), + provider.GetRequiredService(), + provider.GetRequiredService())); services.AddSingleton(provider => new MusicProviderRegistry( [ provider.GetRequiredService(), @@ -117,6 +124,9 @@ public static class AppServices provider.GetRequiredService(), provider.GetService())); services.AddSingleton(); + services.AddSingleton(provider => new ToolUiDefinitionStore( + provider.GetRequiredService(), + provider.GetService())); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(provider => new TitleWeatherService( diff --git a/src/box-winUI/Services/MusicApiProcessService.cs b/src/box-winUI/Services/MusicApiProcessService.cs new file mode 100644 index 0000000..8a19b7c --- /dev/null +++ b/src/box-winUI/Services/MusicApiProcessService.cs @@ -0,0 +1,346 @@ +using System.ComponentModel; +using System.Diagnostics; +using System.Net.Http.Json; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Text.Json; +using Microsoft.Win32.SafeHandles; +using YMhut.Box.Core.App; +using YMhut.Box.Core.Logging; +using YMhut.Box.Core.Music; + +namespace YMhut.Box.WinUI.Services; + +public sealed class MusicApiProcessService(ILogService? logService = null) : ILocalMusicApiEndpoint, IDisposable +{ + private const int ProtocolVersion = 1; + private const string MoeKoeCommit = "4581660209c9cdd07669e8bd5bcbe136b7d91e02"; + private static readonly TimeSpan StartTimeout = TimeSpan.FromSeconds(12); + private readonly SemaphoreSlim _startGate = new(1, 1); + private readonly Queue _restartAttempts = new(); + private Process? _process; + private LocalMusicApiEndpoint? _endpoint; + private SafeJobHandle? _job; + private bool _disposed; + + public bool IsAvailable => _endpoint is not null && _process is { HasExited: false }; + + public async Task StartAsync(CancellationToken cancellationToken = default) + { + try + { + _ = await GetEndpointAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception exception) + { + await WriteLogAsync("Warning", "本地音乐 API 未能启动,酷狗来源暂不可用", exception.Message).ConfigureAwait(false); + } + } + + public async Task GetEndpointAsync(CancellationToken cancellationToken = default) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (_endpoint is not null && _process is { HasExited: false }) return _endpoint; + + await _startGate.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + if (_endpoint is not null && _process is { HasExited: false }) return _endpoint; + EnforceRestartLimit(); + StopProcess(kill: true); + return await StartCoreAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + _startGate.Release(); + } + } + + private async Task StartCoreAsync(CancellationToken cancellationToken) + { + var payload = ResolvePayload(); + var token = Convert.ToHexString(RandomNumberGenerator.GetBytes(32)); + var startInfo = new ProcessStartInfo + { + FileName = payload.Node, + Arguments = $"\"{payload.EntryPoint}\"", + WorkingDirectory = payload.ApiRoot, + UseShellExecute = false, + CreateNoWindow = true, + RedirectStandardOutput = true, + RedirectStandardError = true + }; + startInfo.Environment["YMHUT_INTERNAL_TOKEN"] = token; + startInfo.Environment["YMHUT_PARENT_PID"] = Environment.ProcessId.ToString(System.Globalization.CultureInfo.InvariantCulture); + startInfo.Environment["YMHUT_QUIET"] = "1"; + startInfo.Environment["HOST"] = "127.0.0.1"; + startInfo.Environment["PORT"] = "0"; + startInfo.Environment["platform"] = "lite"; + + var process = Process.Start(startInfo) + ?? throw new LocalMusicApiUnavailableException("无法创建本地音乐 API 子进程。"); + _process = process; + try + { + AttachKillOnCloseJob(process); + var readyLine = await process.StandardOutput.ReadLineAsync(cancellationToken) + .AsTask() + .WaitAsync(StartTimeout, cancellationToken) + .ConfigureAwait(false); + if (string.IsNullOrWhiteSpace(readyLine)) + { + throw new LocalMusicApiUnavailableException("本地音乐 API 未返回就绪消息。"); + } + + var ready = JsonSerializer.Deserialize(readyLine, new JsonSerializerOptions(JsonSerializerDefaults.Web)); + if (ready is null || ready.Type != "ready" || ready.ProtocolVersion != ProtocolVersion || + ready.Commit != MoeKoeCommit || ready.Pid != process.Id || ready.Port is <= 0 or > 65535) + { + throw new LocalMusicApiUnavailableException("本地音乐 API 协议握手失败。"); + } + + var endpoint = new LocalMusicApiEndpoint( + new Uri($"http://127.0.0.1:{ready.Port}/", UriKind.Absolute), + token, + ready.ProtocolVersion, + ready.Commit); + await VerifyHealthAsync(endpoint, cancellationToken).ConfigureAwait(false); + _endpoint = endpoint; + process.EnableRaisingEvents = true; + process.Exited += Process_Exited; + await WriteLogAsync("Information", "本地音乐 API 已启动", $"protocol={ProtocolVersion}; commit={MoeKoeCommit[..12]}").ConfigureAwait(false); + return endpoint; + } + catch + { + StopProcess(kill: true); + throw; + } + } + + private static async Task VerifyHealthAsync(LocalMusicApiEndpoint endpoint, CancellationToken cancellationToken) + { + using var handler = new HttpClientHandler { UseProxy = false, UseCookies = false }; + using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(3) }; + using var request = new HttpRequestMessage(HttpMethod.Get, new Uri(endpoint.BaseAddress, "ymhut/health")); + request.Headers.TryAddWithoutValidation("x-ymhut-internal-token", endpoint.Token); + using var response = await client.SendAsync(request, cancellationToken).ConfigureAwait(false); + if (!response.IsSuccessStatusCode) throw new LocalMusicApiUnavailableException("本地音乐 API 健康检查失败。"); + var health = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken).ConfigureAwait(false); + if (health is null || health.ProtocolVersion != ProtocolVersion || health.Commit != MoeKoeCommit || health.Status != "ready") + { + throw new LocalMusicApiUnavailableException("本地音乐 API 健康响应不匹配。"); + } + } + + private void Process_Exited(object? sender, EventArgs e) + { + _endpoint = null; + _ = WriteLogAsync("Warning", "本地音乐 API 子进程已退出", "酷狗来源将在下次请求时限频重启"); + } + + private void EnforceRestartLimit() + { + var now = DateTimeOffset.UtcNow; + while (_restartAttempts.Count > 0 && now - _restartAttempts.Peek() > TimeSpan.FromMinutes(1)) _restartAttempts.Dequeue(); + if (_restartAttempts.Count >= 3) + { + throw new LocalMusicApiUnavailableException("本地音乐 API 重启过于频繁,请稍后重试。"); + } + _restartAttempts.Enqueue(now); + } + + private static (string Node, string EntryPoint, string ApiRoot) ResolvePayload() + { + foreach (var root in InstallLayoutPaths.CandidateRoots()) + { + var musicApiRoot = Path.Combine(root, "music-api"); + var node = Path.Combine(musicApiRoot, "node.exe"); + var apiRoot = Path.Combine(musicApiRoot, "api"); + var entry = Path.Combine(apiRoot, "ymhut-sidecar.js"); + if (File.Exists(node) && File.Exists(entry) && File.Exists(Path.Combine(apiRoot, "pnpm-lock.yaml")) && + File.Exists(Path.Combine(apiRoot, "LICENSE"))) + { + return (node, entry, apiRoot); + } + } + +#if DEBUG + var current = new DirectoryInfo(AppContext.BaseDirectory); + while (current is not null) + { + var apiRoot = Path.Combine(current.FullName, "third_party", "MoeKoeMusic", "api"); + var entry = Path.Combine(apiRoot, "ymhut-sidecar.js"); + if (File.Exists(entry)) + { + var node = FindOnPath("node.exe"); + if (node is not null) return (node, entry, apiRoot); + } + current = current.Parent; + } +#endif + throw new LocalMusicApiUnavailableException("随包 music-api 运行时不完整。"); + } + +#if DEBUG + private static string? FindOnPath(string name) + { + foreach (var item in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(Path.PathSeparator)) + { + try + { + var candidate = Path.Combine(item.Trim(), name); + if (File.Exists(candidate)) return candidate; + } + catch + { + } + } + return null; + } +#endif + + private void AttachKillOnCloseJob(Process process) + { + _job?.Dispose(); + var job = CreateJobObject(nint.Zero, null); + if (job.IsInvalid) throw new Win32Exception(Marshal.GetLastWin32Error(), "无法创建音乐 API Job Object。"); + var information = new JobObjectExtendedLimitInformation + { + BasicLimitInformation = new JobObjectBasicLimitInformation { LimitFlags = 0x00002000 } + }; + var size = Marshal.SizeOf(); + var pointer = Marshal.AllocHGlobal(size); + try + { + Marshal.StructureToPtr(information, pointer, false); + if (!SetInformationJobObject(job, 9, pointer, (uint)size)) + throw new Win32Exception(Marshal.GetLastWin32Error(), "无法配置音乐 API Job Object。"); + if (!AssignProcessToJobObject(job, process.Handle)) + throw new Win32Exception(Marshal.GetLastWin32Error(), "无法将音乐 API 加入 Job Object。"); + } + catch + { + job.Dispose(); + throw; + } + finally + { + Marshal.FreeHGlobal(pointer); + } + _job = job; + } + + public async Task StopAsync() + { + var endpoint = _endpoint; + var process = _process; + _endpoint = null; + if (endpoint is not null && process is { HasExited: false }) + { + try + { + using var handler = new HttpClientHandler { UseProxy = false, UseCookies = false }; + using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(2) }; + var timestamp = KugouLocalApiProxyHandler.NextTimestamp(); + using var request = new HttpRequestMessage(HttpMethod.Post, new Uri(endpoint.BaseAddress, $"ymhut/shutdown?timestamp={timestamp}")); + request.Headers.TryAddWithoutValidation("x-ymhut-internal-token", endpoint.Token); + using var response = await client.SendAsync(request).ConfigureAwait(false); + await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(2)).ConfigureAwait(false); + } + catch + { + } + } + StopProcess(kill: true); + } + + private void StopProcess(bool kill) + { + var process = Interlocked.Exchange(ref _process, null); + _endpoint = null; + if (process is not null) + { + try { process.Exited -= Process_Exited; } catch { } + try { if (kill && !process.HasExited) process.Kill(entireProcessTree: true); } catch { } + process.Dispose(); + } + _job?.Dispose(); + _job = null; + } + + public void Dispose() + { + if (_disposed) return; + _disposed = true; + try { StopAsync().GetAwaiter().GetResult(); } catch { StopProcess(kill: true); } + _startGate.Dispose(); + } + + private async Task WriteLogAsync(string level, string message, string? detail) + { + if (logService is null) return; + try { await logService.WriteAsync(level, "music-api", message, detail).ConfigureAwait(false); } catch { } + } + + private sealed record ReadyMessage(string Type, int ProtocolVersion, string Commit, int Pid, int Port); + private sealed record HealthMessage(int ProtocolVersion, string Commit, int Pid, string Status); + + [StructLayout(LayoutKind.Sequential)] + private struct JobObjectBasicLimitInformation + { + public long PerProcessUserTimeLimit; + public long PerJobUserTimeLimit; + public uint LimitFlags; + public nuint MinimumWorkingSetSize; + public nuint MaximumWorkingSetSize; + public uint ActiveProcessLimit; + public nuint Affinity; + public uint PriorityClass; + public uint SchedulingClass; + } + + [StructLayout(LayoutKind.Sequential)] + private struct IoCounters + { + public ulong ReadOperationCount; + public ulong WriteOperationCount; + public ulong OtherOperationCount; + public ulong ReadTransferCount; + public ulong WriteTransferCount; + public ulong OtherTransferCount; + } + + [StructLayout(LayoutKind.Sequential)] + private struct JobObjectExtendedLimitInformation + { + public JobObjectBasicLimitInformation BasicLimitInformation; + public IoCounters IoInfo; + public nuint ProcessMemoryLimit; + public nuint JobMemoryLimit; + public nuint PeakProcessMemoryUsed; + public nuint PeakJobMemoryUsed; + } + + private sealed class SafeJobHandle : SafeHandleZeroOrMinusOneIsInvalid + { + private SafeJobHandle() : base(true) { } + + protected override bool ReleaseHandle() => CloseHandle(handle); + } + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + private static extern SafeJobHandle CreateJobObject(nint jobAttributes, string? name); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool SetInformationJobObject(SafeJobHandle job, int informationClass, nint information, uint informationLength); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool AssignProcessToJobObject(SafeJobHandle job, nint process); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool CloseHandle(nint handle); +} diff --git a/src/box-winUI/Services/MusicLyricsCoordinator.cs b/src/box-winUI/Services/MusicLyricsCoordinator.cs index 201ab65..e5cbfd6 100644 --- a/src/box-winUI/Services/MusicLyricsCoordinator.cs +++ b/src/box-winUI/Services/MusicLyricsCoordinator.cs @@ -1,4 +1,5 @@ using YMhut.Box.Core.Music; +using YMhut.Box.Core.Settings; namespace YMhut.Box.WinUI.Services; @@ -14,6 +15,8 @@ public interface IMusicLyricsCoordinator : IDisposable int ActiveWordIndex { get; } + MusicLyricCursor Cursor { get; } + Task RefreshAsync(CancellationToken cancellationToken = default); } @@ -25,22 +28,26 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator private readonly IMusicPlaybackService _playback; private readonly IMusicProviderRegistry _providers; private readonly IDesktopOverlayService _overlay; + private readonly ISettingsService _settingsService; private readonly object _sync = new(); private CancellationTokenSource? _loadCts; private string _songKey = string.Empty; private TimedLyrics? _lyrics; private int _activeLineIndex = -1; private int _activeWordIndex = -1; + private double _activeWordProgress; private bool _disposed; public MusicLyricsCoordinator( IMusicPlaybackService playback, IMusicProviderRegistry providers, - IDesktopOverlayService overlay) + IDesktopOverlayService overlay, + ISettingsService settingsService) { _playback = playback; _providers = providers; _overlay = overlay; + _settingsService = settingsService; _playback.CurrentSongChanged += Playback_CurrentSongChanged; _playback.StateChanged += Playback_StateChanged; } @@ -73,6 +80,14 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator } } + public MusicLyricCursor Cursor + { + get + { + lock (_sync) return new MusicLyricCursor(_activeLineIndex, _activeWordIndex, _activeWordProgress); + } + } + public async Task RefreshAsync(CancellationToken cancellationToken = default) { var song = _playback.CurrentSong; @@ -97,6 +112,7 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator _lyrics = null; _activeLineIndex = -1; _activeWordIndex = -1; + _activeWordProgress = 0; } previous?.Cancel(); previous?.Dispose(); @@ -133,6 +149,7 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator { if (!ReferenceEquals(current, _loadCts)) return; _lyrics = new TimedLyrics([], string.Empty, null, null); + _activeWordProgress = 0; } SetOverlayPlaceholder(); LyricsChanged?.Invoke(this, EventArgs.Empty); @@ -180,6 +197,7 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator if (_activeLineIndex < 0 && _activeWordIndex < 0) return false; _activeLineIndex = -1; _activeWordIndex = -1; + _activeWordProgress = 0; SetOverlayPlaceholder(); return true; } @@ -191,26 +209,41 @@ public sealed class MusicLyricsCoordinator : IMusicLyricsCoordinator if (line.Words[index].Start <= position) wordIndex = index; else break; } - if (lineIndex == _activeLineIndex && wordIndex == _activeWordIndex) return false; + var wordProgress = 0d; + if (wordIndex >= 0 && wordIndex < line.Words.Count) + { + var word = line.Words[wordIndex]; + wordProgress = word.Duration <= TimeSpan.Zero + ? 1 + : Math.Clamp((position - word.Start).TotalMilliseconds / word.Duration.TotalMilliseconds, 0, 1); + } + if (lineIndex == _activeLineIndex && wordIndex == _activeWordIndex && Math.Abs(wordProgress - _activeWordProgress) < 0.025) return false; _activeLineIndex = lineIndex; _activeWordIndex = wordIndex; + _activeWordProgress = wordProgress; var song = _playback.CurrentSong; - _overlay.SetDesktopLyrics( - song?.Name ?? "YMhut Music", - song?.Artist ?? string.Empty, - line.Text, - line.Translation); + if (_settingsService.Current.Lyrics.DesktopSyncEnabled) + { + _overlay.SetDesktopLyrics( + song?.Name ?? "YMhut Music", + song?.Artist ?? string.Empty, + line.Text, + _settingsService.Current.Lyrics.ShowTranslation ? line.Translation : null); + } return true; } private void SetOverlayPlaceholder() { var song = _playback.CurrentSong; - _overlay.SetDesktopLyrics( - song?.Name ?? "YMhut Music", - song?.Artist ?? string.Empty, - song is null ? "播放歌曲后显示桌面歌词" : "纯音乐,请欣赏"); + if (_settingsService.Current.Lyrics.DesktopSyncEnabled) + { + _overlay.SetDesktopLyrics( + song?.Name ?? "YMhut Music", + song?.Artist ?? string.Empty, + song is null ? "播放歌曲后显示桌面歌词" : "纯音乐,请欣赏"); + } } private static string ToKey(MusicSong song) => $"{song.Provider}:{song.Id}"; diff --git a/src/box-winUI/Services/ShellDialogService.cs b/src/box-winUI/Services/ShellDialogService.cs index a9b7b87..c7248a4 100644 --- a/src/box-winUI/Services/ShellDialogService.cs +++ b/src/box-winUI/Services/ShellDialogService.cs @@ -1,5 +1,6 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using YMhut.Box.Core.Settings; namespace YMhut.Box.WinUI.Services; @@ -10,9 +11,10 @@ public interface IShellDialogService Task ShowAsync(ContentDialog dialog); } -public sealed class ShellDialogService : IShellDialogService +public sealed class ShellDialogService(ISettingsService settingsService) : IShellDialogService { private XamlRoot? _xamlRoot; + private readonly ISettingsService _settingsService = settingsService; public void Attach(XamlRoot? xamlRoot) { @@ -24,6 +26,7 @@ public sealed class ShellDialogService : IShellDialogService try { dialog.XamlRoot ??= _xamlRoot ?? ToastService.CurrentXamlRoot; + ThemeService.PrepareContentDialog(dialog, dialog.XamlRoot, _settingsService.Current.Theme); return await dialog.ShowAsync(); } catch (Exception exception) diff --git a/src/box-winUI/ThemeService.cs b/src/box-winUI/ThemeService.cs index fb18c5a..1d7ac73 100644 --- a/src/box-winUI/ThemeService.cs +++ b/src/box-winUI/ThemeService.cs @@ -38,16 +38,28 @@ public static class ThemeService return; } - root.RequestedTheme = theme switch - { - "Light" => ElementTheme.Light, - "Dark" => ElementTheme.Dark, - _ => ElementTheme.Default, - }; + root.RequestedTheme = ResolveElementTheme(theme); ApplyWindowBackdrop(window, windowBackdrop); } + public static void PrepareContentDialog(ContentDialog dialog, XamlRoot? xamlRoot, string? theme) + { + if (xamlRoot is not null) + { + dialog.XamlRoot ??= xamlRoot; + } + + dialog.RequestedTheme = ResolveElementTheme(theme); + dialog.Resources["ApplicationPageBackgroundThemeBrush"] = ModernUi.AppBackground; + dialog.Resources["CardBackgroundFillColorDefaultBrush"] = ModernUi.Surface; + dialog.Resources["ControlFillColorDefaultBrush"] = ModernUi.SurfaceAlt; + dialog.Resources["ControlFillColorSecondaryBrush"] = ModernUi.SurfaceAlt; + dialog.Resources["TextFillColorPrimaryBrush"] = ModernUi.TextPrimary; + dialog.Resources["TextFillColorSecondaryBrush"] = ModernUi.TextSecondary; + dialog.Resources["ControlStrokeColorDefaultBrush"] = ModernUi.Stroke; + } + public static void ApplyWindowBackdrop(Window? window, string windowBackdrop) { if (window is null) @@ -204,6 +216,16 @@ public static class ThemeService }; } + public static ElementTheme ResolveElementTheme(string? theme) + { + return (theme ?? string.Empty).Trim().ToLowerInvariant() switch + { + "light" => ElementTheme.Light, + "dark" => ElementTheme.Dark, + _ => ElementTheme.Default + }; + } + private static bool IsSystemDarkTheme() { try diff --git a/src/box-winUI/Views/AboutPage.cs b/src/box-winUI/Views/AboutPage.cs index 7aabe92..37235ba 100644 --- a/src/box-winUI/Views/AboutPage.cs +++ b/src/box-winUI/Views/AboutPage.cs @@ -544,16 +544,38 @@ public sealed class AboutPage : Page }; row.Children.Add(text); - if (!string.IsNullOrWhiteSpace(reference.Path) && File.Exists(reference.Path)) + var actions = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4 }; + var noticePath = !string.IsNullOrWhiteSpace(reference.LicensePath) ? reference.LicensePath : reference.Path; + if (!string.IsNullOrWhiteSpace(noticePath) && File.Exists(noticePath)) { - var button = ModernUi.IconButton("\uE8A7", AppLocalizer.T("打开原始声明文件", "Open original notice"), () => OpenReferenceFile(reference.Path)); - Grid.SetColumn(button, 1); - row.Children.Add(button); + actions.Children.Add(ModernUi.IconButton("\uE8A7", AppLocalizer.T("打开许可证或原始声明", "Open license or original notice"), () => OpenReferenceFile(noticePath))); + } + if (Uri.TryCreate(reference.SourceUrl, UriKind.Absolute, out var sourceUri) && sourceUri.Scheme == Uri.UriSchemeHttps) + { + actions.Children.Add(ModernUi.IconButton("\uE71B", AppLocalizer.T("打开源代码仓库", "Open source repository"), () => OpenReferenceUrl(sourceUri))); + } + if (actions.Children.Count > 0) + { + Grid.SetColumn(actions, 1); + row.Children.Add(actions); } return row; } + private static void OpenReferenceUrl(Uri uri) + { + try + { + Process.Start(new ProcessStartInfo { FileName = uri.AbsoluteUri, UseShellExecute = true }); + } + catch (Exception exception) + { + CrashLog.Write(exception); + ToastService.Show(AppLocalizer.T("无法打开源代码仓库。", "Unable to open the source repository."), ToastKind.Error); + } + } + private static void OpenReferenceFile(string path) { try @@ -578,7 +600,11 @@ public sealed class AboutPage : Page { "Application" => AppLocalizer.T("应用", "Application"), "Reference project attribution" => AppLocalizer.T("参考项目来源", "Reference project source"), + "Bundled music API source" => AppLocalizer.T("随包音乐 API 源码", "Bundled music API source"), + "Bundled modified component" => AppLocalizer.T("随包修改组件", "Bundled modified component"), + "Cache mechanism attribution" => AppLocalizer.T("缓存机制来源", "Cache mechanism attribution"), "Runtime" => AppLocalizer.T("运行时", "Runtime"), + "Bundled npm dependencies" => AppLocalizer.T("随包 npm 依赖", "Bundled npm dependencies"), "NuGet package" => AppLocalizer.T("NuGet 包", "NuGet package"), "Third-party tool notice" => AppLocalizer.T("第三方工具声明", "Third-party tool notice"), _ => AppLocalizer.T("其他来源", "Other source") @@ -591,9 +617,14 @@ public sealed class AboutPage : Page { "Application" => 0, "Reference project attribution" => 1, - "Runtime" => 2, - "NuGet package" => 3, - _ => 4 + "Bundled music API source" => 2, + "Bundled modified component" => 3, + "Cache mechanism attribution" => 4, + "Runtime" => 5, + "Bundled npm dependencies" => 6, + "NuGet package" => 7, + "Third-party tool notice" => 8, + _ => 9 }; } diff --git a/src/box-winUI/Views/ExternalToolDetailPage.cs b/src/box-winUI/Views/ExternalToolDetailPage.cs index 99f2db9..66dabeb 100644 --- a/src/box-winUI/Views/ExternalToolDetailPage.cs +++ b/src/box-winUI/Views/ExternalToolDetailPage.cs @@ -16,6 +16,8 @@ public sealed partial class ExternalToolDetailPage : ToolPageBase private readonly IRiskConfirmationStore _riskStore = AppServices.GetRequiredService(); private readonly ISettingsService _settingsService = AppServices.GetRequiredService(); private readonly ILogService _logService = AppServices.GetRequiredService(); + private readonly IToolUiDefinitionStore _toolUiDefinitionStore = AppServices.GetRequiredService(); + private ToolUiDefinition _uiDefinition; private readonly ComboBox _variantBox = new() { MinWidth = 220 }; private readonly InfoBar _status = new() { @@ -46,7 +48,71 @@ public sealed partial class ExternalToolDetailPage : ToolPageBase _goBack = goBack; Background = ModernUi.AppBackground; BindModule(module); + _uiDefinition = _toolUiDefinitionStore.GetFallback(module); Content = BuildLayout(); + Loaded += ExternalToolDetailPage_Loaded; + Unloaded += ExternalToolDetailPage_Unloaded; + } + + public ToolUiDefinition UiDefinition => _uiDefinition; + + private async void ExternalToolDetailPage_Loaded(object sender, RoutedEventArgs e) + { + if (Module is null) + { + return; + } + + try + { + _uiDefinition = await _toolUiDefinitionStore.GetAsync(Module); + _status.Title = _uiDefinition.IsFallback ? "外部工具 · 安全回退页面" : "外部工具"; + if (_uiDefinition.IsFallback && !string.IsNullOrWhiteSpace(_uiDefinition.Diagnostic)) + { + _status.Message = $"{_status.Message} 定义状态:{_uiDefinition.Diagnostic}"; + } + + var state = _settingsService.GetToolUiState(Module.Id); + if (state.Values.TryGetValue("variant", out var path)) + { + for (var index = 0; index < _variantBox.Items.Count; index++) + { + if (_variantBox.Items[index] is VariantChoice choice + && string.Equals(choice.Path, path, StringComparison.OrdinalIgnoreCase)) + { + _variantBox.SelectedIndex = index; + break; + } + } + } + } + catch (Exception exception) + { + await _logService.WriteAsync("Warning", "tool-ui", "External tool definition load failed", $"{Module.Id}; {exception.Message}"); + } + } + + private async void ExternalToolDetailPage_Unloaded(object sender, RoutedEventArgs e) + { + if (Module is null) + { + return; + } + + try + { + var state = new ToolUiPageState(); + if (_variantBox.SelectedItem is VariantChoice choice) + { + state.Values["variant"] = choice.Path; + } + + await _settingsService.SaveToolUiStateAsync(Module.Id, state); + } + catch (Exception exception) + { + await _logService.WriteAsync("Warning", "tool-ui", "External tool state could not be saved", $"{Module.Id}; {exception.Message}"); + } } private UIElement BuildLayout() diff --git a/src/box-winUI/Views/NetworkMusicPage.cs b/src/box-winUI/Views/NetworkMusicPage.cs index 351e9b9..60f817b 100644 --- a/src/box-winUI/Views/NetworkMusicPage.cs +++ b/src/box-winUI/Views/NetworkMusicPage.cs @@ -1,3 +1,4 @@ +using Microsoft.UI; using Microsoft.UI.Text; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; @@ -9,7 +10,9 @@ using QRCoder; using Windows.Media.Core; using Windows.Storage.Streams; using Windows.System; +using Windows.UI; using Windows.UI.Text; +using Windows.UI.ViewManagement; using YMhut.Box.Core.Music; using YMhut.Box.Core.Settings; using YMhut.Box.WinUI.Services; @@ -33,6 +36,7 @@ public sealed class NetworkMusicPage : Page private readonly IAppVersionService _appVersionService = AppServices.GetRequiredService(); private readonly IMusicPlaybackService _playback = AppServices.GetRequiredService(); private readonly IDesktopOverlayService _overlayService = AppServices.GetRequiredService(); + private readonly ISettingsService _settingsService = AppServices.GetRequiredService(); private readonly AutoSuggestBox _search = new() { PlaceholderText = AppLocalizer.T("搜索歌曲、歌手或歌单", "Search songs, artists, or playlists"), MinWidth = 0 }; private readonly ComboBox _searchKind = new() { Width = 112 }; private readonly ListView _results = new() { SelectionMode = ListViewSelectionMode.None, IsItemClickEnabled = true }; @@ -46,12 +50,33 @@ public sealed class NetworkMusicPage : Page private readonly Button _modeButton; private readonly Button _favoriteButton; private readonly Button _desktopLyricsButton; + private readonly Button _immersiveButton; + private readonly Button _lyricsSettingsButton; private readonly Button _mvButton; private readonly PersonPicture _accountPicture = new() { Width = 30, Height = 30 }; private readonly Button _accountButton; private readonly Slider _position = new() { Minimum = 0, Maximum = 1, Width = 280 }; private readonly Slider _volume = new() { Minimum = 0, Maximum = 100, Width = 92 }; - private readonly ComboBox _quality = new() { Width = 104 }; + private readonly Slider _immersivePosition = new() { Minimum = 0, Maximum = 1, MinWidth = 180, HorizontalAlignment = HorizontalAlignment.Stretch }; + private readonly Slider _immersiveVolume = new() { Minimum = 0, Maximum = 100, Width = 110 }; + private readonly Image _immersiveCover = new() { Width = 320, Height = 320, Stretch = Stretch.UniformToFill }; + private readonly TextBlock _immersiveTitle = Text(AppLocalizer.T("未在播放", "Nothing playing"), 24, FontWeights.SemiBold, maxLines: 2); + private readonly TextBlock _immersiveArtist = Text(string.Empty, 13, foreground: SecondaryTextBrush, maxLines: 2); + private readonly StackPanel _immersiveLyrics = new() { Spacing = 16 }; + private readonly ScrollViewer _immersiveLyricsScroll = new() { VerticalScrollBarVisibility = ScrollBarVisibility.Auto }; + private readonly Button _immersivePlayPauseButton; + private Button? _immersiveBackButton; + private FrameworkElement? _topBarElement; + private Grid? _contentElement; + private FrameworkElement? _playerElement; + private FrameworkElement? _immersiveElement; + private readonly Button _qualityButton = new() + { + MinWidth = 116, + Height = 36, + Padding = new Thickness(10, 0, 10, 0), + CornerRadius = new CornerRadius(5) + }; private readonly ProgressRing _busy = new() { Width = 22, Height = 22 }; private readonly InfoBar _status = new() { IsOpen = false, IsClosable = true }; private readonly DispatcherTimer _uiTimer = new() { Interval = TimeSpan.FromMilliseconds(250) }; @@ -64,11 +89,12 @@ public sealed class NetworkMusicPage : Page private bool _subscribed; private bool _loaded; private bool _musicDisclaimerAccepted; - private bool _qualitySyncing; private string _displayedPlaybackFailure = string.Empty; private string _favoriteStateSongKey = string.Empty; private bool? _favoriteState; private CancellationTokenSource? _favoriteStateCts; + private bool _immersiveOpen; + private bool _syncingImmersivePosition; private IMusicProvider Provider => _providers.Current; @@ -80,6 +106,9 @@ public sealed class NetworkMusicPage : Page _favoriteButton = IconButton("\uEB51", AppLocalizer.T("收藏当前歌曲", "Favorite current song"), async () => await FavoriteCurrentAsync()); _favoriteButton.IsEnabled = false; _desktopLyricsButton = IconButton("\uE8D2", AppLocalizer.T("桌面歌词", "Desktop lyrics"), async () => await ToggleDesktopLyricsAsync()); + _immersiveButton = IconButton("\uE740", AppLocalizer.T("沉浸歌词", "Immersive lyrics"), OpenImmersiveLyrics); + _lyricsSettingsButton = IconButton("\uE713", AppLocalizer.T("歌词设置", "Lyric settings"), async () => await ShowLyricsSettingsAsync()); + _immersivePlayPauseButton = IconButton("\uE768", AppLocalizer.T("播放或暂停", "Play or pause"), () => _playback.PlayPause()); _mvButton = IconButton("\uE714", AppLocalizer.T("播放当前歌曲 MV", "Play current song MV"), async () => await ShowMvAsync()); _accountButton = new Button { @@ -98,6 +127,26 @@ public sealed class NetworkMusicPage : Page Unloaded += NetworkMusicPage_Unloaded; _uiTimer.Tick += (_, _) => RefreshPlaybackUi(); _search.QuerySubmitted += async (_, args) => await SearchAsync(args.QueryText); + KeyDown += (_, args) => + { + if (_immersiveOpen && args.Key == VirtualKey.Escape) + { + args.Handled = true; + CloseImmersiveLyrics(); + } + }; + var closeImmersiveAccelerator = new KeyboardAccelerator { Key = VirtualKey.Escape }; + closeImmersiveAccelerator.Invoked += (_, args) => + { + if (!_immersiveOpen) + { + return; + } + + args.Handled = true; + CloseImmersiveLyrics(); + }; + KeyboardAccelerators.Add(closeImmersiveAccelerator); } private UIElement BuildContent() @@ -106,16 +155,9 @@ public sealed class NetworkMusicPage : Page _searchKind.Items.Add(AppLocalizer.T("歌手", "Artists")); _searchKind.Items.Add(AppLocalizer.T("歌单", "Playlists")); _searchKind.SelectedIndex = 0; - foreach (var quality in new[] - { - AppLocalizer.T("超清母带", "Hi-Res master"), - AppLocalizer.T("高清臻音", "Spatial audio"), - AppLocalizer.T("无损", "Lossless"), - AppLocalizer.T("极高", "Very high"), - AppLocalizer.T("标准", "Standard") - }) _quality.Items.Add(quality); - _quality.SelectedIndex = 1; - _quality.SelectionChanged += async (_, _) => await ChangeQualityAsync(); + ModernUi.ApplyHoverResources(_qualityButton, SurfaceAltBrush, StrokeBrush, ModernUi.HoverSurface, ModernUi.StrokeStrong); + _qualityButton.Click += (_, _) => ShowQualityFlyout(); + RefreshQualityButton(); _volume.Value = _playback.Volume; _volume.ValueChanged += (_, args) => _playback.Volume = args.NewValue; _position.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler((_, _) => @@ -150,9 +192,11 @@ public sealed class NetworkMusicPage : Page root.RowDefinitions.Add(new RowDefinition()); root.RowDefinitions.Add(new RowDefinition { Height = new GridLength(86) }); var topBar = BuildTopBar(); + _topBarElement = topBar; root.Children.Add(topBar); var content = new Grid(); + _contentElement = content; content.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(210) }); content.ColumnDefinitions.Add(new ColumnDefinition()); content.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(330) }); @@ -167,8 +211,12 @@ public sealed class NetworkMusicPage : Page root.Children.Add(content); var player = BuildPlayerBar(); + _playerElement = player; Grid.SetRow(player, 2); root.Children.Add(player); + _immersiveElement = BuildImmersiveView(); + Grid.SetRowSpan(_immersiveElement, 3); + root.Children.Add(_immersiveElement); root.SizeChanged += (_, args) => { var narrow = args.NewSize.Width < 980; @@ -276,6 +324,8 @@ public sealed class NetworkMusicPage : Page _sectionMeta.Text = SongCount(_playback.Queue.Items.Count); RenderSongs(_playback.Queue.Items); })); + panel.Children.Add(new Border { Height = 1, Margin = new Thickness(6, 10, 6, 10), Background = StrokeBrush }); + panel.Children.Add(NavButton("\uE946", AppLocalizer.T("使用须知", "Usage notice"), async () => await ShowMusicUsageNoticeAsync())); return new Border { Background = SurfaceBrush, @@ -311,6 +361,18 @@ public sealed class NetworkMusicPage : Page { _lyrics.Children.Add(Text(AppLocalizer.T("播放歌曲后显示逐字与翻译歌词", "Word-timed and translated lyrics appear during playback"), 13, foreground: SecondaryTextBrush)); _lyricsScroll.Content = _lyrics; + var header = new Grid(); + header.ColumnDefinitions.Add(new ColumnDefinition()); + header.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); + header.Children.Add(Text(AppLocalizer.T("歌词", "Lyrics"), 17, FontWeights.SemiBold)); + var actions = new StackPanel + { + Orientation = Orientation.Horizontal, + Spacing = 6, + Children = { _lyricsSettingsButton, _immersiveButton } + }; + Grid.SetColumn(actions, 1); + header.Children.Add(actions); return new Border { Padding = new Thickness(20, 18, 18, 18), @@ -326,7 +388,7 @@ public sealed class NetworkMusicPage : Page }, Children = { - Text(AppLocalizer.T("歌词", "Lyrics"), 17, FontWeights.SemiBold), + header, LyricScroller() } } @@ -340,6 +402,109 @@ public sealed class NetworkMusicPage : Page return _lyricsScroll; } + private FrameworkElement BuildImmersiveView() + { + var root = new Grid + { + Visibility = Visibility.Collapsed, + Background = BackgroundBrush, + Padding = new Thickness(24, 18, 24, 18), + RowSpacing = 14 + }; + root.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + root.RowDefinitions.Add(new RowDefinition()); + root.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + + var header = new Grid { ColumnSpacing = 12 }; + header.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); + header.ColumnDefinitions.Add(new ColumnDefinition()); + _immersiveBackButton = IconButton("\uE72B", AppLocalizer.T("返回音乐列表", "Back to music list"), CloseImmersiveLyrics); + header.Children.Add(_immersiveBackButton); + var heading = Text(AppLocalizer.T("沉浸歌词", "Immersive lyrics"), 17, FontWeights.SemiBold); + Grid.SetColumn(heading, 1); + header.Children.Add(heading); + root.Children.Add(header); + + var body = new Grid { ColumnSpacing = 36, RowSpacing = 18 }; + body.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(360) }); + body.ColumnDefinitions.Add(new ColumnDefinition()); + var artwork = new StackPanel + { + Spacing = 14, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Children = { _immersiveCover, _immersiveTitle, _immersiveArtist } + }; + _immersiveTitle.MaxWidth = 360; + _immersiveArtist.MaxWidth = 360; + body.Children.Add(artwork); + _immersiveLyricsScroll.Content = _immersiveLyrics; + _immersiveLyricsScroll.Padding = new Thickness(8, 24, 18, 60); + Grid.SetColumn(_immersiveLyricsScroll, 1); + body.Children.Add(_immersiveLyricsScroll); + Grid.SetRow(body, 1); + root.Children.Add(body); + + var controls = new Grid { ColumnSpacing = 12 }; + controls.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); + controls.ColumnDefinitions.Add(new ColumnDefinition()); + controls.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); + var transport = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6 }; + transport.Children.Add(IconButton("\uE892", AppLocalizer.T("上一首", "Previous"), async () => await RunPlayerActionAsync(() => _playback.PreviousAsync()))); + transport.Children.Add(_immersivePlayPauseButton); + transport.Children.Add(IconButton("\uE893", AppLocalizer.T("下一首", "Next"), async () => await RunPlayerActionAsync(() => _playback.NextAsync()))); + controls.Children.Add(transport); + Grid.SetColumn(_immersivePosition, 1); + controls.Children.Add(_immersivePosition); + var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8 }; + right.Children.Add(new FontIcon { Glyph = "\uE767", FontSize = 14, VerticalAlignment = VerticalAlignment.Center, Foreground = SecondaryTextBrush }); + right.Children.Add(_immersiveVolume); + var immersiveQuality = DarkButton(AppLocalizer.T("音质", "Quality"), "\uE767", () => { }); + immersiveQuality.Click += (_, _) => ShowQualityFlyout(immersiveQuality); + right.Children.Add(immersiveQuality); + Grid.SetColumn(right, 2); + controls.Children.Add(right); + Grid.SetRow(controls, 2); + root.Children.Add(controls); + + _immersivePosition.ValueChanged += (_, args) => + { + if (!_syncingImmersivePosition) _playback.Seek(TimeSpan.FromSeconds(args.NewValue)); + }; + _immersiveVolume.Value = _playback.Volume; + _immersiveVolume.ValueChanged += (_, args) => _playback.Volume = args.NewValue; + body.SizeChanged += (_, args) => + { + var narrow = args.NewSize.Width < 760; + body.ColumnDefinitions.Clear(); + body.RowDefinitions.Clear(); + if (narrow) + { + body.ColumnDefinitions.Add(new ColumnDefinition()); + body.RowDefinitions.Add(new RowDefinition { Height = new GridLength(250) }); + body.RowDefinitions.Add(new RowDefinition()); + _immersiveCover.Width = _immersiveCover.Height = 180; + Grid.SetColumn(artwork, 0); + Grid.SetRow(artwork, 0); + Grid.SetColumn(_immersiveLyricsScroll, 0); + Grid.SetRow(_immersiveLyricsScroll, 1); + } + else + { + body.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(360) }); + body.ColumnDefinitions.Add(new ColumnDefinition()); + body.RowDefinitions.Add(new RowDefinition()); + _immersiveCover.Width = _immersiveCover.Height = 320; + Grid.SetColumn(artwork, 0); + Grid.SetRow(artwork, 0); + Grid.SetColumn(_immersiveLyricsScroll, 1); + Grid.SetRow(_immersiveLyricsScroll, 0); + } + right.Visibility = args.NewSize.Width < 620 ? Visibility.Collapsed : Visibility.Visible; + }; + return root; + } + private FrameworkElement BuildPlayerBar() { var bar = new Grid @@ -381,7 +546,7 @@ public sealed class NetworkMusicPage : Page var volumeIcon = new FontIcon { Glyph = "\uE767", FontSize = 15, Foreground = SecondaryTextBrush }; settings.Children.Add(volumeIcon); settings.Children.Add(_volume); - settings.Children.Add(_quality); + settings.Children.Add(_qualityButton); settings.Children.Add(_desktopLyricsButton); bar.Children.Add(settings); ArrangePlayerBar(bar, track, transport, settings, volumeIcon, double.PositiveInfinity); @@ -435,7 +600,7 @@ public sealed class NetworkMusicPage : Page _favoriteButton.Visibility = Visibility.Visible; volumeIcon.Visibility = full ? Visibility.Visible : Visibility.Collapsed; _volume.Visibility = full ? Visibility.Visible : Visibility.Collapsed; - _quality.Visibility = full ? Visibility.Visible : Visibility.Collapsed; + _qualityButton.Visibility = full ? Visibility.Visible : Visibility.Collapsed; } private async void NetworkMusicPage_Loaded(object sender, RoutedEventArgs e) @@ -456,9 +621,7 @@ public sealed class NetworkMusicPage : Page await Provider.InitializeAsync(); await _playback.RestoreAsync(); _volume.Value = _playback.Volume; - _qualitySyncing = true; - _quality.SelectedIndex = IndexFromQuality(_playback.Quality); - _qualitySyncing = false; + RefreshQualityButton(); await LoadRecommendedCoreAsync(); }); } @@ -535,20 +698,12 @@ public sealed class NetworkMusicPage : Page { XamlRoot = XamlRoot, Title = AppLocalizer.T("网络音乐数据源声明", "Online music source notice"), - Content = new StackPanel - { - Spacing = 10, - Children = - { - Text(AppLocalizer.T("本工具展示、登录和播放的内容均由所选第三方音乐服务提供。", "Search, sign-in, and playback content is supplied by the selected third-party music service."), 14, FontWeights.SemiBold, maxLines: 3), - Text(AppLocalizer.T("请仅使用本人合法账户和已获得授权的内容。会员、版权、地区和服务限制由服务方决定;本工具不会绕过这些限制。", "Use only your own legitimate account and authorized content. Membership, copyright, regional, and service restrictions are decided by the provider and are not bypassed by this tool."), 12, foreground: SecondaryTextBrush, maxLines: 5), - Text(AppLocalizer.T("登录凭据仅在本机通过 Windows DPAPI 加密保存,不会写入应用日志。", "Sign-in credentials are stored only on this device with Windows DPAPI and are never written to application logs."), 12, foreground: SecondaryTextBrush, maxLines: 4) - } - }, + Content = BuildMusicNoticeContent(), PrimaryButtonText = AppLocalizer.T("同意并继续", "Accept and continue"), CloseButtonText = AppLocalizer.T("暂不使用", "Not now"), DefaultButton = ContentDialogButton.Primary }; + ThemeService.PrepareContentDialog(dialog, XamlRoot, _settingsService.Current.Theme); if (await dialog.ShowAsync() != ContentDialogResult.Primary) { ShowStatus( @@ -570,11 +725,92 @@ public sealed class NetworkMusicPage : Page return true; } + private async Task ShowMusicUsageNoticeAsync() + { + var dialog = new ContentDialog + { + XamlRoot = XamlRoot, + Title = AppLocalizer.T("网络音乐使用须知与免责声明", "Online music usage notice and disclaimer"), + Content = BuildMusicNoticeContent(), + CloseButtonText = AppLocalizer.T("关闭", "Close"), + DefaultButton = ContentDialogButton.Close + }; + ThemeService.PrepareContentDialog(dialog, XamlRoot, _settingsService.Current.Theme); + await dialog.ShowAsync(); + } + + private static UIElement BuildMusicNoticeContent() + { + var panel = new StackPanel { Spacing = 10, MaxWidth = 620 }; + panel.Children.Add(Text(AppLocalizer.T( + "本工具展示、登录和播放的内容均由所选第三方音乐服务提供。仅供学习与技术研究,请尊重版权,不得用于商业行为、非法用途或破坏版权。", + "Search, sign-in, and playback content is supplied by third-party music services. This integration is for learning and technical research only; respect copyright and do not use it commercially, illegally, or to undermine copyright."), + 14, + FontWeights.SemiBold, + maxLines: 6)); + panel.Children.Add(Text(AppLocalizer.T( + "酷狗请求由随包 MoeKoeMusic/KuGouMusicApi 在本机随机回环端口承接,端口不对外公开。公共匿名 GET 最多缓存 2 分钟;登录、二维码、账户、权益、个人数据、写操作和播放地址不缓存。", + "Kugou requests are handled by the bundled MoeKoeMusic/KuGouMusicApi service on a random local loopback port that is not exposed externally. Public anonymous GET responses may be cached for up to two minutes; sign-in, QR, account, entitlement, personal, mutation, and stream-resolution requests are not cached."), + 12, + foreground: SecondaryTextBrush, + maxLines: 7)); + panel.Children.Add(Text(AppLocalizer.T( + "登录凭据、账户快照和权益分组仅在本机通过 Windows DPAPI 加密保存。登录态存在时不会重复调用登录接口;超过 12 小时仅在打开账户或使用账户能力时合并刷新。Cookie、令牌、二维码凭据和响应正文不会写入日志。", + "Credentials, account snapshots, and entitlement groups are encrypted locally with Windows DPAPI. Sign-in endpoints are not repeated while a session exists; snapshots older than 12 hours refresh only when account UI or account features are used. Cookies, tokens, QR credentials, and response bodies are not logged."), + 12, + foreground: SecondaryTextBrush, + maxLines: 8)); + panel.Children.Add(Text(AppLocalizer.T( + "请仅使用本人合法账户和已获授权的内容。本工具不会绕过会员、地区、版权或平台服务限制。", + "Use only your own legitimate account and authorized content. This tool does not bypass membership, regional, copyright, or provider restrictions."), + 12, + foreground: SecondaryTextBrush, + maxLines: 5)); + + panel.Children.Add(Text("MoeKoeMusic 固定提交 4581660209c9cdd07669e8bd5bcbe136b7d91e02 原始免责声明:", 12, FontWeights.SemiBold)); + panel.Children.Add(Text( + "0. 本程序是酷狗第三方客户端,并非酷狗官方,需要更完善的功能请下载官方客户端体验.\n" + + "1. 本项目仅供学习使用,请尊重版权,请勿利用此项目从事商业行为及非法用途!\n" + + "2. 使用本项目的过程中可能会产生版权数据。对于这些版权数据,本项目不拥有它们的所有权。为了避免侵权,使用者务必在 24 小时内清除使用本项目的过程中所产生的版权数据。\n" + + "3. 由于使用本项目产生的包括由于本协议或由于使用或无法使用本项目而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责。\n" + + "1. 禁止在违反当地法律法规的情况下使用本项目。对于使用者在明知或不知当地法律法规不允许的情况下使用本项目所造成的任何违法违规行为由使用者承担,本项目不承担由此造成的任何直接、间接、特殊、偶然或结果性责任。\n" + + "2. 音乐平台不易,请尊重版权,支持正版。\n" + + "3. 本项目仅用于对技术可行性的探索及研究,不接受任何商业(包括但不限于广告等)合作及捐赠。\n" + + "4. 如果官方音乐平台觉得本项目不妥,可联系本项目更改或移除。", + 11, + foreground: SecondaryTextBrush)); + + panel.Children.Add(Text("KuGouMusicApi 固定子模块 06560e3e053bda1ab830750db6f645bab703f824 原始免责声明:", 12, FontWeights.SemiBold)); + panel.Children.Add(Text( + "1. 本项目仅供学习使用,请尊重版权,请勿利用此项目从事商业行为及非法用途!\n" + + "2. 使用本项目的过程中可能会产生版权数据。对于这些版权数据,本项目不拥有它们的所有权。为了避免侵权,使用者务必在 24 小时内清除使用本项目的过程中所产生的版权数据。\n" + + "3. 由于使用本项目产生的包括由于本协议或由于使用或无法使用本项目而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责。\n" + + "4. 禁止在违反当地法律法规的情况下使用本项目。对于使用者在明知或不知当地法律法规不允许的情况下使用本项目所造成的任何违法违规行为由使用者承担,本项目不承担由此造成的任何直接、间接、特殊、偶然或结果性责任。\n" + + "5. 音乐平台不易,请尊重版权,支持正版。\n" + + "6. 本项目仅用于对技术可行性的探索及研究,不接受任何商业(包括但不限于广告等)合作及捐赠。\n" + + "7. 如果官方音乐平台觉得本项目不妥,可联系本项目更改或移除。", + 11, + foreground: SecondaryTextBrush)); + panel.Children.Add(Text(AppLocalizer.T( + "许可证与来源:MoeKoeMusic 固定提交适用 GPL-2.0,KuGouMusicApi 固定子模块适用 MIT;Node.js、Binaryify/NeteaseCloudMusicApi 缓存机制及 npm 依赖均在关于页和随包 THIRD_PARTY_NOTICES.md 列出。", + "Licenses and sources: the pinned MoeKoeMusic commit is GPL-2.0 and the pinned KuGouMusicApi submodule is MIT. Node.js, the Binaryify/NeteaseCloudMusicApi cache mechanism, and npm dependencies are listed in About and the bundled THIRD_PARTY_NOTICES.md."), + 11, + foreground: SecondaryTextBrush)); + + return new ScrollViewer + { + MaxHeight = 460, + VerticalScrollBarVisibility = ScrollBarVisibility.Auto, + Content = panel + }; + } + private async Task SelectProviderAsync(string providerId) { if (string.Equals(providerId, Provider.Id, StringComparison.OrdinalIgnoreCase)) return; _providers.Select(providerId); await Provider.InitializeAsync(); + RefreshQualityButton(); _sectionTitle.Text = AppLocalizer.T("发现音乐", "Discover"); _sectionMeta.Text = AppLocalizer.T("精选内容", "Curated content"); _visibleSongs = []; @@ -672,18 +908,100 @@ public sealed class NetworkMusicPage : Page UpdateActiveLyric(_playback.Position); } - private async Task ChangeQualityAsync() + private void ShowQualityFlyout(Button? immersiveQualityAnchor = null) { - if (_qualitySyncing || !_loaded || _quality.SelectedIndex < 0) return; - var requested = QualityFromIndex(_quality.SelectedIndex); + var anchor = immersiveQualityAnchor ?? _qualityButton; + var panel = new StackPanel { Width = 330, Spacing = 2, Padding = new Thickness(4) }; + panel.Children.Add(Text( + AppLocalizer.T($"{ProviderDisplayName(Provider.Id)}音质", $"{ProviderDisplayName(Provider.Id)} quality"), + 13, + FontWeights.SemiBold)); + foreach (var option in Provider.QualityOptions) + { + var selected = option.Quality == _playback.Quality; + var available = option.Availability == MusicQualityAvailability.Available; + var row = new Grid { MinHeight = 52, ColumnSpacing = 10 }; + row.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(24) }); + row.ColumnDefinitions.Add(new ColumnDefinition()); + row.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); + row.Children.Add(new FontIcon + { + Glyph = selected ? "\uE73E" : available ? "\uE8D6" : "\uE72E", + FontSize = 14, + Foreground = selected ? AccentBrush : SecondaryTextBrush, + VerticalAlignment = VerticalAlignment.Center + }); + var labels = new StackPanel { Spacing = 1, VerticalAlignment = VerticalAlignment.Center }; + labels.Children.Add(Text(option.DisplayName, 13, selected ? FontWeights.SemiBold : FontWeights.Normal)); + labels.Children.Add(Text( + $"{option.Format} · {option.BitrateKbps} kbps" + (string.IsNullOrWhiteSpace(option.RequiredEntitlement) ? string.Empty : $" · {option.RequiredEntitlement}"), + 11, + foreground: SecondaryTextBrush, + maxLines: 1)); + Grid.SetColumn(labels, 1); + row.Children.Add(labels); + if (!available) + { + var reason = Text(option.UnavailableReason ?? AppLocalizer.T("当前不可用", "Unavailable"), 10.5, foreground: SecondaryTextBrush, maxLines: 2); + reason.MaxWidth = 96; + reason.TextAlignment = TextAlignment.Right; + Grid.SetColumn(reason, 2); + row.Children.Add(reason); + } + var button = new Button + { + Content = row, + HorizontalContentAlignment = HorizontalAlignment.Stretch, + HorizontalAlignment = HorizontalAlignment.Stretch, + Background = selected ? SurfaceAltBrush : ModernUi.Transparent, + BorderThickness = new Thickness(0), + CornerRadius = new CornerRadius(5), + Padding = new Thickness(8, 2, 8, 2), + IsEnabled = available + }; + ToolTipService.SetToolTip(button, available ? option.DisplayName : option.UnavailableReason); + button.Click += async (_, _) => + { + if (anchor.Flyout is Flyout flyout) flyout.Hide(); + await ChangeQualityAsync(option.Quality); + }; + panel.Children.Add(button); + } + anchor.Flyout = new Flyout + { + Placement = Microsoft.UI.Xaml.Controls.Primitives.FlyoutPlacementMode.Top, + Content = panel + }; + anchor.Flyout.ShowAt(anchor); + } + + private void RefreshQualityButton() + { + var option = Provider.QualityOptions.FirstOrDefault(item => item.Quality == _playback.Quality); + var label = option?.DisplayName ?? _playback.Quality.ToString(); + _qualityButton.Content = new StackPanel + { + Orientation = Orientation.Horizontal, + Spacing = 7, + Children = + { + new FontIcon { Glyph = "\uE767", FontSize = 13 }, + Text(label, 12, FontWeights.SemiBold, maxLines: 1), + new FontIcon { Glyph = "\uE70D", FontSize = 10 } + } + }; + ToolTipService.SetToolTip(_qualityButton, AppLocalizer.T($"当前音质:{label}", $"Current quality: {label}")); + } + + private async Task ChangeQualityAsync(MusicPlaybackQuality requested) + { + if (!_loaded) return; var previous = _playback.Quality; _busy.IsActive = true; try { await _playback.ChangeQualityAsync(requested); - _qualitySyncing = true; - _quality.SelectedIndex = IndexFromQuality(_playback.Quality); - _qualitySyncing = false; + RefreshQualityButton(); var degraded = _playback.Quality != requested; ShowStatus( degraded ? AppLocalizer.T("已自动降级音质", "Quality was reduced") : AppLocalizer.T("音质已切换", "Quality changed"), @@ -694,15 +1012,12 @@ public sealed class NetworkMusicPage : Page } catch (Exception exception) { - _qualitySyncing = true; - _quality.SelectedIndex = IndexFromQuality(previous); - _qualitySyncing = false; + RefreshQualityButton(); if (_playback.LastFailure is { } failure) ShowPlaybackFailure(failure); else ShowStatus(AppLocalizer.T("音质切换失败", "Quality change failed"), AppLocalizer.SanitizeSensitiveText(exception.Message, 180), InfoBarSeverity.Error); } finally { - _qualitySyncing = false; _busy.IsActive = false; } } @@ -832,25 +1147,109 @@ public sealed class NetworkMusicPage : Page _lyrics.Children.Clear(); _activeLyricIndex = -1; _activeLyricWordIndex = -1; + ApplyLyricLayoutSettings(); if (lyrics.Lines.Count == 0) { _lyrics.Children.Add(Text(AppLocalizer.T("当前歌曲没有可用歌词", "No lyrics are available for this song"), 13, foreground: SecondaryTextBrush)); + RenderImmersiveLyrics(lyrics); return; } - foreach (var line in lyrics.Lines) + for (var index = 0; index < lyrics.Lines.Count; index++) { - var panel = new StackPanel { Spacing = 2, Tag = line }; - var lyric = Text(line.Text, 14, FontWeights.Normal, SecondaryTextBrush, maxLines: 3); - lyric.Tag = lyric.FontSize; - panel.Children.Add(lyric); - if (!string.IsNullOrWhiteSpace(line.Translation)) - { - var translation = Text(line.Translation!, 11.5, foreground: SecondaryTextBrush, maxLines: 2); - translation.Tag = translation.FontSize; - panel.Children.Add(translation); - } - _lyrics.Children.Add(panel); + _lyrics.Children.Add(CreateLyricRow(lyrics.Lines[index], index, immersive: false)); } + RenderImmersiveLyrics(lyrics); + } + + private Button CreateLyricRow(TimedLyricLine line, int index, bool immersive) + { + var settings = _settingsService.Current.Lyrics; + var scale = settings.FontScale; + var panel = new StackPanel { Spacing = immersive ? 5 : 3, Tag = line }; + var lyric = Text(line.Text, (immersive ? 21 : 14) * scale, FontWeights.Normal, SecondaryTextBrush, maxLines: immersive ? 5 : 3); + lyric.Tag = lyric.FontSize; + panel.Children.Add(lyric); + if (settings.ShowTranslation && !string.IsNullOrWhiteSpace(line.Translation)) + { + var translation = Text(line.Translation!, (immersive ? 13 : 11.5) * scale, foreground: SecondaryTextBrush, maxLines: immersive ? 3 : 2); + translation.Tag = translation.FontSize; + panel.Children.Add(translation); + } + if (settings.ShowRomanized && !string.IsNullOrWhiteSpace(line.Romanized)) + { + var romanized = Text(line.Romanized!, (immersive ? 12 : 10.5) * scale, foreground: SecondaryTextBrush, maxLines: immersive ? 3 : 2); + romanized.Tag = romanized.FontSize; + panel.Children.Add(romanized); + } + var button = new Button + { + Content = panel, + Tag = index, + HorizontalContentAlignment = HorizontalAlignment.Stretch, + HorizontalAlignment = HorizontalAlignment.Stretch, + Background = ModernUi.Transparent, + BorderThickness = new Thickness(0), + CornerRadius = new CornerRadius(4), + Padding = new Thickness(immersive ? 10 : 4, immersive ? 7 : 3, 10, immersive ? 7 : 3) + }; + Microsoft.UI.Xaml.Automation.AutomationProperties.SetName(button, AppLocalizer.T($"跳转到歌词:{line.Text}", $"Seek to lyric: {line.Text}")); + button.Click += (_, _) => + { + _playback.Seek(line.Start); + RefreshPlaybackUi(); + }; + return button; + } + + private void RenderImmersiveLyrics(TimedLyrics lyrics) + { + _immersiveLyrics.Children.Clear(); + if (lyrics.Lines.Count == 0) + { + _immersiveLyrics.Children.Add(Text(AppLocalizer.T("当前歌曲没有可用歌词", "No lyrics are available for this song"), 15, foreground: SecondaryTextBrush)); + return; + } + for (var index = 0; index < lyrics.Lines.Count; index++) + { + _immersiveLyrics.Children.Add(CreateLyricRow(lyrics.Lines[index], index, immersive: true)); + } + } + + private void OpenImmersiveLyrics() + { + if (_playback.CurrentSong is null) + { + ShowStatus(AppLocalizer.T("尚未播放歌曲", "Nothing is playing"), AppLocalizer.T("选择歌曲后可进入沉浸歌词。", "Choose a song before opening immersive lyrics."), InfoBarSeverity.Informational); + return; + } + _immersiveOpen = true; + if (_topBarElement is not null) _topBarElement.Visibility = Visibility.Collapsed; + if (_contentElement is not null) _contentElement.Visibility = Visibility.Collapsed; + if (_playerElement is not null) _playerElement.Visibility = Visibility.Collapsed; + if (_immersiveElement is not null) _immersiveElement.Visibility = Visibility.Visible; + UpdateImmersiveMetadata(); + if (_currentLyrics is not null) RenderImmersiveLyrics(_currentLyrics); + _immersiveBackButton?.Focus(FocusState.Programmatic); + } + + private void CloseImmersiveLyrics() + { + _immersiveOpen = false; + if (_topBarElement is not null) _topBarElement.Visibility = Visibility.Visible; + if (_contentElement is not null) _contentElement.Visibility = Visibility.Visible; + if (_playerElement is not null) _playerElement.Visibility = Visibility.Visible; + if (_immersiveElement is not null) _immersiveElement.Visibility = Visibility.Collapsed; + _immersiveButton.Focus(FocusState.Programmatic); + } + + private void UpdateImmersiveMetadata() + { + var song = _playback.CurrentSong; + _immersiveTitle.Text = song?.Name ?? AppLocalizer.T("未在播放", "Nothing playing"); + _immersiveArtist.Text = song is null ? string.Empty : $"{song.Artist} · {song.Album}"; + _immersiveCover.Source = Uri.TryCreate(song?.CoverUrl, UriKind.Absolute, out var cover) && cover.Scheme == Uri.UriSchemeHttps + ? new BitmapImage(cover) { DecodePixelWidth = 640, DecodePixelHeight = 640 } + : null; } private void RefreshPlaybackUi() @@ -860,6 +1259,8 @@ public sealed class NetworkMusicPage : Page _trackArtist.Text = song is null ? AppLocalizer.T("从搜索或歌单中选择歌曲", "Choose a song from search or a playlist") : $"{song.Artist} · {song.Album}"; if (_playPauseButton.Content is FontIcon icon) icon.Glyph = _playback.IsPlaying ? "\uE769" : "\uE768"; _mvButton.IsEnabled = song is not null; + UpdateImmersiveMetadata(); + if (_immersivePlayPauseButton.Content is FontIcon immersiveIcon) immersiveIcon.Glyph = _playback.IsPlaying ? "\uE769" : "\uE768"; BeginFavoriteStateRefresh(song); if (_seekInteraction.ShouldSynchronize) { @@ -867,7 +1268,12 @@ public sealed class NetworkMusicPage : Page _position.Maximum = Math.Max(1, _playback.Duration.TotalSeconds); _position.Value = Math.Clamp(_playback.Position.TotalSeconds, 0, _position.Maximum); _syncingPosition = false; + _syncingImmersivePosition = true; + _immersivePosition.Maximum = Math.Max(1, _playback.Duration.TotalSeconds); + _immersivePosition.Value = Math.Clamp(_playback.Position.TotalSeconds, 0, _immersivePosition.Maximum); + _syncingImmersivePosition = false; } + _immersiveVolume.Value = _playback.Volume; UpdateActiveLyric(_playback.Position); if (_playback.LastFailure is { } failure) { @@ -893,8 +1299,9 @@ public sealed class NetworkMusicPage : Page private void UpdateActiveLyric(TimeSpan position) { if (_currentLyrics is null || _currentLyrics.Lines.Count == 0) return; - var nextIndex = _lyricsCoordinator.ActiveLineIndex; - var nextWordIndex = _lyricsCoordinator.ActiveWordIndex; + var cursor = _lyricsCoordinator.Cursor; + var nextIndex = cursor.LineIndex; + var nextWordIndex = cursor.WordIndex; if (nextIndex == _activeLyricIndex && nextWordIndex == _activeLyricWordIndex) return; if (nextIndex < 0) { @@ -905,45 +1312,73 @@ public sealed class NetworkMusicPage : Page if (lineChanged) ResetActiveLyricStyle(); _activeLyricIndex = nextIndex; _activeLyricWordIndex = nextWordIndex; - if (_lyrics.Children[nextIndex] is StackPanel current) + ApplyActiveLyricStyle(_lyrics, _lyricsScroll, nextIndex, nextWordIndex, lineChanged, immersive: false); + ApplyActiveLyricStyle(_immersiveLyrics, _immersiveLyricsScroll, nextIndex, nextWordIndex, lineChanged, immersive: true); + } + + private void ApplyActiveLyricStyle( + StackPanel container, + ScrollViewer scroll, + int lineIndex, + int wordIndex, + bool lineChanged, + bool immersive) + { + if (lineIndex < 0 || lineIndex >= container.Children.Count || LyricPanel(container.Children[lineIndex]) is not { } current) return; + var settings = _settingsService.Current.Lyrics; + var activeBrush = LyricActiveBrush(settings.ActiveWordColor); + foreach (var block in current.Children.OfType()) { - foreach (var block in current.Children.OfType()) + block.Foreground = activeBrush; + block.FontWeight = FontWeights.SemiBold; + block.FontSize = Math.Max(block.Tag is double size ? size : block.FontSize, (immersive ? 22 : 15) * settings.FontScale); + } + if (current.Children.FirstOrDefault() is TextBlock lyric) + { + lyric.TextHighlighters.Clear(); + var words = _currentLyrics!.Lines[lineIndex].Words; + if (settings.WordHighlightEnabled && wordIndex >= 0 && wordIndex < words.Count) { - block.Foreground = AccentBrush; - block.FontWeight = FontWeights.SemiBold; - block.FontSize = Math.Max(block.Tag is double size ? size : block.FontSize, 15); - } - if (current.Children.FirstOrDefault() is TextBlock lyric) - { - lyric.TextHighlighters.Clear(); - var words = _currentLyrics.Lines[nextIndex].Words; - if (nextWordIndex >= 0 && nextWordIndex < words.Count) + var word = words[wordIndex]; + if (word.CharacterStart > 0) { - var word = words[nextWordIndex]; - var highlight = new TextHighlighter - { - Background = AccentBrush, - Foreground = ModernUi.AccentForeground - }; - highlight.Ranges.Add(new TextRange - { - StartIndex = word.CharacterStart, - Length = Math.Max(0, word.CharacterEnd - word.CharacterStart) - }); - lyric.TextHighlighters.Add(highlight); + var completed = new TextHighlighter { Foreground = activeBrush }; + completed.Ranges.Add(new TextRange { StartIndex = 0, Length = word.CharacterStart }); + lyric.TextHighlighters.Add(completed); } + var highlight = new TextHighlighter + { + Background = activeBrush, + Foreground = ModernUi.AccentForeground + }; + highlight.Ranges.Add(new TextRange + { + StartIndex = word.CharacterStart, + Length = Math.Max(0, word.CharacterEnd - word.CharacterStart) + }); + lyric.TextHighlighters.Add(highlight); } - if (lineChanged) - { - var offset = current.TransformToVisual(_lyrics).TransformPoint(new Windows.Foundation.Point()).Y; - _lyricsScroll.ChangeView(null, Math.Max(0, offset - 110), null, disableAnimation: false); - } + } + if (lineChanged) + { + var offset = current.TransformToVisual(container).TransformPoint(new Windows.Foundation.Point()).Y; + var animationsEnabled = true; + try { animationsEnabled = new UISettings().AnimationsEnabled; } catch { } + scroll.ChangeView(null, Math.Max(0, offset - (immersive ? 190 : 110)), null, disableAnimation: !animationsEnabled); } } - private void ResetActiveLyricStyle() + private static StackPanel? LyricPanel(UIElement element) + => element switch + { + Button { Content: StackPanel panel } => panel, + StackPanel panel => panel, + _ => null + }; + + private void ResetLyricStyle(StackPanel container, int lineIndex) { - if (_activeLyricIndex >= 0 && _activeLyricIndex < _lyrics.Children.Count && _lyrics.Children[_activeLyricIndex] is StackPanel previous) + if (lineIndex >= 0 && lineIndex < container.Children.Count && LyricPanel(container.Children[lineIndex]) is { } previous) { foreach (var block in previous.Children.OfType()) { @@ -953,12 +1388,144 @@ public sealed class NetworkMusicPage : Page block.FontSize = block.Tag is double size ? size : block.FontSize; } } + } + + private void ResetActiveLyricStyle() + { + ResetLyricStyle(_lyrics, _activeLyricIndex); + ResetLyricStyle(_immersiveLyrics, _activeLyricIndex); _activeLyricIndex = -1; _activeLyricWordIndex = -1; } + private void ApplyLyricLayoutSettings() + { + var spacing = _settingsService.Current.Lyrics.LineSpacing; + _lyrics.Spacing = spacing; + _immersiveLyrics.Spacing = Math.Clamp(spacing * 1.25, 6, 40); + _desktopLyricsButton.IsEnabled = _settingsService.Current.Lyrics.DesktopSyncEnabled; + } + + private static SolidColorBrush LyricActiveBrush(int argb) + => new(ColorHelper.FromArgb( + (byte)((uint)argb >> 24), + (byte)((uint)argb >> 16), + (byte)((uint)argb >> 8), + (byte)argb)); + + private static Color ToColor(int argb) + => ColorHelper.FromArgb( + (byte)((uint)argb >> 24), + (byte)((uint)argb >> 16), + (byte)((uint)argb >> 8), + (byte)argb); + + private static int ToArgb(Color color) + => unchecked((int)((uint)color.A << 24 | (uint)color.R << 16 | (uint)color.G << 8 | color.B)); + + private async Task ShowLyricsSettingsAsync() + { + var current = _settingsService.Current.Lyrics; + var wordHighlight = new ToggleSwitch + { + Header = AppLocalizer.T("逐字高亮", "Word highlighting"), + IsOn = current.WordHighlightEnabled + }; + var translation = new ToggleSwitch + { + Header = AppLocalizer.T("显示翻译", "Show translation"), + IsOn = current.ShowTranslation + }; + var romanized = new ToggleSwitch + { + Header = AppLocalizer.T("显示罗马音", "Show romanization"), + IsOn = current.ShowRomanized + }; + var desktopSync = new ToggleSwitch + { + Header = AppLocalizer.T("同步桌面歌词", "Sync desktop lyrics"), + IsOn = current.DesktopSyncEnabled + }; + var fontScale = new Slider + { + Minimum = 0.75, + Maximum = 1.75, + StepFrequency = 0.05, + Value = current.FontScale + }; + var lineSpacing = new Slider + { + Minimum = 4, + Maximum = 32, + StepFrequency = 1, + Value = current.LineSpacing + }; + var colorPicker = new ColorPicker + { + Color = ToColor(current.ActiveWordColor), + IsAlphaEnabled = false, + IsColorChannelTextInputVisible = true, + IsHexInputVisible = true, + MinHeight = 220 + }; + var content = new StackPanel + { + Spacing = 12, + MinWidth = 360, + Children = + { + wordHighlight, + translation, + romanized, + desktopSync, + Text(AppLocalizer.T("歌词字号", "Lyric size"), 13, FontWeights.SemiBold), + fontScale, + Text(AppLocalizer.T("歌词行距", "Line spacing"), 13, FontWeights.SemiBold), + lineSpacing, + Text(AppLocalizer.T("当前词颜色", "Active word color"), 13, FontWeights.SemiBold), + colorPicker + } + }; + var dialog = new ContentDialog + { + Title = AppLocalizer.T("歌词字幕设置", "Lyric settings"), + Content = new ScrollViewer { Content = content, MaxHeight = 560 }, + PrimaryButtonText = AppLocalizer.T("保存", "Save"), + CloseButtonText = AppLocalizer.T("取消", "Cancel"), + DefaultButton = ContentDialogButton.Primary, + XamlRoot = XamlRoot + }; + ThemeService.PrepareContentDialog(dialog, XamlRoot, _settingsService.Current.Theme); + if (await dialog.ShowAsync() != ContentDialogResult.Primary) return; + + await _settingsService.UpdateAsync(settings => + { + settings.Lyrics.WordHighlightEnabled = wordHighlight.IsOn; + settings.Lyrics.ShowTranslation = translation.IsOn; + settings.Lyrics.ShowRomanized = romanized.IsOn; + settings.Lyrics.DesktopSyncEnabled = desktopSync.IsOn; + settings.Lyrics.FontScale = fontScale.Value; + settings.Lyrics.LineSpacing = lineSpacing.Value; + settings.Lyrics.ActiveWordColor = ToArgb(colorPicker.Color); + }); + ApplyLyricLayoutSettings(); + if (_currentLyrics is not null) + { + RenderLyrics(_currentLyrics); + UpdateActiveLyric(_playback.Position); + } + } + private async Task ToggleDesktopLyricsAsync() { + if (!_settingsService.Current.Lyrics.DesktopSyncEnabled) + { + ShowStatus( + AppLocalizer.T("桌面歌词已关闭", "Desktop lyrics are disabled"), + AppLocalizer.T("可在歌词设置中重新启用桌面歌词同步。", "Enable desktop lyric sync in lyric settings."), + InfoBarSeverity.Informational); + return; + } var song = _playback.CurrentSong; var line = _activeLyricIndex >= 0 && _currentLyrics is not null && _activeLyricIndex < _currentLyrics.Lines.Count ? _currentLyrics.Lines[_activeLyricIndex] @@ -1087,6 +1654,10 @@ public sealed class NetworkMusicPage : Page try { await currentProvider.InitializeAsync(); + if (currentProvider.LoginState.LoggedIn && currentProvider.LoginState.IsStale) + { + await currentProvider.RefreshLoginStateAsync(); + } RefreshAccountPicture(); } catch (Exception exception) @@ -1100,7 +1671,7 @@ public sealed class NetworkMusicPage : Page var requestedProviderId = string.Empty; var qrImage = new Image { Width = 190, Height = 190, Stretch = Stretch.Uniform }; - var qrStatus = Text(AppLocalizer.T("正在创建登录二维码…", "Creating sign-in QR code..."), 12, foreground: SecondaryTextBrush, maxLines: 3); + var qrStatus = Text(AppLocalizer.T("点击“扫码登录”后才会创建二维码", "A QR code is created only after you choose QR sign-in"), 12, foreground: SecondaryTextBrush, maxLines: 3); var cookie = new TextBox { Header = AppLocalizer.T("Cookie 登录", "Cookie sign-in"), @@ -1122,7 +1693,21 @@ public sealed class NetworkMusicPage : Page var sourceId = source.Id; var option = new RadioButton { - Content = ProviderDisplayName(sourceId), + Content = new StackPanel + { + Spacing = 1, + Children = + { + Text(ProviderDisplayName(sourceId), 12.5, FontWeights.SemiBold), + Text( + source.LoginState.LoggedIn + ? $"{source.LoginState.Nickname} · " + AccountCacheLabel(source.LoginState) + : AppLocalizer.T("未登录", "Signed out"), + 10.5, + foreground: SecondaryTextBrush, + maxLines: 1) + } + }, GroupName = sourceGroup, IsChecked = string.Equals(sourceId, currentProvider.Id, StringComparison.OrdinalIgnoreCase), MinHeight = 36 @@ -1158,11 +1743,21 @@ public sealed class NetworkMusicPage : Page content.Children.Add(accountState); if (signedIn) { - content.Children.Add(Text( - AppLocalizer.T($"账户权益:{currentProvider.LoginState.VipLevel}", $"Account entitlement: {currentProvider.LoginState.VipLevel}"), + var entitlementPanel = new StackPanel { Spacing = 4 }; + entitlementPanel.Children.Add(Text( + AppLocalizer.T($"账户权益 · {AccountCacheLabel(currentProvider.LoginState)}", $"Entitlements · {AccountCacheLabel(currentProvider.LoginState)}"), 12, - foreground: SecondaryTextBrush, - maxLines: 2)); + FontWeights.SemiBold)); + if (currentProvider.LoginState.Entitlements.Count == 0) + { + entitlementPanel.Children.Add(Text(AppLocalizer.T("未返回平台会员权益", "No membership grant was returned"), 11, foreground: SecondaryTextBrush)); + } + foreach (var grant in currentProvider.LoginState.Entitlements) + { + var expiry = grant.ExpiresAt is null ? string.Empty : AppLocalizer.T($" · 至 {grant.ExpiresAt:yyyy-MM-dd}", $" · until {grant.ExpiresAt:yyyy-MM-dd}"); + entitlementPanel.Children.Add(Text($"{grant.DisplayName} · {grant.Group}{expiry}", 11.5, foreground: grant.Enabled ? PrimaryTextBrush : SecondaryTextBrush, maxLines: 2)); + } + content.Children.Add(entitlementPanel); } var qrActions = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8 }; @@ -1188,7 +1783,7 @@ public sealed class NetworkMusicPage : Page { content.Children.Add(qrStatus); content.Children.Add(qrImage); - qrActions.Children.Add(DarkButton(AppLocalizer.T("刷新二维码", "Refresh QR code"), "\uE72C", StartQr)); + qrActions.Children.Add(DarkButton(AppLocalizer.T("扫码登录", "QR sign-in"), "\uE8D7", StartQr, primary: true)); qrActions.Children.Add(DarkButton(AppLocalizer.T("取消扫码", "Cancel QR sign-in"), "\uE71A", () => CancelQr(AppLocalizer.T("已取消扫码登录", "QR sign-in canceled")))); content.Children.Add(qrActions); @@ -1235,6 +1830,15 @@ public sealed class NetworkMusicPage : Page InfoBarSeverity.Error); } })); + if (signedIn) actions.Children.Add(DarkButton(AppLocalizer.T("更新权益", "Refresh entitlements"), "\uE72C", async () => + { + var refreshed = await currentProvider.RefreshLoginStateAsync(force: true); + accountState.Text = refreshed.LoggedIn + ? AppLocalizer.T($"已登录:{refreshed.Nickname} · {AccountCacheLabel(refreshed)}", $"Signed in: {refreshed.Nickname} · {AccountCacheLabel(refreshed)}") + : AppLocalizer.T("登录已失效", "The sign-in has expired"); + reopen = true; + dialog?.Hide(); + })); if (actions.Children.Count > 0) content.Children.Add(actions); content.Children.Add(Text(AppLocalizer.T("登录仅用于当前音乐来源的账户能力;不绕过会员、地区或版权限制。", "Sign-in only enables the selected provider's account features; it does not bypass membership, regional, or copyright restrictions."), 11, foreground: SecondaryTextBrush, maxLines: 3)); dialog = new ContentDialog @@ -1245,7 +1849,7 @@ public sealed class NetworkMusicPage : Page CloseButtonText = AppLocalizer.T("关闭", "Close"), DefaultButton = ContentDialogButton.Close }; - if (!signedIn) StartQr(); + ThemeService.PrepareContentDialog(dialog, XamlRoot, _settingsService.Current.Theme); await dialog.ShowAsync(); CancelQr(AppLocalizer.T("已关闭账户窗口", "Account dialog closed")); @@ -1305,6 +1909,7 @@ public sealed class NetworkMusicPage : Page Content = media, CloseButtonText = AppLocalizer.T("关闭", "Close") }; + ThemeService.PrepareContentDialog(dialog, XamlRoot, _settingsService.Current.Theme); try { await dialog.ShowAsync(); @@ -1488,6 +2093,13 @@ public sealed class NetworkMusicPage : Page _ => providerId }; + private static string AccountCacheLabel(MusicLoginState state) + => state.IsStale + ? AppLocalizer.T("缓存,待更新", "Cached, refresh pending") + : state.IsCached + ? AppLocalizer.T("已缓存", "Cached") + : AppLocalizer.T("已更新", "Up to date"); + private static Button NavButton(string glyph, string title, Func action) => DarkButton(title, glyph, async () => await action()); @@ -1594,21 +2206,4 @@ public sealed class NetworkMusicPage : Page private static TextBlock Text(string value, double size, FontWeight? weight = null, Brush? foreground = null, int maxLines = 0) => ModernUi.Text(value, size, weight, foreground, maxLines); - private static MusicPlaybackQuality QualityFromIndex(int index) => index switch - { - 0 => MusicPlaybackQuality.Master, - 2 => MusicPlaybackQuality.Lossless, - 3 => MusicPlaybackQuality.High, - 4 => MusicPlaybackQuality.Standard, - _ => MusicPlaybackQuality.HiRes - }; - - private static int IndexFromQuality(MusicPlaybackQuality quality) => quality switch - { - MusicPlaybackQuality.Master => 0, - MusicPlaybackQuality.HiRes => 1, - MusicPlaybackQuality.Lossless => 2, - MusicPlaybackQuality.High => 3, - _ => 4 - }; } diff --git a/src/box-winUI/Views/PluginHostPage.cs b/src/box-winUI/Views/PluginHostPage.cs index 29dff82..1b43e27 100644 --- a/src/box-winUI/Views/PluginHostPage.cs +++ b/src/box-winUI/Views/PluginHostPage.cs @@ -22,6 +22,7 @@ public sealed class PluginHostPage : ToolPageBase private readonly ILogService _logService = AppServices.GetRequiredService(); private readonly WebView2EnvironmentFactory _webViewEnvironmentFactory = AppServices.GetRequiredService(); private readonly ISettingsService _settingsService = AppServices.GetRequiredService(); + private readonly IToolUiDefinitionStore _toolUiDefinitionStore = AppServices.GetRequiredService(); private readonly WebView2 _webView = new(); private readonly TextBox _outputBox = new() { @@ -35,6 +36,7 @@ public sealed class PluginHostPage : ToolPageBase private bool _loaded; private PluginBridge? _bridge; private string _origin = string.Empty; + private ToolUiDefinition _uiDefinition; public PluginHostPage(LoadedPlugin plugin, PluginSurface surface, Action? goBack = null) { @@ -42,11 +44,15 @@ public sealed class PluginHostPage : ToolPageBase _surface = surface; _goBack = goBack; Background = ModernUi.AppBackground; + BindModule(new PluginToolModule(plugin, surface)); + _uiDefinition = _toolUiDefinitionStore.GetFallback(Module!); Content = BuildContent(); Loaded += PluginHostPage_Loaded; Unloaded += PluginHostPage_Unloaded; } + public ToolUiDefinition UiDefinition => _uiDefinition; + private UIElement BuildContent() { var root = new Grid @@ -108,6 +114,13 @@ public sealed class PluginHostPage : ToolPageBase } _loaded = true; + if (Module is not null) + { + _uiDefinition = await _toolUiDefinitionStore.GetAsync(Module); + _statusText.Text = _uiDefinition.IsFallback + ? $"插件页面使用安全回退定义:{_uiDefinition.Diagnostic}" + : "插件页面定义已加载,第三方内容保持隔离。"; + } await LoadAsync(); } diff --git a/src/box-winUI/Views/Tools/AdaptiveToolPage.DefinitionSurface.cs b/src/box-winUI/Views/Tools/AdaptiveToolPage.DefinitionSurface.cs new file mode 100644 index 0000000..567c740 --- /dev/null +++ b/src/box-winUI/Views/Tools/AdaptiveToolPage.DefinitionSurface.cs @@ -0,0 +1,499 @@ +using System.Globalization; +using Microsoft.UI.Text; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; +using YMhut.Box.Core.Settings; +using YMhut.Box.Core.Tools; + +namespace YMhut.Box.WinUI.Views.Tools; + +/// +/// Renders the immutable tool definition as a page surface. The execution +/// model remains in AdaptiveToolPage; this file only maps safe controls and +/// actions to the existing execution inputs. +/// +public abstract partial class AdaptiveToolPage +{ + private void RebuildDefinitionSurface() + { + if (_toolGrid.Children.Count < 2 || Module is null) + { + return; + } + + // Detach the old controls before reusing the shared input elements. + _toolGrid.Children.RemoveAt(0); + _toolGrid.Children.Insert(0, BuildModernGalleryInputCard(Module)); + if (_toolGrid.Children.Count == 2) + { + _toolGrid.Children.RemoveAt(1); + _toolGrid.Children.Insert(1, BuildGalleryResultCard()); + } + ArrangeGalleryToolGrid(); + } + + private FrameworkElement BuildDefinitionInputSurface(IToolModule module) + { + _definitionStateControls.Clear(); + _definitionExpanders.Clear(); + var sections = new StackPanel + { + Spacing = _spec.PageDensity == ToolPageDensity.Compact ? 10 : 14 + }; + + foreach (var section in _uiDefinition.Sections) + { + var content = new StackPanel + { + Spacing = 10 + }; + foreach (var control in section.Controls) + { + var element = BuildDefinitionControl(module, section, control); + if (element is not null) + { + content.Children.Add(element); + } + } + + if (content.Children.Count == 0) + { + continue; + } + + var title = section.Title.ForLanguage(_settingsService.Current.Language); + var description = section.Description.ForLanguage(_settingsService.Current.Language); + var header = BuildGallerySectionHeader( + section.IsAdvanced ? AppLocalizer.T("高级", "Advanced") : AppLocalizer.T("工作区", "Workspace"), + title, + description, + section.IsAdvanced ? "\uE713" : "\uE8D2", + compact: true); + + if (section.IsAdvanced) + { + var expander = new Expander + { + IsExpanded = _uiDefinition.AdvancedExpandedByDefault, + Header = header, + Content = content, + HorizontalAlignment = HorizontalAlignment.Stretch + }; + _definitionExpanders[section.Id] = expander; + sections.Children.Add(expander); + } + else + { + sections.Children.Add(new StackPanel + { + Spacing = 10, + Children = { header, content } + }); + } + } + + if (sections.Children.Count == 0) + { + sections.Children.Add(ModernUi.Text( + AppLocalizer.T("此工具没有可验证的输入定义。", "This tool has no verified input definition."), + 13, + foreground: ModernUi.TextSecondary)); + } + + var actions = BuildDefinitionActions(); + if (actions.Children.Count > 0) + { + sections.Children.Add(new ScrollViewer + { + HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, + VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, + Content = actions + }); + } + + return sections; + } + + private UIElement? BuildDefinitionControl(IToolModule module, ToolUiSection section, ToolUiControl control) + { + var id = control.Id.ToLowerInvariant(); + UIElement? element = id switch + { + "primary" or "input" => BuildPrimaryDefinitionControl(control), + "query" => _queryBox.Visibility == Visibility.Visible ? _queryBox : null, + "parameter" => _parameterBox.Visibility == Visibility.Visible ? _parameterBox : null, + "date-range" => _startDatePicker.Visibility == Visibility.Visible ? BuildDatePanel() : null, + "date-start" => _startDatePicker.Visibility == Visibility.Visible ? _startDatePicker : null, + "date-end" => _endDatePicker.Visibility == Visibility.Visible ? _endDatePicker : null, + "number-primary" => _numberBox.Visibility == Visibility.Visible ? _numberBox : null, + "number-secondary" => _secondaryNumberBox.Visibility == Visibility.Visible ? _secondaryNumberBox : null, + "number-third" => _thirdNumberBox.Visibility == Visibility.Visible ? _thirdNumberBox : null, + "number-fourth" => _fourthNumberBox.Visibility == Visibility.Visible ? _fourthNumberBox : null, + "numbers" => UsesNumericPrimaryInput() ? BuildNumberInputPanel() : null, + "rules" => _ruleControlsPanel.Visibility == Visibility.Visible ? _ruleControlsPanel : null, + "auxiliary" => _auxBox.Visibility == Visibility.Visible ? _auxBox : null, + "advanced-toggle" => BuildAdvancedToggle(control), + "status" => ModernUi.Text( + control.Label.ForLanguage(_settingsService.Current.Language), + 13, + foreground: ModernUi.TextSecondary), + _ => BuildUnmappedDefinitionControl(control) + }; + + if (element is FrameworkElement frameworkElement) + { + ApplyDefinitionDefaults(frameworkElement, control); + if (!control.IsReadOnly) + { + _definitionStateControls[control.Id] = frameworkElement; + } + } + + return element; + } + + private UIElement? BuildPrimaryDefinitionControl(ToolUiControl control) + { + if (_queryBox.Visibility == Visibility.Visible) + { + return _queryBox; + } + + if (_inputBox.Visibility == Visibility.Visible) + { + return _inputBox; + } + + if (UsesNumericPrimaryInput()) + { + return BuildNumberInputPanel(); + } + + if (_parameterBox.Visibility == Visibility.Visible) + { + return _parameterBox; + } + + return null; + } + + private ToggleSwitch BuildAdvancedToggle(ToolUiControl control) + { + var toggle = new ToggleSwitch + { + Header = control.Label.ForLanguage(_settingsService.Current.Language), + IsOn = string.Equals(control.DefaultValue, "true", StringComparison.OrdinalIgnoreCase), + HorizontalAlignment = HorizontalAlignment.Stretch + }; + ToolTipService.SetToolTip(toggle, control.Placeholder ?? control.Label.ForLanguage(_settingsService.Current.Language)); + return toggle; + } + + private UIElement BuildUnmappedDefinitionControl(ToolUiControl control) + { + var label = control.Label.ForLanguage(_settingsService.Current.Language); + return new InfoBar + { + IsOpen = true, + Severity = InfoBarSeverity.Informational, + Title = label, + Message = AppLocalizer.T("该控件由定义声明,但当前客户端版本不支持执行;已保持安全只读状态。", "This declared control is not supported by this client version and remains safely read-only."), + IsClosable = false + }; + } + + private void ApplyDefinitionDefaults(FrameworkElement element, ToolUiControl control) + { + if (element is TextBox textBox) + { + if (!string.IsNullOrWhiteSpace(control.Placeholder)) + { + textBox.PlaceholderText = control.Placeholder; + } + + if (!string.IsNullOrWhiteSpace(control.DefaultValue) && string.IsNullOrEmpty(textBox.Text)) + { + textBox.Text = control.DefaultValue; + } + + if (control.Validation?.MaxLength is int maxLength && maxLength > 0) + { + textBox.MaxLength = maxLength; + } + } + + if (element is Control controlElement && control.IsReadOnly) + { + controlElement.IsEnabled = false; + } + } + + private StackPanel BuildDefinitionActions() + { + var actions = new StackPanel + { + Orientation = Orientation.Horizontal, + Spacing = 10 + }; + + foreach (var action in _uiDefinition.Actions) + { + var id = action.Id.ToLowerInvariant(); + var label = action.Label.ForLanguage(_settingsService.Current.Language); + var button = ModernUi.PillButton(label, ActionGlyph(id), primary: id is "run" or "execute" or "query" or "format"); + button.IsEnabled = action.IsEnabled && !_uiDefinition.IsFallback; + if (_uiDefinition.IsFallback && !string.IsNullOrWhiteSpace(_uiDefinition.Diagnostic)) + { + button.IsEnabled = false; + ToolTipService.SetToolTip(button, AppLocalizer.T("页面定义不可用,已禁用未验证动作。", "Unverified actions are disabled because the page definition is unavailable.")); + } + + switch (id) + { + case "run": + case "execute": + case "query": + case "format": + case "convert": + case "generate": + case "process": + button.Click += async (_, _) => await RunCurrentToolAsync(); + break; + case "choosefile": + case "choose-file": + button.Click += (_, _) => BrowseInputFile(); + break; + case "clear": + button.Click += (_, _) => ClearInput(); + break; + case "copyresult": + case "copy-result": + button.Click += (_, _) => CopyResult(); + break; + case "reload": + button.Click += async (_, _) => await RunCurrentToolAsync(); + break; + case "cancel": + button.Click += (_, _) => CancelRunningTool(); + break; + default: + button.IsEnabled = false; + ToolTipService.SetToolTip(button, AppLocalizer.T("未验证的工具动作已禁用。", "Unverified tool action is disabled.")); + break; + } + + actions.Children.Add(button); + } + + return actions; + } + + private static string ActionGlyph(string id) + { + return id switch + { + "clear" => "\uE74D", + "copyresult" or "copy-result" => "\uE8C8", + "choosefile" or "choose-file" => "\uE8E5", + "reload" => "\uE72C", + "cancel" => "\uE711", + "preview" => "\uE7B3", + _ => "\uE768" + }; + } + + private ToolUiPageState CaptureToolUiState() + { + var state = new ToolUiPageState(); + CaptureVisibleValue(state, "input", _inputBox); + CaptureVisibleValue(state, "query", _queryBox); + CaptureVisibleValue(state, "parameter", _parameterBox); + CaptureVisibleValue(state, "auxiliary", _auxBox); + CaptureVisibleValue(state, "number-primary", _numberBox); + CaptureVisibleValue(state, "number-secondary", _secondaryNumberBox); + CaptureVisibleValue(state, "number-third", _thirdNumberBox); + CaptureVisibleValue(state, "number-fourth", _fourthNumberBox); + CaptureVisibleValue(state, "date-start", _startDatePicker); + CaptureVisibleValue(state, "date-end", _endDatePicker); + + foreach (var entry in _selectedRuleValues) + { + state.Values[$"rule:{entry.Key}"] = entry.Value; + } + + foreach (var entry in _definitionStateControls) + { + if (TryReadControlValue(entry.Value, out var value)) + { + state.Values[$"definition:{entry.Key}"] = value; + } + } + + foreach (var entry in _definitionExpanders) + { + state.ExpandedSections[entry.Key] = entry.Value.IsExpanded; + } + + return state; + } + + private void RestoreToolUiState() + { + if (Module is null) + { + return; + } + + var state = _settingsService.GetToolUiState(Module.Id); + RestoreValue(state, "parameter", _parameterBox); + RestoreValue(state, "number-primary", _numberBox); + RestoreValue(state, "number-secondary", _secondaryNumberBox); + RestoreValue(state, "number-third", _thirdNumberBox); + RestoreValue(state, "number-fourth", _fourthNumberBox); + RestoreValue(state, "date-start", _startDatePicker); + RestoreValue(state, "date-end", _endDatePicker); + RestoreValue(state, "auxiliary", _auxBox); + RestoreValue(state, "query", _queryBox); + RestoreValue(state, "input", _inputBox); + + foreach (var rule in _ruleInputControls) + { + if (!state.Values.TryGetValue($"rule:{rule.Key}", out var value)) + { + continue; + } + + _selectedRuleValues[rule.Key] = value; + _viewModel.SelectedRule = value; + ApplyRuleControlValue(rule.Value, value); + } + + foreach (var entry in _definitionStateControls) + { + if (state.Values.TryGetValue($"definition:{entry.Key}", out var value)) + { + ApplyControlValue(entry.Value, value); + } + } + + foreach (var entry in _definitionExpanders) + { + if (state.ExpandedSections.TryGetValue(entry.Key, out var expanded)) + { + entry.Value.IsExpanded = expanded; + } + } + } + + private static void CaptureVisibleValue(ToolUiPageState state, string key, FrameworkElement control) + { + if (control.Visibility == Visibility.Visible && TryReadControlValue(control, out var value)) + { + state.Values[key] = value; + } + } + + private static bool TryReadControlValue(FrameworkElement control, out string value) + { + switch (control) + { + case TextBox textBox: + value = textBox.Text; + return true; + case AutoSuggestBox suggestBox: + value = suggestBox.Text; + return true; + case NumberBox numberBox when !double.IsNaN(numberBox.Value): + value = numberBox.Value.ToString("R", CultureInfo.InvariantCulture); + return true; + case ComboBox comboBox when comboBox.SelectedItem is ComboBoxItem item: + value = item.Tag as string ?? item.Content?.ToString() ?? string.Empty; + return true; + case RadioButtons radioButtons when radioButtons.SelectedItem is ComboBoxItem item: + value = item.Tag as string ?? item.Content?.ToString() ?? string.Empty; + return true; + case ToggleSwitch toggleSwitch: + value = toggleSwitch.IsOn ? "true" : "false"; + return true; + case CalendarDatePicker datePicker when datePicker.Date is DateTimeOffset date: + value = date.ToString("O", CultureInfo.InvariantCulture); + return true; + default: + value = string.Empty; + return false; + } + } + + private static void RestoreValue(ToolUiPageState state, string key, FrameworkElement control) + { + if (state.Values.TryGetValue(key, out var value)) + { + ApplyControlValue(control, value); + } + } + + private static void ApplyControlValue(FrameworkElement control, string value) + { + switch (control) + { + case TextBox textBox: + textBox.Text = value; + break; + case AutoSuggestBox suggestBox: + suggestBox.Text = value; + break; + case NumberBox numberBox when double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var number): + numberBox.Value = Math.Clamp(number, numberBox.Minimum, numberBox.Maximum); + break; + case ComboBox comboBox: + SelectTaggedItem(comboBox.Items, value, index => comboBox.SelectedIndex = index); + break; + case RadioButtons radioButtons: + SelectTaggedItem(radioButtons.Items, value, index => radioButtons.SelectedIndex = index); + break; + case ToggleSwitch toggleSwitch when bool.TryParse(value, out var enabled): + toggleSwitch.IsOn = enabled; + break; + case CalendarDatePicker datePicker when DateTimeOffset.TryParse( + value, + CultureInfo.InvariantCulture, + DateTimeStyles.RoundtripKind, + out var date): + datePicker.Date = date; + break; + } + } + + private static void SelectTaggedItem(IList items, string value, Action select) + { + for (var index = 0; index < items.Count; index++) + { + if (items[index] is ComboBoxItem item + && (string.Equals(item.Tag as string, value, StringComparison.OrdinalIgnoreCase) + || string.Equals(item.Content?.ToString(), value, StringComparison.OrdinalIgnoreCase))) + { + select(index); + return; + } + } + } + + private static void ApplyRuleControlValue(FrameworkElement control, string value) + { + ApplyControlValue(control, value); + if (control is not StackPanel panel) + { + return; + } + + foreach (var button in panel.Children + .OfType() + .SelectMany(row => row.Children.OfType + + +
+ +
+ +
+ +
+
识别结果
+
+
+ + ← 返回首页 + + + + + diff --git a/third_party/MoeKoeMusic/api/public/fingerprint.js b/third_party/MoeKoeMusic/api/public/fingerprint.js new file mode 100644 index 0000000..c1aaae6 --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/fingerprint.js @@ -0,0 +1,365 @@ +/** + * 浏览器端行为指纹生成工具 + * + * 从 login_captcha_simulate.html 提取的独立模块,提供: + * - generateWebGLHash(): 生成 WebGL 指纹哈希值 + * - generateEDTData(opts): 生成用户行为指纹数据(用于 sid/edt 加密的 data 字段) + * + * 适用于 login_captcha.html 和 login_captcha_simulate.html 共用 + */ + +(function (root) { + 'use strict'; + + /** + * 生成 [min, max] 范围内的随机整数(包含两端) + * @param {number} min - 最小值 + * @param {number} max - 最大值 + * @returns {number} 随机整数 + */ + function ri(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + // ============================================================ + // 事件记录格式化函数 + // ============================================================ + + /** + * 格式化 type-3 事件(鼠标/触摸移动) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 子索引(0 或 1) + * @param {number} x - 鼠标 X 坐标 + * @param {number} y - 鼠标 Y 坐标 + * @returns {string} 格式: "3,时间差,子索引,X,Y" + */ + function f3(t, i, x, y) { + return '3,' + t + ',' + i + ',' + x + ',' + y; + } + + /** + * 格式化 type-5 事件(滚动/计时) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 事件索引 + * @returns {string} 格式: "5,时间差,事件索引" + */ + function f5(t, i) { + return '5,' + t + ',' + i; + } + + /** + * 格式化 type-6 事件(窗口事件) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 事件索引 + * @param {number} x - 窗口宽度 + * @param {number} y - 窗口高度 + * @returns {string} 格式: "6,时间差,事件索引,宽,高" + */ + function f6(t, i, x, y) { + return '6,' + t + ',' + i + ',' + x + ',' + y; + } + + /** + * 格式化 type-3 哨兵记录(鼠标事件结束标记) + * @param {number} sentinel - 哨兵值 + * @param {number} i - 子索引 + * @param {number} x - X 坐标 + * @param {number} y - Y 坐标 + * @returns {string} 格式: "3,SENTINEL,子索引,X,Y" + */ + function fs3(sentinel, i, x, y) { + return '3,' + sentinel + ',' + i + ',' + x + ',' + y; + } + + /** + * 格式化 type-5 哨兵记录(滚动事件结束标记) + * @param {number} sentinel - 哨兵值 + * @param {number} i - 事件索引 + * @returns {string} 格式: "5,SENTINEL,事件索引" + */ + function fs5(sentinel, i) { + return '5,' + sentinel + ',' + i; + } + + /** + * 格式化 type-6 哨兵记录(窗口事件结束标记) + * @param {number} sentinel - 哨兵值 + * @param {number} i - 事件索引 + * @param {number} x - 窗口宽度 + * @param {number} y - 窗口高度 + * @returns {string} 格式: "6,SENTINEL,事件索引,宽,高" + */ + function fs6(sentinel, i, x, y) { + return '6,' + sentinel + ',' + i + ',' + x + ',' + y; + } + + // ============================================================ + // 贝塞尔曲线鼠标路径生成 + // ============================================================ + + /** + * 用三阶贝塞尔曲线生成模拟真人的鼠标移动路径 + * + * 真人鼠标轨迹特点: + * - 不是直线,有弧度和加速减速 + * - 有微小抖动(手抖) + * - 起步慢、中间快、结束减速 + * + * @param {number} sx - 起点 X + * @param {number} sy - 起点 Y + * @param {number} ex - 终点 X + * @param {number} ey - 终点 Y + * @param {number} n - 采样点数 + * @returns {Array<{x:number, y:number}>} 路径点数组 + */ + function bezierPath(sx, sy, ex, ey, n) { + const c1x = sx + (ex - sx) * 0.3 + ri(-80, 80); + const c1y = sy + (ey - sy) * 0.2 + ri(-60, 60); + const c2x = sx + (ex - sx) * 0.7 + ri(-60, 60); + const c2y = sy + (ey - sy) * 0.8 + ri(-40, 40); + + const pts = []; + for (let i = 0; i <= n; i++) { + const t = i / n; + const u = 1 - t; + + const x = u * u * u * sx + 3 * u * u * t * c1x + 3 * u * t * t * c2x + t * t * t * ex; + const y = u * u * u * sy + 3 * u * u * t * c1y + 3 * u * t * t * c2y + t * t * t * ey; + + const jitter = Math.max(0.5, 3 - t * 2.5); + pts.push({ + x: x + (Math.random() - 0.5) * jitter, + y: y + (Math.random() - 0.5) * jitter, + }); + } + return pts; + } + + // ============================================================ + // 二进制/hex/Base64 转换工具 + // ============================================================ + + /** + * hex 字符串转 ArrayBuffer + * @param {string} hex - hex 字符串(如 "6b75676f") + * @returns {ArrayBuffer} 对应的二进制缓冲区 + */ + function hex2buf(hex) { + const arr = new Uint8Array(hex.length / 2); + for (let i = 0; i < arr.length; i++) arr[i] = parseInt(hex.substr(i * 2, 2), 16); + return arr.buffer; + } + + /** + * ArrayBuffer 转 hex 字符串 + * @param {ArrayBuffer} buf - 二进制缓冲区 + * @returns {string} hex 字符串(每个字节两位,小写) + */ + function buf2hex(buf) { + return Array.from(new Uint8Array(buf)) + .map((b) => b.toString(16).padStart(2, '0')) + .join(''); + } + + /** + * hex 字符串转 Base64 字符串 + * @param {string} hex - hex 字符串 + * @returns {string} Base64 编码的字符串 + */ + function hexToBase64(hex) { + const bytes = new Uint8Array(hex.length / 2); + for (let i = 0; i < bytes.length; i++) bytes[i] = parseInt(hex.substr(i * 2, 2), 16); + let binary = ''; + for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]); + return btoa(binary); + } + + // ============================================================ + // 加密常量 + // ============================================================ + + /** + * RSA 公钥(SPKI DER 格式的 hex 字符串) + * 从 WASM 二进制中提取,用于 RSA-OAEP SHA-256 加密 AES 密钥 + * 算法: RSA-2048,公钥指数 65537 (0x10001) + */ + const RSA_SPKI_HEX = + '30820122300d06092a864886f70d01010105000382010f003082010a0282010100a16dbe625a3c00b78f4904cfd31045945984387bc10fdb52facec30657ca12edd1cf3bd94da5f526d61b5f8f80554aa3e80473f0833e08a072a8616f6c737f5bae17c4d23eabbcf7e9a8c22f75532765b91bd302262b5cea819b8ab7b83507e1684ab49c2fa1c41590bc26c815f940d88b6b2d46d253bcf56c703f6be8e5426e0e5af63e20a9d3af23894cfb93d7234e5636c9f3004b2b2d83810afda4fa963e6110b46a51e4833d57c29aa3a3da49d29839619b5f78b6f91cc82a1bd9531c6d2707556ea3e50cf956f61e3fc4805ce7a2e0bebe1a225f2716dc1b8f85095544c5b86aecd2d63d1ffb57bd9db675408ab86c56fe05bb645fa05f3eaf1ed61aad0203010001'; + + /** + * AES 初始化向量(固定值) + * ASCII 解码为 "kugousecurity123" + * WASM 中硬编码,每次加密都使用相同的 IV + */ + const AES_IV_HEX = '6b75676f757365637572697479313233'; + + // ============================================================ + // 加密流程 + // ============================================================ + + /** + * 完整的 sid 加密流程(纯 JS 实现,不依赖 WASM) + * + * 加密方案: + * 1. 生成随机 AES-128 密钥 + * 2. 用 AES-128-CBC 加密行为指纹明文 → 得到 EDT + * 3. 用 RSA-OAEP SHA-256 加密 AES 密钥 → 得到 SID + * 4. 服务端用 RSA 私钥解密 SID 得到 AES 密钥,再用 AES 密钥解密 EDT 得到行为数据 + * + * @param {string} plaintext - 待加密的明文(行为指纹数据) + * @returns {Promise} 包含明文、密钥、密文等所有中间数据 + */ + async function encryptSid(plaintext) { + const aesKeyRaw = crypto.getRandomValues(new Uint8Array(16)); + const aesKeyHex = buf2hex(aesKeyRaw); + + const aesKey = await crypto.subtle.importKey('raw', aesKeyRaw, { name: 'AES-CBC' }, false, ['encrypt']); + + const ptBuf = new TextEncoder().encode(plaintext); + const iv = new Uint8Array(hex2buf(AES_IV_HEX)); + const aesCt = await crypto.subtle.encrypt({ name: 'AES-CBC', iv: iv }, aesKey, ptBuf); + + const rsaKey = await crypto.subtle.importKey('spki', hex2buf(RSA_SPKI_HEX), { name: 'RSA-OAEP', hash: 'SHA-256' }, false, ['encrypt']); + + const rsaCt = await crypto.subtle.encrypt({ name: 'RSA-OAEP' }, rsaKey, aesKeyRaw); + + return { + plaintext, + aesKeyHex, + aesIvHex: AES_IV_HEX, + aesCiphertextHex: buf2hex(aesCt), + rsaCiphertextHex: buf2hex(rsaCt), + }; + } + + // ============================================================ + // WebGL 指纹生成 + // ============================================================ + + /** + * 生成 WebGL 指纹哈希值 + * + * WebGL 指纹是浏览器指纹的重要组成部分,通过获取显卡厂商、渲染器名称、 + * WebGL 版本和支持的扩展列表,生成一个唯一的哈希值。 + * + * 浏览器环境:通过 canvas 真实渲染获取 WebGL 信息 + * Node 环境或 WebGL 不可用时:生成随机 uint64 模拟值 + * + * @returns {string} WebGL 指纹的十进制字符串表示 + */ + function generateWebGLHash() { + if (typeof document !== 'undefined') { + try { + const canvas = document.createElement('canvas'); + canvas.width = 200; + canvas.height = 50; + const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + if (gl) { + const dbg = gl.getExtension('WEBGL_debug_renderer_info'); + const vendor = dbg ? gl.getParameter(dbg.UNMASKED_VENDOR_WEBGL) : ''; + const renderer = dbg ? gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) : ''; + const version = gl.getParameter(gl.VERSION); + const exts = gl.getSupportedExtensions().join(','); + const s = vendor + '|' + renderer + '|' + version + '|' + exts; + let hash = BigInt('14695981039346656037'); + const prime = BigInt('1099511628211'); + for (let i = 0; i < s.length; i++) { + hash = hash ^ BigInt(s.charCodeAt(i)); + hash = (hash * prime) & BigInt('0xFFFFFFFFFFFFFFFF'); + } + return hash.toString(); + } + } catch (e) {} + } + const hi = Math.floor(Math.random() * 0xffffffff); + const lo = Math.floor(Math.random() * 0xffffffff); + return (BigInt(hi) * BigInt(0x100000000) + BigInt(lo)).toString(); + } + + // ============================================================ + // 行为数据生成 + // ============================================================ + + /** + * 生成 sid 中的 data 字段(用户行为指纹数据) + * + * 模拟真实用户在页面上的交互行为,包括: + * - 窗口加载/resize 事件 + * - 页面滚动事件 + * - 鼠标移动轨迹 + * + * 数据格式: type,value,index[,x,y] 各条目用 : 分隔 + * 事件类型: + * 3 = 鼠标/触摸移动事件(带 x,y 坐标) + * 5 = 滚动/计时器事件 + * 6 = 窗口事件(如 resize) + * + * @param {Object} opts - 配置项 + * @param {number} opts.startX - 鼠标起点 X 坐标 + * @param {number} opts.startY - 鼠标起点 Y 坐标 + * @param {number} opts.endX - 鼠标终点 X 坐标 + * @param {number} opts.endY - 鼠标终点 Y 坐标 + * @param {number} opts.mousePoints - 鼠标轨迹采样点数 + * @returns {string} 编码后的 data 字段字符串 + */ + function generateEDTData(opts) { + const { startX, startY, endX, endY, mousePoints } = opts; + const sentinel = 0xffffffff - Math.floor(Math.random() * 20); + const entries = []; + let ts = 0; + let ei = 0; + + entries.push(f5(0, 0)); + entries.push(fs5(sentinel, 0)); + entries.push(f5(0, 0)); + entries.push(fs5(sentinel, 0)); + + ts += ri(5, 20); + entries.push(f6(ts, ei, 750, 500)); + entries.push(fs6(sentinel, ei, 750, 500)); + ei++; + + for (let i = 0; i < 3; i++) { + ts += ri(80, 600); + entries.push(f5(ts, ei)); + entries.push(fs5(sentinel, ei)); + ei++; + } + + const path = bezierPath(startX, startY, endX, endY, mousePoints); + let si = 0; + for (let j = 0; j < path.length; j++) { + const p = path[j]; + ts += ri(8, 50); + entries.push(f3(ts, si, Math.round(p.x), Math.round(p.y))); + entries.push(fs3(sentinel, si, Math.round(p.x), Math.round(p.y))); + + if (j > 0 && j % 12 === 0) { + ts += ri(20, 60); + entries.push(f5(ts, ei)); + entries.push(fs5(sentinel, ei)); + ei++; + } + si = (si + 1) % 2; + } + + ts += ri(5, 30); + entries.push(f3(ts, 1, Math.round(endX + ri(-5, 5)), Math.round(endY + ri(-5, 5)))); + entries.push(fs3(sentinel, 1, Math.round(endX), Math.round(endY))); + + return entries.join(':'); + } + + // ============================================================ + // 导出 + // ============================================================ + + const fingerprint = { generateWebGLHash, generateEDTData, encryptSid, hex2buf, buf2hex, hexToBase64, ri }; + + // 支持多种模块系统 + if (typeof module !== 'undefined' && module.exports) { + module.exports = fingerprint; + } else { + root.fingerprint = fingerprint; + } +})(typeof window !== 'undefined' ? window : globalThis); diff --git a/third_party/MoeKoeMusic/api/public/index.html b/third_party/MoeKoeMusic/api/public/index.html new file mode 100644 index 0000000..0942869 --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/index.html @@ -0,0 +1,171 @@ + + + + + + + 酷狗音乐 API + + + + +
+ +

酷狗音乐 API

+

当你看到这个页面时,这个服务已经成功跑起来了~

+ 查看文档 +

例子

+ +
+ + diff --git a/third_party/MoeKoeMusic/api/public/login_captcha.html b/third_party/MoeKoeMusic/api/public/login_captcha.html new file mode 100644 index 0000000..6f801f9 --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/login_captcha.html @@ -0,0 +1,420 @@ + + + + + + + 登录 + + + + + + + + + + + diff --git a/third_party/MoeKoeMusic/api/public/login_captcha_simulate.html b/third_party/MoeKoeMusic/api/public/login_captcha_simulate.html new file mode 100644 index 0000000..f56d13b --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/login_captcha_simulate.html @@ -0,0 +1,459 @@ + + + + + + + 登录 + + + + + + + + + + diff --git a/third_party/MoeKoeMusic/api/public/sid_edt_generator.html b/third_party/MoeKoeMusic/api/public/sid_edt_generator.html new file mode 100644 index 0000000..b29686d --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/sid_edt_generator.html @@ -0,0 +1,394 @@ + + + + + SID / EDT 生成器 + + + + + + + + + + + + +
+

SID / EDT 生成器

+ + + + + + +
+
+ +
+
+
+ +
+
+
+ + +
+

Crypto API 拦截日志

+
+
+
+ + + + diff --git a/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode.js b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode.js new file mode 100644 index 0000000..3f7d32d --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode.js @@ -0,0 +1,1002 @@ +"use strict"; + +function _classCallCheck(instance, Constructor) { + if (!_instanceof(instance, Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _instanceof(left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return !!right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } +} + +function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof(obj); +} + +var wasm_bindgen; + +(function () { + var __exports = {}; + var wasm; + var heap = new Array(32).fill(undefined); + heap.push(undefined, null, true, false); + + function getObject(idx) { + return heap[idx]; + } + + var heap_next = heap.length; + + function dropObject(idx) { + if (idx < 36) return; + heap[idx] = heap_next; + heap_next = idx; + } + + function takeObject(idx) { + var ret = getObject(idx); + dropObject(idx); + return ret; + } + + var cachedTextDecoder = new TextDecoder("utf-8", { + ignoreBOM: true, + fatal: true, + }); + cachedTextDecoder.decode(); + var cachegetUint8Memory0 = null; + + function getUint8Memory0() { + if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { + cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + + return cachegetUint8Memory0; + } + + function getStringFromWasm0(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); + } + + function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + var idx = heap_next; + heap_next = heap[idx]; + heap[idx] = obj; + return idx; + } + + var WASM_VECTOR_LEN = 0; + var cachedTextEncoder = new TextEncoder("utf-8"); + var encodeString = + typeof cachedTextEncoder.encodeInto === "function" + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); + } + : function (arg, view) { + var buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length, + }; + }; + + function passStringToWasm0(arg, malloc, realloc) { + if (realloc === undefined) { + var buf = cachedTextEncoder.encode(arg); + + var _ptr = malloc(buf.length); + + getUint8Memory0() + .subarray(_ptr, _ptr + buf.length) + .set(buf); + WASM_VECTOR_LEN = buf.length; + return _ptr; + } + + var len = arg.length; + var ptr = malloc(len); + var mem = getUint8Memory0(); + var offset = 0; + + for (; offset < len; offset++) { + var code = arg.charCodeAt(offset); + if (code > 0x7f) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + + ptr = realloc(ptr, len, (len = offset + arg.length * 3)); + var view = getUint8Memory0().subarray(ptr + offset, ptr + len); + var ret = encodeString(arg, view); + offset += ret.written; + } + + WASM_VECTOR_LEN = offset; + return ptr; + } + + function isLikeNone(x) { + return x === undefined || x === null; + } + + var cachegetInt32Memory0 = null; + + function getInt32Memory0() { + if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { + cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + + return cachegetInt32Memory0; + } + + function debugString(val) { + // primitive types + var type = _typeof(val); + + if (type == "number" || type == "boolean" || val == null) { + return "".concat(val); + } + + if (type == "string") { + return '"'.concat(val, '"'); + } + + if (type == "symbol") { + var description = val.description; + + if (description == null) { + return "Symbol"; + } else { + return "Symbol(".concat(description, ")"); + } + } + + if (type == "function") { + var name = val.name; + + if (typeof name == "string" && name.length > 0) { + return "Function(".concat(name, ")"); + } else { + return "Function"; + } + } // objects + + if (Array.isArray(val)) { + var length = val.length; + var debug = "["; + + if (length > 0) { + debug += debugString(val[0]); + } + + for (var i = 1; i < length; i++) { + debug += ", " + debugString(val[i]); + } + + debug += "]"; + return debug; + } // Test for built-in + + var builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + var className; + + if (builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + + if (className == "Object") { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return "Object(" + JSON.stringify(val) + ")"; + } catch (_) { + return "Object"; + } + } // errors + + if (_instanceof(val, Error)) { + return "".concat(val.name, ": ").concat(val.message, "\n").concat(val.stack); + } // TODO we could test for more things here, like `Set`s and `Map`s. + + return className; + } + + function makeMutClosure(arg0, arg1, dtor, f) { + var state = { + a: arg0, + b: arg1, + cnt: 1, + }; + + var real = function real() { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + var a = state.a; + state.a = 0; + + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return f.apply(void 0, [a, state.b].concat(args)); + } finally { + if (--state.cnt === 0) wasm.__wbindgen_export_2.get(dtor)(a, state.b); + else state.a = a; + } + }; + + real.original = state; + return real; + } + + function __wbg_adapter_26(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he25972c9b3fefae8( + arg0, + arg1, + ); + } + + function __wbg_adapter_29(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7b132ceac93324a9( + arg0, + arg1, + addHeapObject(arg2), + ); + } + + function __wbg_adapter_32(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d18d2f5d81b3bb0( + arg0, + arg1, + addHeapObject(arg2), + ); + } + /** + */ + + __exports.run = function () { + wasm.run(); + }; + + function handleError(f) { + return function () { + try { + return f.apply(this, arguments); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } + }; + } + + function getArrayU8FromWasm0(ptr, len) { + return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); + } + + var cachegetFloat64Memory0 = null; + + function getFloat64Memory0() { + if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) { + cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer); + } + + return cachegetFloat64Memory0; + } + + function __wbg_adapter_165(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures__invoke2_mut__h695c06ab86e08564( + arg0, + arg1, + addHeapObject(arg2), + addHeapObject(arg3), + ); + } + /** + */ + + var EData = /*#__PURE__*/ (function () { + _createClass( + EData, + [ + { + key: "free", + value: function free() { + var ptr = this.ptr; + this.ptr = 0; + + wasm.__wbg_edata_free(ptr); + }, + /** + */ + }, + ], + [ + { + key: "__wrap", + value: function __wrap(ptr) { + var obj = Object.create(EData.prototype); + obj.ptr = ptr; + return obj; + }, + }, + ], + ); + + function EData() { + _classCallCheck(this, EData); + + var ret = wasm.edata_new(); + return EData.__wrap(ret); + } + /** + * @returns {string} + */ + + _createClass(EData, [ + { + key: "get_edt", + value: function get_edt() { + try { + wasm.edata_get_edt(8, this.ptr); + var r0 = getInt32Memory0()[8 / 4 + 0]; + var r1 = getInt32Memory0()[8 / 4 + 1]; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_free(r0, r1); + } + }, + /** + * @returns {string} + */ + }, + { + key: "get_sid", + value: function get_sid() { + try { + wasm.edata_get_sid(8, this.ptr); + var r0 = getInt32Memory0()[8 / 4 + 0]; + var r1 = getInt32Memory0()[8 / 4 + 1]; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_free(r0, r1); + } + }, + }, + ]); + + return EData; + })(); + + __exports.EData = EData; + + async function load(module, imports) { + if (typeof Response === "function" && _instanceof(module, Response)) { + if (typeof WebAssembly.instantiateStreaming === "function") { + try { + return await WebAssembly.instantiateStreaming(module, imports); + } catch (e) { + if (module.headers.get("Content-Type") != "application/wasm") { + console.warn( + "`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", + e, + ); + } else { + throw e; + } + } + } + + var bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + } else { + var instance = await WebAssembly.instantiate(module, imports); + + if (_instanceof(instance, WebAssembly.Instance)) { + return { + instance: instance, + module: module, + }; + } else { + return instance; + } + } + } + + async function init(input) { + if (typeof input === "undefined") { + var src; + + if (typeof document === "undefined") { + src = location.href; + } else { + src = document.currentScript.src; + } + + input = src.replace(/\.js$/, "_bg.wasm"); + } + + var imports = {}; + imports.wbg = {}; + + imports.wbg.__wbg_setTimeout_b3d3e28b860025e3 = function (arg0, arg1) { + setTimeout(takeObject(arg0), arg1 >>> 0); + }; + + imports.wbg.__wbindgen_object_drop_ref = function (arg0) { + takeObject(arg0); + }; + + imports.wbg.__wbindgen_cb_drop = function (arg0) { + var obj = takeObject(arg0).original; + + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + + var ret = false; + return ret; + }; + + imports.wbg.__wbindgen_string_new = function (arg0, arg1) { + var ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + + imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) { + var ret = getObject(arg0) === getObject(arg1); + return ret; + }; + + imports.wbg.__wbindgen_object_clone_ref = function (arg0) { + var ret = getObject(arg0); + return addHeapObject(ret); + }; + + imports.wbg.__wbindgen_cb_forget = function (arg0) { + takeObject(arg0); + }; + + imports.wbg.__wbg_instanceof_Window_d64060d13377409b = function (arg0) { + var ret = _instanceof(getObject(arg0), Window); + + return ret; + }; + + imports.wbg.__wbg_document_bcf9d67bc56e8c6d = function (arg0) { + var ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_navigator_a1711d7939511fb0 = function (arg0) { + var ret = getObject(arg0).navigator; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_crypto_e775ee2e074e46de = handleError(function (arg0) { + var ret = getObject(arg0).crypto; + return addHeapObject(ret); + }); + imports.wbg.__wbg_requestAnimationFrame_96f88ce2d311332e = handleError(function (arg0, arg1) { + var ret = getObject(arg0).requestAnimationFrame(getObject(arg1)); + return ret; + }); + imports.wbg.__wbg_createElement_467bb064d2ae5833 = handleError(function (arg0, arg1, arg2) { + var ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }); + + imports.wbg.__wbg_clientX_48aae9fc88d6ea69 = function (arg0) { + var ret = getObject(arg0).clientX; + return ret; + }; + + imports.wbg.__wbg_clientY_b23802d9e0dd2c51 = function (arg0) { + var ret = getObject(arg0).clientY; + return ret; + }; + + imports.wbg.__wbg_buttons_d9a487d62a2bcfad = function (arg0) { + var ret = getObject(arg0).buttons; + return ret; + }; + + imports.wbg.__wbg_encrypt_3eac7f61933c3be9 = handleError(function (arg0, arg1, arg2, arg3) { + var ret = getObject(arg0).encrypt(getObject(arg1), getObject(arg2), getObject(arg3)); + return addHeapObject(ret); + }); + imports.wbg.__wbg_importKey_370896d933eba99c = handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + var ret = getObject(arg0).importKey( + getStringFromWasm0(arg1, arg2), + getObject(arg3), + getObject(arg4), + arg5 !== 0, + getObject(arg6), + ); + return addHeapObject(ret); + }); + + imports.wbg.__wbg_deltaX_91eab99c5941b593 = function (arg0) { + var ret = getObject(arg0).deltaX; + return ret; + }; + + imports.wbg.__wbg_deltaY_ba4bc93322183cab = function (arg0) { + var ret = getObject(arg0).deltaY; + return ret; + }; + + imports.wbg.__wbg_subtle_a33b474f137433b4 = function (arg0) { + var ret = getObject(arg0).subtle; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_getRandomValues_bd83b9bca41f01e4 = handleError(function (arg0, arg1, arg2) { + var ret = getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2)); + return addHeapObject(ret); + }); + + imports.wbg.__wbg_clientX_bc61648c02723dc7 = function (arg0) { + var ret = getObject(arg0).clientX; + return ret; + }; + + imports.wbg.__wbg_clientY_67b12bba9c15ace2 = function (arg0) { + var ret = getObject(arg0).clientY; + return ret; + }; + + imports.wbg.__wbg_length_4c6909494a0e02f9 = function (arg0) { + var ret = getObject(arg0).length; + return ret; + }; + + imports.wbg.__wbg_item_bb8a8818d4856ef0 = function (arg0, arg1) { + var ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_setAttribute_02daabbc925a51e3 = handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }); + + imports.wbg.__wbg_instanceof_WebGlRenderingContext_dca65729c7187d57 = function (arg0) { + var ret = _instanceof(getObject(arg0), WebGLRenderingContext); + + return ret; + }; + + imports.wbg.__wbg_bufferData_e135b678b6ef2433 = function (arg0, arg1, arg2, arg3) { + getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0); + }; + + imports.wbg.__wbg_attachShader_9958cc9636fc8494 = function (arg0, arg1, arg2) { + getObject(arg0).attachShader(getObject(arg1), getObject(arg2)); + }; + + imports.wbg.__wbg_bindBuffer_c96c99b259d952f4 = function (arg0, arg1, arg2) { + getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2)); + }; + + imports.wbg.__wbg_clear_ec5c1c21ed3b2fe2 = function (arg0, arg1) { + getObject(arg0).clear(arg1 >>> 0); + }; + + imports.wbg.__wbg_clearColor_b9e0f7e215dc534e = function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).clearColor(arg1, arg2, arg3, arg4); + }; + + imports.wbg.__wbg_compileShader_82966bc7f1d070fe = function (arg0, arg1) { + getObject(arg0).compileShader(getObject(arg1)); + }; + + imports.wbg.__wbg_createBuffer_501da6aef1c4b91c = function (arg0) { + var ret = getObject(arg0).createBuffer(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_createProgram_531dab3c15c28e4f = function (arg0) { + var ret = getObject(arg0).createProgram(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_createShader_376b269548a48c7a = function (arg0, arg1) { + var ret = getObject(arg0).createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_drawArrays_1c6a2bff627558ed = function (arg0, arg1, arg2, arg3) { + getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3); + }; + + imports.wbg.__wbg_enableVertexAttribArray_0f8b0b1592940e3f = function (arg0, arg1) { + getObject(arg0).enableVertexAttribArray(arg1 >>> 0); + }; + + imports.wbg.__wbg_getProgramInfoLog_5def5bb3d8d30e1f = function (arg0, arg1, arg2) { + var ret = getObject(arg1).getProgramInfoLog(getObject(arg2)); + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + + imports.wbg.__wbg_getProgramParameter_c021157c5817259f = function (arg0, arg1, arg2) { + var ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_getShaderInfoLog_b619769ff40aac70 = function (arg0, arg1, arg2) { + var ret = getObject(arg1).getShaderInfoLog(getObject(arg2)); + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + + imports.wbg.__wbg_getShaderParameter_d03718a8c98a4d23 = function (arg0, arg1, arg2) { + var ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_linkProgram_9e60adcb42d34c3c = function (arg0, arg1) { + getObject(arg0).linkProgram(getObject(arg1)); + }; + + imports.wbg.__wbg_shaderSource_c208cc7a688e8923 = function (arg0, arg1, arg2, arg3) { + getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3)); + }; + + imports.wbg.__wbg_useProgram_c4a6df84383cd1a6 = function (arg0, arg1) { + getObject(arg0).useProgram(getObject(arg1)); + }; + + imports.wbg.__wbg_vertexAttribPointer_5660aa1f2b819de1 = function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + + imports.wbg.__wbg_addEventListener_fe52a115589ccc2c = handleError(function (arg0, arg1, arg2, arg3) { + getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); + }); + + imports.wbg.__wbg_instanceof_HtmlCanvasElement_308a7fa689ff20ef = function (arg0) { + var ret = _instanceof(getObject(arg0), HTMLCanvasElement); + + return ret; + }; + + imports.wbg.__wbg_getContext_554fc171434d411b = handleError(function (arg0, arg1, arg2) { + var ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }); + imports.wbg.__wbg_toDataURL_ca175b3d0bb6f5d9 = handleError(function (arg0, arg1) { + var ret = getObject(arg1).toDataURL(); + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }); + imports.wbg.__wbg_cookie_eb31c284e2ed620b = handleError(function (arg0, arg1) { + var ret = getObject(arg1).cookie; + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }); + + imports.wbg.__wbg_keyCode_e19b105e5d2d09d5 = function (arg0) { + var ret = getObject(arg0).keyCode; + return ret; + }; + + imports.wbg.__wbg_shiftKey_0924a6b92b68d3f6 = function (arg0) { + var ret = getObject(arg0).shiftKey; + return ret; + }; + + imports.wbg.__wbg_alpha_71e14e01b1c605a6 = function (arg0, arg1) { + var ret = getObject(arg1).alpha; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); + }; + + imports.wbg.__wbg_beta_f48a7d1a10feff4e = function (arg0, arg1) { + var ret = getObject(arg1).beta; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); + }; + + imports.wbg.__wbg_gamma_eb5fbdd72123221e = function (arg0, arg1) { + var ret = getObject(arg1).gamma; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); + }; + + imports.wbg.__wbg_touches_ea1e29cf107bf92b = function (arg0) { + var ret = getObject(arg0).touches; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_next_7a1e3e5ba77a5417 = handleError(function (arg0) { + var ret = getObject(arg0).next(); + return addHeapObject(ret); + }); + + imports.wbg.__wbg_done_179f9d81f2c93943 = function (arg0) { + var ret = getObject(arg0).done; + return ret; + }; + + imports.wbg.__wbg_value_dd36c45a14714446 = function (arg0) { + var ret = getObject(arg0).value; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_get_fa38f22e54fe1ab1 = handleError(function (arg0, arg1) { + var ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }); + imports.wbg.__wbg_call_20c04382b27a4486 = handleError(function (arg0, arg1) { + var ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); + }); + + imports.wbg.__wbg_new_a938277eeb06668d = function () { + var ret = new Array(); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_push_2bfc5fcfa4d4389d = function (arg0, arg1) { + var ret = getObject(arg0).push(getObject(arg1)); + return ret; + }; + + imports.wbg.__wbg_values_04df67902f0aa20f = function (arg0) { + var ret = getObject(arg0).values(); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_newnoargs_bfddd41728ab0b9c = function (arg0, arg1) { + var ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_now_40a39f1fea2317e3 = function () { + var ret = Date.now(); + return ret; + }; + + imports.wbg.__wbg_new_f46e6afe0b8a862e = function () { + var ret = new Object(); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_exec_0847b50db1960a9b = function (arg0, arg1, arg2) { + var ret = getObject(arg0).exec(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + + imports.wbg.__wbg_new_ad3a28429d2566a0 = function (arg0, arg1, arg2, arg3) { + var ret = new RegExp(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_new_261626435fed913c = function (arg0, arg1) { + try { + var state0 = { + a: arg0, + b: arg1, + }; + + var cb0 = function cb0(arg0, arg1) { + var a = state0.a; + state0.a = 0; + + try { + return __wbg_adapter_165(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + + var ret = new Promise(cb0); + return addHeapObject(ret); + } finally { + state0.a = state0.b = 0; + } + }; + + imports.wbg.__wbg_resolve_430b2f40a51592cc = function (arg0) { + var ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_then_a9485ea9ef567f90 = function (arg0, arg1) { + var ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_then_b114127b40814c36 = function (arg0, arg1, arg2) { + var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_self_944d201f31e01c91 = handleError(function () { + var ret = self.self; + return addHeapObject(ret); + }); + imports.wbg.__wbg_window_993fd51731b86960 = handleError(function () { + var ret = window.window; + return addHeapObject(ret); + }); + imports.wbg.__wbg_globalThis_8379563d70fab135 = handleError(function () { + var ret = globalThis.globalThis; + return addHeapObject(ret); + }); + imports.wbg.__wbg_global_073eb4249a3a8c12 = handleError(function () { + var ret = global.global; + return addHeapObject(ret); + }); + + imports.wbg.__wbindgen_is_undefined = function (arg0) { + var ret = getObject(arg0) === undefined; + return ret; + }; + + imports.wbg.__wbg_buffer_985803c87989344b = function (arg0) { + var ret = getObject(arg0).buffer; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_newwithbyteoffsetandlength_36d42f1c91e7259d = function (arg0, arg1, arg2) { + var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_length_32e166b42b85060a = function (arg0) { + var ret = getObject(arg0).length; + return ret; + }; + + imports.wbg.__wbg_new_b7e3d6adc8b9377a = function (arg0) { + var ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_set_66e888cef8f00a73 = function (arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }; + + imports.wbg.__wbg_newwithbyteoffsetandlength_3c83a6445776097f = function (arg0, arg1, arg2) { + var ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }; + + imports.wbg.__wbg_buffer_4f0ba77e90f96e9d = function (arg0) { + var ret = getObject(arg0).buffer; + return addHeapObject(ret); + }; + + imports.wbg.__wbg_ownKeys_8a63b9d67c805cfd = handleError(function (arg0) { + var ret = Reflect.ownKeys(getObject(arg0)); + return addHeapObject(ret); + }); + imports.wbg.__wbg_set_6db0a4cb6e322f85 = handleError(function (arg0, arg1, arg2) { + var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); + return ret; + }); + + imports.wbg.__wbindgen_string_get = function (arg0, arg1) { + var obj = getObject(arg1); + var ret = typeof obj === "string" ? obj : undefined; + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + + imports.wbg.__wbindgen_boolean_get = function (arg0) { + var v = getObject(arg0); + var ret = typeof v === "boolean" ? (v ? 1 : 0) : 2; + return ret; + }; + + imports.wbg.__wbindgen_debug_string = function (arg0, arg1) { + var ret = debugString(getObject(arg1)); + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + + imports.wbg.__wbindgen_throw = function (arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + imports.wbg.__wbindgen_memory = function () { + var ret = wasm.memory; + return addHeapObject(ret); + }; + + imports.wbg.__wbindgen_closure_wrapper191 = function (arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 64, __wbg_adapter_26); + return addHeapObject(ret); + }; + + imports.wbg.__wbindgen_closure_wrapper193 = function (arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 64, __wbg_adapter_32); + return addHeapObject(ret); + }; + + imports.wbg.__wbindgen_closure_wrapper220 = function (arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 73, __wbg_adapter_29); + return addHeapObject(ret); + }; + + if ( + typeof input === "string" || + (typeof Request === "function" && _instanceof(input, Request)) || + (typeof URL === "function" && _instanceof(input, URL)) + ) { + input = fetch(input); + } + + var _await$load = await load(await input, imports), + instance = _await$load.instance, + module = _await$load.module; + + wasm = instance.exports; + init.__wbindgen_wasm_module = module; + + wasm.__wbindgen_start(); + + return wasm; + } + + wasm_bindgen = Object.assign(init, __exports); +})(); diff --git a/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg.wasm b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg.wasm new file mode 100644 index 0000000..c3f08b6 Binary files /dev/null and b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg.wasm differ diff --git a/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg_ios.wasm b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg_ios.wasm new file mode 100644 index 0000000..c3f08b6 Binary files /dev/null and b/third_party/MoeKoeMusic/api/public/verify-pkg/verifycode_bg_ios.wasm differ diff --git a/third_party/MoeKoeMusic/api/public/verifySlide.html b/third_party/MoeKoeMusic/api/public/verifySlide.html new file mode 100644 index 0000000..6b37b42 --- /dev/null +++ b/third_party/MoeKoeMusic/api/public/verifySlide.html @@ -0,0 +1,679 @@ + + + + + + 验证码验证 + + + + + + + + + + diff --git a/third_party/MoeKoeMusic/api/server.js b/third_party/MoeKoeMusic/api/server.js new file mode 100644 index 0000000..060c474 --- /dev/null +++ b/third_party/MoeKoeMusic/api/server.js @@ -0,0 +1,656 @@ +/** + * @fileoverview KuGouMusic API 服务器核心模块 + * + * 基于 Express 框架构建的 HTTP 服务,负责: + * - 动态扫描并加载 `module/` 目录下的所有 API 模块,自动注册路由 + * - 处理 CORS 跨域请求 + * - 解析请求 Cookie 并注入平台标识信息 + * - 提供 2 分钟的响应缓存机制 + * - 统一错误处理与响应返回 + * + * @module server + * @requires node:fs + * @requires node:path + * @requires express + * @requires safe-decode-uri-component + * @requires dotenv + * @requires ./util/util + * @requires ./util/crypto + * @requires ./util/request + * @requires ./util/apicache + */ + +const fs = require('node:fs'); +const path = require('node:path'); +const express = require('express'); +const decode = require('safe-decode-uri-component'); +const { cookieToJson, randomString, getGuid, calculateMid, generateWebGLHash, isUUIDv4 } = require('./util/util'); +const { cryptoMd5 } = require('./util/crypto'); +const { createRequest } = require('./util/request'); +const dotenv = require('dotenv'); +const apiCache = require('./util/apicache'); +apiCache.options({ headerBlacklist: ['set-cookie'] }); +const cache = apiCache.middleware; +const axios = require('axios'); +const crypto = require('node:crypto'); + +const YMHUT_PROTOCOL_VERSION = 1; +const YMHUT_MOEKOE_COMMIT = '4581660209c9cdd07669e8bd5bcbe136b7d91e02'; +const PUBLIC_CACHE_ROUTES = new Set([ + '/search', + '/search/default', + '/search/hot', + '/search/lyric', + '/search/suggest', + '/rank/list', + '/rank/top', + '/top/album', + '/top/playlist', + '/top/song', + '/sheet/detail', + '/sheet/explore', + '/sheet/rank', + '/sheet/song', + '/sheet/tags', + '/album', + '/album/detail', + '/album/songs', + '/artist/albums', + '/artist/audios', + '/artist/detail', + '/artist/lists', + '/artist/videos', + '/audio', + '/images', + '/images/audio', + '/lyric', + '/video/detail', +]); + +function constantTimeTokenEquals(actual, expected) { + const actualBytes = Buffer.from(typeof actual === 'string' ? actual : '', 'utf8'); + const expectedBytes = Buffer.from(typeof expected === 'string' ? expected : '', 'utf8'); + return actualBytes.length === expectedBytes.length && crypto.timingSafeEqual(actualBytes, expectedBytes); +} + +function isAllowedKugouTarget(rawUrl) { + try { + const target = new URL(rawUrl); + const host = target.hostname.toLowerCase(); + return target.protocol === 'https:' && + !target.username && + !target.password && + (!target.port || target.port === '443') && + (host === 'kugou.com' || host.endsWith('.kugou.com')); + } catch { + return false; + } +} + +function filterProxyHeaders(headers) { + const blocked = new Set(['host', 'content-length', 'connection', 'x-ymhut-internal-token']); + const result = {}; + for (const [name, value] of Object.entries(headers || {})) { + const normalized = String(name).toLowerCase(); + if (!blocked.has(normalized) && typeof value === 'string' && value.length <= 8192) { + result[normalized] = value; + } + } + return result; +} + +function isAnonymousPublicRequest(req) { + if (req.headers.authorization || req.query.cookie) return false; + const rawCookie = String(req.headers.cookie || ''); + return !/(?:^|;\s*)(?:token|userid|vip_token|t1|MUSIC_U|MUSIC_A)=/i.test(rawCookie); +} + +function originalRequestPath(req) { + try { + return new URL(req.originalUrl || req.url, 'http://127.0.0.1').pathname; + } catch { + return ''; + } +} + +/** + * @typedef {Object} ModuleDefinition + * @description API 模块的定义结构,由 {@link getModulesDefinitions} 生成 + * @property {string} [identifier] - 模块标识符,取自文件名(去除 .js 后缀) + * @property {string} route - 该模块对应的 Express 路由路径 + * @property {any} module - 模块导出的内容(require 加载时为模块对象,否则为文件路径) + */ + +/** + * @typedef {Object} ExpressExtension + * @description 对 Express 实例的扩展,附加了 HTTP Server 引用 + * @property {import('http').Server} [server] - 底层 HTTP 服务实例 + */ + +/** + * 全局唯一设备标识符(GUID) + * 对随机生成的 GUID 字符串进行 MD5 哈希,作为默认的设备标识 + * @type {string} + * @constant + */ +const guid = cryptoMd5(getGuid()); + +/** + * 随机生成的 10 位大写字符串,用作默认的开发设备标识(DEV ID) + * @type {string} + * @constant + */ +const serverDev = randomString(10).toUpperCase(); + +/** + * .env 环境变量配置文件路径 + * 优先从项目根目录加载,如果文件存在则通过 dotenv 读取其中的环境变量 + * @type {string} + */ +const envPath = path.join(process.cwd(), '.env'); + +if (fs.existsSync(envPath)) { + // 静默加载 .env 文件中的环境变量到 process.env,quiet 抑制加载日志 + dotenv.config({ path: envPath, quiet: true }); +} + +/** + * 动态扫描指定目录,获取所有 API 模块的定义信息 + * + * 扫描流程: + * 1. 读取 `modulesPath` 目录下的所有文件 + * 2. 过滤出以 `.js` 结尾且不以 `_` 开头的文件(`_` 前缀的文件视为内部模块,跳过注册) + * 3. 对文件列表进行倒序排列(与 app.js 中的模块加载顺序保持一致) + * 4. 根据文件名生成路由路径:默认将文件名中的 `_` 替换为 `/`,如有 `specificRoute` 自定义映射则优先使用 + * 5. 如果 `doRequire` 为 true,则通过 require 加载模块;否则仅返回文件路径 + * + * @async + * @param {string} modulesPath - 模块目录的绝对路径(例如 `path.join(__dirname, 'module')`) + * @param {Record} specificRoute - 特定文件名到路由路径的自定义映射表 + * - key 为文件名(如 `"album_new.js"`),value 为自定义路由(如 `"/album/create"`) + * - 未在映射表中的文件将使用默认的路由生成规则 + * @param {boolean} [doRequire=true] - 是否通过 require 加载模块 + * - `true`:直接 require 模块文件,返回模块导出对象 + * - `false`:仅返回模块文件的绝对路径字符串 + * @returns {Promise} 模块定义数组,每个元素包含 identifier、route、module + * + * @example + * // 扫描 module 目录并加载所有模块 + * const defs = await getModulesDefinitions(path.join(__dirname, 'module'), {}); + * + * @example + * // 自定义部分模块的路由 + * const defs = await getModulesDefinitions( + * path.join(__dirname, 'module'), + * { "album_new.js": "/album/create" } + * ); + */ +async function getModulesDefinitions(modulesPath, specificRoute, doRequire = true) { + const files = await fs.promises.readdir(modulesPath); + + /** + * 根据文件名解析出路由路径 + * 优先使用 specificRoute 中的自定义映射,否则按默认规则生成: + * - 去掉 .js 后缀 + * - 将下划线 _ 替换为斜杠 / + * - 加上 / 前缀 + * 例如:`user_detail.js` → `/user/detail` + * @param {string} fileName - 文件名 + * @returns {string} 路由路径 + */ + const parseRoute = (fileName) => + specificRoute && fileName in specificRoute ? specificRoute[fileName] : `/${fileName.replace(/\.(js)$/i, '').replace(/_/g, '/')}`; + + return ( + files + // 倒序排列,确保模块加载顺序与 app.js 中 readdirSync().reverse() 保持一致 + .reverse() + // 仅保留 .js 结尾且不以 _ 开头的文件(跳过内部/私有模块) + .filter((fileName) => fileName.endsWith('.js') && !fileName.startsWith('_')) + .map((fileName) => { + // 模块标识符:取文件名的主体部分(去掉 .js 后缀) + const identifier = fileName.split('.').shift(); + // 生成路由路径 + const route = parseRoute(fileName); + // 模块文件的完整绝对路径 + const modulePath = path.resolve(modulesPath, fileName); + // 根据 doRequire 决定是加载模块还是仅返回路径 + const module = doRequire ? require(modulePath) : modulePath; + return { identifier, route, module }; + }) + ); +} + +/** + * 构建并配置 Express 应用实例 + * + * 该函数完成以下工作: + * 1. 创建 Express 应用 + * 2. 配置 CORS 跨域中间件(处理 OPTIONS 预检请求) + * 3. 配置自定义 Cookie 解析中间件 + * 4. 注入平台标识 Cookie(PLATFORM、MID、GUID、DEV、MAC) + * 5. 配置 JSON / URL-encoded 请求体解析 + * 6. 挂载静态文件服务(public 目录和 docs 目录) + * 7. 配置 2 分钟的 API 响应缓存 + * 8. 遍历所有模块定义,动态注册 Express 路由处理器 + * - 每个路由处理器负责:合并请求参数、调用模块函数、处理 Cookie、返回响应 + * + * @async + * @param {ModuleDefinition[]} [moduleDefs] - 可选的模块定义数组 + * - 如果未提供,则自动调用 {@link getModulesDefinitions} 从 `module/` 目录扫描加载 + * @returns {Promise} 配置完成的 Express 应用实例 + */ +async function consturctServer(moduleDefs) { + const app = express(); + + const internalToken = process.env.YMHUT_INTERNAL_TOKEN; + if (internalToken) { + app.use((req, res, next) => { + if (!constantTimeTokenEquals(req.get('x-ymhut-internal-token'), internalToken)) { + res.status(401).json({ code: 401, message: 'Unauthorized' }); + return; + } + next(); + }); + } + + // 从环境变量读取允许的跨域来源,若未配置则回退到请求头中的 origin 或 '*' + const { CORS_ALLOW_ORIGIN } = process.env; + + // 启用反向代理信任,确保 req.ip 能正确获取客户端真实 IP(如经过 Nginx 反代) + app.set('trust proxy', true); + + /** + * ============================================================ + * CORS 跨域资源共享中间件 + * ============================================================ + * + * 对非根路径且非静态文件的请求设置 CORS 响应头: + * - Access-Control-Allow-Credentials: 允许携带凭证(Cookie) + * - Access-Control-Allow-Origin: 允许的来源域名 + * - Access-Control-Allow-Headers: 允许的请求头 + * - Access-Control-Allow-Methods: 允许的 HTTP 方法 + * - Content-Type: 统一使用 UTF-8 编码的 JSON + * + * 对 OPTIONS 预检请求直接返回 204 No Content + */ + app.use((req, res, next) => { + if (req.path !== '/' && !req.path.includes('.')) { + res.set({ + 'Access-Control-Allow-Credentials': true, + 'Access-Control-Allow-Origin': CORS_ALLOW_ORIGIN || req.headers.origin || '*', + 'Access-Control-Allow-Headers': 'Authorization,X-Requested-With,Content-Type,Cache-Control', + 'Access-Control-Allow-Methods': 'PUT,POST,GET,DELETE,OPTIONS', + 'Content-Type': 'application/json; charset=utf-8', + }); + } + // OPTIONS 预检请求无需继续处理,直接返回 204 + req.method === 'OPTIONS' ? res.status(204).end() : next(); + }); + + /** + * ============================================================ + * Cookie 解析中间件 + * ============================================================ + * + * 手动解析请求头中的 Cookie 字符串,将其转换为键值对对象并挂载到 req.cookies。 + * + * 解析规则: + * - 按 `; ` 或末尾空格分隔多个 cookie 键值对 + * - 每个键值对按第一个 `=` 分割为 key 和 value + * - key 和 value 均通过 safe-decode-uri-component 解码 + * - 跳过无效的键值对(无 `=` 或 `=` 在末尾) + */ + app.use((req, _, next) => { + req.cookies = {}; + (req.headers.cookie || '').split(/;\s+|(? { + const crack = pair.indexOf('='); + // 跳过无效的 cookie:没有 = 号,或 = 号在最后(无 value) + if (crack < 1 || crack === pair.length - 1) { + return; + } + req.cookies[decode(pair.slice(0, crack)).trim()] = decode(pair.slice(crack + 1)).trim(); + }); + next(); + }); + + /** + * ============================================================ + * 平台标识 Cookie 注入中间件 + * ============================================================ + * + * 自动向请求的 Cookie 对象中注入以下平台标识信息(仅在客户端未提供时补充): + * - KUGOU_API_PLATFORM: 平台类型(标准版/概念版 lite),来自环境变量 platform + * - KUGOU_API_MID: 设备 MID,由 GUID 通过 calculateMid 算法生成 + * - KUGOU_API_GUID: 设备全局唯一标识符,优先使用环境变量 KUGOU_API_GUID,否则使用启动时生成的默认值 + * - KUGOU_API_DEV: 开发设备标识符,优先使用环境变量 KUGOU_API_DEV + * - KUGOU_API_MAC: 设备 MAC 地址,默认为 '02:00:00:00:00:00' + * + * 同时通过 Set-Cookie 将这些值写回客户端,方便调试和后续请求自动携带。 + * 根据请求协议(HTTP/HTTPS)决定 Cookie 的安全属性(SameSite=None; Secure)。 + */ + app.use((req, res, next) => { + const cookies = req.cookies || {}; + const isHttps = req.protocol === 'https'; + // HTTPS 下设置 SameSite=None; Secure 以支持跨站 Cookie 传递 + const cookieSuffix = isHttps ? '; PATH=/; SameSite=None; Secure' : '; PATH=/'; + + /** + * 确保指定的 cookie key 存在,如果不存在则自动写入 + * @param {string} key - Cookie 键名 + * @param {string} value - Cookie 默认值 + */ + const ensureCookie = (key, value) => { + // 如果客户端已经提供了该 cookie,则跳过不覆盖 + if (Object.prototype.hasOwnProperty.call(cookies, key)) return; + cookies[key] = String(value); + res.append('Set-Cookie', `${key}=${cookies[key]}${cookieSuffix}`); + }; + + // 获取 env guid + const env_guid = isUUIDv4(process.env.KUGOU_API_GUID) ? cryptoMd5(process.env.KUGOU_API_GUID) : process.env.KUGOU_API_GUID; + + // 计算设备 MID(基于 GUID 的衍生标识) + const mid = calculateMid(env_guid ?? guid); + + // 依次注入各平台标识 Cookie + ensureCookie('KUGOU_API_PLATFORM', process.env.platform); + ensureCookie('KUGOU_API_MID', mid); + ensureCookie('KUGOU_API_GUID', env_guid ?? guid); + ensureCookie('KUGOU_API_DEV', (process.env.KUGOU_API_DEV ?? serverDev).toUpperCase()); + ensureCookie('KUGOU_API_MAC', (process.env.KUGOU_API_MAC ?? '02:00:00:00:00:00').toUpperCase()); + ensureCookie('KUGOU_API_WEBGL', process.env.KUGOU_API_WEBGL ?? generateWebGLHash()); + + // 将注入后的 cookies 回写到 req 对象上,供后续中间件和路由处理器使用 + req.cookies = cookies; + + next(); + }); + + /** + * ============================================================ + * 请求体解析中间件 + * ============================================================ + * + * - express.json(): 解析 Content-Type 为 application/json 的请求体 + * - express.urlencoded(): 解析 Content-Type 为 application/x-www-form-urlencoded 的请求体 + * - extended: false 使用 querystring 库解析(不支持嵌套对象) + */ + app.use(express.json({ limit: '5mb' })); + app.use(express.urlencoded({ extended: false, limit: '5mb' })); + app.use(express.raw({ type: 'application/octet-stream', limit: '100mb' })); + + app.get('/ymhut/health', (_, res) => { + res.json({ + protocolVersion: YMHUT_PROTOCOL_VERSION, + commit: YMHUT_MOEKOE_COMMIT, + pid: process.pid, + status: 'ready', + }); + }); + + app.post('/ymhut/shutdown', (req, res) => { + res.json({ ok: true }); + setImmediate(() => app.emit('ymhut-shutdown')); + }); + + // Compatibility bridge for the existing signed provider adapter. It keeps every + // production KuGou network hop inside this authenticated loopback process. + app.post('/ymhut/proxy', async (req, res) => { + const timestamp = String(req.query.timestamp || ''); + if (!/^\d+$/.test(timestamp)) { + res.status(400).json({ code: 400, message: 'A numeric timestamp is required.' }); + return; + } + + const payload = req.body || {}; + if (!isAllowedKugouTarget(payload.url)) { + res.status(400).json({ code: 400, message: 'Target is not allowed.' }); + return; + } + + const method = String(payload.method || 'GET').toUpperCase(); + if (!['GET', 'HEAD', 'POST', 'PUT', 'DELETE'].includes(method)) { + res.status(405).json({ code: 405, message: 'Method is not allowed.' }); + return; + } + + try { + const response = await axios.request({ + method, + url: payload.url, + headers: filterProxyHeaders(payload.headers), + data: payload.bodyBase64 ? Buffer.from(payload.bodyBase64, 'base64') : undefined, + responseType: 'arraybuffer', + timeout: 15000, + maxRedirects: 0, + validateStatus: () => true, + }); + const responseHeaders = {}; + for (const [name, value] of Object.entries(response.headers || {})) { + if (value !== undefined && !['connection', 'content-length', 'transfer-encoding'].includes(name.toLowerCase())) { + responseHeaders[name] = Array.isArray(value) ? value : String(value); + } + } + res.json({ + status: response.status, + headers: responseHeaders, + bodyBase64: Buffer.from(response.data || []).toString('base64'), + }); + } catch (error) { + const code = error && error.code === 'ECONNABORTED' ? 504 : 502; + res.status(code).json({ code, message: code === 504 ? 'Upstream timeout.' : 'Upstream unavailable.' }); + } + }); + + /** + * ============================================================ + * 静态文件服务 + * ============================================================ + * + * 将项目根目录下的 `public/` 目录作为静态资源目录, + * 可用于提供前端页面、图标等静态文件 + */ + app.use(express.static(path.join(__dirname, 'public'))); + + /** + * API 文档静态服务 + * + * 将 `docs/` 目录挂载到 `/docs` 路径下, + * 访问 /docs 可查看项目接口文档 + */ + app.use('/docs', express.static(path.join(__dirname, 'docs'))); + + /** + * ============================================================ + * API 响应缓存中间件 + * ============================================================ + * + * 使用 apicache 对成功的请求(statusCode === 200)进行 2 分钟的缓存。 + * 相同 URL 在 2 分钟内只会向酷狗服务器发送一次请求。 + * + * 绕过缓存的方式:在请求 URL 后附加不同的 timestamp 参数, + * 例如: /personal/fm?timestamp=1691256061923 + */ + app.use(cache( + '2 minutes', + (req, res) => req.method === 'GET' && + isAnonymousPublicRequest(req) && + PUBLIC_CACHE_ROUTES.has(originalRequestPath(req)) && + res.statusCode === 200, + { + appendKey: (req) => `${req.method}:${req.get('host') || 'loopback'}`, + } + )); + + /** + * ============================================================ + * 动态路由注册 + * ============================================================ + * + * 如果未传入模块定义数组,则自动扫描 module/ 目录加载所有模块。 + * 遍历每个模块定义,为其注册 Express 路由处理器。 + */ + const moduleDefinitions = moduleDefs || (await getModulesDefinitions(path.join(__dirname, 'module'), {})); + + for (const moduleDef of moduleDefinitions) { + /** + * 为每个 API 模块注册路由处理器 + * + * 请求处理流程: + * 1. 解析并合并 Cookie(支持 query 和 body 中的 cookie 字符串) + * 2. 合并所有请求参数:query 参数、body 参数、Cookie + * 3. 提取 Authorization 请求头中的认证信息,合并到 cookie 中 + * 4. 调用模块处理函数,传入合并后的参数和请求工厂函数 + * 5. 处理模块返回的 Cookie(通过 Set-Cookie 写回客户端) + * 6. 返回模块的响应数据 + * 7. 异常时记录日志并返回错误响应 + */ + app.use(moduleDef.route, async (req, res) => { + // Step 1: 解析 query 和 body 中的 cookie 字符串为 JSON 对象 + [req.query, req.body].forEach((item) => { + if (typeof item.cookie === 'string') { + item.cookie = cookieToJson(decode(item.cookie)); + } + }); + + // Step 2: 从 query 中分离出 cookie 参数和其余参数 + const { cookie, ...params } = req.query; + + // Step 3: 构建统一的 query 对象 + // - cookie: 合并请求 Cookie 和 query 中传入的 cookie 参数 + // - params: query 中除 cookie 外的其余参数 + // - body: 请求体(POST 数据) + const body = Buffer.isBuffer(req.body) ? { data: req.body } : req.body; + const query = Object.assign({}, { cookie: Object.assign({}, req.cookies, cookie) }, params, body); + + // Step 4: 如果请求携带了 Authorization 头,将其解析为 Cookie 并合并 + // 这样客户端可以通过 Authorization 头传递认证信息,例如: token=xxx;userid=xxx + const authHeader = req.headers['authorization']; + if (authHeader) { + query.cookie = { + ...query.cookie, + ...cookieToJson(authHeader), + }; + } + + try { + /** + * Step 5: 调用模块处理函数 + * + * 传入两个参数: + * - query: 合并后的所有请求参数 + * - 请求工厂函数: 接收请求配置,注入客户端 IP 后调用 createRequest 发起实际请求 + * + * @see createRequest - 底层 HTTP 请求函数 + */ + const moduleResponse = await moduleDef.module(query, (config) => { + // 获取客户端真实 IP(去除 IPv6-mapped IPv4 前缀) + let ip = req.ip; + if (ip.substring(0, 7) === '::ffff:') { + ip = ip.substring(7); + } + config.ip = ip; + return createRequest(config); + }); + + // 请求成功日志 + if (process.env.YMHUT_QUIET !== '1') console.log('[OK]', req.path); + + // Step 6: 处理模块返回的 Cookie + // 将模块设置的 Cookie 通过 Set-Cookie 响应头写回客户端 + const cookies = moduleResponse.cookie; + if (!query.noCookie) { + if (Array.isArray(cookies) && cookies.length > 0) { + if (req.protocol === 'https') { + // HTTPS 协议下设置 SameSite=None; Secure 以解决 CORS 环境下的 Cookie 传递问题 + res.append( + 'Set-Cookie', + cookies.map((cookie) => { + return `${cookie}; PATH=/; SameSite=None; Secure`; + }) + ); + } else { + // HTTP 协议下仅设置 PATH + res.append( + 'Set-Cookie', + cookies.map((cookie) => { + return `${cookie}; PATH=/`; + }) + ); + } + } + } + + // Step 7: 返回模块的响应(包含 headers、status、body) + res.header(moduleResponse.headers).status(moduleResponse.status).send(moduleResponse.body); + } catch (e) { + // 异常处理:模块内部错误会被封装为包含 status 和 body 的错误对象抛出 + const moduleResponse = e; + + // 错误日志 + if (process.env.YMHUT_QUIET !== '1') console.log('[ERR]', req.path, moduleResponse.status); + + // 如果错误对象没有 body,返回通用 404 响应 + if (!moduleResponse.body) { + res.status(404).send({ + code: 404, + data: null, + msg: 'Not Found', + }); + return; + } + + // 返回模块错误的响应体 + res.header(moduleResponse.headers).status(moduleResponse.status).send(moduleResponse.body); + } + }); + } + + return app; +} + +/** + * 启动 KuGouMusic API 服务 + * + * 完整启动流程: + * 1. 从环境变量读取端口号(默认 3000)和主机地址(默认空字符串,即监听所有可用地址) + * 2. 调用 {@link consturctServer} 构建并配置 Express 应用 + * 3. 在指定端口和主机上启动 HTTP 监听 + * 4. 输出启动成功日志 + * 5. 返回扩展后的 Express 实例(附带底层 server 引用) + * + * @async + * @returns {Promise} 扩展后的 Express 应用实例, + * 包含 `service` 属性指向底层 HTTP Server + * + * @example + * // 基本用法 + * const app = await startService(); + * // 服务已启动,可通过 app.service 访问底层 HTTP Server + * + * @example + * // 通过环境变量自定义端口和主机 + * // PORT=4000 HOST=127.0.0.1 node index.js + */ +async function startService() { + // 读取端口号配置,默认为 3000 + const port = Number(process.env.PORT || '3000'); + // 读取主机地址配置,默认为空(监听所有网络接口) + const host = process.env.HOST || ''; + + // 构建 Express 应用(包含所有中间件和路由) + const app = await consturctServer(); + + /** @type {import('express').Express & ExpressExtension} */ + const appExt = app; + + // 启动 HTTP 服务并监听指定端口和主机 + appExt.service = app.listen(port, host, () => { + console.log(`server running @ http://${host || 'localhost'}:${port}`); + }); + + return appExt; +} + +module.exports = { startService, getModulesDefinitions, consturctServer }; diff --git a/third_party/MoeKoeMusic/api/tsconfig.json b/third_party/MoeKoeMusic/api/tsconfig.json new file mode 100644 index 0000000..e665e4e --- /dev/null +++ b/third_party/MoeKoeMusic/api/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "experimentalDecorators": true, + "moduleResolution": "node", + "lib": ["esnext", "dom"], + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "allowJs": true, + "sourceMap": true, + "strict": true, + "noImplicitAny": false, + "noEmit": true, + "baseUrl": "./", + "resolveJsonModule": true, + "rootDir": "./", + "outDir": "./dist", + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true + }, + + "include": ["./interface.d.ts"] +} diff --git a/third_party/MoeKoeMusic/api/tsdown.config.js b/third_party/MoeKoeMusic/api/tsdown.config.js new file mode 100644 index 0000000..585e600 --- /dev/null +++ b/third_party/MoeKoeMusic/api/tsdown.config.js @@ -0,0 +1,16 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + dts: false, + entry: { + app: './index.js', + 'util/*': './util/*', + 'module/*': './module/*.js' + }, + outDir: './bin/api_js/', + fixedExtension: false, + format: 'cjs', + platform: 'node', + target: 'node14', + minify: true +}); \ No newline at end of file diff --git a/third_party/MoeKoeMusic/api/util/apicache.js b/third_party/MoeKoeMusic/api/util/apicache.js new file mode 100644 index 0000000..2905dea --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/apicache.js @@ -0,0 +1,1024 @@ +/** + * @fileoverview API 响应缓存中间件 + * + * 来源: 基于 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 修改 + * + * 本模块提供 Express 中间件级别的 API 响应缓存功能,支持: + * - 内存缓存(默认)和 Redis 缓存(可选) + * - 按时间字符串(如 "2 minutes"、"1 hour")设置缓存过期 + * - 按分组管理缓存条目,支持批量清除 + * - 自定义缓存条件(状态码过滤、请求/响应 toggle 函数) + * - 缓存命中率统计(可选,用于性能监控) + * - ETag/304 协商缓存支持 + * - JSONP 请求的 URL 去参处理 + * + * 使用示例: + * const cache = require('./apicache').middleware; + * app.use(cache('2 minutes', (req, res) => res.statusCode === 200)); + * + * @module apicache + * @requires url - URL 解析(用于 JSONP 模式下去除查询参数) + * @requires ./memory-cache - 内存缓存实现 + */ + +const url = require('url'); +const MemoryCache = require('./memory-cache'); + +/** + * 时间单位到毫秒的转换表 + * 用于解析人类可读的时间字符串(如 "2 minutes"、"1 hour") + * @type {Object.} + */ +const t = { + ms: 1, // 毫秒 + second: 1000, // 秒 → 1000ms + minute: 60000, // 分钟 → 60000ms + hour: 3600000, // 小时 → 3600000ms + day: 3600000 * 24, // 天 → 86400000ms + week: 3600000 * 24 * 7, // 周 → 604800000ms + month: 3600000 * 24 * 30, // 月(30天)→ 2592000000ms +}; + +/** + * 所有 ApiCache 实例的全局注册表 + * 用于跟踪和管理多个缓存实例 + * @type {Array} + */ +const instances = []; + +/** + * 创建严格相等匹配函数 + * @param {string} a - 要匹配的值 + * @returns {function(string): boolean} 匹配函数 + */ +const matches = function (a) { + return function (b) { + return a === b; + }; +}; + +/** + * 创建不匹配函数(matches 的反函数) + * @param {string} a - 要排除的值 + * @returns {function(string): boolean} 不匹配函数 + */ +const doesntMatch = function (a) { + return function (b) { + return !matches(a)(b); + }; +}; + +/** + * 格式化持续时间为人类可读的日志字符串 + * 超过 1000ms 显示为秒(如 "1.23sec"),否则显示为毫秒(如 "456ms") + * 输出带黄色 ANSI 转义码 + * + * @param {number} d - 持续时间(毫秒) + * @param {string} [prefix] - 可选的前缀文本 + * @returns {string} 带颜色的日志字符串 + */ +const logDuration = function (d, prefix) { + const str = d > 1000 ? `${(d / 1000).toFixed(2)}sec` : `${d}ms`; + return `\x1B[33m- ${prefix ? `${prefix} ` : ''}${str}\x1B[0m`; +}; + +/** + * 安全地获取响应头对象 + * 兼容不同版本的 Express/Node.js + * @param {Object} res - Express 响应对象 + * @returns {Object} 响应头键值对 + */ +function getSafeHeaders(res) { + return res.getHeaders ? res.getHeaders() : res._headers; +} + +/** + * ApiCache 缓存中间件构造函数 + * + * 每个实例维护独立的: + * - 内存缓存(MemoryCache) + * - 全局配置选项 + * - 缓存索引(all + groups) + * - 定时器集合(用于自动过期清除) + * - 性能统计数组 + * + * @constructor + */ +function ApiCache() { + const memCache = new MemoryCache(); + + /** + * 全局配置选项 + * @type {Object} + */ + const globalOptions = { + debug: false, // 是否开启调试日志 + defaultDuration: 3600000, // 默认缓存时长(1小时,毫秒) + enabled: true, // 是否启用缓存 + appendKey: [], // 自定义缓存键追加字段(数组或函数) + jsonp: false, // 是否为 JSONP 请求(启用后会去除 URL 中的查询参数) + redisClient: false, // Redis 客户端实例(false 表示使用内存缓存) + headerBlacklist: [], // 不缓存的响应头黑名单 + statusCodes: { + include: [], // 仅缓存这些状态码(空数组表示不限制) + exclude: [], // 排除这些状态码 + }, + events: { + expire: undefined, // 缓存过期时的回调函数 + }, + headers: {}, // 强制覆盖的响应头(如 'cache-control': 'no-cache') + trackPerformance: false, // 是否跟踪缓存命中率(会增加内存消耗) + }; + + const middlewareOptions = []; // 所有中间件的选项注册表 + const instance = this; + let index = null; // 缓存索引:{ all: [key...], groups: { groupName: [key...] } } + const timers = {}; // 自动过期定时器集合 { key: setTimeout ID } + const performanceArray = []; // 缓存命中率统计数组 + + // 将当前实例注册到全局实例列表 + instances.push(this); + this.id = instances.length; + + /** + * 调试日志输出函数 + * 仅在 debug 模式或环境变量 DEBUG 包含 'apicache' 时输出 + * @param {...*} args - 日志参数 + */ + function debug(a, b, c, d) { + const arr = ['\x1B[36m[apicache]\x1B[0m', a, b, c, d].filter((arg) => { + return arg !== undefined; + }); + const debugEnv = process.env.DEBUG && process.env.DEBUG.split(',').includes('apicache'); + + return (globalOptions.debug || debugEnv) && console.log.apply(null, arr); + } + + /** + * 判断响应是否应该被缓存 + * + * 判断逻辑: + * 1. 响应对象必须存在 + * 2. 如果提供了 toggle 函数,toggle 必须返回 true + * 3. 响应状态码不在 exclude 列表中 + * 4. 响应状态码在 include 列表中(如果 include 非空) + * + * @param {Object} request - Express 请求对象 + * @param {Object} response - Express 响应对象 + * @param {function} [toggle] - 可选的缓存条件函数 (req, res) => boolean + * @returns {boolean} 是否应该缓存 + */ + function shouldCacheResponse(request, response, toggle) { + const opt = globalOptions; + const codes = opt.statusCodes; + + if (!response) { + return false; + } + + // 自定义 toggle 函数判断 + if (toggle && !toggle(request, response)) { + return false; + } + + // 状态码排除列表 + if (codes.exclude && codes.exclude.length && codes.exclude.includes(response.statusCode)) { + return false; + } + // 状态码包含列表(白名单模式) + if (codes.include && codes.include.length && codes.include.includes(response.statusCode)) { + return false; + } + + return true; + } + + /** + * 将缓存键添加到索引中 + * + * 索引结构: + * - index.all: 所有缓存键的数组(用于全量清除) + * - index.groups: 按分组名索引的缓存键数组(用于按组清除) + * + * @param {string} key - 缓存键 + * @param {Object} req - Express 请求对象(req.apicacheGroup 可指定分组名) + */ + function addIndexEntries(key, req) { + const groupName = req.apicacheGroup; + + if (groupName) { + debug(`group detected "${groupName}"`); + // 将键添加到分组索引(unshift 添加到数组头部) + const group = (index.groups[groupName] = index.groups[groupName] || []); + group.unshift(key); + } + + // 将键添加到全局索引 + index.all.unshift(key); + } + + /** + * 过滤掉黑名单中的响应头 + * @param {Object} headers - 原始响应头 + * @returns {Object} 过滤后的响应头 + */ + function filterBlacklistedHeaders(headers) { + return Object.keys(headers) + .filter((key) => { + return !globalOptions.headerBlacklist.includes(key); + }) + .reduce((acc, header) => { + acc[header] = headers[header]; + return acc; + }, {}); + } + + /** + * 创建缓存对象 + * + * @param {number} status - HTTP 状态码 + * @param {Object} headers - 响应头 + * @param {string|Buffer} data - 响应体数据 + * @param {string} encoding - 编码方式 + * @returns {Object} 缓存对象 + */ + function createCacheObject(status, headers, data, encoding) { + return { + status, + headers: filterBlacklistedHeaders(headers), // 过滤黑名单头 + data, + encoding, + timestamp: new Date().getTime() / 1000, // Unix 时间戳(秒),用于计算剩余 max-age + }; + } + + /** + * 将响应数据存入缓存 + * + * 支持两种存储后端: + * - Redis: 使用 hset 存储,expire 设置过期 + * - 内存: 使用 MemoryCache 存储 + * + * 同时设置自动清除定时器(setTimeout 最大值限制为 2147483647ms ≈ 24.8 天) + * + * @param {string} key - 缓存键 + * @param {Object} value - 缓存对象 + * @param {number} duration - 缓存时长(毫秒) + */ + function cacheResponse(key, value, duration) { + const redis = globalOptions.redisClient; + const expireCallback = globalOptions.events.expire; + + if (redis && redis.connected) { + // Redis 存储 + try { + redis.hset(key, 'response', JSON.stringify(value)); + redis.hset(key, 'duration', duration); + redis.expire(key, duration / 1000, expireCallback || (() => {})); + } catch (err) { + debug('[apicache] error in redis.hset()'); + } + } else { + // 内存存储 + memCache.add(key, value, duration, expireCallback); + } + + // 设置自动清除定时器(限制最大值防止 setTimeout 溢出) + timers[key] = setTimeout(() => { + instance.clear(key, true); + }, Math.min(duration, 2147483647)); + } + + /** + * 累积响应内容到 res._apicache.content + * + * Express 的 res.write() 可能被多次调用,每次传递部分内容。 + * 此函数将所有部分内容累积起来,用于最终缓存完整的响应。 + * + * 支持三种内容类型: + * - string: 字符串拼接 + * - Buffer: Buffer.concat 拼接 + * - 其他: 直接赋值(如 JSON 对象) + * + * @param {Object} res - Express 响应对象 + * @param {string|Buffer} content - 本次写入的内容 + */ + function accumulateContent(res, content) { + if (content) { + if (typeof content == 'string') { + // 字符串拼接 + res._apicache.content = (res._apicache.content || '') + content; + } else if (Buffer.isBuffer(content)) { + let oldContent = res._apicache.content; + + // 将旧的字符串内容转为 Buffer + if (typeof oldContent === 'string') { + oldContent = !Buffer.from ? new Buffer(oldContent) : Buffer.from(oldContent); + } + + if (!oldContent) { + oldContent = !Buffer.alloc ? Buffer.alloc(0) : Buffer.alloc(0); + } + + // Buffer 拼接 + res._apicache.content = Buffer.concat([oldContent, content], oldContent.length + content.length); + } else { + // 其他类型直接赋值 + res._apicache.content = content; + } + } + } + + /** + * 使响应变得可缓存(Monkey-patch res 的方法) + * + * 通过劫持 res.writeHead、res.write、res.end 三个方法, + * 在响应完成时自动将内容存入缓存。 + * + * 流程: + * 1. 保存原始方法引用到 res._apicache + * 2. 应用全局响应头覆盖 + * 3. 重写 res.writeHead: 添加 cache-control 头,保存响应头快照 + * 4. 重写 res.write: 累积部分内容 + * 5. 重写 res.end: 判断是否缓存,创建缓存对象并存储 + * + * @param {Object} req - Express 请求对象 + * @param {Object} res - Express 响应对象 + * @param {function} next - Express next 函数 + * @param {string} key - 缓存键 + * @param {number} duration - 缓存时长(毫秒) + * @param {string} strDuration - 原始时长字符串(用于日志) + * @param {function} [toggle] - 缓存条件函数 + */ + function makeResponseCacheable(req, res, next, key, duration, strDuration, toggle) { + // 保存原始方法引用,用于后续调用 + res._apicache = { + write: res.write, + writeHead: res.writeHead, + end: res.end, + cacheable: true, + content: undefined, + }; + + // 应用全局响应头覆盖 + Object.keys(globalOptions.headers).forEach((name) => { + res.setHeader(name, globalOptions.headers[name]); + }); + + // 重写 res.writeHead:添加 cache-control 头并保存响应头快照 + res.writeHead = function () { + if (!globalOptions.headers['cache-control']) { + if (shouldCacheResponse(req, res, toggle)) { + // 可缓存:设置 max-age + res.setHeader('cache-control', `max-age=${(duration / 1000).toFixed(0)}`); + } else { + // 不可缓存:禁止缓存 + res.setHeader('cache-control', 'no-cache, no-store, must-revalidate'); + } + } + + // 保存响应头快照(在 writeHead 被调用后,headers 已确定) + res._apicache.headers = Object.assign({}, getSafeHeaders(res)); + return res._apicache.writeHead.apply(this, arguments); + }; + + // 重写 res.write:累积部分内容 + res.write = function (content) { + accumulateContent(res, content); + return res._apicache.write.apply(this, arguments); + }; + + // 重写 res.end:判断是否缓存,创建缓存对象并存储 + res.end = function (content, encoding) { + if (shouldCacheResponse(req, res, toggle)) { + accumulateContent(res, content); + + if (res._apicache.cacheable && res._apicache.content) { + // 添加到缓存索引 + addIndexEntries(key, req); + const headers = res._apicache.headers || getSafeHeaders(res); + // 创建缓存对象并存储 + const cacheObject = createCacheObject(res.statusCode, headers, res._apicache.content, encoding); + cacheResponse(key, cacheObject, duration); + + // 调试日志 + const elapsed = new Date() - req.apicacheTimer; + debug(`adding cache entry for "${key}" @ ${strDuration}`, logDuration(elapsed)); + debug('_apicache.headers: ', res._apicache.headers); + debug('res.getHeaders(): ', getSafeHeaders(res)); + debug('cacheObject: ', cacheObject); + } + } + + // 调用原始 res.end + return res._apicache.end.apply(this, arguments); + }; + + next(); + } + + /** + * 发送缓存的响应 + * + * 处理逻辑: + * 1. 检查 toggle 函数是否允许返回缓存 + * 2. 合并响应头,正确递减 max-age(减去已过去的时间) + * 3. 反序列化 Buffer 数据 + * 4. 检查 ETag/If-None-Match,满足条件返回 304 + * 5. 返回完整的缓存响应 + * + * @param {Object} request - Express 请求对象 + * @param {Object} response - Express 响应对象 + * @param {Object} cacheObject - 缓存对象 + * @param {function} [toggle] - 缓存条件函数 + * @param {function} next - Express next 函数 + * @param {number} duration - 缓存时长(毫秒) + */ + function sendCachedResponse(request, response, cacheObject, toggle, next, duration) { + if (toggle && !toggle(request, response)) { + return next(); + } + + const headers = getSafeHeaders(response); + + // 合并缓存的响应头,并正确递减 max-age + Object.assign(headers, filterBlacklistedHeaders(cacheObject.headers || {}), { + // max-age = 原始时长 - 已过去的时间,最小为 0 + 'cache-control': `max-age=${Math.max(0, (duration / 1000 - (new Date().getTime() / 1000 - cacheObject.timestamp)).toFixed(0))}`, + }); + + // 反序列化 Buffer 数据(JSON 序列化后的 Buffer 会变成 { type: 'Buffer', data: [...] } 格式) + let data = cacheObject.data; + if (data && data.type === 'Buffer') { + data = typeof data.data === 'number' ? new Buffer.alloc(data.data) : new Buffer.from(data.data); + } + + // ETag 协商缓存:如果请求的 If-None-Match 与缓存的 ETag 匹配,返回 304 + const cachedEtag = cacheObject.headers.etag; + const requestEtag = request.headers['if-none-match']; + + if (requestEtag && cachedEtag === requestEtag) { + response.writeHead(304, headers); + return response.end(); + } + + // 返回缓存的响应 + response.writeHead(cacheObject.status || 200, headers); + + return response.end(data, cacheObject.encoding); + } + + /** + * 同步全局选项到所有中间件实例 + * 将 globalOptions 合并到每个中间件的 opt 中,并应用各自的 localOptions + */ + function syncOptions() { + for (const i in middlewareOptions) { + Object.assign(middlewareOptions[i].options, globalOptions, middlewareOptions[i].localOptions); + } + } + + /** + * 清除缓存 + * + * 支持三种清除模式: + * 1. 按分组名清除: target 为分组名,清除该分组下的所有缓存 + * 2. 按缓存键清除: target 为具体的缓存键 + * 3. 全部清除: target 为空,清除所有缓存 + * + * @param {string} [target] - 分组名或缓存键,为空则清除全部 + * @param {boolean} [isAutomatic] - 是否为自动过期清除(用于日志区分) + * @returns {Object} 当前缓存索引 + */ + this.clear = function (target, isAutomatic) { + const group = index.groups[target]; + const redis = globalOptions.redisClient; + + if (group) { + // 模式1: 按分组名清除 + debug(`clearing group "${target}"`); + + group.forEach((key) => { + debug(`clearing cached entry for "${key}"`); + clearTimeout(timers[key]); + delete timers[key]; + if (!globalOptions.redisClient) { + memCache.delete(key); + } else { + try { + redis.del(key); + } catch (err) { + console.log(`[apicache] error in redis.del("${key}")`); + } + } + index.all = index.all.filter(doesntMatch(key)); + }); + + delete index.groups[target]; + } else if (target) { + // 模式2: 按缓存键清除 + debug(`clearing ${isAutomatic ? 'expired' : 'cached'} entry for "${target}"`); + clearTimeout(timers[target]); + delete timers[target]; + + if (!redis) { + memCache.delete(target); + } else { + try { + redis.del(target); + } catch (err) { + console.log(`[apicache] error in redis.del("${target}")`); + } + } + + // 从全局索引中移除 + index.all = index.all.filter(doesntMatch(target)); + + // 从所有分组中移除,并清理空分组 + Object.keys(index.groups).forEach((groupName) => { + index.groups[groupName] = index.groups[groupName].filter(doesntMatch(target)); + + if (!index.groups[groupName].length) { + delete index.groups[groupName]; + } + }); + } else { + // 模式3: 全部清除 + debug('clearing entire index'); + + Object.keys(timers).forEach((key) => { + clearTimeout(timers[key]); + delete timers[key]; + }); + + if (!redis) { + memCache.clear(); + } else { + // 逐个清除 Redis 键(避免误删非 apicache 的条目) + index.all.forEach((key) => { + try { + redis.del(key); + } catch (err) { + console.log(`[apicache] error in redis.del("${key}")`); + } + }); + } + this.resetIndex(); + } + + return this.getIndex(); + }; + + /** + * 解析时长字符串为毫秒数 + * + * 支持的格式: + * - 数字: 直接返回(毫秒) + * - 字符串: "2 minutes"、"1 hour"、"30 seconds"、"500ms" + * - 数字部分支持小数点(如 "1.5 hours") + * - 单位支持复数(自动去掉末尾的 s) + * - "m" 会被解析为 "ms"(毫秒缩写) + * + * @param {number|string} duration - 时长(数字或字符串) + * @param {number} defaultDuration - 默认时长(解析失败时使用) + * @returns {number} 时长(毫秒) + */ + function parseDuration(duration, defaultDuration) { + if (typeof duration === 'number') { + return duration; + } + + if (typeof duration === 'string') { + const split = duration.match(/^([\d\.,]+)\s?(\w+)$/); + + if (split.length === 3) { + const len = Number.parseFloat(split[1]); + let unit = split[2].replace(/s$/i, '').toLowerCase(); + if (unit === 'm') { + unit = 'ms'; + } + + return (len || 1) * (t[unit] || 0); + } + } + + return defaultDuration; + } + + /** + * 获取时长(公开方法) + * @param {number|string} duration - 时长 + * @returns {number} 解析后的毫秒数 + */ + this.getDuration = function (duration) { + return parseDuration(duration, globalOptions.defaultDuration); + }; + + /** + * 获取缓存性能统计(命中率) + * + * 可用于创建性能监控接口: + * app.get('/api/cache/performance', (req, res) => { + * res.json(apicache.getPerformance()) + * }) + * + * @returns {Array} 每个中间件的性能报告数组 + */ + this.getPerformance = function () { + return performanceArray.map((p) => { + return p.report(); + }); + }; + + /** + * 获取缓存索引 + * @param {string} [group] - 可选的分组名,不传则返回完整索引 + * @returns {Object} 缓存索引 + */ + this.getIndex = function (group) { + if (group) { + return index.groups[group]; + } else { + return index; + } + }; + + /** + * 创建缓存中间件 + * + * 这是主要的公开 API,返回一个 Express 中间件函数。 + * 中间件会拦截请求,检查缓存,命中则直接返回缓存响应,未命中则继续处理并缓存响应。 + * + * @param {string|number} strDuration - 缓存时长(如 "2 minutes" 或 120000) + * @param {function} [middlewareToggle] - 中间件级别的缓存条件函数 (req, res) => boolean + * @param {Object} [localOptions] - 本中间件的局部配置(覆盖全局配置) + * @returns {function} Express 中间件函数 + */ + this.middleware = function cache(strDuration, middlewareToggle, localOptions) { + const duration = instance.getDuration(strDuration); + const opt = {}; + + // 注册中间件选项 + middlewareOptions.push({ + options: opt, + }); + + /** + * 更新或获取中间件选项 + * @param {Object} [localOptions] - 局部配置 + * @returns {Object} 当前中间件的配置 + */ + const options = function (localOptions) { + if (localOptions) { + middlewareOptions.find((middleware) => { + return middleware.options === opt; + }).localOptions = localOptions; + } + + syncOptions(); + + return opt; + }; + + options(localOptions); + + /** + * 空操作的性能统计类(不跟踪性能时使用) + * 所有方法都是空函数,避免条件判断开销 + */ + function NOOPCachePerformance() { + this.report = this.hit = this.miss = function () {}; // noop; + } + + /** + * 缓存命中率统计类 + * + * 使用位压缩技术高效存储历史命中/未命中记录: + * - 每个 Uint8Array 元素存储 4 条记录 + * - 每条记录占 2 bit: 00=无记录, 01=命中, 10=未命中 + * - 支持 4 个时间窗口: 最近 100/1000/10000/100000 次请求 + */ + function CachePerformance() { + /** + * 最近 100 次请求的命中记录(位压缩存储) + * @type {Uint8Array} + */ + this.hitsLast100 = new Uint8Array(100 / 4); // each hit is 2 bits + + /** + * 最近 1000 次请求的命中记录 + * @type {Uint8Array} + */ + this.hitsLast1000 = new Uint8Array(1000 / 4); // each hit is 2 bits + + /** + * 最近 10000 次请求的命中记录 + * @type {Uint8Array} + */ + this.hitsLast10000 = new Uint8Array(10000 / 4); // each hit is 2 bits + + /** + * 最近 100000 次请求的命中记录 + * @type {Uint8Array} + */ + this.hitsLast100000 = new Uint8Array(100000 / 4); // each hit is 2 bits + + /** + * 总请求次数(自服务器启动以来) + * @type {number} + */ + this.callCount = 0; + + /** + * 总命中次数 + * @type {number} + */ + this.hitCount = 0; + + /** + * 最后一次缓存命中的键(用于识别对应路由) + * @type {string|null} + */ + this.lastCacheHit = null; + + /** + * 最后一次缓存未命中的键 + * @type {string|null} + */ + this.lastCacheMiss = null; + + /** + * 生成性能统计报告 + * @returns {Object} 包含各项统计指标的报告对象 + */ + this.report = function () { + return { + lastCacheHit: this.lastCacheHit, + lastCacheMiss: this.lastCacheMiss, + callCount: this.callCount, + hitCount: this.hitCount, + missCount: this.callCount - this.hitCount, + hitRate: this.callCount == 0 ? null : this.hitCount / this.callCount, + hitRateLast100: this.hitRate(this.hitsLast100), + hitRateLast1000: this.hitRate(this.hitsLast1000), + hitRateLast10000: this.hitRate(this.hitsLast10000), + hitRateLast100000: this.hitRate(this.hitsLast100000), + }; + }; + + /** + * 从位压缩数组中计算命中率 + * + * 遍历每个字节的 4 个 2-bit 记录: + * - 01 (1) = 命中 + * - 10 (2) = 未命中 + * - 00 (0) = 无记录(忽略) + * + * @param {Uint8Array} array - 位压缩的命中记录数组 + * @returns {number|null} 命中率(0~1),无记录时返回 null + */ + this.hitRate = function (array) { + let hits = 0; + let misses = 0; + for (let i = 0; i < array.length; i++) { + let n8 = array[i]; + for (j = 0; j < 4; j++) { + switch (n8 & 3) { + case 1: + hits++; + break; + case 2: + misses++; + break; + } + n8 >>= 2; + } + } + const total = hits + misses; + if (total == 0) { + return null; + } + return hits / total; + }; + + /** + * 在位压缩数组中记录一次命中或未命中 + * + * 编码规则(每个 2-bit 记录): + * - 00: 无记录 + * - 01: 命中 + * - 10: 未命中 + * + * @param {Uint8Array} array - 位压缩数组 + * @param {boolean} hit - true=命中, false=未命中 + */ + this.recordHitInArray = function (array, hit) { + const arrayIndex = ~~(this.callCount / 4) % array.length; // 数组索引 + const bitOffset = (this.callCount % 4) * 2; // 位偏移(每 2 bit 一条记录) + const clearMask = ~(3 << bitOffset); // 清除掩码 + const record = (hit ? 1 : 2) << bitOffset; // 编码记录 + array[arrayIndex] = (array[arrayIndex] & clearMask) | record; + }; + + /** + * 记录一次命中/未命中到所有时间窗口的数组 + * @param {boolean} hit - true=命中, false=未命中 + */ + this.recordHit = function (hit) { + this.recordHitInArray(this.hitsLast100, hit); + this.recordHitInArray(this.hitsLast1000, hit); + this.recordHitInArray(this.hitsLast10000, hit); + this.recordHitInArray(this.hitsLast100000, hit); + if (hit) { + this.hitCount++; + } + this.callCount++; + }; + + /** + * 记录一次缓存命中 + * @param {string} key - 命中的缓存键 + */ + this.hit = function (key) { + this.recordHit(true); + this.lastCacheHit = key; + }; + + /** + * 记录一次缓存未命中 + * @param {string} key - 未命中的缓存键 + */ + this.miss = function (key) { + this.recordHit(false); + this.lastCacheMiss = key; + }; + } + + // 根据配置决定使用真实的性能统计还是空操作 + const perf = globalOptions.trackPerformance ? new CachePerformance() : new NOOPCachePerformance(); + + performanceArray.push(perf); + + /** + * 核心缓存中间件函数 + * + * 请求处理流程: + * 1. 检查缓存是否启用、是否有 bypass 头 + * 2. 生成缓存键(hostname + URL + appendKey) + * 3. 尝试从内存缓存获取 → 命中则直接返回 + * 4. 尝试从 Redis 获取 → 命中则直接返回 + * 5. 未命中 → 劫持 res 方法,等待响应完成后缓存 + */ + const cache = function (req, res, next) { + /** + * 跳过缓存,直接进入下一个中间件 + */ + function bypass() { + debug('bypass detected, skipping cache.'); + return next(); + } + + // 初始跳过检查 + if (!opt.enabled) { + return bypass(); + } + // 通过请求头强制跳过缓存 + if (req.headers['x-apicache-bypass'] || req.headers['x-apicache-force-fetch']) { + return bypass(); + } + + // 记录请求开始时间(用于计算耗时) + req.apicacheTimer = new Date(); + + // 生成缓存键: hostname + URL + // Express 4.x 中 req.url 可能是路由相对路径,使用 originalUrl 获取完整路径 + let key = req.hostname + (req.originalUrl || req.url); + // JSONP 模式:去除查询参数(避免不同的 callback 参数产生不同的缓存键) + if (opt.jsonp) { + key = url.parse(key).pathname; + } + + // 追加自定义缓存键(支持函数或属性路径数组) + if (typeof opt.appendKey === 'function') { + key += `$$appendKey=${opt.appendKey(req, res)}`; + } else if (opt.appendKey.length > 0) { + let appendKey = req; + + for (let i = 0; i < opt.appendKey.length; i++) { + appendKey = appendKey[opt.appendKey[i]]; + } + key += `$$appendKey=${appendKey}`; + } + + // 尝试从缓存获取 + const redis = opt.redisClient; + const cached = !redis ? memCache.getValue(key) : null; + + // 内存缓存命中 + if (cached) { + const elapsed = new Date() - req.apicacheTimer; + debug('sending cached (memory-cache) version of', key, logDuration(elapsed)); + + perf.hit(key); + return sendCachedResponse(req, res, cached, middlewareToggle, next, duration); + } + + // Redis 缓存命中 + if (redis && redis.connected) { + try { + redis.hgetall(key, (err, obj) => { + if (!err && obj && obj.response) { + const elapsed = new Date() - req.apicacheTimer; + debug('sending cached (redis) version of', key, logDuration(elapsed)); + + perf.hit(key); + return sendCachedResponse(req, res, JSON.parse(obj.response), middlewareToggle, next, duration); + } else { + // Redis 未命中,进入缓存写入流程 + perf.miss(key); + return makeResponseCacheable(req, res, next, key, duration, strDuration, middlewareToggle); + } + }); + } catch (err) { + // Redis 出错时降级为未命中 + perf.miss(key); + return makeResponseCacheable(req, res, next, key, duration, strDuration, middlewareToggle); + } + } else { + // 无 Redis,内存也未命中,进入缓存写入流程 + perf.miss(key); + return makeResponseCacheable(req, res, next, key, duration, strDuration, middlewareToggle); + } + }; + + // 暴露 options 函数,允许运行时修改配置 + cache.options = options; + + return cache; + }; + + /** + * 设置或获取全局配置选项 + * + * @param {Object} [options] - 配置对象,不传则返回当前配置 + * @returns {ApiCache|Object} 传入 options 时返回 this(支持链式调用),否则返回当前配置 + */ + this.options = function (options) { + if (options) { + Object.assign(globalOptions, options); + syncOptions(); + + if ('defaultDuration' in options) { + // 将默认时长转换为毫秒数 + globalOptions.defaultDuration = parseDuration(globalOptions.defaultDuration, 3600000); + } + + if (globalOptions.trackPerformance) { + debug('WARNING: using trackPerformance flag can cause high memory usage!'); + } + + return this; + } else { + return globalOptions; + } + }; + + /** + * 重置缓存索引(清空所有索引记录) + */ + this.resetIndex = function () { + index = { + all: [], // 所有缓存键 + groups: {}, // 分组索引 { groupName: [key...] } + }; + }; + + /** + * 创建新的 ApiCache 实例(可选配置) + * @param {Object} [config] - 初始配置 + * @returns {ApiCache} 新实例 + */ + this.newInstance = function (config) { + const instance = new ApiCache(); + + if (config) { + instance.options(config); + } + + return instance; + }; + + /** + * 克隆当前实例(复制配置) + * @returns {ApiCache} 克隆的实例 + */ + this.clone = function () { + return this.newInstance(this.options()); + }; + + // 初始化缓存索引 + this.resetIndex(); +} + +// 导出单例实例(整个应用共享一个缓存管理器) +module.exports = new ApiCache(); diff --git a/third_party/MoeKoeMusic/api/util/config.json b/third_party/MoeKoeMusic/api/util/config.json new file mode 100644 index 0000000..7c9e6f1 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/config.json @@ -0,0 +1,12 @@ +{ + "wx_appid": "wx79f2c4418704b4f8", + "wx_lite_appid": "wx72b795aca60ad321", + "wx_secret": "4efcab88b700769e376e3f6087b8abc9", + "wx_lite_secret": "33e486041e5e25729a4e3d2da7502f9a", + "srcappid": 2919, + "appid": 1005, + "apiver": 20, + "clientver": 20489, + "liteAppid": 3116, + "liteClientver": 11440 +} \ No newline at end of file diff --git a/third_party/MoeKoeMusic/api/util/crypto.js b/third_party/MoeKoeMusic/api/util/crypto.js new file mode 100644 index 0000000..f51bfb8 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/crypto.js @@ -0,0 +1,318 @@ +const CryptoJS = require('crypto-js'); +const forge = require('node-forge'); +const { randomString } = require('./util'); +const publicRasKey = `-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIAG7QOELSYoIJvTFJhMpe1s/gbjDJX51HBNnEl5HXqTW6lQ7LC8jr9fWZTwusknp+sVGzwd40MwP6U5yDE27M/X1+UR4tvOGOqp94TJtQ1EPnWGWXngpeIW5GxoQGao1rmYWAu6oi1z9XkChrsUdC6DJE5E221wf/4WLFxwAtRQIDAQAB\n-----END PUBLIC KEY-----`; +const publicLiteRasKey = `-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDECi0Np2UR87scwrvTr72L6oO01rBbbBPriSDFPxr3Z5syug0O24QyQO8bg27+0+4kBzTBTBOZ/WWU0WryL1JSXRTXLgFVxtzIY41Pe7lPOgsfTCn5kZcvKhYKJesKnnJDNr5/abvTGf+rHG3YRwsCHcQ08/q6ifSioBszvb3QiwIDAQAB\n-----END PUBLIC KEY-----`; + +const rsaKeyCache = new Map(); + +function encodeUtf8(str) { + if (typeof TextEncoder !== 'undefined') { + return new TextEncoder().encode(str); + } + + if (typeof Buffer !== 'undefined') { + return new Uint8Array(Buffer.from(str, 'utf8')); + } + + const codePoints = []; + for (let i = 0; i < str.length; i++) { + let code = str.charCodeAt(i); + if (code >= 0xd800 && code <= 0xdbff && i + 1 < str.length) { + const next = str.charCodeAt(i + 1); + if (next >= 0xdc00 && next <= 0xdfff) { + code = ((code - 0xd800) << 10) + (next - 0xdc00) + 0x10000; + i++; + } + } + codePoints.push(code); + } + + const bytes = []; + for (const code of codePoints) { + if (code <= 0x7f) { + bytes.push(code); + } else if (code <= 0x7ff) { + bytes.push( + 0xc0 | (code >> 6), + 0x80 | (code & 0x3f), + ); + } else if (code <= 0xffff) { + bytes.push( + 0xe0 | (code >> 12), + 0x80 | ((code >> 6) & 0x3f), + 0x80 | (code & 0x3f), + ); + } else { + bytes.push( + 0xf0 | (code >> 18), + 0x80 | ((code >> 12) & 0x3f), + 0x80 | ((code >> 6) & 0x3f), + 0x80 | (code & 0x3f), + ); + } + } + + return new Uint8Array(bytes); +} + +function decodeUtf8(uint8) { + if (typeof TextDecoder !== 'undefined') { + return new TextDecoder().decode(uint8); + } + + if (typeof Buffer !== 'undefined') { + return Buffer.from(uint8).toString('utf8'); + } + + let out = ''; + let i = 0; + while (i < uint8.length) { + const byte1 = uint8[i++]; + if (byte1 < 0x80) { + out += String.fromCharCode(byte1); + continue; + } + if (byte1 < 0xe0) { + const byte2 = uint8[i++] & 0x3f; + const codePoint = ((byte1 & 0x1f) << 6) | byte2; + out += String.fromCharCode(codePoint); + continue; + } + if (byte1 < 0xf0) { + const byte2 = uint8[i++] & 0x3f; + const byte3 = uint8[i++] & 0x3f; + const codePoint = ((byte1 & 0x0f) << 12) | (byte2 << 6) | byte3; + out += String.fromCharCode(codePoint); + continue; + } + + const byte2 = uint8[i++] & 0x3f; + const byte3 = uint8[i++] & 0x3f; + const byte4 = uint8[i++] & 0x3f; + let codePoint = ((byte1 & 0x07) << 18) | (byte2 << 12) | (byte3 << 6) | byte4; + codePoint -= 0x10000; + out += String.fromCharCode( + (codePoint >> 10) + 0xd800, + (codePoint & 0x3ff) + 0xdc00, + ); + } + + return out; +} + +function normalizeBuffer(data) { + if (data instanceof Uint8Array) return data; + const str = typeof data === 'string' ? data : JSON.stringify(data); + return encodeUtf8(str); +} + +function wordArrayFromBuffer(uint8) { + const words = []; + for (let i = 0; i < uint8.length; i += 4) { + words.push( + ((uint8[i] || 0) << 24) | ((uint8[i + 1] || 0) << 16) | + ((uint8[i + 2] || 0) << 8) | (uint8[i + 3] || 0) + ); + } + return CryptoJS.lib.WordArray.create(words, uint8.length); +} + +function wordArrayToBuffer(wordArray) { + const { words, sigBytes } = wordArray; + const uint8 = new Uint8Array(sigBytes); + for (let i = 0; i < sigBytes; i++) { + uint8[i] = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + } + return uint8; +} + +function uint8ArrayToHex(arr) { + return Array.from(arr).map(b => b.toString(16).padStart(2, '0')).join(''); +} + +function utf8WordArray(input) { + return typeof input === 'string' ? CryptoJS.enc.Utf8.parse(input) : wordArrayFromBuffer(input); +} + +function getForgePublicKey(pem) { + if (!rsaKeyCache.has(pem)) { + rsaKeyCache.set(pem, forge.pki.publicKeyFromPem(pem)); + } + return rsaKeyCache.get(pem); +} + +function bufferToBinaryString(buffer) { + let out = ''; + for (let i = 0; i < buffer.length; i++) out += String.fromCharCode(buffer[i]); + return out; +} + +function rsaRawEncrypt(buffer, publicKey) { + const keyLength = Math.ceil(publicKey.n.bitLength() / 8); + const message = new forge.jsbn.BigInteger(uint8ArrayToHex(buffer), 16); + const encrypted = message.modPow(publicKey.e, publicKey.n); + return encrypted.toString(16).padStart(keyLength * 2, '0'); +} + +/** + * @typedef {{str: string, key: string}} AesEncrypt + */ + +/** + * MD5 加密 + * @param {BufferLike} data + * @returns {string} + */ +function cryptoMd5(data) { + const buffer = typeof data === 'object' ? JSON.stringify(data) : data; + return CryptoJS.MD5(buffer).toString(CryptoJS.enc.Hex); +} + +/** + * Sha1 加密 + * @param {BufferLike} data + * @returns { string } + */ +function cryptoSha1(data) { + const buffer = typeof data === 'object' ? JSON.stringify(data) : data; + return CryptoJS.SHA1(buffer).toString(CryptoJS.enc.Hex); +} + +/** + * AES 加密 + * @param {BufferLike} data 需要加密的数据 + * @param {{ key?:string, iv?: string } | undefined} opt + * @returns {AesEncrypt | string} + */ +function cryptoAesEncrypt(data, opt) { + if (typeof data === 'object') data = JSON.stringify(data); + const buffer = normalizeBuffer(data); + let key; + let iv; + let tempKey = ''; + + if (opt?.key && opt?.iv) { + key = opt.key; + iv = opt.iv; + } else { + tempKey = opt?.key || randomString(16).toLowerCase(); + key = cryptoMd5(tempKey).substring(0, 32); + iv = key.substring(key.length - 16); + } + + const encrypted = CryptoJS.AES.encrypt(wordArrayFromBuffer(buffer), utf8WordArray(key), { + iv: utf8WordArray(iv), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + + const hex = CryptoJS.enc.Hex.stringify(encrypted.ciphertext); + if (opt?.key && opt?.key) return hex; + return { str: hex, key: tempKey }; +} + +/** + * AES 解密 + * @param {string} data + * @param {string} key + * @param {string?} iv + * @returns {string | Record} + */ +function cryptoAesDecrypt(data, key, iv) { + if (!iv) key = cryptoMd5(key).substring(0, 32); + iv = iv || key.substring(key.length - 16); + const cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Hex.parse(data) }); + + const decrypted = CryptoJS.AES.decrypt(cipherParams, utf8WordArray(key), { + iv: utf8WordArray(iv), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + + const text = decodeUtf8(wordArrayToBuffer(decrypted)); + try { + return JSON.parse(text); + } catch (e) { + return text; + } +} + +/** + * RSA加密 + * @param {BufferLike} data + * @param {string?} publicKey + * @returns {string} hex + */ +function cryptoRSAEncrypt(data, publicKey) { + const isLite = process.env.platform === 'lite'; + const buffer = normalizeBuffer(data); + const pem = publicKey || (isLite ? publicLiteRasKey : publicRasKey); + const key = getForgePublicKey(pem); + const keyLength = Math.ceil(key.n.bitLength() / 8); + + if (buffer.length > keyLength) throw new Error('Data length exceeds key size'); + let padded = buffer; + if (buffer.length < keyLength) { + padded = new Uint8Array(keyLength); + padded.set(buffer); + } + + return rsaRawEncrypt(padded, key); +} + +function rsaEncrypt2(data) { + const isLite = process.env.platform === 'lite'; + const buffer = normalizeBuffer(data); + const key = getForgePublicKey(isLite ? publicLiteRasKey : publicRasKey); + const encrypted = key.encrypt(bufferToBinaryString(buffer), 'RSAES-PKCS1-V1_5'); + return forge.util.bytesToHex(encrypted); +} + +function playlistAesEncrypt(data) { + const useData = typeof data === 'object' ? JSON.stringify(data) : data; + const key = randomString(6).toLowerCase(); + const encryptKey = cryptoMd5(key).substring(0, 16); + const iv = cryptoMd5(key).substring(16, 32); + + const encrypted = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(useData), utf8WordArray(encryptKey), { + iv: utf8WordArray(iv), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + + return { key, str: CryptoJS.enc.Base64.stringify(encrypted.ciphertext) }; +} + +function playlistAesDecrypt(data) { + const encryptKey = cryptoMd5(data.key).substring(0, 16); + const iv = cryptoMd5(data.key).substring(16, 32); + + const cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Base64.parse(data.str) }); + const decrypted = CryptoJS.AES.decrypt(cipherParams, utf8WordArray(encryptKey), { + iv: utf8WordArray(iv), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + + const text = decodeUtf8(wordArrayToBuffer(decrypted)); + try { + return JSON.parse(text); + } catch (e) { + return text; + } +} + +module.exports = { + cryptoAesDecrypt, + cryptoAesEncrypt, + cryptoMd5, + cryptoRSAEncrypt, + rsaEncrypt2, + cryptoSha1, + playlistAesEncrypt, + playlistAesDecrypt, + publicLiteRasKey, + publicRasKey, + wordArrayFromBuffer, +}; diff --git a/third_party/MoeKoeMusic/api/util/generate_simulate.js b/third_party/MoeKoeMusic/api/util/generate_simulate.js new file mode 100644 index 0000000..1a5e157 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/generate_simulate.js @@ -0,0 +1,351 @@ +/** + * @fileoverview 酷狗音乐 API 行为指纹模拟生成器(Node.js 版) + * + * 本模块用于在服务端生成模拟的用户行为指纹数据,替代浏览器端 WASM 的功能。 + * 主要用于自动化请求场景(如批量登录、接口调用等),绕过酷狗的行为检测机制。 + * + * 核心功能: + * 1. 生成模拟的鼠标移动轨迹(贝塞尔曲线 + 随机抖动) + * 2. 生成模拟的页面交互事件(滚动、窗口 resize 等) + * 3. 使用 AES-128-CBC 加密行为数据得到 EDT(Encrypted Data Token) + * 4. 使用 RSA-OAEP SHA-256 加密 AES 密钥得到 SID(Session ID) + * 5. 服务端用 RSA 私钥解密 SID 得到 AES 密钥,再用 AES 密钥解密 EDT 还原行为数据 + * + * 加密方案: + * 明文(行为数据)→ AES-128-CBC 加密 → EDT(Base64) + * AES 密钥 → RSA-OAEP SHA-256 加密 → SID(Base64) + * + * @module generate_simulate + * @requires crypto-js - AES 加密库 + * @requires node-forge - RSA 加密库 + * @requires ./util - 工具函数(randomString) + */ + +const { randomString } = require('./util'); + +const CryptoJS = require('crypto-js'); +const forge = require('node-forge'); + +/** + * RSA 公钥(PEM 格式) + * 从酷狗 WASM 二进制中提取的 SPKI 公钥,用于 RSA-OAEP SHA-256 加密 AES 密钥 + * 算法: RSA-2048,公钥指数 65537 (0x10001) + * + * 服务端持有对应的私钥,用于解密 SID 获取 AES 密钥 + */ +const publicKey = `-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoW2+Ylo8ALePSQTP0xBF\nlFmEOHvBD9tS+s7DBlfKEu3RzzvZTaX1JtYbX4+AVUqj6ARz8IM+CKByqGFvbHN/\nW64XxNI+q7z36ajCL3VTJ2W5G9MCJitc6oGbire4NQfhaEq0nC+hxBWQvCbIFflA\n2ItrLUbSU7z1bHA/a+jlQm4OWvY+IKnTryOJTPuT1yNOVjbJ8wBLKy2DgQr9pPqW\nPmEQtGpR5IM9V8Kao6PaSdKYOWGbX3i2+RzIKhvZUxxtJwdVbqPlDPlW9h4/xIBc\n56Lgvr4aIl8nFtwbj4UJVUTFuGrs0tY9H/tXvZ22dUCKuGxW/gW7ZF+gXz6vHtYa\nrQIDAQAB\n-----END PUBLIC KEY-----`; + +/** + * AES 初始化向量(固定值) + * ASCII 解码为 "kugousecurity123" + * 与浏览器端 WASM 中硬编码的 IV 一致,每次加密都使用相同的 IV + * @type {string} + */ +const iv = 'kugousecurity123'; + +/** + * 哨兵值(接近 0xFFFFFFFF 的随机值) + * WASM 中每条事件记录后都会跟一条哨兵记录,用于标记事件结束或表示"无数据" + * 每次调用 generateSimulate 时会重新生成,增加指纹随机性 + * @type {number} + */ +let SENTINEL = 0xffffffff - Math.floor(Math.random() * 20); + +/** + * 生成 EDT 中的 data 字段(用户行为指纹数据) + * + * 模拟真实用户在页面上的交互行为,包括: + * - 窗口加载/resize 事件(type 6) + * - 页面滚动事件(type 5) + * - 鼠标移动轨迹(type 3,贝塞尔曲线生成) + * + * 事件编码格式:各条目用冒号 `:` 分隔,每个条目的字段用逗号 `,` 分隔 + * - type-3(鼠标移动): "3,时间差,子索引,X,Y" + * - type-5(滚动/计时): "5,时间差,事件索引" + * - type-6(窗口事件): "6,时间差,事件索引,宽,高" + * - 哨兵记录: 时间差字段替换为 SENTINEL 值 + * + * @param {Object} opts - 配置项 + * @param {number} opts.startX - 鼠标起点 X 坐标 + * @param {number} opts.startY - 鼠标起点 Y 坐标 + * @param {number} opts.endX - 鼠标终点 X 坐标 + * @param {number} opts.endY - 鼠标终点 Y 坐标 + * @param {number} opts.mousePoints - 鼠标轨迹采样点数 + * @returns {string} 编码后的 data 字段字符串,各事件条目用 `:` 分隔 + */ +function generateEDTData(opts) { + const { startX, startY, endX, endY, mousePoints } = opts; + const entries = []; // 所有事件条目 + let ts = 0; // 累计时间戳(毫秒),从 0 开始递增 + let ei = 0; // 全局事件索引(用于 type-5/6 事件的标识) + + // --- 初始化: 两个 type-5 零事件 --- + // 模拟 WASM 启动时记录的初始事件,每个事件后跟一条哨兵记录 + entries.push(f5(0, 0)); + entries.push(fs5(0)); + entries.push(f5(0, 0)); + entries.push(fs5(0)); + + // --- 窗口事件 (type 6) --- + // 模拟窗口加载/resize 事件,窗口尺寸设为 750x500(模拟移动端页面) + ts += ri(5, 20); // 随机延迟 5-20ms(模拟页面加载耗时) + entries.push(f6(ts, ei, 750, 500)); // 窗口事件记录 + entries.push(fs6(ei, 750, 500)); // 对应的哨兵记录 + ei++; + + // --- 滚动事件 (type 5) --- + // 模拟用户滚动页面的行为(3 次滚动,间隔不均匀) + for (let i = 0; i < 3; i++) { + ts += ri(80, 600); // 滚动间隔 80-600ms(模拟不均匀的滚动节奏) + entries.push(f5(ts, ei)); + entries.push(fs5(ei)); + ei++; + } + + // --- 鼠标轨迹 (type 3) --- + // 用三阶贝塞尔曲线生成平滑的鼠标移动路径 + const path = bezierPath(startX, startY, endX, endY, mousePoints); + let si = 0; // 子索引(0 或 1,交替变化) + for (let i = 0; i < path.length; i++) { + const { x, y } = path[i]; + ts += ri(8, 50); // 鼠标移动间隔 8-50ms + entries.push(f3(ts, si, Math.round(x), Math.round(y))); + entries.push(fs3(si, Math.round(x), Math.round(y))); + + // 每隔 12 帧插入一个滚动事件,模拟边滚动边移动鼠标的真实行为 + if (i > 0 && i % 12 === 0) { + ts += ri(20, 60); + entries.push(f5(ts, ei)); + entries.push(fs5(ei)); + ei++; + } + si = (si + 1) % 2; // 子索引在 0 和 1 之间交替 + } + + // --- 结束事件 --- + // 最后一个鼠标位置,带微小随机偏移(模拟点击前的微调) + ts += ri(5, 30); + entries.push(f3(ts, 1, Math.round(endX + ri(-5, 5)), Math.round(endY + ri(-5, 5)))); + entries.push(fs3(1, Math.round(endX), Math.round(endY))); + + return entries.join(':'); +} + +// ============================================================ +// 贝塞尔曲线鼠标路径生成 +// ============================================================ + +/** + * 用三阶贝塞尔曲线生成模拟真人的鼠标移动路径 + * + * 真人鼠标轨迹特点: + * - 不是直线,有弧度和加速减速 + * - 有微小抖动(手抖),起步时抖动大,移动后趋于稳定 + * - 起步慢、中间快、结束减速(由贝塞尔曲线的参数 t 均匀采样自然实现) + * + * 三阶贝塞尔公式: B(t) = (1-t)³·P0 + 3(1-t)²t·P1 + 3(1-t)t²·P2 + t³·P3 + * 其中 P0=起点, P3=终点, P1/P2=两个随机控制点 + * + * @param {number} sx - 起点 X + * @param {number} sy - 起点 Y + * @param {number} ex - 终点 X + * @param {number} ey - 终点 Y + * @param {number} n - 采样点数(越多轨迹越平滑) + * @returns {Array<{x:number, y:number}>} 路径点数组,长度为 n+1 + */ +function bezierPath(sx, sy, ex, ey, n) { + // 生成两个随机控制点,使路径不是直线而是有弧度的曲线 + // 控制点在起点到终点的连线附近随机偏移 + const c1x = sx + (ex - sx) * 0.3 + ri(-80, 80); // 第一个控制点 X(起点 30% 处 + 随机偏移) + const c1y = sy + (ey - sy) * 0.2 + ri(-60, 60); // 第一个控制点 Y(起点 20% 处 + 随机偏移) + const c2x = sx + (ex - sx) * 0.7 + ri(-60, 60); // 第二个控制点 X(起点 70% 处 + 随机偏移) + const c2y = sy + (ey - sy) * 0.8 + ri(-40, 40); // 第二个控制点 Y(起点 80% 处 + 随机偏移) + + const pts = []; + for (let i = 0; i <= n; i++) { + const t = i / n; // 参数 t 从 0 到 1,均匀采样 + const u = 1 - t; // 1 - t,用于公式简化 + + // 三阶贝塞尔公式展开计算 + const x = u * u * u * sx + 3 * u * u * t * c1x + 3 * u * t * t * c2x + t * t * t * ex; + const y = u * u * u * sy + 3 * u * u * t * c1y + 3 * u * t * t * c2y + t * t * t * ey; + + // 抖动幅度: 起点大(3px),逐渐减小到 0.5px(模拟起步时手抖,移动后趋于稳定) + const jitter = Math.max(0.5, 3 - t * 2.5); + pts.push({ + x: x + (Math.random() - 0.5) * jitter, // X 方向随机抖动 + y: y + (Math.random() - 0.5) * jitter, // Y 方向随机抖动 + }); + } + return pts; +} + +// ============================================================ +// 事件记录格式化函数 +// ============================================================ + +/** + * 格式化 type-3 事件(鼠标/触摸移动) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 子索引(0 或 1,交替变化) + * @param {number} x - 鼠标 X 坐标 + * @param {number} y - 鼠标 Y 坐标 + * @returns {string} 格式: "3,时间差,子索引,X,Y" + */ +function f3(t, i, x, y) { + return `3,${t},${i},${x},${y}`; +} + +/** + * 格式化 type-5 事件(滚动/计时) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 事件索引 + * @returns {string} 格式: "5,时间差,事件索引" + */ +function f5(t, i) { + return `5,${t},${i}`; +} + +/** + * 格式化 type-6 事件(窗口事件) + * @param {number} t - 时间差(毫秒) + * @param {number} i - 事件索引 + * @param {number} x - 窗口宽度 + * @param {number} y - 窗口高度 + * @returns {string} 格式: "6,时间差,事件索引,宽,高" + */ +function f6(t, i, x, y) { + return `6,${t},${i},${x},${y}`; +} + +/** + * 格式化 type-3 哨兵记录(鼠标事件结束标记) + * 哨兵记录的时间差字段使用 SENTINEL 值,标记该类型事件序列的结束 + * @param {number} i - 子索引 + * @param {number} x - X 坐标 + * @param {number} y - Y 坐标 + * @returns {string} 格式: "3,SENTINEL,子索引,X,Y" + */ +function fs3(i, x, y) { + return `3,${SENTINEL},${i},${x},${y}`; +} + +/** + * 格式化 type-5 哨兵记录(滚动事件结束标记) + * @param {number} i - 事件索引 + * @returns {string} 格式: "5,SENTINEL,事件索引" + */ +function fs5(i) { + return `5,${SENTINEL},${i}`; +} + +/** + * 格式化 type-6 哨兵记录(窗口事件结束标记) + * @param {number} i - 事件索引 + * @param {number} x - 窗口宽度 + * @param {number} y - 窗口高度 + * @returns {string} 格式: "6,SENTINEL,事件索引,宽,高" + */ +function fs6(i, x, y) { + return `6,${SENTINEL},${i},${x},${y}`; +} + +/** + * 生成 [min, max] 范围内的随机整数(包含两端) + * @param {number} min - 最小值 + * @param {number} max - 最大值 + * @returns {number} 随机整数 + */ +function ri(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; +} + +// ============================================================ +// 核心导出函数 +// ============================================================ + +/** + * 生成模拟的 sid 和 edt 加密数据 + * + * 完整流程: + * 1. 生成随机 AES-128 密钥(16 字节,取 MD5 哈希的前 16 字符) + * 2. 随机化鼠标轨迹参数(起点、终点、采样点数) + * 3. 生成模拟行为数据(鼠标轨迹 + 滚动 + 窗口事件) + * 4. 拼接完整明文: mid=xxx;userid=xxx;dfid=xxx;webgl=xxx;webdriver=0;ts=xxx;data=xxx + * 5. AES-128-CBC 加密明文 → EDT(Base64) + * 6. RSA-OAEP SHA-256 加密 AES 密钥 → SID(Base64) + * + * @param {string|number} mid - 设备 MID 标识,不存在时默认 0 + * @param {string|number} userid - 用户 ID,不存在时默认 0 + * @param {string|number} dfid - 设备指纹 ID(由 register_dev 接口返回),不存在时默认 0 + * @param {string} [webglHash] - WebGL 指纹哈希,不传时自动生成 + * @returns {{ edt: string, sid: string }} 加密后的数据对象 + * - edt: AES-128-CBC 加密后的行为数据(Base64) + * - sid: RSA-OAEP 加密后的 AES 密钥(Base64) + */ +const generateSimulate = (mid, userid, dfid, webglHash) => { + // 每次调用重新生成哨兵值,增加指纹随机性 + SENTINEL = 0xffffffff - Math.floor(Math.random() * 20); + + // 生成随机 AES-128 密钥:先生成 16 字节随机字符串,取其 MD5 哈希的前 16 字符 + const key = CryptoJS.MD5(randomString(16)).toString(CryptoJS.enc.Hex).substring(0, 16); + + // 随机化鼠标轨迹参数,使每次请求的行为指纹不同 + const points = ri(30, 60); // 鼠标轨迹采样点数(30~60 个点) + const startX = ri(200, 600); // 鼠标起点 X(页面中部区域) + const startY = ri(200, 500); // 鼠标起点 Y + const endX = ri(500, 700); // 鼠标终点 X(登录按钮附近) + const endY = ri(80, 150); // 鼠标终点 Y + + // 参数默认值处理 + mid = mid || 0; + userid = userid || 0; + dfid = dfid || 0; + webglHash = webglHash || generateWebGLHash(); + const ts = Date.now(); // 当前时间戳 + + // 生成行为数据(鼠标轨迹 + 滚动 + 窗口事件) + const data = generateEDTData({ startX, startY, endX, endY, mousePoints: points }); + + // 拼接完整明文 + // 格式: mid=xxx;userid=xxx;dfid=xxx;webgl=xxx;webdriver=0;ts=xxx;data=xxx + // - mid: 设备标识 + // - userid: 用户 ID + // - dfid: 设备指纹 ID + // - webgl: WebGL 渲染器指纹哈希 + // - webdriver: 是否为自动化驱动(0 表示否) + // - ts: 时间戳 + // - data: 行为事件数据 + const sidPlaintext = `mid=${mid};userid=${userid};dfid=${dfid};webgl=${webglHash};webdriver=0;ts=${ts};data=${data}`; + + console.log(sidPlaintext); + + // 第1步: AES-128-CBC 加密行为指纹明文 → EDT + // - 密钥: 随机生成的 16 字符字符串 + // - IV: 固定值 "kugousecurity123" + // - 填充: PKCS7 + // - 输出: Base64 编码的密文 + const edtData = CryptoJS.AES.encrypt(sidPlaintext, CryptoJS.enc.Utf8.parse(key), { + iv: CryptoJS.enc.Utf8.parse(iv), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }).toString(); + + // 第2步: RSA-OAEP SHA-256 加密 AES 密钥 → SID + // - 使用酷狗服务器的 RSA 公钥加密 AES 密钥 + // - 哈希算法: SHA-256 + // - MGF1 哈希: SHA-256(与主哈希一致) + // - 输出: Base64 编码的密文 + const rsaKey = forge.pki.publicKeyFromPem(publicKey); + + const encrypted = rsaKey.encrypt(key, 'RSA-OAEP', { + md: forge.md.sha256.create(), // 主哈希算法 + mgf1: { md: forge.md.sha256.create() }, // MGF1 掩码生成函数的哈希算法 + }); + const ciphertext = forge.util.encode64(encrypted); // Base64 编码 + + // 返回 EDT(加密的行为数据)和 SID(加密的 AES 密钥) + return { edt: edtData, sid: ciphertext }; +}; + +module.exports = { generateSimulate }; diff --git a/third_party/MoeKoeMusic/api/util/helper.js b/third_party/MoeKoeMusic/api/util/helper.js new file mode 100644 index 0000000..5299df7 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/helper.js @@ -0,0 +1,188 @@ +/** + * @fileoverview 酷狗音乐 API 请求签名工具 + * + * 本模块提供多种签名算法,用于对 API 请求参数进行加密签名, + * 确保请求的合法性和防篡改。酷狗服务端会验证这些签名。 + * + * 签名类型: + * - signatureWebParams: Web 版 API 请求签名 + * - signatureAndroidParams: Android 版 API 请求签名(支持标准版/概念版 lite) + * - signatureRegisterParams: 设备注册接口签名 + * - signParams: 通用 sign 签名 + * - signKey: 请求密钥签名(区分平台) + * - signCloudKey: 云盘接口密钥签名 + * - signParamsKey: 参数密钥签名(区分平台) + * + * 所有签名算法均基于 MD5 哈希,通过将盐值(salt)+ 参数拼接后取 MD5 实现。 + * + * @module helper + * @requires ./crypto - MD5 加密函数 + * @requires ./config.json - 平台配置(appid、clientver 等) + */ + +const CryptoJS = require('crypto-js'); +const { cryptoMd5, wordArrayFromBuffer } = require('./crypto'); +const { appid: useAppid, liteAppid, clientver: useClientver, liteClientver } = require('./config.json'); + +/** + * Web 版 API 请求 signature 签名 + * + * 签名算法: + * 1. 将所有参数按 key=value 格式拼接 + * 2. 对参数字符串按字母顺序排序 + * 3. 拼接为: 盐值 + 排序后的参数串 + 盐值 + * 4. 对整体取 MD5 哈希 + * + * @param {Object} params - 请求参数键值对 + * @returns {string} MD5 签名字符串(32位小写hex) + */ +const signatureWebParams = (params) => { + const str = 'NVPh5oo715z5DIWAeQlhMDsWXXQV4hwt'; // Web 版签名盐值 + const paramsString = Object.keys(params) + .map((key) => `${key}=${params[key]}`) + .sort() // 按 key 字母排序 + .join(''); // 拼接为连续字符串 + return cryptoMd5(`${str}${paramsString}${str}`); +}; + +/** + * Android 版 API 请求 signature 签名 + * + * 与 Web 版的区别: + * - 盐值不同,且区分标准版和概念版(lite) + * - 支持附加请求体数据(data 参数)到签名中 + * - 参数值为对象时会先 JSON.stringify + * + * @param {Object} params - 请求参数键值对 + * @param {string} [data] - 可选的请求体数据(如 POST body) + * @returns {string} MD5 签名字符串 + */ +const signatureAndroidParams = (params, data) => { + const isLite = process.env.platform === 'lite'; + const str = isLite ? 'LnT6xpN3khm36zse0QzvmgTZ3waWdRSA' : `OIlwieks28dk2k092lksi2UIkp`; + const paramsString = Object.keys(params) + .sort() + .map((key) => `${key}=${typeof params[key] === 'object' ? JSON.stringify(params[key]) : params[key]}`) + .join(''); + + if (Buffer.isBuffer(data)) { + const hasher = CryptoJS.algo.MD5.create(); + hasher.update(CryptoJS.enc.Utf8.parse(str)); + hasher.update(CryptoJS.enc.Utf8.parse(paramsString)); + hasher.update(wordArrayFromBuffer(data)); + hasher.update(CryptoJS.enc.Utf8.parse(str)); + return hasher.finalize().toString(CryptoJS.enc.Hex); + } + + return cryptoMd5(`${str}${paramsString}${data || ''}${str}`); +}; + +/** + * 设备注册接口(register_dev)signature 签名 + * + * 签名算法: + * 1. 提取所有参数的值(忽略 key) + * 2. 对值按字母排序 + * 3. 拼接为: "1014" + 排序后的值串 + "1014" + * 4. 对整体取 MD5 哈希 + * + * @param {Object} params - 请求参数键值对 + * @returns {string} MD5 签名字符串 + */ +const signatureRegisterParams = (params) => { + const paramsString = Object.keys(params) + .map((key) => params[key]) // 只取值,忽略 key + .sort() + .join(''); + return cryptoMd5(`1014${paramsString}1014`); // 盐值为 "1014" +}; + +/** + * 通用 sign 签名 + * + * 签名算法: + * 1. 参数按 key 排序 + * 2. 每个参数拼接为 key+value(无等号) + * 3. 拼接为: 排序后的参数串 + 请求体数据 + 盐值 + * 4. 对整体取 MD5 哈希 + * + * @param {Object} params - 请求参数键值对 + * @param {string} [data] - 可选的请求体数据 + * @returns {string} MD5 签名字符串 + */ +const signParams = (params, data) => { + const str = 'R6snCXJgbCaj9WFRJKefTMIFp0ey6Gza'; // 签名盐值 + const paramsString = Object.keys(params) + .sort() + .map((key) => `${key}${params[key]}`) // key+value 无等号 + .join(''); + return cryptoMd5(`${paramsString}${data || ''}${str}`); +}; + +/** + * 请求密钥签名(signKey) + * + * 用于生成请求的 signKey 参数,区分标准版和概念版。 + * 签名算法:MD5(hash + 盐值 + appid + mid + userid) + * + * @param {string} hash - 请求哈希值 + * @param {string} mid - 设备 MID 标识 + * @param {(string|number)} [userid] - 用户 ID,默认 0 + * @param {(string|number)} [appid] - 应用 ID,默认使用配置文件中的值 + * @returns {string} MD5 签名字符串 + */ +const signKey = (hash, mid, userid, appid) => { + const isLite = process.env.platform === 'lite'; + // 标准版和概念版使用不同的盐值 + const str = isLite ? '185672dd44712f60bb1736df5a377e82' : '57ae12eb6890223e355ccfcb74edf70d'; + return cryptoMd5(`${hash}${str}${appid || useAppid}${mid}${userid || 0}`); +}; + +/** + * 云盘接口密钥签名(signCloudKey) + * + * 用于云盘相关接口的签名验证。 + * 签名算法:MD5("musicclound" + hash + pid + 盐值) + * + * @param {string} hash - 请求哈希值 + * @param {string} pid - 云盘资源 PID + * @returns {string} MD5 签名字符串 + */ +const signCloudKey = (hash, pid) => { + const str = 'ebd1ac3134c880bda6a2194537843caa0162e2e7'; // 云盘签名盐值 + return cryptoMd5(`musicclound${hash}${pid}${str}`); +}; + +/** + * 参数密钥签名(signParamsKey) + * + * 用于生成 sign 参数,区分标准版和概念版。 + * 签名算法:MD5(appid + 盐值 + clientver + data) + * + * @param {string|number} data - 签名数据(通常为请求哈希或时间戳) + * @param {(string|number)} [appid] - 应用 ID,默认使用配置文件中的值 + * @param {(string|number)} [clientver] - 客户端版本号,默认使用配置文件中的值 + * @returns {string} MD5 签名字符串 + */ +const signParamsKey = (data, appid, clientver) => { + const isLite = process.env.platform === 'lite'; + // 标准版和概念版使用不同的盐值 + const str = isLite ? 'LnT6xpN3khm36zse0QzvmgTZ3waWdRSA' : 'OIlwieks28dk2k092lksi2UIkp'; + + // 根据平台选择默认的 appid + appid = appid || (isLite ? liteAppid : useAppid); + // 根据平台选择默认的 clientver + clientver = clientver || (isLite ? liteClientver : useClientver); + + return cryptoMd5(`${appid}${str}${clientver}${data}`); +}; + +module.exports = { + signKey, + signParams, + signParamsKey, + signCloudKey, + signatureAndroidParams, + signatureRegisterParams, + signatureWebParams, +}; diff --git a/third_party/MoeKoeMusic/api/util/index.js b/third_party/MoeKoeMusic/api/util/index.js new file mode 100644 index 0000000..2931e5e --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/index.js @@ -0,0 +1,99 @@ +/** + * @fileoverview 工具模块统一导出入口 + * + * 本文件是 util 目录的索引模块,负责: + * 1. 从各子模块导入所有工具函数和常量 + * 2. 根据当前平台(标准版/概念版 lite)选择对应的配置值 + * 3. 统一导出供 API 模块使用 + * + * API 模块(module/ 目录下的文件)通过 `require('../util')` 引用本文件, + * 即可获得所有需要的工具函数和配置常量。 + * + * @module util/index + */ + +// ========== 配置常量 ========== +const { apiver, appid, wx_appid, wx_lite_appid, wx_secret, wx_lite_secret, srcappid, clientver, liteAppid, liteClientver } = require('./config.json'); + +// ========== 加密函数 ========== +const { + cryptoAesDecrypt, // AES 解密 + cryptoAesEncrypt, // AES 加密 + cryptoMd5, // MD5 哈希 + cryptoRSAEncrypt, // RSA 加密 + cryptoSha1, // SHA1 哈希 + rsaEncrypt2, // RSA 加密 v2(用于 register_dev 等接口) + playlistAesEncrypt, // 歌单 AES 加密 + playlistAesDecrypt, // 歌单 AES 解密 + publicLiteRasKey, // 概念版 RSA 公钥 + publicRasKey, // 标准版 RSA 公钥 +} = require('./crypto'); + +// ========== 请求函数 ========== +const { createRequest } = require('./request'); + +// ========== 签名函数 ========== +const { signKey, signParams, signParamsKey, signCloudKey, signatureAndroidParams, signatureRegisterParams, signatureWebParams } = require('./helper'); + +// ========== 工具函数 ========== +const { randomString, decodeLyrics, parseCookieString, cookieToJson, randomNumber, calculateMid, isUUIDv4 } = require('./util'); + +// ========== 平台判断 ========== +// 根据环境变量 platform 判断当前是否为概念版(lite) +const isLite = process.env.platform === 'lite'; +// 根据平台选择对应的 appid 和 clientver +const useAppid = isLite ? liteAppid : appid; +const useClientver = isLite ? liteClientver : clientver; + +/** + * 统一导出所有工具函数和配置常量 + * + * API 模块通过 `const { xxx } = require('../util')` 按需引入。 + */ +module.exports = { + // --- 配置常量 --- + apiver, // API 版本号 + appid: useAppid, // 应用 ID(根据平台自动选择) + // liteAppid, // 概念版应用 ID(注释掉,不对外暴露) + // liteClientver, // 概念版客户端版本号(注释掉,不对外暴露) + wx_appid, // 微信小程序应用 ID + wx_lite_appid, // 微信概念版小程序应用 ID + wx_secret, // 微信小程序密钥 + wx_lite_secret, // 微信概念版小程序密钥 + srcappid, // 来源应用 ID + clientver: useClientver, // 客户端版本号(根据平台自动选择) + isLite, // 是否为概念版 + + // --- 加密函数 --- + cryptoAesDecrypt, // AES 解密 + cryptoAesEncrypt, // AES 加密 + cryptoMd5, // MD5 哈希 + cryptoRSAEncrypt, // RSA 加密 + cryptoSha1, // SHA1 哈希 + rsaEncrypt2, // RSA 加密 v2 + playlistAesEncrypt, // 歌单 AES 加密 + playlistAesDecrypt, // 歌单 AES 解密 + + // --- 请求函数 --- + createRequest, // 创建 HTTP 请求 + + // --- 签名函数 --- + signKey, // 请求密钥签名 + signParams, // 通用 sign 签名 + signParamsKey, // 参数密钥签名 + signCloudKey, // 云盘接口密钥签名 + signatureAndroidParams, // Android 版 signature 签名 + signatureRegisterParams, // 设备注册 signature 签名 + signatureWebParams, // Web 版 signature 签名 + + // --- 工具函数 --- + randomString, // 随机字符串生成 + decodeLyrics, // KRC 歌词解码 + parseCookieString, // Cookie 字符串格式化 + cookieToJson, // Cookie 字符串转 JSON + publicLiteRasKey, // 概念版 RSA 公钥 + publicRasKey, // 标准版 RSA 公钥 + randomNumber, // 随机数字字符串生成 + calculateMid, // 设备 MID 计算 + isUUIDv4 // 判断是否为 UUID V4 +}; diff --git a/third_party/MoeKoeMusic/api/util/memory-cache.js b/third_party/MoeKoeMusic/api/util/memory-cache.js new file mode 100644 index 0000000..547c737 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/memory-cache.js @@ -0,0 +1,107 @@ +/** + * @fileoverview 基于内存的缓存实现 + * + * 提供简单的键值对缓存,支持: + * - 按时间自动过期(通过 setTimeout 实现) + * - 过期回调通知 + * - 批量清除 + * + * 作为 apicache 的底层存储引擎使用。 + * + * @module memory-cache + */ + +/** + * MemoryCache 构造函数 + * + * 初始化空的缓存存储和计数器。 + * @constructor + */ +function MemoryCache() { + this.cache = {}; // 缓存数据存储 { key: { value, expire, timeout } } + this.size = 0; // 当前缓存条目数 +} + +/** + * 添加缓存条目 + * + * @param {string} key - 缓存键 + * @param {*} value - 缓存值(任意类型) + * @param {number} time - 过期时间(毫秒) + * @param {function} [timeoutCallback] - 过期时的回调函数 (value, key) => void + * @returns {Object} 创建的缓存条目 { value, expire, timeout } + */ +MemoryCache.prototype.add = function (key, value, time, timeoutCallback) { + const old = this.cache[key]; + const instance = this; + + const entry = { + value, // 缓存的值 + expire: time + Date.now(), // 过期时间戳(毫秒) + timeout: setTimeout(function () { + // 自动过期:删除条目并触发回调 + instance.delete(key); + return timeoutCallback && typeof timeoutCallback === 'function' && timeoutCallback(value, key); + }, time), + }; + + this.cache[key] = entry; + this.size = Object.keys(this.cache).length; + + return entry; +}; + +/** + * 删除缓存条目 + * + * @param {string} key - 缓存键 + * @returns {null} 始终返回 null + */ +MemoryCache.prototype.delete = function (key) { + const entry = this.cache[key]; + if (entry) clearTimeout(entry.timeout); // 清除自动过期定时器 + + delete this.cache[key]; + + this.size = Object.keys(this.cache).length; + + return null; +}; + +/** + * 获取缓存条目(包含元数据) + * + * @param {string} key - 缓存键 + * @returns {Object|undefined} 缓存条目 { value, expire, timeout },不存在返回 undefined + */ +MemoryCache.prototype.get = function (key) { + return this.cache[key]; +}; + +/** + * 获取缓存的值(仅返回 value 部分) + * + * @param {string} key - 缓存键 + * @returns {*} 缓存的值,不存在返回 undefined + */ +MemoryCache.prototype.getValue = function (key) { + const entry = this.get(key); + + return entry && entry.value; +}; + +/** + * 清除所有缓存条目 + * + * 遍历所有键并逐个删除(会清除对应的定时器)。 + * @returns {true} 始终返回 true + */ +MemoryCache.prototype.clear = function () { + Object.keys(this.cache).forEach(function (key) { + this.delete(key); + }, this); + + return true; +}; + +module.exports = MemoryCache; diff --git a/third_party/MoeKoeMusic/api/util/request.js b/third_party/MoeKoeMusic/api/util/request.js new file mode 100644 index 0000000..62c35dc --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/request.js @@ -0,0 +1,245 @@ +/** + * @fileoverview 酷狗音乐 API HTTP 请求封装 + * + * 本模块是所有 API 请求的底层发送函数,负责: + * 1. 构建请求参数(注入默认设备标识、时间戳等) + * 2. 根据加密类型生成请求签名(signature/sign) + * 3. 配置请求头(User-Agent、设备信息、IP 等) + * 4. 发送 HTTP 请求(通过 axios) + * 5. 处理响应(解析 Cookie、SSA 验证码、错误处理) + * 6. 在需要二次验证时自动生成模拟行为指纹(sid/edt) + * + * 所有 API 模块(module/ 目录)通过 `useAxios(config)` 调用本函数发送请求。 + * + * @module request + * @requires axios - HTTP 客户端 + * @requires ./helper - 签名函数 + * @requires ./util - 工具函数(parseCookieString) + * @requires ./config.json - 平台配置 + * @requires ./runtime - 代理配置解析 + * @requires ./generate_simulate - 行为指纹模拟生成 + */ + +const axios = require('axios'); +const { signKey, signatureAndroidParams, signatureRegisterParams, signatureWebParams } = require('./helper'); +const { parseCookieString } = require('./util'); +const { appid, clientver, liteAppid, liteClientver } = require('./config.json'); +const { resolveProxy } = require('./runtime'); +const { generateSimulate } = require('./generate_simulate'); + +/** + * @typedef {Object} UseAxiosResponse + * @description API 请求的统一响应格式 + * @property {number} status - HTTP 状态码(200=成功,502=失败) + * @property {any} body - 响应体(JSON 对象或原始数据) + * @property {string[]} cookie - 响应中的 Set-Cookie 数组(已格式化) + * @property {Record} [headers] - 响应头(如 ssa-code) + */ + +/** + * 创建并发送 API 请求 + * + * 完整流程: + * 1. 从 cookie 中提取设备标识(dfid、mid、uuid、token、userid) + * 2. 构建默认请求参数(dfid、mid、uuid、appid、clientver、clienttime) + * 3. 根据 encryptType 生成签名(signature) + * 4. 配置请求头(User-Agent、设备信息、IP 透传) + * 5. 配置代理(如果设置了 KUGOU_API_PROXY 环境变量) + * 6. 发送请求并处理响应 + * 7. 如果需要二次验证(SSA),自动生成模拟行为指纹 + * + * @param {Object} options - 请求配置 + * @param {'get'|'GET'|'post'|'POST'} options.method - HTTP 请求方法 + * @param {string} options.url - 请求路径(如 "/v1/search") + * @param {string} [options.baseURL] - 基础 URL(默认 "https://gateway.kugou.com") + * @param {Record} [options.params] - URL 查询参数 + * @param {Record} [options.data] - 请求体(POST 数据) + * @param {Record} [options.headers] - 自定义请求头 + * @param {'android'|'web'|'register'} options.encryptType - 签名加密方式 + * @param {Object} options.cookie - 请求 Cookie 对象 + * @param {boolean} [options.encryptKey] - 是否生成 signKey + * @param {boolean} [options.clearDefaultParams] - 是否清除默认参数 + * @param {boolean} [options.notSignature] - 是否跳过签名 + * @param {string} [options.ip] - 客户端 IP + * @param {string} [options.realIP] - 真实 IP(优先级高于 ip) + * @returns {Promise} 统一格式的响应对象 + */ +const createRequest = (options) => { + return new Promise(async (resolve, reject) => { + const isLite = process.env.platform === 'lite'; + + // ========== 从 Cookie 中提取设备标识 ========== + const dfid = options?.cookie?.dfid || '-'; // 设备指纹 ID(register_dev 接口返回) + const mid = `${options?.cookie?.KUGOU_API_MID}`; // 设备 MID(server.js 通过 calculateMid 生成) + const uuid = '-'; // 设备 UUID(当前固定为 '-') + const token = options?.cookie?.token || ''; // 用户登录令牌 + const userid = options?.cookie?.userid || 0; // 用户 ID + const clienttime = Math.floor(Date.now() / 1000); // 当前时间戳(秒) + const ip = options?.realIP || options?.ip || ''; // 客户端 IP(用于 IP 透传) + const webglHash = options?.cookie?.KUGOU_API_WEBGL; // WebGL 指纹哈希 + + // ========== 构建请求头 ========== + // kg-rc / kg-thash / kg-rec / kg-rf: 酷狗内部标识头,用于服务端识别请求来源 + const headers = { dfid, clienttime, mid, 'kg-rc': '1', 'kg-thash': '5d816a0', 'kg-rec': 1, 'kg-rf': 'B9EDA08A64250DEFFBCADDEE00F8F25F' }; + + // IP 透传:将客户端真实 IP 通过 X-Real-IP / X-Forwarded-For 传递给酷狗服务端 + if (ip) { + headers['X-Real-IP'] = ip; + headers['X-Forwarded-For'] = ip; + } + + // ========== 构建默认请求参数 ========== + // 这些参数会自动注入到每个请求中,模拟真实客户端行为 + const defaultParams = { + dfid, // 设备指纹 ID + mid, // 设备 MID + uuid, // 设备 UUID + appid: isLite ? liteAppid : appid, // 应用 ID(根据平台选择) + clientver: isLite ? liteClientver : clientver, // 客户端版本号(根据平台选择) + clienttime, // 请求时间戳(秒) + }; + + // 如果有登录令牌和用户 ID,也加入默认参数 + if (token) defaultParams['token'] = token; + if (userid && userid !== 0) defaultParams['userid'] = userid; + + // 合并默认参数和自定义参数(clearDefaultParams 为 true 时仅使用自定义参数) + const params = options?.clearDefaultParams ? options?.params || {} : Object.assign({}, defaultParams, options?.params || {}); + + // 同步 clienttime 到请求头 + headers['clienttime'] = params.clienttime; + + // ========== 生成 signKey(可选) ========== + // 某些接口需要额外的 key 参数作为签名验证 + if (options?.encryptKey) { + params['key'] = signKey(params['hash'], params['mid'], params['userid'], params['appid']); + } + + // ========== 序列化请求体 ========== + const data = Buffer.isBuffer(options?.data) ? options.data : typeof options?.data === 'object' ? JSON.stringify(options.data) : options?.data || ''; + + // ========== 生成请求签名 ========== + // 根据 encryptType 选择不同的签名算法 + // - android: Android 版签名(默认,最常用) + // - web: Web 版签名 + // - register: 设备注册签名 + if (!params['signature'] && !options.notSignature) { + switch (options?.encryptType) { + case 'register': + params['signature'] = signatureRegisterParams(params); + break; + case 'web': + params['signature'] = signatureWebParams(params); + break; + case 'android': + default: + params['signature'] = signatureAndroidParams(params, data); + break; + } + } + + // ========== 配置请求选项 ========== + options['params'] = params; + options['baseURL'] = options?.baseURL || 'https://gateway.kugou.com'; // 默认网关地址 + options['headers'] = Object.assign({ 'User-Agent': 'Android15-1070-11083-46-0-DiscoveryDRADProtocol-wifi' }, options?.headers || {}, { + dfid, + clienttime: params.clienttime, + mid, + }); + + const requestOptions = { + params, + data: options?.data, + method: options.method, + baseURL: options?.baseURL, + url: options.url, + headers: Object.assign({}, options?.headers || {}, headers), + withCredentials: true, // 携带 Cookie + responseType: options.responseType, // 响应类型(如 'arraybuffer') + }; + + // ========== 代理配置 ========== + // 如果设置了 KUGOU_API_PROXY 环境变量,使用代理发送请求 + const proxyConfig = resolveProxy(); + if (proxyConfig) { + requestOptions.proxy = proxyConfig; + } + + if (options.data) requestOptions.data = options.data; + if (params) requestOptions.params = params; + + // ========== CDN 接口特殊处理 ========== + // openapicdn 基础 URL 的接口需要将参数拼接到 URL 中 + if (options.baseURL?.includes('openapicdn')) { + const url = requestOptions.url; + const _params = Object.keys(params) + .map((key) => `${key}=${params[key]}`) + .join('&'); + requestOptions.url = `${url}?${_params}`; + requestOptions.params = {}; + } + + // ========== 发送请求 ========== + const answer = { status: 500, body: {}, cookie: [], headers: {} }; + try { + const response = await axios(requestOptions); + + let ssaCode = ''; + + const body = response.data; + + // 解析响应中的 Set-Cookie(格式化为干净的 key=value 字符串) + answer.cookie = (response.headers['set-cookie'] || []).map((x) => parseCookieString(x)); + + // ========== SSA 验证码处理 ========== + // ssa-code 响应头表示需要进行二次安全验证(如滑块验证码、短信验证码) + if (response.headers['ssa-code'] || response.headers['SSA-CODE']) { + const _ssaCode = response.headers['ssa-code'] || response.headers['SSA-CODE']; + answer.headers['ssa-code'] = _ssaCode; + ssaCode = _ssaCode; + } + + // 解析响应体为 JSON + try { + answer.body = JSON.parse(body.toString()); + } catch (error) { + answer.body = body; + } + + // ========== 响应状态判断 ========== + if (response.data.status === 0 || (response.data?.error_code && response.data.error_code !== 0)) { + // 请求失败:status=0 或 error_code 非 0 + answer.status = 502; + + // 如果有 SSA 验证码,生成模拟行为指纹(sid/edt)附加到响应中 + // 客户端拿到 sid/edt 后可以用于后续的验证请求 + if (ssaCode) { + const { edt, sid } = generateSimulate(mid, userid, dfid, webglHash); + if (edt) answer.body.edt = edt; + if (sid) answer.body.sid = sid; + answer.body.ssaCode = ssaCode; + } + reject(answer); + } else { + // 请求成功 + answer.status = 200; + + // 同样在成功时附加 SSA 验证码信息(某些接口成功时也需要二次验证) + if (ssaCode) { + const { edt, sid } = generateSimulate(mid, userid, dfid, webglHash); + if (edt) answer.body.edt = edt; + if (sid) answer.body.sid = sid; + answer.body.ssaCode = ssaCode; + } + resolve(answer); + } + } catch (e) { + // 网络错误或请求异常 + answer.status = 502; + answer.body = { status: 0, msg: e }; + reject(answer); + } + }); +}; + +module.exports = { createRequest }; diff --git a/third_party/MoeKoeMusic/api/util/runtime.js b/third_party/MoeKoeMusic/api/util/runtime.js new file mode 100644 index 0000000..5b8acbd --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/runtime.js @@ -0,0 +1,182 @@ +/** + * @fileoverview 运行时配置工具 + * + * 处理命令行参数解析和运行时环境变量配置,包括: + * - 命令行参数解析(--key=value 格式) + * - CLI 参数覆盖环境变量(proxy、platform、port 等) + * - 代理地址解析与缓存 + * + * @module runtime + * @requires url - URL 解析(用于代理地址解析) + */ + +const { URL } = require('url'); + +/** + * 缓存的代理地址原始字符串(用于避免重复解析) + * @type {string | undefined} + */ +let cachedProxyRaw; + +/** + * 缓存的代理配置对象(AxiosProxyConfig 格式) + * @type {import('axios').AxiosProxyConfig | null} + */ +let cachedProxy; + +/** + * 解析命令行参数 + * + * 仅解析 `--key=value` 格式的参数,忽略其他格式。 + * 解析规则: + * - 必须以 `--` 开头 + * - 必须包含 `=` 分隔符 + * - key 和 value 均不能为空 + * + * @param {string[]} [args] - 参数数组,默认使用 process.argv.slice(2) + * @returns {Record} 解析后的键值对对象 + * + * @example + * // 命令行: node app.js --proxy=http://127.0.0.1:8080 --platform=lite + * parseCliArgs() // => { proxy: 'http://127.0.0.1:8080', platform: 'lite' } + */ +function parseCliArgs(args) { + const source = Array.isArray(args) ? args : process.argv.slice(2); + return source.reduce((acc, rawArg) => { + if (typeof rawArg !== 'string') { + return acc; + } + const arg = rawArg.trim(); + // 必须以 -- 开头 + if (!arg.startsWith('--')) { + return acc; + } + const eqIndex = arg.indexOf('='); + // = 必须在 -- 之后且不在末尾(确保 key 和 value 都存在) + if (eqIndex <= 2 || eqIndex === arg.length - 1) { + return acc; + } + const key = arg.slice(2, eqIndex).trim(); + const value = arg.slice(eqIndex + 1).trim(); + if (!key || !value) return acc; + acc[key] = value; + return acc; + }, {}); +} + +/** + * 应用命令行参数覆盖环境变量 + * + * 支持的 CLI 参数: + * - --proxy: 设置 KUGOU_API_PROXY(代理地址) + * - --platform: 设置 platform(平台类型,如 "lite") + * - --guid: 设置 KUGOU_API_GUID(设备 GUID) + * - --dev: 设置 KUGOU_API_DEV(开发设备标识) + * - --mac: 设置 KUGOU_API_MAC(设备 MAC 地址) + * - --port: 设置 PORT(服务器端口,需为正整数) + * + * @param {string[]} [args] - 参数数组,默认使用 process.argv.slice(2) + */ +function applyCliOverrides(args) { + const parsed = parseCliArgs(args); + + if (parsed.proxy) { + process.env.KUGOU_API_PROXY = parsed.proxy; + } + + if (parsed.platform) { + process.env.platform = parsed.platform; + } + + if (parsed.guid) { + process.env.KUGOU_API_GUID = parsed.guid; + } + + if (parsed.dev) { + process.env.KUGOU_API_DEV = parsed.dev; + } + + if (parsed.mac) { + process.env.KUGOU_API_MAC = parsed.mac; + } + + if (parsed.port) { + const port = Number(parsed.port); + if (!Number.isNaN(port) && port > 0) { + process.env.PORT = String(port); + } else { + console.warn(`[cli] Invalid port value "${parsed.port}", fallback to default.`); + } + } +} + +/** + * 解析代理配置 + * + * 从环境变量 KUGOU_API_PROXY 读取代理地址,解析为 Axios 兼容的代理配置对象。 + * 支持 HTTP/HTTPS 协议,支持带认证信息的代理(user:password@host:port)。 + * + * 解析结果会被缓存,避免每次请求都重复解析。 + * 当环境变量值未变化时直接返回缓存结果。 + * + * @returns {import('axios').AxiosProxyConfig | null} 代理配置对象,无代理时返回 null + * + * @example + * // KUGOU_API_PROXY=http://user:pass@127.0.0.1:8080 + * resolveProxy() + * // => { protocol: 'http', host: '127.0.0.1', port: 8080, auth: { username: 'user', password: 'pass' } } + */ +function resolveProxy() { + const rawProxyEnv = typeof process.env.KUGOU_API_PROXY === 'string' ? process.env.KUGOU_API_PROXY.trim() : undefined; + const rawProxy = rawProxyEnv && rawProxyEnv.length > 0 ? rawProxyEnv : undefined; + + // 无代理配置,清空缓存 + if (!rawProxy) { + cachedProxyRaw = undefined; + cachedProxy = null; + return null; + } + + // 缓存命中,直接返回 + if (cachedProxyRaw === rawProxy) { + return cachedProxy; + } + + // 缓存未命中,重新解析 + cachedProxyRaw = rawProxy; + try { + const parsed = new URL(rawProxy); + + // 仅支持 HTTP/HTTPS 代理协议 + if (!/^https?:$/.test(parsed.protocol)) { + console.warn(`[proxy] Unsupported proxy protocol: ${parsed.protocol}`); + cachedProxy = null; + return null; + } + + // 构建 Axios 代理配置 + const proxyConfig = { + protocol: parsed.protocol.replace(':', ''), // 去掉末尾的冒号 + host: parsed.hostname, + port: parsed.port ? Number(parsed.port) : parsed.protocol === 'https:' ? 443 : 80, // 默认端口 + }; + + // 如果代理地址包含认证信息 + if (parsed.username || parsed.password) { + proxyConfig.auth = { + username: parsed.username, + password: parsed.password, + }; + } + + cachedProxy = proxyConfig; + console.info(`[proxy] Using proxy ${parsed.protocol}//${parsed.host}`); + } catch (error) { + console.warn(`[proxy] Failed to parse proxy address "${rawProxy}": ${error.message}`); + cachedProxy = null; + } + + return cachedProxy; +} + +module.exports = { applyCliOverrides, parseCliArgs, resolveProxy }; diff --git a/third_party/MoeKoeMusic/api/util/util.js b/third_party/MoeKoeMusic/api/util/util.js new file mode 100644 index 0000000..5d3af01 --- /dev/null +++ b/third_party/MoeKoeMusic/api/util/util.js @@ -0,0 +1,310 @@ +/** + * @fileoverview 通用工具函数库 + * + * 提供酷狗音乐 API 项目中常用的工具函数,包括: + * - 随机字符串/数字生成 + * - Cookie 解析与格式化 + * - KRC 歌词解码(XOR 解密 + zlib 解压) + * - 设备 MID 计算(基于 MD5 的大整数转换) + * - GUID 生成(UUID v4 格式) + * - WebGL 指纹哈希生成(浏览器/Node 双环境支持) + * + * @module util + * @requires pako - zlib 解压库(用于 KRC 歌词解码) + * @requires crypto-js - 加密库(用于 MID 计算中的 MD5 哈希) + * @requires big-integer - 大整数库(用于 MID 的进制转换) + */ + +const pako = require('pako'); +const CryptoJS = require('crypto-js'); +const bigInt = require('big-integer'); + +/** + * 生成随机字符串(大写字母 + 数字) + * + * 字符池: 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ(36个字符) + * 每次从字符池中随机选取一个字符,拼接为指定长度的字符串。 + * + * @param {number} [len=16] - 字符串长度,默认 16 + * @returns {string} 随机字符串 + * + * @example + * randomString(8) // => "A3B7K9X2" + */ +const randomString = (len = 16) => { + const keyString = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const _key = []; + const keyStringArr = keyString.split(''); + for (let i = 0; i < len; i += 1) { + const ceil = Math.ceil((keyStringArr.length - 1) * Math.random()); + const _tmp = keyStringArr[ceil]; + _key.push(_tmp); + } + + return _key.join(''); +}; + +/** + * 生成随机数字字符串 + * + * 字符池: 1234567890(10个数字字符) + * 每次从字符池中随机选取一个数字字符,拼接为指定长度的字符串。 + * + * @param {number} [len=16] - 字符串长度,默认 16 + * @returns {string} 随机数字字符串 + * + * @example + * randomNumber(6) // => "384729" + */ +const randomNumber = (len = 16) => { + const keyString = '1234567890'; + const _key = []; + const keyStringArr = keyString.split(''); + for (let i = 0; i < len; i += 1) { + const ceil = Math.ceil((keyStringArr.length - 1) * Math.random()); + const _tmp = keyStringArr[ceil]; + _key.push(_tmp); + } + + return _key.join(''); +}; + +/** + * 格式化 Cookie 字符串 + * + * 移除 Cookie 中的非数据字段(Domain、path、expires、HttpOnly), + * 仅保留有效的键值对数据。 + * + * @param {string} cookie - 原始 Cookie 字符串 + * @returns {string} 格式化后的 Cookie 字符串 + * + * @example + * parseCookieString('token=abc; Domain=.kugou.com; path=/; HttpOnly') + * // => 'token=abc' + */ +const parseCookieString = (cookie) => { + const t = cookie.replace(/\s*(Domain|domain|path|expires)=[^(;|$)]+;*/g, ''); + return t.replace(/;HttpOnly/g, ''); +}; + +/** + * Cookie 字符串转 JSON 对象 + * + * 将 Cookie 字符串按 `;` 分割,每个键值对按 `=` 分割为 key 和 value。 + * + * @param {string} cookie - Cookie 字符串 + * @returns {Object} Cookie 键值对对象 + * + * @example + * cookieToJson('token=abc; userid=123') + * // => { token: 'abc', userid: '123' } + */ +const cookieToJson = (cookie) => { + if (!cookie) return {}; + let cookieArr = cookie.split(';'); + let obj = {}; + cookieArr.forEach((i) => { + let arr = i.split('='); + obj[arr[0]] = arr[1]; + }); + return obj; +}; + +/** + * KRC 歌词解码 + * + * 酷狗 KRC 歌词文件的解码流程: + * 1. 跳过前 4 字节(文件头标识) + * 2. 剩余字节与固定密钥进行 XOR 异或解密 + * 3. 使用 pako(zlib)解压得到明文歌词 + * + * XOR 密钥(16字节循环使用): + * [64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 105] + * + * @param {string | Uint8Array | Buffer} val - 加密的歌词数据 + * - string: Base64 编码的歌词数据 + * - Uint8Array: 原始字节数组 + * - Buffer: Node.js Buffer + * @returns {string} 解码后的明文歌词,解码失败返回空字符串 + */ +const decodeLyrics = (val) => { + let bytes = null; + if (val instanceof Uint8Array) bytes = val; + if (Buffer.isBuffer(val)) bytes = new Uint8Array(val); + if (typeof val === 'string') bytes = new Uint8Array(Buffer.from(val, 'base64')); + if (bytes === null) return ''; + + // XOR 解密密钥(16字节,循环使用) + const enKey = [64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 105]; + const krcBytes = bytes.slice(4); // 跳过前 4 字节文件头 + const len = krcBytes.byteLength; + + // XOR 异或解密 + for (let index = 0; index < len; index += 1) { + krcBytes[index] = krcBytes[index] ^ enKey[index % enKey.length]; + } + + // zlib 解压 + try { + const inflate = pako.inflate(krcBytes); + return Buffer.from(inflate).toString('utf8'); + } catch { + return ''; + } +}; + +/** + * 计算设备 MID + * + * 将输入字符串(通常是 GUID)进行 MD5 哈希,然后将哈希值作为 16 进制大整数 + * 转换为 10 进制字符串表示。 + * + * 算法: + * 1. 对输入字符串取 MD5 哈希(32位hex) + * 2. 将 hex 字符串视为 16 进制数 + * 3. 逐位累加: sum += digit * 16^(position) + * 4. 返回十进制字符串 + * + * @param {string} str - 输入字符串(通常为设备 GUID) + * @returns {string} MID 的十进制字符串表示 + * + * @example + * calculateMid('550e8400-e29b-41d4-a716-446655440000') + * // => "123456789012345678901234567890" + */ +const calculateMid = (str) => { + let bigInteger = bigInt(0); + const bigInteger2 = bigInt(16); // 进制基数 + const digest = CryptoJS.MD5(str).toString(CryptoJS.enc.Hex); // MD5 哈希 + const length = digest.length; + for (let i = 0; i < length; i += 1) { + const charValue = bigInt(parseInt(digest.charAt(i), 16)); // 当前位的值 + const powerValue = bigInteger2.pow(length - 1 - i); // 16 的幂次 + bigInteger = bigInteger.add(charValue.multiply(powerValue)); // 累加 + } + return bigInteger.toString(); +}; + +/** + * 生成随机 GUID(UUID v4 格式) + * + * 格式: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx + * - 第三段以 4 开头(UUID v4 标识) + * - 第四段以 8/9/a/b 开头(UUID v4 变体标识) + * + * @returns {string} UUID v4 格式的 GUID 字符串 + * + * @example + * getGuid() // => "550e8400-e29b-41d4-a716-446655440000" + */ +const getGuid = () => { + const e = () => { + return ((65536 * (1 + Math.random())) | 0).toString(16).substring(1); + }; + + return `${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`; +}; + +/** + * 生成 WebGL 指纹哈希值 + * + * WebGL 指纹是浏览器指纹的重要组成部分,通过以下信息生成唯一哈希: + * + * 浏览器环境: + * 1. 编译顶点/片段着色器,创建 WebGL 程序 + * 2. 绘制一个三角形并读取像素数据 + * 3. 获取显卡厂商、渲染器名称、WebGL 版本等元数据 + * 4. 使用 FNV-1a 64-bit 哈希算法对像素数据 + 元数据进行哈希 + * + * Node 环境或 WebGL 不可用时: + * 生成随机 uint64 作为模拟指纹 + * + * @returns {string} WebGL 指纹的十进制字符串表示 + */ +const generateWebGLHash = () => { + // 浏览器环境:通过 canvas 获取真实的 WebGL 渲染器信息 + if (typeof document !== 'undefined') { + try { + const c = document.createElement('canvas'); + c.width = 200; + c.height = 50; + const gl = c.getContext('webgl') || c.getContext('experimental-webgl'); + if (gl) { + // --- 编译着色器(和 WASM 中的逻辑一致)--- + const vs = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(vs, 'attribute vec4 position;void main(){gl_Position=position;}'); + gl.compileShader(vs); + const fs = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(fs, 'void main(){gl_FragColor=vec4(1.0,1.0,1.0,1.0);}'); + gl.compileShader(fs); + const prog = gl.createProgram(); + gl.attachShader(prog, vs); + gl.attachShader(prog, fs); + gl.linkProgram(prog); + gl.useProgram(prog); + + // --- 绘制一个三角形 --- + const buf = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buf); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1]), gl.STATIC_DRAW); + const pos = gl.getAttribLocation(prog, 'position'); + gl.enableVertexAttribArray(pos); + gl.vertexAttribPointer(pos, 2, gl.FLOAT, false, 0, 0); + gl.viewport(0, 0, 200, 50); + gl.clearColor(0, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.drawArrays(gl.TRIANGLES, 0, 3); + + // --- 读取渲染结果并哈希 --- + const pixels = new Uint8Array(200 * 50 * 4); + gl.readPixels(0, 0, 200, 50, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + + // 同时加入元数据(显卡厂商、渲染器名称、WebGL 版本) + const dbg = gl.getExtension('WEBGL_debug_renderer_info'); + const vendor = dbg ? gl.getParameter(dbg.UNMASKED_VENDOR_WEBGL) : ''; + const renderer = dbg ? gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) : ''; + const version = gl.getParameter(gl.VERSION); + + // FNV-1a 64-bit 哈希算法 + let h = BigInt('14695981039346656037'); // FNV offset basis + const prime = BigInt('1099511628211'); // FNV prime + + // 哈希像素数据 + for (let i = 0; i < pixels.length; i++) { + h = ((h ^ BigInt(pixels[i])) * prime) & BigInt('0xFFFFFFFFFFFFFFFF'); + } + // 哈希元数据 + const meta = vendor + '|' + renderer + '|' + version; + for (let i = 0; i < meta.length; i++) { + h = ((h ^ BigInt(meta.charCodeAt(i))) * prime) & BigInt('0xFFFFFFFFFFFFFFFF'); + } + return h.toString(); + } + } catch (e) {} + } + // Node 环境或 WebGL 不可用:生成随机 uint64 作为模拟指纹 + const hi = Math.floor(Math.random() * 0xffffffff); + const lo = Math.floor(Math.random() * 0xffffffff); + return (BigInt(hi) * BigInt(0x100000000) + BigInt(lo)).toString(); +}; + +/** + * 判断是否为UUID v4 + * @param {string} str + * @returns { Boolean } + */ +const isUUIDv4 = (str) => { + return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(str); +} + +module.exports = { + decodeLyrics, + cookieToJson, + parseCookieString, + randomString, + randomNumber, + calculateMid, + getGuid, + generateWebGLHash, + isUUIDv4 +}; diff --git a/third_party/MoeKoeMusic/api/vercel.json b/third_party/MoeKoeMusic/api/vercel.json new file mode 100644 index 0000000..40bdd5e --- /dev/null +++ b/third_party/MoeKoeMusic/api/vercel.json @@ -0,0 +1,15 @@ +{ + "version": 2, + "builds": [ + { + "src": "./index.js", + "use": "@vercel/node" + } + ], + "routes": [ + { + "src": "/(.*)", + "dest": "/" + } + ] +} \ No newline at end of file diff --git a/third_party/MoeKoeMusic/api/ymhut-sidecar.js b/third_party/MoeKoeMusic/api/ymhut-sidecar.js new file mode 100644 index 0000000..f92397c --- /dev/null +++ b/third_party/MoeKoeMusic/api/ymhut-sidecar.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +'use strict'; + +const { once } = require('node:events'); +const { consturctServer } = require('./server'); + +const protocolVersion = 1; +const commit = '4581660209c9cdd07669e8bd5bcbe136b7d91e02'; +const token = process.env.YMHUT_INTERNAL_TOKEN; +const parentPid = Number(process.env.YMHUT_PARENT_PID || '0'); + +if (!token || token.length < 32 || !Number.isInteger(parentPid) || parentPid <= 0) { + process.stderr.write('Invalid sidecar bootstrap environment.\n'); + process.exit(2); +} + +async function main() { + const app = await consturctServer(); + const server = app.listen(0, '127.0.0.1'); + await once(server, 'listening'); + const address = server.address(); + if (!address || typeof address === 'string') throw new Error('Loopback listener did not expose a port.'); + + let stopping = false; + const stop = () => { + if (stopping) return; + stopping = true; + clearInterval(parentWatchdog); + server.close(() => process.exit(0)); + setTimeout(() => process.exit(0), 1500).unref(); + }; + + app.once('ymhut-shutdown', stop); + process.once('SIGINT', stop); + process.once('SIGTERM', stop); + + const parentWatchdog = setInterval(() => { + try { + process.kill(parentPid, 0); + } catch { + stop(); + } + }, 2000); + parentWatchdog.unref(); + + process.stdout.write(JSON.stringify({ + type: 'ready', + protocolVersion, + commit, + pid: process.pid, + port: address.port, + }) + '\n'); +} + +main().catch((error) => { + process.stderr.write(`Sidecar startup failed: ${error && error.message ? error.message : 'unknown error'}\n`); + process.exit(1); +}); diff --git a/update-notice/2.0.7.13.json b/update-notice/2.0.7.13.json new file mode 100644 index 0000000..0f5558c --- /dev/null +++ b/update-notice/2.0.7.13.json @@ -0,0 +1,92 @@ +{ + "api_keys": { + "uapipro": "" + }, + "app_version": "2.0.7.13", + "build": "13", + "channel": "stable", + "title": "YMhut Box 2.0.7.13", + "message": "本版本完善网络音乐、工具页面和安装器:酷狗请求改由随包本地 API 承接,登录权益和歌词体验得到增强,每个工具使用独立页面定义,安装协议和按钮状态也更加完整。", + "message_md": "# YMhut Box 2.0.7.13\n\n本版本集中完善网络音乐、独立工具页面和安装器交互,让第三方音乐服务边界、账户状态、歌词显示和工具配置更加清晰可靠。", + "release_notes": "网络音乐的酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接,仅监听随机回环端口并由应用内部访问;登录态使用本机加密快照,减少重复登录和账户风控,账户页面展示平台返回的会员及分组权益;网易云和酷狗共用音质选择、逐字歌词、翻译、罗马音及沉浸歌词体验,歌词只保留文字高亮;每个内置工具、Nex 工具、插件和外部工具宿主使用独立的随包 .dat 页面定义,损坏时回退到安全最小页面;安装器补充完整网络音乐使用须知、第三方许可和免责声明,并完善按钮悬停、按下、禁用及键盘焦点状态。", + "release_notes_md": "## 网络音乐\n\n- 酷狗搜索、歌单、榜单、播放、MV、歌词和账户请求统一经随包 MoeKoeMusic 本地 Sidecar,不再使用客户端公网直连入口。\n- Sidecar 仅监听随机回环端口,并通过应用内部令牌访问;缓存仅用于公共 GET,登录、账户、权益和播放地址不参与共享缓存。\n- 登录态使用本机加密快照,减少重复登录请求;账户页按平台真实结果展示 VIP、音乐包及分组权益。\n- 网易云与酷狗共用来源感知的音质选择、逐字歌词、翻译、罗马音和沉浸歌词;歌词进度只通过文字高亮表达。\n\n## 工具页面\n\n- 每个内置工具、Nex 工具、插件宿主和外部工具宿主使用独立页面定义,不再依赖统一整页模板。\n- 页面定义以只读加密 `.dat` 随包分发;缺失或损坏时回退到安全最小页面,用户输入仍按工具隔离保存。\n\n## 安装器\n\n- 安装协议加入网络音乐完整使用须知、版权声明、MoeKoeMusic 与 KuGouMusicApi 来源和许可证信息。\n- 按钮补齐悬停、按下、禁用和键盘焦点状态,当前步骤与校验结果会同步控制可用性。", + "home_notes": "v2.0.7.13 完善本地音乐 API、账户权益、逐字与沉浸歌词、独立工具页面定义,以及安装器协议和按钮状态。", + "last_update_notes": { + "v2.0.7.12 界面与工具": "上一版本统一 WinUI、音乐、安装器、发布服务和系统工具;本版本继续收敛音乐服务边界并拆分工具页面定义。" + }, + "category_list": [ + { "id": "music", "name": "网络音乐", "icon": "music" }, + { "id": "tools", "name": "工具页面", "icon": "tool" }, + { "id": "installer", "name": "安装器", "icon": "download" }, + { "id": "privacy", "name": "隐私与许可", "icon": "shield" } + ], + "update_notes": { + "网络音乐": "酷狗请求统一经随包本地 API;完善加密登录快照、账户权益、音质选择、逐字歌词和沉浸歌词。", + "工具页面": "每个工具使用独立随包 .dat 页面定义,异常时安全回退并隔离保存用户状态。", + "安装器": "补齐按钮交互与禁用状态,并将网络音乐完整使用须知纳入安装协议。", + "隐私与许可": "明确本地随机端口、缓存、登录风控、版权限制和第三方许可证边界。" + }, + "release_date": "2026-08-17", + "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "force_update": false, + "min_supported_version": "2.0.5", + "download_mirrors": [ + { + "id": "fullInstaller", + "name": "完整安装包", + "type": "exe", + "url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "size": "待发布", + "sizeBytes": 0, + "sha256": "", + "required": false + }, + { + "id": "msix", + "name": "MSIX 安装包", + "type": "msix", + "url": "https://update.ymhut.cn/downloads/YMhutBox_2.0.7.14_x64.msix", + "size": "待发布", + "sizeBytes": 0, + "sha256": "", + "required": false + }, + { + "id": "appInstaller", + "name": "在线安装配置", + "type": "appinstaller", + "url": "https://update.ymhut.cn/winui.appinstaller", + "size": "在线配置", + "sizeBytes": 0, + "sha256": "", + "required": false + } + ], + "detected_product": { + "name": "YMhut Box WinUI", + "version": "2.0.7.13", + "channel": "stable" + }, + "detected_packages": [ + { + "id": "fullInstaller", + "name": "YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "version": "2.0.7.14", + "type": "exe", + "size": "待发布", + "sizeBytes": 0, + "url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "sha256": "" + }, + { + "id": "msix", + "name": "YMhutBox_2.0.7.14_x64.msix", + "version": "2.0.7.14", + "type": "msix", + "size": "待发布", + "sizeBytes": 0, + "url": "https://update.ymhut.cn/downloads/YMhutBox_2.0.7.14_x64.msix", + "sha256": "" + } + ] +} diff --git a/update-notice/2.0.7.14.json b/update-notice/2.0.7.14.json new file mode 100644 index 0000000..e59ab23 --- /dev/null +++ b/update-notice/2.0.7.14.json @@ -0,0 +1,97 @@ +{ + "api_keys": { + "uapipro": "" + }, + "app_version": "2.0.7.14", + "build": "14", + "channel": "stable", + "title": "YMhut Box 2.0.7.14", + "message": "本版本包含 2.0.7.13 的全部网络音乐、独立工具页面和安装器改进,并进一步修复高 DPI 模糊、安装页面滚轮、应用主题不一致、深色文字对比度以及 Windows Terminal 帮助弹窗。", + "message_md": "# YMhut Box 2.0.7.14\n\n本版本完整包含 2.0.7.13 的网络音乐、工具页面和安装器改进,并追加高 DPI、滚动、主题一致性和终端启动体验修复。", + "release_notes": "完整包含 2.0.7.13 的用户可见改进:酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接,登录态使用本机加密快照并展示平台会员权益,网易云与酷狗共用音质、逐字歌词和沉浸歌词,每个工具使用独立随包 .dat 页面定义,安装器补充完整网络音乐协议与按钮状态;安装器和主程序启用 PerMonitorV2 高 DPI 支持,改善 150% 与 200% 缩放清晰度;安装器全部步骤支持滚轮、滚动条和触控平移;应用明确以 Light、Dark 或 System 设置为唯一主题来源,修复系统深色时应用亮色页面混用深色控件的问题,并增强深色模式正文、辅助文字和禁用状态的对比度;终端检测不再执行会触发 Windows Terminal 1.24 Help 弹窗的 wt.exe --version,改为后台读取包元数据,打开失败时静默回退到 PowerShell。", + "release_notes_md": "## 2.0.7.13 完整改进\n\n- 酷狗搜索、歌单、榜单、播放、MV、歌词和账户请求统一经随包 MoeKoeMusic 本地 Sidecar,不再使用客户端公网直连入口。\n- Sidecar 仅监听随机回环端口;登录态使用本机加密快照,减少重复登录和账号风控,账户页展示平台真实会员及分组权益。\n- 网易云与酷狗共用音质选择、逐字歌词、翻译、罗马音和沉浸歌词,歌词进度只通过文字高亮表达。\n- 每个内置工具、Nex 工具、插件和外部工具宿主使用独立随包 `.dat` 页面定义,异常时回退到安全最小页面。\n- 安装协议加入网络音乐完整使用须知、版权声明和第三方许可证;按钮补齐悬停、按下、禁用和键盘焦点状态。\n\n## 高 DPI 与安装器滚动\n\n- 安装器和主程序统一启用 PerMonitorV2,改善 100%、150% 和 200% 缩放下的文字、按钮与标题栏清晰度。\n- 欢迎、许可、安装目录、安装选项、环境检查、安装过程和完成页均支持滚轮、滚动条和触控平移,底部操作区保持固定。\n\n## 主题与可读性\n\n- Light、Dark 和 System 设置成为唯一主题来源,应用主题不再被 Windows 当前主题覆盖。\n- 修复系统深色、应用亮色时对话框和页面资源混用的问题;主题切换后同步刷新标题栏、页面与对话框。\n- 提升深色模式正文、辅助文字、警告、错误和禁用状态的对比度,并保留高对比度及减少动画支持。\n\n## Windows Terminal\n\n- 终端检测改为后台读取 Appx 包或文件版本,不再执行 `wt.exe --version`,避免 Windows Terminal 1.24 弹出 Help 窗口。\n- 用户主动打开终端失败时,应用会静默回退到 PowerShell,并在应用内显示状态。", + "home_notes": "v2.0.7.14 包含 2.0.7.13 的音乐、工具与安装器升级,并修复高 DPI、页面滚动、主题混用、深色文字和 Terminal 弹窗。", + "last_update_notes": { + "v2.0.7.13 音乐与工具": "完整保留本地音乐 API、账户权益、逐字与沉浸歌词、独立工具页面定义,以及安装器协议与按钮状态改进。", + "v2.0.7.12 界面与工具": "继续保留此前的 WinUI、音乐、安全浏览器、发布服务、天梯图和 Windows 工具升级。" + }, + "category_list": [ + { "id": "music", "name": "网络音乐", "icon": "music" }, + { "id": "tools", "name": "工具页面", "icon": "tool" }, + { "id": "installer", "name": "安装器与高 DPI", "icon": "download" }, + { "id": "ui", "name": "主题与可读性", "icon": "monitor" }, + { "id": "terminal", "name": "开发终端", "icon": "terminal" }, + { "id": "privacy", "name": "隐私与许可", "icon": "shield" } + ], + "update_notes": { + "网络音乐": "完整包含 2.0.7.13:酷狗统一经随包本地 API,完善加密登录快照、权益、音质、逐字与沉浸歌词。", + "工具页面": "完整包含 2.0.7.13:每个工具使用独立随包 .dat 页面定义并支持安全回退。", + "安装器与高 DPI": "完整包含新版协议和按钮状态;安装器与主程序启用 PerMonitorV2,所有安装步骤支持滚轮和触控滚动。", + "主题与可读性": "修复应用主题与系统主题不一致,增强深色正文、辅助文字和禁用状态对比度。", + "开发终端": "终端版本改为后台元数据查询,避免 Windows Terminal 1.24 Help 弹窗并提供静默回退。", + "隐私与许可": "保留本地随机端口、缓存、登录风控、版权限制和第三方许可证说明。" + }, + "release_date": "2026-08-18", + "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "force_update": false, + "min_supported_version": "2.0.5", + "download_mirrors": [ + { + "id": "fullInstaller", + "name": "完整安装包", + "type": "exe", + "url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "size": "待发布", + "sizeBytes": 0, + "sha256": "", + "required": false + }, + { + "id": "msix", + "name": "MSIX 安装包", + "type": "msix", + "url": "https://update.ymhut.cn/downloads/YMhutBox_2.0.7.14_x64.msix", + "size": "待发布", + "sizeBytes": 0, + "sha256": "", + "required": false + }, + { + "id": "appInstaller", + "name": "在线安装配置", + "type": "appinstaller", + "url": "https://update.ymhut.cn/winui.appinstaller", + "size": "在线配置", + "sizeBytes": 0, + "sha256": "", + "required": false + } + ], + "detected_product": { + "name": "YMhut Box WinUI", + "version": "2.0.7.14", + "channel": "stable" + }, + "detected_packages": [ + { + "id": "fullInstaller", + "name": "YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "version": "2.0.7.14", + "type": "exe", + "size": "待发布", + "sizeBytes": 0, + "url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "sha256": "" + }, + { + "id": "msix", + "name": "YMhutBox_2.0.7.14_x64.msix", + "version": "2.0.7.14", + "type": "msix", + "size": "待发布", + "sizeBytes": 0, + "url": "https://update.ymhut.cn/downloads/YMhutBox_2.0.7.14_x64.msix", + "sha256": "" + } + ] +} diff --git a/update-notice/total.json b/update-notice/total.json index f211043..09d7bd5 100644 --- a/update-notice/total.json +++ b/update-notice/total.json @@ -1,42 +1,89 @@ { "schema_version": 1, "product": "YMhut Box", - "latest_version": "2.0.7.12", - "latest_notice_file": "2.0.7.12.json", - "last_updated": "2026-08-16T00:00:00Z", + "latest_version": "2.0.7.14", + "latest_notice_file": "2.0.7.14.json", + "last_updated": "2026-08-18T00:00:00Z", "latest": { - "version": "2.0.7.12", - "build": "12", - "channel": "stable", - "title": "YMhut Box 2.0.7.12", - "message": "本版本统一 WinUI 客户端视觉与导航,修复工具箱、音乐、安全浏览器和安装器,并完成发布服务、管理后台、硬件天梯图及六项 Windows 工具升级;网络音乐新增酷狗来源、最近播放、持续歌词同步和歌曲关联 MV。", - "release_notes": "统一主页面、工具页、插件页和内嵌 Web 工具的 Fluent 视觉;工具箱使用自适应 ItemsWrapGrid,修复宽屏留白和双词条挤压;优化中心及子工具按实际来源返回;修复网络音乐搜索、扫码与 Cookie 登录、歌词跟随、音质重载、播放地址刷新和结构化错误提示;二维码登录统一使用 type:3 协议并保留创建阶段会话 Cookie,手机授权后进入独立账户同步阶段,修复授权成功但桌面端无法加载账户的问题;网络音乐新增网易云/酷狗隔离来源、500 条最近播放、来源感知会话恢复、离开页面后持续同步的歌词与桌面歌词、可调播放进度、登录态账户弹窗、按版本签署的数据源声明及歌曲关联 MV;VIP 与受限歌曲继续严格使用服务方合法会话和权益结果;Shell 输出统一按 BOM、UTF-8、OEM 与 ANSI 顺序解码;安全浏览器新增临时会话多标签、快捷键、弹窗转标签和确定性资源释放;聚合搜索默认使用 Bing;首页公告改为紧凑状态横幅;安装器统一七步状态、预检、进度、错误和窄屏侧栏,改用 YMhut 博客风格的浅色编辑式界面,修复成功安装在 100% 时误显 error,并让展开日志可滚动且自动跟随最新步骤;统一服务使用 release_packages 持久化索引与原子快照,完善六种包格式上传、阶段错误码、覆盖回滚、Nginx 上传和下载配置;发布 Manifest 以已发布版本为准并置顶同版本安装包,修复历史包覆盖客户端更新提示、下载页和后台最新版本的问题;管理后台改用真实 Vue Router、类型化状态与标准菜单页面;新增带 ETag、校验和离线快照的 CPU/GPU 天梯图;新增 Windows 系统修复、可选功能、事件日志、文件占用、系统还原点及 Win32/MSIX 应用管理六项工具;修复 WinUI 构建脚本的 HOME 覆盖和 NuGet 源选择。", - "release_date": "2026-08-16", - "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.12.exe", - "force_update": false, - "highlights": [ - "统一主页面、工具页、插件页和内嵌 Web 工具的 Fluent 视觉。", - "工具箱改用自适应 ItemsWrapGrid,修复宽屏留白和双词条拥挤。", - "工具导航按实际来源返回,优化中心和子工具层级不再丢失。", - "完善网络音乐搜索、扫码登录、播放重试和结构化错误提示。", - "修复 type:3 二维码会话 Cookie 保持与手机授权后的账户同步。", - "网络音乐增加网易云/酷狗隔离来源、500 条最近播放、来源感知会话恢复和按版本签署的数据源声明。", - "歌词及桌面歌词在切歌、系统媒体控制和离开页面后持续同步,并支持进度自由调整与歌曲关联 MV。", - "Shell 工具与插件运行时共用中文输出解码器。", - "安全浏览器增加临时会话多标签、快捷键、弹窗转标签和资源释放。", - "聚合搜索默认使用 Bing,首页公告改为紧凑状态横幅。", - "修复 WinUI 构建脚本的 HOME 覆盖和 NuGet 源选择。", - "发布服务采用持久化索引、原子快照和六种格式上传事务回滚。", - "发布 Manifest 以已发布版本为准,客户端、下载页和后台统一置顶同版本安装包。", - "管理后台完成 Vue Router、类型化状态和标准菜单页面重构。", - "安装器采用 YMhut 浅色编辑式视觉,修复 100% 成功误显 error,并让展开日志自动跟随最新步骤。", - "CPU/GPU 天梯图增加筛选、ETag、SHA-256 校验和离线快照。", - "新增系统修复、可选功能、事件日志、文件占用、还原点和应用管理六项 Windows 工具。" - ], - "message_md": "# YMhut Box 2.0.7.12\n\n本版本在既有 Fluent、工具箱、音乐、安全浏览器、Shell 输出和公告改进之上,追加统一服务发布包可靠性、管理后台标准化、安装器优化、第一方 CPU/GPU 天梯图及六项 Windows 诊断与维护工具。", - "release_notes_md": "## 界面与导航\n\n- 统一主要页面、工具页、插件页和内嵌 Web 工具的 Fluent 视觉。\n- 修复工具箱宽屏留白、元数据长条、优化卡片裁切和来源感知返回。\n- HTML/JS 标签移除关闭按钮;安装器统一七步状态、预检、进度和窄屏布局。\n- 安装器采用 YMhut 浅色编辑式视觉,修复 100% 成功误显 error;展开日志可滚动并自动跟随最新步骤。\n- 首页公告改为紧凑状态横幅。\n\n## 工具可靠性\n\n- 完善网络音乐扫码与 Cookie 登录、歌词跟随、音质重载、播放重试和错误提示。\n- 二维码登录保持 type:3 创建会话 Cookie,授权后独立同步账户且不重复消费二维码状态;缺少登录令牌时明确提示刷新重试。\n- 网络音乐增加网易云/酷狗隔离来源、500 条最近播放、持续歌词与桌面歌词同步、可调进度、按版本签署的数据源声明和歌曲关联 MV。\n- 已登录账户不再重复显示二维码;VIP 与受限歌曲继续以服务方合法会话和实际权益结果为准。\n- Shell 工具和插件运行时共用中文输出解码器。\n- 聚合搜索将 Bing 设为新安装默认项。\n\n## 天梯图与新增工具\n\n- CPU/GPU 天梯图支持搜索筛选、ETag、SHA-256 校验及离线快照。\n- 新增系统修复、可选功能、事件日志、文件占用、还原点和应用管理六项工具。\n\n## 统一服务与后台\n\n- 发布包采用持久化索引与原子快照,六种上传格式支持阶段错误码和事务回滚。\n- 管理后台完成 Vue Router、类型化状态与标准菜单页面重构。\n\n## 安全浏览器与构建\n\n- 安全浏览器修复内容拉伸并升级为临时会话多标签模式。\n- 修复构建脚本的 HOME 覆盖和 NuGet 源选择。" - }, + "version": "2.0.7.14", + "build": "14", + "channel": "stable", + "title": "YMhut Box 2.0.7.14", + "message": "本版本包含 2.0.7.13 的全部网络音乐、独立工具页面和安装器改进,并进一步修复高 DPI 模糊、安装页面滚轮、应用主题不一致、深色文字对比度以及 Windows Terminal 帮助弹窗。", + "release_notes": "完整包含 2.0.7.13 的用户可见改进:酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接,登录态使用本机加密快照并展示平台会员权益,网易云与酷狗共用音质、逐字歌词和沉浸歌词,每个工具使用独立随包 .dat 页面定义,安装器补充完整网络音乐协议与按钮状态;安装器和主程序启用 PerMonitorV2 高 DPI 支持,全部安装步骤支持滚轮、滚动条和触控平移;应用明确以 Light、Dark 或 System 设置为唯一主题来源,修复系统主题与应用主题混用并增强深色文字对比度;终端检测改为后台读取包元数据,不再执行会触发 Windows Terminal 1.24 Help 弹窗的 wt.exe --version,失败时静默回退到 PowerShell。", + "release_date": "2026-08-18", + "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "force_update": false, + "highlights": [ + "酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接,仅供应用内部访问。", + "登录态使用本机加密快照并展示平台返回的会员及分组权益。", + "网易云与酷狗共用音质、逐字歌词、翻译、罗马音和沉浸歌词体验。", + "每个工具使用独立随包 .dat 页面定义,异常时回退到安全最小页面。", + "安装协议补齐网络音乐声明与第三方许可,按钮状态和键盘焦点更加明确。", + "安装器和主程序统一启用 PerMonitorV2 高 DPI 支持。", + "安装器所有步骤支持滚轮、滚动条和触控平移。", + "修复应用亮色/深色设置被 Windows 系统主题覆盖的问题。", + "增强深色模式正文、辅助文字、警告和禁用状态的对比度。", + "终端检测不再调用 wt.exe --version,避免 Windows Terminal Help 弹窗。" + ], + "message_md": "# YMhut Box 2.0.7.14\n\n本版本完整包含 2.0.7.13 的网络音乐、工具页面和安装器改进,并追加高 DPI、滚动、主题一致性和终端启动体验修复。", + "release_notes_md": "## 2.0.7.13 完整改进\n\n- 酷狗请求统一经随包 MoeKoeMusic 本地 Sidecar,登录态使用本机加密快照并展示平台权益。\n- 网易云与酷狗共用音质选择、逐字歌词和沉浸歌词,每个工具使用独立随包 `.dat` 页面定义。\n- 安装协议加入网络音乐完整使用须知和第三方许可,按钮补齐交互、禁用与焦点状态。\n\n## 2.0.7.14 新增修复\n\n- 安装器和主程序启用 PerMonitorV2,全部安装步骤支持滚轮、滚动条和触控平移。\n- Light、Dark、System 成为唯一主题来源,修复系统主题与应用主题混用并增强深色文字对比度。\n- 终端检测改为后台元数据查询,不再执行 `wt.exe --version`,避免 Windows Terminal 1.24 Help 弹窗。" + }, "versions": [ + { + "version": "2.0.7.14", + "build": "14", + "channel": "stable", + "release_date": "2026-08-18", + "title": "YMhut Box 2.0.7.14", + "summary": "完整包含 2.0.7.13 的本地音乐 API、账户权益、歌词、独立工具页面与安装器升级,并修复高 DPI、滚动、主题混用、深色文字和 Terminal 弹窗。", + "categories": { + "music": "酷狗统一经随包本地 API;完善加密登录快照、权益、音质、逐字与沉浸歌词。", + "tools": "每个工具使用独立随包 .dat 页面定义并支持安全回退。", + "installer": "加入完整音乐协议和按钮状态,启用 PerMonitorV2 并支持全页面滚动。", + "theme": "修复应用主题与系统主题不一致并增强深色文字对比度。", + "terminal": "后台读取 Terminal 版本,避免 wt.exe --version 触发 Help 弹窗。" + }, + "highlights": [ + "酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接,仅供应用内部访问。", + "登录态使用本机加密快照并展示平台返回的会员及分组权益。", + "网易云与酷狗共用音质、逐字歌词、翻译、罗马音和沉浸歌词体验。", + "每个工具使用独立随包 .dat 页面定义,异常时回退到安全最小页面。", + "安装协议补齐网络音乐声明与第三方许可,按钮状态和键盘焦点更加明确。", + "安装器和主程序统一启用 PerMonitorV2 高 DPI 支持。", + "安装器所有步骤支持滚轮、滚动条和触控平移。", + "修复应用亮色/深色设置被 Windows 系统主题覆盖的问题。", + "增强深色模式正文、辅助文字、警告和禁用状态的对比度。", + "终端检测不再调用 wt.exe --version,避免 Windows Terminal Help 弹窗。" + ], + "notice_file": "2.0.7.14.json", + "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "force_update": false + }, + { + "version": "2.0.7.13", + "build": "13", + "channel": "stable", + "release_date": "2026-08-17", + "title": "YMhut Box 2.0.7.13", + "summary": "完善随包本地音乐 API、加密登录权益、逐字与沉浸歌词、独立工具页面定义,以及安装器协议和按钮状态。", + "categories": { + "music": "酷狗统一经随包本地 API;完善登录快照、权益、音质与歌词体验。", + "tools": "每个工具使用独立随包 .dat 页面定义并支持安全回退。", + "installer": "网络音乐完整使用须知纳入协议,按钮补齐交互、禁用和焦点状态。" + }, + "highlights": [ + "酷狗请求统一由随包 MoeKoeMusic 本地 Sidecar 承接。", + "登录态使用本机加密快照,账户页展示平台真实权益。", + "网易云与酷狗共用音质、逐字歌词和沉浸歌词。", + "每个工具使用独立随包 .dat 页面定义。", + "安装协议补齐网络音乐声明和第三方许可。", + "安装器按钮补齐悬停、按下、禁用和键盘焦点状态。" + ], + "notice_file": "2.0.7.13.json", + "download_url": "https://update.ymhut.cn/downloads/YMhut_Box_WinUI_Setup_2.0.7.14.exe", + "force_update": false + }, { "version": "2.0.7.12", "build": "12", diff --git a/version.json b/version.json index 0308051..4c4b5ef 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { "version": "2.0.7", - "build": "12", + "build": "14", "channel": "stable" } diff --git a/参考/NexBox-main/.env.template b/参考/NexBox-main/.env.template deleted file mode 100644 index da5fdf1..0000000 --- a/参考/NexBox-main/.env.template +++ /dev/null @@ -1,5 +0,0 @@ -# 传感器 HTTP 服务地址(与 tools/Program.cs 中 UseUrls 一致时可省略) -NEXT_PUBLIC_SENSOR_URL=http://127.0.0.1:58888 - -# Tauri 开发时前端资源主机(一般保持 localhost) -# TAURI_DEV_HOST=localhost diff --git a/参考/NexBox-main/.eslintrc.json b/参考/NexBox-main/.eslintrc.json deleted file mode 100644 index 6952b6c..0000000 --- a/参考/NexBox-main/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": ["next/core-web-vitals", "next/typescript"] -} diff --git a/参考/NexBox-main/.gitignore b/参考/NexBox-main/.gitignore deleted file mode 100644 index 3d56e49..0000000 --- a/参考/NexBox-main/.gitignore +++ /dev/null @@ -1,100 +0,0 @@ -# Dependencies -node_modules/ - -# Next.js -.next/ -out/ - -# Tauri / Rust -src-tauri/target/ -installer/src-tauri/target/ -uninstaller/src-tauri/target/ - -# C#(传感器服务位于 tools/ 根目录,与 csproj 同级) -tools/bin/ -tools/obj/ - -# 本地生成的图标源(可选用仓库内其他资源重新执行 `npx tauri icon`) -icon-src.png - -# 环境 -.env -.env.local -.env.*.local - -# 日志与编辑器 -npm-debug.log* -.DS_Store -Thumbs.db - -# IDE -.idea/ -.vscode/ -*.swp -*.swo -*~ - -# Build outputs -Output/ -*.exe -*.zip - -# Tauri -src-tauri/src-tauri.zip - -# Temporary directories - -# Atom code -.atomcode/ - -# Trae AI documents -.trae/ - -# CodeBuddy -.codebuddy/ - -# WorkBuddy -.workbuddy/ - -# Uploads -.uploads/ - -# Joycode -.joycode/ - -# Husky -.husky/ - -# Third-party executables -nvidiaProfileInspector.exe -Reference.xml -nvidiaProfileInspector.exe.config - -# OpenCode -.opencode/ - -# CodeFlicker -.codeflicker/ - -# Video directory -video/ - -# ChineseSimplified.isl (Inno Setup translation, already in nexbox.iss) -ChineseSimplified.isl - -# README -README.md - -# Resources -resources/ -src-tauri/resources/ - -# 排除的文件 -1.icc -软件介绍.md -社区滤镜A.icc -原亮 冷色调.icc -Delta Force.nip -MCTier技术介绍.md - -debug.log diff --git a/参考/NexBox-main/.gitmodules b/参考/NexBox-main/.gitmodules deleted file mode 100644 index b16acc0..0000000 --- a/参考/NexBox-main/.gitmodules +++ /dev/null @@ -1 +0,0 @@ -# 暂无 Git 子模块;需要时将第三方仓库登记于此。 diff --git a/参考/NexBox-main/.prettierrc b/参考/NexBox-main/.prettierrc deleted file mode 100644 index bccee91..0000000 --- a/参考/NexBox-main/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "semi": true, - "singleQuote": false, - "trailingComma": "all", - "printWidth": 100 -} diff --git a/参考/NexBox-main/Fonts/AiDianFengYaHei.ttf b/参考/NexBox-main/Fonts/AiDianFengYaHei.ttf deleted file mode 100644 index 3384e87..0000000 Binary files a/参考/NexBox-main/Fonts/AiDianFengYaHei.ttf and /dev/null differ diff --git a/参考/NexBox-main/Fonts/Cubic.ttf b/参考/NexBox-main/Fonts/Cubic.ttf deleted file mode 100644 index 2aec542..0000000 Binary files a/参考/NexBox-main/Fonts/Cubic.ttf and /dev/null differ diff --git a/参考/NexBox-main/Fonts/MiSansVF.ttf b/参考/NexBox-main/Fonts/MiSansVF.ttf deleted file mode 100644 index 07a1ea5..0000000 Binary files a/参考/NexBox-main/Fonts/MiSansVF.ttf and /dev/null differ diff --git a/参考/NexBox-main/Fonts/Sinter-Regular.otf b/参考/NexBox-main/Fonts/Sinter-Regular.otf deleted file mode 100644 index 826c8c5..0000000 Binary files a/参考/NexBox-main/Fonts/Sinter-Regular.otf and /dev/null differ diff --git a/参考/NexBox-main/LICENSE b/参考/NexBox-main/LICENSE deleted file mode 100644 index e8e7ade..0000000 --- a/参考/NexBox-main/LICENSE +++ /dev/null @@ -1,584 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not impose additional -conditions to a court. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work would infringe a patent in your country that you have -reason to believe is valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant also automatically applies to all covered works conveyed or -propagated by you in connection with that transaction or arrangement. - - You may not, in connection with or arising out of a single -transaction or arrangement, grant a patent license to one or more -parties (or a group of parties) to the exclusion of any other parties -(or another group of parties) who receive covered works from you in -connection with that same transaction or arrangement. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for conveying the covered work from others who do -so, the only way you could satisfy both that obligation and this License -would be to refrain entirely from conveying the covered work. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License to use, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation \ No newline at end of file diff --git a/参考/NexBox-main/LICENSE.EXTRA b/参考/NexBox-main/LICENSE.EXTRA deleted file mode 100644 index 08e77fa..0000000 --- a/参考/NexBox-main/LICENSE.EXTRA +++ /dev/null @@ -1,584 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not impose additional -conditions to a court. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work would infringe a patent in your country that you have -reason to believe is valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant also automatically applies to all covered works conveyed or -propagated by you in connection with that transaction or arrangement. - - You may not, in connection with or arising out of a single -transaction or arrangement, grant a patent license to one or more -parties (or a group of parties) to the exclusion of any other parties -(or another group of parties) who receive covered works from you in -connection with that same transaction or arrangement. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for conveying the covered work from others who do -so, the only way you could satisfy both that obligation and this License -would be to refrain entirely from conveying the covered work. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License to use, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation diff --git a/参考/NexBox-main/LibreHardwareMonitorLib.dll b/参考/NexBox-main/LibreHardwareMonitorLib.dll deleted file mode 100644 index d98c84a..0000000 Binary files a/参考/NexBox-main/LibreHardwareMonitorLib.dll and /dev/null differ diff --git a/参考/NexBox-main/R560-developer/NvApiDriverSettings.c b/参考/NexBox-main/R560-developer/NvApiDriverSettings.c deleted file mode 100644 index b4eb350..0000000 --- a/参考/NexBox-main/R560-developer/NvApiDriverSettings.c +++ /dev/null @@ -1,957 +0,0 @@ -/***************************************************************************\ -|* *| -|* Copyright NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This source code is subject to NVIDIA ownership rights under U.S. *| -|* and international Copyright laws. Users and possessors of this *| -|* source code are hereby granted a nonexclusive, royalty-free *| -|* license to use this code in individual and commercial software. *| -|* *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *| -|* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *| -|* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *| -|* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *| -|* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *| -|* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *| -|* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *| -|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *| -|* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *| -|* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *| -|* CODE. *| -|* *| -|* U.S. Government End Users. This source code is a "commercial item" *| -|* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *| -|* of "commercial computer software" and "commercial computer software *| -|* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *| -|* and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *| -|* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *| -|* source code with only those rights set forth herein. *| -|* *| -|* Any use of this source code in individual and commercial software must *| -|* include, in the user documentation and internal comments to the code, *| -|* the above Disclaimer and U.S. Government End Users Notice. *| -|* *| -|* *| -\***************************************************************************/ - -#include "NvApiDriverSettings.h" - -EValues_OGL_AA_LINE_GAMMA g_valuesOGL_AA_LINE_GAMMA[OGL_AA_LINE_GAMMA_NUM_VALUES] = -{ - OGL_AA_LINE_GAMMA_DISABLED, - OGL_AA_LINE_GAMMA_ENABLED, - OGL_AA_LINE_GAMMA_MIN, - OGL_AA_LINE_GAMMA_MAX, -}; - -EValues_OGL_CPL_GDI_COMPATIBILITY g_valuesOGL_CPL_GDI_COMPATIBILITY[OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES] = -{ - OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED, - OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED, - OGL_CPL_GDI_COMPATIBILITY_AUTO, -}; - -EValues_OGL_CPL_PREFER_DXPRESENT g_valuesOGL_CPL_PREFER_DXPRESENT[OGL_CPL_PREFER_DXPRESENT_NUM_VALUES] = -{ - OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED, - OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED, - OGL_CPL_PREFER_DXPRESENT_AUTO, -}; - -EValues_OGL_DEEP_COLOR_SCANOUT g_valuesOGL_DEEP_COLOR_SCANOUT[OGL_DEEP_COLOR_SCANOUT_NUM_VALUES] = -{ - OGL_DEEP_COLOR_SCANOUT_DISABLE, - OGL_DEEP_COLOR_SCANOUT_ENABLE, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL g_valuesOGL_DEFAULT_SWAP_INTERVAL[OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_TEAR, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC, - OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON, - OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED, - OGL_DEFAULT_SWAP_INTERVAL_DISABLE, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL[OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN[OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE, -}; - -EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD[OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES] = -{ - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL, -}; - -EValues_OGL_FORCE_BLIT g_valuesOGL_FORCE_BLIT[OGL_FORCE_BLIT_NUM_VALUES] = -{ - OGL_FORCE_BLIT_ON, - OGL_FORCE_BLIT_OFF, -}; - -EValues_OGL_FORCE_STEREO g_valuesOGL_FORCE_STEREO[OGL_FORCE_STEREO_NUM_VALUES] = -{ - OGL_FORCE_STEREO_OFF, - OGL_FORCE_STEREO_ON, -}; - -const wchar_t * g_valuesOGL_IMPLICIT_GPU_AFFINITY[OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES] = -{ - OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT -}; - -EValues_OGL_OVERLAY_PIXEL_TYPE g_valuesOGL_OVERLAY_PIXEL_TYPE[OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES] = -{ - OGL_OVERLAY_PIXEL_TYPE_NONE, - OGL_OVERLAY_PIXEL_TYPE_CI, - OGL_OVERLAY_PIXEL_TYPE_RGBA, - OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA, -}; - -EValues_OGL_OVERLAY_SUPPORT g_valuesOGL_OVERLAY_SUPPORT[OGL_OVERLAY_SUPPORT_NUM_VALUES] = -{ - OGL_OVERLAY_SUPPORT_OFF, - OGL_OVERLAY_SUPPORT_ON, - OGL_OVERLAY_SUPPORT_FORCE_SW, -}; - -EValues_OGL_QUALITY_ENHANCEMENTS g_valuesOGL_QUALITY_ENHANCEMENTS[OGL_QUALITY_ENHANCEMENTS_NUM_VALUES] = -{ - OGL_QUALITY_ENHANCEMENTS_HQUAL, - OGL_QUALITY_ENHANCEMENTS_QUAL, - OGL_QUALITY_ENHANCEMENTS_PERF, - OGL_QUALITY_ENHANCEMENTS_HPERF, -}; - -EValues_OGL_SINGLE_BACKDEPTH_BUFFER g_valuesOGL_SINGLE_BACKDEPTH_BUFFER[OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES] = -{ - OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE, - OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE, - OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT, -}; - -EValues_OGL_SLI_MULTICAST g_valuesOGL_SLI_MULTICAST[OGL_SLI_MULTICAST_NUM_VALUES] = -{ - OGL_SLI_MULTICAST_DISABLE, - OGL_SLI_MULTICAST_ENABLE, - OGL_SLI_MULTICAST_FORCE_DISABLE, - OGL_SLI_MULTICAST_ALLOW_MOSAIC, -}; - -EValues_OGL_THREAD_CONTROL g_valuesOGL_THREAD_CONTROL[OGL_THREAD_CONTROL_NUM_VALUES] = -{ - OGL_THREAD_CONTROL_ENABLE, - OGL_THREAD_CONTROL_DISABLE, -}; - -EValues_OGL_TMON_LEVEL g_valuesOGL_TMON_LEVEL[OGL_TMON_LEVEL_NUM_VALUES] = -{ - OGL_TMON_LEVEL_DISABLE, - OGL_TMON_LEVEL_CRITICAL, - OGL_TMON_LEVEL_WARNING, - OGL_TMON_LEVEL_INFORMATION, - OGL_TMON_LEVEL_MOST, - OGL_TMON_LEVEL_VERBOSE, -}; - -EValues_OGL_TRIPLE_BUFFER g_valuesOGL_TRIPLE_BUFFER[OGL_TRIPLE_BUFFER_NUM_VALUES] = -{ - OGL_TRIPLE_BUFFER_DISABLED, - OGL_TRIPLE_BUFFER_ENABLED, -}; - -EValues_AA_BEHAVIOR_FLAGS g_valuesAA_BEHAVIOR_FLAGS[AA_BEHAVIOR_FLAGS_NUM_VALUES] = -{ - AA_BEHAVIOR_FLAGS_NONE, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE, - AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE, - AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE, - AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING, - AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING, - AA_BEHAVIOR_FLAGS_DISABLE_CPLAA, - AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE, - AA_BEHAVIOR_FLAGS_DISABLE_SLIAA, - AA_BEHAVIOR_FLAGS_DEFAULT, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT, - AA_BEHAVIOR_FLAGS_MASK, -}; - -EValues_AA_MODE_ALPHATOCOVERAGE g_valuesAA_MODE_ALPHATOCOVERAGE[AA_MODE_ALPHATOCOVERAGE_NUM_VALUES] = -{ - AA_MODE_ALPHATOCOVERAGE_MODE_MASK, - AA_MODE_ALPHATOCOVERAGE_MODE_OFF, - AA_MODE_ALPHATOCOVERAGE_MODE_ON, - AA_MODE_ALPHATOCOVERAGE_MODE_MAX, -}; - -EValues_AA_MODE_GAMMACORRECTION g_valuesAA_MODE_GAMMACORRECTION[AA_MODE_GAMMACORRECTION_NUM_VALUES] = -{ - AA_MODE_GAMMACORRECTION_MASK, - AA_MODE_GAMMACORRECTION_OFF, - AA_MODE_GAMMACORRECTION_ON_IF_FOS, - AA_MODE_GAMMACORRECTION_ON_ALWAYS, - AA_MODE_GAMMACORRECTION_MAX, - AA_MODE_GAMMACORRECTION_DEFAULT, - AA_MODE_GAMMACORRECTION_DEFAULT_TESLA, - AA_MODE_GAMMACORRECTION_DEFAULT_FERMI, -}; - -EValues_AA_MODE_METHOD g_valuesAA_MODE_METHOD[AA_MODE_METHOD_NUM_VALUES] = -{ - AA_MODE_METHOD_NONE, - AA_MODE_METHOD_SUPERSAMPLE_2X_H, - AA_MODE_METHOD_SUPERSAMPLE_2X_V, - AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5, - AA_MODE_METHOD_FREE_0x03, - AA_MODE_METHOD_FREE_0x04, - AA_MODE_METHOD_SUPERSAMPLE_4X, - AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN, - AA_MODE_METHOD_FREE_0x08, - AA_MODE_METHOD_FREE_0x09, - AA_MODE_METHOD_SUPERSAMPLE_9X, - AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS, - AA_MODE_METHOD_SUPERSAMPLE_16X, - AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL, - AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX, - AA_MODE_METHOD_MULTISAMPLE_4X, - AA_MODE_METHOD_FREE_0x11, - AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN, - AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP, - AA_MODE_METHOD_FREE_0x14, - AA_MODE_METHOD_FREE_0x15, - AA_MODE_METHOD_MIXEDSAMPLE_6X, - AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP, - AA_MODE_METHOD_MIXEDSAMPLE_8X, - AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP, - AA_MODE_METHOD_MIXEDSAMPLE_16X, - AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA, - AA_MODE_METHOD_MULTISAMPLE_16X, - AA_MODE_METHOD_VCAA_32X_8v24, - AA_MODE_METHOD_CORRUPTION_CHECK, - AA_MODE_METHOD_6X_CT, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA, - AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA, - AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA, - AA_MODE_METHOD_MULTISAMPLE_8X, - AA_MODE_METHOD_VCAA_8X_4v4, - AA_MODE_METHOD_VCAA_16X_4v12, - AA_MODE_METHOD_VCAA_16X_8v8, - AA_MODE_METHOD_MIXEDSAMPLE_32X, - AA_MODE_METHOD_SUPERVCAA_64X_4v12, - AA_MODE_METHOD_SUPERVCAA_64X_8v8, - AA_MODE_METHOD_MIXEDSAMPLE_64X, - AA_MODE_METHOD_MIXEDSAMPLE_128X, - AA_MODE_METHOD_COUNT, - AA_MODE_METHOD_METHOD_MASK, - AA_MODE_METHOD_METHOD_MAX, -}; - -EValues_AA_MODE_REPLAY g_valuesAA_MODE_REPLAY[AA_MODE_REPLAY_NUM_VALUES] = -{ - AA_MODE_REPLAY_SAMPLES_MASK, - AA_MODE_REPLAY_SAMPLES_ONE, - AA_MODE_REPLAY_SAMPLES_TWO, - AA_MODE_REPLAY_SAMPLES_FOUR, - AA_MODE_REPLAY_SAMPLES_EIGHT, - AA_MODE_REPLAY_SAMPLES_MAX, - AA_MODE_REPLAY_MODE_MASK, - AA_MODE_REPLAY_MODE_OFF, - AA_MODE_REPLAY_MODE_ALPHA_TEST, - AA_MODE_REPLAY_MODE_PIXEL_KILL, - AA_MODE_REPLAY_MODE_DYN_BRANCH, - AA_MODE_REPLAY_MODE_OPTIMAL, - AA_MODE_REPLAY_MODE_ALL, - AA_MODE_REPLAY_MODE_MAX, - AA_MODE_REPLAY_TRANSPARENCY, - AA_MODE_REPLAY_DISALLOW_TRAA, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI, - AA_MODE_REPLAY_MASK, -}; - -EValues_AA_MODE_SELECTOR g_valuesAA_MODE_SELECTOR[AA_MODE_SELECTOR_NUM_VALUES] = -{ - AA_MODE_SELECTOR_MASK, - AA_MODE_SELECTOR_APP_CONTROL, - AA_MODE_SELECTOR_OVERRIDE, - AA_MODE_SELECTOR_ENHANCE, - AA_MODE_SELECTOR_MAX, -}; - -EValues_AA_MODE_SELECTOR_SLIAA g_valuesAA_MODE_SELECTOR_SLIAA[AA_MODE_SELECTOR_SLIAA_NUM_VALUES] = -{ - AA_MODE_SELECTOR_SLIAA_DISABLED, - AA_MODE_SELECTOR_SLIAA_ENABLED, -}; - -EValues_ANISO_MODE_LEVEL g_valuesANISO_MODE_LEVEL[ANISO_MODE_LEVEL_NUM_VALUES] = -{ - ANISO_MODE_LEVEL_MASK, - ANISO_MODE_LEVEL_NONE_POINT, - ANISO_MODE_LEVEL_NONE_LINEAR, - ANISO_MODE_LEVEL_MAX, - ANISO_MODE_LEVEL_DEFAULT, -}; - -EValues_ANISO_MODE_SELECTOR g_valuesANISO_MODE_SELECTOR[ANISO_MODE_SELECTOR_NUM_VALUES] = -{ - ANISO_MODE_SELECTOR_MASK, - ANISO_MODE_SELECTOR_APP, - ANISO_MODE_SELECTOR_USER, - ANISO_MODE_SELECTOR_COND, - ANISO_MODE_SELECTOR_MAX, - ANISO_MODE_SELECTOR_DEFAULT, -}; - -EValues_ANSEL_ALLOW g_valuesANSEL_ALLOW[ANSEL_ALLOW_NUM_VALUES] = -{ - ANSEL_ALLOW_DISALLOWED, - ANSEL_ALLOW_ALLOWED, -}; - -EValues_ANSEL_ALLOWLISTED g_valuesANSEL_ALLOWLISTED[ANSEL_ALLOWLISTED_NUM_VALUES] = -{ - ANSEL_ALLOWLISTED_DISALLOWED, - ANSEL_ALLOWLISTED_ALLOWED, -}; - -EValues_ANSEL_ENABLE g_valuesANSEL_ENABLE[ANSEL_ENABLE_NUM_VALUES] = -{ - ANSEL_ENABLE_OFF, - ANSEL_ENABLE_ON, -}; - -EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT[APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES] = -{ - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES, -}; - -EValues_BATTERY_BOOST_APP_FPS g_valuesBATTERY_BOOST_APP_FPS[BATTERY_BOOST_APP_FPS_NUM_VALUES] = -{ - BATTERY_BOOST_APP_FPS_MIN, - BATTERY_BOOST_APP_FPS_MAX, - BATTERY_BOOST_APP_FPS_NO_OVERRIDE, -}; - -EValues_CPL_HIDDEN_PROFILE g_valuesCPL_HIDDEN_PROFILE[CPL_HIDDEN_PROFILE_NUM_VALUES] = -{ - CPL_HIDDEN_PROFILE_DISABLED, - CPL_HIDDEN_PROFILE_ENABLED, -}; - -const wchar_t * g_valuesCUDA_EXCLUDED_GPUS[CUDA_EXCLUDED_GPUS_NUM_VALUES] = -{ - CUDA_EXCLUDED_GPUS_NONE -}; - -const wchar_t * g_valuesD3DOGL_GPU_MAX_POWER[D3DOGL_GPU_MAX_POWER_NUM_VALUES] = -{ - D3DOGL_GPU_MAX_POWER_DEFAULTPOWER -}; - -EValues_EXPORT_PERF_COUNTERS g_valuesEXPORT_PERF_COUNTERS[EXPORT_PERF_COUNTERS_NUM_VALUES] = -{ - EXPORT_PERF_COUNTERS_OFF, - EXPORT_PERF_COUNTERS_ON, -}; - -EValues_EXTERNAL_QUIET_MODE g_valuesEXTERNAL_QUIET_MODE[EXTERNAL_QUIET_MODE_NUM_VALUES] = -{ - EXTERNAL_QUIET_MODE_ON, - EXTERNAL_QUIET_MODE_OFF, -}; - -EValues_FRL_FPS g_valuesFRL_FPS[FRL_FPS_NUM_VALUES] = -{ - FRL_FPS_DISABLED, - FRL_FPS_MIN, - FRL_FPS_MAX, -}; - -EValues_FXAA_ALLOW g_valuesFXAA_ALLOW[FXAA_ALLOW_NUM_VALUES] = -{ - FXAA_ALLOW_DISALLOWED, - FXAA_ALLOW_ALLOWED, -}; - -EValues_FXAA_ENABLE g_valuesFXAA_ENABLE[FXAA_ENABLE_NUM_VALUES] = -{ - FXAA_ENABLE_OFF, - FXAA_ENABLE_ON, -}; - -EValues_FXAA_INDICATOR_ENABLE g_valuesFXAA_INDICATOR_ENABLE[FXAA_INDICATOR_ENABLE_NUM_VALUES] = -{ - FXAA_INDICATOR_ENABLE_OFF, - FXAA_INDICATOR_ENABLE_ON, -}; - -EValues_LATENCY_INDICATOR_AUTOALIGN g_valuesLATENCY_INDICATOR_AUTOALIGN[LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES] = -{ - LATENCY_INDICATOR_AUTOALIGN_DISABLED, - LATENCY_INDICATOR_AUTOALIGN_ENABLED, -}; - -EValues_MCSFRSHOWSPLIT g_valuesMCSFRSHOWSPLIT[MCSFRSHOWSPLIT_NUM_VALUES] = -{ - MCSFRSHOWSPLIT_DISABLED, - MCSFRSHOWSPLIT_ENABLED, -}; - -EValues_NV_QUALITY_UPSCALING g_valuesNV_QUALITY_UPSCALING[NV_QUALITY_UPSCALING_NUM_VALUES] = -{ - NV_QUALITY_UPSCALING_OFF, - NV_QUALITY_UPSCALING_ON, -}; - -EValues_OPTIMUS_MAXAA g_valuesOPTIMUS_MAXAA[OPTIMUS_MAXAA_NUM_VALUES] = -{ - OPTIMUS_MAXAA_MIN, - OPTIMUS_MAXAA_MAX, -}; - -EValues_PHYSXINDICATOR g_valuesPHYSXINDICATOR[PHYSXINDICATOR_NUM_VALUES] = -{ - PHYSXINDICATOR_DISABLED, - PHYSXINDICATOR_ENABLED, -}; - -EValues_PREFERRED_PSTATE g_valuesPREFERRED_PSTATE[PREFERRED_PSTATE_NUM_VALUES] = -{ - PREFERRED_PSTATE_ADAPTIVE, - PREFERRED_PSTATE_PREFER_MAX, - PREFERRED_PSTATE_DRIVER_CONTROLLED, - PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE, - PREFERRED_PSTATE_PREFER_MIN, - PREFERRED_PSTATE_OPTIMAL_POWER, - PREFERRED_PSTATE_MIN, - PREFERRED_PSTATE_MAX, -}; - -EValues_PREVENT_UI_AF_OVERRIDE g_valuesPREVENT_UI_AF_OVERRIDE[PREVENT_UI_AF_OVERRIDE_NUM_VALUES] = -{ - PREVENT_UI_AF_OVERRIDE_OFF, - PREVENT_UI_AF_OVERRIDE_ON, -}; - -EValues_SHIM_MCCOMPAT g_valuesSHIM_MCCOMPAT[SHIM_MCCOMPAT_NUM_VALUES] = -{ - SHIM_MCCOMPAT_INTEGRATED, - SHIM_MCCOMPAT_ENABLE, - SHIM_MCCOMPAT_USER_EDITABLE, - SHIM_MCCOMPAT_MASK, - SHIM_MCCOMPAT_VIDEO_MASK, - SHIM_MCCOMPAT_VARYING_BIT, - SHIM_MCCOMPAT_AUTO_SELECT, - SHIM_MCCOMPAT_OVERRIDE_BIT, -}; - -EValues_SHIM_RENDERING_MODE g_valuesSHIM_RENDERING_MODE[SHIM_RENDERING_MODE_NUM_VALUES] = -{ - SHIM_RENDERING_MODE_INTEGRATED, - SHIM_RENDERING_MODE_ENABLE, - SHIM_RENDERING_MODE_USER_EDITABLE, - SHIM_RENDERING_MODE_MASK, - SHIM_RENDERING_MODE_VIDEO_MASK, - SHIM_RENDERING_MODE_VARYING_BIT, - SHIM_RENDERING_MODE_AUTO_SELECT, - SHIM_RENDERING_MODE_OVERRIDE_BIT, -}; - -EValues_SHIM_RENDERING_OPTIONS g_valuesSHIM_RENDERING_OPTIONS[SHIM_RENDERING_OPTIONS_NUM_VALUES] = -{ - SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE, - SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT, - SHIM_RENDERING_OPTIONS_EHSHELL_DETECT, - SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT, - SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT, - SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES, - SHIM_RENDERING_OPTIONS_RESERVED1, - SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT, - SHIM_RENDERING_OPTIONS_RESERVED2, - SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE, - SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS, - SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS, - SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS, - SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING, - SHIM_RENDERING_OPTIONS_DISABLE_CUDA, - SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS, - SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT, - SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO, - SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID, - SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD, - SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT, - SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG, - SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP, - SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH, - SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH, - SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY, -}; - -EValues_SLI_GPU_COUNT g_valuesSLI_GPU_COUNT[SLI_GPU_COUNT_NUM_VALUES] = -{ - SLI_GPU_COUNT_AUTOSELECT, - SLI_GPU_COUNT_ONE, - SLI_GPU_COUNT_TWO, - SLI_GPU_COUNT_THREE, - SLI_GPU_COUNT_FOUR, -}; - -EValues_SLI_PREDEFINED_GPU_COUNT g_valuesSLI_PREDEFINED_GPU_COUNT[SLI_PREDEFINED_GPU_COUNT_NUM_VALUES] = -{ - SLI_PREDEFINED_GPU_COUNT_AUTOSELECT, - SLI_PREDEFINED_GPU_COUNT_ONE, - SLI_PREDEFINED_GPU_COUNT_TWO, - SLI_PREDEFINED_GPU_COUNT_THREE, - SLI_PREDEFINED_GPU_COUNT_FOUR, -}; - -EValues_SLI_PREDEFINED_GPU_COUNT_DX10 g_valuesSLI_PREDEFINED_GPU_COUNT_DX10[SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES] = -{ - SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT, - SLI_PREDEFINED_GPU_COUNT_DX10_ONE, - SLI_PREDEFINED_GPU_COUNT_DX10_TWO, - SLI_PREDEFINED_GPU_COUNT_DX10_THREE, - SLI_PREDEFINED_GPU_COUNT_DX10_FOUR, -}; - -EValues_SLI_PREDEFINED_MODE g_valuesSLI_PREDEFINED_MODE[SLI_PREDEFINED_MODE_NUM_VALUES] = -{ - SLI_PREDEFINED_MODE_AUTOSELECT, - SLI_PREDEFINED_MODE_FORCE_SINGLE, - SLI_PREDEFINED_MODE_FORCE_AFR, - SLI_PREDEFINED_MODE_FORCE_AFR2, - SLI_PREDEFINED_MODE_FORCE_SFR, - SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_SLI_PREDEFINED_MODE_DX10 g_valuesSLI_PREDEFINED_MODE_DX10[SLI_PREDEFINED_MODE_DX10_NUM_VALUES] = -{ - SLI_PREDEFINED_MODE_DX10_AUTOSELECT, - SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR2, - SLI_PREDEFINED_MODE_DX10_FORCE_SFR, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_SLI_RENDERING_MODE g_valuesSLI_RENDERING_MODE[SLI_RENDERING_MODE_NUM_VALUES] = -{ - SLI_RENDERING_MODE_AUTOSELECT, - SLI_RENDERING_MODE_FORCE_SINGLE, - SLI_RENDERING_MODE_FORCE_AFR, - SLI_RENDERING_MODE_FORCE_AFR2, - SLI_RENDERING_MODE_FORCE_SFR, - SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_VRPRERENDERLIMIT g_valuesVRPRERENDERLIMIT[VRPRERENDERLIMIT_NUM_VALUES] = -{ - VRPRERENDERLIMIT_MIN, - VRPRERENDERLIMIT_MAX, - VRPRERENDERLIMIT_APP_CONTROLLED, - VRPRERENDERLIMIT_DEFAULT, -}; - -EValues_VRRFEATUREINDICATOR g_valuesVRRFEATUREINDICATOR[VRRFEATUREINDICATOR_NUM_VALUES] = -{ - VRRFEATUREINDICATOR_DISABLED, - VRRFEATUREINDICATOR_ENABLED, -}; - -EValues_VRROVERLAYINDICATOR g_valuesVRROVERLAYINDICATOR[VRROVERLAYINDICATOR_NUM_VALUES] = -{ - VRROVERLAYINDICATOR_DISABLED, - VRROVERLAYINDICATOR_ENABLED, -}; - -EValues_VRRREQUESTSTATE g_valuesVRRREQUESTSTATE[VRRREQUESTSTATE_NUM_VALUES] = -{ - VRRREQUESTSTATE_DISABLED, - VRRREQUESTSTATE_FULLSCREEN_ONLY, - VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED, -}; - -EValues_VRR_APP_OVERRIDE g_valuesVRR_APP_OVERRIDE[VRR_APP_OVERRIDE_NUM_VALUES] = -{ - VRR_APP_OVERRIDE_ALLOW, - VRR_APP_OVERRIDE_FORCE_OFF, - VRR_APP_OVERRIDE_DISALLOW, - VRR_APP_OVERRIDE_ULMB, - VRR_APP_OVERRIDE_FIXED_REFRESH, -}; - -EValues_VRR_APP_OVERRIDE_REQUEST_STATE g_valuesVRR_APP_OVERRIDE_REQUEST_STATE[VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES] = -{ - VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW, - VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF, - VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW, - VRR_APP_OVERRIDE_REQUEST_STATE_ULMB, - VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH, -}; - -EValues_VRR_MODE g_valuesVRR_MODE[VRR_MODE_NUM_VALUES] = -{ - VRR_MODE_DISABLED, - VRR_MODE_FULLSCREEN_ONLY, - VRR_MODE_FULLSCREEN_AND_WINDOWED, -}; - -EValues_VSYNCSMOOTHAFR g_valuesVSYNCSMOOTHAFR[VSYNCSMOOTHAFR_NUM_VALUES] = -{ - VSYNCSMOOTHAFR_OFF, - VSYNCSMOOTHAFR_ON, -}; - -EValues_VSYNCVRRCONTROL g_valuesVSYNCVRRCONTROL[VSYNCVRRCONTROL_NUM_VALUES] = -{ - VSYNCVRRCONTROL_DISABLE, - VSYNCVRRCONTROL_ENABLE, - VSYNCVRRCONTROL_NOTSUPPORTED, -}; - -EValues_VSYNC_BEHAVIOR_FLAGS g_valuesVSYNC_BEHAVIOR_FLAGS[VSYNC_BEHAVIOR_FLAGS_NUM_VALUES] = -{ - VSYNC_BEHAVIOR_FLAGS_NONE, - VSYNC_BEHAVIOR_FLAGS_DEFAULT, - VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE, -}; - -EValues_WKS_API_STEREO_EYES_EXCHANGE g_valuesWKS_API_STEREO_EYES_EXCHANGE[WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES] = -{ - WKS_API_STEREO_EYES_EXCHANGE_OFF, - WKS_API_STEREO_EYES_EXCHANGE_ON, -}; - -EValues_WKS_API_STEREO_MODE g_valuesWKS_API_STEREO_MODE[WKS_API_STEREO_MODE_NUM_VALUES] = -{ - WKS_API_STEREO_MODE_SHUTTER_GLASSES, - WKS_API_STEREO_MODE_VERTICAL_INTERLACED, - WKS_API_STEREO_MODE_TWINVIEW, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1, - WKS_API_STEREO_MODE_COLOR_LINE, - WKS_API_STEREO_MODE_COLOR_INTERLEAVED, - WKS_API_STEREO_MODE_ANAGLYPH, - WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED, - WKS_API_STEREO_MODE_SIDE_FIELD, - WKS_API_STEREO_MODE_SUB_FIELD, - WKS_API_STEREO_MODE_CHECKERBOARD, - WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD, - WKS_API_STEREO_MODE_TRIDELITY_SL, - WKS_API_STEREO_MODE_TRIDELITY_MV, - WKS_API_STEREO_MODE_SEEFRONT, - WKS_API_STEREO_MODE_STEREO_MIRROR, - WKS_API_STEREO_MODE_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE, - WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_DP_INBAND, - WKS_API_STEREO_MODE_USE_HW_DEFAULT, - WKS_API_STEREO_MODE_DEFAULT_GL, -}; - -EValues_WKS_STEREO_DONGLE_SUPPORT g_valuesWKS_STEREO_DONGLE_SUPPORT[WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES] = -{ - WKS_STEREO_DONGLE_SUPPORT_OFF, - WKS_STEREO_DONGLE_SUPPORT_DAC, - WKS_STEREO_DONGLE_SUPPORT_DLP, -}; - -EValues_WKS_STEREO_SUPPORT g_valuesWKS_STEREO_SUPPORT[WKS_STEREO_SUPPORT_NUM_VALUES] = -{ - WKS_STEREO_SUPPORT_OFF, - WKS_STEREO_SUPPORT_ON, -}; - -EValues_WKS_STEREO_SWAP_MODE g_valuesWKS_STEREO_SWAP_MODE[WKS_STEREO_SWAP_MODE_NUM_VALUES] = -{ - WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL, - WKS_STEREO_SWAP_MODE_PER_EYE, - WKS_STEREO_SWAP_MODE_PER_EYE_PAIR, - WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR, - WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP, -}; - -EValues_AO_MODE g_valuesAO_MODE[AO_MODE_NUM_VALUES] = -{ - AO_MODE_OFF, - AO_MODE_LOW, - AO_MODE_MEDIUM, - AO_MODE_HIGH, -}; - -EValues_AO_MODE_ACTIVE g_valuesAO_MODE_ACTIVE[AO_MODE_ACTIVE_NUM_VALUES] = -{ - AO_MODE_ACTIVE_DISABLED, - AO_MODE_ACTIVE_ENABLED, -}; - -EValues_AUTO_LODBIASADJUST g_valuesAUTO_LODBIASADJUST[AUTO_LODBIASADJUST_NUM_VALUES] = -{ - AUTO_LODBIASADJUST_OFF, - AUTO_LODBIASADJUST_ON, -}; - -EValues_EXPORT_PERF_COUNTERS_DX9_ONLY g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY[EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES] = -{ - EXPORT_PERF_COUNTERS_DX9_ONLY_OFF, - EXPORT_PERF_COUNTERS_DX9_ONLY_ON, -}; - -EValues_LODBIASADJUST g_valuesLODBIASADJUST[LODBIASADJUST_NUM_VALUES] = -{ - LODBIASADJUST_MIN, - LODBIASADJUST_MAX, -}; - -EValues_MAXWELL_B_SAMPLE_INTERLEAVE g_valuesMAXWELL_B_SAMPLE_INTERLEAVE[MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES] = -{ - MAXWELL_B_SAMPLE_INTERLEAVE_OFF, - MAXWELL_B_SAMPLE_INTERLEAVE_ON, -}; - -EValues_PRERENDERLIMIT g_valuesPRERENDERLIMIT[PRERENDERLIMIT_NUM_VALUES] = -{ - PRERENDERLIMIT_MIN, - PRERENDERLIMIT_MAX, - PRERENDERLIMIT_APP_CONTROLLED, -}; - -EValues_PS_SHADERDISKCACHE g_valuesPS_SHADERDISKCACHE[PS_SHADERDISKCACHE_NUM_VALUES] = -{ - PS_SHADERDISKCACHE_OFF, - PS_SHADERDISKCACHE_ON, -}; - -EValues_PS_SHADERDISKCACHE_MAX_SIZE g_valuesPS_SHADERDISKCACHE_MAX_SIZE[PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES] = -{ - PS_SHADERDISKCACHE_MAX_SIZE_MIN, - PS_SHADERDISKCACHE_MAX_SIZE_MAX, -}; - -EValues_PS_TEXFILTER_ANISO_OPTS2 g_valuesPS_TEXFILTER_ANISO_OPTS2[PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES] = -{ - PS_TEXFILTER_ANISO_OPTS2_OFF, - PS_TEXFILTER_ANISO_OPTS2_ON, -}; - -EValues_PS_TEXFILTER_BILINEAR_IN_ANISO g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO[PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES] = -{ - PS_TEXFILTER_BILINEAR_IN_ANISO_OFF, - PS_TEXFILTER_BILINEAR_IN_ANISO_ON, -}; - -EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE[PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES] = -{ - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON, -}; - -EValues_PS_TEXFILTER_NO_NEG_LODBIAS g_valuesPS_TEXFILTER_NO_NEG_LODBIAS[PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES] = -{ - PS_TEXFILTER_NO_NEG_LODBIAS_OFF, - PS_TEXFILTER_NO_NEG_LODBIAS_ON, -}; - -EValues_QUALITY_ENHANCEMENTS g_valuesQUALITY_ENHANCEMENTS[QUALITY_ENHANCEMENTS_NUM_VALUES] = -{ - QUALITY_ENHANCEMENTS_HIGHQUALITY, - QUALITY_ENHANCEMENTS_QUALITY, - QUALITY_ENHANCEMENTS_PERFORMANCE, - QUALITY_ENHANCEMENTS_HIGHPERFORMANCE, -}; - -EValues_QUALITY_ENHANCEMENT_SUBSTITUTION g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION[QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES] = -{ - QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION, - QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY, -}; - -EValues_REFRESH_RATE_OVERRIDE g_valuesREFRESH_RATE_OVERRIDE[REFRESH_RATE_OVERRIDE_NUM_VALUES] = -{ - REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED, - REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE, - REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK, -}; - -EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE[SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES] = -{ - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON, -}; - -EValues_SET_VAB_DATA g_valuesSET_VAB_DATA[SET_VAB_DATA_NUM_VALUES] = -{ - SET_VAB_DATA_ZERO, - SET_VAB_DATA_UINT_ONE, - SET_VAB_DATA_FLOAT_ONE, - SET_VAB_DATA_FLOAT_POS_INF, - SET_VAB_DATA_FLOAT_NAN, - SET_VAB_DATA_USE_API_DEFAULTS, -}; - -EValues_VSYNCMODE g_valuesVSYNCMODE[VSYNCMODE_NUM_VALUES] = -{ - VSYNCMODE_PASSIVE, - VSYNCMODE_FORCEOFF, - VSYNCMODE_FORCEON, - VSYNCMODE_FLIPINTERVAL2, - VSYNCMODE_FLIPINTERVAL3, - VSYNCMODE_FLIPINTERVAL4, - VSYNCMODE_VIRTUAL, -}; - -EValues_VSYNCTEARCONTROL g_valuesVSYNCTEARCONTROL[VSYNCTEARCONTROL_NUM_VALUES] = -{ - VSYNCTEARCONTROL_DISABLE, - VSYNCTEARCONTROL_ENABLE, -}; - - -SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] = -{ - {OGL_AA_LINE_GAMMA_ID, OGL_AA_LINE_GAMMA_STRING, 4, (NvU32 *)g_valuesOGL_AA_LINE_GAMMA, OGL_AA_LINE_GAMMA_DISABLED}, - {OGL_CPL_GDI_COMPATIBILITY_ID, OGL_CPL_GDI_COMPATIBILITY_STRING, 3, (NvU32 *)g_valuesOGL_CPL_GDI_COMPATIBILITY, OGL_CPL_GDI_COMPATIBILITY_AUTO}, - {OGL_CPL_PREFER_DXPRESENT_ID, OGL_CPL_PREFER_DXPRESENT_STRING, 3, (NvU32 *)g_valuesOGL_CPL_PREFER_DXPRESENT, OGL_CPL_PREFER_DXPRESENT_AUTO}, - {OGL_DEEP_COLOR_SCANOUT_ID, OGL_DEEP_COLOR_SCANOUT_STRING, 2, (NvU32 *)g_valuesOGL_DEEP_COLOR_SCANOUT, OGL_DEEP_COLOR_SCANOUT_ENABLE}, - {OGL_DEFAULT_SWAP_INTERVAL_ID, OGL_DEFAULT_SWAP_INTERVAL_STRING, 9, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL, OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE}, - {OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID, OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL, 0x00000000}, - {OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID, OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN, OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE}, - {OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID, OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING, 5, (NvU32 *)g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD, OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL}, - {OGL_EXTENSION_STRING_VERSION_ID, OGL_EXTENSION_STRING_VERSION_STRING, 0, NULL, 0x00000000}, - {OGL_FORCE_BLIT_ID, OGL_FORCE_BLIT_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_BLIT, OGL_FORCE_BLIT_OFF}, - {OGL_FORCE_STEREO_ID, OGL_FORCE_STEREO_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_STEREO, OGL_FORCE_STEREO_OFF}, - {OGL_MAX_FRAMES_ALLOWED_ID, OGL_MAX_FRAMES_ALLOWED_STRING, 0, NULL, 0x00000002}, - {OGL_OVERLAY_PIXEL_TYPE_ID, OGL_OVERLAY_PIXEL_TYPE_STRING, 4, (NvU32 *)g_valuesOGL_OVERLAY_PIXEL_TYPE, OGL_OVERLAY_PIXEL_TYPE_CI}, - {OGL_OVERLAY_SUPPORT_ID, OGL_OVERLAY_SUPPORT_STRING, 3, (NvU32 *)g_valuesOGL_OVERLAY_SUPPORT, OGL_OVERLAY_SUPPORT_OFF}, - {OGL_QUALITY_ENHANCEMENTS_ID, OGL_QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesOGL_QUALITY_ENHANCEMENTS, OGL_QUALITY_ENHANCEMENTS_QUAL}, - {OGL_SINGLE_BACKDEPTH_BUFFER_ID, OGL_SINGLE_BACKDEPTH_BUFFER_STRING, 3, (NvU32 *)g_valuesOGL_SINGLE_BACKDEPTH_BUFFER, OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE}, - {OGL_SLI_MULTICAST_ID, OGL_SLI_MULTICAST_STRING, 4, (NvU32 *)g_valuesOGL_SLI_MULTICAST, OGL_SLI_MULTICAST_DISABLE}, - {OGL_THREAD_CONTROL_ID, OGL_THREAD_CONTROL_STRING, 2, (NvU32 *)g_valuesOGL_THREAD_CONTROL, 0x00000000}, - {OGL_TMON_LEVEL_ID, OGL_TMON_LEVEL_STRING, 6, (NvU32 *)g_valuesOGL_TMON_LEVEL, OGL_TMON_LEVEL_MOST}, - {OGL_TRIPLE_BUFFER_ID, OGL_TRIPLE_BUFFER_STRING, 2, (NvU32 *)g_valuesOGL_TRIPLE_BUFFER, OGL_TRIPLE_BUFFER_DISABLED}, - {AA_BEHAVIOR_FLAGS_ID, AA_BEHAVIOR_FLAGS_STRING, 18, (NvU32 *)g_valuesAA_BEHAVIOR_FLAGS, AA_BEHAVIOR_FLAGS_DEFAULT}, - {AA_MODE_ALPHATOCOVERAGE_ID, AA_MODE_ALPHATOCOVERAGE_STRING, 4, (NvU32 *)g_valuesAA_MODE_ALPHATOCOVERAGE, 0x00000000}, - {AA_MODE_GAMMACORRECTION_ID, AA_MODE_GAMMACORRECTION_STRING, 8, (NvU32 *)g_valuesAA_MODE_GAMMACORRECTION, 0x00000000}, - {AA_MODE_METHOD_ID, AA_MODE_METHOD_STRING, 50, (NvU32 *)g_valuesAA_MODE_METHOD, AA_MODE_METHOD_NONE}, - {AA_MODE_REPLAY_ID, AA_MODE_REPLAY_STRING, 20, (NvU32 *)g_valuesAA_MODE_REPLAY, 0x00000000}, - {AA_MODE_SELECTOR_ID, AA_MODE_SELECTOR_STRING, 5, (NvU32 *)g_valuesAA_MODE_SELECTOR, AA_MODE_SELECTOR_APP_CONTROL}, - {AA_MODE_SELECTOR_SLIAA_ID, AA_MODE_SELECTOR_SLIAA_STRING, 2, (NvU32 *)g_valuesAA_MODE_SELECTOR_SLIAA, AA_MODE_SELECTOR_SLIAA_DISABLED}, - {ANISO_MODE_LEVEL_ID, ANISO_MODE_LEVEL_STRING, 5, (NvU32 *)g_valuesANISO_MODE_LEVEL, ANISO_MODE_LEVEL_DEFAULT}, - {ANISO_MODE_SELECTOR_ID, ANISO_MODE_SELECTOR_STRING, 6, (NvU32 *)g_valuesANISO_MODE_SELECTOR, ANISO_MODE_SELECTOR_DEFAULT}, - {ANSEL_ALLOW_ID, ANSEL_ALLOW_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOW, ANSEL_ALLOW_ALLOWED}, - {ANSEL_ALLOWLISTED_ID, ANSEL_ALLOWLISTED_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOWLISTED, ANSEL_ALLOWLISTED_DISALLOWED}, - {ANSEL_ENABLE_ID, ANSEL_ENABLE_STRING, 2, (NvU32 *)g_valuesANSEL_ENABLE, ANSEL_ENABLE_ON}, - {APPIDLE_DYNAMIC_FRL_FPS_ID, APPIDLE_DYNAMIC_FRL_FPS_STRING, 0, NULL, 0x00000000}, - {APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_ID, APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_STRING, 0, NULL, 0x00000000}, - {APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING, 6, (NvU32 *)g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED}, - {APPLICATION_STEAM_ID_ID, APPLICATION_STEAM_ID_STRING, 0, NULL, 0x00000000}, - {BATTERY_BOOST_APP_FPS_ID, BATTERY_BOOST_APP_FPS_STRING, 3, (NvU32 *)g_valuesBATTERY_BOOST_APP_FPS, BATTERY_BOOST_APP_FPS_NO_OVERRIDE}, - {CPL_HIDDEN_PROFILE_ID, CPL_HIDDEN_PROFILE_STRING, 2, (NvU32 *)g_valuesCPL_HIDDEN_PROFILE, CPL_HIDDEN_PROFILE_DISABLED}, - {EXPORT_PERF_COUNTERS_ID, EXPORT_PERF_COUNTERS_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS, EXPORT_PERF_COUNTERS_OFF}, - {EXTERNAL_QUIET_MODE_ID, EXTERNAL_QUIET_MODE_STRING, 2, (NvU32 *)g_valuesEXTERNAL_QUIET_MODE, EXTERNAL_QUIET_MODE_OFF}, - {FRL_FPS_ID, FRL_FPS_STRING, 3, (NvU32 *)g_valuesFRL_FPS, FRL_FPS_DISABLED}, - {FXAA_ALLOW_ID, FXAA_ALLOW_STRING, 2, (NvU32 *)g_valuesFXAA_ALLOW, FXAA_ALLOW_ALLOWED}, - {FXAA_ENABLE_ID, FXAA_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_ENABLE, FXAA_ENABLE_OFF}, - {FXAA_INDICATOR_ENABLE_ID, FXAA_INDICATOR_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_INDICATOR_ENABLE, FXAA_INDICATOR_ENABLE_OFF}, - {LATENCY_INDICATOR_AUTOALIGN_ID, LATENCY_INDICATOR_AUTOALIGN_STRING, 2, (NvU32 *)g_valuesLATENCY_INDICATOR_AUTOALIGN, LATENCY_INDICATOR_AUTOALIGN_ENABLED}, - {MCSFRSHOWSPLIT_ID, MCSFRSHOWSPLIT_STRING, 2, (NvU32 *)g_valuesMCSFRSHOWSPLIT, MCSFRSHOWSPLIT_DISABLED}, - {NV_QUALITY_UPSCALING_ID, NV_QUALITY_UPSCALING_STRING, 2, (NvU32 *)g_valuesNV_QUALITY_UPSCALING, NV_QUALITY_UPSCALING_OFF}, - {OPTIMUS_MAXAA_ID, OPTIMUS_MAXAA_STRING, 2, (NvU32 *)g_valuesOPTIMUS_MAXAA, 0x00000000}, - {PHYSXINDICATOR_ID, PHYSXINDICATOR_STRING, 2, (NvU32 *)g_valuesPHYSXINDICATOR, PHYSXINDICATOR_DISABLED}, - {PREFERRED_PSTATE_ID, PREFERRED_PSTATE_STRING, 8, (NvU32 *)g_valuesPREFERRED_PSTATE, PREFERRED_PSTATE_OPTIMAL_POWER}, - {PREVENT_UI_AF_OVERRIDE_ID, PREVENT_UI_AF_OVERRIDE_STRING, 2, (NvU32 *)g_valuesPREVENT_UI_AF_OVERRIDE, PREVENT_UI_AF_OVERRIDE_OFF}, - {SHIM_MAXRES_ID, SHIM_MAXRES_STRING, 0, NULL, 0x00000000}, - {SHIM_MCCOMPAT_ID, SHIM_MCCOMPAT_STRING, 8, (NvU32 *)g_valuesSHIM_MCCOMPAT, SHIM_MCCOMPAT_AUTO_SELECT}, - {SHIM_RENDERING_MODE_ID, SHIM_RENDERING_MODE_STRING, 8, (NvU32 *)g_valuesSHIM_RENDERING_MODE, SHIM_RENDERING_MODE_AUTO_SELECT}, - {SHIM_RENDERING_OPTIONS_ID, SHIM_RENDERING_OPTIONS_STRING, 28, (NvU32 *)g_valuesSHIM_RENDERING_OPTIONS, 0x00000000}, - {SLI_GPU_COUNT_ID, SLI_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_GPU_COUNT, SLI_GPU_COUNT_AUTOSELECT}, - {SLI_PREDEFINED_GPU_COUNT_ID, SLI_PREDEFINED_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT, SLI_PREDEFINED_GPU_COUNT_AUTOSELECT}, - {SLI_PREDEFINED_GPU_COUNT_DX10_ID, SLI_PREDEFINED_GPU_COUNT_DX10_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT_DX10, SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT}, - {SLI_PREDEFINED_MODE_ID, SLI_PREDEFINED_MODE_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE, SLI_PREDEFINED_MODE_AUTOSELECT}, - {SLI_PREDEFINED_MODE_DX10_ID, SLI_PREDEFINED_MODE_DX10_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE_DX10, SLI_PREDEFINED_MODE_DX10_AUTOSELECT}, - {SLI_RENDERING_MODE_ID, SLI_RENDERING_MODE_STRING, 6, (NvU32 *)g_valuesSLI_RENDERING_MODE, SLI_RENDERING_MODE_AUTOSELECT}, - {VRPRERENDERLIMIT_ID, VRPRERENDERLIMIT_STRING, 4, (NvU32 *)g_valuesVRPRERENDERLIMIT, VRPRERENDERLIMIT_DEFAULT}, - {VRRFEATUREINDICATOR_ID, VRRFEATUREINDICATOR_STRING, 2, (NvU32 *)g_valuesVRRFEATUREINDICATOR, VRRFEATUREINDICATOR_ENABLED}, - {VRROVERLAYINDICATOR_ID, VRROVERLAYINDICATOR_STRING, 2, (NvU32 *)g_valuesVRROVERLAYINDICATOR, VRROVERLAYINDICATOR_ENABLED}, - {VRRREQUESTSTATE_ID, VRRREQUESTSTATE_STRING, 3, (NvU32 *)g_valuesVRRREQUESTSTATE, VRRREQUESTSTATE_FULLSCREEN_ONLY}, - {VRR_APP_OVERRIDE_ID, VRR_APP_OVERRIDE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE, VRR_APP_OVERRIDE_ALLOW}, - {VRR_APP_OVERRIDE_REQUEST_STATE_ID, VRR_APP_OVERRIDE_REQUEST_STATE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE_REQUEST_STATE, VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW}, - {VRR_MODE_ID, VRR_MODE_STRING, 3, (NvU32 *)g_valuesVRR_MODE, VRR_MODE_FULLSCREEN_ONLY}, - {VSYNCSMOOTHAFR_ID, VSYNCSMOOTHAFR_STRING, 2, (NvU32 *)g_valuesVSYNCSMOOTHAFR, VSYNCSMOOTHAFR_OFF}, - {VSYNCVRRCONTROL_ID, VSYNCVRRCONTROL_STRING, 3, (NvU32 *)g_valuesVSYNCVRRCONTROL, VSYNCVRRCONTROL_ENABLE}, - {VSYNC_BEHAVIOR_FLAGS_ID, VSYNC_BEHAVIOR_FLAGS_STRING, 3, (NvU32 *)g_valuesVSYNC_BEHAVIOR_FLAGS, VSYNC_BEHAVIOR_FLAGS_DEFAULT}, - {WKS_API_STEREO_EYES_EXCHANGE_ID, WKS_API_STEREO_EYES_EXCHANGE_STRING, 2, (NvU32 *)g_valuesWKS_API_STEREO_EYES_EXCHANGE, WKS_API_STEREO_EYES_EXCHANGE_OFF}, - {WKS_API_STEREO_MODE_ID, WKS_API_STEREO_MODE_STRING, 25, (NvU32 *)g_valuesWKS_API_STEREO_MODE, WKS_API_STEREO_MODE_SHUTTER_GLASSES}, - {WKS_STEREO_DONGLE_SUPPORT_ID, WKS_STEREO_DONGLE_SUPPORT_STRING, 3, (NvU32 *)g_valuesWKS_STEREO_DONGLE_SUPPORT, WKS_STEREO_DONGLE_SUPPORT_DAC}, - {WKS_STEREO_SUPPORT_ID, WKS_STEREO_SUPPORT_STRING, 2, (NvU32 *)g_valuesWKS_STEREO_SUPPORT, WKS_STEREO_SUPPORT_OFF}, - {WKS_STEREO_SWAP_MODE_ID, WKS_STEREO_SWAP_MODE_STRING, 5, (NvU32 *)g_valuesWKS_STEREO_SWAP_MODE, WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL}, - {AO_MODE_ID, AO_MODE_STRING, 4, (NvU32 *)g_valuesAO_MODE, AO_MODE_OFF}, - {AO_MODE_ACTIVE_ID, AO_MODE_ACTIVE_STRING, 2, (NvU32 *)g_valuesAO_MODE_ACTIVE, AO_MODE_ACTIVE_DISABLED}, - {AUTO_LODBIASADJUST_ID, AUTO_LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesAUTO_LODBIASADJUST, AUTO_LODBIASADJUST_ON}, - {EXPORT_PERF_COUNTERS_DX9_ONLY_ID, EXPORT_PERF_COUNTERS_DX9_ONLY_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY, EXPORT_PERF_COUNTERS_DX9_ONLY_OFF}, - {LODBIASADJUST_ID, LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesLODBIASADJUST, 0x00000000}, - {MAXWELL_B_SAMPLE_INTERLEAVE_ID, MAXWELL_B_SAMPLE_INTERLEAVE_STRING, 2, (NvU32 *)g_valuesMAXWELL_B_SAMPLE_INTERLEAVE, MAXWELL_B_SAMPLE_INTERLEAVE_OFF}, - {PRERENDERLIMIT_ID, PRERENDERLIMIT_STRING, 3, (NvU32 *)g_valuesPRERENDERLIMIT, PRERENDERLIMIT_APP_CONTROLLED}, - {PS_SHADERDISKCACHE_ID, PS_SHADERDISKCACHE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE, PS_SHADERDISKCACHE_ON}, - {PS_SHADERDISKCACHE_MAX_SIZE_ID, PS_SHADERDISKCACHE_MAX_SIZE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE_MAX_SIZE, 0x00000000}, - {PS_TEXFILTER_ANISO_OPTS2_ID, PS_TEXFILTER_ANISO_OPTS2_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_ANISO_OPTS2, PS_TEXFILTER_ANISO_OPTS2_OFF}, - {PS_TEXFILTER_BILINEAR_IN_ANISO_ID, PS_TEXFILTER_BILINEAR_IN_ANISO_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO, PS_TEXFILTER_BILINEAR_IN_ANISO_OFF}, - {PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF}, - {PS_TEXFILTER_NO_NEG_LODBIAS_ID, PS_TEXFILTER_NO_NEG_LODBIAS_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_NO_NEG_LODBIAS, PS_TEXFILTER_NO_NEG_LODBIAS_OFF}, - {QUALITY_ENHANCEMENTS_ID, QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesQUALITY_ENHANCEMENTS, QUALITY_ENHANCEMENTS_QUALITY}, - {QUALITY_ENHANCEMENT_SUBSTITUTION_ID, QUALITY_ENHANCEMENT_SUBSTITUTION_STRING, 2, (NvU32 *)g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION, QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION}, - {REFRESH_RATE_OVERRIDE_ID, REFRESH_RATE_OVERRIDE_STRING, 3, (NvU32 *)g_valuesREFRESH_RATE_OVERRIDE, REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED}, - {SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING, 2, (NvU32 *)g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF}, - {SET_VAB_DATA_ID, SET_VAB_DATA_STRING, 6, (NvU32 *)g_valuesSET_VAB_DATA, SET_VAB_DATA_USE_API_DEFAULTS}, - {VSYNCMODE_ID, VSYNCMODE_STRING, 7, (NvU32 *)g_valuesVSYNCMODE, VSYNCMODE_PASSIVE}, - {VSYNCTEARCONTROL_ID, VSYNCTEARCONTROL_STRING, 2, (NvU32 *)g_valuesVSYNCTEARCONTROL, VSYNCTEARCONTROL_DISABLE}, -}; - -SettingWSTRINGNameString mapSettingWSTRING[TOTAL_WSTRING_SETTING_NUM] = -{ - {OGL_IMPLICIT_GPU_AFFINITY_ID, OGL_IMPLICIT_GPU_AFFINITY_STRING, 1, (const wchar_t **)g_valuesOGL_IMPLICIT_GPU_AFFINITY, L"autoselect"}, - {CUDA_EXCLUDED_GPUS_ID, CUDA_EXCLUDED_GPUS_STRING, 1, (const wchar_t **)g_valuesCUDA_EXCLUDED_GPUS, L"none"}, - {D3DOGL_GPU_MAX_POWER_ID, D3DOGL_GPU_MAX_POWER_STRING, 1, (const wchar_t **)g_valuesD3DOGL_GPU_MAX_POWER, L"0"}, - {ICAFE_LOGO_CONFIG_ID, ICAFE_LOGO_CONFIG_STRING, 0, NULL, L""}, - {PS_SHADERDISKCACHE_DLL_PATH_WCHAR_ID, PS_SHADERDISKCACHE_DLL_PATH_WCHAR_STRING, 0, NULL, L""}, -}; - diff --git a/参考/NexBox-main/R560-developer/NvApiDriverSettings.h b/参考/NexBox-main/R560-developer/NvApiDriverSettings.h deleted file mode 100644 index df1d48a..0000000 --- a/参考/NexBox-main/R560-developer/NvApiDriverSettings.h +++ /dev/null @@ -1,1161 +0,0 @@ -/***************************************************************************\ -|* *| -|* Copyright NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This source code is subject to NVIDIA ownership rights under U.S. *| -|* and international Copyright laws. Users and possessors of this *| -|* source code are hereby granted a nonexclusive, royalty-free *| -|* license to use this code in individual and commercial software. *| -|* *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *| -|* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *| -|* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *| -|* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *| -|* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *| -|* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *| -|* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *| -|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *| -|* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *| -|* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *| -|* CODE. *| -|* *| -|* U.S. Government End Users. This source code is a "commercial item" *| -|* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *| -|* of "commercial computer software" and "commercial computer software *| -|* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *| -|* and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *| -|* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *| -|* source code with only those rights set forth herein. *| -|* *| -|* Any use of this source code in individual and commercial software must *| -|* include, in the user documentation and internal comments to the code, *| -|* the above Disclaimer and U.S. Government End Users Notice. *| -|* *| -|* *| -\***************************************************************************/ - -#ifndef _NVAPI_DRIVER_SETTINGS_H_ -#define _NVAPI_DRIVER_SETTINGS_H_ - -#define OGL_AA_LINE_GAMMA_STRING L"Antialiasing - Line gamma" -#define OGL_CPL_GDI_COMPATIBILITY_STRING L"OpenGL GDI compatibility" -#define OGL_CPL_PREFER_DXPRESENT_STRING L"Vulkan/OpenGL present method" -#define OGL_DEEP_COLOR_SCANOUT_STRING L"Deep color for 3D applications" -#define OGL_DEFAULT_SWAP_INTERVAL_STRING L"OpenGL default swap interval" -#define OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING L"OpenGL default swap interval fraction" -#define OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING L"OpenGL default swap interval sign" -#define OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING L"Event Log Severity Threshold" -#define OGL_EXTENSION_STRING_VERSION_STRING L"Extension String version" -#define OGL_FORCE_BLIT_STRING L"Buffer-flipping mode" -#define OGL_FORCE_STEREO_STRING L"Force Stereo shuttering" -#define OGL_IMPLICIT_GPU_AFFINITY_STRING L"Preferred OpenGL GPU" -#define OGL_MAX_FRAMES_ALLOWED_STRING L"Maximum frames allowed" -#define OGL_OVERLAY_PIXEL_TYPE_STRING L"Exported Overlay pixel types" -#define OGL_OVERLAY_SUPPORT_STRING L"Enable overlay" -#define OGL_QUALITY_ENHANCEMENTS_STRING L"High level control of the rendering quality on OpenGL" -#define OGL_SINGLE_BACKDEPTH_BUFFER_STRING L"Unified back/depth buffer" -#define OGL_SLI_MULTICAST_STRING L"Enable NV_gpu_multicast extension" -#define OGL_THREAD_CONTROL_STRING L"Threaded optimization" -#define OGL_TMON_LEVEL_STRING L"Event Log Tmon Severity Threshold" -#define OGL_TRIPLE_BUFFER_STRING L"Triple buffering" -#define AA_BEHAVIOR_FLAGS_STRING L"Antialiasing - Behavior Flags" -#define AA_MODE_ALPHATOCOVERAGE_STRING L"Antialiasing - Transparency Multisampling" -#define AA_MODE_GAMMACORRECTION_STRING L"Antialiasing - Gamma correction" -#define AA_MODE_METHOD_STRING L"Antialiasing - Setting" -#define AA_MODE_REPLAY_STRING L"Antialiasing - Transparency Supersampling" -#define AA_MODE_SELECTOR_STRING L"Antialiasing - Mode" -#define AA_MODE_SELECTOR_SLIAA_STRING L"Antialiasing - SLI AA" -#define ANISO_MODE_LEVEL_STRING L"Anisotropic filtering setting" -#define ANISO_MODE_SELECTOR_STRING L"Anisotropic filtering mode" -#define ANSEL_ALLOW_STRING L"NVIDIA Predefined Ansel Usage" -#define ANSEL_ALLOWLISTED_STRING L"Ansel flags for enabled applications" -#define ANSEL_ENABLE_STRING L"Enable Ansel" -#define APPIDLE_DYNAMIC_FRL_FPS_STRING L"Idle Application Max FPS Limit" -#define APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_STRING L"Idle Application Threshold Time out in seconds" -#define APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING L"Application Profile Notification Popup Timeout" -#define APPLICATION_STEAM_ID_STRING L"Steam Application ID" -#define BATTERY_BOOST_APP_FPS_STRING L"Battery Boost Application FPS" -#define CPL_HIDDEN_PROFILE_STRING L"Do not display this profile in the Control Panel" -#define CUDA_EXCLUDED_GPUS_STRING L"List of Universal GPU ids" -#define D3DOGL_GPU_MAX_POWER_STRING L"Maximum GPU Power" -#define EXPORT_PERF_COUNTERS_STRING L"Export Performance Counters" -#define EXTERNAL_QUIET_MODE_STRING L"External Quiet Mode (XQM)" -#define FRL_FPS_STRING L"Frame Rate Limiter" -#define FXAA_ALLOW_STRING L"NVIDIA Predefined FXAA Usage" -#define FXAA_ENABLE_STRING L"Enable FXAA" -#define FXAA_INDICATOR_ENABLE_STRING L"Enable FXAA Indicator" -#define LATENCY_INDICATOR_AUTOALIGN_STRING L"Autoalign flash indicator" -#define MCSFRSHOWSPLIT_STRING L"SLI indicator" -#define NV_QUALITY_UPSCALING_STRING L"NVIDIA Quality upscaling" -#define OPTIMUS_MAXAA_STRING L"Maximum AA samples allowed for a given application" -#define PHYSXINDICATOR_STRING L"Display the PhysX indicator" -#define PREFERRED_PSTATE_STRING L"Power management mode" -#define PREVENT_UI_AF_OVERRIDE_STRING L"No override of Anisotropic filtering" -#define SHIM_MAXRES_STRING L"Maximum resolution allowed for a given application" -#define SHIM_MCCOMPAT_STRING L"Optimus flags for enabled applications" -#define SHIM_RENDERING_MODE_STRING L"Enable application for Optimus" -#define SHIM_RENDERING_OPTIONS_STRING L"Shim Rendering Mode Options per application for Optimus" -#define SLI_GPU_COUNT_STRING L"Number of GPUs to use on SLI rendering mode" -#define SLI_PREDEFINED_GPU_COUNT_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode" -#define SLI_PREDEFINED_GPU_COUNT_DX10_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10" -#define SLI_PREDEFINED_MODE_STRING L"NVIDIA predefined SLI mode" -#define SLI_PREDEFINED_MODE_DX10_STRING L"NVIDIA predefined SLI mode on DirectX 10" -#define SLI_RENDERING_MODE_STRING L"SLI rendering mode" -#define VRPRERENDERLIMIT_STRING L"Virtual Reality pre-rendered frames" -#define VRRFEATUREINDICATOR_STRING L"Toggle the VRR global feature" -#define VRROVERLAYINDICATOR_STRING L"Display the VRR Overlay Indicator" -#define VRRREQUESTSTATE_STRING L"VRR requested state" -#define VRR_APP_OVERRIDE_STRING L"G-SYNC" -#define VRR_APP_OVERRIDE_REQUEST_STATE_STRING L"G-SYNC" -#define VRR_MODE_STRING L"Enable G-SYNC globally" -#define VSYNCSMOOTHAFR_STRING L"Flag to control smooth AFR behavior" -#define VSYNCVRRCONTROL_STRING L"Variable refresh Rate" -#define VSYNC_BEHAVIOR_FLAGS_STRING L"Vsync - Behavior Flags" -#define WKS_API_STEREO_EYES_EXCHANGE_STRING L"Stereo - Swap eyes" -#define WKS_API_STEREO_MODE_STRING L"Stereo - Display mode" -#define WKS_STEREO_DONGLE_SUPPORT_STRING L"Stereo - Dongle Support" -#define WKS_STEREO_SUPPORT_STRING L"Stereo - Enable" -#define WKS_STEREO_SWAP_MODE_STRING L"Stereo - swap mode" -#define AO_MODE_STRING L"Ambient Occlusion" -#define AO_MODE_ACTIVE_STRING L"NVIDIA Predefined Ambient Occlusion Usage" -#define AUTO_LODBIASADJUST_STRING L"Texture filtering - Driver Controlled LOD Bias" -#define EXPORT_PERF_COUNTERS_DX9_ONLY_STRING L"Export Performance Counters for DX9 only" -#define ICAFE_LOGO_CONFIG_STRING L"ICafe Settings" -#define LODBIASADJUST_STRING L"Texture filtering - LOD Bias" -#define MAXWELL_B_SAMPLE_INTERLEAVE_STRING L"Enable sample interleaving (MFAA)" -#define PRERENDERLIMIT_STRING L"Maximum pre-rendered frames" -#define PS_SHADERDISKCACHE_STRING L"Shader Cache" -#define PS_SHADERDISKCACHE_DLL_PATH_WCHAR_STRING L"shader cache path to dll" -#define PS_SHADERDISKCACHE_MAX_SIZE_STRING L"Shader disk cache maximum size" -#define PS_TEXFILTER_ANISO_OPTS2_STRING L"Texture filtering - Anisotropic sample optimization" -#define PS_TEXFILTER_BILINEAR_IN_ANISO_STRING L"Texture filtering - Anisotropic filter optimization" -#define PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING L"Texture filtering - Trilinear optimization" -#define PS_TEXFILTER_NO_NEG_LODBIAS_STRING L"Texture filtering - Negative LOD bias" -#define QUALITY_ENHANCEMENTS_STRING L"Texture filtering - Quality" -#define QUALITY_ENHANCEMENT_SUBSTITUTION_STRING L"Texture filtering - Quality Substitution" -#define REFRESH_RATE_OVERRIDE_STRING L"Preferred refresh rate" -#define SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING L"PowerThrottle" -#define SET_VAB_DATA_STRING L"VAB Default Data" -#define VSYNCMODE_STRING L"Vertical Sync" -#define VSYNCTEARCONTROL_STRING L"Vertical Sync Tear Control" - -enum ESetting { - OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, - OGL_CPL_GDI_COMPATIBILITY_ID = 0x2072C5A3, - OGL_CPL_PREFER_DXPRESENT_ID = 0x20D690F8, - OGL_DEEP_COLOR_SCANOUT_ID = 0x2097C2F6, - OGL_DEFAULT_SWAP_INTERVAL_ID = 0x206A6582, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID = 0x206C4581, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID = 0x20655CFA, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID = 0x209DF23E, - OGL_EXTENSION_STRING_VERSION_ID = 0x20FF7493, - OGL_FORCE_BLIT_ID = 0x201F619F, - OGL_FORCE_STEREO_ID = 0x204D9A0C, - OGL_IMPLICIT_GPU_AFFINITY_ID = 0x20D0F3E6, - OGL_MAX_FRAMES_ALLOWED_ID = 0x208E55E3, - OGL_OVERLAY_PIXEL_TYPE_ID = 0x209AE66F, - OGL_OVERLAY_SUPPORT_ID = 0x206C28C4, - OGL_QUALITY_ENHANCEMENTS_ID = 0x20797D6C, - OGL_SINGLE_BACKDEPTH_BUFFER_ID = 0x20A29055, - OGL_SLI_MULTICAST_ID = 0x2092D3BE, - OGL_THREAD_CONTROL_ID = 0x20C1221E, - OGL_TMON_LEVEL_ID = 0x202888C1, - OGL_TRIPLE_BUFFER_ID = 0x20FDD1F9, - AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82, - AA_MODE_ALPHATOCOVERAGE_ID = 0x10FC2D9C, - AA_MODE_GAMMACORRECTION_ID = 0x107D639D, - AA_MODE_METHOD_ID = 0x10D773D2, - AA_MODE_REPLAY_ID = 0x10D48A85, - AA_MODE_SELECTOR_ID = 0x107EFC5B, - AA_MODE_SELECTOR_SLIAA_ID = 0x107AFC5B, - ANISO_MODE_LEVEL_ID = 0x101E61A9, - ANISO_MODE_SELECTOR_ID = 0x10D2BB16, - ANSEL_ALLOW_ID = 0x1035DB89, - ANSEL_ALLOWLISTED_ID = 0x1085DA8A, - ANSEL_ENABLE_ID = 0x1075D972, - APPIDLE_DYNAMIC_FRL_FPS_ID = 0x10835016, - APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_ID = 0x10835017, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6, - APPLICATION_STEAM_ID_ID = 0x107CDDBC, - BATTERY_BOOST_APP_FPS_ID = 0x10115C8C, - CPL_HIDDEN_PROFILE_ID = 0x106D5CFF, - CUDA_EXCLUDED_GPUS_ID = 0x10354FF8, - D3DOGL_GPU_MAX_POWER_ID = 0x10D1EF29, - EXPORT_PERF_COUNTERS_ID = 0x108F0841, - EXTERNAL_QUIET_MODE_ID = 0x10115C8D, - FRL_FPS_ID = 0x10835002, - FXAA_ALLOW_ID = 0x1034CB89, - FXAA_ENABLE_ID = 0x1074C972, - FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C, - LATENCY_INDICATOR_AUTOALIGN_ID = 0x1095F170, - MCSFRSHOWSPLIT_ID = 0x10287051, - NV_QUALITY_UPSCALING_ID = 0x10444444, - OPTIMUS_MAXAA_ID = 0x10F9DC83, - PHYSXINDICATOR_ID = 0x1094F16F, - PREFERRED_PSTATE_ID = 0x1057EB71, - PREVENT_UI_AF_OVERRIDE_ID = 0x103BCCB5, - SHIM_MAXRES_ID = 0x10F9DC82, - SHIM_MCCOMPAT_ID = 0x10F9DC80, - SHIM_RENDERING_MODE_ID = 0x10F9DC81, - SHIM_RENDERING_OPTIONS_ID = 0x10F9DC84, - SLI_GPU_COUNT_ID = 0x1033DCD1, - SLI_PREDEFINED_GPU_COUNT_ID = 0x1033DCD2, - SLI_PREDEFINED_GPU_COUNT_DX10_ID = 0x1033DCD3, - SLI_PREDEFINED_MODE_ID = 0x1033CEC1, - SLI_PREDEFINED_MODE_DX10_ID = 0x1033CEC2, - SLI_RENDERING_MODE_ID = 0x1033CED1, - VRPRERENDERLIMIT_ID = 0x10111133, - VRRFEATUREINDICATOR_ID = 0x1094F157, - VRROVERLAYINDICATOR_ID = 0x1095F16F, - VRRREQUESTSTATE_ID = 0x1094F1F7, - VRR_APP_OVERRIDE_ID = 0x10A879CF, - VRR_APP_OVERRIDE_REQUEST_STATE_ID = 0x10A879AC, - VRR_MODE_ID = 0x1194F158, - VSYNCSMOOTHAFR_ID = 0x101AE763, - VSYNCVRRCONTROL_ID = 0x10A879CE, - VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, - WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, - WKS_API_STEREO_MODE_ID = 0x11E91A61, - WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, - WKS_STEREO_SUPPORT_ID = 0x11AA9E99, - WKS_STEREO_SWAP_MODE_ID = 0x11333333, - AO_MODE_ID = 0x00667329, - AO_MODE_ACTIVE_ID = 0x00664339, - AUTO_LODBIASADJUST_ID = 0x00638E8F, - EXPORT_PERF_COUNTERS_DX9_ONLY_ID = 0x00B65E72, - ICAFE_LOGO_CONFIG_ID = 0x00DB1337, - LODBIASADJUST_ID = 0x00738E8F, - MAXWELL_B_SAMPLE_INTERLEAVE_ID = 0x0098C1AC, - PRERENDERLIMIT_ID = 0x007BA09E, - PS_SHADERDISKCACHE_ID = 0x00198FFF, - PS_SHADERDISKCACHE_DLL_PATH_WCHAR_ID = 0x0019A002, - PS_SHADERDISKCACHE_MAX_SIZE_ID = 0x00AC8497, - PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, - PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID = 0x002ECAF2, - PS_TEXFILTER_NO_NEG_LODBIAS_ID = 0x0019BB68, - QUALITY_ENHANCEMENTS_ID = 0x00CE2691, - QUALITY_ENHANCEMENT_SUBSTITUTION_ID = 0x00CE2692, - REFRESH_RATE_OVERRIDE_ID = 0x0064B541, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID = 0x00AE785C, - SET_VAB_DATA_ID = 0x00AB8687, - VSYNCMODE_ID = 0x00A879CF, - VSYNCTEARCONTROL_ID = 0x005A375C, - TOTAL_DWORD_SETTING_NUM = 96, - TOTAL_WSTRING_SETTING_NUM = 5, - TOTAL_SETTING_NUM = 101, - INVALID_SETTING_ID = 0xFFFFFFFF -}; - -enum EValues_OGL_AA_LINE_GAMMA { - OGL_AA_LINE_GAMMA_DISABLED = 0x10, - OGL_AA_LINE_GAMMA_ENABLED = 0x23, - OGL_AA_LINE_GAMMA_MIN = 1, - OGL_AA_LINE_GAMMA_MAX = 100, - OGL_AA_LINE_GAMMA_NUM_VALUES = 4, - OGL_AA_LINE_GAMMA_DEFAULT = OGL_AA_LINE_GAMMA_DISABLED -}; - -enum EValues_OGL_CPL_GDI_COMPATIBILITY { - OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED = 0x00000000, - OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED = 0x00000001, - OGL_CPL_GDI_COMPATIBILITY_AUTO = 0x00000002, - OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES = 3, - OGL_CPL_GDI_COMPATIBILITY_DEFAULT = OGL_CPL_GDI_COMPATIBILITY_AUTO -}; - -enum EValues_OGL_CPL_PREFER_DXPRESENT { - OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED = 0x00000000, - OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED = 0x00000001, - OGL_CPL_PREFER_DXPRESENT_AUTO = 0x00000002, - OGL_CPL_PREFER_DXPRESENT_NUM_VALUES = 3, - OGL_CPL_PREFER_DXPRESENT_DEFAULT = OGL_CPL_PREFER_DXPRESENT_AUTO -}; - -enum EValues_OGL_DEEP_COLOR_SCANOUT { - OGL_DEEP_COLOR_SCANOUT_DISABLE = 0, - OGL_DEEP_COLOR_SCANOUT_ENABLE = 1, - OGL_DEEP_COLOR_SCANOUT_NUM_VALUES = 2, - OGL_DEEP_COLOR_SCANOUT_DEFAULT = OGL_DEEP_COLOR_SCANOUT_ENABLE -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL { - OGL_DEFAULT_SWAP_INTERVAL_TEAR = 0, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE = 1, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC = 1, - OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK = 0x0000FFFF, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK = 0xF0000000, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF = 0xF0000000, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON = 0x10000000, - OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED = 0x00000000, - OGL_DEFAULT_SWAP_INTERVAL_DISABLE = 0xffffffff, - OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES = 9, - OGL_DEFAULT_SWAP_INTERVAL_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL { - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES = 0, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES = 100, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES = 2, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_DEFAULT = 0U -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN { - OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE = 0, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE = 1, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES = 2, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE -}; - -enum EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD { - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE = 0, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL = 1, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING = 2, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION = 3, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL = 4, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES = 5, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DEFAULT = OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL -}; - -enum EValues_OGL_FORCE_BLIT { - OGL_FORCE_BLIT_ON = 1, - OGL_FORCE_BLIT_OFF = 0, - OGL_FORCE_BLIT_NUM_VALUES = 2, - OGL_FORCE_BLIT_DEFAULT = OGL_FORCE_BLIT_OFF -}; - -enum EValues_OGL_FORCE_STEREO { - OGL_FORCE_STEREO_OFF = 0, - OGL_FORCE_STEREO_ON = 1, - OGL_FORCE_STEREO_NUM_VALUES = 2, - OGL_FORCE_STEREO_DEFAULT = OGL_FORCE_STEREO_OFF -}; - -#define OGL_IMPLICIT_GPU_AFFINITY_ENV_VAR L"OGL_DEFAULT_RENDERING_GPU" -#define OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT L"autoselect" -#define OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES 1 -#define OGL_IMPLICIT_GPU_AFFINITY_DEFAULT OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT - -enum EValues_OGL_OVERLAY_PIXEL_TYPE { - OGL_OVERLAY_PIXEL_TYPE_NONE = 0x0, - OGL_OVERLAY_PIXEL_TYPE_CI = 0x1, - OGL_OVERLAY_PIXEL_TYPE_RGBA = 0x2, - OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA = 0x3, - OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES = 4, - OGL_OVERLAY_PIXEL_TYPE_DEFAULT = OGL_OVERLAY_PIXEL_TYPE_CI -}; - -enum EValues_OGL_OVERLAY_SUPPORT { - OGL_OVERLAY_SUPPORT_OFF = 0, - OGL_OVERLAY_SUPPORT_ON = 1, - OGL_OVERLAY_SUPPORT_FORCE_SW = 2, - OGL_OVERLAY_SUPPORT_NUM_VALUES = 3, - OGL_OVERLAY_SUPPORT_DEFAULT = OGL_OVERLAY_SUPPORT_OFF -}; - -enum EValues_OGL_QUALITY_ENHANCEMENTS { - OGL_QUALITY_ENHANCEMENTS_HQUAL = 0xfffffff6, - OGL_QUALITY_ENHANCEMENTS_QUAL = 0, - OGL_QUALITY_ENHANCEMENTS_PERF = 10, - OGL_QUALITY_ENHANCEMENTS_HPERF = 20, - OGL_QUALITY_ENHANCEMENTS_NUM_VALUES = 4, - OGL_QUALITY_ENHANCEMENTS_DEFAULT = OGL_QUALITY_ENHANCEMENTS_QUAL -}; - -enum EValues_OGL_SINGLE_BACKDEPTH_BUFFER { - OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE = 0x0, - OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE = 0x1, - OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT = 0xffffffff, - OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES = 3, - OGL_SINGLE_BACKDEPTH_BUFFER_DEFAULT = OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE -}; - -enum EValues_OGL_SLI_MULTICAST { - OGL_SLI_MULTICAST_DISABLE = 0x00, - OGL_SLI_MULTICAST_ENABLE = 0x01, - OGL_SLI_MULTICAST_FORCE_DISABLE = 0x02, - OGL_SLI_MULTICAST_ALLOW_MOSAIC = 0x04, - OGL_SLI_MULTICAST_NUM_VALUES = 4, - OGL_SLI_MULTICAST_DEFAULT = OGL_SLI_MULTICAST_DISABLE -}; - -enum EValues_OGL_THREAD_CONTROL { - OGL_THREAD_CONTROL_ENABLE = 0x00000001, - OGL_THREAD_CONTROL_DISABLE = 0x00000002, - OGL_THREAD_CONTROL_NUM_VALUES = 2, - OGL_THREAD_CONTROL_DEFAULT = 0U -}; - -enum EValues_OGL_TMON_LEVEL { - OGL_TMON_LEVEL_DISABLE = 0, - OGL_TMON_LEVEL_CRITICAL = 1, - OGL_TMON_LEVEL_WARNING = 2, - OGL_TMON_LEVEL_INFORMATION = 3, - OGL_TMON_LEVEL_MOST = 4, - OGL_TMON_LEVEL_VERBOSE = 5, - OGL_TMON_LEVEL_NUM_VALUES = 6, - OGL_TMON_LEVEL_DEFAULT = OGL_TMON_LEVEL_MOST -}; - -enum EValues_OGL_TRIPLE_BUFFER { - OGL_TRIPLE_BUFFER_DISABLED = 0x00000000, - OGL_TRIPLE_BUFFER_ENABLED = 0x00000001, - OGL_TRIPLE_BUFFER_NUM_VALUES = 2, - OGL_TRIPLE_BUFFER_DEFAULT = OGL_TRIPLE_BUFFER_DISABLED -}; - -enum EValues_AA_BEHAVIOR_FLAGS { - AA_BEHAVIOR_FLAGS_NONE = 0x00000000, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED = 0x00000001, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE = 0x00000002, - AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE = 0x00000003, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED = 0x00000004, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE = 0x00000008, - AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE = 0x0000000c, - AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING = 0x00010000, - AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING = 0x00020000, - AA_BEHAVIOR_FLAGS_DISABLE_CPLAA = 0x00040000, - AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE = 0x00080000, - AA_BEHAVIOR_FLAGS_DISABLE_SLIAA = 0x00100000, - AA_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4 = 0xf0000000, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT = 28, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4 = 0x0f000000, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT = 24, - AA_BEHAVIOR_FLAGS_MASK = 0xff1f000f, - AA_BEHAVIOR_FLAGS_NUM_VALUES = 18, -}; - -enum EValues_AA_MODE_ALPHATOCOVERAGE { - AA_MODE_ALPHATOCOVERAGE_MODE_MASK = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_MODE_OFF = 0x00000000, - AA_MODE_ALPHATOCOVERAGE_MODE_ON = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_MODE_MAX = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_NUM_VALUES = 4, - AA_MODE_ALPHATOCOVERAGE_DEFAULT = 0x00000000 -}; - -enum EValues_AA_MODE_GAMMACORRECTION { - AA_MODE_GAMMACORRECTION_MASK = 0x00000003, - AA_MODE_GAMMACORRECTION_OFF = 0x00000000, - AA_MODE_GAMMACORRECTION_ON_IF_FOS = 0x00000001, - AA_MODE_GAMMACORRECTION_ON_ALWAYS = 0x00000002, - AA_MODE_GAMMACORRECTION_MAX = 0x00000002, - AA_MODE_GAMMACORRECTION_DEFAULT = 0x00000000, - AA_MODE_GAMMACORRECTION_DEFAULT_TESLA = 0x00000002, - AA_MODE_GAMMACORRECTION_DEFAULT_FERMI = 0x00000002, - AA_MODE_GAMMACORRECTION_NUM_VALUES = 8, -}; - -enum EValues_AA_MODE_METHOD { - AA_MODE_METHOD_NONE = 0x0, - AA_MODE_METHOD_SUPERSAMPLE_2X_H = 0x1, - AA_MODE_METHOD_SUPERSAMPLE_2X_V = 0x2, - AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5 = 0x2, - AA_MODE_METHOD_FREE_0x03 = 0x3, - AA_MODE_METHOD_FREE_0x04 = 0x4, - AA_MODE_METHOD_SUPERSAMPLE_4X = 0x5, - AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS = 0x6, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN = 0x7, - AA_MODE_METHOD_FREE_0x08 = 0x8, - AA_MODE_METHOD_FREE_0x09 = 0x9, - AA_MODE_METHOD_SUPERSAMPLE_9X = 0xA, - AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS = 0xB, - AA_MODE_METHOD_SUPERSAMPLE_16X = 0xC, - AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS = 0xD, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL = 0xE, - AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX = 0xF, - AA_MODE_METHOD_MULTISAMPLE_4X = 0x10, - AA_MODE_METHOD_FREE_0x11 = 0x11, - AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN = 0x12, - AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP = 0x13, - AA_MODE_METHOD_FREE_0x14 = 0x14, - AA_MODE_METHOD_FREE_0x15 = 0x15, - AA_MODE_METHOD_MIXEDSAMPLE_6X = 0x16, - AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP = 0x17, - AA_MODE_METHOD_MIXEDSAMPLE_8X = 0x18, - AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP = 0x19, - AA_MODE_METHOD_MIXEDSAMPLE_16X = 0x1a, - AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA = 0x1b, - AA_MODE_METHOD_MULTISAMPLE_16X = 0x1c, - AA_MODE_METHOD_VCAA_32X_8v24 = 0x1d, - AA_MODE_METHOD_CORRUPTION_CHECK = 0x1e, - AA_MODE_METHOD_6X_CT = 0x1f, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA = 0x20, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA = 0x21, - AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA = 0x22, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA = 0x23, - AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA = 0x24, - AA_MODE_METHOD_MULTISAMPLE_8X = 0x25, - AA_MODE_METHOD_VCAA_8X_4v4 = 0x26, - AA_MODE_METHOD_VCAA_16X_4v12 = 0x27, - AA_MODE_METHOD_VCAA_16X_8v8 = 0x28, - AA_MODE_METHOD_MIXEDSAMPLE_32X = 0x29, - AA_MODE_METHOD_SUPERVCAA_64X_4v12 = 0x2a, - AA_MODE_METHOD_SUPERVCAA_64X_8v8 = 0x2b, - AA_MODE_METHOD_MIXEDSAMPLE_64X = 0x2c, - AA_MODE_METHOD_MIXEDSAMPLE_128X = 0x2d, - AA_MODE_METHOD_COUNT = 0x2e, - AA_MODE_METHOD_METHOD_MASK = 0x0000ffff, - AA_MODE_METHOD_METHOD_MAX = 0xf1c57815, - AA_MODE_METHOD_NUM_VALUES = 50, - AA_MODE_METHOD_DEFAULT = AA_MODE_METHOD_NONE -}; - -enum EValues_AA_MODE_REPLAY { - AA_MODE_REPLAY_SAMPLES_MASK = 0x00000070, - AA_MODE_REPLAY_SAMPLES_ONE = 0x00000000, - AA_MODE_REPLAY_SAMPLES_TWO = 0x00000010, - AA_MODE_REPLAY_SAMPLES_FOUR = 0x00000020, - AA_MODE_REPLAY_SAMPLES_EIGHT = 0x00000030, - AA_MODE_REPLAY_SAMPLES_MAX = 0x00000030, - AA_MODE_REPLAY_MODE_MASK = 0x0000000f, - AA_MODE_REPLAY_MODE_OFF = 0x00000000, - AA_MODE_REPLAY_MODE_ALPHA_TEST = 0x00000001, - AA_MODE_REPLAY_MODE_PIXEL_KILL = 0x00000002, - AA_MODE_REPLAY_MODE_DYN_BRANCH = 0x00000004, - AA_MODE_REPLAY_MODE_OPTIMAL = 0x00000004, - AA_MODE_REPLAY_MODE_ALL = 0x00000008, - AA_MODE_REPLAY_MODE_MAX = 0x0000000f, - AA_MODE_REPLAY_TRANSPARENCY = 0x00000023, - AA_MODE_REPLAY_DISALLOW_TRAA = 0x00000100, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT = 0x00000000, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA = 0x00000000, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI = 0x00000000, - AA_MODE_REPLAY_MASK = 0x0000017f, - AA_MODE_REPLAY_NUM_VALUES = 20, - AA_MODE_REPLAY_DEFAULT = 0x00000000 -}; - -enum EValues_AA_MODE_SELECTOR { - AA_MODE_SELECTOR_MASK = 0x00000003, - AA_MODE_SELECTOR_APP_CONTROL = 0x00000000, - AA_MODE_SELECTOR_OVERRIDE = 0x00000001, - AA_MODE_SELECTOR_ENHANCE = 0x00000002, - AA_MODE_SELECTOR_MAX = 0x00000002, - AA_MODE_SELECTOR_NUM_VALUES = 5, - AA_MODE_SELECTOR_DEFAULT = AA_MODE_SELECTOR_APP_CONTROL -}; - -enum EValues_AA_MODE_SELECTOR_SLIAA { - AA_MODE_SELECTOR_SLIAA_DISABLED = 0, - AA_MODE_SELECTOR_SLIAA_ENABLED = 1, - AA_MODE_SELECTOR_SLIAA_NUM_VALUES = 2, - AA_MODE_SELECTOR_SLIAA_DEFAULT = AA_MODE_SELECTOR_SLIAA_DISABLED -}; - -enum EValues_ANISO_MODE_LEVEL { - ANISO_MODE_LEVEL_MASK = 0x0000ffff, - ANISO_MODE_LEVEL_NONE_POINT = 0x00000000, - ANISO_MODE_LEVEL_NONE_LINEAR = 0x00000001, - ANISO_MODE_LEVEL_MAX = 0x00000010, - ANISO_MODE_LEVEL_DEFAULT = 0x00000001, - ANISO_MODE_LEVEL_NUM_VALUES = 5, -}; - -enum EValues_ANISO_MODE_SELECTOR { - ANISO_MODE_SELECTOR_MASK = 0x0000000f, - ANISO_MODE_SELECTOR_APP = 0x00000000, - ANISO_MODE_SELECTOR_USER = 0x00000001, - ANISO_MODE_SELECTOR_COND = 0x00000002, - ANISO_MODE_SELECTOR_MAX = 0x00000002, - ANISO_MODE_SELECTOR_DEFAULT = 0x00000000, - ANISO_MODE_SELECTOR_NUM_VALUES = 6, -}; - -enum EValues_ANSEL_ALLOW { - ANSEL_ALLOW_DISALLOWED = 0, - ANSEL_ALLOW_ALLOWED = 1, - ANSEL_ALLOW_NUM_VALUES = 2, - ANSEL_ALLOW_DEFAULT = ANSEL_ALLOW_ALLOWED -}; - -enum EValues_ANSEL_ALLOWLISTED { - ANSEL_ALLOWLISTED_DISALLOWED = 0, - ANSEL_ALLOWLISTED_ALLOWED = 1, - ANSEL_ALLOWLISTED_NUM_VALUES = 2, - ANSEL_ALLOWLISTED_DEFAULT = ANSEL_ALLOWLISTED_DISALLOWED -}; - -enum EValues_ANSEL_ENABLE { - ANSEL_ENABLE_OFF = 0, - ANSEL_ENABLE_ON = 1, - ANSEL_ENABLE_NUM_VALUES = 2, - ANSEL_ENABLE_DEFAULT = ANSEL_ENABLE_ON -}; - -enum EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT { - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED = 0, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS = 9, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS = 15, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS = 30, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE = 60, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES = 120, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES = 6, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED -}; - -enum EValues_BATTERY_BOOST_APP_FPS { - BATTERY_BOOST_APP_FPS_MIN = 0x00000001, - BATTERY_BOOST_APP_FPS_MAX = 0x000003ff, - BATTERY_BOOST_APP_FPS_NO_OVERRIDE = 0x00000000, - BATTERY_BOOST_APP_FPS_NUM_VALUES = 3, - BATTERY_BOOST_APP_FPS_DEFAULT = BATTERY_BOOST_APP_FPS_NO_OVERRIDE -}; - -enum EValues_CPL_HIDDEN_PROFILE { - CPL_HIDDEN_PROFILE_DISABLED = 0, - CPL_HIDDEN_PROFILE_ENABLED = 1, - CPL_HIDDEN_PROFILE_NUM_VALUES = 2, - CPL_HIDDEN_PROFILE_DEFAULT = CPL_HIDDEN_PROFILE_DISABLED -}; - -#define CUDA_EXCLUDED_GPUS_NONE L"none" -#define CUDA_EXCLUDED_GPUS_NUM_VALUES 1 -#define CUDA_EXCLUDED_GPUS_DEFAULT CUDA_EXCLUDED_GPUS_NONE - -#define D3DOGL_GPU_MAX_POWER_DEFAULTPOWER L"0" -#define D3DOGL_GPU_MAX_POWER_NUM_VALUES 1 -#define D3DOGL_GPU_MAX_POWER_DEFAULT D3DOGL_GPU_MAX_POWER_DEFAULTPOWER - -enum EValues_EXPORT_PERF_COUNTERS { - EXPORT_PERF_COUNTERS_OFF = 0x00000000, - EXPORT_PERF_COUNTERS_ON = 0x00000001, - EXPORT_PERF_COUNTERS_NUM_VALUES = 2, - EXPORT_PERF_COUNTERS_DEFAULT = EXPORT_PERF_COUNTERS_OFF -}; - -enum EValues_EXTERNAL_QUIET_MODE { - EXTERNAL_QUIET_MODE_ON = 0x00000001, - EXTERNAL_QUIET_MODE_OFF = 0x00000000, - EXTERNAL_QUIET_MODE_NUM_VALUES = 2, - EXTERNAL_QUIET_MODE_DEFAULT = EXTERNAL_QUIET_MODE_OFF -}; - -enum EValues_FRL_FPS { - FRL_FPS_DISABLED = 0x00000000, - FRL_FPS_MIN = 0x00000000, - FRL_FPS_MAX = 0x000003ff, - FRL_FPS_NUM_VALUES = 3, - FRL_FPS_DEFAULT = FRL_FPS_DISABLED -}; - -enum EValues_FXAA_ALLOW { - FXAA_ALLOW_DISALLOWED = 0, - FXAA_ALLOW_ALLOWED = 1, - FXAA_ALLOW_NUM_VALUES = 2, - FXAA_ALLOW_DEFAULT = FXAA_ALLOW_ALLOWED -}; - -enum EValues_FXAA_ENABLE { - FXAA_ENABLE_OFF = 0, - FXAA_ENABLE_ON = 1, - FXAA_ENABLE_NUM_VALUES = 2, - FXAA_ENABLE_DEFAULT = FXAA_ENABLE_OFF -}; - -enum EValues_FXAA_INDICATOR_ENABLE { - FXAA_INDICATOR_ENABLE_OFF = 0, - FXAA_INDICATOR_ENABLE_ON = 1, - FXAA_INDICATOR_ENABLE_NUM_VALUES = 2, - FXAA_INDICATOR_ENABLE_DEFAULT = FXAA_INDICATOR_ENABLE_OFF -}; - -enum EValues_LATENCY_INDICATOR_AUTOALIGN { - LATENCY_INDICATOR_AUTOALIGN_DISABLED = 0x0, - LATENCY_INDICATOR_AUTOALIGN_ENABLED = 0x1, - LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES = 2, - LATENCY_INDICATOR_AUTOALIGN_DEFAULT = LATENCY_INDICATOR_AUTOALIGN_ENABLED -}; - -enum EValues_MCSFRSHOWSPLIT { - MCSFRSHOWSPLIT_DISABLED = 0x34534064, - MCSFRSHOWSPLIT_ENABLED = 0x24545582, - MCSFRSHOWSPLIT_NUM_VALUES = 2, - MCSFRSHOWSPLIT_DEFAULT = MCSFRSHOWSPLIT_DISABLED -}; - -enum EValues_NV_QUALITY_UPSCALING { - NV_QUALITY_UPSCALING_OFF = 0, - NV_QUALITY_UPSCALING_ON = 1, - NV_QUALITY_UPSCALING_NUM_VALUES = 2, - NV_QUALITY_UPSCALING_DEFAULT = NV_QUALITY_UPSCALING_OFF -}; - -enum EValues_OPTIMUS_MAXAA { - OPTIMUS_MAXAA_MIN = 0, - OPTIMUS_MAXAA_MAX = 16, - OPTIMUS_MAXAA_NUM_VALUES = 2, - OPTIMUS_MAXAA_DEFAULT = 0 -}; - -enum EValues_PHYSXINDICATOR { - PHYSXINDICATOR_DISABLED = 0x34534064, - PHYSXINDICATOR_ENABLED = 0x24545582, - PHYSXINDICATOR_NUM_VALUES = 2, - PHYSXINDICATOR_DEFAULT = PHYSXINDICATOR_DISABLED -}; - -enum EValues_PREFERRED_PSTATE { - PREFERRED_PSTATE_ADAPTIVE = 0x00000000, - PREFERRED_PSTATE_PREFER_MAX = 0x00000001, - PREFERRED_PSTATE_DRIVER_CONTROLLED = 0x00000002, - PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE = 0x00000003, - PREFERRED_PSTATE_PREFER_MIN = 0x00000004, - PREFERRED_PSTATE_OPTIMAL_POWER = 0x00000005, - PREFERRED_PSTATE_MIN = 0x00000000, - PREFERRED_PSTATE_MAX = 0x00000005, - PREFERRED_PSTATE_NUM_VALUES = 8, - PREFERRED_PSTATE_DEFAULT = PREFERRED_PSTATE_OPTIMAL_POWER -}; - -enum EValues_PREVENT_UI_AF_OVERRIDE { - PREVENT_UI_AF_OVERRIDE_OFF = 0, - PREVENT_UI_AF_OVERRIDE_ON = 1, - PREVENT_UI_AF_OVERRIDE_NUM_VALUES = 2, - PREVENT_UI_AF_OVERRIDE_DEFAULT = PREVENT_UI_AF_OVERRIDE_OFF -}; - -enum EValues_SHIM_MCCOMPAT { - SHIM_MCCOMPAT_INTEGRATED = 0x00000000U, - SHIM_MCCOMPAT_ENABLE = 0x00000001U, - SHIM_MCCOMPAT_USER_EDITABLE = 0x00000002U, - SHIM_MCCOMPAT_MASK = 0x00000003U, - SHIM_MCCOMPAT_VIDEO_MASK = 0x00000004U, - SHIM_MCCOMPAT_VARYING_BIT = 0x00000008U, - SHIM_MCCOMPAT_AUTO_SELECT = 0x00000010U, - SHIM_MCCOMPAT_OVERRIDE_BIT = 0x80000000U, - SHIM_MCCOMPAT_NUM_VALUES = 8, - SHIM_MCCOMPAT_DEFAULT = SHIM_MCCOMPAT_AUTO_SELECT -}; - -enum EValues_SHIM_RENDERING_MODE { - SHIM_RENDERING_MODE_INTEGRATED = 0x00000000U, - SHIM_RENDERING_MODE_ENABLE = 0x00000001U, - SHIM_RENDERING_MODE_USER_EDITABLE = 0x00000002U, - SHIM_RENDERING_MODE_MASK = 0x00000003U, - SHIM_RENDERING_MODE_VIDEO_MASK = 0x00000004U, - SHIM_RENDERING_MODE_VARYING_BIT = 0x00000008U, - SHIM_RENDERING_MODE_AUTO_SELECT = 0x00000010U, - SHIM_RENDERING_MODE_OVERRIDE_BIT = 0x80000000U, - SHIM_RENDERING_MODE_NUM_VALUES = 8, - SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT -}; - -enum EValues_SHIM_RENDERING_OPTIONS { - SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE = 0x00000000U, - SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT = 0x00000001U, - SHIM_RENDERING_OPTIONS_EHSHELL_DETECT = 0x00000002U, - SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT = 0x00000004U, - SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT = 0x00000008U, - SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES = 0x00000010U, - SHIM_RENDERING_OPTIONS_RESERVED1 = 0x00000020U, - SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT = 0x00000040U, - SHIM_RENDERING_OPTIONS_RESERVED2 = 0x00000080U, - SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE = 0x00000100U, - SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS = 0x00000200U, - SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS = 0x00000400U, - SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS = 0x00000800U, - SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT = 0x00001000U, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING = 0x00002000U, - SHIM_RENDERING_OPTIONS_DISABLE_CUDA = 0x00004000U, - SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO = 0x00008000U, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS = 0x00010000U, - SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT = 0x00020000U, - SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO = 0x00040000U, - SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID = 0x00080000U, - SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD = 0x00100000U, - SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT = 0x00200000U, - SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG = 0x00400000U, - SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP = 0x00800000U, - SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000U, - SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000U, - SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY = 0x04000000U, - SHIM_RENDERING_OPTIONS_NUM_VALUES = 28, - SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000U -}; - -enum EValues_SLI_GPU_COUNT { - SLI_GPU_COUNT_AUTOSELECT = 0x00000000, - SLI_GPU_COUNT_ONE = 0x00000001, - SLI_GPU_COUNT_TWO = 0x00000002, - SLI_GPU_COUNT_THREE = 0x00000003, - SLI_GPU_COUNT_FOUR = 0x00000004, - SLI_GPU_COUNT_NUM_VALUES = 5, - SLI_GPU_COUNT_DEFAULT = SLI_GPU_COUNT_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_GPU_COUNT { - SLI_PREDEFINED_GPU_COUNT_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_GPU_COUNT_ONE = 0x00000001, - SLI_PREDEFINED_GPU_COUNT_TWO = 0x00000002, - SLI_PREDEFINED_GPU_COUNT_THREE = 0x00000003, - SLI_PREDEFINED_GPU_COUNT_FOUR = 0x00000004, - SLI_PREDEFINED_GPU_COUNT_NUM_VALUES = 5, - SLI_PREDEFINED_GPU_COUNT_DEFAULT = SLI_PREDEFINED_GPU_COUNT_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_GPU_COUNT_DX10 { - SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_GPU_COUNT_DX10_ONE = 0x00000001, - SLI_PREDEFINED_GPU_COUNT_DX10_TWO = 0x00000002, - SLI_PREDEFINED_GPU_COUNT_DX10_THREE = 0x00000003, - SLI_PREDEFINED_GPU_COUNT_DX10_FOUR = 0x00000004, - SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES = 5, - SLI_PREDEFINED_GPU_COUNT_DX10_DEFAULT = SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_MODE { - SLI_PREDEFINED_MODE_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_MODE_FORCE_SINGLE = 0x00000001, - SLI_PREDEFINED_MODE_FORCE_AFR = 0x00000002, - SLI_PREDEFINED_MODE_FORCE_AFR2 = 0x00000003, - SLI_PREDEFINED_MODE_FORCE_SFR = 0x00000004, - SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_PREDEFINED_MODE_NUM_VALUES = 6, - SLI_PREDEFINED_MODE_DEFAULT = SLI_PREDEFINED_MODE_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_MODE_DX10 { - SLI_PREDEFINED_MODE_DX10_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE = 0x00000001, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR = 0x00000002, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR2 = 0x00000003, - SLI_PREDEFINED_MODE_DX10_FORCE_SFR = 0x00000004, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_PREDEFINED_MODE_DX10_NUM_VALUES = 6, - SLI_PREDEFINED_MODE_DX10_DEFAULT = SLI_PREDEFINED_MODE_DX10_AUTOSELECT -}; - -enum EValues_SLI_RENDERING_MODE { - SLI_RENDERING_MODE_AUTOSELECT = 0x00000000, - SLI_RENDERING_MODE_FORCE_SINGLE = 0x00000001, - SLI_RENDERING_MODE_FORCE_AFR = 0x00000002, - SLI_RENDERING_MODE_FORCE_AFR2 = 0x00000003, - SLI_RENDERING_MODE_FORCE_SFR = 0x00000004, - SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_RENDERING_MODE_NUM_VALUES = 6, - SLI_RENDERING_MODE_DEFAULT = SLI_RENDERING_MODE_AUTOSELECT -}; - -enum EValues_VRPRERENDERLIMIT { - VRPRERENDERLIMIT_MIN = 0x00, - VRPRERENDERLIMIT_MAX = 0xff, - VRPRERENDERLIMIT_APP_CONTROLLED = 0x00, - VRPRERENDERLIMIT_DEFAULT = 0x01, - VRPRERENDERLIMIT_NUM_VALUES = 4, -}; - -enum EValues_VRRFEATUREINDICATOR { - VRRFEATUREINDICATOR_DISABLED = 0x0, - VRRFEATUREINDICATOR_ENABLED = 0x1, - VRRFEATUREINDICATOR_NUM_VALUES = 2, - VRRFEATUREINDICATOR_DEFAULT = VRRFEATUREINDICATOR_ENABLED -}; - -enum EValues_VRROVERLAYINDICATOR { - VRROVERLAYINDICATOR_DISABLED = 0x0, - VRROVERLAYINDICATOR_ENABLED = 0x1, - VRROVERLAYINDICATOR_NUM_VALUES = 2, - VRROVERLAYINDICATOR_DEFAULT = VRROVERLAYINDICATOR_ENABLED -}; - -enum EValues_VRRREQUESTSTATE { - VRRREQUESTSTATE_DISABLED = 0x0, - VRRREQUESTSTATE_FULLSCREEN_ONLY = 0x1, - VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED = 0x2, - VRRREQUESTSTATE_NUM_VALUES = 3, - VRRREQUESTSTATE_DEFAULT = VRRREQUESTSTATE_FULLSCREEN_ONLY -}; - -enum EValues_VRR_APP_OVERRIDE { - VRR_APP_OVERRIDE_ALLOW = 0, - VRR_APP_OVERRIDE_FORCE_OFF = 1, - VRR_APP_OVERRIDE_DISALLOW = 2, - VRR_APP_OVERRIDE_ULMB = 3, - VRR_APP_OVERRIDE_FIXED_REFRESH = 4, - VRR_APP_OVERRIDE_NUM_VALUES = 5, - VRR_APP_OVERRIDE_DEFAULT = VRR_APP_OVERRIDE_ALLOW -}; - -enum EValues_VRR_APP_OVERRIDE_REQUEST_STATE { - VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW = 0, - VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF = 1, - VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW = 2, - VRR_APP_OVERRIDE_REQUEST_STATE_ULMB = 3, - VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH = 4, - VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES = 5, - VRR_APP_OVERRIDE_REQUEST_STATE_DEFAULT = VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW -}; - -enum EValues_VRR_MODE { - VRR_MODE_DISABLED = 0x0, - VRR_MODE_FULLSCREEN_ONLY = 0x1, - VRR_MODE_FULLSCREEN_AND_WINDOWED = 0x2, - VRR_MODE_NUM_VALUES = 3, - VRR_MODE_DEFAULT = VRR_MODE_FULLSCREEN_ONLY -}; - -enum EValues_VSYNCSMOOTHAFR { - VSYNCSMOOTHAFR_OFF = 0x00000000, - VSYNCSMOOTHAFR_ON = 0x00000001, - VSYNCSMOOTHAFR_NUM_VALUES = 2, - VSYNCSMOOTHAFR_DEFAULT = VSYNCSMOOTHAFR_OFF -}; - -enum EValues_VSYNCVRRCONTROL { - VSYNCVRRCONTROL_DISABLE = 0x00000000, - VSYNCVRRCONTROL_ENABLE = 0x00000001, - VSYNCVRRCONTROL_NOTSUPPORTED = 0x9f95128e, - VSYNCVRRCONTROL_NUM_VALUES = 3, - VSYNCVRRCONTROL_DEFAULT = VSYNCVRRCONTROL_ENABLE -}; - -enum EValues_VSYNC_BEHAVIOR_FLAGS { - VSYNC_BEHAVIOR_FLAGS_NONE = 0x00000000, - VSYNC_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, - VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE = 0x00000001, - VSYNC_BEHAVIOR_FLAGS_NUM_VALUES = 3, -}; - -enum EValues_WKS_API_STEREO_EYES_EXCHANGE { - WKS_API_STEREO_EYES_EXCHANGE_OFF = 0, - WKS_API_STEREO_EYES_EXCHANGE_ON = 1, - WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES = 2, - WKS_API_STEREO_EYES_EXCHANGE_DEFAULT = WKS_API_STEREO_EYES_EXCHANGE_OFF -}; - -enum EValues_WKS_API_STEREO_MODE { - WKS_API_STEREO_MODE_SHUTTER_GLASSES = 0, - WKS_API_STEREO_MODE_VERTICAL_INTERLACED = 1, - WKS_API_STEREO_MODE_TWINVIEW = 2, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO = 3, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0 = 4, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1 = 5, - WKS_API_STEREO_MODE_COLOR_LINE = 6, - WKS_API_STEREO_MODE_COLOR_INTERLEAVED = 7, - WKS_API_STEREO_MODE_ANAGLYPH = 8, - WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED = 9, - WKS_API_STEREO_MODE_SIDE_FIELD = 10, - WKS_API_STEREO_MODE_SUB_FIELD = 11, - WKS_API_STEREO_MODE_CHECKERBOARD = 12, - WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD = 13, - WKS_API_STEREO_MODE_TRIDELITY_SL = 14, - WKS_API_STEREO_MODE_TRIDELITY_MV = 15, - WKS_API_STEREO_MODE_SEEFRONT = 16, - WKS_API_STEREO_MODE_STEREO_MIRROR = 17, - WKS_API_STEREO_MODE_FRAME_SEQUENTIAL = 18, - WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE = 19, - WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL = 20, - WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL = 21, - WKS_API_STEREO_MODE_DP_INBAND = 22, - WKS_API_STEREO_MODE_USE_HW_DEFAULT = 0xffffffff, - WKS_API_STEREO_MODE_DEFAULT_GL = 3, - WKS_API_STEREO_MODE_NUM_VALUES = 25, - WKS_API_STEREO_MODE_DEFAULT = WKS_API_STEREO_MODE_SHUTTER_GLASSES -}; - -enum EValues_WKS_STEREO_DONGLE_SUPPORT { - WKS_STEREO_DONGLE_SUPPORT_OFF = 0, - WKS_STEREO_DONGLE_SUPPORT_DAC = 1, - WKS_STEREO_DONGLE_SUPPORT_DLP = 2, - WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES = 3, - WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC -}; - -enum EValues_WKS_STEREO_SUPPORT { - WKS_STEREO_SUPPORT_OFF = 0, - WKS_STEREO_SUPPORT_ON = 1, - WKS_STEREO_SUPPORT_NUM_VALUES = 2, - WKS_STEREO_SUPPORT_DEFAULT = WKS_STEREO_SUPPORT_OFF -}; - -enum EValues_WKS_STEREO_SWAP_MODE { - WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL = 0x0, - WKS_STEREO_SWAP_MODE_PER_EYE = 0x1, - WKS_STEREO_SWAP_MODE_PER_EYE_PAIR = 0x2, - WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR = 0x3, - WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP = 0x4, - WKS_STEREO_SWAP_MODE_NUM_VALUES = 5, - WKS_STEREO_SWAP_MODE_DEFAULT = WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL -}; - -enum EValues_AO_MODE { - AO_MODE_OFF = 0, - AO_MODE_LOW = 1, - AO_MODE_MEDIUM = 2, - AO_MODE_HIGH = 3, - AO_MODE_NUM_VALUES = 4, - AO_MODE_DEFAULT = AO_MODE_OFF -}; - -enum EValues_AO_MODE_ACTIVE { - AO_MODE_ACTIVE_DISABLED = 0, - AO_MODE_ACTIVE_ENABLED = 1, - AO_MODE_ACTIVE_NUM_VALUES = 2, - AO_MODE_ACTIVE_DEFAULT = AO_MODE_ACTIVE_DISABLED -}; - -enum EValues_AUTO_LODBIASADJUST { - AUTO_LODBIASADJUST_OFF = 0x00000000, - AUTO_LODBIASADJUST_ON = 0x00000001, - AUTO_LODBIASADJUST_NUM_VALUES = 2, - AUTO_LODBIASADJUST_DEFAULT = AUTO_LODBIASADJUST_ON -}; - -enum EValues_EXPORT_PERF_COUNTERS_DX9_ONLY { - EXPORT_PERF_COUNTERS_DX9_ONLY_OFF = 0x00000000, - EXPORT_PERF_COUNTERS_DX9_ONLY_ON = 0x00000001, - EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES = 2, - EXPORT_PERF_COUNTERS_DX9_ONLY_DEFAULT = EXPORT_PERF_COUNTERS_DX9_ONLY_OFF -}; - -enum EValues_LODBIASADJUST { - LODBIASADJUST_MIN = 0xffffff80, - LODBIASADJUST_MAX = 128, - LODBIASADJUST_NUM_VALUES = 2, - LODBIASADJUST_DEFAULT = 0 -}; - -enum EValues_MAXWELL_B_SAMPLE_INTERLEAVE { - MAXWELL_B_SAMPLE_INTERLEAVE_OFF = 0, - MAXWELL_B_SAMPLE_INTERLEAVE_ON = 1, - MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES = 2, - MAXWELL_B_SAMPLE_INTERLEAVE_DEFAULT = MAXWELL_B_SAMPLE_INTERLEAVE_OFF -}; - -enum EValues_PRERENDERLIMIT { - PRERENDERLIMIT_MIN = 0x00, - PRERENDERLIMIT_MAX = 0xff, - PRERENDERLIMIT_APP_CONTROLLED = 0x00, - PRERENDERLIMIT_NUM_VALUES = 3, - PRERENDERLIMIT_DEFAULT = PRERENDERLIMIT_APP_CONTROLLED -}; - -enum EValues_PS_SHADERDISKCACHE { - PS_SHADERDISKCACHE_OFF = 0x00000000, - PS_SHADERDISKCACHE_ON = 0x00000001, - PS_SHADERDISKCACHE_NUM_VALUES = 2, - PS_SHADERDISKCACHE_DEFAULT = PS_SHADERDISKCACHE_ON -}; - -enum EValues_PS_SHADERDISKCACHE_MAX_SIZE { - PS_SHADERDISKCACHE_MAX_SIZE_MIN = 0x0, - PS_SHADERDISKCACHE_MAX_SIZE_MAX = 0xffffffff, - PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES = 2, - PS_SHADERDISKCACHE_MAX_SIZE_DEFAULT = 0x1000 -}; - -enum EValues_PS_TEXFILTER_ANISO_OPTS2 { - PS_TEXFILTER_ANISO_OPTS2_OFF = 0x00000000, - PS_TEXFILTER_ANISO_OPTS2_ON = 0x00000001, - PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES = 2, - PS_TEXFILTER_ANISO_OPTS2_DEFAULT = PS_TEXFILTER_ANISO_OPTS2_OFF -}; - -enum EValues_PS_TEXFILTER_BILINEAR_IN_ANISO { - PS_TEXFILTER_BILINEAR_IN_ANISO_OFF = 0x00000000, - PS_TEXFILTER_BILINEAR_IN_ANISO_ON = 0x00000001, - PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES = 2, - PS_TEXFILTER_BILINEAR_IN_ANISO_DEFAULT = PS_TEXFILTER_BILINEAR_IN_ANISO_OFF -}; - -enum EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE { - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF = 0x00000000, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON = 0x00000001, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES = 2, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_DEFAULT = PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF -}; - -enum EValues_PS_TEXFILTER_NO_NEG_LODBIAS { - PS_TEXFILTER_NO_NEG_LODBIAS_OFF = 0x00000000, - PS_TEXFILTER_NO_NEG_LODBIAS_ON = 0x00000001, - PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES = 2, - PS_TEXFILTER_NO_NEG_LODBIAS_DEFAULT = PS_TEXFILTER_NO_NEG_LODBIAS_OFF -}; - -enum EValues_QUALITY_ENHANCEMENTS { - QUALITY_ENHANCEMENTS_HIGHQUALITY = 0xfffffff6, - QUALITY_ENHANCEMENTS_QUALITY = 0x00000000, - QUALITY_ENHANCEMENTS_PERFORMANCE = 0x0000000a, - QUALITY_ENHANCEMENTS_HIGHPERFORMANCE = 0x00000014, - QUALITY_ENHANCEMENTS_NUM_VALUES = 4, - QUALITY_ENHANCEMENTS_DEFAULT = QUALITY_ENHANCEMENTS_QUALITY -}; - -enum EValues_QUALITY_ENHANCEMENT_SUBSTITUTION { - QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION = 0x00000000, - QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY = 0x00000001, - QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES = 2, - QUALITY_ENHANCEMENT_SUBSTITUTION_DEFAULT = QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION -}; - -enum EValues_REFRESH_RATE_OVERRIDE { - REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED = 0x00000000, - REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE = 0x00000001, - REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK = 0x00000FF0, - REFRESH_RATE_OVERRIDE_NUM_VALUES = 3, - REFRESH_RATE_OVERRIDE_DEFAULT = REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED -}; - -enum EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE { - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF = 0x00000000, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON = 0x00000001, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES = 2, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_DEFAULT = SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF -}; - -enum EValues_SET_VAB_DATA { - SET_VAB_DATA_ZERO = 0x00000000, - SET_VAB_DATA_UINT_ONE = 0x00000001, - SET_VAB_DATA_FLOAT_ONE = 0x3f800000, - SET_VAB_DATA_FLOAT_POS_INF = 0x7f800000, - SET_VAB_DATA_FLOAT_NAN = 0x7fc00000, - SET_VAB_DATA_USE_API_DEFAULTS = 0xffffffff, - SET_VAB_DATA_NUM_VALUES = 6, - SET_VAB_DATA_DEFAULT = SET_VAB_DATA_USE_API_DEFAULTS -}; - -enum EValues_VSYNCMODE { - VSYNCMODE_PASSIVE = 0x60925292, - VSYNCMODE_FORCEOFF = 0x08416747, - VSYNCMODE_FORCEON = 0x47814940, - VSYNCMODE_FLIPINTERVAL2 = 0x32610244, - VSYNCMODE_FLIPINTERVAL3 = 0x71271021, - VSYNCMODE_FLIPINTERVAL4 = 0x13245256, - VSYNCMODE_VIRTUAL = 0x18888888, - VSYNCMODE_NUM_VALUES = 7, - VSYNCMODE_DEFAULT = VSYNCMODE_PASSIVE -}; - -enum EValues_VSYNCTEARCONTROL { - VSYNCTEARCONTROL_DISABLE = 0x96861077, - VSYNCTEARCONTROL_ENABLE = 0x99941284, - VSYNCTEARCONTROL_NUM_VALUES = 2, - VSYNCTEARCONTROL_DEFAULT = VSYNCTEARCONTROL_DISABLE -}; - - - -typedef struct _SettingDWORDNameString { - NvU32 settingId; - const wchar_t * settingNameString; - NvU32 numSettingValues; - NvU32 *settingValues; - NvU32 defaultValue; -} SettingDWORDNameString; - -typedef struct _SettingWSTRINGNameString { - NvU32 settingId; - const wchar_t * settingNameString; - NvU32 numSettingValues; - const wchar_t **settingValues; - const wchar_t * defaultValue; -} SettingWSTRINGNameString; - - -#endif // _NVAPI_DRIVER_SETTINGS_H_ - diff --git a/参考/NexBox-main/R560-developer/Sample_Code/CustomTiming/CustomTiming.cpp b/参考/NexBox-main/R560-developer/Sample_Code/CustomTiming/CustomTiming.cpp deleted file mode 100644 index a583b16..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/CustomTiming/CustomTiming.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012-2023 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ - -//////////////////////////////////////////////////////////////////////////////////// -// @brief: This is the entry point for the console application. -// This program applies a fixed custom resolution to the attached monitor -// It applies the custom settings each active display in the following sequence: -// NvAPI_DISP_TryCustomDisplay... Wait for 5 seconds -// NvAPI_DISP_SaveCustomDisplay... Wait for 5 seconds -// NvAPI_DISP_RevertCustomDisplay... Wait for 5 seconds -// -// @assumptions: This code is designed for Win7+ operating systems. It assumes that -// the system has atleast one active display. -// -// @driver support: R313+ -//////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "nvapi.h" - -// Link the lib file. -// The following line is needed if we are building the code using the command line compiler. -// If we are building using the Visual Studio, we can point to the lib file using the UI. -#pragma comment(lib, "nvapi64.lib") - -// This function applies the loaded custom timings on all available displays -NvAPI_Status ApplyCustomDisplay(); - -// This function enumerates the display Ids of all the connected displays -NvAPI_Status GetConnectedDisplays(NvU32 *displayIds, NvU32 *noDisplays); - -// This function applies custom display settings, saves them and reverts back. -void loadCustomDisplay(NV_CUSTOM_DISPLAY *customDisplay); - -int _tmain(int argc, _TCHAR *argv[]) -{ - NvAPI_Status ret = NVAPI_OK; - - ret = NvAPI_Initialize(); - if(ret != NVAPI_OK) - { - printf("NvAPI_Initialize() failed = 0x%x", ret); - return 1; // Initialization failed - } - - for(NvU32 q = 0; q < 50; q++) - { - printf("/"); - } - printf("\n"); - - ret = ApplyCustomDisplay(); - if(ret != NVAPI_OK) - { - getchar(); - return 1; // Failed to apply custom display - } - printf("\n"); - - for(NvU32 q = 0; q < 50; q++) - { - printf("/"); - } - printf("\n"); - - printf("\nCustom_Timing successful!\nPress any key to exit...\n"); - getchar(); - return 0; -} - -void loadCustomDisplay(NV_CUSTOM_DISPLAY *cd) -{ - cd->version = NV_CUSTOM_DISPLAY_VER; - cd->width = 1024; - cd->height = 999; - cd->depth = 32; - cd->colorFormat = NV_FORMAT_A8R8G8B8; - cd->srcPartition.x = 0; - cd->srcPartition.y = 0; - cd->srcPartition.w = 1; - cd->srcPartition.h = 1; - cd->xRatio = 1; - cd->yRatio = 1; -} - -NvAPI_Status GetConnectedDisplays(NvU32 *displayIds, NvU32 *noDisplays) -{ - NvAPI_Status ret = NVAPI_OK; - - NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS] = { 0 }; - NvU32 gpuCount = 0; - NvU32 noDisplay = 0; - - // Get all the Physical GPU Handles - ret = NvAPI_EnumPhysicalGPUs(nvGPUHandle, &gpuCount); - if(ret != NVAPI_OK) - { - return ret; - } - - for(NvU32 Count = 0; Count < gpuCount; Count++) // iterating per Physical GPU Handle call - { - NvU32 dispIdCount = 0; - // First call to get the no. of displays connected by passing NULL - if(NvAPI_GPU_GetConnectedDisplayIds(nvGPUHandle[Count], NULL, &dispIdCount, 0) != NVAPI_OK) - { - return NVAPI_ERROR; - } - - if(dispIdCount > 0) // If no. of displays connected > 0 we can proceed to check if its active - { - // alocations for the display ids - NV_GPU_DISPLAYIDS *dispIds = (NV_GPU_DISPLAYIDS *)malloc( sizeof(NV_GPU_DISPLAYIDS)*dispIdCount ); - - for(NvU32 dispIndex = 0; dispIndex < dispIdCount; dispIndex++) - { - dispIds[dispIndex].version = NV_GPU_DISPLAYIDS_VER; // adding the correct version information - } - - // second call to get the display ids - if(NvAPI_GPU_GetConnectedDisplayIds(nvGPUHandle[Count], dispIds, &dispIdCount, 0) != NVAPI_OK) - { - return NVAPI_ERROR; - } - - for(NvU32 dispIndex = 0; dispIndex < dispIdCount; dispIndex++) - { - if(dispIds[dispIndex].isMultiStreamRootNode) - { - continue; - } - displayIds[noDisplay] = dispIds[dispIndex].displayId; - noDisplay++; - } - } - } - - *noDisplays = noDisplay; - - return ret; -} - -NvAPI_Status ApplyCustomDisplay() -{ - NvAPI_Status ret = NVAPI_OK; - NvU32 noDisplays = 0; - - NvDisplayHandle hNvDisplay[NVAPI_MAX_DISPLAYS] = {0}; - - NvU32 displayIds[NVAPI_MAX_DISPLAYS] = {0}; - - ret = GetConnectedDisplays(&displayIds[0],&noDisplays); - if(ret != NVAPI_OK) - { - printf("\nCall to GetConnectedDisplays() failed"); - return ret; - } - - printf("\nNumber of Displays in the system = %2d",noDisplays); - - NV_CUSTOM_DISPLAY cd[NVAPI_MAX_DISPLAYS] = {0}; - - float rr = 60; - - //timing computation (to get timing that suits the changes made) - NV_TIMING_FLAG flag = {0}; - - NV_TIMING_INPUT timing = {0}; - - timing.version = NV_TIMING_INPUT_VER; - - for (NvU32 count = 0; count < noDisplays; count++) - { - //Load the NV_CUSTOM_DISPLAY structure with data from XML file - loadCustomDisplay(&cd[count]); - - timing.height = cd[count].height; - timing.width = cd[count].width; - timing.rr = rr; - - timing.flag = flag; - timing.type = NV_TIMING_OVERRIDE_CVT_RB; - timing.flag.scaling = 1; - - ret = NvAPI_DISP_GetTiming( displayIds[0], &timing, &cd[count].timing); - - if ( ret != NVAPI_OK) - { - printf("NvAPI_DISP_GetTiming() failed = %d\n", ret); //failed to get custom display timing - return ret; - } - } - - printf("\nCustom Timing to be tried: "); - printf("%d X %d @ %0.2f hz",cd[0].width,cd[0].height,rr); - - printf("\nNvAPI_DISP_TryCustomDisplay()"); - - ret = NvAPI_DISP_TryCustomDisplay(&displayIds[0],noDisplays, &cd[0]); // trying to set custom display - if ( ret != NVAPI_OK) - { - printf("NvAPI_DISP_TryCustomDisplay() failed = %d", ret); //failed to set custom display - return ret; - } - else - { - printf(".....Success!\n"); - } - Sleep(5000); - - printf("NvAPI_DISP_SaveCustomDisplay()"); - - ret = NvAPI_DISP_SaveCustomDisplay(&displayIds[0],noDisplays, true, true); - if ( ret != NVAPI_OK) - { - printf("NvAPI_DISP_SaveCustomDisplay() failed = %d", ret); //failed to save custom display - return ret; - } - else - { - printf(".....Success!\n"); - } - - Sleep(5000); - - printf("NvAPI_DISP_RevertCustomDisplayTrial()"); - - // Revert the new custom display settings tried. - ret = NvAPI_DISP_RevertCustomDisplayTrial(&displayIds[0],1); - if ( ret != NVAPI_OK) - { - printf("NvAPI_DISP_RevertCustomDisplayTrial() failed = %d", ret); //failed to revert custom display trail - return ret; - } - else - { - printf(".....Success!"); - Sleep(5000); - - } - - return ret; // Custom Display. -} \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/DisplayColorControl.cpp b/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/DisplayColorControl.cpp deleted file mode 100644 index 49667ff..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/DisplayColorControl.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -////////////////////////////////////////////////////////////////////////////////////////// -// @brief: This sample code shows how to use the NvAPI NvAPI_Disp_ColorControl to control the color values. -// @driver support: R304+ -////////////////////////////////////////////////////////////////////////////////////////// - - -#include "stdafx.h" -#include"NVHelper.h" - -int main() -{ - NvAPI_Status ret = Initialize_NVAPI(); - if (ret != NVAPI_OK) - { - return 0; - } - GetColorControl(); - SetColorControl(); - return 0; -} \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.cpp b/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.cpp deleted file mode 100644 index 92d0163..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -////////////////////////////////////////////////////////////////////////////////////////// -// @brief: This sample code shows how to use the NvAPI NvAPI_Disp_ColorControl to control the color values. -// @driver support: R304+ -////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "nvapi.h" -#include - -NvAPI_ShortString errorDescStr; - -char* GetNvAPIStatusString(NvAPI_Status nvapiErrorStatus) -{ - NvAPI_GetErrorMessage(nvapiErrorStatus, errorDescStr); - return errorDescStr; -} - -NvAPI_Status Initialize_NVAPI() -{ - NvAPI_Status nvapiReturnStatus = NVAPI_ERROR; - - nvapiReturnStatus = NvAPI_Initialize(); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nNvAPI_Initialize() failed.\nReturn Error : %s", GetNvAPIStatusString( nvapiReturnStatus)); - } - else - { - printf("\nNVAPI Initialized successfully"); - } - - return nvapiReturnStatus; -} - -NvAPI_Status GetGPUs(NvPhysicalGpuHandle gpuHandleArray[NVAPI_MAX_PHYSICAL_GPUS], NvU32 &gpuCount) -{ - NvAPI_Status nvapiReturnStatus = NVAPI_ERROR; - - // Get all gpu handles. - nvapiReturnStatus = NvAPI_EnumPhysicalGPUs(gpuHandleArray, &gpuCount); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nNvAPI_EnumPhysicalGPUs() failed.\nReturn Error : %s", GetNvAPIStatusString(nvapiReturnStatus)); - return nvapiReturnStatus; - } - - return nvapiReturnStatus; -} - -NvAPI_Status GetConnectedDisplays(NvPhysicalGpuHandle gpuHandle, NV_GPU_DISPLAYIDS *pDisplayID, NvU32 &displayIdCount) -{ - // First call to get the no. of displays connected by passing NULL - NvAPI_Status nvapiReturnStatus = NVAPI_ERROR; - NvU32 displayCount = 0; - nvapiReturnStatus = NvAPI_GPU_GetConnectedDisplayIds(gpuHandle, NULL, &displayCount, 0); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nNvAPI_GPU_GetConnectedDisplayIds() failed.\nReturn Error : %s", GetNvAPIStatusString(nvapiReturnStatus)); - return nvapiReturnStatus; - } - - if (displayCount == 0) - return nvapiReturnStatus; - - // alocation for the display ids - NV_GPU_DISPLAYIDS *dispIds = new NV_GPU_DISPLAYIDS[displayCount]; - if (!dispIds) - { - return NVAPI_OUT_OF_MEMORY; - } - - dispIds[0].version = NV_GPU_DISPLAYIDS_VER; - - nvapiReturnStatus = NvAPI_GPU_GetConnectedDisplayIds(gpuHandle, dispIds, &displayCount, 0); - if (nvapiReturnStatus == NVAPI_OK) - { - memcpy_s(pDisplayID, sizeof(NV_GPU_DISPLAYIDS) * NVAPI_MAX_DISPLAYS, dispIds, sizeof(NV_GPU_DISPLAYIDS) * displayCount); - displayIdCount = displayCount; - } - - delete[] dispIds; - return nvapiReturnStatus; -} - -void ColorControl(NV_COLOR_CMD command) -{ - NvAPI_Status nvapiReturnStatus = NVAPI_OK; - - switch (command) - { - case NV_COLOR_CMD_GET: - case NV_COLOR_CMD_SET: - break; - default: - nvapiReturnStatus = NVAPI_INVALID_ARGUMENT; - break; - } - - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nColorControl failed with error code : %s", GetNvAPIStatusString(nvapiReturnStatus)); - return; - } - - NV_GPU_DISPLAYIDS pDisplayID[NVAPI_MAX_DISPLAYS]; - NvU32 displayIdCount = 0; - - NvPhysicalGpuHandle gpuHandleArray[NVAPI_MAX_PHYSICAL_GPUS] = { 0 }; - NvU32 gpuCount = 0; - - nvapiReturnStatus = GetGPUs(gpuHandleArray, gpuCount); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nGetGPUs failed with error code : %s ", GetNvAPIStatusString(nvapiReturnStatus)); - return; - } - - // Get all active outputs info for all gpu's - for (NvU32 i = 0; i < gpuCount; ++i) - { - printf("\n\nGPU %d (Gpu handle : 0x%x )", i + 1, gpuHandleArray[i]); - nvapiReturnStatus = GetConnectedDisplays(gpuHandleArray[i], pDisplayID, displayIdCount); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\nGetConnectedDisplays failed for this GPU with error code : %s ", GetNvAPIStatusString(nvapiReturnStatus)); - continue; - } - - if (!displayIdCount) - { - printf("\n\tNo displays connected on this GPU"); - continue; - } - - NV_COLOR_DATA colorData = { 0 }; - colorData.version = NV_COLOR_DATA_VER; - colorData.size = sizeof(NV_COLOR_DATA); - - switch(command) - { - case NV_COLOR_CMD_GET: - colorData.cmd = NV_COLOR_CMD_GET; - break; - case NV_COLOR_CMD_SET: - colorData.cmd = NV_COLOR_CMD_SET; - colorData.data.bpc = NV_BPC_10; - colorData.data.colorFormat = NV_COLOR_FORMAT_DEFAULT; - colorData.data.colorimetry = NV_COLOR_COLORIMETRY_DEFAULT; - colorData.data.colorSelectionPolicy = NV_COLOR_SELECTION_POLICY_USER; - colorData.data.dynamicRange = NV_DYNAMIC_RANGE_AUTO; - break; - } - - for (NvU32 j = 0; j < displayIdCount; j++) - { - printf("\n\tDisplay %d (DisplayId 0x%x):", j + 1, pDisplayID[j].displayId); - nvapiReturnStatus = NvAPI_Disp_ColorControl(pDisplayID[j].displayId, &colorData); - if (nvapiReturnStatus != NVAPI_OK) - { - printf("\n\t\tNvAPI_Disp_ColorControl failed for this display with error code : %s ", GetNvAPIStatusString(nvapiReturnStatus)); - continue; - } - else - { - printf("\n\t\tNvAPI_Disp_ColorControl returned successfully for this display"); - } - } - } -} - -void GetColorControl() -{ - printf("\n\nGetColorControl started\n"); - NvAPI_Status nvapiReturnStatus = NVAPI_ERROR; - ColorControl(NV_COLOR_CMD_GET); -} - -void SetColorControl() -{ - printf("\n\n\nSetColorControl started\n"); - NvAPI_Status nvapiReturnStatus = NVAPI_ERROR; - ColorControl(NV_COLOR_CMD_SET); -} \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.h b/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.h deleted file mode 100644 index 5086f02..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/DisplayColorControl/NVHelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -////////////////////////////////////////////////////////////////////////////////////////// -// @brief: This sample code shows how to use the NvAPI NvAPI_Disp_ColorControl to control the color values. -// @driver support: R304+ -////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once -#include "nvapi.h" - -NvAPI_Status Initialize_NVAPI(); -void SetColorControl(); -void GetColorControl(); \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/DisplayConfiguration.cpp b/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/DisplayConfiguration.cpp deleted file mode 100644 index da32432..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/DisplayConfiguration.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -////////////////////////////////////////////////////////////////////////////////////////// -// @brief: This sample code checks the current configuration of the displays in the system. -// Assuming we have two displays on the system, we shall set the different display -// configurations on the displays. -// -// @assumptions:The system is assumed to have a WinVista+ OS, with atleast 2 Displays. -// An NVIDIA adapter is assumed to be present on the system with the appropriate -// driver installed. -// -// @driver support: R304+ -////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "targetver.h" -#include "nvapi.h" - -NvAPI_Status AllocateAndGetDisplayConfig(NvU32* pathInfoCount, NV_DISPLAYCONFIG_PATH_INFO** pPathInfo); -void ShowCurrentDisplayConfig(void); -NvAPI_Status SetMode(void); - -int _tmain(int argc, _TCHAR* argv[]) -{ - NvAPI_Status ret = NVAPI_OK; - ret = NvAPI_Initialize(); - if(ret != NVAPI_OK) - { - printf("NvAPI_Initialize() failed = 0x%x", ret); - return 1; // Initialization failed - } - ret = SetMode();//to get the current mode, set to single view and then apply clone mode - if(ret != NVAPI_OK) - { - printf("Failed to Set Mode... return code = 0x%x", ret); - return 1;//Failed to Set Mode - } - printf("\nDisplay Configuration Successful!\n"); - printf("\nPress any key to exit..."); - getchar(); - return 0; -} - -// This function is used to do the NvAPI_DISP_GetDisplayConfig to get the current state of the system -NvAPI_Status AllocateAndGetDisplayConfig(NvU32* pathInfoCount, NV_DISPLAYCONFIG_PATH_INFO** pPathInfo) -{ - NvAPI_Status ret; - - // Retrieve the display path information - NvU32 pathCount = 0; - NV_DISPLAYCONFIG_PATH_INFO *pathInfo = NULL; - - ret = NvAPI_DISP_GetDisplayConfig(&pathCount, NULL); - if (ret != NVAPI_OK) return ret; - - pathInfo = (NV_DISPLAYCONFIG_PATH_INFO*) malloc(pathCount * sizeof(NV_DISPLAYCONFIG_PATH_INFO)); - if (!pathInfo) - { - return NVAPI_OUT_OF_MEMORY; - } - - memset(pathInfo, 0, pathCount * sizeof(NV_DISPLAYCONFIG_PATH_INFO)); - for (NvU32 i = 0; i < pathCount; i++) - { - pathInfo[i].version = NV_DISPLAYCONFIG_PATH_INFO_VER; - } - - // Retrieve the targetInfo counts - ret = NvAPI_DISP_GetDisplayConfig(&pathCount, pathInfo); - if (ret != NVAPI_OK) - { - return ret; - } - - for (NvU32 i = 0; i < pathCount; i++) - { - // Allocate the source mode info - - if(pathInfo[i].version == NV_DISPLAYCONFIG_PATH_INFO_VER1 || pathInfo[i].version == NV_DISPLAYCONFIG_PATH_INFO_VER2) - { - pathInfo[i].sourceModeInfo = (NV_DISPLAYCONFIG_SOURCE_MODE_INFO*) malloc(sizeof(NV_DISPLAYCONFIG_SOURCE_MODE_INFO)); - } - else - { - -#ifdef NV_DISPLAYCONFIG_PATH_INFO_VER3 -pathInfo[i].sourceModeInfo = (NV_DISPLAYCONFIG_SOURCE_MODE_INFO*) malloc(pathInfo[i].sourceModeInfoCount * sizeof(NV_DISPLAYCONFIG_SOURCE_MODE_INFO)); -#endif - - } - if (pathInfo[i].sourceModeInfo == NULL) - { - return NVAPI_OUT_OF_MEMORY; - } - memset(pathInfo[i].sourceModeInfo, 0, sizeof(NV_DISPLAYCONFIG_SOURCE_MODE_INFO)); - - // Allocate the target array - pathInfo[i].targetInfo = (NV_DISPLAYCONFIG_PATH_TARGET_INFO*) malloc(pathInfo[i].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - if (pathInfo[i].targetInfo == NULL) - { - return NVAPI_OUT_OF_MEMORY; - } - // Allocate the target details - memset(pathInfo[i].targetInfo, 0, pathInfo[i].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - for (NvU32 j = 0 ; j < pathInfo[i].targetInfoCount ; j++) - { - pathInfo[i].targetInfo[j].details = (NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO*) malloc(sizeof(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO)); - memset(pathInfo[i].targetInfo[j].details, 0, sizeof(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO)); - pathInfo[i].targetInfo[j].details->version = NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER; - } - } - - // Retrieve the full path info - ret = NvAPI_DISP_GetDisplayConfig(&pathCount, pathInfo); - if (ret != NVAPI_OK) - { - return ret; - } - - *pathInfoCount = pathCount; - *pPathInfo = pathInfo; - return NVAPI_OK; -} - -// This function is used to display the current GPU configuration and the connected displays -void ShowCurrentDisplayConfig(void) -{ - NvAPI_Status ret = NVAPI_OK; - NV_DISPLAYCONFIG_PATH_INFO *pathInfo = NULL; - NvU32 pathCount = 0; - NV_DISPLAYCONFIG_PATH_INFO *pathInfo1 = NULL; - NvU32 nDisplayIds = 0; - NvU32 physicalGpuCount = 0; - NV_GPU_DISPLAYIDS* pDisplayIds = NULL; - NvPhysicalGpuHandle hPhysicalGpu[NVAPI_MAX_PHYSICAL_GPUS]; - - for (NvU32 PhysicalGpuIndex = 0; PhysicalGpuIndex < NVAPI_MAX_PHYSICAL_GPUS; PhysicalGpuIndex++) - { - hPhysicalGpu[PhysicalGpuIndex]=0; - } - - printf("\nThe currently running display configuration is as follows:\n"); - for(NvU32 count = 0; count < 60; count++) printf("#"); - printf("\nGPU index\tGPU ID\t\tDisplayIDs of displays\n"); - - - - // Enumerate the physical GPU handle - ret = NvAPI_EnumPhysicalGPUs(hPhysicalGpu, &physicalGpuCount); - if(ret != NVAPI_OK) - { - printf("Cannot enumerate GPUs in the system...\n"); - getchar(); - exit(1); - } - // get the display ids of connected displays - NvU32 DisplayGpuIndex = 0; - - for(NvU32 GpuIndex = 0; GpuIndex < physicalGpuCount; GpuIndex++) - { - ret = NvAPI_GPU_GetConnectedDisplayIds(hPhysicalGpu[GpuIndex], pDisplayIds, &nDisplayIds, 0); - if((ret == NVAPI_OK) && nDisplayIds) - { - DisplayGpuIndex = GpuIndex; - pDisplayIds = (NV_GPU_DISPLAYIDS*)malloc(nDisplayIds * sizeof(NV_GPU_DISPLAYIDS)); - if (pDisplayIds) - { - memset(pDisplayIds, 0, nDisplayIds * sizeof(NV_GPU_DISPLAYIDS)); - pDisplayIds[GpuIndex].version = NV_GPU_DISPLAYIDS_VER; - ret = NvAPI_GPU_GetConnectedDisplayIds(hPhysicalGpu[DisplayGpuIndex], pDisplayIds, &nDisplayIds, 0); - for(NvU32 DisplayIdIndex = 0; DisplayIdIndex < nDisplayIds; DisplayIdIndex++) - { - printf("%2d\t\t0x%x\t0x%x", GpuIndex, hPhysicalGpu[DisplayGpuIndex], pDisplayIds[DisplayIdIndex].displayId); - if(!pDisplayIds[DisplayIdIndex].displayId)printf("(NONE)"); - printf("\n"); - } - } - } - else - printf("%2d\t\t0x%x\n", GpuIndex, hPhysicalGpu[GpuIndex]); - } - for(NvU32 count = 0; count < 60; count++)printf("#"); - printf("\n"); - - ret = AllocateAndGetDisplayConfig(&pathCount, &pathInfo); - if (ret != NVAPI_OK) - { - printf("AllocateAndGetDisplayConfig failed!\n"); - getchar(); - exit(1); - } - if( pathCount == 1 ) - { - if( pathInfo[0].targetInfoCount == 1 ) // if pathCount = 1 and targetInfoCount =1 it is Single Mode - printf("Single MODE\n"); - else if( pathInfo[0].targetInfoCount > 1) // if pathCount >= 1 and targetInfoCount >1 it is Clone Mode - printf("Monitors in Clone MODE\n"); - } - else - { - for (NvU32 PathIndex = 0; PathIndex < pathCount; PathIndex++) - { - if(pathInfo[PathIndex].targetInfoCount == 1) - { - printf("Monitor with Display Id 0x%x is in Extended MODE\n",pathInfo[PathIndex].targetInfo->displayId); - // if pathCount > 1 and targetInfoCount =1 it is Extended Mode - } - else if( pathInfo[PathIndex].targetInfoCount > 1) - { - for (NvU32 TargetIndex = 0; TargetIndex < pathInfo[PathIndex].targetInfoCount; TargetIndex++) - { - // if pathCount >= 1 and targetInfoCount > 1 it is Clone Mode - printf("Monitors with Display Id 0x%x are in Clone MODE\n",pathInfo[PathIndex].targetInfo[TargetIndex].displayId); - } - } - } - } -} -// This function actually sets the possible display configurations on the multi-monitor setup -NvAPI_Status SetMode(void) -{ - NvU32 totalTargets = 0; - NvAPI_Status ret = NVAPI_OK; - NvU32 DisplayID = 0; - NvU32 pathCount = 0; - NV_DISPLAYCONFIG_PATH_INFO *pathInfo = NULL; - NvDisplayHandle *pNvDispHandle = NULL; - - //Retrieve the display path information - ShowCurrentDisplayConfig(); - - ret = AllocateAndGetDisplayConfig(&pathCount, &pathInfo); - if (ret != NVAPI_OK) - return ret; - - NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO *details = NULL; - details = (NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO*)malloc(sizeof(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO)); - - if( pathCount == 1 ) - { - totalTargets += pathInfo[0].targetInfoCount; - if(pathInfo[0].targetInfoCount > 1) - DisplayID = pathInfo[0].targetInfo[1].displayId; // Store displayId to use later - } - else - { - for (NvU32 i = 0; i < pathCount; i++) - { - totalTargets += pathInfo[i].targetInfoCount; // Count all targets - DisplayID = pathInfo[i].targetInfo[0].displayId; // Store displayId to use later - if(pathInfo[i].targetInfo[0].details) - { - details = pathInfo[i].targetInfo[0].details; - } - } - } - - - // Activate and Set 2 targets in Clone mode; pathCount >= 1 and targetInfoCount > 1 - if (totalTargets > 1) - { - printf("\nActivating clone mode display on system"); - if(pathInfo[0].version == NV_DISPLAYCONFIG_PATH_INFO_VER1 || pathInfo[0].version == NV_DISPLAYCONFIG_PATH_INFO_VER2) - { - - pathInfo[0].targetInfoCount = 2; - NV_DISPLAYCONFIG_PATH_TARGET_INFO* primary = (NV_DISPLAYCONFIG_PATH_TARGET_INFO*) malloc(pathInfo[0].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - printf("."); - memset(primary, 0, pathInfo[0].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - primary->displayId = pathInfo[0].targetInfo[0].displayId; - printf("."); - delete pathInfo[0].targetInfo; - pathInfo[0].targetInfo = primary; - pathInfo[0].targetInfo[1].displayId = DisplayID; - pathInfo[0].sourceModeInfo[0].bGDIPrimary = 1; // Decide the primary display - } - else - { - if( pathCount > 1 ) - { - pathInfo[0].targetInfoCount = 2; - NV_DISPLAYCONFIG_PATH_TARGET_INFO* primary = (NV_DISPLAYCONFIG_PATH_TARGET_INFO*) malloc(pathInfo[0].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - printf("."); - memset(primary, 0, pathInfo[0].targetInfoCount * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - primary->displayId = pathInfo[0].targetInfo[0].displayId; - printf("."); - primary->details = pathInfo[0].targetInfo[0].details; - primary++; - primary->displayId = DisplayID; - primary->details = details; - primary--; - delete pathInfo[0].targetInfo; - pathInfo[0].targetInfo = (NV_DISPLAYCONFIG_PATH_TARGET_INFO*) malloc(2 * sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO)); - pathInfo[0].targetInfo = primary; - } - pathInfo[0].sourceModeInfo[0].bGDIPrimary = 1;// Decide the primary display - -#ifdef NV_DISPLAYCONFIG_PATH_INFO_VER3 -pathInfo[0].sourceModeInfoCount = 1; -#endif - } - - ret = NvAPI_DISP_SetDisplayConfig(1, pathInfo, 0); - printf(".\n"); - NvU32 tempPathCount = 0; - NV_DISPLAYCONFIG_PATH_INFO *tempPathInfo = NULL; - if (ret == NVAPI_OK) - { - //Validation of set - ret = AllocateAndGetDisplayConfig(&tempPathCount, &tempPathInfo); - if (ret != NVAPI_OK) - { - ret = NVAPI_ERROR; - return ret; - } - else - { - (tempPathCount == 1 && pathInfo[0].targetInfoCount == tempPathInfo[0].targetInfoCount) ? ret = NVAPI_OK : ret = NVAPI_ERROR; - } - } - - if (ret != NVAPI_OK) - return ret; - - printf("Clone mode set!\n"); - printf("\nPress any key to continue..."); - getchar(); - } - - // Activate and Set 2 targets in Extended mode; pathCount > 1 and targetInfoCount = 1 - - if (totalTargets > 1) - { - printf("\nActivating extended mode display on system"); - NV_DISPLAYCONFIG_PATH_INFO *pathInfo1 = NULL; - NvU32 nDisplayIds = 0; - NvU32 physicalGpuCount = 0; - NV_GPU_DISPLAYIDS* pDisplayIds = NULL; - - NvPhysicalGpuHandle hPhysicalGpu[NVAPI_MAX_PHYSICAL_GPUS]; - for (NvU32 i = 0; idisplayId = pDisplayIds[i].displayId; - } - - ret = NvAPI_DISP_SetDisplayConfig(nDisplayIds, pathInfo1, 0); - printf(".\n");//Display config set to extended mode - NvU32 tempPathCount = 0; - NV_DISPLAYCONFIG_PATH_INFO *tempPathInfo = NULL; - if (ret == NVAPI_OK) - { - //Validation of set - ret = AllocateAndGetDisplayConfig(&tempPathCount, &tempPathInfo); - if (ret != NVAPI_OK) - { - ret = NVAPI_ERROR; - } - else - { - (tempPathCount == nDisplayIds) ? ret = NVAPI_OK : ret = NVAPI_ERROR; - } - } - - if (ret != NVAPI_OK) - return ret; - - printf("Extended mode set!\n"); - - } - return ret; -} - diff --git a/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/targetver.h b/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/targetver.h deleted file mode 100644 index 619b945..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/DisplayConfiguration/targetver.h +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -#pragma once - -// The following macros define the minimum required platform. The minimum required platform -// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run -// your application. The macros work by enabling all features available on platform versions up to and -// including the version specified. - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. -#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. -#endif \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/GPUHandleEnumeration/gpuHandleEnumeration.c b/参考/NexBox-main/R560-developer/Sample_Code/GPUHandleEnumeration/gpuHandleEnumeration.c deleted file mode 100644 index 8d8a1da..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/GPUHandleEnumeration/gpuHandleEnumeration.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. - * SPDX-License-Identifier: LicenseRef-NvidiaProprietary - * - * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual - * property and proprietary rights in and to this material, related - * documentation and any modifications thereto. Any use, reproduction, - * disclosure or distribution of this material and related documentation - * without an express license agreement from NVIDIA CORPORATION or - * its affiliates is strictly prohibited. - */ - -/*************************************************************/ -/* gpuHandleEnumeration.cpp -/* -/* The goal of this sample code is to demonstrate the usage of -/* the GPU handle enumeration APIs: -/* 1) NvAPI_SYS_GetLogicalGPUs -/* 2) NvAPI_SYS_GetPhysicalGPUs -/* -/* These APIs are capable of enumerating the GPU handles for -/* all types of NVIDIA adapters in the system - WDDM/MCDM/TCC. -/* -/* The GPU handles obtained from these APIs can further be -/* used to call other APIs. -/* -/*************************************************************/ - -#include -#include "nvapi.h" - -// Statically link to the NvAPI static library -#pragma comment(lib, "nvapi64.lib") -int main() -{ - NvAPI_Status status = NVAPI_OK; - NvAPI_ShortString szError = { 0 }; - - // Initialize the NVAPI interface first. - status = NvAPI_Initialize(); - if (status != NVAPI_OK) - { - NvAPI_GetErrorMessage(status, szError); - printf("\nNvAPI_Initialize() failed. The Error code is: %s", szError); - return -1; - } - - //--------------------------------------------------------------------------- - // Call the NvAPI_SYS_GetLogicalGPUs API and print the logical GPU handles - // with their adapter type. - //--------------------------------------------------------------------------- - NV_LOGICAL_GPUS_V1 nvLogicalGPUs = { 0 }; - nvLogicalGPUs.version = NV_LOGICAL_GPUS_VER1; - status = NvAPI_SYS_GetLogicalGPUs(&nvLogicalGPUs); - if (status != NVAPI_OK) - { - NvAPI_GetErrorMessage(status, szError); - printf("\nNvAPI_SYS_GetLogicalGPUs() failed. The Error code is: %s", szError); - return -1; - } - - printf("\n\nThe enumerated logical GPU handles are listed below. GPU_Count=%d.\n", nvLogicalGPUs.gpuHandleCount); - for (NvU32 i = 0; i < nvLogicalGPUs.gpuHandleCount; i++) - { - printf("\nLogical_GPUHandle[%d]:0x%p | AdapterType = %d", i, nvLogicalGPUs.gpuHandleData[i].hLogicalGpu, - nvLogicalGPUs.gpuHandleData[i].adapterType); - } - - //---------------------------------------------------------------------------- - // Call the NvAPI_SYS_GetPhysicalGPUs API and print the physical GPU handles - // with their adapter type - //---------------------------------------------------------------------------- - NV_PHYSICAL_GPUS_V1 nvPhysicalGPUs = { 0 }; - nvPhysicalGPUs.version = NV_PHYSICAL_GPUS_VER1; - status = NvAPI_SYS_GetPhysicalGPUs(&nvPhysicalGPUs); - if (status != NVAPI_OK) - { - NvAPI_GetErrorMessage(status, szError); - printf("\nNvAPI_SYS_GetPhysicalGPUs() failed. The Error code is: %s", szError); - return -1; - } - - for (NvU32 i = 0; i < nvPhysicalGPUs.gpuHandleCount; i++) - { - printf("\nPhysical_GPUHandle[%d]:0x%p | AdapterType = %d", i, nvPhysicalGPUs.gpuHandleData[i].hPhysicalGpu, - nvPhysicalGPUs.gpuHandleData[i].adapterType); - } - - return 0; -} diff --git a/参考/NexBox-main/R560-developer/Sample_Code/QSYNC_Event_Registration/QSYNC_Event_Registration.cpp b/参考/NexBox-main/R560-developer/Sample_Code/QSYNC_Event_Registration/QSYNC_Event_Registration.cpp deleted file mode 100644 index ee1a371..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/QSYNC_Event_Registration/QSYNC_Event_Registration.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2020 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -//////////////////////////////////////////////////////////////////////////////////// -// @brief: This is the entry point for the console application. -// This program registers QSYNC event to the system. -// The received QSYNC event will be logged on the console of this application. -// -// @assumptions: This code is designed for Win10+. It assumes that the system has -// atleast one GPU and a QSYNC board. -// -// @driver support: R460+ -//////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include -#include -#include -#include "nvapi.h" - - -#define STATUS_SUCCESS 0 -#define STATUS_FAIL 1 - - -// forward declarations -void __cdecl HandleQSYNCEvent(NV_QSYNC_EVENT_DATA qsyncEventData, void *callbackParam); - -int _tmain(int argc, _TCHAR* argv[]) -{ - int iRet = STATUS_FAIL; // default to fail - NvEventHandle hEventQSYNC = NULL; - NvAPI_Status status = NVAPI_ERROR; - - do - { - status = NvAPI_Initialize(); - if (NVAPI_OK != status) - { - // Initialization failed - printf("NvAPI_Initialize() failed = 0x%x", status); - break; - } - - NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES]; - NvU32 gsyncCount = 0; - status = NvAPI_GSync_EnumSyncDevices(nvGSyncHandles, &gsyncCount); - if (status == NVAPI_NVIDIA_DEVICE_NOT_FOUND || gsyncCount == 0) - { - printf("No Quadro Sync Devices found on this system\n"); - break; - } - - NV_EVENT_REGISTER_CALLBACK nvQSYNCEventRegisterCallback; - ZeroMemory(&nvQSYNCEventRegisterCallback, sizeof(nvQSYNCEventRegisterCallback)); - nvQSYNCEventRegisterCallback.nvCallBackFunc.nvQSYNCEventCallback = HandleQSYNCEvent; - nvQSYNCEventRegisterCallback.eventId = NV_EVENT_TYPE_QSYNC; - nvQSYNCEventRegisterCallback.version = NV_EVENT_REGISTER_CALLBACK_VERSION; - - // Register for Quadro sync events. - // This is central callback for the events of all Quadro Sync devices in the system. - status = NvAPI_Event_RegisterCallback(&nvQSYNCEventRegisterCallback, &hEventQSYNC); - if (NVAPI_OK != status) - { - printf("NvAPI_Event_RegisterCallback() failed = 0x%x", status); - break; - } - - // Wait for user's input for exit. Log all events until then. - printf("The console would log Quadro Sync (QSYNC) related events\n"); - printf("(Please wait for events or Press any key to exit...)\n"); - getchar(); - - // we've succeeded - iRet = STATUS_SUCCESS; - } while (false); - - // Cleanup - if (hEventQSYNC != NULL) - { - status = NvAPI_Event_UnregisterCallback(hEventQSYNC); - if (status != NVAPI_OK) - { - iRet = STATUS_FAIL; - printf("NvAPI_Event_UnregisterCallback() failed = 0x%x", status); - } - hEventQSYNC = NULL; - } - - return iRet; -} - - -// This function is hit when a QSYNC event is broadcasted by the display driver. -void __cdecl HandleQSYNCEvent(NV_QSYNC_EVENT_DATA qsyncEventData, void *callbackParam) -{ - switch (qsyncEventData.qsyncEvent) - { - case NV_QSYNC_EVENT_SYNC_LOSS: - printf("\n Received event NV_QSYNC_EVENT_SYNC_LOSS"); - break; - case NV_QSYNC_EVENT_SYNC_GAIN: - printf("\n Received event NV_QSYNC_EVENT_SYNC_GAIN"); - break; - case NV_QSYNC_EVENT_HOUSESYNC_GAIN: - printf("\n Received event NV_QSYNC_EVENT_HOUSESYNC_GAIN"); - break; - case NV_QSYNC_EVENT_HOUSESYNC_LOSS: - printf("\n Received event NV_QSYNC_EVENT_HOUSESYNC_LOSS"); - break; - case NV_QSYNC_EVENT_RJ45_GAIN: - printf("\n Received event NV_QSYNC_EVENT_RJ45_GAIN"); - break; - case NV_QSYNC_EVENT_RJ45_LOSS: - printf("\n Received event NV_QSYNC_EVENT_RJ45_LOSS"); - break; - default: - printf("\n Received Unknown event"); - break; - } -} \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/Sync_Configuration.cpp b/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/Sync_Configuration.cpp deleted file mode 100644 index 0591aa4..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/Sync_Configuration.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ - -#include -#include -#include -#include -#include -#include"nvapi.h" - - -static const char* g_connector[] = {"NONE", "PRIMARY", "SECONDARY", "TERTIARY","QUARTERNARY"}; -static const char* g_dispSyncState[] = {"UNSYNCED", "SLAVE", "MASTER"}; -static const char* g_RJ45Status[] = {"OUTPUT", "INPUT", "UNUSED"}; -static const char* g_RJ45Ethernet[] = {"NO", "YES"}; - -#define NVAPI_MAX_GPUS_PER_GSYNC 4 - -typedef struct __GSyncSySInfo -{ - NvU32 gsyncCount; // gsync board (default 0) - struct{ - NvGSyncDeviceHandle hNvGSyncDevice; - NvU32 gpuCount; - NV_GSYNC_GPU gpus[NVAPI_MAX_GPUS_PER_GSYNC]; // gpu attached gsync board (default 0) - NvU32 refreshRate; // refresh rate (default 60) - NV_GSYNC_CONTROL_PARAMS Ctrlparams; - } gsyncTopo[NVAPI_MAX_GSYNC_DEVICES]; - NvU32 dispCount; - NV_GSYNC_DISPLAY displays[NVAPI_MAX_GPUS_PER_GSYNC*NV_MAX_HEADS]; -} GSyncSySInfo; -GSyncSySInfo gsyncSysInfo; - -typedef struct __GSyncUserSettings -{ - NvGSyncDeviceHandle hNvGSyncDevice;; // gsync board (default 0) - NvU32 gpuBoard; // gpu attached gsync board (default 0) - NvU32 dispCount; - NV_GSYNC_DISPLAY displays[NVAPI_MAX_GPUS_PER_GSYNC*NV_MAX_HEADS]; - NV_GSYNC_CONTROL_PARAMS Ctrlparams; -} GSyncUserSettings; - -NvAPI_Status gSyncQueryParameters(NvGSyncDeviceHandle hNvGSyncDevice) -{ - // Status params - NvAPI_Status ret; - NV_GSYNC_CONTROL_PARAMS Ctrlparams = {0}; - NV_GSYNC_STATUS_PARAMS StatusParams = {0}; - - Ctrlparams.version = NV_GSYNC_CONTROL_PARAMS_VER; - ret = NvAPI_GSync_GetControlParameters( hNvGSyncDevice, &Ctrlparams ); - - if( NVAPI_OK == ret ) - { - printf("Polarity : %d\n", (NvU32)Ctrlparams.polarity); - printf("Video Mode : %d\n", (NvU32)Ctrlparams.vmode); - printf("Sync Interval : %d\n", Ctrlparams.interval); - printf("Source : %d\n", (NvU32)Ctrlparams.source); - } - else - { - printf("Error querying control parameters:%d\n\n", ret); - return ret; - } - - // Status params - StatusParams.version = NV_GSYNC_STATUS_PARAMS_VER; - ret = NvAPI_GSync_GetStatusParameters( hNvGSyncDevice, &StatusParams ); - - if( NVAPI_OK == ret ) - { - printf("Refresh Rate : %d\n", StatusParams.refreshRate); - printf("Incoming house sync freq : %d\n", StatusParams.houseSyncIncoming); - printf("House sync present : %d\n", StatusParams.bHouseSync); - printf("RJ45[0] : %s\n", g_RJ45Status[(NvU32)StatusParams.RJ45_IO[0]]); - printf("RJ45[1] : %s\n", g_RJ45Status[(NvU32)StatusParams.RJ45_IO[1]]); - printf("RJ45[0] to ethernet? : %s\n", g_RJ45Ethernet[StatusParams.RJ45_Ethernet[0]]); - printf("RJ45[1] to ethernet? : %s\n", g_RJ45Ethernet[StatusParams.RJ45_Ethernet[1]]); - } - else - { - printf("Error querying status parameters:%d\n\n", ret); - } - - printf("---------------------------\n"); - return ret; -} - -NvAPI_Status gSyncQuerySyncStatus(NvGSyncDeviceHandle nvGSyncHandle) -{ - NV_GSYNC_STATUS status = {0}; - NvAPI_Status ret = NVAPI_OK; - NvU32 gsyncGpuCount = 0; - - ret = NvAPI_GSync_GetTopology(nvGSyncHandle, &gsyncGpuCount, NULL, NULL, NULL); - if ((ret != NVAPI_OK) && (gsyncGpuCount < 1)) - { - printf("GetTopology Call failed\n"); - return ret; - } - - NV_GSYNC_GPU *pGsyncGpu = new NV_GSYNC_GPU[gsyncGpuCount]; - pGsyncGpu[0].version = NV_GSYNC_GPU_VER; - - ret = NvAPI_GSync_GetTopology(nvGSyncHandle, &gsyncGpuCount, pGsyncGpu, NULL, NULL); - if (ret != NVAPI_OK) - { - printf("GetTopology Call failed\n"); - goto cleanup; - return ret; - } - - for(NvU32 i=0; i It returns current Sync topology including GPU and displays of system, for all available Sync devices. \n" ); - printf(" setSync -> It sets the default Sync state for active displays in Sync topology. \n" ); - printf(" unSync -> It un-sets the Sync state for displays in Sync topology. \n" ); - printf(" queryParams -> It returns control parameters and status parameters, for all available Sync devices. \n" ); - printf(" toggleSrc -> Toggles between houseSync and vSync. \n"); -} - -int main(int argc, char** argv) -{ - if(argc < 2) - { - printf("check help\n"); - return -1; - } - - NvAPI_Status ret = NVAPI_OK; - NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES]; - NvU32 gsyncCount = 0; - ret = NvAPI_GSync_EnumSyncDevices(nvGSyncHandles, &gsyncCount); - if (NVAPI_OK != ret) - { - if (NVAPI_NVIDIA_DEVICE_NOT_FOUND == ret) - { - gsyncCount = 0; - printf("No GSync Devices found on this system (cannot continue testing)\n"); - } - return -1; - } - - gsyncSysInfo.gsyncCount = gsyncCount; - - ret = gsyncGetTopology(nvGSyncHandles, gsyncCount); - if(ret != NVAPI_OK) - { - return -1; - } - - GSyncUserSettings gsyncUserSettings = {0}; - - int index = 1; - if(stricmp(argv[index], "help") == 0) - { - printHelp(); - return 0; - } - else if(stricmp(argv[index], "queryTopo") == 0) - { - printGsyncTopo(); - return 0; - } - // SetSync with one master and rest slaves - else if(stricmp(argv[index], "setSync") == 0) - { - NvU32 flags = 0 ; - GSyncUserSettings gsyncUserSettings; - memset(&gsyncUserSettings,0,sizeof(GSyncUserSettings)); - gsyncUserSettings.displays[0].version = NV_GSYNC_DISPLAY_VER; - - NvU32 dispIndex = 0; - bool isMasterableFound = false; - gsyncUserSettings.dispCount = gsyncSysInfo.dispCount; - for (dispIndex = 0 ; dispIndex < gsyncSysInfo.dispCount; dispIndex++) - { - gsyncUserSettings.displays[dispIndex].displayId = gsyncSysInfo.displays[dispIndex].displayId; - gsyncUserSettings.displays[dispIndex].reserved = gsyncSysInfo.displays[dispIndex].reserved; - if (!isMasterableFound && gsyncSysInfo.displays[dispIndex].isMasterable) - { - gsyncUserSettings.displays[dispIndex].syncState = NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER; - isMasterableFound = true; - } - else - { - gsyncUserSettings.displays[dispIndex].syncState = NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE; - } - } - ret = NvAPI_GSync_SetSyncStateSettings(gsyncUserSettings.dispCount, gsyncUserSettings.displays, flags); - if(ret!=NVAPI_OK) - { - printf("setSync failed with %d error code\n",ret); - return -1; - } - else - { - printf("settings applied--see topo as below\n"); - gsyncGetTopology(nvGSyncHandles, gsyncCount); - printGsyncTopo(); - return 0; - } - } - // Disable = UnSync all displays connected - else if(stricmp(argv[index], "unSync") == 0) - { - NvU32 flags = 0 ; - GSyncUserSettings gsyncUserSettings = {0}; - gsyncUserSettings.displays[0].version = NV_GSYNC_DISPLAY_VER; - - gsyncUserSettings.dispCount = 0; - ret = NvAPI_GSync_SetSyncStateSettings(gsyncUserSettings.dispCount, gsyncUserSettings.displays, flags); - if(ret!=NVAPI_OK) - { - printf("unSync failed with %d error code\n",ret); - return -1; - } - else - { - printf("settings applied--see topo as below\n"); - gsyncGetTopology(nvGSyncHandles, gsyncCount); - printGsyncTopo(); - return 0; - } - } - else if(stricmp(argv[index], "queryParams") == 0) - { - ret = gSyncQueryParameters(nvGSyncHandles[0]); - if(ret !=NVAPI_OK) - { - return -1; - } - } - else if(stricmp(argv[index], "toggleSrc") == 0) - { - gsyncSysInfo.gsyncTopo[0].Ctrlparams.source = (NVAPI_GSYNC_SYNC_SOURCE)!(NvU32)gsyncSysInfo.gsyncTopo[0].Ctrlparams.source; - gsyncSysInfo.gsyncTopo[0].Ctrlparams.version = NV_GSYNC_CONTROL_PARAMS_VER; - ret = NvAPI_GSync_SetControlParameters(nvGSyncHandles[0], &gsyncSysInfo.gsyncTopo[0].Ctrlparams); - if(ret!=NVAPI_OK) - { - printf("SetControl failed with %d error code\n",ret); - return -1; - } - } - - return 0; -} - diff --git a/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/targetver.h b/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/targetver.h deleted file mode 100644 index 7d48277..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/Sync_Configuration/targetver.h +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ - -#pragma once - -// The following macros define the minimum required platform. The minimum required platform -// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run -// your application. The macros work by enabling all features available on platform versions up to and -// including the version specified. - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. -#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. -#endif diff --git a/参考/NexBox-main/R560-developer/Sample_Code/i2c/i2c.cpp b/参考/NexBox-main/R560-developer/Sample_Code/i2c/i2c.cpp deleted file mode 100644 index bec762b..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/i2c/i2c.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -//////////////////////////////////////////////////////////////////////////////////// -// @brief: This sample changes the brightness of a monitor over the i2c bus. -// It checks whether the monitor connected to the system is -// DDC/CI compatible or not. On success, it shall reduce its brightness to 20 -// and after a wait of 5 seconds, restores the value to -// its original -// -// @assumptions: This code is designed for WinVista+.It assumes that the system has -// atleast one active display.This sample demonstrates the use of the -// i2c APIs for read and write. -// -// @driver support: R304+ -//////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "nvapi.h" -#include "targetver.h" - -const int DELAY_IN_SEC = 5; // Delay between brightness changes -const int BRIGHTNESS_TEST_VALUE = 20; // Test value to set brightness to - -BOOL ReadAndChangeBrightness(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayId, bool bSimulateBarcoTest); -BOOL CheckForDDCCICompliance(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayId); - -int main() -{ - NvAPI_Status nvapiStatus = NVAPI_OK; - - // Initialize NVAPI. - if ((nvapiStatus = NvAPI_Initialize()) != NVAPI_OK ) - { - printf("NvAPI_Initialize() failed with status %d\n", nvapiStatus); - printf("\n"); - printf("I2C Read/Write brightness test FAILED"); - return 1; - } - // - // Enumerate display handles - // - NvDisplayHandle hDisplay_a[NVAPI_MAX_PHYSICAL_GPUS * NVAPI_MAX_DISPLAY_HEADS] = {0}; - NvU32 nvDisplayCount = 0; - for (unsigned int i = 0; nvapiStatus == NVAPI_OK; i++) - { - nvapiStatus = NvAPI_EnumNvidiaDisplayHandle(i, &hDisplay_a[i]); - - if (nvapiStatus == NVAPI_OK) - { - nvDisplayCount++; - } - else if (nvapiStatus != NVAPI_END_ENUMERATION) - { - printf("NvAPI_EnumNvidiaDisplayHandle() failed with status %d\n", nvapiStatus); - printf("\n"); - printf("I2C Read/Write brightness test FAILED"); - return 1; - } - } - - printf("No of displays = %u\n", nvDisplayCount); - printf("Display handles: "); - for (unsigned int i = 0; i < nvDisplayCount; i++) - { - printf(" %08p", (void*)hDisplay_a[i]); - } - printf("\n"); - - // - // Enumerate physical GPU handles - // - NvPhysicalGpuHandle hGPU_a[NVAPI_MAX_PHYSICAL_GPUS] = {0}; // handle to GPUs - NvU32 gpuCount = 0; - nvapiStatus = NvAPI_EnumPhysicalGPUs(hGPU_a, &gpuCount); - if (nvapiStatus != NVAPI_OK) - { - printf("NvAPI_EnumPhysicalGPUs() failed with status %d\n", nvapiStatus); - printf("\n"); - printf("I2C Read/Write brightness test FAILED"); - return 1; - } - printf("Total number of GPU's = %u\n", gpuCount); - - BOOL isTestPassed = TRUE; - - // - // Cycle through all attached displays to read & change brightness - // - for (unsigned int i = 0; i < nvDisplayCount; i++) - { - // Get GPU id assiciated with display ID - NvPhysicalGpuHandle hGpu = NULL; - NvU32 pGpuCount=0; - nvapiStatus = NvAPI_GetPhysicalGPUsFromDisplay(hDisplay_a[i], &hGpu, &pGpuCount); - if (nvapiStatus != NVAPI_OK) - { - printf("NvAPI_GetPhysicalGPUFromDisplay() failed with status %d\n", nvapiStatus); - isTestPassed = FALSE; - break; - } - - // Get the display id for subsequent I2C calls via NVAPI: - NvU32 outputID = 0; - nvapiStatus=NvAPI_GetAssociatedDisplayOutputId(hDisplay_a[i], &outputID); - if (nvapiStatus != NVAPI_OK) - { - printf("NvAPI_GetAssociatedDisplayOutputId() failed with status %d\n", nvapiStatus); - isTestPassed = FALSE; - break; - } - - printf - ( - "Testing GPU handle=%08p, Output ID=%d, Display no=%d, Display handle=%08p...\n", - hGpu, outputID, i, hDisplay_a[i] - ); - - printf( "- Regular I2C read operation test mode\n" ); - - BOOL result = CheckForDDCCICompliance(hGpu, outputID); - if (!result) - { - printf(" The display 0x%X is not DDC/CI capable so skipping the test \n \n", outputID); - printf(" The Failure is expected on notebooks \n"); - return FALSE; - } - - result = ReadAndChangeBrightness(hGpu, outputID, TRUE); - if (!result) - { - printf("...test FAILED!\n"); - isTestPassed = FALSE; - } - printf("\n"); - - printf( "- Barco DDC test I2C read operation test mode\n" ); - result = ReadAndChangeBrightness(hGpu, outputID, FALSE); - if (!result) - { - printf("...test FAILED!\n"); - isTestPassed = FALSE; - } - printf("\n"); - } - - printf("\n"); - printf("I2C Read/Write brightness test %s\n", isTestPassed ? "PASSED" : "FAILED"); - - return isTestPassed ? 0 : 1; -} - - -// This function calculates the (XOR) checksum of the I2C register -void CalculateI2cChecksum(const NV_I2C_INFO &i2cInfo) -{ - // Calculate the i2c packet checksum and place the - // value into the packet - - // i2c checksum is the result of xor'ing all the bytes in the - // packet (except for the last data byte, which is the checksum - // itself) - - // Packet consists of: - - // The device address... - BYTE checksum = i2cInfo.i2cDevAddress; - - // Register address... - for (unsigned int i = 0; i < i2cInfo.regAddrSize; ++i) - { - checksum ^= i2cInfo.pbI2cRegAddress[ i ]; - } - - // And data bytes less last byte for checksum... - for (unsigned int i = 0; i < i2cInfo.cbSize - 1; ++i) - { - checksum ^= i2cInfo.pbData[ i ]; - } - - // Store calculated checksum in the last byte of i2c packet - i2cInfo.pbData[ i2cInfo.cbSize - 1 ] = checksum; -} - - -// This macro initializes the i2cinfo structure -#define INIT_I2CINFO(i2cInfo, i2cVersion, displayId, isDDCPort, \ - i2cDevAddr, regAddr, regSize, dataBuf, bufSize, speed) \ -do { \ - i2cInfo.version = i2cVersion; \ - i2cInfo.displayMask = displayId; \ - i2cInfo.bIsDDCPort = isDDCPort; \ - i2cInfo.i2cDevAddress = i2cDevAddr; \ - i2cInfo.pbI2cRegAddress = (BYTE*) ®Addr; \ - i2cInfo.regAddrSize = regSize; \ - i2cInfo.pbData = (BYTE*) &dataBuf; \ - i2cInfo.cbSize = bufSize; \ - i2cInfo.i2cSpeed = speed; \ -}while (0) - -// Checks whether the Display Device is compliant with DDC(Display Data Channel) standard and its CI(Command Interface) -BOOL CheckForDDCCICompliance(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayId) -{ - NvAPI_Status nvapiStatus = NVAPI_OK; - - //Check if the monitor is DDC/CI compliant or not - - NV_I2C_INFO i2cInfo = {0}; - // - // The 7-bit I2C address for display = Ox37 - // Since we always use 8bits to address, this 7-bit addr (0x37) is placed on - // the upper 7 bits, and the LSB contains the Read/Write flag: - // Write = 0 and Read =1; - // - NvU8 i2cDeviceAddr = 0x37; - NvU8 i2cWriteDeviceAddr = i2cDeviceAddr << 1; //0x6E - NvU8 i2cReadDeviceAddr = i2cWriteDeviceAddr | 1; //0x6F - - // - // 1. Send a write packet to request current brightness value - // The packet consists of the following bytes - // 0x6E - i2cWriteDeviceAddr - // Ox51 - Register address - // 0x82 - Length - // 0x01 - Read operation flag - // 0x10 - MCCS brightness code for samsung - // OxAC - Check sum, xor'ing all the above bytes - // - BYTE destAddr[ ] = {0x51}; - BYTE comBytes[ ] = {0x82, 0x01, 0x10, 0xAC}; - - INIT_I2CINFO(i2cInfo, NV_I2C_INFO_VER, displayId, TRUE, i2cWriteDeviceAddr, - destAddr, sizeof(destAddr), comBytes, sizeof(comBytes), 27); - CalculateI2cChecksum( i2cInfo ); - - nvapiStatus = NvAPI_I2CWrite(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CWrite failed with status %d\n", nvapiStatus); - return FALSE; - } - - // Short delay of 100ms, min time should be 30ms for the display to sync up: - Sleep( 100 ); - - // 2. read the response from the display - BYTE readBytes[11] = {0}; - BYTE i2cRegAddress[] = {0x6E}; // reg address to simulate Barco tool's read op - - INIT_I2CINFO(i2cInfo, NV_I2C_INFO_VER, displayId, TRUE, i2cReadDeviceAddr, - i2cRegAddress, sizeof(i2cRegAddress), readBytes, sizeof(readBytes), 27); - - CalculateI2cChecksum( i2cInfo ); - nvapiStatus = NvAPI_I2CRead(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CRead failed with status %d\n", nvapiStatus); - return FALSE; - } - printf("%X %X %X %X %X %X %X %X %X %X %X \n\n ", readBytes[0], readBytes[1], - readBytes[2], readBytes[3], readBytes[4], readBytes[5], readBytes[6], - readBytes[7], readBytes[8], readBytes[9], readBytes[10]); - if (readBytes[3] != 0x00) - { - printf(" ResultCode = %d\n", readBytes[3]); - return FALSE; - } - printf(" The display 0x%x is DDC/CI capable \n\n", displayId); - - // Short delay of 100ms, min time should be 30ms for the display to sync up: - Sleep( 1000 ); - - return TRUE; -} -// This function actually changes the brightness over the I2C bus by issuing commands and data -BOOL ReadAndChangeBrightness(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayId, bool bSimulateBarcoTest) -{ - NvAPI_Status nvapiStatus = NVAPI_OK; - - NV_I2C_INFO i2cInfo = {0}; - i2cInfo.version = NV_I2C_INFO_VER; - // - // The 7-bit I2C address for display = Ox37 - // Since we always use 8bits to address, this 7-bit addr (0x37) is placed on - // the upper 7 bits, and the LSB contains the Read/Write flag: - // Write = 0 and Read =1; - // - NvU8 i2cDeviceAddr = 0x37; - NvU8 i2cWriteDeviceAddr = i2cDeviceAddr << 1; //0x6E - NvU8 i2cReadDeviceAddr = i2cWriteDeviceAddr | 1; //0x6F - - // - // 1. Send a write packet to request current brightness value - // The packet consists of the following bytes - // 0x6E - i2cWriteDeviceAddr - // Ox51 - Register address - // 0x82 - 0x80 OR n where n = 2 bytes for "read a value" request - // 0x01 - Read operation flag - // 0x10 - MCCS brightness code for samsung - // OxAC - Check sum, xor'ing all the above bytes - // - BYTE registerAddr[ ] = {0x51}; - BYTE queryBytes[ ] = { 0x82, 0x01, 0x10, 0xAC}; - - INIT_I2CINFO(i2cInfo, NV_I2C_INFO_VER, displayId, TRUE, i2cWriteDeviceAddr, - registerAddr, sizeof(registerAddr), queryBytes, sizeof(queryBytes), 27); - - CalculateI2cChecksum( i2cInfo ); - - nvapiStatus = NvAPI_I2CWrite(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CWrite (request brightness) failed with status %d\n", nvapiStatus); - return FALSE; - } - // Short delay of 100ms, min time should be 30ms for the display to sync up: - Sleep( 100 ); - - // - // 2. Do a read to get the answer to our brightness value request - // - BYTE readBytes[11] = {0}; - BYTE i2cRegAddress[] = {0}; // reg address to simulate Barco tool's read op - - INIT_I2CINFO(i2cInfo, NV_I2C_INFO_VER, displayId, TRUE, i2cReadDeviceAddr, - i2cRegAddress, sizeof(i2cRegAddress), readBytes, sizeof(readBytes), 27); - if (bSimulateBarcoTest) - { - // Barco test tool (as well as various 3rd party applications, such as CFS from Canvys) - // do the direct I2C read operation (LSB of device address == 1), but still specify - // non-zero regAddrSize. - // - // See bug http://nvbugs/572079 for reference on customer complain; http://nvbugs/534510 - // for CFS tool problem; NvAPI_I2cReadInternal() for reference on direct vs standard read - // - i2cInfo.pbI2cRegAddress = i2cRegAddress; - i2cInfo.regAddrSize = 1; - } - else - { - i2cInfo.pbI2cRegAddress = (BYTE *)~0; //not required, ignore - i2cInfo.regAddrSize = 0; - } - - nvapiStatus = NvAPI_I2CRead(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CRead (read brightness) failed with status %d\n", nvapiStatus); - return FALSE; - } - - Sleep( 500 ); - - // - // The data packet, Readbytes that is returned by the monitor is ordered as follows - // Readbytes[0] = Ox6E , ACK to the read device address that was sent earlier - // Readbytes[1] = 0x88 , 0x80 OR n where n = 8 bytes for answer to read request as follows - // Readbytes[2] = 0x02 , Fixed value - // Readbytes[3] = 0x00 , Result Code (00h = NoError, 01h = Unsupported VCP Code) - // Readbytes[4] = 0x10 , MCCS brightness code value that we want to read - // Readbytes[5] = 0x00 , VCP type code (00h = Set parameter, 01h = Momentary) - // Readbytes[6] = 0x?? , Max value (High byte) of your monitor - // Readbytes[7] = 0x?? , Max value (Low byte) of your monitor - // Readbytes[8] = 0x?? , Current brightness value (High byte) - // Readbytes[9] = 0x?? , Current brightness value (Low byte) - // Readbytes[10] = checksum - // - printf(" Current brightness value = %d and max brightness value = %d\n", - (readBytes[8] << 8 | readBytes[9]), (readBytes[6] << 8 |readBytes[7])); - // - // Now Send a write packet to modify current brightness value to 20 (0x14) - // The packet consists of the following bytes - // 0x6E - i2cWriteDeviceAddr - // Ox51 - Register address - // 0x84 - 0x80 OR n where n = 4 bytes for "modify a value" request - // 0x03 - change a value flag - // 0x10 - MCCS brightness code for samsung - // Ox00 - new brightness value high byte - // 0x14 - new brightness value low byte (=20) - // 0xBC - checksum, , xor'ing all the above bytes - // - BYTE modifyBytes[ ] = { 0x84, 0x03, 0x10, 0x00, BRIGHTNESS_TEST_VALUE, 0xBC}; - - INIT_I2CINFO(i2cInfo, NV_I2C_INFO_VER, displayId, TRUE, i2cWriteDeviceAddr, - registerAddr, sizeof(registerAddr), modifyBytes, sizeof(modifyBytes), 27); - CalculateI2cChecksum( i2cInfo ); - - nvapiStatus = NvAPI_I2CWrite(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CWrite (revise brightness) failed with status %d\n", nvapiStatus); - return FALSE; - } - - Sleep( 100 ); - printf("\n Succesfully modified brightness value to %d!\n", BRIGHTNESS_TEST_VALUE); - - printf(" Pausing for %d seconds...\n", DELAY_IN_SEC); - Sleep( DELAY_IN_SEC * 1000 ); // Wait for the user to notice the brightness change - - // - // restore the brightness, so the user doesn't have to fiddle - // around with the monitor front panel controls: - // - modifyBytes[3] = readBytes[8]; // Set brightness back to what it was before - modifyBytes[4] = readBytes[9]; - - CalculateI2cChecksum( i2cInfo ); - - nvapiStatus = NvAPI_I2CWrite(hPhysicalGpu, &i2cInfo); - if (nvapiStatus != NVAPI_OK) - { - printf(" NvAPI_I2CWrite (restore brightness) failed with status %d\n", nvapiStatus); - return FALSE; - } - Sleep( 100 ); - printf("\n Succesfully restored the brightness value to %d.\n", readBytes[9]); - - printf(" Pausing for %d more seconds...\n", DELAY_IN_SEC); - Sleep( DELAY_IN_SEC * 1000 ); - - return TRUE; -} diff --git a/参考/NexBox-main/R560-developer/Sample_Code/i2c/targetver.h b/参考/NexBox-main/R560-developer/Sample_Code/i2c/targetver.h deleted file mode 100644 index 619b945..0000000 --- a/参考/NexBox-main/R560-developer/Sample_Code/i2c/targetver.h +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************************************************************************\ -|* *| -|* Copyright 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement *| -|* and / or non-disclosure agreement. Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| -\************************************************************************************************************************************/ -#pragma once - -// The following macros define the minimum required platform. The minimum required platform -// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run -// your application. The macros work by enabling all features available on platform versions up to and -// including the version specified. - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. -#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. -#endif \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/amd64/nvapi64.lib b/参考/NexBox-main/R560-developer/amd64/nvapi64.lib deleted file mode 100644 index 2083dc1..0000000 Binary files a/参考/NexBox-main/R560-developer/amd64/nvapi64.lib and /dev/null differ diff --git a/参考/NexBox-main/R560-developer/docs/NVAPI_Reference_Developer.chm b/参考/NexBox-main/R560-developer/docs/NVAPI_Reference_Developer.chm deleted file mode 100644 index 6fad5c6..0000000 Binary files a/参考/NexBox-main/R560-developer/docs/NVAPI_Reference_Developer.chm and /dev/null differ diff --git a/参考/NexBox-main/R560-developer/docs/NVAPI_SDKs_Samples_and_Tools_License_Agreement(Public).pdf b/参考/NexBox-main/R560-developer/docs/NVAPI_SDKs_Samples_and_Tools_License_Agreement(Public).pdf deleted file mode 100644 index 081ef3a..0000000 Binary files a/参考/NexBox-main/R560-developer/docs/NVAPI_SDKs_Samples_and_Tools_License_Agreement(Public).pdf and /dev/null differ diff --git a/参考/NexBox-main/R560-developer/docs/R560_NVAPI_Developer_Release_Notes.pdf b/参考/NexBox-main/R560-developer/docs/R560_NVAPI_Developer_Release_Notes.pdf deleted file mode 100644 index edc2142..0000000 Binary files a/参考/NexBox-main/R560-developer/docs/R560_NVAPI_Developer_Release_Notes.pdf and /dev/null differ diff --git a/参考/NexBox-main/R560-developer/nvHLSLExtns.h b/参考/NexBox-main/R560-developer/nvHLSLExtns.h deleted file mode 100644 index 4a49db5..0000000 --- a/参考/NexBox-main/R560-developer/nvHLSLExtns.h +++ /dev/null @@ -1,2323 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -////////////////////////// NVIDIA SHADER EXTENSIONS ///////////////// - -// this file is to be #included in the app HLSL shader code to make -// use of nvidia shader extensions - - -#include "nvHLSLExtnsInternal.h" - -//----------------------------------------------------------------------------// -//------------------------- Warp Shuffle Functions ---------------------------// -//----------------------------------------------------------------------------// - -// all functions have variants with width parameter which permits sub-division -// of the warp into segments - for example to exchange data between 4 groups of -// 8 lanes in a SIMD manner. If width is less than warpSize then each subsection -// of the warp behaves as a separate entity with a starting logical lane ID of 0. -// A thread may only exchange data with others in its own subsection. Width must -// have a value which is a power of 2 so that the warp can be subdivided equally; -// results are undefined if width is not a power of 2, or is a number greater -// than warpSize. - -// -// simple variant of SHFL instruction -// returns val from the specified lane -// optional width parameter must be a power of two and width <= 32 -// -int NvShfl(int val, uint srcLane, int width = NV_WARP_SIZE) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = val; // variable to be shuffled - g_NvidiaExt[index].src0u.y = srcLane; // source lane - g_NvidiaExt[index].src0u.z = __NvGetShflMaskFromWidth(width); - g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL; - - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -int2 NvShfl(int2 val, uint srcLane, int width = NV_WARP_SIZE) -{ - int x = NvShfl(val.x, srcLane, width); - int y = NvShfl(val.y, srcLane, width); - return int2(x, y); -} - -int4 NvShfl(int4 val, uint srcLane, int width = NV_WARP_SIZE) -{ - int x = NvShfl(val.x, srcLane, width); - int y = NvShfl(val.y, srcLane, width); - int z = NvShfl(val.z, srcLane, width); - int w = NvShfl(val.w, srcLane, width); - return int4(x, y, z, w); -} - -// -// Copy from a lane with lower ID relative to caller -// -int NvShflUp(int val, uint delta, int width = NV_WARP_SIZE) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = val; // variable to be shuffled - g_NvidiaExt[index].src0u.y = delta; // relative lane offset - g_NvidiaExt[index].src0u.z = (NV_WARP_SIZE - width) << 8; // minIndex = maxIndex for shfl_up (src2[4:0] is expected to be 0) - g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_UP; - return g_NvidiaExt.IncrementCounter(); -} - -// -// Copy from a lane with higher ID relative to caller -// -int NvShflDown(int val, uint delta, int width = NV_WARP_SIZE) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = val; // variable to be shuffled - g_NvidiaExt[index].src0u.y = delta; // relative lane offset - g_NvidiaExt[index].src0u.z = __NvGetShflMaskFromWidth(width); - g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_DOWN; - return g_NvidiaExt.IncrementCounter(); -} - -// -// Copy from a lane based on bitwise XOR of own lane ID -// -int NvShflXor(int val, uint laneMask, int width = NV_WARP_SIZE) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = val; // variable to be shuffled - g_NvidiaExt[index].src0u.y = laneMask; // laneMask to be XOR'ed with current laneId to get the source lane id - g_NvidiaExt[index].src0u.z = __NvGetShflMaskFromWidth(width); - g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_XOR; - return g_NvidiaExt.IncrementCounter(); -} - - -//----------------------------------------------------------------------------// -//----------------------------- Warp Vote Functions---------------------------// -//----------------------------------------------------------------------------// - -// returns 0xFFFFFFFF if the predicate is true for any thread in the warp, returns 0 otherwise -uint NvAny(int predicate) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = predicate; - g_NvidiaExt[index].opcode = NV_EXTN_OP_VOTE_ANY; - return g_NvidiaExt.IncrementCounter(); -} - -// returns 0xFFFFFFFF if the predicate is true for ALL threads in the warp, returns 0 otherwise -uint NvAll(int predicate) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = predicate; - g_NvidiaExt[index].opcode = NV_EXTN_OP_VOTE_ALL; - return g_NvidiaExt.IncrementCounter(); -} - -// returns a mask of all threads in the warp with bits set for threads that have predicate true -uint NvBallot(int predicate) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = predicate; - g_NvidiaExt[index].opcode = NV_EXTN_OP_VOTE_BALLOT; - return g_NvidiaExt.IncrementCounter(); -} - - -//----------------------------------------------------------------------------// -//----------------------------- Utility Functions ----------------------------// -//----------------------------------------------------------------------------// - -// returns the lane index of the current thread (thread index in warp) -int NvGetLaneId() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_GET_LANE_ID; - return g_NvidiaExt.IncrementCounter(); -} - -// returns value of special register - specify subopcode from any of NV_SPECIALOP_* specified in nvShaderExtnEnums.h - other opcodes undefined behavior -uint NvGetSpecial(uint subOpCode) -{ - return __NvGetSpecial(subOpCode); -} - -//----------------------------------------------------------------------------// -//----------------------------- FP16 Atmoic Functions-------------------------// -//----------------------------------------------------------------------------// - -// The functions below performs atomic operations on two consecutive fp16 -// values in the given raw UAV. -// The uint paramater 'fp16x2Val' is treated as two fp16 values byteAddress must be multiple of 4 -// The returned value are the two fp16 values packed into a single uint - -uint NvInterlockedAddFp16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, fp16x2Val, NV_EXTN_ATOM_MAX); -} - - -// versions of the above functions taking two fp32 values (internally converted to fp16 values) -uint NvInterlockedAddFp16x2(RWByteAddressBuffer uav, uint byteAddress, float2 val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWByteAddressBuffer uav, uint byteAddress, float2 val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWByteAddressBuffer uav, uint byteAddress, float2 val) -{ - return __NvAtomicOpFP16x2(uav, byteAddress, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MAX); -} - - -//----------------------------------------------------------------------------// - -// The functions below perform atomic operation on a R16G16_FLOAT UAV at the given address -// the uint paramater 'fp16x2Val' is treated as two fp16 values -// the returned value are the two fp16 values (.x and .y components) packed into a single uint -// Warning: Behaviour of these set of functions is undefined if the UAV is not -// of R16G16_FLOAT format (might result in app crash or TDR) - -uint NvInterlockedAddFp16x2(RWTexture1D uav, uint address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture1D uav, uint address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture1D uav, uint address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - -uint NvInterlockedAddFp16x2(RWTexture2D uav, uint2 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture2D uav, uint2 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture2D uav, uint2 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - -uint NvInterlockedAddFp16x2(RWTexture3D uav, uint3 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture3D uav, uint3 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture3D uav, uint3 address, uint fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - - -// versions taking two fp32 values (internally converted to fp16) -uint NvInterlockedAddFp16x2(RWTexture1D uav, uint address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture1D uav, uint address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture1D uav, uint address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MAX); -} - -uint NvInterlockedAddFp16x2(RWTexture2D uav, uint2 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture2D uav, uint2 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture2D uav, uint2 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MAX); -} - -uint NvInterlockedAddFp16x2(RWTexture3D uav, uint3 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_ADD); -} - -uint NvInterlockedMinFp16x2(RWTexture3D uav, uint3 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MIN); -} - -uint NvInterlockedMaxFp16x2(RWTexture3D uav, uint3 address, float2 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x2Tofp16x2(val), NV_EXTN_ATOM_MAX); -} - - -//----------------------------------------------------------------------------// - -// The functions below perform Atomic operation on a R16G16B16A16_FLOAT UAV at the given address -// the uint2 paramater 'fp16x2Val' is treated as four fp16 values -// i.e, fp16x2Val.x = uav.xy and fp16x2Val.y = uav.yz -// The returned value are the four fp16 values (.xyzw components) packed into uint2 -// Warning: Behaviour of these set of functions is undefined if the UAV is not -// of R16G16B16A16_FLOAT format (might result in app crash or TDR) - -uint2 NvInterlockedAddFp16x4(RWTexture1D uav, uint address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture1D uav, uint address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture1D uav, uint address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedAddFp16x4(RWTexture2D uav, uint2 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture2D uav, uint2 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture2D uav, uint2 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedAddFp16x4(RWTexture3D uav, uint3 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture3D uav, uint3 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture3D uav, uint3 address, uint2 fp16x2Val) -{ - return __NvAtomicOpFP16x2(uav, address, fp16x2Val, NV_EXTN_ATOM_MAX); -} - -// versions taking four fp32 values (internally converted to fp16) -uint2 NvInterlockedAddFp16x4(RWTexture1D uav, uint address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture1D uav, uint address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture1D uav, uint address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedAddFp16x4(RWTexture2D uav, uint2 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture2D uav, uint2 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture2D uav, uint2 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedAddFp16x4(RWTexture3D uav, uint3 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMinFp16x4(RWTexture3D uav, uint3 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedMaxFp16x4(RWTexture3D uav, uint3 address, float4 val) -{ - return __NvAtomicOpFP16x2(uav, address, __fp32x4Tofp16x4(val), NV_EXTN_ATOM_MAX); -} - - -//----------------------------------------------------------------------------// -//----------------------------- FP32 Atmoic Functions-------------------------// -//----------------------------------------------------------------------------// - -// The functions below performs atomic add on the given UAV treating the value as float -// byteAddress must be multiple of 4 -// The returned value is the value present in memory location before the atomic add - -float NvInterlockedAddFp32(RWByteAddressBuffer uav, uint byteAddress, float val) -{ - return __NvAtomicAddFP32(uav, byteAddress, val); -} - -//----------------------------------------------------------------------------// - -// The functions below perform atomic add on a R32_FLOAT UAV at the given address -// the returned value is the value before performing the atomic add -// Warning: Behaviour of these set of functions is undefined if the UAV is not -// of R32_FLOAT format (might result in app crash or TDR) - -float NvInterlockedAddFp32(RWTexture1D uav, uint address, float val) -{ - return __NvAtomicAddFP32(uav, address, val); -} - -float NvInterlockedAddFp32(RWTexture2D uav, uint2 address, float val) -{ - return __NvAtomicAddFP32(uav, address, val); -} - -float NvInterlockedAddFp32(RWTexture3D uav, uint3 address, float val) -{ - return __NvAtomicAddFP32(uav, address, val); -} - - -//----------------------------------------------------------------------------// -//--------------------------- UINT64 Atmoic Functions-------------------------// -//----------------------------------------------------------------------------// - -// The functions below performs atomic operation on the given UAV treating the value as uint64 -// byteAddress must be multiple of 8 -// The returned value is the value present in memory location before the atomic operation -// uint2 vector type is used to represent a single uint64 value with the x component containing the low 32 bits and y component the high 32 bits. - -uint2 NvInterlockedAddUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMaxUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedMinUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedAndUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_AND); -} - -uint2 NvInterlockedOrUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_OR); -} - -uint2 NvInterlockedXorUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_XOR); -} - -uint2 NvInterlockedCompareExchangeUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 compare_value, uint2 value) -{ - return __NvAtomicCompareExchangeUINT64(uav, byteAddress, compare_value, value); -} - -uint2 NvInterlockedExchangeUint64(RWByteAddressBuffer uav, uint byteAddress, uint2 value) -{ - return __NvAtomicOpUINT64(uav, byteAddress, value, NV_EXTN_ATOM_SWAP); -} - -//----------------------------------------------------------------------------// - -// The functions below perform atomic operation on a R32G32_UINT UAV at the given address treating the value as uint64 -// the returned value is the value before performing the atomic operation -// uint2 vector type is used to represent a single uint64 value with the x component containing the low 32 bits and y component the high 32 bits. -// Warning: Behaviour of these set of functions is undefined if the UAV is not of R32G32_UINT format (might result in app crash or TDR) - -uint2 NvInterlockedAddUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMaxUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedMinUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedAndUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_AND); -} - -uint2 NvInterlockedOrUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_OR); -} - -uint2 NvInterlockedXorUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_XOR); -} - -uint2 NvInterlockedCompareExchangeUint64(RWTexture1D uav, uint address, uint2 compare_value, uint2 value) -{ - return __NvAtomicCompareExchangeUINT64(uav, address, compare_value, value); -} - -uint2 NvInterlockedExchangeUint64(RWTexture1D uav, uint address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_SWAP); -} - -uint2 NvInterlockedAddUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMaxUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedMinUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedAndUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_AND); -} - -uint2 NvInterlockedOrUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_OR); -} - -uint2 NvInterlockedXorUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_XOR); -} - -uint2 NvInterlockedCompareExchangeUint64(RWTexture2D uav, uint2 address, uint2 compare_value, uint2 value) -{ - return __NvAtomicCompareExchangeUINT64(uav, address, compare_value, value); -} - -uint2 NvInterlockedExchangeUint64(RWTexture2D uav, uint2 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_SWAP); -} - -uint2 NvInterlockedAddUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_ADD); -} - -uint2 NvInterlockedMaxUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MAX); -} - -uint2 NvInterlockedMinUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_MIN); -} - -uint2 NvInterlockedAndUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_AND); -} - -uint2 NvInterlockedOrUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_OR); -} - -uint2 NvInterlockedXorUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_XOR); -} - -uint2 NvInterlockedCompareExchangeUint64(RWTexture3D uav, uint3 address, uint2 compare_value, uint2 value) -{ - return __NvAtomicCompareExchangeUINT64(uav, address, compare_value, value); -} - -uint2 NvInterlockedExchangeUint64(RWTexture3D uav, uint3 address, uint2 value) -{ - return __NvAtomicOpUINT64(uav, address, value, NV_EXTN_ATOM_SWAP); -} - -//----------------------------------------------------------------------------// -//--------------------------- VPRS functions ---------------------------------// -//----------------------------------------------------------------------------// - -// Returns the shading rate and the number of per-pixel shading passes for current VPRS pixel -uint3 NvGetShadingRate() -{ - uint3 shadingRate = (uint3)0; - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_GET_SHADING_RATE; - g_NvidiaExt[index].numOutputsForIncCounter = 3; - shadingRate.x = g_NvidiaExt.IncrementCounter(); - shadingRate.y = g_NvidiaExt.IncrementCounter(); - shadingRate.z = g_NvidiaExt.IncrementCounter(); - return shadingRate; -} - -float NvEvaluateAttributeAtSampleForVPRS(float attrib, uint sampleIndex, int2 pixelOffset) -{ - float value = (float)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float2 NvEvaluateAttributeAtSampleForVPRS(float2 attrib, uint sampleIndex, int2 pixelOffset) -{ - float2 value = (float2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float3 NvEvaluateAttributeAtSampleForVPRS(float3 attrib, uint sampleIndex, int2 pixelOffset) -{ - float3 value = (float3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - value.z = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float4 NvEvaluateAttributeAtSampleForVPRS(float4 attrib, uint sampleIndex, int2 pixelOffset) -{ - float4 value = (float4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - value.z = asfloat(g_NvidiaExt.IncrementCounter()); - value.w = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -int NvEvaluateAttributeAtSampleForVPRS(int attrib, uint sampleIndex, int2 pixelOffset) -{ - int value = (int)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int2 NvEvaluateAttributeAtSampleForVPRS(int2 attrib, uint sampleIndex, int2 pixelOffset) -{ - int2 value = (int2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int3 NvEvaluateAttributeAtSampleForVPRS(int3 attrib, uint sampleIndex, int2 pixelOffset) -{ - int3 value = (int3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - value.z = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int4 NvEvaluateAttributeAtSampleForVPRS(int4 attrib, uint sampleIndex, int2 pixelOffset) -{ - int4 value = (int4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - value.z = asint(g_NvidiaExt.IncrementCounter()); - value.w = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint NvEvaluateAttributeAtSampleForVPRS(uint attrib, uint sampleIndex, int2 pixelOffset) -{ - uint value = (uint)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint2 NvEvaluateAttributeAtSampleForVPRS(uint2 attrib, uint sampleIndex, int2 pixelOffset) -{ - uint2 value = (uint2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint3 NvEvaluateAttributeAtSampleForVPRS(uint3 attrib, uint sampleIndex, int2 pixelOffset) -{ - uint3 value = (uint3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - value.z = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint4 NvEvaluateAttributeAtSampleForVPRS(uint4 attrib, uint sampleIndex, int2 pixelOffset) -{ - uint4 value = (uint4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.x = sampleIndex; - g_NvidiaExt[ext].src2u.xy = pixelOffset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - value.z = asuint(g_NvidiaExt.IncrementCounter()); - value.w = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - - -float NvEvaluateAttributeSnappedForVPRS(float attrib, uint2 offset) -{ - float value = (float)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float2 NvEvaluateAttributeSnappedForVPRS(float2 attrib, uint2 offset) -{ - float2 value = (float2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float3 NvEvaluateAttributeSnappedForVPRS(float3 attrib, uint2 offset) -{ - float3 value = (float3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - value.z = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -float4 NvEvaluateAttributeSnappedForVPRS(float4 attrib, uint2 offset) -{ - float4 value = (float4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asfloat(g_NvidiaExt.IncrementCounter()); - value.y = asfloat(g_NvidiaExt.IncrementCounter()); - value.z = asfloat(g_NvidiaExt.IncrementCounter()); - value.w = asfloat(g_NvidiaExt.IncrementCounter()); - return value; -} - -int NvEvaluateAttributeSnappedForVPRS(int attrib, uint2 offset) -{ - int value = (int)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int2 NvEvaluateAttributeSnappedForVPRS(int2 attrib, uint2 offset) -{ - int2 value = (int2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int3 NvEvaluateAttributeSnappedForVPRS(int3 attrib, uint2 offset) -{ - int3 value = (int3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - value.z = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -int4 NvEvaluateAttributeSnappedForVPRS(int4 attrib, uint2 offset) -{ - int4 value = (int4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asint(g_NvidiaExt.IncrementCounter()); - value.y = asint(g_NvidiaExt.IncrementCounter()); - value.z = asint(g_NvidiaExt.IncrementCounter()); - value.w = asint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint NvEvaluateAttributeSnappedForVPRS(uint attrib, uint2 offset) -{ - uint value = (uint)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.x = asuint(attrib.x); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 1; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint2 NvEvaluateAttributeSnappedForVPRS(uint2 attrib, uint2 offset) -{ - uint2 value = (uint2)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xy = asuint(attrib.xy); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 2; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint3 NvEvaluateAttributeSnappedForVPRS(uint3 attrib, uint2 offset) -{ - uint3 value = (uint3)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyz = asuint(attrib.xyz); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 3; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - value.z = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -uint4 NvEvaluateAttributeSnappedForVPRS(uint4 attrib, uint2 offset) -{ - uint4 value = (uint4)0; - uint ext = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[ext].opcode = NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED; - g_NvidiaExt[ext].src0u.xyzw = asuint(attrib.xyzw); - g_NvidiaExt[ext].src1u.xy = offset; - g_NvidiaExt[ext].numOutputsForIncCounter = 4; - value.x = asuint(g_NvidiaExt.IncrementCounter()); - value.y = asuint(g_NvidiaExt.IncrementCounter()); - value.z = asuint(g_NvidiaExt.IncrementCounter()); - value.w = asuint(g_NvidiaExt.IncrementCounter()); - return value; -} - -// MATCH instruction variants -uint NvWaveMatch(uint value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = value; - g_NvidiaExt[index].src1u.x = 1; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -uint NvWaveMatch(uint2 value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = value.xy; - g_NvidiaExt[index].src1u.x = 2; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -uint NvWaveMatch(uint4 value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u = value; - g_NvidiaExt[index].src1u.x = 4; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -uint NvWaveMatch(float value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = asuint(value); - g_NvidiaExt[index].src1u.x = 1; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -uint NvWaveMatch(float2 value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = asuint(value); - g_NvidiaExt[index].src1u.x = 2; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - -uint NvWaveMatch(float4 value) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u = asuint(value); - g_NvidiaExt[index].src1u.x = 4; - g_NvidiaExt[index].opcode = NV_EXTN_OP_MATCH_ANY; - // result is returned as the return value of IncrementCounter on fake UAV slot - return g_NvidiaExt.IncrementCounter(); -} - - -//----------------------------------------------------------------------------// -//------------------------------ Footprint functions -------------------------// -//----------------------------------------------------------------------------// -// texSpace and smpSpace must be immediates, texIndex and smpIndex can be variable -// offset must be immediate -// the required components of location and offset fields can be filled depending on the dimension/type of the texture -// texType should be one of 2D or 3D as defined in nvShaderExtnEnums.h and and should be an immediate literal -// if the above restrictions are not met, the behaviour of this instruction is undefined - -uint4 NvFootprintFine(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprint(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, offset); -} - -uint4 NvFootprintCoarse(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprint(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, offset); -} - - - -uint4 NvFootprintFineBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float bias, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintBias(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, bias, offset); -} - -uint4 NvFootprintCoarseBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float bias, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintBias(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, bias, offset); -} - - - -uint4 NvFootprintFineLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float lodLevel, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintLevel(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, lodLevel, offset); -} - -uint4 NvFootprintCoarseLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float lodLevel, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintLevel(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, lodLevel, offset); -} - - - -uint4 NvFootprintFineGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float3 ddx, float3 ddy, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintGrad(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, ddx, ddy, offset); -} - -uint4 NvFootprintCoarseGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float3 ddx, float3 ddy, int3 offset = int3(0, 0, 0)) -{ - return __NvFootprintGrad(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, ddx, ddy, offset); -} - -uint NvFootprintExtractLOD(uint4 blob) -{ - return ((blob.w & 0xF000) >> 12); -} - -uint NvFootprintExtractReturnGran(uint4 blob) -{ - return ((blob.z & 0xF000000) >> 24); -} - -uint2 NvFootprintExtractAnchorTileLoc2D(uint4 blob) -{ - uint2 loc; - loc.x = (blob.w & 0xFFF); - loc.y = (blob.z & 0xFFF); - return loc; -} - -uint3 NvFootprintExtractAnchorTileLoc3D(uint4 blob) -{ - uint3 loc; - loc.x = (blob.w & 0xFFF); - loc.y = ((blob.w & 0xFFF0000) >> 16); - loc.z = (blob.z & 0x1FFF); - return loc; -} - -uint2 NvFootprintExtractOffset2D(uint4 blob) -{ - uint2 loc; - loc.x = ((blob.z & 0x070000) >> 16); - loc.y = ((blob.z & 0x380000) >> 19); - return loc; -} - -uint3 NvFootprintExtractOffset3D(uint4 blob) -{ - uint3 loc; - loc.x = ((blob.z & 0x030000) >> 16); - loc.y = ((blob.z & 0x0C0000) >> 18); - loc.z = ((blob.z & 0x300000) >> 20); - return loc; -} - -uint2 NvFootprintExtractBitmask(uint4 blob) -{ - return blob.xy; -} - - -// Variant of Footprint extensions which returns isSingleLod (out parameter) -// isSingleLod = true -> This footprint request touched the texels from only single LOD. -uint4 NvFootprintFine(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprint(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - -uint4 NvFootprintCoarse(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprint(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - - - -uint4 NvFootprintFineBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float bias, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintBias(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, bias, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - -uint4 NvFootprintCoarseBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float bias, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintBias(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, bias, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - - - -uint4 NvFootprintFineLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float lodLevel, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintLevel(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, lodLevel, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - -uint4 NvFootprintCoarseLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float lodLevel, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintLevel(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, lodLevel, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - - - -uint4 NvFootprintFineGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float3 ddx, float3 ddy, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintGrad(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_FINE, gran, ddx, ddy, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - -uint4 NvFootprintCoarseGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint gran, float3 ddx, float3 ddy, out uint isSingleLod, int3 offset = int3(0, 0, 0)) -{ - uint4 res = __NvFootprintGrad(texSpace, texIndex, smpSpace, smpIndex, texType, location, NV_EXTN_FOOTPRINT_MODE_COARSE, gran, ddx, ddy, offset); - isSingleLod = __NvGetSpecial(NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED); - return res; -} - - -uint NvActiveThreads() -{ - return NvBallot(1); -} - - -//----------------------------------------------------------------------------// -//------------------------------ WaveMultiPrefix functions -------------------// -//----------------------------------------------------------------------------// - -// Following are the WaveMultiPrefix functions for different operations (Add, Bitand, BitOr, BitXOr) for different datatypes (uint, uint2, uint4) -// This is a set of functions which implement multi-prefix operations among the set of active lanes in the current wave (WARP). -// A multi-prefix operation comprises a set of prefix operations, executed in parallel within subsets of lanes identified with the provided bitmasks. -// These bitmasks represent partitioning of the set of active lanes in the current wave into N groups (where N is the number of unique masks across all lanes in the wave). -// N prefix operations are then performed each within its corresponding group. -// The groups are assumed to be non-intersecting (that is, a given lane can be a member of one and only one group), -// and bitmasks in all lanes belonging to the same group are required to be the same. -// There are 2 type of functions - Exclusive and Inclusive prefix operations. -// e.g. For NvWaveMultiPrefixInclusiveAdd(val, mask) operation - For each of the groups (for which mask input is same) following is the expected output : -// i^th thread in a group has value = sum(values of threads 0 to i) -// For Exclusive version of same opeartion - -// i^th thread in a group has value = sum(values of threads 0 to i-1) and 0th thread in a the Group has value 0 - -// Extensions for Add -uint NvWaveMultiPrefixInclusiveAdd(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - // As remainingThreads only has threads in group with smaller thread ids than its own thread-id nextLane can never be 31 for any thread in the group except the smallest one - // For smallest thread in the group, remainingThreads is 0 --> nextLane is ~0 (i.e. considering last 5 bits its 31) - // So passing maskClampValue=30 to __NvShflGeneric, it will return laneValid=false for the smallest thread in the group. So update val and nextLane based on laneValid. - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val + temp; - nextLane = newLane; - } - } - return val; -} - -uint NvWaveMultiPrefixExclusiveAdd(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : 0; - return NvWaveMultiPrefixInclusiveAdd(val, mask); -} - -uint2 NvWaveMultiPrefixInclusiveAdd(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val + temp; - nextLane = newLane; - } - } - return val; -} - -uint2 NvWaveMultiPrefixExclusiveAdd(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint2(0, 0); - return NvWaveMultiPrefixInclusiveAdd(val, mask); -} - -uint4 NvWaveMultiPrefixInclusiveAdd(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val + temp; - nextLane = newLane; - } - } - return val; -} - -uint4 NvWaveMultiPrefixExclusiveAdd(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint4(0, 0, 0, 0); - return NvWaveMultiPrefixInclusiveAdd(val, mask); -} - -// MultiPrefix extensions for Bitand -uint NvWaveMultiPrefixInclusiveAnd(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val & temp; - nextLane = newLane; - } - } - return val; -} - -uint NvWaveMultiPrefixExclusiveAnd(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : ~0; - return NvWaveMultiPrefixInclusiveAnd(val, mask); -} - -uint2 NvWaveMultiPrefixInclusiveAnd(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val & temp; - nextLane = newLane; - } - } - return val; -} - -uint2 NvWaveMultiPrefixExclusiveAnd(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint2(~0, ~0); - return NvWaveMultiPrefixInclusiveAnd(val, mask); -} - - -uint4 NvWaveMultiPrefixInclusiveAnd(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val & temp; - nextLane = newLane; - } - } - return val; -} - -uint4 NvWaveMultiPrefixExclusiveAnd(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint4(~0, ~0, ~0, ~0); - return NvWaveMultiPrefixInclusiveAnd(val, mask); -} - - -// MultiPrefix extensions for BitOr -uint NvWaveMultiPrefixInclusiveOr(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val | temp; - nextLane = newLane; - } - } - return val; -} - -uint NvWaveMultiPrefixExclusiveOr(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : 0; - return NvWaveMultiPrefixInclusiveOr(val, mask); -} - -uint2 NvWaveMultiPrefixInclusiveOr(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val | temp; - nextLane = newLane; - } - } - return val; -} - -uint2 NvWaveMultiPrefixExclusiveOr(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint2(0, 0); - return NvWaveMultiPrefixInclusiveOr(val, mask); -} - - -uint4 NvWaveMultiPrefixInclusiveOr(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val | temp; - nextLane = newLane; - } - } - return val; -} - -uint4 NvWaveMultiPrefixExclusiveOr(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint4(0, 0, 0, 0); - return NvWaveMultiPrefixInclusiveOr(val, mask); -} - - -// MultiPrefix extensions for BitXOr -uint NvWaveMultiPrefixInclusiveXOr(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val ^ temp; - nextLane = newLane; - } - } - return val; -} - -uint NvWaveMultiPrefixExclusiveXOr(uint val, uint mask) -{ - uint temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : 0; - return NvWaveMultiPrefixInclusiveXOr(val, mask); -} - -uint2 NvWaveMultiPrefixInclusiveXOr(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val ^ temp; - nextLane = newLane; - } - } - return val; -} - -uint2 NvWaveMultiPrefixExclusiveXOr(uint2 val, uint mask) -{ - uint2 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint2(0, 0); - return NvWaveMultiPrefixInclusiveXOr(val, mask); -} - - -uint4 NvWaveMultiPrefixInclusiveXOr(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint nextLane = firstbithigh(remainingThreads); - for (uint i = 0; i < NV_WARP_SIZE_LOG2; i++) - { - temp = NvShfl(val, nextLane); - uint laneValid; - uint newLane = asuint(__NvShflGeneric(nextLane, nextLane, 30, laneValid)); - if (laneValid) // if nextLane's nextLane is valid - { - val = val ^ temp; - nextLane = newLane; - } - } - return val; -} - -uint4 NvWaveMultiPrefixExclusiveXOr(uint4 val, uint mask) -{ - uint4 temp; - uint a = NvActiveThreads(); - uint remainingThreads = a & __NvGetSpecial(NV_SPECIALOP_THREADLTMASK) & mask; - uint lane = firstbithigh(remainingThreads); - temp = NvShfl(val, lane); - val = remainingThreads != 0 ? temp : uint4(0, 0, 0, 0); - return NvWaveMultiPrefixInclusiveXOr(val, mask); -} - - -//----------------------------------------------------------------------------// -//------------------------- DXR Micro-map Extension --------------------------// -//----------------------------------------------------------------------------// - -float3x3 NvRtTriangleObjectPositions() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_TRIANGLE_OBJECT_POSITIONS; - - float3x3 ret; - ret[0][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[0][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[0][2] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][2] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][2] = asfloat(g_NvidiaExt.IncrementCounter()); - return ret; -} - -float3x3 NvRtMicroTriangleObjectPositions() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_MICRO_TRIANGLE_OBJECT_POSITIONS; - - float3x3 ret; - ret[0][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[0][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[0][2] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][2] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][2] = asfloat(g_NvidiaExt.IncrementCounter()); - return ret; -} - -float3x2 NvRtMicroTriangleBarycentrics() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_MICRO_TRIANGLE_BARYCENTRICS; - - float3x2 ret; - ret[0][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[0][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[1][1] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][0] = asfloat(g_NvidiaExt.IncrementCounter()); - ret[2][1] = asfloat(g_NvidiaExt.IncrementCounter()); - return ret; -} - -bool NvRtIsMicroTriangleHit() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_IS_MICRO_TRIANGLE_HIT; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; -} - -bool NvRtIsBackFacing() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_IS_BACK_FACING; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; -} - -#if __SHADER_TARGET_MAJOR > 6 || (__SHADER_TARGET_MAJOR == 6 && __SHADER_TARGET_MINOR >= 5) - -float3 NvRtMicroVertexObjectPosition(RaytracingAccelerationStructure AccelerationStructure, uint InstanceIndex, uint GeometryIndex, uint PrimitiveIndex, uint2 UV) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_MICRO_VERTEX_OBJECT_POSITION; - g_NvidiaExt[index].src0u.x = InstanceIndex; - g_NvidiaExt[index].src0u.y = GeometryIndex; - g_NvidiaExt[index].src0u.z = PrimitiveIndex; - g_NvidiaExt[index].src0u.w = UV.x; - g_NvidiaExt[index].src1u.x = UV.y; - uint handle = g_NvidiaExt.IncrementCounter(); - float3 ret; - ret.x = asfloat(g_NvidiaExt.IncrementCounter()); - ret.y = asfloat(g_NvidiaExt.IncrementCounter()); - ret.z = asfloat(g_NvidiaExt.IncrementCounter()); - - RayQuery<0> rq; - rq.TraceRayInline(AccelerationStructure, 0, handle, (RayDesc)0); - - return ret; -} - -float2 NvRtMicroVertexBarycentrics(RaytracingAccelerationStructure AccelerationStructure, uint InstanceIndex, uint GeometryIndex, uint PrimitiveIndex, uint2 UV) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_RT_MICRO_VERTEX_BARYCENTRICS; - g_NvidiaExt[index].src0u.x = InstanceIndex; - g_NvidiaExt[index].src0u.y = GeometryIndex; - g_NvidiaExt[index].src0u.z = PrimitiveIndex; - g_NvidiaExt[index].src0u.w = UV.x; - g_NvidiaExt[index].src1u.x = UV.y; - uint handle = g_NvidiaExt.IncrementCounter(); - float2 ret; - ret.x = asfloat(g_NvidiaExt.IncrementCounter()); - ret.y = asfloat(g_NvidiaExt.IncrementCounter()); - - RayQuery<0> rq; - rq.TraceRayInline(AccelerationStructure, 0, handle, (RayDesc)0); - - return ret; -} - -#endif - -//----------------------------------------------------------------------------// -//------------------------- DXR HitObject Extension --------------------------// -//----------------------------------------------------------------------------// - -// Support for templates in HLSL requires HLSL 2021+. When using dxc, -// use the -HV 2021 command line argument to enable these versions. -#if defined(__HLSL_VERSION) && (__HLSL_VERSION >= 2021) && !defined(NV_HITOBJECT_USE_MACRO_API) - -struct NvHitObject { - uint _handle; - - bool IsMiss() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_MISS; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - bool IsHit() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_HIT; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - bool IsNop() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_NOP; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - uint GetInstanceID() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_ID; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetInstanceIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetPrimitiveIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_PRIMITIVE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetGeometryIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_GEOMETRY_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetHitKind() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_HIT_KIND; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - RayDesc GetRayDesc() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_RAY_DESC; - g_NvidiaExt[index].src0u.x = _handle; - - uint tmin = g_NvidiaExt.IncrementCounter(); - uint tmax = g_NvidiaExt.IncrementCounter(); - uint rayOrgX = g_NvidiaExt.IncrementCounter(); - uint rayOrgY = g_NvidiaExt.IncrementCounter(); - uint rayOrgZ = g_NvidiaExt.IncrementCounter(); - uint rayDirX = g_NvidiaExt.IncrementCounter(); - uint rayDirY = g_NvidiaExt.IncrementCounter(); - uint rayDirZ = g_NvidiaExt.IncrementCounter(); - - RayDesc ray; - ray.TMin = asfloat(tmin); - ray.TMax = asfloat(tmax); - ray.Origin.x = asfloat(rayOrgX); - ray.Origin.y = asfloat(rayOrgY); - ray.Origin.z = asfloat(rayOrgZ); - ray.Direction.x = asfloat(rayDirX); - ray.Direction.y = asfloat(rayDirY); - ray.Direction.z = asfloat(rayDirZ); - - return ray; - } - - template - T GetAttributes() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_ATTRIBUTES; - g_NvidiaExt[index].src0u.x = _handle; - uint callHandle = g_NvidiaExt.IncrementCounter(); - - T attrs; - CallShader(callHandle, attrs); - return attrs; - } - - uint GetShaderTableIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_SHADER_TABLE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint LoadLocalRootTableConstant(uint RootConstantOffsetInBytes) - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_LOAD_LOCAL_ROOT_TABLE_CONSTANT; - g_NvidiaExt[index].src0u.x = _handle; - g_NvidiaExt[index].src0u.y = RootConstantOffsetInBytes; - return g_NvidiaExt.IncrementCounter(); - } -}; - -template -NvHitObject NvTraceRayHitObject( - RaytracingAccelerationStructure AccelerationStructure, - uint RayFlags, - uint InstanceInclusionMask, - uint RayContributionToHitGroupIndex, - uint MultiplierForGeometryContributionToHitGroupIndex, - uint MissShaderIndex, - RayDesc Ray, - inout T Payload) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_TRACE_RAY; - g_NvidiaExt[index].numOutputsForIncCounter = 2; - g_NvidiaExt[index].src0u.x = MissShaderIndex; - uint hitHandle = g_NvidiaExt.IncrementCounter(); - uint traceHandle = g_NvidiaExt.IncrementCounter(); - - TraceRay(AccelerationStructure, RayFlags, InstanceInclusionMask, RayContributionToHitGroupIndex, MultiplierForGeometryContributionToHitGroupIndex, traceHandle, Ray, Payload); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -template -NvHitObject NvMakeHit( - RaytracingAccelerationStructure AccelerationStructure, - uint InstanceIndex, - uint GeometryIndex, - uint PrimitiveIndex, - uint HitKind, - uint RayContributionToHitGroupIndex, - uint MultiplierForGeometryContributionToHitGroupIndex, - RayDesc Ray, - T Attributes) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_HIT; - g_NvidiaExt[index].numOutputsForIncCounter = 2; - g_NvidiaExt[index].src0u.x = InstanceIndex; - g_NvidiaExt[index].src0u.y = GeometryIndex; - g_NvidiaExt[index].src0u.z = PrimitiveIndex; - g_NvidiaExt[index].src0u.w = HitKind; - g_NvidiaExt[index].src1u.x = RayContributionToHitGroupIndex; - g_NvidiaExt[index].src1u.y = MultiplierForGeometryContributionToHitGroupIndex; - uint hitHandle = g_NvidiaExt.IncrementCounter(); - uint traceHandle = g_NvidiaExt.IncrementCounter(); - - struct AttrWrapper { T Attrs; }; - AttrWrapper wrapper; - wrapper.Attrs = Attributes; - CallShader(traceHandle, wrapper); - - struct DummyPayload { int a; }; - DummyPayload payload; - TraceRay(AccelerationStructure, 0, 0, 0, 0, traceHandle, Ray, payload); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -template -NvHitObject NvMakeHitWithRecordIndex( - uint HitGroupRecordIndex, - RaytracingAccelerationStructure AccelerationStructure, - uint InstanceIndex, - uint GeometryIndex, - uint PrimitiveIndex, - uint HitKind, - RayDesc Ray, - T Attributes) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_HIT_WITH_RECORD_INDEX; - g_NvidiaExt[index].numOutputsForIncCounter = 2; - g_NvidiaExt[index].src0u.x = InstanceIndex; - g_NvidiaExt[index].src0u.y = GeometryIndex; - g_NvidiaExt[index].src0u.z = PrimitiveIndex; - g_NvidiaExt[index].src0u.w = HitKind; - g_NvidiaExt[index].src1u.x = HitGroupRecordIndex; - uint hitHandle = g_NvidiaExt.IncrementCounter(); - uint traceHandle = g_NvidiaExt.IncrementCounter(); - - struct AttrWrapper { T Attrs; }; - AttrWrapper wrapper; - wrapper.Attrs = Attributes; - CallShader(traceHandle, wrapper); - - struct DummyPayload { int a; }; - DummyPayload payload; - TraceRay(AccelerationStructure, 0, 0, 0, 0, traceHandle, Ray, payload); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -NvHitObject NvMakeMiss( - uint MissShaderIndex, - RayDesc Ray) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_MISS; - g_NvidiaExt[index].src0u.x = MissShaderIndex; - g_NvidiaExt[index].src0u.y = asuint(Ray.TMin); - g_NvidiaExt[index].src0u.z = asuint(Ray.TMax); - g_NvidiaExt[index].src1u.x = asuint(Ray.Origin.x); - g_NvidiaExt[index].src1u.y = asuint(Ray.Origin.y); - g_NvidiaExt[index].src1u.z = asuint(Ray.Origin.z); - g_NvidiaExt[index].src2u.x = asuint(Ray.Direction.x); - g_NvidiaExt[index].src2u.y = asuint(Ray.Direction.y); - g_NvidiaExt[index].src2u.z = asuint(Ray.Direction.z); - uint hitHandle = g_NvidiaExt.IncrementCounter(); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -NvHitObject NvMakeNop() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_NOP; - uint hitHandle = g_NvidiaExt.IncrementCounter(); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -void NvReorderThread(uint CoherenceHint, uint NumCoherenceHintBits) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD; - g_NvidiaExt[index].src0u.x = 0; - g_NvidiaExt[index].src0u.y = 0; - g_NvidiaExt[index].src0u.z = CoherenceHint; - g_NvidiaExt[index].src0u.w = NumCoherenceHintBits; - g_NvidiaExt.IncrementCounter(); -} - -void NvReorderThread(NvHitObject HitObj, uint CoherenceHint, uint NumCoherenceHintBits) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD; - g_NvidiaExt[index].src0u.x = 1; - g_NvidiaExt[index].src0u.y = HitObj._handle; - g_NvidiaExt[index].src0u.z = CoherenceHint; - g_NvidiaExt[index].src0u.w = NumCoherenceHintBits; - g_NvidiaExt.IncrementCounter(); -} - -void NvReorderThread(NvHitObject HitObj) -{ - NvReorderThread(HitObj, 0, 0); -} - -template -void NvInvokeHitObject( - RaytracingAccelerationStructure AccelerationStructure, - NvHitObject HitObj, - inout T Payload) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_INVOKE; - g_NvidiaExt[index].src0u.x = HitObj._handle; - uint handle = g_NvidiaExt.IncrementCounter(); - - TraceRay(AccelerationStructure, 0, 0, 0, 0, handle, (RayDesc)0, Payload); -} - -// Macro-based version of the HitObject API. Use this when HLSL 2021 is not available. -// Enable by specifying #define NV_HITOBJECT_USE_MACRO_API before including this header. -#elif defined(NV_HITOBJECT_USE_MACRO_API) - -struct NvHitObject { - uint _handle; - - bool IsMiss() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_MISS; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - bool IsHit() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_HIT; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - bool IsNop() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_IS_NOP; - g_NvidiaExt[index].src0u.x = _handle; - uint ret = g_NvidiaExt.IncrementCounter(); - return ret != 0; - } - - uint GetInstanceID() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_ID; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetInstanceIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetPrimitiveIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_PRIMITIVE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetGeometryIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_GEOMETRY_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint GetHitKind() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_HIT_KIND; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - RayDesc GetRayDesc() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_RAY_DESC; - g_NvidiaExt[index].src0u.x = _handle; - - uint tmin = g_NvidiaExt.IncrementCounter(); - uint tmax = g_NvidiaExt.IncrementCounter(); - uint rayOrgX = g_NvidiaExt.IncrementCounter(); - uint rayOrgY = g_NvidiaExt.IncrementCounter(); - uint rayOrgZ = g_NvidiaExt.IncrementCounter(); - uint rayDirX = g_NvidiaExt.IncrementCounter(); - uint rayDirY = g_NvidiaExt.IncrementCounter(); - uint rayDirZ = g_NvidiaExt.IncrementCounter(); - - RayDesc ray; - ray.TMin = asfloat(tmin); - ray.TMax = asfloat(tmax); - ray.Origin.x = asfloat(rayOrgX); - ray.Origin.y = asfloat(rayOrgY); - ray.Origin.z = asfloat(rayOrgZ); - ray.Direction.x = asfloat(rayDirX); - ray.Direction.y = asfloat(rayDirY); - ray.Direction.z = asfloat(rayDirZ); - - return ray; - } - - uint GetShaderTableIndex() - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_SHADER_TABLE_INDEX; - g_NvidiaExt[index].src0u.x = _handle; - return g_NvidiaExt.IncrementCounter(); - } - - uint LoadLocalRootTableConstant(uint RootConstantOffsetInBytes) - { - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_LOAD_LOCAL_ROOT_TABLE_CONSTANT; - g_NvidiaExt[index].src0u.x = _handle; - g_NvidiaExt[index].src0u.y = RootConstantOffsetInBytes; - return g_NvidiaExt.IncrementCounter(); - } -}; - -#define NvTraceRayHitObject(AccelerationStructure,RayFlags,InstanceInclusionMask,RayContributionToHitGroupIndex,MultiplierForGeometryContributionToHitGroupIndex,MissShaderIndex,Ray,Payload,ResultHitObj) \ -do { \ - uint _rayFlags = RayFlags; \ - uint _instanceInclusionMask = InstanceInclusionMask; \ - uint _rayContributionToHitGroupIndex = RayContributionToHitGroupIndex; \ - uint _multiplierForGeometryContributionToHitGroupIndex = MultiplierForGeometryContributionToHitGroupIndex; \ - uint _missShaderIndex = MissShaderIndex; \ - RayDesc _ray = Ray; \ - uint _index = g_NvidiaExt.IncrementCounter(); \ - g_NvidiaExt[_index].opcode = NV_EXTN_OP_HIT_OBJECT_TRACE_RAY; \ - g_NvidiaExt[_index].numOutputsForIncCounter = 2; \ - g_NvidiaExt[_index].src0u.x = _missShaderIndex; \ - uint _hitHandle = g_NvidiaExt.IncrementCounter(); \ - uint _traceHandle = g_NvidiaExt.IncrementCounter(); \ - TraceRay(AccelerationStructure, _rayFlags, _instanceInclusionMask, _rayContributionToHitGroupIndex, _multiplierForGeometryContributionToHitGroupIndex, _traceHandle, _ray, Payload); \ - ResultHitObj._handle = _hitHandle; \ -} while(0) - -struct NvHitObjectMacroDummyPayloadType { int a; }; - -#define NvMakeHit(AccelerationStructure,InstanceIndex,GeometryIndex,PrimitiveIndex,HitKind,RayContributionToHitGroupIndex,MultiplierForGeometryContributionToHitGroupIndex,Ray,Attributes,ResultHitObj) \ -do { \ - uint _instanceIndex = InstanceIndex; \ - uint _geometryIndex = GeometryIndex; \ - uint _primitiveIndex = PrimitiveIndex; \ - uint _hitKind = HitKind; \ - uint _rayContributionToHitGroupIndex = RayContributionToHitGroupIndex; \ - uint _multiplierForGeometryContributionToHitGroupIndex = MultiplierForGeometryContributionToHitGroupIndex; \ - RayDesc _ray = Ray; \ - uint _index = g_NvidiaExt.IncrementCounter(); \ - g_NvidiaExt[_index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_HIT; \ - g_NvidiaExt[_index].numOutputsForIncCounter = 2; \ - g_NvidiaExt[_index].src0u.x = _instanceIndex; \ - g_NvidiaExt[_index].src0u.y = _geometryIndex; \ - g_NvidiaExt[_index].src0u.z = _primitiveIndex; \ - g_NvidiaExt[_index].src0u.w = _hitKind; \ - g_NvidiaExt[_index].src1u.x = _rayContributionToHitGroupIndex; \ - g_NvidiaExt[_index].src1u.y = _multiplierForGeometryContributionToHitGroupIndex; \ - uint _hitHandle = g_NvidiaExt.IncrementCounter(); \ - uint _traceHandle = g_NvidiaExt.IncrementCounter(); \ - CallShader(_traceHandle, Attributes); \ - NvHitObjectMacroDummyPayloadType _payload; \ - TraceRay(AccelerationStructure, 0, 0, 0, 0, _traceHandle, _ray, _payload); \ - ResultHitObj._handle = _hitHandle; \ -} while(0) - -#define NvMakeHitWithRecordIndex(HitGroupRecordIndex,AccelerationStructure,InstanceIndex,GeometryIndex,PrimitiveIndex,HitKind,Ray,Attributes,ResultHitObj) \ -do { \ - uint _hitGroupRecordIndex = HitGroupRecordIndex; \ - uint _instanceIndex = InstanceIndex; \ - uint _geometryIndex = GeometryIndex; \ - uint _primitiveIndex = PrimitiveIndex; \ - uint _hitKind = HitKind; \ - RayDesc _ray = Ray; \ - uint _index = g_NvidiaExt.IncrementCounter(); \ - g_NvidiaExt[_index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_HIT_WITH_RECORD_INDEX; \ - g_NvidiaExt[_index].numOutputsForIncCounter = 2; \ - g_NvidiaExt[_index].src0u.x = _instanceIndex; \ - g_NvidiaExt[_index].src0u.y = _geometryIndex; \ - g_NvidiaExt[_index].src0u.z = _primitiveIndex; \ - g_NvidiaExt[_index].src0u.w = _hitKind; \ - g_NvidiaExt[_index].src1u.x = _hitGroupRecordIndex; \ - uint _hitHandle = g_NvidiaExt.IncrementCounter(); \ - uint _traceHandle = g_NvidiaExt.IncrementCounter(); \ - CallShader(_traceHandle, Attributes); \ - NvHitObjectMacroDummyPayloadType _payload; \ - TraceRay(AccelerationStructure, 0, 0, 0, 0, _traceHandle, _ray, _payload); \ - ResultHitObj._handle = _hitHandle; \ -} while(0) - -NvHitObject NvMakeMiss( - uint MissShaderIndex, - RayDesc Ray) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_MISS; - g_NvidiaExt[index].src0u.x = MissShaderIndex; - g_NvidiaExt[index].src0u.y = asuint(Ray.TMin); - g_NvidiaExt[index].src0u.z = asuint(Ray.TMax); - g_NvidiaExt[index].src1u.x = asuint(Ray.Origin.x); - g_NvidiaExt[index].src1u.y = asuint(Ray.Origin.y); - g_NvidiaExt[index].src1u.z = asuint(Ray.Origin.z); - g_NvidiaExt[index].src2u.x = asuint(Ray.Direction.x); - g_NvidiaExt[index].src2u.y = asuint(Ray.Direction.y); - g_NvidiaExt[index].src2u.z = asuint(Ray.Direction.z); - uint hitHandle = g_NvidiaExt.IncrementCounter(); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -NvHitObject NvMakeNop() -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_MAKE_NOP; - uint hitHandle = g_NvidiaExt.IncrementCounter(); - - NvHitObject hitObj; - hitObj._handle = hitHandle; - return hitObj; -} - -#define NvGetAttributesFromHitObject(HitObj,ResultAttributes) \ -do { \ - uint _index = g_NvidiaExt.IncrementCounter(); \ - g_NvidiaExt[_index].opcode = NV_EXTN_OP_HIT_OBJECT_GET_ATTRIBUTES; \ - g_NvidiaExt[_index].src0u.x = HitObj._handle; \ - uint _callHandle = g_NvidiaExt.IncrementCounter(); \ - CallShader(_callHandle, ResultAttributes); \ -} while(0) - -void NvReorderThread(uint CoherenceHint, uint NumCoherenceHintBits) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD; - g_NvidiaExt[index].src0u.x = 0; - g_NvidiaExt[index].src0u.y = 0; - g_NvidiaExt[index].src0u.z = CoherenceHint; - g_NvidiaExt[index].src0u.w = NumCoherenceHintBits; - g_NvidiaExt.IncrementCounter(); -} - -void NvReorderThread(NvHitObject HitObj, uint CoherenceHint, uint NumCoherenceHintBits) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD; - g_NvidiaExt[index].src0u.x = 1; - g_NvidiaExt[index].src0u.y = HitObj._handle; - g_NvidiaExt[index].src0u.z = CoherenceHint; - g_NvidiaExt[index].src0u.w = NumCoherenceHintBits; - g_NvidiaExt.IncrementCounter(); -} - -void NvReorderThread(NvHitObject HitObj) -{ - NvReorderThread(HitObj, 0, 0); -} - -#define NvInvokeHitObject(AccelerationStructure,HitObj,Payload) \ -do { \ - uint _index = g_NvidiaExt.IncrementCounter(); \ - g_NvidiaExt[_index].opcode = NV_EXTN_OP_HIT_OBJECT_INVOKE; \ - g_NvidiaExt[_index].src0u.x = HitObj._handle; \ - uint _handle = g_NvidiaExt.IncrementCounter(); \ - TraceRay(AccelerationStructure, 0, 0, 0, 0, _handle, (RayDesc)0, Payload); \ -} while(0) - -#endif diff --git a/参考/NexBox-main/R560-developer/nvHLSLExtnsInternal.h b/参考/NexBox-main/R560-developer/nvHLSLExtnsInternal.h deleted file mode 100644 index a7cb1b3..0000000 --- a/参考/NexBox-main/R560-developer/nvHLSLExtnsInternal.h +++ /dev/null @@ -1,767 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -////////////////////////// NVIDIA SHADER EXTENSIONS ///////////////// -// internal functions -// Functions in this file are not expected to be called by apps directly - -#include "nvShaderExtnEnums.h" - -struct NvShaderExtnStruct -{ - uint opcode; // opcode - uint rid; // resource ID - uint sid; // sampler ID - - uint4 dst1u; // destination operand 1 (for instructions that need extra destination operands) - uint4 src3u; // source operand 3 - uint4 src4u; // source operand 4 - uint4 src5u; // source operand 5 - - uint4 src0u; // uint source operand 0 - uint4 src1u; // uint source operand 0 - uint4 src2u; // uint source operand 0 - uint4 dst0u; // uint destination operand - - uint markUavRef; // the next store to UAV is fake and is used only to identify the uav slot - uint numOutputsForIncCounter; // Used for output to IncrementCounter - float padding1[27]; // struct size: 256 bytes -}; - -// RW structured buffer for Nvidia shader extensions - -// Application needs to define NV_SHADER_EXTN_SLOT as a unused slot, which should be -// set using NvAPI_D3D11_SetNvShaderExtnSlot() call before creating the first shader that -// uses nvidia shader extensions. E.g before including this file in shader define it as: -// #define NV_SHADER_EXTN_SLOT u7 - -// For SM5.1, application needs to define NV_SHADER_EXTN_REGISTER_SPACE as register space -// E.g. before including this file in shader define it as: -// #define NV_SHADER_EXTN_REGISTER_SPACE space2 - -// Note that other operations to this UAV will be ignored so application -// should bind a null resource - -#ifdef NV_SHADER_EXTN_REGISTER_SPACE -RWStructuredBuffer g_NvidiaExt : register( NV_SHADER_EXTN_SLOT, NV_SHADER_EXTN_REGISTER_SPACE ); -#else -RWStructuredBuffer g_NvidiaExt : register( NV_SHADER_EXTN_SLOT ); -#endif - -//----------------------------------------------------------------------------// -// the exposed SHFL instructions accept a mask parameter in src2 -// To compute lane mask from width of segment: -// minLaneID : currentLaneId & src2[12:8] -// maxLaneID : minLaneId | (src2[4:0] & ~src2[12:8]) -// where [minLaneId, maxLaneId] defines the segment where currentLaneId belongs -// we always set src2[4:0] to 11111 (0x1F), and set src2[12:8] as (32 - width) -int __NvGetShflMaskFromWidth(uint width) -{ - return ((NV_WARP_SIZE - width) << 8) | 0x1F; -} - -//----------------------------------------------------------------------------// - -void __NvReferenceUAVForOp(RWByteAddressBuffer uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav.Store(index, 0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = float2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = float2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = float2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = float4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = float4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = float4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = 0.0f; -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = 0.0f; -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = 0.0f; -} - - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = uint2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = uint2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = uint2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = uint4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = uint4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = uint4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = 0; -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = 0; -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = 0; -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = int2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = int2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = int2(0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = int4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = int4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = int4(0,0,0,0); -} - -void __NvReferenceUAVForOp(RWTexture1D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[index] = 0; -} - -void __NvReferenceUAVForOp(RWTexture2D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint2(index,index)] = 0; -} - -void __NvReferenceUAVForOp(RWTexture3D uav) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].markUavRef = 1; - uav[uint3(index,index,index)] = 0; -} - -//----------------------------------------------------------------------------// -// ATOMIC op sub-opcodes -#define NV_EXTN_ATOM_AND 0 -#define NV_EXTN_ATOM_OR 1 -#define NV_EXTN_ATOM_XOR 2 - -#define NV_EXTN_ATOM_ADD 3 -#define NV_EXTN_ATOM_MAX 6 -#define NV_EXTN_ATOM_MIN 7 - -#define NV_EXTN_ATOM_SWAP 8 -#define NV_EXTN_ATOM_CAS 9 - -//----------------------------------------------------------------------------// - -// performs Atomic operation on two consecutive fp16 values in the given UAV -// the uint paramater 'fp16x2Val' is treated as two fp16 values -// the passed sub-opcode 'op' should be an immediate constant -// byteAddress must be multiple of 4 -// the returned value are the two fp16 values packed into a single uint -uint __NvAtomicOpFP16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = byteAddress; - g_NvidiaExt[index].src1u.x = fp16x2Val; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - - return g_NvidiaExt[index].dst0u.x; -} - -//----------------------------------------------------------------------------// - -// performs Atomic operation on a R16G16_FLOAT UAV at the given address -// the uint paramater 'fp16x2Val' is treated as two fp16 values -// the passed sub-opcode 'op' should be an immediate constant -// the returned value are the two fp16 values (.x and .y components) packed into a single uint -// Warning: Behaviour of these set of functions is undefined if the UAV is not -// of R16G16_FLOAT format (might result in app crash or TDR) - -uint __NvAtomicOpFP16x2(RWTexture1D uav, uint address, uint fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address; - g_NvidiaExt[index].src1u.x = fp16x2Val; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - - return g_NvidiaExt[index].dst0u.x; -} - -uint __NvAtomicOpFP16x2(RWTexture2D uav, uint2 address, uint fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = address; - g_NvidiaExt[index].src1u.x = fp16x2Val; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - - return g_NvidiaExt[index].dst0u.x; -} - -uint __NvAtomicOpFP16x2(RWTexture3D uav, uint3 address, uint fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = address; - g_NvidiaExt[index].src1u.x = fp16x2Val; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - - return g_NvidiaExt[index].dst0u.x; -} - -//----------------------------------------------------------------------------// - -// performs Atomic operation on a R16G16B16A16_FLOAT UAV at the given address -// the uint2 paramater 'fp16x2Val' is treated as four fp16 values -// i.e, fp16x2Val.x = uav.xy and fp16x2Val.y = uav.yz -// the passed sub-opcode 'op' should be an immediate constant -// the returned value are the four fp16 values (.xyzw components) packed into uint2 -// Warning: Behaviour of these set of functions is undefined if the UAV is not -// of R16G16B16A16_FLOAT format (might result in app crash or TDR) - -uint2 __NvAtomicOpFP16x2(RWTexture1D uav, uint address, uint2 fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - // break it down into two fp16x2 atomic ops - uint2 retVal; - - // first op has x-coordinate = x * 2 - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address * 2; - g_NvidiaExt[index].src1u.x = fp16x2Val.x; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.x = g_NvidiaExt[index].dst0u.x; - - // second op has x-coordinate = x * 2 + 1 - index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address * 2 + 1; - g_NvidiaExt[index].src1u.x = fp16x2Val.y; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.y = g_NvidiaExt[index].dst0u.x; - - return retVal; -} - -uint2 __NvAtomicOpFP16x2(RWTexture2D uav, uint2 address, uint2 fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - // break it down into two fp16x2 atomic ops - uint2 retVal; - - // first op has x-coordinate = x * 2 - uint2 addressTemp = uint2(address.x * 2, address.y); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = addressTemp; - g_NvidiaExt[index].src1u.x = fp16x2Val.x; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.x = g_NvidiaExt[index].dst0u.x; - - // second op has x-coordinate = x * 2 + 1 - addressTemp.x++; - index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = addressTemp; - g_NvidiaExt[index].src1u.x = fp16x2Val.y; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.y = g_NvidiaExt[index].dst0u.x; - - return retVal; -} - -uint2 __NvAtomicOpFP16x2(RWTexture3D uav, uint3 address, uint2 fp16x2Val, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - // break it down into two fp16x2 atomic ops - uint2 retVal; - - // first op has x-coordinate = x * 2 - uint3 addressTemp = uint3(address.x * 2, address.y, address.z); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = addressTemp; - g_NvidiaExt[index].src1u.x = fp16x2Val.x; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.x = g_NvidiaExt[index].dst0u.x; - - // second op has x-coordinate = x * 2 + 1 - addressTemp.x++; - index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = addressTemp; - g_NvidiaExt[index].src1u.x = fp16x2Val.y; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC; - retVal.y = g_NvidiaExt[index].dst0u.x; - - return retVal; -} - -uint __fp32x2Tofp16x2(float2 val) -{ - return (f32tof16(val.y)<<16) | f32tof16(val.x) ; -} - -uint2 __fp32x4Tofp16x4(float4 val) -{ - return uint2( (f32tof16(val.y)<<16) | f32tof16(val.x), (f32tof16(val.w)<<16) | f32tof16(val.z) ) ; -} - -//----------------------------------------------------------------------------// - -// FP32 Atomic functions -// performs Atomic operation treating the uav as float (fp32) values -// the passed sub-opcode 'op' should be an immediate constant -// byteAddress must be multiple of 4 -float __NvAtomicAddFP32(RWByteAddressBuffer uav, uint byteAddress, float val) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = byteAddress; - g_NvidiaExt[index].src1u.x = asuint(val); // passing as uint to make it more convinient for the driver to translate - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC; - - return asfloat(g_NvidiaExt[index].dst0u.x); -} - -float __NvAtomicAddFP32(RWTexture1D uav, uint address, float val) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address; - g_NvidiaExt[index].src1u.x = asuint(val); - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC; - - return asfloat(g_NvidiaExt[index].dst0u.x); -} - -float __NvAtomicAddFP32(RWTexture2D uav, uint2 address, float val) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = address; - g_NvidiaExt[index].src1u.x = asuint(val); - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC; - - return asfloat(g_NvidiaExt[index].dst0u.x); -} - -float __NvAtomicAddFP32(RWTexture3D uav, uint3 address, float val) -{ - __NvReferenceUAVForOp(uav); - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = address; - g_NvidiaExt[index].src1u.x = asuint(val); - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD; - g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC; - - return asfloat(g_NvidiaExt[index].dst0u.x); -} - -//----------------------------------------------------------------------------// - -// UINT64 Atmoic Functions -// The functions below performs atomic operation on the given UAV treating the value as uint64 -// byteAddress must be multiple of 8 -// The returned value is the value present in memory location before the atomic operation -// uint2 vector type is used to represent a single uint64 value with the x component containing the low 32 bits and y component the high 32 bits. - -uint2 __NvAtomicCompareExchangeUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 compareValue, uint2 value) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = byteAddress; - g_NvidiaExt[index].src1u.xy = compareValue; - g_NvidiaExt[index].src1u.zw = value; - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicOpUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 value, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = byteAddress; - g_NvidiaExt[index].src1u.xy = value; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicCompareExchangeUINT64(RWTexture1D uav, uint address, uint2 compareValue, uint2 value) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address; - g_NvidiaExt[index].src1u.xy = compareValue; - g_NvidiaExt[index].src1u.zw = value; - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicOpUINT64(RWTexture1D uav, uint address, uint2 value, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = address; - g_NvidiaExt[index].src1u.xy = value; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicCompareExchangeUINT64(RWTexture2D uav, uint2 address, uint2 compareValue, uint2 value) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = address; - g_NvidiaExt[index].src1u.xy = compareValue; - g_NvidiaExt[index].src1u.zw = value; - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicOpUINT64(RWTexture2D uav, uint2 address, uint2 value, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xy = address; - g_NvidiaExt[index].src1u.xy = value; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicCompareExchangeUINT64(RWTexture3D uav, uint3 address, uint2 compareValue, uint2 value) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = address; - g_NvidiaExt[index].src1u.xy = compareValue; - g_NvidiaExt[index].src1u.zw = value; - g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - -uint2 __NvAtomicOpUINT64(RWTexture3D uav, uint3 address, uint2 value, uint atomicOpType) -{ - __NvReferenceUAVForOp(uav); - - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.xyz = address; - g_NvidiaExt[index].src1u.xy = value; - g_NvidiaExt[index].src2u.x = atomicOpType; - g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC; - - return g_NvidiaExt[index].dst0u.xy; -} - - -uint4 __NvFootprint(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, int3 offset = int3(0, 0, 0)) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = texIndex; - g_NvidiaExt[index].src0u.y = smpIndex; - g_NvidiaExt[index].src1u.xyz = asuint(location); - g_NvidiaExt[index].src1u.w = gran; - g_NvidiaExt[index].src3u.x = texSpace; - g_NvidiaExt[index].src3u.y = smpSpace; - g_NvidiaExt[index].src3u.z = texType; - g_NvidiaExt[index].src3u.w = footprintmode; - g_NvidiaExt[index].src4u.xyz = asuint(offset); - - g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT; - g_NvidiaExt[index].numOutputsForIncCounter = 4; - - // result is returned as the return value of IncrementCounter on fake UAV slot - uint4 op; - op.x = g_NvidiaExt.IncrementCounter(); - op.y = g_NvidiaExt.IncrementCounter(); - op.z = g_NvidiaExt.IncrementCounter(); - op.w = g_NvidiaExt.IncrementCounter(); - return op; -} - -uint4 __NvFootprintBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float bias, int3 offset = int3(0, 0, 0)) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = texIndex; - g_NvidiaExt[index].src0u.y = smpIndex; - g_NvidiaExt[index].src1u.xyz = asuint(location); - g_NvidiaExt[index].src1u.w = gran; - g_NvidiaExt[index].src2u.x = asuint(bias); - g_NvidiaExt[index].src3u.x = texSpace; - g_NvidiaExt[index].src3u.y = smpSpace; - g_NvidiaExt[index].src3u.z = texType; - g_NvidiaExt[index].src3u.w = footprintmode; - g_NvidiaExt[index].src4u.xyz = asuint(offset); - - g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_BIAS; - g_NvidiaExt[index].numOutputsForIncCounter = 4; - - // result is returned as the return value of IncrementCounter on fake UAV slot - uint4 op; - op.x = g_NvidiaExt.IncrementCounter(); - op.y = g_NvidiaExt.IncrementCounter(); - op.z = g_NvidiaExt.IncrementCounter(); - op.w = g_NvidiaExt.IncrementCounter(); - return op; -} - -uint4 __NvFootprintLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float lodLevel, int3 offset = int3(0, 0, 0)) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = texIndex; - g_NvidiaExt[index].src0u.y = smpIndex; - g_NvidiaExt[index].src1u.xyz = asuint(location); - g_NvidiaExt[index].src1u.w = gran; - g_NvidiaExt[index].src2u.x = asuint(lodLevel); - g_NvidiaExt[index].src3u.x = texSpace; - g_NvidiaExt[index].src3u.y = smpSpace; - g_NvidiaExt[index].src3u.z = texType; - g_NvidiaExt[index].src3u.w = footprintmode; - g_NvidiaExt[index].src4u.xyz = asuint(offset); - - g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_LEVEL; - g_NvidiaExt[index].numOutputsForIncCounter = 4; - - // result is returned as the return value of IncrementCounter on fake UAV slot - uint4 op; - op.x = g_NvidiaExt.IncrementCounter(); - op.y = g_NvidiaExt.IncrementCounter(); - op.z = g_NvidiaExt.IncrementCounter(); - op.w = g_NvidiaExt.IncrementCounter(); - return op; -} - -uint4 __NvFootprintGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float3 ddx, float3 ddy, int3 offset = int3(0, 0, 0)) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = texIndex; - g_NvidiaExt[index].src0u.y = smpIndex; - g_NvidiaExt[index].src1u.xyz = asuint(location); - g_NvidiaExt[index].src1u.w = gran; - g_NvidiaExt[index].src2u.xyz = asuint(ddx); - g_NvidiaExt[index].src5u.xyz = asuint(ddy); - g_NvidiaExt[index].src3u.x = texSpace; - g_NvidiaExt[index].src3u.y = smpSpace; - g_NvidiaExt[index].src3u.z = texType; - g_NvidiaExt[index].src3u.w = footprintmode; - g_NvidiaExt[index].src4u.xyz = asuint(offset); - g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_GRAD; - g_NvidiaExt[index].numOutputsForIncCounter = 4; - - // result is returned as the return value of IncrementCounter on fake UAV slot - uint4 op; - op.x = g_NvidiaExt.IncrementCounter(); - op.y = g_NvidiaExt.IncrementCounter(); - op.z = g_NvidiaExt.IncrementCounter(); - op.w = g_NvidiaExt.IncrementCounter(); - return op; -} - -// returns value of special register - specify subopcode from any of NV_SPECIALOP_* specified in nvShaderExtnEnums.h - other opcodes undefined behavior -uint __NvGetSpecial(uint subOpCode) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].opcode = NV_EXTN_OP_GET_SPECIAL; - g_NvidiaExt[index].src0u.x = subOpCode; - return g_NvidiaExt.IncrementCounter(); -} - -// predicate is returned in laneValid indicating if srcLane is in range and val from specified lane is returned. -int __NvShflGeneric(int val, uint srcLane, uint maskClampVal, out uint laneValid) -{ - uint index = g_NvidiaExt.IncrementCounter(); - g_NvidiaExt[index].src0u.x = val; // variable to be shuffled - g_NvidiaExt[index].src0u.y = srcLane; // source lane - g_NvidiaExt[index].src0u.z = maskClampVal; - g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_GENERIC; - g_NvidiaExt[index].numOutputsForIncCounter = 2; - - laneValid = asuint(g_NvidiaExt.IncrementCounter()); - return g_NvidiaExt.IncrementCounter(); -} \ No newline at end of file diff --git a/参考/NexBox-main/R560-developer/nvShaderExtnEnums.h b/参考/NexBox-main/R560-developer/nvShaderExtnEnums.h deleted file mode 100644 index e3ff8a7..0000000 --- a/参考/NexBox-main/R560-developer/nvShaderExtnEnums.h +++ /dev/null @@ -1,150 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -//////////////////////////////////////////////////////////////////////////////// -////////////////////////// NVIDIA SHADER EXTENSIONS //////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -// This file can be included both from HLSL shader code as well as C++ code. -// The app should call NvAPI_D3D11_IsNvShaderExtnOpCodeSupported() / NvAPI_D3D12_IsNvShaderExtnOpCodeSupported() -// to check for support for every nv shader extension opcode it plans to use - - - -//----------------------------------------------------------------------------// -//---------------------------- NV Shader Extn Version -----------------------// -//----------------------------------------------------------------------------// -#define NV_SHADER_EXTN_VERSION 1 - -//----------------------------------------------------------------------------// -//---------------------------- Misc constants --------------------------------// -//----------------------------------------------------------------------------// -#define NV_WARP_SIZE 32 -#define NV_WARP_SIZE_LOG2 5 - -//----------------------------------------------------------------------------// -//---------------------------- opCode constants ------------------------------// -//----------------------------------------------------------------------------// - - -#define NV_EXTN_OP_SHFL 1 -#define NV_EXTN_OP_SHFL_UP 2 -#define NV_EXTN_OP_SHFL_DOWN 3 -#define NV_EXTN_OP_SHFL_XOR 4 - -#define NV_EXTN_OP_VOTE_ALL 5 -#define NV_EXTN_OP_VOTE_ANY 6 -#define NV_EXTN_OP_VOTE_BALLOT 7 - -#define NV_EXTN_OP_GET_LANE_ID 8 -#define NV_EXTN_OP_FP16_ATOMIC 12 -#define NV_EXTN_OP_FP32_ATOMIC 13 - -#define NV_EXTN_OP_GET_SPECIAL 19 - -#define NV_EXTN_OP_UINT64_ATOMIC 20 - -#define NV_EXTN_OP_MATCH_ANY 21 - -// FOOTPRINT - For Sample and SampleBias -#define NV_EXTN_OP_FOOTPRINT 28 -#define NV_EXTN_OP_FOOTPRINT_BIAS 29 - -#define NV_EXTN_OP_GET_SHADING_RATE 30 - -// FOOTPRINT - For SampleLevel and SampleGrad -#define NV_EXTN_OP_FOOTPRINT_LEVEL 31 -#define NV_EXTN_OP_FOOTPRINT_GRAD 32 - -// SHFL Generic -#define NV_EXTN_OP_SHFL_GENERIC 33 - -#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE 51 -#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED 52 - -// HitObject API -#define NV_EXTN_OP_HIT_OBJECT_TRACE_RAY 67 -#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT 68 -#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT_WITH_RECORD_INDEX 69 -#define NV_EXTN_OP_HIT_OBJECT_MAKE_MISS 70 -#define NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD 71 -#define NV_EXTN_OP_HIT_OBJECT_INVOKE 72 -#define NV_EXTN_OP_HIT_OBJECT_IS_MISS 73 -#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_ID 74 -#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_INDEX 75 -#define NV_EXTN_OP_HIT_OBJECT_GET_PRIMITIVE_INDEX 76 -#define NV_EXTN_OP_HIT_OBJECT_GET_GEOMETRY_INDEX 77 -#define NV_EXTN_OP_HIT_OBJECT_GET_HIT_KIND 78 -#define NV_EXTN_OP_HIT_OBJECT_GET_RAY_DESC 79 -#define NV_EXTN_OP_HIT_OBJECT_GET_ATTRIBUTES 80 -#define NV_EXTN_OP_HIT_OBJECT_GET_SHADER_TABLE_INDEX 81 -#define NV_EXTN_OP_HIT_OBJECT_LOAD_LOCAL_ROOT_TABLE_CONSTANT 82 -#define NV_EXTN_OP_HIT_OBJECT_IS_HIT 83 -#define NV_EXTN_OP_HIT_OBJECT_IS_NOP 84 -#define NV_EXTN_OP_HIT_OBJECT_MAKE_NOP 85 - -// Micro-map API -#define NV_EXTN_OP_RT_TRIANGLE_OBJECT_POSITIONS 86 -#define NV_EXTN_OP_RT_MICRO_TRIANGLE_OBJECT_POSITIONS 87 -#define NV_EXTN_OP_RT_MICRO_TRIANGLE_BARYCENTRICS 88 -#define NV_EXTN_OP_RT_IS_MICRO_TRIANGLE_HIT 89 -#define NV_EXTN_OP_RT_IS_BACK_FACING 90 -#define NV_EXTN_OP_RT_MICRO_VERTEX_OBJECT_POSITION 91 -#define NV_EXTN_OP_RT_MICRO_VERTEX_BARYCENTRICS 92 - -//----------------------------------------------------------------------------// -//-------------------- GET_SPECIAL subOpCode constants -----------------------// -//----------------------------------------------------------------------------// -#define NV_SPECIALOP_THREADLTMASK 4 -#define NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED 5 -#define NV_SPECIALOP_GLOBAL_TIMER_LO 9 -#define NV_SPECIALOP_GLOBAL_TIMER_HI 10 - -//----------------------------------------------------------------------------// -//----------------------------- Texture Types -------------------------------// -//----------------------------------------------------------------------------// -#define NV_EXTN_TEXTURE_1D 2 -#define NV_EXTN_TEXTURE_1D_ARRAY 3 -#define NV_EXTN_TEXTURE_2D 4 -#define NV_EXTN_TEXTURE_2D_ARRAY 5 -#define NV_EXTN_TEXTURE_3D 6 -#define NV_EXTN_TEXTURE_CUBE 7 -#define NV_EXTN_TEXTURE_CUBE_ARRAY 8 - - -//---------------------------------------------------------------------------// -//----------------FOOTPRINT Enums for NvFootprint* extns---------------------// -//---------------------------------------------------------------------------// -#define NV_EXTN_FOOTPRINT_MODE_FINE 0 -#define NV_EXTN_FOOTPRINT_MODE_COARSE 1 diff --git a/参考/NexBox-main/R560-developer/nvapi.h b/参考/NexBox-main/R560-developer/nvapi.h deleted file mode 100644 index 7239b14..0000000 --- a/参考/NexBox-main/R560-developer/nvapi.h +++ /dev/null @@ -1,23596 +0,0 @@ -#include"nvapi_lite_salstart.h" -#include"nvapi_lite_common.h" -#include"nvapi_lite_sli.h" -#include"nvapi_lite_surround.h" -#include"nvapi_lite_stereo.h" -#include"nvapi_lite_d3dext.h" - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - - -/////////////////////////////////////////////////////////////////////////////// -// -// Date: Jul 19, 2024 -// File: nvapi.h -// -// NvAPI provides an interface to NVIDIA devices. This file contains the -// interface constants, structure definitions and function prototypes. -// -// Target Profile: developer -// Target Platform: windows -// -/////////////////////////////////////////////////////////////////////////////// -#ifndef _NVAPI_H -#define _NVAPI_H - -#pragma pack(push,8) // Make sure we have consistent structure packings - -#ifdef __cplusplus -extern "C" { -#endif -// ==================================================== -// Universal NvAPI Definitions -// ==================================================== -#ifndef _WIN32 -#define __cdecl -#endif - - - -//! @} - - -//! \ingroup nvapistatus -#define NVAPI_API_NOT_INTIALIZED NVAPI_API_NOT_INITIALIZED //!< Fix typo in error code - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Initialize -// -//! This function initializes the NvAPI library (if not already initialized) but always increments the ref-counter. -//! This must be called before calling other NvAPI_ functions. -//! Note: It is now mandatory to call NvAPI_Initialize before calling any other NvAPI. -//! NvAPI_Unload should be called to unload the NVAPI Library. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_LIBRARY_NOT_FOUND Failed to load the NVAPI support library -//! \sa nvapistatus -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Initialize(); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Unload -// -//! DESCRIPTION: Decrements the ref-counter and when it reaches ZERO, unloads NVAPI library. -//! This must be called in pairs with NvAPI_Initialize. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! If the client wants unload functionality, it is recommended to always call NvAPI_Initialize and NvAPI_Unload in pairs. -//! -//! Unloading NvAPI library is not supported when the library is in a resource locked state. -//! Some functions in the NvAPI library initiates an operation or allocates certain resources -//! and there are corresponding functions available, to complete the operation or free the -//! allocated resources. All such function pairs are designed to prevent unloading NvAPI library. -//! -//! For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with -//! NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources, -//! before calling NvAPI_Unload again. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_API_IN_USE Atleast an API is still being called hence cannot unload requested driver. -//! -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Unload(); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetErrorMessage -// -//! This function converts an NvAPI error code into a null terminated string. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param nr The error code to convert -//! \param szDesc The string corresponding to the error code -//! -//! \return NULL terminated string (always, never NULL) -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr,NvAPI_ShortString szDesc); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetInterfaceVersionString -// -//! This function returns a string describing the version of the NvAPI library. -//! The contents of the string are human readable. Do not assume a fixed -//! format. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param szDesc User readable string giving NvAPI version information -//! -//! \return See \ref nvapistatus for the list of possible return values. -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetInterfaceVersionStringEx -// -//! This function returns a string describing the version of the NvAPI library. -//! The contents of the string are human readable. Do not assume a fixed format. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 450 -//! -//! \param szDesc User readable string giving NvAPI version information -//! -//! \return See \ref nvapistatus for the list of possible return values. -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetInterfaceVersionStringEx(NvAPI_ShortString szDesc); - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// All display port related data types definition starts -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// This category is intentionally added before the #ifdef. The #endif should also be in the same scope - -#ifndef DISPLAYPORT_STRUCTS_DEFINED -#define DISPLAYPORT_STRUCTS_DEFINED - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_LINK_RATE -{ - NV_DP_1_62GBPS = 6, - NV_DP_2_70GBPS = 0xA, - NV_DP_5_40GBPS = 0x14, - NV_DP_8_10GBPS = 0x1E, -// Recommended Intermidiate Link Transfer Rates - NV_EDP_2_16GBPS = 8, - NV_EDP_2_43GBPS = 9, - NV_EDP_3_24GBPS = 0xC, - NV_EDP_4_32GBPS = 0x10 -} NV_DP_LINK_RATE; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_LANE_COUNT -{ - NV_DP_1_LANE = 1, - NV_DP_2_LANE = 2, - NV_DP_4_LANE = 4, -} NV_DP_LANE_COUNT; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_COLOR_FORMAT -{ - NV_DP_COLOR_FORMAT_RGB = 0, - NV_DP_COLOR_FORMAT_YCbCr422, - NV_DP_COLOR_FORMAT_YCbCr444, -} NV_DP_COLOR_FORMAT; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_COLORIMETRY -{ - NV_DP_COLORIMETRY_RGB = 0, - NV_DP_COLORIMETRY_YCbCr_ITU601, - NV_DP_COLORIMETRY_YCbCr_ITU709, -} NV_DP_COLORIMETRY; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_DYNAMIC_RANGE -{ - NV_DP_DYNAMIC_RANGE_VESA = 0, - NV_DP_DYNAMIC_RANGE_CEA, -} NV_DP_DYNAMIC_RANGE; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_BPC -{ - NV_DP_BPC_DEFAULT = 0, - NV_DP_BPC_6, - NV_DP_BPC_8, - NV_DP_BPC_10, - NV_DP_BPC_12, - NV_DP_BPC_16, -} NV_DP_BPC; - - -#endif //#ifndef DISPLAYPORT_STRUCTS_DEFINED - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// All display port related data types definitions end -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetEDID -// -//! \fn NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID) -//! This function returns the EDID data for the specified GPU handle and connection bit mask. -//! displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set -//! \retval NVAPI_OK *pEDID contains valid data. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_DATA_NOT_FOUND The requested display does not contain an EDID. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! @{ - -#define NV_EDID_V1_DATA_SIZE 256 - -#define NV_EDID_DATA_SIZE NV_EDID_V1_DATA_SIZE - -typedef struct -{ - NvU32 version; //structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; -} NV_EDID_V1; - -//! Used in NvAPI_GPU_GetEDID() -typedef struct -{ - NvU32 version; //!< Structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; - NvU32 sizeofEDID; -} NV_EDID_V2; - -//! Used in NvAPI_GPU_GetEDID() -typedef struct -{ - NvU32 version; //!< Structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; - NvU32 sizeofEDID; - NvU32 edidId; //!< ID which always returned in a monotonically increasing counter. - //!< Across a split-EDID read we need to verify that all calls returned the same edidId. - //!< This counter is incremented if we get the updated EDID. - NvU32 offset; //!< Which 256-byte page of the EDID we want to read. Start at 0. - //!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE, - //!< call back again with offset+256 until we have read the entire buffer -} NV_EDID_V3; - -typedef NV_EDID_V3 NV_EDID; - -#define NV_EDID_VER1 MAKE_NVAPI_VERSION(NV_EDID_V1,1) -#define NV_EDID_VER2 MAKE_NVAPI_VERSION(NV_EDID_V2,2) -#define NV_EDID_VER3 MAKE_NVAPI_VERSION(NV_EDID_V3,3) -#define NV_EDID_VER NV_EDID_VER3 - -//! @} - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID); - -//! \ingroup gpu - -//! Used in NvAPI_DISP_GetEdidData - -#define NV_EDID_DATA_SIZE_MAX 1024 //!< This is the current size supported by Nvidia Display Driver and may change in future. - -typedef enum -{ - NV_EDID_FLAG_DEFAULT = 0, //!< the EDID which is actively used by the driver, it could be _RAW/_COOKED/_FORCED/_INF. - NV_EDID_FLAG_RAW = 1, //!< the EDID which is not modified by the driver. If there's no _FORCED edid engaged, it - //!< will be the unmodified monitor EDID from the I2C bus. Otherwise it is original _FORCED edid. - NV_EDID_FLAG_COOKED = 2, //!< the EDID has been modified by the driver for compatibility - NV_EDID_FLAG_FORCED = 3, //!< the EDID is forced by the end-user over s/w interface, - NV_EDID_FLAG_INF = 4, //!< the EDID is from monitor INF - NV_EDID_FLAG_HW = 5, //!< the EDID is from the monitor over I2C bus without any modification. -} NV_EDID_FLAG; - -//! \ingroup gpu -//! Used in NV_GPU_CONNECTOR_DATA -typedef enum _NV_GPU_CONNECTOR_TYPE -{ - NVAPI_GPU_CONNECTOR_VGA_15_PIN = 0x00000000, - NVAPI_GPU_CONNECTOR_TV_COMPOSITE = 0x00000010, - NVAPI_GPU_CONNECTOR_TV_SVIDEO = 0x00000011, - NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = 0x00000013, - NVAPI_GPU_CONNECTOR_TV_SCART = 0x00000014, - NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = 0x00000016, - NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = 0x00000017, - NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = 0x00000018, - NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = 0x00000019, - NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = 0x0000001A, - NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = 0x00000020, - NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = 0x00000021, - NVAPI_GPU_CONNECTOR_DVI_I = 0x00000030, - NVAPI_GPU_CONNECTOR_DVI_D = 0x00000031, - NVAPI_GPU_CONNECTOR_ADC = 0x00000032, - NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = 0x00000038, - NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = 0x00000039, - NVAPI_GPU_CONNECTOR_SPWG = 0x00000040, - NVAPI_GPU_CONNECTOR_OEM = 0x00000041, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = 0x00000046, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = 0x00000047, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT = 0x00000048, - NVAPI_GPU_CONNECTOR_HDMI_A = 0x00000061, - NVAPI_GPU_CONNECTOR_HDMI_C_MINI = 0x00000063, - NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1 = 0x00000064, - NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2 = 0x00000065, - NVAPI_GPU_CONNECTOR_VIRTUAL_WFD = 0x00000070, //!< Deprecated. - NVAPI_GPU_CONNECTOR_USB_C = 0x00000071, - NVAPI_GPU_CONNECTOR_UNKNOWN = 0xFFFFFFFF, -} NV_GPU_CONNECTOR_TYPE; - -//////////////////////////////////////////////////////////////////////////////// -// -// NvAPI_TVOutput Information -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup tvapi -//! Used in NV_DISPLAY_TV_OUTPUT_INFO -typedef enum _NV_DISPLAY_TV_FORMAT -{ - NV_DISPLAY_TV_FORMAT_NONE = 0, - NV_DISPLAY_TV_FORMAT_SD_NTSCM = 0x00000001, - NV_DISPLAY_TV_FORMAT_SD_NTSCJ = 0x00000002, - NV_DISPLAY_TV_FORMAT_SD_PALM = 0x00000004, - NV_DISPLAY_TV_FORMAT_SD_PALBDGH = 0x00000008, - NV_DISPLAY_TV_FORMAT_SD_PALN = 0x00000010, - NV_DISPLAY_TV_FORMAT_SD_PALNC = 0x00000020, - NV_DISPLAY_TV_FORMAT_SD_576i = 0x00000100, - NV_DISPLAY_TV_FORMAT_SD_480i = 0x00000200, - NV_DISPLAY_TV_FORMAT_ED_480p = 0x00000400, - NV_DISPLAY_TV_FORMAT_ED_576p = 0x00000800, - NV_DISPLAY_TV_FORMAT_HD_720p = 0x00001000, - NV_DISPLAY_TV_FORMAT_HD_1080i = 0x00002000, - NV_DISPLAY_TV_FORMAT_HD_1080p = 0x00004000, - NV_DISPLAY_TV_FORMAT_HD_720p50 = 0x00008000, - NV_DISPLAY_TV_FORMAT_HD_1080p24 = 0x00010000, - NV_DISPLAY_TV_FORMAT_HD_1080i50 = 0x00020000, - NV_DISPLAY_TV_FORMAT_HD_1080p50 = 0x00040000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30 = 0x00080000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp30, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25 = 0x00100000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp25, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24 = 0x00200000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp24, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE = 0x00400000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_3840 = 0x00800000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_3840 = 0x00900000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_4096 = 0x00A00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_4096 = 0x00B00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_4096 = 0x00C00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_4096 = 0x00D00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_4096 = 0x00E00000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp24_7680 = 0x01000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp25_7680 = 0x02000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp30_7680 = 0x04000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp48_7680 = 0x08000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp50_7680 = 0x09000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp60_7680 = 0x0A000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp100_7680 = 0x0B000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp120_7680 = 0x0C000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_3840 = 0x0D000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_4096 = 0x0E000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_4096 = 0x0F000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_3840 = 0x10000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_4096 = 0x11000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_3840 = 0x12000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_5120 = 0x13000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_5120 = 0x14000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_5120 = 0x15000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_5120 = 0x16000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_5120 = 0x17000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_5120 = 0x18000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_5120 = 0x19000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_5120 = 0x20000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp24_10240 = 0x21000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp25_10240 = 0x22000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp30_10240 = 0x23000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp48_10240 = 0x24000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp50_10240 = 0x25000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp60_10240 = 0x26000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp100_10240 = 0x27000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp120_10240 = 0x28000000, - - - NV_DISPLAY_TV_FORMAT_SD_OTHER = 0x30000000, - NV_DISPLAY_TV_FORMAT_ED_OTHER = 0x40000000, - NV_DISPLAY_TV_FORMAT_HD_OTHER = 0x50000000, - - NV_DISPLAY_TV_FORMAT_ANY = 0x80000000, - -} NV_DISPLAY_TV_FORMAT; - - -//! \ingroup dispcontrol -//! @{ -#define NVAPI_MAX_VIEW_TARGET 2 -#define NVAPI_ADVANCED_MAX_VIEW_TARGET 4 - -#ifndef _NV_TARGET_VIEW_MODE_ -#define _NV_TARGET_VIEW_MODE_ - -//! Used in NvAPI_SetView(). -typedef enum _NV_TARGET_VIEW_MODE -{ - NV_VIEW_MODE_STANDARD = 0, - NV_VIEW_MODE_CLONE = 1, - NV_VIEW_MODE_HSPAN = 2, - NV_VIEW_MODE_VSPAN = 3, - NV_VIEW_MODE_DUALVIEW = 4, - NV_VIEW_MODE_MULTIVIEW = 5, -} NV_TARGET_VIEW_MODE; -#endif - -//! @} - -// Following definitions are used in NvAPI_SetViewEx. - -//! Scaling modes - used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -typedef enum _NV_SCALING -{ - NV_SCALING_DEFAULT = 0, //!< No change - - // New Scaling Declarations - NV_SCALING_GPU_SCALING_TO_CLOSEST = 1, //!< Balanced - Full Screen - NV_SCALING_GPU_SCALING_TO_NATIVE = 2, //!< Force GPU - Full Screen - NV_SCALING_GPU_SCANOUT_TO_NATIVE = 3, //!< Force GPU - Centered\No Scaling - NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE = 5, //!< Force GPU - Aspect Ratio - NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6, //!< Balanced - Aspect Ratio - NV_SCALING_GPU_SCANOUT_TO_CLOSEST = 7, //!< Balanced - Centered\No Scaling - NV_SCALING_GPU_INTEGER_ASPECT_SCALING = 8, //!< Force GPU - Integer Scaling - - // Legacy Declarations - NV_SCALING_MONITOR_SCALING = NV_SCALING_GPU_SCALING_TO_CLOSEST, - NV_SCALING_ADAPTER_SCALING = NV_SCALING_GPU_SCALING_TO_NATIVE, - NV_SCALING_CENTERED = NV_SCALING_GPU_SCANOUT_TO_NATIVE, - NV_SCALING_ASPECT_SCALING = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE, - - NV_SCALING_CUSTOMIZED = 255 //!< For future use -} NV_SCALING; - -//! Rotate modes- used in NvAPI_SetViewEx(). - -//! \ingroup dispcontrol -typedef enum _NV_ROTATE -{ - NV_ROTATE_0 = 0, - NV_ROTATE_90 = 1, - NV_ROTATE_180 = 2, - NV_ROTATE_270 = 3, - NV_ROTATE_IGNORED = 4, -} NV_ROTATE; - -//! Color formats- used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -#define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) | \ - ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24 )) - - - -//! Color formats- used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -typedef enum _NV_FORMAT -{ - NV_FORMAT_UNKNOWN = 0, //!< unknown. Driver will choose one as following value. - NV_FORMAT_P8 = 41, //!< for 8bpp mode - NV_FORMAT_R5G6B5 = 23, //!< for 16bpp mode - NV_FORMAT_A8R8G8B8 = 21, //!< for 32bpp mode - NV_FORMAT_A16B16G16R16F = 113, //!< for 64bpp(floating point) mode. - -} NV_FORMAT; - -// TV standard - -typedef struct -{ - float x; //!< x-coordinate of the viewport top-left point - float y; //!< y-coordinate of the viewport top-left point - float w; //!< Width of the viewport - float h; //!< Height of the viewport -} NV_VIEWPORTF; - - - -//! \ingroup dispcontrol -//! The timing override is not supported yet; must be set to _AUTO. \n - - -typedef enum _NV_TIMING_OVERRIDE -{ - NV_TIMING_OVERRIDE_CURRENT = 0, //!< get the current timing - NV_TIMING_OVERRIDE_AUTO, //!< the timing the driver will use based the current policy - NV_TIMING_OVERRIDE_EDID, //!< EDID timing - NV_TIMING_OVERRIDE_DMT, //!< VESA DMT timing - NV_TIMING_OVERRIDE_DMT_RB, //!< VESA DMT timing with reduced blanking - NV_TIMING_OVERRIDE_CVT, //!< VESA CVT timing - NV_TIMING_OVERRIDE_CVT_RB, //!< VESA CVT timing with reduced blanking - NV_TIMING_OVERRIDE_GTF, //!< VESA GTF timing - NV_TIMING_OVERRIDE_EIA861, //!< EIA 861x pre-defined timing - NV_TIMING_OVERRIDE_ANALOG_TV, //!< analog SD/HDTV timing - NV_TIMING_OVERRIDE_CUST, //!< NV custom timings - NV_TIMING_OVERRIDE_NV_PREDEFINED, //!< NV pre-defined timing (basically the PsF timings) - NV_TIMING_OVERRIDE_NV_PSF = NV_TIMING_OVERRIDE_NV_PREDEFINED, - NV_TIMING_OVERRIDE_NV_ASPR, - NV_TIMING_OVERRIDE_SDI, //!< Override for SDI timing - - NV_TIMING_OVRRIDE_MAX, -}NV_TIMING_OVERRIDE; - - -#ifndef NV_TIMING_STRUCTS_DEFINED -#define NV_TIMING_STRUCTS_DEFINED - -//*********************** -// The Timing Structure -//*********************** -// -//! \ingroup dispcontrol -//! NVIDIA-specific timing extras \n -//! Used in NV_TIMING. -typedef struct tagNV_TIMINGEXT -{ - NvU32 flag; //!< Reserved for NVIDIA hardware-based enhancement, such as double-scan. - NvU16 rr; //!< Logical refresh rate to present - NvU32 rrx1k; //!< Physical vertical refresh rate in 0.001Hz - NvU32 aspect; //!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect - NvU16 rep; //!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,.. - NvU32 status; //!< Timing standard - NvU8 name[40]; //!< Timing name -}NV_TIMINGEXT; - - - -//! \ingroup dispcontrol -//!The very basic timing structure based on the VESA standard: -//! \code -//! |<----------------------------htotal--------------------------->| -//! ---------"active" video-------->|<-------blanking------>|<----- -//! |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->| -//! --------- -+-------------------------+ | | | | | -//! A A | | | | | | | -//! : : | | | | | | | -//! : : | | | | | | | -//! :vertical| addressable video | | | | | | -//! : visible| | | | | | | -//! : : | | | | | | | -//! : : | | | | | | | -//! vertical V | | | | | | | -//! total --+-------------------------+ | | | | | -//! : vb border | | | | | -//! : -----------------------------------+ | | | | -//! : vfp front porch | | | | -//! : -------------------------------------------+ | | | -//! : vsw sync width | | | -//! : ---------------------------------------------------+ | | -//! : vbp back porch | | -//! : -----------------------------------------------------------+ | -//! V vb border | -//! ---------------------------------------------------------------------------+ -//! \endcode -typedef struct _NV_TIMING -{ - // VESA scan out timing parameters: - NvU16 HVisible; //!< horizontal visible - NvU16 HBorder; //!< horizontal border - NvU16 HFrontPorch; //!< horizontal front porch - NvU16 HSyncWidth; //!< horizontal sync width - NvU16 HTotal; //!< horizontal total - NvU8 HSyncPol; //!< horizontal sync polarity: 1-negative, 0-positive - - NvU16 VVisible; //!< vertical visible - NvU16 VBorder; //!< vertical border - NvU16 VFrontPorch; //!< vertical front porch - NvU16 VSyncWidth; //!< vertical sync width - NvU16 VTotal; //!< vertical total - NvU8 VSyncPol; //!< vertical sync polarity: 1-negative, 0-positive - - NvU16 interlaced; //!< 1-interlaced, 0-progressive - NvU32 pclk; //!< pixel clock in 10 kHz - - //other timing related extras - NV_TIMINGEXT etc; -}NV_TIMING; -#endif //NV_TIMING_STRUCTS_DEFINED - - -//! \addtogroup dispcontrol -//! Timing-related constants -//! @{ -#define NV_TIMING_H_SYNC_POSITIVE 0 -#define NV_TIMING_H_SYNC_NEGATIVE 1 -#define NV_TIMING_H_SYNC_DEFAULT NV_TIMING_H_SYNC_NEGATIVE -// -#define NV_TIMING_V_SYNC_POSITIVE 0 -#define NV_TIMING_V_SYNC_NEGATIVE 1 -#define NV_TIMING_V_SYNC_DEFAULT NV_TIMING_V_SYNC_POSITIVE -// -#define NV_TIMING_PROGRESSIVE 0 -#define NV_TIMING_INTERLACED 1 -#define NV_TIMING_INTERLACED_EXTRA_VBLANK_ON_FIELD2 1 -#define NV_TIMING_INTERLACED_NO_EXTRA_VBLANK_ON_FIELD2 2 -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetView -// -//! \fn NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView) -//! This function lets the caller modify the target display arrangement of the selected source display handle in any nView mode. -//! It can also modify or extend the source display in Dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 90 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pTargetInfo Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] targetCount Count of target devices specified in pTargetInfo. -//! \param [in] targetView Target view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -//! Used in NvAPI_SetView() and NvAPI_GetView() -typedef struct -{ - NvU32 version; //!< (IN) structure version - NvU32 count; //!< (IN) target count - struct - { - NvU32 deviceMask; //!< (IN/OUT) Device mask - NvU32 sourceId; //!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU. - NvU32 bPrimary:1; //!< (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary. - //!< NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view. - NvU32 bInterlaced:1; //!< (IN/OUT) Indicates if the timing being used on this monitor is interlaced. - NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary. - NvU32 bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetView(). Turns off optimization & forces OS to set supplied mode. - } target[NVAPI_MAX_VIEW_TARGET]; -} NV_VIEW_TARGET_INFO; - -//! \ingroup dispcontrol -#define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2) - -//! \ingroup dispcontrol -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.") -NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetViewEx -// -//! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView) -//! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes. -//! It also allows to modify or extend the source display in dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] pathCount Count of paths specified in pPathInfo. -//! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -#define NVAPI_MAX_DISPLAY_PATH NVAPI_MAX_VIEW_TARGET - -//! \ingroup dispcontrol -#define NVAPI_ADVANCED_MAX_DISPLAY_PATH NVAPI_ADVANCED_MAX_VIEW_TARGET - - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PATH_INFO. -typedef struct -{ - NvU32 deviceMask; //!< (IN) Device mask - NvU32 sourceId; //!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?) - NvU32 bPrimary:1; //!< (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary. - //!< NvAPI_SetViewEx() automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view. - NV_GPU_CONNECTOR_TYPE connector; //!< (IN) Specify connector type. For TV only. - - // source mode information - NvU32 width; //!< (IN) Width of the mode - NvU32 height; //!< (IN) Height of the mode - NvU32 depth; //!< (IN) Depth of the mode - NV_FORMAT colorFormat; //!< Color format if it needs to be specified. Not used now. - - //rotation setting of the mode - NV_ROTATE rotation; //!< (IN) Rotation setting. - - // the scaling mode - NV_SCALING scaling; //!< (IN) Scaling setting - - // Timing info - NvU32 refreshRate; //!< (IN) Refresh rate of the mode - NvU32 interlaced:1; //!< (IN) Interlaced mode flag - - NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE - - // Windows desktop position - NvU32 posx; //!< (IN/OUT) X-offset of this display on the Windows desktop - NvU32 posy; //!< (IN/OUT) Y-offset of this display on the Windows desktop - NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary. - - NvU32 bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetViewEx(). Turns off optimization & forces OS to set supplied mode. - NvU32 bFocusDisplay:1;//!< (IN) If set, this display path should have the focus after the GPU topology change - NvU32 gpuId:24; //!< (IN) the physical display/target Gpu id which is the owner of the scan out (for SLI multimon, display from the slave Gpu) - -} NV_DISPLAY_PATH; - -//! \ingroup dispcontrol -//! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx(). -typedef struct -{ - NvU32 version; //!< (IN) Structure version - NvU32 count; //!< (IN) Path count - NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH]; -} NV_DISPLAY_PATH_INFO_V3; - -//! \ingroup dispcontrol -//! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx(). -typedef struct -{ - NvU32 version; //!< (IN) Structure version - NvU32 count; //!< (IN) Path count - NV_DISPLAY_PATH path[NVAPI_ADVANCED_MAX_DISPLAY_PATH]; -} NV_DISPLAY_PATH_INFO; - -//! \addtogroup dispcontrol -//! Macro for constructing the version fields of NV_DISPLAY_PATH_INFO -//! @{ -#define NV_DISPLAY_PATH_INFO_VER NV_DISPLAY_PATH_INFO_VER4 -#define NV_DISPLAY_PATH_INFO_VER4 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,4) -#define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,3) -#define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2) -#define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,1) -//! @} -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetViewEx -// -//! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView) -//! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes. -//! It also allows to modify or extend the source display in dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] pathCount Count of paths specified in pPathInfo. -//! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.") -NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView); - - - -/////////////////////////////////////////////////////////////////////////////// -// SetDisplayConfig/GetDisplayConfig -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol - -typedef struct _NV_POSITION -{ - NvS32 x; - NvS32 y; -} NV_POSITION; - -//! \ingroup dispcontrol -typedef struct _NV_RESOLUTION -{ - NvU32 width; - NvU32 height; - NvU32 colorDepth; -} NV_RESOLUTION; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 -{ - NvU32 version; - - // Rotation and Scaling - NV_ROTATE rotation; //!< (IN) rotation setting. - NV_SCALING scaling; //!< (IN) scaling setting. - - // Refresh Rate - NvU32 refreshRate1K; //!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored - //!< This is the value which driver reports to the OS. - // Flags - NvU32 interlaced:1; //!< (IN) Interlaced mode flag, ignored if refreshRate == 0 - NvU32 primary:1; //!< (IN) Declares primary display in clone configuration. This is *NOT* GDI Primary. - //!< Only one target can be primary per source. If no primary is specified, the first - //!< target will automatically be primary. -#ifdef NV_PAN_AND_SCAN_DEFINED - NvU32 isPanAndScanTarget:1; //!< Whether on this target Pan and Scan is enabled or has to be enabled. Valid only - //!< when the target is part of clone topology. -#else - NvU32 reservedBit1:1; -#endif - NvU32 disableVirtualModeSupport:1; - NvU32 isPreferredUnscaledTarget:1; - NvU32 reserved:27; - // TV format information - NV_GPU_CONNECTOR_TYPE connector; //!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE - NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE - //!< In case of NvAPI_DISP_GetDisplayConfig(), this field will indicate the currently applied TV format; - //!< if no TV format is applied, this field will have NV_DISPLAY_TV_FORMAT_NONE value. - //!< In case of NvAPI_DISP_SetDisplayConfig(), this field should only be set in case of TVs; - //!< for other displays this field will be ignored and resolution & refresh rate specified in input will be used to apply the TV format. - - // Backend (raster) timing standard - NV_TIMING_OVERRIDE timingOverride; //!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT - NV_TIMING timing; //!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST - //!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may - //!< tweak this value for HDTV, stereo, etc., before reporting it to the OS. -} NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1; - -//! \ingroup dispcontrol -typedef NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO; - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1,1) - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1 -{ - NvU32 displayId; //!< Display ID - NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display. -} NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 -{ - NvU32 displayId; //!< Display ID - NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required - NvU32 targetId; //!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored. -} NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2; - - -//! \ingroup dispcontrol -//! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO -typedef NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 NV_DISPLAYCONFIG_PATH_TARGET_INFO; - - -//! \ingroup dispcontrol -typedef enum _NV_DISPLAYCONFIG_SPANNING_ORIENTATION -{ - NV_DISPLAYCONFIG_SPAN_NONE = 0, - NV_DISPLAYCONFIG_SPAN_HORIZONTAL = 1, - NV_DISPLAYCONFIG_SPAN_VERTICAL = 2, -} NV_DISPLAYCONFIG_SPANNING_ORIENTATION; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 -{ - NV_RESOLUTION resolution; - NV_FORMAT colorFormat; //!< Ignored at present, must be NV_FORMAT_UNKNOWN (0) - NV_POSITION position; //!< Is all positions are 0 or invalid, displays will be automatically - //!< positioned from left to right with GDI Primary at 0,0, and all - //!< other displays in the order of the path array. - NV_DISPLAYCONFIG_SPANNING_ORIENTATION spanningOrientation; //!< Spanning is only supported on XP - NvU32 bGDIPrimary : 1; - NvU32 bSLIFocus : 1; - NvU32 reserved : 30; //!< Must be 0 -} NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1; - - - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V1 -{ - NvU32 version; - NvU32 reserved_sourceId; //!< This field is reserved. There is ongoing debate if we need this field. - //!< Identifies sourceIds used by Windows. If all sourceIds are 0, - //!< these will be computed automatically. - NvU32 targetInfoCount; //!< Number of elements in targetInfo array - NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1* targetInfo; - NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important -} NV_DISPLAYCONFIG_PATH_INFO_V1; - -//! \ingroup dispcontrol -//! This define is temporary and must be removed once DVS failure is fixed. -#define _NV_DISPLAYCONFIG_PATH_INFO_V2 _NV_DISPLAYCONFIG_PATH_INFO - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V2 -{ - NvU32 version; - union { - NvU32 sourceId; //!< Identifies sourceId used by Windows CCD. This can be optionally set. - NvU32 reserved_sourceId; //!< Only for compatibility - }; - - NvU32 targetInfoCount; //!< Number of elements in targetInfo array - NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2* targetInfo; - NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important - NvU32 IsNonNVIDIAAdapter : 1; //!< True for non-NVIDIA adapter. - NvU32 reserved : 31; //!< Must be 0 - void *pOSAdapterID; //!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID - //!< type, type casted to void *. -} NV_DISPLAYCONFIG_PATH_INFO_V2; - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V1,1) - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2,2) - -#ifndef NV_DISPLAYCONFIG_PATH_INFO_VER - -typedef NV_DISPLAYCONFIG_PATH_INFO_V2 NV_DISPLAYCONFIG_PATH_INFO; - -#define NV_DISPLAYCONFIG_PATH_INFO_VER NV_DISPLAYCONFIG_PATH_INFO_VER2 - -typedef NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 NV_DISPLAYCONFIG_SOURCE_MODE_INFO; - -#endif - - -//! \ingroup dispcontrol -typedef enum _NV_DISPLAYCONFIG_FLAGS -{ - NV_DISPLAYCONFIG_VALIDATE_ONLY = 0x00000001, - NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE = 0x00000002, - NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED = 0x00000004, //!< Driver reload is permitted if necessary - NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION = 0x00000008, //!< Refresh OS mode list. - NV_FORCE_COMMIT_VIDPN = 0x00000010, //!< Tell OS to avoid optimizing CommitVidPn call during a modeset -} NV_DISPLAYCONFIG_FLAGS; - - -#define NVAPI_UNICODE_STRING_MAX 2048 -#define NVAPI_BINARY_DATA_MAX 4096 - -typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX]; -typedef const NvU16 *NvAPI_LPCWSTR; - -// Common - - - -//! \ingroup gpuclock -//! @{ -#define NVAPI_MAX_GPU_CLOCKS 32 -#define NVAPI_MAX_GPU_PUBLIC_CLOCKS 32 -#define NVAPI_MAX_GPU_PERF_CLOCKS 32 -#define NVAPI_MAX_GPU_PERF_VOLTAGES 16 -#define NVAPI_MAX_GPU_PERF_PSTATES 16 -//! @} - -//! \ingroup gpuclock -typedef enum _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID -{ - NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE = 0, - NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED = NVAPI_MAX_GPU_PERF_VOLTAGES, -} NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID; - -//! \ingroup gpuclock -typedef enum _NV_GPU_PUBLIC_CLOCK_ID -{ - NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS = 0, - NVAPI_GPU_PUBLIC_CLOCK_MEMORY = 4, - NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR = 7, - NVAPI_GPU_PUBLIC_CLOCK_VIDEO = 8, - NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED = NVAPI_MAX_GPU_PUBLIC_CLOCKS, -} NV_GPU_PUBLIC_CLOCK_ID; - - -//! \addtogroup gpupstate -//! @{ - -typedef enum _NV_GPU_PERF_PSTATE_ID -{ - NVAPI_GPU_PERF_PSTATE_P0 = 0, - NVAPI_GPU_PERF_PSTATE_P1, - NVAPI_GPU_PERF_PSTATE_P2, - NVAPI_GPU_PERF_PSTATE_P3, - NVAPI_GPU_PERF_PSTATE_P4, - NVAPI_GPU_PERF_PSTATE_P5, - NVAPI_GPU_PERF_PSTATE_P6, - NVAPI_GPU_PERF_PSTATE_P7, - NVAPI_GPU_PERF_PSTATE_P8, - NVAPI_GPU_PERF_PSTATE_P9, - NVAPI_GPU_PERF_PSTATE_P10, - NVAPI_GPU_PERF_PSTATE_P11, - NVAPI_GPU_PERF_PSTATE_P12, - NVAPI_GPU_PERF_PSTATE_P13, - NVAPI_GPU_PERF_PSTATE_P14, - NVAPI_GPU_PERF_PSTATE_P15, - NVAPI_GPU_PERF_PSTATE_UNDEFINED = NVAPI_MAX_GPU_PERF_PSTATES, - NVAPI_GPU_PERF_PSTATE_ALL, - -} NV_GPU_PERF_PSTATE_ID; - -//! @} - - - -//! \addtogroup gpupstate -//! @{ - -#define NVAPI_MAX_GPU_PSTATE20_PSTATES 16 -#define NVAPI_MAX_GPU_PSTATE20_CLOCKS 8 -#define NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES 4 - -//! Used to identify clock type -typedef enum -{ - //! Clock domains that use single frequency value within given pstate - NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE = 0, - - //! Clock domains that allow range of frequency values within given pstate - NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE, -} NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID; - -//! Used to describe both voltage and frequency deltas -typedef struct -{ - //! Value of parameter delta (in respective units [kHz, uV]) - NvS32 value; - - struct - { - //! Min value allowed for parameter delta (in respective units [kHz, uV]) - NvS32 min; - - //! Max value allowed for parameter delta (in respective units [kHz, uV]) - NvS32 max; - } valueRange; -} NV_GPU_PERF_PSTATES20_PARAM_DELTA; - -//! Used to describe single clock entry -typedef struct -{ - //! ID of the clock domain - NV_GPU_PUBLIC_CLOCK_ID domainId; - - //! Clock type ID - NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID typeId; - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Current frequency delta from nominal settings in (kHz) - NV_GPU_PERF_PSTATES20_PARAM_DELTA freqDelta_kHz; - - //! Clock domain type dependant information - union - { - struct - { - //! Clock frequency within given pstate in (kHz) - NvU32 freq_kHz; - } single; - - struct - { - //! Min clock frequency within given pstate in (kHz) - NvU32 minFreq_kHz; - - //! Max clock frequency within given pstate in (kHz) - NvU32 maxFreq_kHz; - - //! Voltage domain ID and value range in (uV) required for this clock - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; - NvU32 minVoltage_uV; - NvU32 maxVoltage_uV; - } range; - } data; -} NV_GPU_PSTATE20_CLOCK_ENTRY_V1; - -//! Used to describe single base voltage entry -typedef struct -{ - //! ID of the voltage domain - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Current base voltage settings in [uV] - NvU32 volt_uV; - - NV_GPU_PERF_PSTATES20_PARAM_DELTA voltDelta_uV; // Current base voltage delta from nominal settings in [uV] -} NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1; - -//! Used in NvAPI_GPU_GetPstates20() interface call. - -typedef struct -{ - //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER) - NvU32 version; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Number of populated pstates - NvU32 numPstates; - - //! Number of populated clocks (per pstate) - NvU32 numClocks; - - //! Number of populated base voltages (per pstate) - NvU32 numBaseVoltages; - - //! Performance state (P-State) settings - //! Valid index range is 0 to numPstates-1 - struct - { - //! ID of the P-State - NV_GPU_PERF_PSTATE_ID pstateId; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Array of clock entries - //! Valid index range is 0 to numClocks-1 - NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS]; - - //! Array of baseVoltage entries - //! Valid index range is 0 to numBaseVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES]; -} NV_GPU_PERF_PSTATES20_INFO_V1; - -//! Used in NvAPI_GPU_GetPstates20() interface call. - -typedef struct _NV_GPU_PERF_PSTATES20_INFO_V2 -{ - //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER) - NvU32 version; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Number of populated pstates - NvU32 numPstates; - - //! Number of populated clocks (per pstate) - NvU32 numClocks; - - //! Number of populated base voltages (per pstate) - NvU32 numBaseVoltages; - - //! Performance state (P-State) settings - //! Valid index range is 0 to numPstates-1 - struct - { - //! ID of the P-State - NV_GPU_PERF_PSTATE_ID pstateId; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Array of clock entries - //! Valid index range is 0 to numClocks-1 - NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS]; - - //! Array of baseVoltage entries - //! Valid index range is 0 to numBaseVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES]; - - //! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality - //! Valid index range is 0 to numVoltages-1 - struct - { - //! Number of populated voltages - NvU32 numVoltages; - - //! Array of voltage entries - //! Valid index range is 0 to numVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 voltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } ov; -} NV_GPU_PERF_PSTATES20_INFO_V2; - -typedef NV_GPU_PERF_PSTATES20_INFO_V2 NV_GPU_PERF_PSTATES20_INFO; - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V1 -#define NV_GPU_PERF_PSTATES20_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V1,1) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2 -#define NV_GPU_PERF_PSTATES20_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,2) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2 -#define NV_GPU_PERF_PSTATES20_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,3) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO -#define NV_GPU_PERF_PSTATES20_INFO_VER NV_GPU_PERF_PSTATES20_INFO_VER3 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetDisplayDriverVersion -//! \fn NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion) -//! This function returns a struct that describes aspects of the display driver -//! build. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] hNvDisplay NVIDIA display handle. -//! \param [out] pVersion Pointer to NV_DISPLAY_DRIVER_VERSION struc -//! -//! \retval NVAPI_ERROR -//! \retval NVAPI_OK -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup driverapi -//! Used in NvAPI_GetDisplayDriverVersion() -typedef struct -{ - NvU32 version; // Structure version - NvU32 drvVersion; - NvU32 bldChangeListNum; - NvAPI_ShortString szBuildBranchString; - NvAPI_ShortString szAdapterString; -} NV_DISPLAY_DRIVER_VERSION; - -//! \ingroup driverapi -#define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1) - - -//! \ingroup driverapi -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.") -NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get] -// -//! \name NvAPI_OGL_ExpertModeSet[Get] Functions -//@{ -//! This function configures OpenGL Expert Mode, an API usage feedback and -//! advice reporting mechanism. The effects of this call are -//! applied only to the current context, and are reset to the -//! defaults when the context is destroyed. -//! -//! \note This feature is valid at runtime only when GLExpert -//! functionality has been built into the OpenGL driver -//! installed on the system. All Windows Vista OpenGL -//! drivers provided by NVIDIA have this instrumentation -//! included by default. Windows XP, however, requires a -//! special display driver available with the NVIDIA -//! PerfSDK found at developer.nvidia.com. -//! -//! \note These functions are valid only for the current OpenGL -//! context. Calling these functions prior to creating a -//! context and calling MakeCurrent with it will result -//! in errors and undefined behavior. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param expertDetailMask Mask made up of NVAPI_OGLEXPERT_DETAIL bits, -//! this parameter specifies the detail level in -//! the feedback stream. -//! -//! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits, -//! this parameter specifies the areas of -//! functional interest. -//! -//! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits, -//! this parameter specifies the feedback output -//! location. -//! -//! \param expertCallback Used in conjunction with OUTPUT_TO_CALLBACK, -//! this is a simple callback function the user -//! may use to obtain the feedback stream. The -//! function will be called once per fully -//! qualified feedback stream extry. -//! -//! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU found -//! \retval NVAPI_OPENGL_CONTEXT_NOT_CURRENT No NVIDIA OpenGL context -//! which supports GLExpert -//! has been made current -//! \retval NVAPI_ERROR OpenGL driver failed to load properly -//! \retval NVAPI_OK Success -// -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup oglapi -//! @{ -#define NVAPI_OGLEXPERT_DETAIL_NONE 0x00000000 -#define NVAPI_OGLEXPERT_DETAIL_ERROR 0x00000001 -#define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK 0x00000002 -#define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO 0x00000004 -#define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO 0x00000008 -#define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING 0x00000010 -#define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING 0x00000020 -#define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING 0x00000040 -#define NVAPI_OGLEXPERT_DETAIL_ALL 0xFFFFFFFF - -#define NVAPI_OGLEXPERT_REPORT_NONE 0x00000000 -#define NVAPI_OGLEXPERT_REPORT_ERROR 0x00000001 -#define NVAPI_OGLEXPERT_REPORT_SWFALLBACK 0x00000002 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX 0x00000004 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY 0x00000008 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB 0x00000010 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER 0x00000020 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT 0x00000040 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP 0x00000080 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL 0x00000200 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE 0x00000400 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT 0x00000800 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE 0x00001000 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM 0x00002000 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO 0x00004000 -#define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI 0x00008000 -#define NVAPI_OGLEXPERT_REPORT_ALL 0xFFFFFFFF - - -#define NVAPI_OGLEXPERT_OUTPUT_TO_NONE 0x00000000 -#define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE 0x00000001 -#define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER 0x00000004 -#define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK 0x00000008 -#define NVAPI_OGLEXPERT_OUTPUT_TO_ALL 0xFFFFFFFF - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK -// -//! DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple -//! callback function the user may use to obtain the feedback -//! stream. The function will be called once per fully qualified -//! feedback stream entry. -//! -//! \param categoryId Contains the bit from the NVAPI_OGLEXPERT_REPORT -//! mask that corresponds to the current message -//! \param messageId Unique ID for the current message -//! \param detailLevel Contains the bit from the NVAPI_OGLEXPERT_DETAIL -//! mask that corresponds to the current message -//! \param objectId Unique ID of the object that corresponds to the -//! current message -//! \param messageStr Text string from the current message -//! -//! \ingroup oglapi -/////////////////////////////////////////////////////////////////////////////// -typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr); - - - -//! \ingroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel, - NvU32 expertReportMask, - NvU32 expertOutputMask, - NVAPI_OGLEXPERT_CALLBACK expertCallback); - -//! \addtogroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel, - NvU32 *pExpertReportMask, - NvU32 *pExpertOutputMask, - NVAPI_OGLEXPERT_CALLBACK *pExpertCallback); - -//@} -/////////////////////////////////////////////////////////////////////////////// -// -//! \name NvAPI_OGL_ExpertModeDefaultsSet[Get] Functions -//! -//@{ -//! This function configures OpenGL Expert Mode global defaults. These settings -//! apply to any OpenGL application which starts up after these -//! values are applied (i.e. these settings *do not* apply to -//! currently running applications). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param expertDetailLevel Value which specifies the detail level in -//! the feedback stream. This is a mask made up -//! of NVAPI_OGLEXPERT_LEVEL bits. -//! -//! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits, -//! this parameter specifies the areas of -//! functional interest. -//! -//! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits, -//! this parameter specifies the feedback output -//! location. Note that using OUTPUT_TO_CALLBACK -//! here is meaningless and has no effect, but -//! using it will not cause an error. -//! -//! \return ::NVAPI_ERROR or ::NVAPI_OK -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel, - NvU32 expertReportMask, - NvU32 expertOutputMask); - -//! \addtogroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel, - NvU32 *pExpertReportMask, - NvU32 *pExpertOutputMask); -//@} - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumTCCPhysicalGPUs -// -//! This function returns an array of physical GPU handles that are in TCC Mode. -//! Each handle represents a physical GPU present in the system in TCC Mode. -//! That GPU may not be visible to the OS directly. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! NOTE: Handles enumerated by this API are only valid for NvAPIs that are tagged as TCC_SUPPORTED -//! If handle is passed to any other API, it will fail with NVAPI_INVALID_HANDLE -//! -//! For WDDM GPU handles please use NvAPI_EnumPhysicalGPUs() -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! \param [out] nvGPUHandle Physical GPU array that will contain all TCC Physical GPUs -//! \param [out] pGpuCount count represent the number of valid entries in nvGPUHandle -//! -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumTCCPhysicalGPUs( NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumLogicalGPUs -// -//! This function returns an array of logical GPU handles. -//! -//! Each handle represents one or more GPUs acting in concert as a single graphics device. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with logical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! \note All logical GPUs handles get invalidated on a GPU topology change, so the calling -//! application is required to renum the logical GPU handles to get latest physical handle -//! mapping after every GPU topology change activated by a call to NvAPI_SetGpuTopologies(). -//! -//! To detect if SLI rendering is enabled, use NvAPI_D3D_GetCurrentSLIState(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay -// -//! This function returns an array of physical GPU handles associated with the specified display. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! If the display corresponds to more than one physical GPU, the first GPU returned -//! is the one with the attached active output. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay -// -//! This function returns a physical GPU handle associated with the specified unattached display. -//! The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL. -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay -// -//! This function returns the logical GPU handle associated with the specified display. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! hNvDisp can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; pLogicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU -// -//! This function returns the logical GPU handle associated with specified physical GPU handle. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGPU is not valid; pLogicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU -// -//! This function returns the physical GPU handles associated with the specified logical GPU handle. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array hPhysicalGPU will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hLogicalGPU is not valid; hPhysicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_LOGICAL_GPU_HANDLE hLogicalGPU was not a logical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU,NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUFromGPUID -// -//! Do not use this function for new software development. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT gpuId is zero or pPhysicalGPU is NULL -//! \retval NVAPI_OK Handle was returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromGPUID(NvU32 gpuId, NvPhysicalGpuHandle *pPhysicalGPU); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetGPUIDfromPhysicalGPU -// -//! Do not use this function for new software development. -// -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL or invalid. Re-enumerate the GPU handles. -//! \retval NVAPI_OK Handle was returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetGPUIDfromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pGpuId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetShaderSubPipeCount -// -//! DESCRIPTION: This function retrieves the number of Shader SubPipes on the GPU -//! On newer architectures, this corresponds to the number of SM units -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT: pCount is NULL -//! \retval NVAPI_OK: *pCount is set -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetShaderSubPipeCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetGpuCoreCount -// -//! DESCRIPTION: Retrieves the total number of cores defined for a GPU. -//! Returns 0 on architectures that don't define GPU cores. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \retval ::NVAPI_INVALID_ARGUMENT pCount is NULL -//! \retval ::NVAPI_OK *pCount is set -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \retval ::NVAPI_NOT_SUPPORTED API call is not supported on current architecture -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllOutputs -// -//! This function returns set of all GPU-output identifiers as a bitmask. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pOutputsMask); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs -// -//! This function is the same as NvAPI_GPU_GetAllOutputs() but returns only the set of GPU output -//! identifiers that are connected to display devices. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs -// -//! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputs() but returns only the set of GPU-output -//! identifiers that can be selected in an SLI configuration. -//! NOTE: This function matches NvAPI_GPU_GetConnectedOutputs() -//! - On systems which are not SLI capable. -//! - If the queried GPU is not part of a valid SLI group. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - - - -//! \ingroup gpu -typedef enum -{ - NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0, - NV_MONITOR_CONN_TYPE_VGA, - NV_MONITOR_CONN_TYPE_COMPONENT, - NV_MONITOR_CONN_TYPE_SVIDEO, - NV_MONITOR_CONN_TYPE_HDMI, - NV_MONITOR_CONN_TYPE_DVI, - NV_MONITOR_CONN_TYPE_LVDS, - NV_MONITOR_CONN_TYPE_DP, - NV_MONITOR_CONN_TYPE_COMPOSITE, - NV_MONITOR_CONN_TYPE_UNKNOWN = -1 -} NV_MONITOR_CONN_TYPE; - - -//! \addtogroup gpu -//! @{ -#define NV_GPU_CONNECTED_IDS_FLAG_UNCACHED NV_BIT(0) //!< Get uncached connected devices -#define NV_GPU_CONNECTED_IDS_FLAG_SLI NV_BIT(1) //!< Get devices such that those can be selected in an SLI configuration -#define NV_GPU_CONNECTED_IDS_FLAG_LIDSTATE NV_BIT(2) //!< Get devices such that to reflect the Lid State -#define NV_GPU_CONNECTED_IDS_FLAG_FAKE NV_BIT(3) //!< Get devices that includes the fake connected monitors -#define NV_GPU_CONNECTED_IDS_FLAG_EXCLUDE_MST NV_BIT(4) //!< Excludes devices that are part of the multi stream topology. - -//! @} - -//! \ingroup gpu -typedef struct _NV_GPU_DISPLAYIDS -{ - NvU32 version; - NV_MONITOR_CONN_TYPE connectorType; //!< out: vga, tv, dvi, hdmi and dp. This is reserved for future use and clients should not rely on this information. Instead get the - //!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx - NvU32 displayId; //!< this is a unique identifier for each device - - NvU32 isDynamic : 1; //!< if bit is set then this display is part of MST topology and it's a dynamic - NvU32 isMultiStreamRootNode : 1; //!< if bit is set then this displayID belongs to a multi stream enabled connector(root node). Note that when multi stream is enabled and - //!< a single multi stream capable monitor is connected to it, the monitor will share the display id with the RootNode. - //!< When there is more than one monitor connected in a multi stream topology, then the root node will have a separate displayId. - NvU32 isActive : 1; //!< if bit is set then this display is being actively driven - NvU32 isCluster : 1; //!< if bit is set then this display is the representative display - NvU32 isOSVisible : 1; //!< if bit is set, then this display is reported to the OS - NvU32 isWFD : 1; //!< Deprecated. Will always return 0. - NvU32 isConnected : 1; //!< if bit is set, then this display is connected - - NvU32 reservedInternal : 10; //!< Do not use - NvU32 isPhysicallyConnected : 1; //!< if bit is set, then this display is a phycially connected display; Valid only when isConnected bit is set - NvU32 reserved : 14; //!< must be zero -} NV_GPU_DISPLAYIDS; - -//! \ingroup gpu -//! Macro for constructing the version field of ::_NV_GPU_DISPLAYIDS -#define NV_GPU_DISPLAYIDS_VER1 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,1) -#define NV_GPU_DISPLAYIDS_VER2 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,3) - -#define NV_GPU_DISPLAYIDS_VER NV_GPU_DISPLAYIDS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedDisplayIds -// -//! -//! DESCRIPTION: Due to space limitation NvAPI_GPU_GetConnectedOutputs can return maximum 32 devices, but -//! this is no longer true for DPMST. NvAPI_GPU_GetConnectedDisplayIds will return all -//! the connected display devices in the form of displayIds for the associated hPhysicalGpu. -//! This function can accept set of flags to request cached, uncached, sli and lid to get the connected devices. -//! Default value for flags will be cached . -//! -//! HOW TO USE: 1) for each PhysicalGpu, make a call to get the number of connected displayId's -//! using NvAPI_GPU_GetConnectedDisplayIds by passing the pDisplayIds as NULL -//! On call success: -//! -//! 2) If pDisplayIdCount is greater than 0, allocate memory based on pDisplayIdCount. Then make a call NvAPI_GPU_GetConnectedDisplayIds to populate DisplayIds. -//! However, if pDisplayIdCount is 0, do not make this call. -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] hPhysicalGpu - GPU selection -//! \param [in] flags - One or more defines from NV_GPU_CONNECTED_IDS_FLAG_* as valid flags. -//! \param [in,out] pDisplayIds - Pointer to an NV_GPU_DISPLAYIDS struct, each entry represents a one displayID and its attributes -//! \param [in] pDisplayIdCount - Number of displayId's. -//! -//! \retval NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pDisplayIds or pDisplayIdCount is NULL -//! \retval NVAPI_OK: *pDisplayIds contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetConnectedDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount, __in NvU32 flags); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllDisplayIds -// -//! DESCRIPTION: This API returns display IDs for all possible outputs on the GPU. -//! For DPMST connector, it will return display IDs for all the video sinks in the topology. \n -//! HOW TO USE: 1. The first call should be made to get the all display ID count. To get the display ID count, send in \n -//! a) hPhysicalGpu - a valid WDDM type GPU handle(enumerated using NvAPI_SYS_GetPhysicalGPUs()) as input, \n -//! b) pDisplayIds - NULL, as we just want to get the display ID count. \n -//! c) pDisplayIdCount - a valid pointer to NvU32, whose value is set to ZERO. \n -//! If all parameters are correct and this call is successful, this call will return the display ID's count. \n -//! 2. To get the display ID array, make the second call to NvAPI_GPU_GetAllDisplayIds() with \n -//! a) hPhysicalGpu - should be same value which was sent in first call, \n -//! b) pDisplayIds - pointer to the display ID array allocated by caller based on display ID count, \n -//! eg. malloc(sizeof(NV_GPU_DISPLAYIDS) * pDisplayIdCount). \n -//! c) pDisplayIdCount - a valid pointer to NvU32. This indicates for how many display IDs \n -//! the memory is allocated(pDisplayIds) by the caller. \n -//! If all parameters are correct and this call is successful, this call will return the display ID array and actual -//! display ID count (which was obtained in the first call to NvAPI_GPU_GetAllDisplayIds). If the input display ID count is -//! less than the actual display ID count, it will overwrite the input and give the pDisplayIdCount as actual count and the -//! API will return NVAPI_INSUFFICIENT_BUFFER. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu GPU selection. -//! \param [in,out] DisplayIds Pointer to an array of NV_GPU_DISPLAYIDS structures, each entry represents one displayID -//! and its attributes. -//! \param [in,out] pDisplayIdCount As input, this parameter indicates the number of display's id's for which caller has -//! allocated the memory. As output, it will return the actual number of display IDs. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INSUFFICIENT_BUFFER When the input buffer(pDisplayIds) is less than the actual number of display IDs, this API -//! will return NVAPI_INSUFFICIENT_BUFFER. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetAllDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState -// -//! This function is similar to NvAPI_GPU_GetConnectedOutputs(), and returns the connected display identifiers that are connected -//! as an output mask but unlike NvAPI_GPU_GetConnectedOutputs() this API "always" reflects the Lid State in the output mask. -//! Thus if you expect the LID close state to be available in the connection mask use this API. -//! - If LID is closed then this API will remove the LID panel from the connected display identifiers. -//! - If LID is open then this API will reflect the LID panel in the connected display identifiers. -//! -//! \note This API should be used on notebook systems and on systems where the LID state is required in the connection -//! output mask. On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs(). -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState -// -//! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputsWithLidState() but returns only the set -//! of GPU-output identifiers that can be selected in an SLI configuration. With SLI disabled, -//! this function matches NvAPI_GPU_GetConnectedOutputsWithLidState(). -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetSystemType -// -//! \fn NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType) -//! This function identifies whether the GPU is a notebook GPU or a desktop GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pSystemType contains the GPU system type -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetSystemType() -typedef enum -{ - NV_SYSTEM_TYPE_UNKNOWN = 0, - NV_SYSTEM_TYPE_LAPTOP = 1, - NV_SYSTEM_TYPE_DESKTOP = 2, - -} NV_SYSTEM_TYPE; - - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetActiveOutputs -// -//! This function is the same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU output -//! identifiers that are actively driving display devices. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_SetEDID -// -//! Thus function sets the EDID data for the specified GPU handle and connection bit mask. -//! User can either send (Gpu handle & output id) or only display Id in variable displayOutputId parameter & hPhysicalGpu parameter can be default handle (0). -//! \note The EDID will be cached across the boot session and will be enumerated to the OS in this call. -//! To remove the EDID set sizeofEDID to zero. -//! OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically. -//! -//! This feature will NOT be supported on the following boards: -//! - GeForce -//! - Quadro VX -//! - Tesla -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 100 -//! -//! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set -//! \retval NVAPI_OK *pEDID data was applied to the requested displayOutputId. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_NOT_SUPPORTED For the above mentioned GPUs -//! \retval NVAPI_INVALID_USER_PRIVILEGE The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetOutputType -// -//! \fn NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType) -//! This function returns the output type. User can either specify both 'physical GPU handle and outputId (exactly 1 bit set - see \ref handles)' or -//! a valid displayId in the outputId parameter. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \Version Earliest supported ForceWare version: 82.61 -//! -//! \retval NVAPI_INVALID_ARGUMENT outputId, pOutputType is NULL; or if outputId parameter is not displayId and either it has > 1 bit set or hPhysicalGpu is NULL. -//! \retval NVAPI_OK *pOutputType contains a NvGpuOutputType value -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! used in NvAPI_GPU_GetOutputType() -typedef enum _NV_GPU_OUTPUT_TYPE -{ - NVAPI_GPU_OUTPUT_UNKNOWN = 0, - NVAPI_GPU_OUTPUT_CRT = 1, //!< CRT display device - NVAPI_GPU_OUTPUT_DFP = 2, //!< Digital Flat Panel display device - NVAPI_GPU_OUTPUT_TV = 3, //!< TV display device -} NV_GPU_OUTPUT_TYPE; - - - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination -// -//! This function determines if a set of GPU outputs can be active -//! simultaneously. While a GPU may have outputs, typically they cannot -//! all be active at the same time due to internal resource sharing. -//! -//! Given a physical GPU handle and a mask of candidate outputs, this call -//! will return NVAPI_OK if all of the specified outputs can be driven -//! simultaneously. It will return NVAPI_INVALID_COMBINATION if they cannot. -//! -//! Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_OK Combination of outputs in outputsMask are valid (can be active simultaneously). -//! \retval NVAPI_INVALID_COMBINATION Combination of outputs in outputsMask are NOT valid. -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or outputsMask does not have at least 2 bits set. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetFullName -// -//! This function retrieves the full GPU name as an ASCII string - for example, "Quadro FX 1400". -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers -// -//! This function returns the PCI identifiers associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \param DeviceId The internal PCI device identifier for the GPU. -//! \param SubSystemId The internal PCI subsystem identifier for the GPU. -//! \param RevisionId The internal PCI device-specific revision identifier for the GPU. -//! \param ExtDeviceId The external PCI device identifier for the GPU. -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or an argument is NULL -//! \retval NVAPI_OK Arguments are populated with PCI identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pDeviceId,NvU32 *pSubSystemId,NvU32 *pRevisionId,NvU32 *pExtDeviceId); - - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetGPUType(). -typedef enum _NV_GPU_TYPE -{ - NV_SYSTEM_TYPE_GPU_UNKNOWN = 0, - NV_SYSTEM_TYPE_IGPU = 1, //!< Integrated GPU - NV_SYSTEM_TYPE_DGPU = 2, //!< Discrete GPU -} NV_GPU_TYPE; - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetGPUType -// -//! DESCRIPTION: This function returns the GPU type (integrated or discrete). -//! See ::NV_GPU_TYPE. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 173 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu -//! \retval NVAPI_OK *pGpuType contains the GPU type -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetGPUType(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_TYPE *pGpuType); - - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetBusType() -typedef enum _NV_GPU_BUS_TYPE -{ - NVAPI_GPU_BUS_TYPE_UNDEFINED = 0, - NVAPI_GPU_BUS_TYPE_PCI = 1, - NVAPI_GPU_BUS_TYPE_AGP = 2, - NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3, - NVAPI_GPU_BUS_TYPE_FPCI = 4, - NVAPI_GPU_BUS_TYPE_AXI = 5, -} NV_GPU_BUS_TYPE; -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusType -// -//! This function returns the type of bus associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusType is NULL. -//! \retval NVAPI_OK *pBusType contains bus identifier. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS_TYPE *pBusType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusId -// -//! DESCRIPTION: Returns the ID of the bus associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 167 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusId is NULL. -//! \retval NVAPI_OK *pBusId contains the bus ID. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusSlotId -// -//! DESCRIPTION: Returns the ID of the bus slot associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 167 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusSlotId is NULL. -//! \retval NVAPI_OK *pBusSlotId contains the bus slot ID. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetIRQ -// -//! This function returns the interrupt number associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pIRQ is NULL. -//! \retval NVAPI_OK *pIRQ contains interrupt number. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosRevision -// -//! This function returns the revision of the video BIOS associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL. -//! \retval NVAPI_OK *pBiosRevision contains revision number. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision -// -//! This function returns the OEM revision of the video BIOS associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL -//! \retval NVAPI_OK *pBiosRevision contains revision number -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString -// -//! This function returns the full video BIOS version string in the form of xx.xx.xx.xx.yy where -//! - xx numbers come from NvAPI_GPU_GetVbiosRevision() and -//! - yy comes from NvAPI_GPU_GetVbiosOEMRevision(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL. -//! \retval NVAPI_OK szBiosRevision contains version string. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu,NvAPI_ShortString szBiosRevision); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAGPAperture -// -//! This function returns the AGP aperture in megabytes. -//! -//! \deprecated Do not use this function - it is deprecated in release 455. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_NOT_SUPPORTED -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.") -NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate -// -//! This function returns the current AGP Rate (0 = AGP not present, 1 = 1x, 2 = 2x, etc.). -//! -//! \deprecated Do not use this function - it is deprecated in release 455. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_NOT_SUPPORTED -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.") -NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pRate); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth -// -//! This function returns the number of PCIE lanes being used for the PCIE interface -//! downstream from the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pWidth is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pWidth); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize -// -//! This function returns the physical size of framebuffer in KB. This does NOT include any -//! system RAM that may be dedicated for use by the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pSize is NULL -//! \retval NVAPI_OK Call successful -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize -// -//! This function returns the virtual size of framebuffer in KB. This includes the physical RAM plus any -//! system RAM that has been dedicated for use by the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pSize is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetQuadroStatus -// -//! This function retrieves the Quadro status for the GPU (1 if Quadro, 0 if GeForce) -//! -//! This API is deprecated and it is recommended to instead query -//! NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ support from the API -//! NvAPI_GPU_QueryWorkstationFeatureSupport. -//! \deprecated Do not use this function - it is deprecated in release 460. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 460.") -NVAPI_INTERFACE NvAPI_GPU_GetQuadroStatus(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pStatus); - - -//! \ingroup gpu -typedef struct _NV_BOARD_INFO -{ - NvU32 version; //!< structure version - NvU8 BoardNum[16]; //!< Board Serial Number - -}NV_BOARD_INFO_V1; - -#define NV_BOARD_INFO_VER1 MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1,1) -#ifndef NV_BOARD_INFO_VER -//! \ingroup gpu -typedef NV_BOARD_INFO_V1 NV_BOARD_INFO; -//! \ingroup gpu -//! \ingroup gpu -#define NV_BOARD_INFO_VER NV_BOARD_INFO_VER1 -#endif - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBoardInfo -// -//! DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM. -//! -//! \param [in] hPhysicalGpu Physical GPU Handle. -//! \param [in,out] NV_BOARD_INFO Board Information. -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE handle passed is not a physical GPU handle -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval ::NVAPI_INVALID_POINTER pBoardInfo is NULL -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of the INFO struct is not supported -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetRamBusWidth -// -//! This function returns the width of the GPU's RAM memory bus. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 100 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetRamBusWidth(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusWidth); - - - -//! Used in NvAPI_GPU_GetArchInfo() -typedef struct -{ - NvU32 version; - - NvU32 architecture; - NvU32 implementation; - NvU32 revision; - -} NV_GPU_ARCH_INFO_V1; - -//! NV_GPU_ARCH_INFO() values to identify Architecture level for the GPU. -typedef enum _NV_GPU_ARCHITECTURE_ID -{ - - NV_GPU_ARCHITECTURE_T2X = 0xE0000020, - NV_GPU_ARCHITECTURE_T3X = 0xE0000030, - NV_GPU_ARCHITECTURE_T4X = 0xE0000040, - NV_GPU_ARCHITECTURE_T12X = 0xE0000040, - NV_GPU_ARCHITECTURE_NV40 = 0x00000040, - NV_GPU_ARCHITECTURE_NV50 = 0x00000050, - NV_GPU_ARCHITECTURE_G78 = 0x00000060, - NV_GPU_ARCHITECTURE_G80 = 0x00000080, - NV_GPU_ARCHITECTURE_G90 = 0x00000090, - NV_GPU_ARCHITECTURE_GT200 = 0x000000A0, - NV_GPU_ARCHITECTURE_GF100 = 0x000000C0, - NV_GPU_ARCHITECTURE_GF110 = 0x000000D0, - NV_GPU_ARCHITECTURE_GK100 = 0x000000E0, - NV_GPU_ARCHITECTURE_GK110 = 0x000000F0, - NV_GPU_ARCHITECTURE_GK200 = 0x00000100, - NV_GPU_ARCHITECTURE_GM000 = 0x00000110, - NV_GPU_ARCHITECTURE_GM200 = 0x00000120, - NV_GPU_ARCHITECTURE_GP100 = 0x00000130, - NV_GPU_ARCHITECTURE_GV100 = 0x00000140, - NV_GPU_ARCHITECTURE_GV110 = 0x00000150, - NV_GPU_ARCHITECTURE_TU100 = 0x00000160, - NV_GPU_ARCHITECTURE_GA100 = 0x00000170, - NV_GPU_ARCHITECTURE_AD100 = 0x00000190, - -}NV_GPU_ARCHITECTURE_ID; - -//! NV_GPU_ARCH_INFO() values to identify GPU Architecture Implementation. -typedef enum _NV_GPU_ARCH_IMPLEMENTATION_ID -{ - - NV_GPU_ARCH_IMPLEMENTATION_T20 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_T30 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_T35 = 0x00000005, - - NV_GPU_ARCH_IMPLEMENTATION_T40 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_T124 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_NV40 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_NV41 = 0x00000001, - NV_GPU_ARCH_IMPLEMENTATION_NV42 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_NV43 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_NV44 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_NV44A = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_NV46 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_NV47 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_NV49 = 0x00000009, - NV_GPU_ARCH_IMPLEMENTATION_NV4B = 0x0000000B, - NV_GPU_ARCH_IMPLEMENTATION_NV4C = 0x0000000C, - NV_GPU_ARCH_IMPLEMENTATION_NV4E = 0x0000000E, - - NV_GPU_ARCH_IMPLEMENTATION_NV50 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_NV63 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_NV67 = 0x00000007, - - NV_GPU_ARCH_IMPLEMENTATION_G84 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_G86 = 0x00000006, - - NV_GPU_ARCH_IMPLEMENTATION_G92 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_G94 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_G96 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_G98 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GT200 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GT212 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GT214 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GT215 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_GT216 = 0x00000005, - NV_GPU_ARCH_IMPLEMENTATION_GT218 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_MCP77 = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_GT21C = 0x0000000B, - NV_GPU_ARCH_IMPLEMENTATION_MCP79 = 0x0000000C, - NV_GPU_ARCH_IMPLEMENTATION_GT21A = 0x0000000D, - NV_GPU_ARCH_IMPLEMENTATION_MCP89 = 0x0000000F, - - NV_GPU_ARCH_IMPLEMENTATION_GF100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GF104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GF106 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_GF108 = 0x00000001, - - NV_GPU_ARCH_IMPLEMENTATION_GF110 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GF116 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GF117 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GF118 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_GF119 = 0x00000009, - - NV_GPU_ARCH_IMPLEMENTATION_GK104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GK106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GK107 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GK20A = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_GK110 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_GK208 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GM204 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GM206 = 0x00000006, - - NV_GPU_ARCH_IMPLEMENTATION_GP100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GP000 = 0x00000001, - NV_GPU_ARCH_IMPLEMENTATION_GP102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GP104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GP106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GP107 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GP108 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GV100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GV10B = 0x0000000B, - - NV_GPU_ARCH_IMPLEMENTATION_TU100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_TU102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_TU104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_TU106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_TU116 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_TU117 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_TU000 = 0x00000001, - - NV_GPU_ARCH_IMPLEMENTATION_GA100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GA102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GA104 = 0x00000004, - - NV_GPU_ARCH_IMPLEMENTATION_AD102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_AD103 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_AD104 = 0x00000004, - -}NV_GPU_ARCH_IMPLEMENTATION_ID; - -typedef enum _NV_GPU_CHIP_REVISION -{ - NV_GPU_CHIP_REV_EMULATION_QT = 0x00000000, //!< QT chip - NV_GPU_CHIP_REV_EMULATION_FPGA = 0x00000001, //!< FPGA implementation of the chipset - NV_GPU_CHIP_REV_A01 = 0x00000011, //!< First silicon chipset revision - NV_GPU_CHIP_REV_A02 = 0x00000012, //!< Second Silicon chipset revision - NV_GPU_CHIP_REV_A03 = 0x00000013, //!< Third Silicon chipset revision - NV_GPU_CHIP_REV_UNKNOWN = 0xffffffff, //!< Unknown chip revision -}NV_GPU_CHIP_REVISION; - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetArchInfo() -typedef struct -{ - NvU32 version; - - union - { - NvU32 architecture; //!< architecture and architecture_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_ARCHITECTURE_ID architecture_id; //!< specifies the architecture level for the GPU. - }; - union - { - NvU32 implementation; //!< implementation and implementation_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_ARCH_IMPLEMENTATION_ID implementation_id; //!< specifies the implementation of the architecture for the GPU. - }; - union - { - NvU32 revision; //!< revision and revision_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_CHIP_REVISION revision_id; //!< specifies the architecture revision of the GPU. - }; - -} NV_GPU_ARCH_INFO_V2; - -//! \ingroup gpu -typedef NV_GPU_ARCH_INFO_V2 NV_GPU_ARCH_INFO; - -//! \ingroup gpu -#define NV_GPU_ARCH_INFO_VER_1 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V1,1) -#define NV_GPU_ARCH_INFO_VER_2 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V2,2) -#define NV_GPU_ARCH_INFO_VER NV_GPU_ARCH_INFO_VER_2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetArchInfo -// -//! \fn NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo) -//! This function retrieves the architecture, implementation and chip revision for the specified GPU . -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! \since Release: 85 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo); - - - -/////////////////////////////////////////////////////////////////////////////////// -// I2C API -// Provides ability to read or write data using I2C protocol. -// These APIs allow I2C access only to DDC monitors - - -//! \ingroup i2capi -//! @{ -#define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER 4096 -#define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS 4 -#define NVAPI_DISPLAY_DEVICE_MASK_MAX 24 -#define NVAPI_I2C_SPEED_DEPRECATED 0xFFFF - -typedef enum -{ - NVAPI_I2C_SPEED_DEFAULT, //!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting. - NVAPI_I2C_SPEED_3KHZ, - NVAPI_I2C_SPEED_10KHZ, - NVAPI_I2C_SPEED_33KHZ, - NVAPI_I2C_SPEED_100KHZ, - NVAPI_I2C_SPEED_200KHZ, - NVAPI_I2C_SPEED_400KHZ, -} NV_I2C_SPEED; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed). -} NV_I2C_INFO_V1; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED. - NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED). -} NV_I2C_INFO_V2; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED. - NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED). - NvU8 portId; //!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set) - //!< Optional for pre-Kepler - NvU32 bIsPortIdSet; //!< set this flag on if and only if portid value is set -} NV_I2C_INFO_V3; - -typedef NV_I2C_INFO_V3 NV_I2C_INFO; - -#define NV_I2C_INFO_VER3 MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3) -#define NV_I2C_INFO_VER2 MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2) -#define NV_I2C_INFO_VER1 MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1) - -#define NV_I2C_INFO_VER NV_I2C_INFO_VER3 -//! @} - -/***********************************************************************************/ - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_I2CRead -// -//! This function reads the data buffer from the I2C port. -//! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1. -//! -//! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case, -//! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned. -//! -//! If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in -//! the combined format described in the I2C specification. The register address will be written, followed by -//! reading into the data buffer. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [out] NV_I2C_INFO *pI2cInfo The I2C data input structure -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported. -//! \retval NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements -//! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum -//! -//! \ingroup i2capi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_I2CWrite -// -//! This function writes the data buffer to the I2C port. -//! -//! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1. -//! -//! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case, -//! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned. -//! -//! If a register address is specified (i.e. regAddrSize is positive), then the register address will be written -//! and the data buffer will immediately follow without a restart. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [in] pI2cInfo The I2C data input structure -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported. -//! \retval NVAPI_INVALID_ARGUMENT Argument does not meet specified requirements -//! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE Argument exceeds the maximum -//! -//! \ingroup i2capi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_WorkstationFeatureSetup -// -//! \fn NvAPI_GPU_WorkstationFeatureSetup(NvPhysicalGpuHandle hPhysicalGpu, NvU32 featureEnableMask, NvU32 featureDisableMask) -//! DESCRIPTION: This API configures the driver for a set of workstation features. -//! The driver can allocate the memory resources accordingly. -//! -//! SUPPORTED OS: Windows 7 -//! -//! -//! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved -//! using NvAPI_EnumPhysicalGPUs. A value of NULL is permitted and applies the same operation -//! to all GPU handles enumerated by NvAPI_EnumPhysicalGPUs. -//! \param [in] featureEnableMask Mask of features the caller requests to enable for use -//! \param [in] featureDisableMask Mask of features the caller requests to disable -//! -//! As a general rule, features in the enable and disable masks are expected to be disjoint, although the disable -//! mask has precedence and a feature flagged in both masks will be disabled. -//! -//! \retval ::NVAPI_OK configuration request succeeded -//! \retval ::NVAPI_ERROR configuration request failed -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle. -//! \retval ::NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE requested feature set does not have all resources allocated for completeness. -//! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to -//! keep compatibility with apps written against Win7. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef enum -{ - NVAPI_GPU_WORKSTATION_FEATURE_MASK_SWAPGROUP = 0x00000001, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_STEREO = 0x00000010, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_WARPING = 0x00000100, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_PIXINTENSITY = 0x00000200, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_GRAYSCALE = 0x00000400, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_BPC10 = 0x00001000 -} NVAPI_GPU_WORKSTATION_FEATURE_MASK; - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureSetup(__in NvPhysicalGpuHandle hPhysicalGpu, __in NvU32 featureEnableMask, __in NvU32 featureDisableMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_WorkstationFeatureQuery -// -//! DESCRIPTION: This API queries the current set of workstation features. -//! -//! SUPPORTED OS: Windows 7 -//! -//! -//! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved -//! using NvAPI_EnumPhysicalGPUs. -//! \param [out] pConfiguredFeatureMask Mask of features requested for use by client drivers -//! \param [out] pConsistentFeatureMask Mask of features that have all resources allocated for completeness. -//! -//! \retval ::NVAPI_OK configuration request succeeded -//! \retval ::NVAPI_ERROR configuration request failed -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle. -//! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to -//! keep compatibility with apps written against Win7. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhysicalGpu, __out_opt NvU32 *pConfiguredFeatureMask, __out_opt NvU32 *pConsistentFeatureMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus -// -//! \fn NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus) -//! DESCRIPTION: This function returns a GPU's HDCP support status. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 175 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION -// -//////////////////////////////////////////////////////////////////////////////// - - -//! \addtogroup gpu -//! @{ - - -//! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_FUSE_STATE -{ - NV_GPU_HDCP_FUSE_STATE_UNKNOWN = 0, - NV_GPU_HDCP_FUSE_STATE_DISABLED = 1, - NV_GPU_HDCP_FUSE_STATE_ENABLED = 2, -} NV_GPU_HDCP_FUSE_STATE; - - -//! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_KEY_SOURCE -{ - NV_GPU_HDCP_KEY_SOURCE_UNKNOWN = 0, - NV_GPU_HDCP_KEY_SOURCE_NONE = 1, - NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2, - NV_GPU_HDCP_KEY_SOURCE_SBIOS = 3, - NV_GPU_HDCP_KEY_SOURCE_I2C_ROM = 4, - NV_GPU_HDCP_KEY_SOURCE_FUSES = 5, -} NV_GPU_HDCP_KEY_SOURCE; - - -//! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE -{ - NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0, - NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT = 1, - NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2, -} NV_GPU_HDCP_KEY_SOURCE_STATE; - - -//! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus() -typedef struct -{ - NvU32 version; //! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS - NV_GPU_HDCP_FUSE_STATE hdcpFuseState; //! GPU's HDCP fuse state - NV_GPU_HDCP_KEY_SOURCE hdcpKeySource; //! GPU's HDCP key source - NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState; //! GPU's HDCP key source state -} NV_GPU_GET_HDCP_SUPPORT_STATUS; - - -//! Macro for constructing the version for structure NV_GPU_GET_HDCP_SUPPORT_STATUS -#define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS,1) - - -//! @} - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus); - - - - -//! \ingroup gpucuda -//! @{ - -//! defgroup nvcomp_gpu_top NVIDIA Compute GPU Topology Flags -//! @{ - -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE NV_BIT(0) //!< This is Read only GPU flag - Physics capable GPU. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE NV_BIT(1) //!< This is Read/Write GPU flag - Indicates GPU is already enabled for physics. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_DEDICATED NV_BIT(2) //!< This is Read only GPU flag - Physics enabled GPU which is *dedicated* for physics indicates - //!< this compute capable GPU was automatically made usable for Physx on CUDA. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED NV_BIT(3) //!< This is Read only GPU flag - Physics GPU which is recommended by the driver. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE NV_BIT(4) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE NV_BIT(16) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_DISABLED NV_BIT(17) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE NV_BIT(21) //!< This is Read only GPU flag - PhysX is able to use this GPU (PhysX is installed, etc) - -//! @} - -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 gpuCount; //!< Total number of compute-capable GPUs - - struct - { - NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle - NvU32 flags; //!< One or more flags from \ref nvcomp_gpu_top - - } computeGpus[NVAPI_MAX_GPU_PER_TOPOLOGY]; //!< Array of compute-capable physical GPUs. - -} NV_COMPUTE_GPU_TOPOLOGY_V1; - - -typedef struct _NV_COMPUTE_GPU -{ - NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle - NvU32 flags; //!< One or more flags from \ref nvcomp_gpu_top - -} NV_COMPUTE_GPU; - -typedef struct _NV_COMPUTE_GPU_TOPOLOGY_V2 -{ - NvU32 version; //!< Structure version - NvU32 gpuCount; //!< Size of array - NV_COMPUTE_GPU *computeGpus; //!< Array of compute-capable physical GPUs (allocate memory of size of Physical gpuCount of system). - -} NV_COMPUTE_GPU_TOPOLOGY_V2; - -//! Macro for constructing the version field of NV_COMPUTE_GPU_TOPOLOGY -#define NV_COMPUTE_GPU_TOPOLOGY_VER1 MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V1,1) - -#define NV_COMPUTE_GPU_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V2,2) -typedef NV_COMPUTE_GPU_TOPOLOGY_V2 NV_COMPUTE_GPU_TOPOLOGY; - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_CudaEnumComputeCapableGpus -// -//! DESCRIPTION: This API enumerates one or more compute-capable GPUs. -//! Note that this API is deprecated and should no longer be used for new software development. -//! \deprecated Do not use this function - it is deprecated in release 319. -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in,out] pComputeTopo Pointer to the structure NV_COMPUTE_GPU_TOPOLOGY. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! The gpuCount indicates if one or more compute-capable GPUs are found. -//! gpuCount >= 1 means atleast one compute-capable GPU is found. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported, initialize to NV_COMPUTE_GPU_TOPOLOGY_VER. -//! \retval ::NVAPI_ERROR Enumeration of the GPUs failed. Make sure at least one NVIDIA GPU exists in the system. -//! -//! \ingroup gpucuda -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 319.") -NVAPI_INTERFACE NvAPI_GPU_CudaEnumComputeCapableGpus(__inout NV_COMPUTE_GPU_TOPOLOGY *pComputeTopo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetTachReading -// -//! DESCRIPTION: This API retrieves the fan speed tachometer reading for the specified physical GPU. -//! -//! HOW TO USE: -//! - NvU32 Value = 0; -//! - ret = NvAPI_GPU_GetTachReading(hPhysicalGpu, &Value); -//! - On call success: -//! - Value contains the tachometer reading -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGpu GPU selection. -//! \param [out] pValue Pointer to a variable to get the tachometer reading -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_NOT_SUPPORTED - functionality not supported -//! \retval ::NVAPI_API_NOT_INTIALIZED - nvapi not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - invalid argument passed -//! \retval ::NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide) -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle -//! -//! \ingroup gpucooler -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCStatusInfo -// -//! \fn NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_STATUS_INFO *pECCStatusInfo); -//! DESCRIPTION: This function returns ECC memory status information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for which ECC -//! status information is to be retrieved. -//! \param [out] pECCStatusInfo A pointer to an ECC status structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup gpuecc -//! Used in NV_GPU_ECC_STATUS_INFO. -typedef enum _NV_ECC_CONFIGURATION -{ - NV_ECC_CONFIGURATION_NOT_SUPPORTED = 0, - NV_ECC_CONFIGURATION_DEFERRED, //!< Changes require a POST to take effect - NV_ECC_CONFIGURATION_IMMEDIATE, //!< Changes can optionally be made to take effect immediately -} NV_ECC_CONFIGURATION; - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCStatusInfo(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 isSupported : 1; //!< ECC memory feature support - NV_ECC_CONFIGURATION configurationOptions; //!< Supported ECC memory feature configuration options - NvU32 isEnabled : 1; //!< Active ECC memory setting -} NV_GPU_ECC_STATUS_INFO; - -//! \ingroup gpuecc -//! Macro for constructing the version field of NV_GPU_ECC_STATUS_INFO -#define NV_GPU_ECC_STATUS_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_STATUS_INFO,1) - -//! \ingroup gpuecc -NVAPI_INTERFACE NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_STATUS_INFO *pECCStatusInfo); - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCErrorInfo()/ -typedef struct -{ - NvU32 version; //!< Structure version - struct - { - NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last boot - NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last boot - } current; - struct - { - NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last counter reset - NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last counter reset - } aggregate; -} NV_GPU_ECC_ERROR_INFO; - -//! \ingroup gpuecc -//! Macro for constructing the version field of NV_GPU_ECC_ERROR_INFO -#define NV_GPU_ECC_ERROR_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_ERROR_INFO,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCErrorInfo -// -//! \fn NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_ERROR_INFO *pECCErrorInfo); -//! -//! DESCRIPTION: This function returns ECC memory error information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC error information is to be -//! retrieved. -//! \param [out] pECCErrorInfo A pointer to an ECC error structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_ARGUMENT incorrect param value -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION structure version is not supported, initialize to NV_GPU_ECC_ERROR_INFO_VER. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup gpuecc - -NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_ERROR_INFO *pECCErrorInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_ResetECCErrorInfo -// -//! DESCRIPTION: This function resets ECC memory error counters. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \requires Administrator privileges since release 430.39 -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC error information is to be -//! cleared. -//! \param [in] bResetCurrent Reset the current ECC error counters. -//! \param [in] bResetAggregate Reset the aggregate ECC error counters. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gpuecc -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bResetCurrent, - NvU8 bResetAggregate); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCConfigurationInfo -// -//! \fn NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo); -//! DESCRIPTION: This function returns ECC memory configuration information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC configuration information -//! is to be retrieved. -//! \param [out] pECCConfigurationInfo A pointer to an ECC -//! configuration structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCConfigurationInfo(). -typedef struct -{ - NvU32 version; //! Structure version - NvU32 isEnabled : 1; //! Current ECC configuration stored in non-volatile memory - NvU32 isEnabledByDefault : 1; //! Factory default ECC configuration (static) -} NV_GPU_ECC_CONFIGURATION_INFO; - -//! \ingroup gpuecc -//! Macro for consstructing the verion field of NV_GPU_ECC_CONFIGURATION_INFO -#define NV_GPU_ECC_CONFIGURATION_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_CONFIGURATION_INFO,1) - -//! \ingroup gpuecc -NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_SetECCConfiguration -// -//! DESCRIPTION: This function updates the ECC memory configuration setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \requires Administrator privileges since release 430.39 -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which to update the ECC configuration -//! setting. -//! \param [in] bEnable The new ECC configuration setting. -//! \param [in] bEnableImmediately Request that the new setting take effect immediately. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_CONFIGURATION - Possibly SLI is enabled. Disable SLI and retry. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gpuecc -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetECCConfiguration(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bEnable, - NvU8 bEnableImmediately); - - - -// The following enum is providing definitions for events signaled by a Quadro Sync (QSYNC) device. -// QSYNC event broadcast is supported for Windows 10 and later OS. -typedef enum -{ - NV_QSYNC_EVENT_NONE = 0, - NV_QSYNC_EVENT_SYNC_LOSS = 1, // Frame Lock sync loss event - NV_QSYNC_EVENT_SYNC_GAIN = 2, // Frame Lock sync gain event - NV_QSYNC_EVENT_HOUSESYNC_GAIN = 3, // House cable gain(plug in) event - NV_QSYNC_EVENT_HOUSESYNC_LOSS = 4, // House cable loss(plug out) event - NV_QSYNC_EVENT_RJ45_GAIN = 5, // RJ45 cable gain(plug in) event - NV_QSYNC_EVENT_RJ45_LOSS = 6, // RJ45 cable loss(plug out) event -} NV_QSYNC_EVENT; - -typedef struct -{ - NV_QSYNC_EVENT qsyncEvent; // One of the value of the enum NV_QSYNC_EVENT - NvU32 reserved[7]; // Reserved for future use. Do not use this. -} NV_QSYNC_EVENT_DATA; - -//! Callback for QSYNC event -typedef void(__cdecl *NVAPI_CALLBACK_QSYNCEVENT)(NV_QSYNC_EVENT_DATA qyncEventData, void *callbackParam); - - -//! Enum for Event IDs -typedef enum -{ - NV_EVENT_TYPE_NONE = 0, - NV_EVENT_TYPE_QSYNC = 6, -} NV_EVENT_TYPE; - -//! Core NV_EVENT_REGISTER_CALLBACK structure declaration -typedef struct -{ - NvU32 version; //!< version field to ensure minimum version compatibility - NV_EVENT_TYPE eventId; //!< ID of the event being sent - void *callbackParam; //!< This value will be passed back to the callback function when an event occurs - union - { - NVAPI_CALLBACK_QSYNCEVENT nvQSYNCEventCallback; //!< Callback function pointer for QSYNC events - }nvCallBackFunc; - -} NV_EVENT_REGISTER_CALLBACK, *PNV_EVENT_REGISTER_CALLBACK; - -//! Macro for constructing the version field of ::NV_EVENT_REGISTER_CALLBACK -#define NV_EVENT_REGISTER_CALLBACK_VERSION MAKE_NVAPI_VERSION(NV_EVENT_REGISTER_CALLBACK,1) - - -//! \ingroup gpu -typedef enum _NV_GPU_WORKSTATION_FEATURE_TYPE -{ - NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY = 1, //!< NVIDIA RTX VR Ready - NV_GPU_WORKSTATION_FEATURE_TYPE_QUADRO_VR_READY = NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY, //!< DEPRECATED name - do not use - NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ = 2, -} NV_GPU_WORKSTATION_FEATURE_TYPE; - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_QueryWorkstationFeatureSupport -// -//! \fn NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature) -//! \code -//! DESCRIPTION: Indicates whether a queried workstation feature is supported by the requested GPU. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 440 -//! -//! DESCRIPTION: This API, when called with a valid physical gpu handle as Input, lets caller know whether the given workstation feature is supported by this GPU. -//! -//! PARAMETERS: physicalGpu(IN) : The handle of the GPU for the which caller wants to get the support information. -//! gpuWorkstationFeature(IN ) : The feature for the GPU in question. One of the values from enum NV_GPU_WORKSTATION_FEATURE_TYPE. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status listed below -//! -//! \retval ::NVAPI_OK the queried workstation feature is supported on the given GPU. -//! \retval ::NVAPI_NO_IMPLEMENTATION the current driver doesn't support this interface. -//! \retval ::NVAPI_INVALID_HANDLE the incoming physicalGpu handle is invalid. -//! \retval ::NVAPI_NOT_SUPPORTED the requested gpuWorkstationFeature is not supported in the selected GPU. -//! \retval ::NVAPI_SETTING_NOT_FOUND the requested gpuWorkstationFeature is unknown to the current driver version. -//! -//! \endcode -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature); - - - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - NvU32 width; //!< width of the input texture - NvU32 height; //!< height of the input texture - float* blendingTexture; //!< array of floating values building an intensity RGB texture -} NV_SCANOUT_INTENSITY_DATA_V1; - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - NvU32 width; //!< width of the input texture - NvU32 height; //!< height of the input texture - float* blendingTexture; //!< array of floating values building an intensity RGB texture - float* offsetTexture; //!< array of floating values building an offset texture - NvU32 offsetTexChannels; //!< number of channels per pixel in the offset texture -} NV_SCANOUT_INTENSITY_DATA_V2; - -typedef NV_SCANOUT_INTENSITY_DATA_V2 NV_SCANOUT_INTENSITY_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_INTENSITY_DATA_VER1 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V1, 1) -#define NV_SCANOUT_INTENSITY_DATA_VER2 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V2, 2) -#define NV_SCANOUT_INTENSITY_DATA_VER NV_SCANOUT_INTENSITY_DATA_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutIntensity -// -//! DESCRIPTION: This API enables and sets up per-pixel intensity feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to apply the intensity control. -//! \param [in] scanoutIntensityData the intensity texture info. -//! \param [out] pbSticky(OUT) indicates whether the settings will be kept over a reboot. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetScanoutIntensity(NvU32 displayId, NV_SCANOUT_INTENSITY_DATA* scanoutIntensityData, int *pbSticky); - - -//! \ingroup gpu -typedef struct _NV_SCANOUT_INTENSITY_STATE_DATA -{ - NvU32 version; //!< version of this structure - NvU32 bEnabled; //!< intensity is enabled or not -} NV_SCANOUT_INTENSITY_STATE_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_INTENSITY_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_STATE_DATA, 1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutIntensityState -// -//! DESCRIPTION: This API queries current state of the intensity feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] scanoutIntensityStateData intensity state data. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutIntensityState(__in NvU32 displayId, __inout NV_SCANOUT_INTENSITY_STATE_DATA* scanoutIntensityStateData); - - -//! \ingroup gpu -typedef enum -{ - NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ = 0, - NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ = 1, -} NV_GPU_WARPING_VERTICE_FORMAT; - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - float* vertices; //!< width of the input texture - NV_GPU_WARPING_VERTICE_FORMAT vertexFormat; //!< format of the input vertices - int numVertices; //!< number of the input vertices - NvSBox* textureRect; //!< rectangle in desktop coordinates describing the source area for the warping -} NV_SCANOUT_WARPING_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_WARPING_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_DATA, 1) - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutWarping -// -//! DESCRIPTION: This API enables and sets up the warping feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control -//! \param [in] scanoutWarpingData The warping data info -//! \param [out] pbSticky Indicates whether the settings will be kept over a reboot. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_WARPING_DATA structure version mismatch. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_GPU_SetScanoutWarping(NvU32 displayId, NV_SCANOUT_WARPING_DATA* scanoutWarpingData, int* piMaxNumVertices, int* pbSticky); - - -//! \ingroup gpu -typedef struct _NV_SCANOUT_WARPING_STATE_DATA -{ - NvU32 version; //!< version of this structure - NvU32 bEnabled; //!< warping is enabled or not -} NV_SCANOUT_WARPING_STATE_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_WARPING_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_STATE_DATA, 1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutWarpingState -// -//! DESCRIPTION: This API queries current state of the warping feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] scanoutWarpingStateData warping state data. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutWarpingState(__in NvU32 displayId, __inout NV_SCANOUT_WARPING_STATE_DATA* scanoutWarpingStateData); - -typedef enum -{ - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_WARPING_RESAMPLING_METHOD = 0 -} NV_GPU_SCANOUT_COMPOSITION_PARAMETER; - -//! This enum defines a collection of possible scanout composition values that can be used to configure -//! possible scanout composition settings. (Currently the only parameter defined is the WARPING_RESAMPLING_METHOD). -typedef enum -{ - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SET_TO_DEFAULT = 0, // Set parameter to default value. - // WARPING_RESAMPLING_METHOD section: - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BILINEAR = 0x100, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_TRIANGULAR = 0x101, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BELL_SHAPED = 0x102, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BSPLINE = 0x103, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_TRIANGULAR = 0x104, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BELL_SHAPED = 0x105, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BSPLINE = 0x106 -} NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutCompositionParameter -// -//! DESCRIPTION: This API sets various parameters that configure the scanout composition feature on the specified display. -//! (currently there is only one configurable parameter defined: WARPING_RESAMPLING_METHOD, -//! but this function is designed to support the addition of parameters as needed.) -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control -//! \param [in] parameter The scanout composition parameter to be set -//! \param [in] parameterValue The data to be set for the specified parameter -//! \param [in] pContainer Additional container for data associated with the specified parameter -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_GPU_SetScanoutCompositionParameter(NvU32 displayId, NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE parameterValue, float *pContainer); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutCompositionParameter -// -//! DESCRIPTION: This API queries current state of one of the various scanout composition parameters on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in] parameter scanout composition parameter to by queried. -//! \param [out] parameterData scanout composition parameter data. -//! \param [out] pContainer Additional container for returning data associated with the specified parameter -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutCompositionParameter(__in NvU32 displayId, __in NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter, - __out NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE *parameterData, __out float *pContainer); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutConfiguration -// -//! DESCRIPTION: This API queries the desktop and scanout portion of the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] desktopRect desktop area of the display in desktop coordinates. -//! \param [in,out] scanoutRect scanout area of the display relative to desktopRect. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfiguration(NvU32 displayId, NvSBox* desktopRect, NvSBox* scanoutRect); - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetScanoutConfigurationEx(). -typedef struct _NV_SCANOUT_INFORMATION -{ - NvU32 version; //!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER. - - NvSBox sourceDesktopRect; //!< Operating system display device rect in desktop coordinates displayId is scanning out from. - NvSBox sourceViewportRect; //!< Area inside the sourceDesktopRect which is scanned out to the display. - NvSBox targetViewportRect; //!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to. - NvU32 targetDisplayWidth; //!< Horizontal size of the active resolution scanned out to the display. - NvU32 targetDisplayHeight; //!< Vertical size of the active resolution scanned out to the display. - NvU32 cloneImportance; //!< If targets are cloned views of the sourceDesktopRect the cloned targets have an importance assigned (0:primary,1 secondary,...). - NV_ROTATE sourceToTargetRotation; //!< Rotation performed between the sourceViewportRect and the targetViewportRect. -} NV_SCANOUT_INFORMATION; - -#define NV_SCANOUT_INFORMATION_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INFORMATION,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutConfigurationEx -// -//! DESCRIPTION: This API queries the desktop and scanout portion of the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 331 -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] pScanoutInformation desktop area to displayId mapping information. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfigurationEx(__in NvU32 displayId, __inout NV_SCANOUT_INFORMATION *pScanoutInformation); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAdapterIdFromPhysicalGpu -// -//! DESCRIPTION: This API returns the OS-AdapterID from physicalGpu Handle. OS-AdapterID -//! is the Adapter ID that is used by Win7 CCD APIs. -//! This API is deprecated. Please use NvAPI_GPU_GetLogicalGpuInfo to get the OS-AdapterID. -//! NvAPI_GetLogicalGPUFromPhysicalGPU can be used to get the logical GPU handle associated with specified physical GPU handle. -//! -//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetLogicalGpuInfo. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu PhysicalGpu Handle -//! \param [out] pOSAdapterId Returns OS-AdapterId, it is typed as void * to -//! avoid dependency with windows.h. User must type cast it to LUID. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT pOSAdapterId is NULL; hPhysicalGpu is invalid -//! \retval ::NVAPI_OK *pOSAdapterId contains valid data. -//! \retval ::NVAPI_NOT_SUPPORTED This API is not supported on the system. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetLogicalGpuInfo.") -NVAPI_INTERFACE NvAPI_GPU_GetAdapterIdFromPhysicalGpu(NvPhysicalGpuHandle hPhysicalGpu, void *pOSAdapterId); - - - - -//! \ingroup gpu -typedef enum _NV_VIRTUALIZATION_MODE -{ - NV_VIRTUALIZATION_MODE_NONE = 0, //!< Represents Bare Metal GPU - NV_VIRTUALIZATION_MODE_NMOS = 1, //!< Represents GPU-Passthrough - NV_VIRTUALIZATION_MODE_VGX = 2, //!< Represents vGPU inside virtual machine - NV_VIRTUALIZATION_MODE_HOST_VGPU = 3 //!< Represents VGX hypervisor in vGPU mode -} NV_VIRTUALIZATION_MODE; - -//! \ingroup gpu -typedef struct _NV_GPU_VIRTUALIZATION_INFO -{ - NvU32 version; //!< Structure version - - NV_VIRTUALIZATION_MODE virtualizationMode; //!< one of NV_VIRTUALIZATION_MODE. - NvU32 reserved; //!< reserved for future use. Should be set to ZERO. -} NV_GPU_VIRTUALIZATION_INFO_V1; - -//! \ingroup gpu -typedef NV_GPU_VIRTUALIZATION_INFO_V1 NV_GPU_VIRTUALIZATION_INFO; - -//! \ingroup gpu -#define NV_GPU_VIRTUALIZATION_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_VIRTUALIZATION_INFO_V1,1) - -//! \ingroup gpu -#define NV_GPU_VIRTUALIZATION_INFO_VER NV_GPU_VIRTUALIZATION_INFO_VER1 - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_GetVirtualizationInfo -//! -//! DESCRIPTION: This API returns virtualization information of the GPU -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 367 -//! -//! \param [in,out] pVirtualizationInfo Pointer to NV_GPU_VIRTUALIZATION_INFO structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVirtualizationInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VIRTUALIZATION_INFO *pVirtualizationInfo); - - -//! \ingroup gpu -typedef struct _NV_LOGICAL_GPU_DATA_V1 -{ - NvU32 version; //!< [in] Structure version. - void *pOSAdapterId; //!< [out] Returns OS-AdapterId. User must send memory buffer of size atleast equal to the size of LUID structure before calling the NVAPI. - NvU32 physicalGpuCount; //!< [out] Number of physical GPU handles associated with the specified logical GPU handle. - - NvPhysicalGpuHandle physicalGpuHandles[NVAPI_MAX_PHYSICAL_GPUS]; //!< [out] This array will be filled with physical GPU handles associated with the given logical GPU handle. - //!< The array index refers to the Physical Gpu Index (Idx). - //!< Idx value is the same as D3D11 MultiGPUDevice GPU index, D3D12 node index, OpenGL GL_NV_gpu_multicast GPU index. - //!< When converted to a bit mask (1 << Idx), it matches: - //!< 1. Vulkan deviceNodeMask in VkPhysicalDeviceIDProperties - //!< 2. CUDA deviceNodeMask returned by cuDeviceGetLuid - NvU32 reserved[8]; //!< Reserved for future use. Should be set to ZERO. -} NV_LOGICAL_GPU_DATA_V1; - -//! \ingroup gpu -typedef NV_LOGICAL_GPU_DATA_V1 NV_LOGICAL_GPU_DATA; -#define NV_LOGICAL_GPU_DATA_VER1 MAKE_NVAPI_VERSION(NV_LOGICAL_GPU_DATA_V1,1) -#define NV_LOGICAL_GPU_DATA_VER NV_LOGICAL_GPU_DATA_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetLogicalGpuInfo -// -//! This function is used to query Logical GPU information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 421 -//! -//! \param [in] hLogicalGpu logical GPU Handle. -//! \param [in,out] pLogicalGpuData Pointer to NV_LOGICAL_GPU_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetLogicalGpuInfo(__in NvLogicalGpuHandle hLogicalGpu, __inout NV_LOGICAL_GPU_DATA *pLogicalGpuData); - - -//! \ingroup gridlicense -//! @{ - -//! Maximum number of supported Feature License -#define NV_LICENSE_MAX_COUNT 3 - -//! Signature length for GRID License -#define NV_LICENSE_SIGNATURE_SIZE (128) - -//! Length for Grid License -#define NV_LICENSE_INFO_MAX_LENGTH (128) - -//! License string -typedef char NvAPI_LicenseString[NV_LICENSE_INFO_MAX_LENGTH]; - -//! Used in NV_LICENSE_FEATURE_DETAILS -typedef enum _NV_LICENSE_FEATURE_TYPE -{ - NV_LICENSE_FEATURE_UNKNOWN = 0, - NV_LICENSE_FEATURE_VGPU = 1, - NV_LICENSE_FEATURE_NVIDIA_RTX = 2, - NV_LICENSE_FEATURE_QUADRO = NV_LICENSE_FEATURE_NVIDIA_RTX, //!< DEPRECATED name - do not use - NV_LICENSE_FEATURE_GAMING = 3, - NV_LICENSE_FEATURE_COMPUTE = 4, -} NV_LICENSE_FEATURE_TYPE; - -//! Used in NV_LICENSE_FEATURE_DETAILS -//! -//!< The 'status' variable holds any one of the following license expiry status codes : -//!< 0 - Expiry information not available -//!< 1 - Invalid expiry or error fetching expiry -//!< 2 - Valid expiry -//!< 3 - Expiry not applicable -//!< 4 - Permanent expiry -typedef struct _NV_LICENSE_EXPIRY_DETAILS -{ - NvU32 year; //!< Year value of license expiry - NvU16 month; //!< Month value of license expiry - NvU16 day; //!< Day value of license expiry - NvU16 hour; //!< Hour value of license expiry - NvU16 min; //!< Minutes value of license expiry - NvU16 sec; //!< Seconds value of license expiry - - NvU8 status; //!< License expiry status -}NV_LICENSE_EXPIRY_DETAILS; - -//! Used in NV_LICENSABLE_FEATURES -typedef struct _NV_LICENSE_FEATURE_DETAILS_V1 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isEnabled : 1; //!< The current state of the licensed feature, true=enabled, false=disabled. - NvU32 reserved : 31; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated -}NV_LICENSE_FEATURE_DETAILS_V1; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V2 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of the licensed feature, true=enabled, false=disabled. - NvU32 reserved : 31; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. -}NV_LICENSE_FEATURE_DETAILS_V2; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V3 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of license, true=licensed, false=unlicensed. - NvU32 isFeatureEnabled : 1; //!< The current state of feature, true=enabled, false=disabled. - NvU32 reserved : 30; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. -}NV_LICENSE_FEATURE_DETAILS_V3; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V4 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of license, true=licensed, false=unlicensed. - NvU32 isFeatureEnabled : 1; //!< The current state of feature, true=enabled, false=disabled. - NvU32 reserved : 30; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. - NV_LICENSE_EXPIRY_DETAILS licenseExpiry; //!< License expiry information. -}NV_LICENSE_FEATURE_DETAILS_V4; - -typedef NV_LICENSE_FEATURE_DETAILS_V1 NV_LICENSE_FEATURE_DETAILS; - -#define NV_LICENSE_FEATURE_DETAILS_VER1 MAKE_NVAPI_VERSION(NV_LICENSE_FEATURE_DETAILS_V1, 1) -#define NV_LICENSE_FEATURE_DETAILS_VER NV_LICENSE_FEATURE_DETAILS_VER1 - -//! Licensable features -typedef struct _NV_LICENSABLE_FEATURES_V1 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V1 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V1; - -typedef struct _NV_LICENSABLE_FEATURES_V2 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V2 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V2; - -typedef struct _NV_LICENSABLE_FEATURES_V3 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V3 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V3; - -typedef struct _NV_LICENSABLE_FEATURES_V4 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V4 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V4; - -typedef NV_LICENSABLE_FEATURES_V4 NV_LICENSABLE_FEATURES; - -#define NV_LICENSABLE_FEATURES_VER1 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V1, 1) -#define NV_LICENSABLE_FEATURES_VER2 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V2, 2) -#define NV_LICENSABLE_FEATURES_VER3 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V3, 3) -#define NV_LICENSABLE_FEATURES_VER4 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V4, 4) -#define NV_LICENSABLE_FEATURES_VER NV_LICENSABLE_FEATURES_VER4 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetLicensableFeatures -// -//! DESCRIPTION: This function call identifies whether licenses are supported on this system and if -//! they are supported, returns the details of the features that can be licensed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGpu GPU selection -//! \param [in,out] pLicensableFeatures Licensable features information. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup gridlicense -///////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetLicensableFeatures(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_LICENSABLE_FEATURES *pLicensableFeatures); - - -#define NVAPI_NVLINK_COUNTER_MAX_TYPES 32 -#define NVAPI_NVLINK_MAX_LINKS 32 - -//! \ingroup nvlink -//! @{ -//! Used in NvAPI_GPU_NVLINK_GetCaps() - -/* caps format is byte_index:bit_mask */ -#define NVAPI_NVLINK_CAPS_SUPPORTED 0x00000001 //!< Set if NVLink is present and supported on this GPU.This field is used for *global* caps only and NOT for per-link caps -#define NVAPI_NVLINK_CAPS_P2P_SUPPORTED 0x00000002 //!< Set if P2P over NVLink is supported on this GPU. -#define NVAPI_NVLINK_CAPS_SYSMEM_ACCESS 0x00000004 //!< Set if sysmem can be accessed over NVLink on this GPU. -#define NVAPI_NVLINK_CAPS_P2P_ATOMICS 0x00000008 //!< Set if P2P atomics are supported over NVLink on this GPU. -#define NVAPI_NVLINK_CAPS_SYSMEM_ATOMICS 0x00000010 //!< Set if sysmem atomic transcations are supported over NVLink on this GPU. -#define NVAPI_NVLINK_CAPS_PEX_TUNNELING 0x00000020 //!< Set if PEX tunneling over NVLink is supported on this GPU. -#define NVAPI_NVLINK_CAPS_SLI_BRIDGE 0x00000040 //!< Set if SLI over NVLink is supported on this GPU. -#define NVAPI_NVLINK_CAPS_SLI_BRIDGE_SENSABLE 0x00000080 //!< This bit is set if capable of sensing SLI bridges. -#define NVAPI_NVLINK_CAPS_POWER_STATE_L0 0x00000100 //!< This bit is set if L0 is a supported power state on this GPU. -#define NVAPI_NVLINK_CAPS_POWER_STATE_L1 0x00000200 //!< This bit is set if L1 is a supported power state on this GPU. -#define NVAPI_NVLINK_CAPS_POWER_STATE_L2 0x00000400 //!< This bit is set if L2 is a supported power state on this GPU. -#define NVAPI_NVLINK_CAPS_POWER_STATE_L3 0x00000800 //!< This bit is set if L3 is a supported power state on this GPU. - -#define NVAPI_NVLINK_CAPS_VALID 0x00001000 //!< Set if this link is supported on this GPU.This field is used for *per-link* caps only and NOT for global caps. - -#define NVAPI_NVLINK_CAPS_NVLINK_VERSION_INVALID (0x00000000) -#define NVAPI_NVLINK_CAPS_NVLINK_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_CAPS_NVLINK_VERSION_2_0 (0x00000002) - -#define NVAPI_NVLINK_CAPS_NCI_VERSION_INVALID (0x00000000) -#define NVAPI_NVLINK_CAPS_NCI_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_CAPS_NCI_VERSION_2_0 (0x00000002) - -typedef struct -{ - NvU32 version; //!< Version of this structure. Must always be first element in this structure. - NvU32 capsTbl; //!< This is bit field for getting different global caps.The individual bitfields are specified by NVAPI_NVLINK_CAPS_* - NvU8 lowestNvlinkVersion; //!< This field specifies the lowest supported NVLink version for this GPU. - NvU8 highestNvlinkVersion; //!< This field specifies the highest supported NVLink version for this GPU. - NvU8 lowestNciVersion; //!< This field specifies the lowest supported NCI version for this GPU. - NvU8 highestNciVersion; //!< This field specifies the highest supported NCI version for this GPU. - NvU32 linkMask; //!< This field provides a bitfield mask of NVLink links enabled on this GPU. -}NVLINK_GET_CAPS_V1; - -typedef NVLINK_GET_CAPS_V1 NVLINK_GET_CAPS; -#define NVLINK_GET_CAPS_VER1 MAKE_NVAPI_VERSION(NVLINK_GET_CAPS_V1, 1) - -#define NVLINK_GET_CAPS_VER NVLINK_GET_CAPS_VER1 -//! @} -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_NVLINK_GetCaps -// -//! DESCRIPTION: This function returns the NVLink capabilities supported by the GPU. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 361 -//! -//! \param [in] hPhysicalGpu GPU selection -//! -//! \param [in,out] NVLINK_GET_CAPS This structure contains the output parameters. -//! Also need to specify the version. -//! -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The caller does not have administrative privileges -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup nvlink -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_NVLINK_GetCaps(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NVLINK_GET_CAPS *capsParams); - - -//! \ingroup nvlink -//! @{ -//! Used in NvAPI_GPU_NVLINK_GetStatus() - -#define NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_NONE (0x00000000) -#define NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_PCI (0x00000001) -#define NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_UUID (0x00000002) - -typedef enum _NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE -{ - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_EBRIDGE, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_NPU, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_GPU, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_SWITCH, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_TEGRA, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_NONE, - NVAPI_NVLINK_DEVICE_INFO_DEVICE_UUID_INVALID, -} NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE; - -typedef struct -{ - NvU32 deviceIdFlags; //!< ID Flags, Bitmask that specifies which IDs are valid for the GPU. Refer NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_* for possible values. - //!< If NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_PCI is set, PCI information is valid. - //!< If NVAPI_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_UUID is set, UUID is valid. - NvU16 domain; //!< domain, bus, device, function, pciDeviceId : PCI information for the GPU. - NvU16 bus; - NvU16 device; - NvU16 function; - NvU32 pciDeviceId; - NvU64 deviceType; //!< GPU Type. See NVAPI_NVLINK_DEVICE_INFO_DEVICE_TYPE_* for possible values. - NvU8 deviceUUID[16]; //!< GPU UUID -}NVLINK_DEVICE_INFO_V1; - -typedef enum _NVAPI_NVLINK_STATUS_LINK_STATE -{ - NVAPI_NVLINK_STATUS_LINK_STATE_UNKNOWN, - NVAPI_NVLINK_STATUS_LINK_STATE_INIT, - NVAPI_NVLINK_STATUS_LINK_STATE_HWCFG, - NVAPI_NVLINK_STATUS_LINK_STATE_SWCFG, - NVAPI_NVLINK_STATUS_LINK_STATE_ACTIVE, - NVAPI_NVLINK_STATUS_LINK_STATE_FAULT, - NVAPI_NVLINK_STATUS_LINK_STATE_RECOVERY, - NVAPI_NVLINK_STATUS_LINK_STATE_RECOVERY_AC, - NVAPI_NVLINK_STATUS_LINK_STATE_RECOVERY_AX, - NVAPI_NVLINK_STATUS_LINK_STATE_INVALID = 0xFFFFFFFF, -}NVAPI_NVLINK_STATUS_LINK_STATE; - -typedef enum _NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE -{ - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_UNKNOWN, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_HIGH_SPEED_1, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_LOW_POWER, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_TRAINING, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_SAFE_MODE, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_OFF, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_TEST, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_FAULT, - NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE_INVALID = 0xFF, -}NVAPI_NVLINK_STATUS_SUBLINK_RX_STATE; - -typedef enum _NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE -{ - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_UNKNOWN, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_HIGH_SPEED_1, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_LOW_POWER, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_TRAINING, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_SAFE_MODE, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_OFF, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_TEST, - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_FAULT, - - NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE_INVALID= 0xFF, -} NVAPI_NVLINK_STATUS_SUBLINK_TX_STATE; - - -#define NVAPI_NVLINK_STATUS_PHY_NVHS (0x00000001) -#define NVAPI_NVLINK_STATUS_PHY_GRS (0x00000002) -#define NVAPI_NVLINK_STATUS_PHY_INVALID (0x000000FF) - -#define NVAPI_NVLINK_STATUS_NVLINK_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_STATUS_NVLINK_VERSION_2_0 (0x00000002) -#define NVAPI_NVLINK_STATUS_NVLINK_VERSION_INVALID (0x000000FF) - -#define NVAPI_NVLINK_STATUS_NCI_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_STATUS_NCI_VERSION_2_0 (0x00000002) -#define NVAPI_NVLINK_STATUS_NCI_VERSION_INVALID (0x000000FF) - -#define NVAPI_NVLINK_STATUS_NVHS_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_STATUS_NVHS_VERSION_INVALID (0x000000FF) - -#define NVAPI_NVLINK_STATUS_GRS_VERSION_1_0 (0x00000001) -#define NVAPI_NVLINK_STATUS_GRS_VERSION_INVALID (0x000000FF) - -#define NVAPI_NVLINK_STATUS_CONNECTED_TRUE (0x00000001) -#define NVAPI_NVLINK_STATUS_CONNECTED_FALSE (0x00000000) - -#define NVAPI_NVLINK_STATUS_LOOP_PROPERTY_LOOPBACK (0x00000001) -#define NVAPI_NVLINK_STATUS_LOOP_PROPERTY_LOOPOUT (0x00000002) -#define NVAPI_NVLINK_STATUS_LOOP_PROPERTY_NONE (0x00000000) - -#define NVAPI_NVLINK_STATUS_REMOTE_LINK_NUMBER_INVALID (0x000000FF) - -#define NVAPI_NVLINK_REFCLK_TYPE_INVALID (0x00) -#define NVAPI_NVLINK_REFCLK_TYPE_NVHS (0x01) -#define NVAPI_NVLINK_REFCLK_TYPE_PEX (0x02) - - -typedef struct -{ - NvU32 capsTbl; //!< This is bit field for getting different global caps.The individual bitfields are specified by NVAPI_NVLINK_CAPS_*. - NvU8 phyType; //!< This field specifies the type of PHY (NVHS or GRS) being used for this link. - NvU8 subLinkWidth; //!< This field specifies the no. of lanes per sublink. - NvU32 linkState; //!< This field specifies the current state of the link.See NVAPI_NVLINK_GET_NVLINK_STATUS_LINK_STATE_* for possible values. - NvU8 rxSublinkStatus; //!< This field specifies the current state of RX sublink.See NVAPI_NVLINK_GET_NVLINK_STATUS_SUBLINK_RX_STATE_* for possible values. - NvU8 txSublinkStatus; //!< This field specifies the current state of TX sublink.See NVAPI_NVLINK_GET_NVLINK_STATUS_SUBLINK_TX_STATE_* for possible values. - NvU8 nvlinkVersion; //!< This field specifies the NVLink version supported by the link. - NvU8 nciVersion; //!< This field specifies the NCI version supported by the link. - NvU8 phyVersion; //!< This field specifies the version of PHY being used by the link. - NvU32 nvlinkCommonClockSpeedMhz; //!< This field gives the value of nvlink common clock in MHz. - NvU32 nvlinkRefClkSpeedMhz; //!< This field gives the value of nvlink refclk clock in MHz. - NvU8 nvlinkRefClkType; //!< This field specifies whether refclk is taken from NVHS reflck or PEX refclk for the current GPU.See NVAPI_NVLINK_REFCLK_TYPE_INVALID* for possible values. - NvU32 nvlinkLinkClockMhz; //!< This field gives the actual clock/speed at which links is running in MHz. - NvU32 connected:1 ; //!< This field specifies if any device is connected on the other end of the link. - NvU32 reserved:31; //!< Reserved for future use. - NvU8 loopProperty; //!< This field specifies if the link is a loopback/loopout link. See NVAPI_NVLINK_STATUS_LOOP_PROPERTY_* for possible values. - NvU8 remoteDeviceLinkNumber; //!< This field specifies the link number on the remote end of the link. - NVLINK_DEVICE_INFO_V1 remoteDeviceInfo; //!< This field stores the GPU information for the remote end of the link -}NVLINK_LINK_STATUS_INFO_V1; - -typedef struct -{ - NvU32 capsTbl; //!< This is bit field for getting different global caps.The individual bitfields are specified by NVAPI_NVLINK_CAPS_*. - NvU8 phyType; //!< This field specifies the type of PHY (NVHS or GRS) being used for this link. - NvU8 subLinkWidth; //!< This field specifies the no. of lanes per sublink. - NvU32 linkState; //!< This field specifies the current state of the link.See NVAPI_NVLINK_GET_NVLINK_STATUS_LINK_STATE_* for possible values. - NvU8 rxSublinkStatus; //!< This field specifies the current state of RX sublink.See NVAPI_NVLINK_GET_NVLINK_STATUS_SUBLINK_RX_STATE_* for possible values. - NvU8 txSublinkStatus; //!< This field specifies the current state of TX sublink.See NVAPI_NVLINK_GET_NVLINK_STATUS_SUBLINK_TX_STATE_* for possible values. - NvU8 nvlinkVersion; //!< This field specifies the NVLink version supported by the link. - NvU8 nciVersion; //!< This field specifies the NCI version supported by the link. - NvU8 phyVersion; //!< This field specifies the version of PHY being used by the link. - NvU32 nvlinkCommonClockSpeedMhz; //!< This field gives the value of nvlink common clock in MHz. - NvU32 nvlinkRefClkSpeedMhz; //!< This field gives the value of nvlink refclk clock in MHz. - NvU8 nvlinkRefClkType; //!< This field specifies whether refclk is taken from NVHS reflck or PEX refclk for the current GPU.See NVAPI_NVLINK_REFCLK_TYPE_INVALID* for possible values. - NvU32 nvlinkLinkClockMhz; //!< This field gives the actual clock/speed at which links is running in MHz. - NvU32 connected:1 ; //!< This field specifies if any device is connected on the other end of the link. - NvU32 reserved:31; //!< Reserved for future use. - NvU8 loopProperty; //!< This field specifies if the link is a loopback/loopout link. See NVAPI_NVLINK_STATUS_LOOP_PROPERTY_* for possible values. - NvU8 remoteDeviceLinkNumber; //!< This field specifies the link number on the remote end of the link. - NVLINK_DEVICE_INFO_V1 remoteDeviceInfo; //!< This field stores the device information for the remote end of the link - NvU8 localDeviceLinkNumber; //!< This field specifies the link number on the local end of the link. - NVLINK_DEVICE_INFO_V1 localDeviceInfo; //!< This field stores the device information for the local end of the link. - NvU32 nvlinkLineRateMbps; //!< Bit rate at which bits toggle on wires in megabits per second. - NvU32 reservedEx[8]; //!< Reserved for future use to avoid versioning. -}NVLINK_LINK_STATUS_INFO_V2; - -typedef struct -{ - NvU32 version; //!< Version of this structure. Must always be first element in this structure. - NvU32 linkMask; //!< This parameter specifies for which links we want the status. - NVLINK_LINK_STATUS_INFO_V1 linkInfo[NVAPI_NVLINK_MAX_LINKS]; //!< This structure stores the per-link status of different NVLink parameters. The link is identified by the index. -}NVLINK_GET_STATUS_V1; - -typedef struct -{ - NvU32 version; //!< Version of this structure. Must always be first element in this structure. - NvU32 linkMask; //!< This parameter specifies for which links we want the status. - NVLINK_LINK_STATUS_INFO_V2 linkInfo[NVAPI_NVLINK_MAX_LINKS]; //!< This structure stores the per-link status of different NVLink parameters. The link is identified by the index. -}NVLINK_GET_STATUS_V2; - - -typedef NVLINK_GET_STATUS_V2 NVLINK_GET_STATUS; -#define NVLINK_GET_STATUS_VER1 MAKE_NVAPI_VERSION(NVLINK_GET_STATUS_V1, 1) -#define NVLINK_GET_STATUS_VER2 MAKE_NVAPI_VERSION(NVLINK_GET_STATUS_V2, 2) - -#define NVLINK_GET_STATUS_VER NVLINK_GET_STATUS_VER2 -//! @} -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_NVLINK_GetStatus -// -//! DESCRIPTION: This function returns the NVLink status. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 361 -//! -//! \param [in] hPhysicalGpu GPU selection -//! -//! \param [in,out] NVLINK_GET_STATUS This structure contains the input and output parameters. -//! linkMask is the input param while others are output parameters. -//! Also need to specify the version. -//! -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The caller does not have administrative privileges -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup nvlink -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_NVLINK_GetStatus(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NVLINK_GET_STATUS* statusParams); - - -typedef struct _NV_GPU_INFO_V1 -{ - NvU32 version; //!< Structure Version. - NvU32 bIsExternalGpu:1; //!< This flag is set for external GPU. - NvU32 reserved:31; //!< Reserved for future use -} NV_GPU_INFO_V1; - -typedef struct _NV_GPU_INFO_V2 -{ - NvU32 version; //!< Structure Version. - NvU32 bIsExternalGpu:1; //!< This flag is set for external GPU. - NvU32 reserved0:31; //!< Reserved for future use - NvU64 reserved1; //!< Reserved for future use - NvU32 rayTracingCores; //!< Number of "Ray Tracing Cores" supported by the GPU. - NvU32 tensorCores; //!< Number of "Tensor Cores" supported by the GPU. - NvU32 reserved2[14]; //!< Reserved for future use. -} NV_GPU_INFO_V2; - -#define NV_GPU_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_INFO_V1, 1) -#define NV_GPU_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_INFO_V2, 2) -#define NV_GPU_INFO_VER NV_GPU_INFO_VER2 -typedef NV_GPU_INFO_V2 NV_GPU_INFO; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetGPUInfo -// -//! DESCRIPTION: This API will return NVIDIA GPU related information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! -//! \param [in,out] pGpuInfo - This structure will be filled with required information. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetGPUInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_INFO *pGpuInfo); - - - -typedef struct _NV_GPU_VR_READY_V1 -{ - NvU32 version; //!< Structure Version. - NvU32 isVRReady : 1; //!< Is the requested GPU VR ready. - NvU32 reserved : 31; -} NV_GPU_VR_READY_V1; - -#define NV_GPU_VR_READY_VER1 MAKE_NVAPI_VERSION(NV_GPU_VR_READY_V1, 1) -#define NV_GPU_VR_READY_VER NV_GPU_VR_READY_VER1 -typedef NV_GPU_VR_READY_V1 NV_GPU_VR_READY; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVRReadyData -// -//! DESCRIPTION: This API will return NVIDIA GPU VR Ready state. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 465 -//! -//! \param [in,out] pGpuVrReadyData - This structure will be filled with required information. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVRReadyData(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VR_READY *pGpuVrReadyData); - - -typedef enum _NV_ADAPTER_TYPE -{ - NV_ADAPTER_TYPE_UNKNOWN = 0x0, - NV_ADAPTER_TYPE_WDDM = NV_BIT(0), //BATT event - NV_GPU_PERF_DECREASE_REASON_API_TRIGGERED = 0x00000008, //!< API triggered slowdown - NV_GPU_PERF_DECREASE_REASON_INSUFFICIENT_POWER = 0x00000010, //!< Power connector missing - NV_GPU_PERF_DECREASE_REASON_UNKNOWN = 0x80000000, //!< Unknown reason -} NVAPI_GPU_PERF_DECREASE; - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPerfDecreaseInfo -// -//! DESCRIPTION: This function retrieves - in NvU32 variable - reasons for the current performance decrease. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] hPhysicalGPU (IN) - GPU for which performance decrease is to be evaluated. -//! \param [out] pPerfDecrInfo (OUT) - Pointer to a NvU32 variable containing performance decrease info -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup gpuPerf -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPerfDecreaseInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NvU32 *pPerfDecrInfo); - - -//! \ingroup gpupstate -//! Used in NvAPI_GPU_GetPstatesInfoEx() -typedef struct -{ - NvU32 version; - NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not - //!< - bit 1 indicates if dynamic Pstate is capable or not - //!< - bit 2 indicates if dynamic Pstate is enable or not - //!< - all other bits must be set to 0 - NvU32 numPstates; //!< The number of available p-states - NvU32 numClocks; //!< The number of clock domains supported by each P-State - struct - { - NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state. - NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2 - //!< - bit 1 indicates if the Pstate is overclocked or not - //!< - bit 2 indicates if the Pstate is overclockable or not - //!< - all other bits must be set to 0 - struct - { - NV_GPU_PUBLIC_CLOCK_ID domainId; //!< ID of the clock domain - NvU32 flags; //!< Reserved. Must be set to 0 - NvU32 freq; //!< Clock frequency in kHz - - } clocks[NVAPI_MAX_GPU_PERF_CLOCKS]; - } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; - -} NV_GPU_PERF_PSTATES_INFO_V1; - - -//! \ingroup gpupstate -typedef struct -{ - NvU32 version; - NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not - //!< - bit 1 indicates if dynamic Pstate is capable or not - //!< - bit 2 indicates if dynamic Pstate is enable or not - //!< - all other bits must be set to 0 - NvU32 numPstates; //!< The number of available p-states - NvU32 numClocks; //!< The number of clock domains supported by each P-State - NvU32 numVoltages; - struct - { - NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state. - NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2 - //!< - bit 1 indicates if the Pstate is overclocked or not - //!< - bit 2 indicates if the Pstate is overclockable or not - //!< - all other bits must be set to 0 - struct - { - NV_GPU_PUBLIC_CLOCK_ID domainId; - NvU32 flags; //!< bit 0 indicates if this clock is overclockable - //!< all other bits must be set to 0 - NvU32 freq; - - } clocks[NVAPI_MAX_GPU_PERF_CLOCKS]; - struct - { - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; //!< ID of the voltage domain, containing flags and mvolt info - NvU32 flags; //!< Reserved for future use. Must be set to 0 - NvU32 mvolt; //!< Voltage in mV - - } voltages[NVAPI_MAX_GPU_PERF_VOLTAGES]; - - } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; //!< Valid index range is 0 to numVoltages-1 - -} NV_GPU_PERF_PSTATES_INFO_V2; - -//! \ingroup gpupstate -typedef NV_GPU_PERF_PSTATES_INFO_V2 NV_GPU_PERF_PSTATES_INFO; - - -//! \ingroup gpupstate -//! @{ - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V1 -#define NV_GPU_PERF_PSTATES_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V1,1) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2 -#define NV_GPU_PERF_PSTATES_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,2) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2 -#define NV_GPU_PERF_PSTATES_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,3) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO -#define NV_GPU_PERF_PSTATES_INFO_VER NV_GPU_PERF_PSTATES_INFO_VER3 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPstatesInfoEx -// -//! DESCRIPTION: This API retrieves all performance states (P-States) information. -//! -//! P-States are GPU active/executing performance capability and power consumption states. -//! -//! P-States ranges from P0 to P15, with P0 being the highest performance/power state, and -//! P15 being the lowest performance/power state. Each P-State, if available, maps to a -//! performance level. Not all P-States are available on a given system. The definitions -//! of each P-State are currently as follows: \n -//! - P0/P1 - Maximum 3D performance -//! - P2/P3 - Balanced 3D performance-power -//! - P8 - Basic HD video playback -//! - P10 - DVD playback -//! - P12 - Minimum idle power consumption -//! -//! \deprecated Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [out] pPerfPstatesInfo P-States information retrieved, as detailed below: \n -//! - flags is reserved for future use. -//! - numPstates is the number of available P-States -//! - numClocks is the number of clock domains supported by each P-State -//! - pstates has valid index range from 0 to numPstates - 1 -//! - pstates[i].pstateId is the ID of the P-State, -//! containing the following info: -//! - pstates[i].flags containing the following info: -//! - bit 0 indicates if the PCIE limit is GEN1 or GEN2 -//! - bit 1 indicates if the Pstate is overclocked or not -//! - bit 2 indicates if the Pstate is overclockable or not -//! - pstates[i].clocks has valid index range from 0 to numClocks -1 -//! - pstates[i].clocks[j].domainId is the public ID of the clock domain, -//! containing the following info: -//! - pstates[i].clocks[j].flags containing the following info: -//! bit 0 indicates if the clock domain is overclockable or not -//! - pstates[i].clocks[j].freq is the clock frequency in kHz -//! - pstates[i].voltages has a valid index range from 0 to numVoltages - 1 -//! - pstates[i].voltages[j].domainId is the ID of the voltage domain, -//! containing the following info: -//! - pstates[i].voltages[j].flags is reserved for future use. -//! - pstates[i].voltages[j].mvolt is the voltage in mV -//! inputFlags(IN) - This can be used to select various options: -//! - if bit 0 is set, pPerfPstatesInfo would contain the default settings -//! instead of the current, possibily overclocked settings. -//! - if bit 1 is set, pPerfPstatesInfo would contain the maximum clock -//! frequencies instead of the nominal frequencies. -//! - if bit 2 is set, pPerfPstatesInfo would contain the minimum clock -//! frequencies instead of the nominal frequencies. -//! - all other bits must be set to 0. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! \retval ::NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide) -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the NV_GPU_PERF_PSTATES struct is not supported -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.") -NVAPI_INTERFACE NvAPI_GPU_GetPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATES_INFO *pPerfPstatesInfo, NvU32 inputFlags); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPstates20 -// -//! DESCRIPTION: This API retrieves all performance states (P-States) 2.0 information. -//! -//! P-States are GPU active/executing performance capability states. -//! They range from P0 to P15, with P0 being the highest performance state, -//! and P15 being the lowest performance state. Each P-State, if available, -//! maps to a performance level. Not all P-States are available on a given system. -//! The definition of each P-States are currently as follow: -//! - P0/P1 - Maximum 3D performance -//! - P2/P3 - Balanced 3D performance-power -//! - P8 - Basic HD video playback -//! - P10 - DVD playback -//! - P12 - Minimum idle power consumption -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 295 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGPU GPU selection -//! \param [out] pPstatesInfo P-States information retrieved, as documented in declaration above -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPstates20(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_PERF_PSTATES20_INFO *pPstatesInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentPstate -// -//! DESCRIPTION: This function retrieves the current performance state (P-State). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \param [in] hPhysicalGPU GPU selection -//! \param [out] pCurrentPstate The ID of the current P-State of the GPU - see \ref NV_GPU_PERF_PSTATES. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_NOT_SUPPORTED P-States is not supported on this setup. -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetCurrentPstate(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATE_ID *pCurrentPstate); - - - - -//! \ingroup gpupstate -#define NVAPI_MAX_GPU_UTILIZATIONS 8 - - - -//! \ingroup gpupstate -//! Used in NvAPI_GPU_GetDynamicPstatesInfoEx(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 flags; //!< bit 0 indicates if the dynamic Pstate is enabled or not - struct - { - NvU32 bIsPresent:1; //!< Set if this utilization domain is present on this GPU - NvU32 percentage; //!< Percentage of time where the domain is considered busy in the last 1 second interval - } utilization[NVAPI_MAX_GPU_UTILIZATIONS]; -} NV_GPU_DYNAMIC_PSTATES_INFO_EX; - -//! \ingroup gpupstate -//! Macro for constructing the version field of NV_GPU_DYNAMIC_PSTATES_INFO_EX -#define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx -// -//! DESCRIPTION: This API retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU. -//! Each domain's info is indexed in the array. For example: -//! - pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain. \p -//! There are currently 4 domains for which GPU utilization and dynamic P-State thresholds can be retrieved: -//! graphic engine (GPU), frame buffer (FB), video engine (VID), and bus interface (BUS). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! \since Release: 185 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT pDynamicPstatesInfo is NULL -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx); -/////////////////////////////////////////////////////////////////////////////////// -// Thermal API -// Provides ability to get temperature levels from the various thermal sensors associated with the GPU - -//! \ingroup gputhermal -#define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3 - -//! \ingroup gputhermal -//! Used in NV_GPU_THERMAL_SETTINGS -typedef enum -{ - NVAPI_THERMAL_TARGET_NONE = 0, - NVAPI_THERMAL_TARGET_GPU = 1, //!< GPU core temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_MEMORY = 2, //!< GPU memory temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4, //!< GPU power supply temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_BOARD = 8, //!< GPU board ambient temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_VCD_BOARD = 9, //!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle - NVAPI_THERMAL_TARGET_VCD_INLET = 10, //!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle - NVAPI_THERMAL_TARGET_VCD_OUTLET = 11, //!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle - - NVAPI_THERMAL_TARGET_ALL = 15, - NVAPI_THERMAL_TARGET_UNKNOWN = -1, -} NV_THERMAL_TARGET; - -//! \ingroup gputhermal -//! Used in NV_GPU_THERMAL_SETTINGS -typedef enum -{ - NVAPI_THERMAL_CONTROLLER_NONE = 0, - NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL, - NVAPI_THERMAL_CONTROLLER_ADM1032, - NVAPI_THERMAL_CONTROLLER_MAX6649, - NVAPI_THERMAL_CONTROLLER_MAX1617, - NVAPI_THERMAL_CONTROLLER_LM99, - NVAPI_THERMAL_CONTROLLER_LM89, - NVAPI_THERMAL_CONTROLLER_LM64, - NVAPI_THERMAL_CONTROLLER_ADT7473, - NVAPI_THERMAL_CONTROLLER_SBMAX6649, - NVAPI_THERMAL_CONTROLLER_VBIOSEVT, - NVAPI_THERMAL_CONTROLLER_OS, - NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1, -} NV_THERMAL_CONTROLLER; - -//! \ingroup gputhermal -//! Used in NvAPI_GPU_GetThermalSettings() -typedef struct -{ - NvU32 version; //!< structure version - NvU32 count; //!< number of associated thermal sensors - struct - { - NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649... - NvU32 defaultMinTemp; //!< The min default temperature value of the thermal sensor in degree Celsius - NvU32 defaultMaxTemp; //!< The max default temperature value of the thermal sensor in degree Celsius - NvU32 currentTemp; //!< The current temperature value of the thermal sensor in degree Celsius - NV_THERMAL_TARGET target; //!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc. - } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU]; - -} NV_GPU_THERMAL_SETTINGS_V1; - -//! \ingroup gputhermal -typedef struct -{ - NvU32 version; //!< structure version - NvU32 count; //!< number of associated thermal sensors - struct - { - NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649... - NvS32 defaultMinTemp; //!< Minimum default temperature value of the thermal sensor in degree Celsius - NvS32 defaultMaxTemp; //!< Maximum default temperature value of the thermal sensor in degree Celsius - NvS32 currentTemp; //!< Current temperature value of the thermal sensor in degree Celsius - NV_THERMAL_TARGET target; //!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc - } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU]; - -} NV_GPU_THERMAL_SETTINGS_V2; - -//! \ingroup gputhermal -typedef NV_GPU_THERMAL_SETTINGS_V2 NV_GPU_THERMAL_SETTINGS; - -//! \ingroup gputhermal -//! @{ - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V1 -#define NV_GPU_THERMAL_SETTINGS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1,1) - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V2 -#define NV_GPU_THERMAL_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2,2) - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS -#define NV_GPU_THERMAL_SETTINGS_VER NV_GPU_THERMAL_SETTINGS_VER_2 -//! @} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetThermalSettings -// -//! This function retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU. -//! Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1. -//! -//! - To retrieve specific thermal sensor info, set the sensorIndex to the required thermal sensor index. -//! - To retrieve info for all sensors, set sensorIndex to NVAPI_THERMAL_TARGET_ALL. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [in] sensorIndex Explicit thermal sensor index selection. -//! \param [out] pThermalSettings Array of thermal settings. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_INVALID_ARGUMENT pThermalInfo is NULL. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported. -//! \ingroup gputhermal -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings); - - - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 reserved; //!< These bits are reserved for future use. - struct - { - NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU - NvU32 reserved:31; //!< These bits are reserved for future use. - NvU32 frequency; //!< Clock frequency (kHz) - }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS]; -} NV_GPU_CLOCK_FREQUENCIES_V1; - -#ifndef NV_GPU_MAX_CLOCK_FREQUENCIES - #define NV_GPU_MAX_CLOCK_FREQUENCIES 3 -#endif - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef enum -{ - NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ = 0, - NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK = 1, - NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK = 2, - NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM = NV_GPU_MAX_CLOCK_FREQUENCIES -} NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE; - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 ClockType:4; //!< One of NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE. Used to specify the type of clock to be returned. - NvU32 reserved:20; //!< These bits are reserved for future use. Must be set to 0. - NvU32 reserved1:8; //!< These bits are reserved. - struct - { - NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU - NvU32 reserved:31; //!< These bits are reserved for future use. - NvU32 frequency; //!< Clock frequency (kHz) - }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS]; -} NV_GPU_CLOCK_FREQUENCIES_V2; - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef NV_GPU_CLOCK_FREQUENCIES_V2 NV_GPU_CLOCK_FREQUENCIES; - -//! \addtogroup gpuclock -//! @{ -#define NV_GPU_CLOCK_FREQUENCIES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V1,1) -#define NV_GPU_CLOCK_FREQUENCIES_VER_2 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,2) -#define NV_GPU_CLOCK_FREQUENCIES_VER_3 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,3) -#define NV_GPU_CLOCK_FREQUENCIES_VER NV_GPU_CLOCK_FREQUENCIES_VER_3 -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllClockFrequencies -// -//! This function retrieves the NV_GPU_CLOCK_FREQUENCIES structure for the specified physical GPU. -//! -//! For each clock domain: -//! - bIsPresent is set for each domain that is present on the GPU -//! - frequency is the domain's clock freq in kHz -//! -//! Each domain's info is indexed in the array. For example: -//! clkFreqs.domain[NVAPI_GPU_PUBLIC_CLOCK_MEMORY] holds the info for the MEMORY domain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 295 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval NVAPI_INVALID_ARGUMENT pClkFreqs is NULL. -//! \ingroup gpuclock -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGPU, __inout NV_GPU_CLOCK_FREQUENCIES *pClkFreqs); - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_QueryIlluminationSupport -//! -//! \fn NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo) -//! DESCRIPTION: This function reports if the specified illumination attribute is supported. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with this call to determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be querried -//! \param [out] pSupported A boolean indicating if the attribute is supported. -//! -//! \return See \ref nvapistatus for the list of possible return values. -// -////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef enum _NV_GPU_ILLUMINATION_ATTRIB -{ - NV_GPU_IA_LOGO_BRIGHTNESS = 0, - NV_GPU_IA_SLI_BRIGHTNESS = 1, -} NV_GPU_ILLUMINATION_ATTRIB; - -//! \ingroup gpu -typedef struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - - // OUT - NvU32 bSupported; //!< A boolean indicating if the attribute is supported. - -} NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM; -//! \ingroup gpu -#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_GetIllumination -//! -//! \fn NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo) -//! DESCRIPTION: This function reports value of the specified illumination attribute. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to -//! determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be querried -//! \param [out] Value A DWORD containing the current value for the specified attribute. -//! This is specified as a percentage of the full range of the attribute -//! (0-100; 0 = off, 100 = full brightness) -//! -//! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are: -//! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver. -//! NVAPI_NOT_SUPPORTED: The specified attribute is not supported on the specified GPU -// -////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef struct _NV_GPU_GET_ILLUMINATION_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< Note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - - // OUT - NvU32 Value; //!< A DWORD that will contain the current value of the specified attribute. - //! This is specified as a percentage of the full range of the attribute - //! (0-100; 0 = off, 100 = full brightness) - -} NV_GPU_GET_ILLUMINATION_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_GET_ILLUMINATION_PARM_V1 NV_GPU_GET_ILLUMINATION_PARM; -//! \ingroup gpu -#define NV_GPU_GET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_GET_ILLUMINATION_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_GET_ILLUMINATION_PARM_VER NV_GPU_GET_ILLUMINATION_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_SetIllumination -//! -//! \fn NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo) -//! DESCRIPTION: This function sets the value of the specified illumination attribute. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to -//! determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be set -//! \param Value The new value for the specified attribute. -//! This should be specified as a percentage of the full range of the attribute -//! (0-100; 0 = off, 100 = full brightness) -//! If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned. -//! -//! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are: -//! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver, or the specified value is out of range. -//! NVAPI_NOT_SUPPORTED The specified attribute is not supported on the specified GPU. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef struct _NV_GPU_SET_ILLUMINATION_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< Note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - NvU32 Value; //!< A DWORD containing the new value for the specified attribute. - //!< This should be specified as a percentage of the full range of the attribute - //!< (0-100; 0 = off, 100 = full brightness) - //!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned. - - // OUT - -} NV_GPU_SET_ILLUMINATION_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_SET_ILLUMINATION_PARM_V1 NV_GPU_SET_ILLUMINATION_PARM; -//! \ingroup gpu -#define NV_GPU_SET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_SET_ILLUMINATION_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_SET_ILLUMINATION_PARM_VER NV_GPU_SET_ILLUMINATION_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo); - - - -/*! - * Enumeration of control modes that can be applied to Illumination Zones. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB = 0, // deprecated - NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB, // deprecated - - NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL = 0, - NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR, - - // Strictly add new control modes above this. - NV_GPU_CLIENT_ILLUM_CTRL_MODE_INVALID = 0xFF, -} NV_GPU_CLIENT_ILLUM_CTRL_MODE; - -/*! - * Enumeration of locations where an Illumination Zone might be present. - * Encoding used - - * 1:0 - Number specifier (0) - * 4:2 - Location (TOP) - * 7:5 - Type (GPU/SLI) - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_TOP_0 = 0x00, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_FRONT_0 = 0x08, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_BACK_0 = 0x0C, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_SLI_TOP_0 = 0x20, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_INVALID = 0xFFFFFFFF, -} NV_GPU_CLIENT_ILLUM_ZONE_LOCATION; - -/*! - * Enumeration of ILLUM_DEVICEs. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_INVALID = 0, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_MCUV10, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_RGBW_V10, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_SINGLE_COLOR_V10, -} NV_GPU_CLIENT_ILLUM_DEVICE_TYPE; - -/*! - * Enumeration of ILLUM_ZONEs. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_INVALID = 0, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGBW, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_SINGLE_COLOR, -} NV_GPU_CLIENT_ILLUM_ZONE_TYPE; - -/*! - * Number of color points for the piecewise linear control mode. - */ -#define NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS 2 - -/*! - * Enumeration of Cycle types for piecewise linear control mode. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_HALF_HALT = 0, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_HALT, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_REPEAT, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_INVALID = 0xFF, -} NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX 32 - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illumination device type MCUV10. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 -{ - /*! - * I2C Device Index: Pointing to the illumination device in I2C Devices Table. - */ - NvU8 i2cDevIdx; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illum device type GPIO_PWM_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW -{ - /*! - * Red drive GPIO pin. - */ - NvU8 gpioPinRed; - - /*! - * Green drive GPIO pin. - */ - NvU8 gpioPinGreen; - - /*! - * Blue drive GPIO pin. - */ - NvU8 gpioPinBlue; - - /*! - * White drive GPIO pin. - */ - NvU8 gpioPinWhite; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW; -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illum device type GPIO_PWM_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR -{ - /*! - * Single Color GPIO pin. - */ - NvU8 gpioPinSingleColor; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR; - -/*! - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 -{ - /*! - * Type of the illumination device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type; - - /*! - * Supported control modes for this illumination device. - */ - NvU32 ctrlModeMask; - - /*! - * Union of illumination device info data. Interpreted as per - * @ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1::type - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 mcuv10; - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW gpioPwmRgbwv10; - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR gpioPwmSingleColorv10; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1; - -/*! - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination devices present. - */ - NvU32 numIllumDevices; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - /*! - */ - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX]; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetInfo -//! -//! DESCRIPTION: This API returns static information about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumDevicesInfo Pointer to structure containing static -//! information about illumination devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS *pIllumDevicesInfo); - - -/*! - * Structure representing the data required for synchronization. - */ -typedef struct -{ - /*! - * Boolean representing the need for synchronization. - */ - NvBool bSync; - - /*! - * Time stamp value required for synchronization. - */ - NvU64 timeStampms; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1; - -/*! - * Structure representing the device control parameters of each ILLUM_DEVICE. - */ -typedef struct -{ - /*! - * Type of the illum device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type; - - /*! - * Structure containing the synchronization data for the illumination device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1 syncData; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1; - -typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL; - -/*! - * Structure representing the control parameters of ILLUM_DEVICE-s. - */ -typedef struct -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination devices present. - */ - NvU32 numIllumDevices; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - /*! - */ - NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX]; -} NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetControl -//! -//! DESCRIPTION: This API gets control parameters about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [inout] pIllumDevicesControl Pointer to structure containing control -//! information about illum devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl); - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesSetControl -//! -//! DESCRIPTION: This API sets control parameters about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [inout] pClientIllumDevicesControl Pointer to structure containing control -//! information about illum devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl); - - -#define NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX 32 - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 - * Describes the static information of illum zone type RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 - * Describes the static information of illum zone type SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE type; - - /*! - * Index pointing to an Illumination Device that controls this zone. - */ - NvU8 illumDeviceIdx; - - /*! - * Provider index for representing logical to physical zone mapping. - */ - NvU8 provIdx; - - /*! - * Location of the zone on the board. - */ - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION zoneLocation; - - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB rgb; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW rgbw; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR singleColor; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination zones present. - */ - NvU32 numIllumZones; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX]; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetInfo -//! -//! DESCRIPTION: This API returns static information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesInfo Pointer to structure containing static -//! information about illumination devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS *pIllumZonesInfo); - - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS -{ - /*! - * Red compenent of color applied to the zone. - */ - NvU8 colorR; - - /*! - * Green compenent of color applied to the zone. - */ - NvU8 colorG; - - /*! - * Blue compenent of color applied to the zone. - */ - NvU8 colorB; - - /*! - * Brightness perecentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR -{ - /*! - * Type of cycle effect to apply. - */ - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE cycleType; - - /*! - * Number of times to repeat function within group period. - */ - NvU8 grpCount; - - /*! - * Time in ms to transition from color A to color B. - */ - NvU16 riseTimems; - - /*! - * Time in ms to transition from color B to color A. - */ - NvU16 fallTimems; - - /*! - * Time in ms to remain at color A before color A to color B transition. - */ - NvU16 ATimems; - - /*! - * Time in ms to remain at color B before color B to color A transition. - */ - NvU16 BTimems; - - /*! - * Time in ms to remain idle before next group of repeated function cycles. - */ - NvU16 grpIdleTimems; - - /*! - * Time in ms to offset the cycle relative to other zones. - */ - NvU16 phaseOffsetms; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illumination zone of type - * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB -{ - /*! - * Union of illumination zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB manualRGB; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB piecewiseLinearRGB; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS -{ - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED manualColorFixed; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED piecewiseLinearColorFixed; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS -{ - /*! - * Red component of color applied to the zone. - */ - NvU8 colorR; - - /*! - * Green component of color applied to the zone. - */ - NvU8 colorG; - - /*! - * Blue component of color applied to the zone. - */ - NvU8 colorB; - - /*! - * White component of color applied to the zone. - */ - NvU8 colorW; - - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_ILLUM_ZONE_TYPE_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_RGBW. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW manualRGBW; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW piecewiseLinearRGBW; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS -{ - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR manualSingleColor; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR piecewiseLinearSingleColor; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE type; - NV_GPU_CLIENT_ILLUM_CTRL_MODE ctrlMode; - union - { - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB rgb; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED colorFixed; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW rgbw; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR singleColor; - NvU8 rsvd[64]; - } data; - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 -{ - NvU32 version; - - /*! - * Bit field specifying the set of values to retrieve or set - * - default (NV_TRUE) - * - currently active (NV_FALSE). - */ - NvU32 bDefault : 1; - NvU32 rsvdField : 31; - - /*! - * Number of illumination zones present. - */ - NvU32 numIllumZonesControl; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetControl -//! -//! DESCRIPTION: Accessor for control information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesControl Pointer to structure containing control -//! information about illumination zones. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl); - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesSetControl -//! -//! DESCRIPTION: Mutator for control information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesControl Pointer to structure containing control -//! information about illumination zones. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Event_RegisterCallback -// -//! DESCRIPTION: This API registers the process for events. This API should be called for each eventcallback. -//! The handle returned to the client will be common across all eventCallbacks. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] eventCallback Pointer to NV_EVENT_REGISTER_CALLBACK structure to call -//! on new events -//! \param [out] phClient Handle to client for use with -//! unregister function -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Event_RegisterCallback(PNV_EVENT_REGISTER_CALLBACK eventCallback, - NvEventHandle* phClient); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Event_UnregisterCallback -// -//! DESCRIPTION: This API unregister an event handle. -//! This API should be called only once per process(irrespective of the number of callbacks registered). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hClient Handle associated with this listeners -//! event queue. Same as returned from -//! NvAPI_Event_RegisterCallback(). -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Event_UnregisterCallback(NvEventHandle hClient); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle -// -//! This function returns the handle of the NVIDIA display specified by the enum -//! index (thisEnum). The client should keep enumerating until it -//! returns error. -//! -//! Note: Display handles can get invalidated on a modeset, so the calling applications need to -//! renum the handles after every modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] thisEnum The index of the NVIDIA display. -//! \param [out] pNvDispHandle Pointer to the NVIDIA display handle. -//! -//! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big -//! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system -//! \retval NVAPI_END_ENUMERATION No more display device to enumerate -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle); - - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle -// -//! This function returns the handle of the NVIDIA unattached display specified by the enum -//! index (thisEnum). The client should keep enumerating until it -//! returns error. -//! Note: Display handles can get invalidated on a modeset, so the calling applications need to -//! renum the handles after every modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] thisEnum The index of the NVIDIA display. -//! \param [out] pNvUnAttachedDispHandle Pointer to the NVIDIA display handle of the unattached display. -//! -//! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big -//! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system -//! \retval NVAPI_END_ENUMERATION No more display device to enumerate. -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay -// -//! This function converts the unattached display handle to an active attached display handle. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pNvDisplay is NULL. -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayHandle -// -//! This function returns the handle of the NVIDIA display that is associated -//! with the given display "name" (such as "\\.\DISPLAY1"). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle -// -//! DESCRIPTION: This function returns the handle of an unattached NVIDIA display that is -//! associated with the given display name (such as "\\DISPLAY1"). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Either argument is NULL. -//! \retval ::NVAPI_OK *pNvUnAttachedDispHandle is now valid. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name. -//! -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayName -// -//! For a given NVIDIA display handle, this function returns a string (such as "\\.\DISPLAY1") to identify the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName -// -//! This function returns the display name given, for example, "\\DISPLAY1", using the unattached NVIDIA display handle -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnableHWCursor -// -//! This function enables hardware cursor support -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DisableHWCursor -// -//! This function disables hardware cursor support -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetVBlankCounter -// -//! This function gets the V-blank counter -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SetRefreshRateOverride -// -//! This function overrides the refresh rate on the given display/outputsMask. -//! The new refresh rate can be applied right away in this API call or deferred to be applied with the -//! next OS modeset. The override is good for only one modeset (regardless whether it's deferred or immediate). -//! -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 80 -//! -//! \param [in] hNvDisplay The NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle -//! enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] outputsMask A set of bits that identify all target outputs which are associated with the NVIDIA -//! display handle to apply the refresh rate override. When SLI is enabled, the -//! outputsMask only applies to the GPU that is driving the display output. -//! \param [in] refreshRate The override value. "0.0" means cancel the override. -//! \param [in] bSetDeferred -//! - "0": Apply the refresh rate override immediately in this API call.\p -//! - "1": Apply refresh rate at the next OS modeset. -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisplay or outputsMask is invalid -//! \retval NVAPI_OK The refresh rate override is correct set -//! \retval NVAPI_ERROR The operation failed -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId -// -//! This function gets the active outputId associated with the display handle. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 90 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] outputId The active display output ID associated with the selected display handle hNvDisplay. -//! The outputid will have only one bit set. In the case of Clone or Span mode, this will indicate the -//! display outputId of the primary display that the GPU is driving. See \ref handles. -//! -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId); - - -//! \ingroup dispcontrol -//! Used in NvAPI_GetDisplayPortInfo(). -typedef struct _NV_DISPLAY_PORT_INFO_V1 -{ - NvU32 version; //!< Structure version - NvU32 dpcd_ver; //!< DPCD version of the monitor - NV_DP_LINK_RATE maxLinkRate; //!< Maximum supported link rate - NV_DP_LANE_COUNT maxLaneCount; //!< Maximum supported lane count - NV_DP_LINK_RATE curLinkRate; //!< Current link rate - NV_DP_LANE_COUNT curLaneCount; //!< Current lane count - NV_DP_COLOR_FORMAT colorFormat; //!< Current color format - NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range - NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space - NV_DP_BPC bpc; //!< Current bit-per-component - NvU32 isDp : 1; //!< If the monitor is driven by a DisplayPort - NvU32 isInternalDp : 1; //!< If the monitor is driven by an NV Dp transmitter - NvU32 isColorCtrlSupported : 1; //!< If the color format change is supported - NvU32 is6BPCSupported : 1; //!< If 6 bpc is supported - NvU32 is8BPCSupported : 1; //!< If 8 bpc is supported - NvU32 is10BPCSupported : 1; //!< If 10 bpc is supported - NvU32 is12BPCSupported : 1; //!< If 12 bpc is supported - NvU32 is16BPCSupported : 1; //!< If 16 bpc is supported - NvU32 isYCrCb420Supported : 1; //!< If YCrCb420 is supported - NvU32 isYCrCb422Supported : 1; //!< If YCrCb422 is supported - NvU32 isYCrCb444Supported : 1; //!< If YCrCb444 is supported - NvU32 isRgb444SupportedOnCurrentMode : 1; //!< If Rgb444 is supported on the current mode - NvU32 isYCbCr444SupportedOnCurrentMode : 1; //!< If YCbCr444 is supported on the current mode - NvU32 isYCbCr422SupportedOnCurrentMode : 1; //!< If YCbCr422 is supported on the current mode - NvU32 isYCbCr420SupportedOnCurrentMode : 1; //!< If YCbCr420 is supported on the current mode - NvU32 is6BPCSupportedOnCurrentMode : 1; // if 6 bpc is supported On Current Mode - NvU32 is8BPCSupportedOnCurrentMode : 1; // if 8 bpc is supported On Current Mode - NvU32 is10BPCSupportedOnCurrentMode : 1; // if 10 bpc is supported On Current Mode - NvU32 is12BPCSupportedOnCurrentMode : 1; // if 12 bpc is supported On Current Mode - NvU32 is16BPCSupportedOnCurrentMode : 1; // if 16 bpc is supported On Current Mode - NvU32 isMonxvYCC601Capable : 1; // if xvYCC 601 extended colorimetry is supported - NvU32 isMonxvYCC709Capable : 1; // if xvYCC 709 extended colorimetry is supported - NvU32 isMonsYCC601Capable : 1; // if sYCC601 extended colorimetry is supported - NvU32 isMonAdobeYCC601Capable : 1; // if AdobeYCC601 extended colorimetry is supported - NvU32 isMonAdobeRGBCapable : 1; // if AdobeRGB extended colorimetry is supported - NvU32 isMonBT2020RGBCapable : 1; // if BT2020 RGB extended colorimetry is supported - NvU32 isMonBT2020YCCCapable : 1; // if BT2020 Y'CbCr extended colorimetry is supported - NvU32 isMonBT2020cYCCCapable : 1; // if BT2020 cYCbCr (constant luminance) extended colorimetry is supported - - NvU32 reserved : 4; //!< reserved - } NV_DISPLAY_PORT_INFO_V1; - - typedef NV_DISPLAY_PORT_INFO_V1 NV_DISPLAY_PORT_INFO; - -//! Macro for constructing the version field of NV_DISPLAY_PORT_INFO. -#define NV_DISPLAY_PORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1) -#define NV_DISPLAY_PORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,2) -#define NV_DISPLAY_PORT_INFO_VER NV_DISPLAY_PORT_INFO_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetDisplayPortInfo -// -//! \fn NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo) -//! DESCRIPTION: This function returns the current DisplayPort-related information on the specified device (monitor). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! This parameter is ignored when the outputId is a NvAPI displayId. -//! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed, -//! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from -//! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles. -//! \param [out] pInfo The DisplayPort information -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SetDisplayPort -// -//! \fn NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg) -//! DESCRIPTION: This function sets up DisplayPort-related configurations. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hNvDisplay NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] outputId This display output ID, when it's "0" it means the default outputId generated from the return of -//! NvAPI_GetAssociatedDisplayOutputId(). See \ref handles. -//! \param [in] pCfg The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dispcontrol -//! DisplayPort configuration settings - used in NvAPI_SetDisplayPort(). -typedef struct -{ - NvU32 version; //!< Structure version - 2 is the latest - NV_DP_LINK_RATE linkRate; //!< Link rate - NV_DP_LANE_COUNT laneCount; //!< Lane count - NV_DP_COLOR_FORMAT colorFormat; //!< Color format to set - NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range - NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space - NV_DP_BPC bpc; //!< Bit-per-component - NvU32 isHPD : 1; //!< If the control panel is making this call due to HPD - NvU32 isSetDeferred : 1; //!< Requires an OS modeset to finalize the setup if set - NvU32 isChromaLpfOff : 1; //!< Force the chroma low_pass_filter to be off - NvU32 isDitherOff : 1; //!< Force to turn off dither - NvU32 testLinkTrain : 1; //!< If testing mode, skip validation - NvU32 testColorChange : 1; //!< If testing mode, skip validation - -} NV_DISPLAY_PORT_CONFIG; - -//! \addtogroup dispcontrol -//! @{ -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2) -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1) -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2) -//! @} - - -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg); - - - - -//! \ingroup dispcontrol -//! Used in NvAPI_GetHDMISupportInfo(). -typedef struct _NV_HDMI_SUPPORT_INFO_V1 -{ - NvU32 version; //!< Structure version - - NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI - NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan - NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio - NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported - NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported - NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC 601 is supported - NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC 709 is supported - NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID) - NvU32 reserved : 24; //!< Reserved. - - NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension - } NV_HDMI_SUPPORT_INFO_V1; - -typedef struct _NV_HDMI_SUPPORT_INFO_V2 -{ - NvU32 version; //!< Structure version - - NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI - NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan - NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio - NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported - NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported - NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC extended colorimetry 601 is supported - NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC extended colorimetry 709 is supported - NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID) - NvU32 isMonsYCC601Capable : 1; //!< if sYCC601 extended colorimetry is supported - NvU32 isMonAdobeYCC601Capable : 1; //!< if AdobeYCC601 extended colorimetry is supported - NvU32 isMonAdobeRGBCapable : 1; //!< if AdobeRGB extended colorimetry is supported - NvU32 reserved : 21; //!< Reserved. - - NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension - } NV_HDMI_SUPPORT_INFO_V2; - -#define NV_HDMI_SUPPORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V1, 1) -#define NV_HDMI_SUPPORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V2, 2) - - - -#ifndef NV_HDMI_SUPPORT_INFO_VER - -typedef NV_HDMI_SUPPORT_INFO_V2 NV_HDMI_SUPPORT_INFO; -#define NV_HDMI_SUPPORT_INFO_VER NV_HDMI_SUPPORT_INFO_VER2 - -#endif - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetHDMISupportInfo -// -//! \fn NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo) -//! This API returns the current infoframe data on the specified device(monitor). -//! -//! \since Release: 95 -//! -//! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! This parameter is ignored when the outputId is a NvAPI displayId. -//! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed, -//! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from -//! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles. -//! \param [out] pInfo The monitor and GPU's HDMI support info -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo); - - -//! \ingroup dispcontrol - -typedef enum -{ - NV_INFOFRAME_CMD_GET_DEFAULT = 0, //!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM. - NV_INFOFRAME_CMD_RESET, //!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set. - NV_INFOFRAME_CMD_GET, //!< Get the current infoframe state. - NV_INFOFRAME_CMD_SET, //!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist. - NV_INFOFRAME_CMD_GET_OVERRIDE, //!< Get the override infoframe state, non-override fields will be set to value = AUTO, overridden fields will have the current override values. - NV_INFOFRAME_CMD_SET_OVERRIDE, //!< Set the override infoframe state, non-override fields will be set to value = AUTO, other values indicate override; persist across modeset/reboot - NV_INFOFRAME_CMD_GET_PROPERTY, //!< get properties associated with infoframe (each of the infoframe type will have properties) - NV_INFOFRAME_CMD_SET_PROPERTY, //!< set properties associated with infoframe -} NV_INFOFRAME_CMD; - - -typedef enum -{ - NV_INFOFRAME_PROPERTY_MODE_AUTO = 0, //!< Driver determines whether to send infoframes. - NV_INFOFRAME_PROPERTY_MODE_ENABLE, //!< Driver always sends infoframe. - NV_INFOFRAME_PROPERTY_MODE_DISABLE, //!< Driver never sends infoframe. - NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE, //!< Driver only sends infoframe when client requests it via infoframe escape call. -} NV_INFOFRAME_PROPERTY_MODE; - - -//! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist. -typedef enum -{ - NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0, - NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE, -} NV_INFOFRAME_PROPERTY_BLACKLIST; - -typedef struct -{ - NvU32 mode : 4; - NvU32 blackList : 2; - NvU32 reserved : 10; - NvU32 version : 8; - NvU32 length : 8; -} NV_INFOFRAME_PROPERTY; - -//! Byte1 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE, - NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_F17; - -//! Byte2 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO = 31, -} NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY; - -//! Byte 3 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT, - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_ITC; - -//! Byte 4 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION; - -//! Adding an Auto bit to each field -typedef struct -{ - NvU32 vic : 8; - NvU32 pixelRepeat : 5; - NvU32 colorSpace : 3; - NvU32 colorimetry : 3; - NvU32 extendedColorimetry : 4; - NvU32 rgbQuantizationRange : 3; - NvU32 yccQuantizationRange : 3; - NvU32 itContent : 2; - NvU32 contentTypes : 3; - NvU32 scanInfo : 3; - NvU32 activeFormatInfoPresent : 2; - NvU32 activeFormatAspectRatio : 5; - NvU32 picAspectRatio : 3; - NvU32 nonuniformScaling : 3; - NvU32 barInfo : 3; - NvU32 top_bar : 17; - NvU32 bottom_bar : 17; - NvU32 left_bar : 17; - NvU32 right_bar : 17; - NvU32 Future17 : 2; - NvU32 Future47 : 2; -} NV_INFOFRAME_VIDEO; - -//! Byte 1 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE; - -//! Byte 2 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY; - - - -//! Byte 3 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO = 63 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE; - - -//! Byte 4 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL =0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL = 0X31, - // all other values should default to auto - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO = 0x1FF -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION; - -//! Byte 5 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED, - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX; - -typedef struct -{ - NvU32 codingType : 5; - NvU32 codingExtensionType : 6; - NvU32 sampleSize : 3; - NvU32 sampleRate : 4; - NvU32 channelCount : 4; - NvU32 speakerPlacement : 9; - NvU32 downmixInhibit : 2; - NvU32 lfePlaybackLevel : 3; - NvU32 levelShift : 5; - NvU32 Future12 : 2; - NvU32 Future2x : 4; - NvU32 Future3x : 4; - NvU32 Future52 : 2; - NvU32 Future6 : 9; - NvU32 Future7 : 9; - NvU32 Future8 : 9; - NvU32 Future9 : 9; - NvU32 Future10 : 9; -} NV_INFOFRAME_AUDIO; - -typedef struct -{ - NvU32 version; //!< version of this structure - NvU16 size; //!< size of this structure - NvU8 cmd; //!< The actions to perform from NV_INFOFRAME_CMD - NvU8 type; //!< type of infoframe - - union - { - NV_INFOFRAME_PROPERTY property; //!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe. - NV_INFOFRAME_AUDIO audio; - NV_INFOFRAME_VIDEO video; - } infoframe; -} NV_INFOFRAME_DATA; - -//! Macro for constructing the version field of ::NV_INFOFRAME_DATA -#define NV_INFOFRAME_DATA_VER MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_InfoFrameControl -// -//! DESCRIPTION: This API controls the InfoFrame values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pInfoframeData Contains data corresponding to InfoFrame -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(__in NvU32 displayId, __inout NV_INFOFRAME_DATA *pInfoframeData); - - - - - - -//! \ingroup dispcontrol -//! @{ -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_ColorControl -// -//! \fn NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData) -//! DESCRIPTION: This API controls the Color values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pColorData Contains data corresponding to color information -//! -//! \return RETURN STATUS: -//! ::NVAPI_OK, -//! ::NVAPI_ERROR, -//! ::NVAPI_INVALID_ARGUMENT -// -/////////////////////////////////////////////////////////////////////////////// - -typedef enum -{ - NV_COLOR_CMD_GET = 1, - NV_COLOR_CMD_SET, - NV_COLOR_CMD_IS_SUPPORTED_COLOR, - NV_COLOR_CMD_GET_DEFAULT -} NV_COLOR_CMD; - -//! See Table 14 of CEA-861E. Not all of this is supported by the GPU. -typedef enum -{ - NV_COLOR_FORMAT_RGB = 0, - NV_COLOR_FORMAT_YUV422, - NV_COLOR_FORMAT_YUV444, - NV_COLOR_FORMAT_YUV420, - - NV_COLOR_FORMAT_DEFAULT = 0xFE, - NV_COLOR_FORMAT_AUTO = 0xFF -} NV_COLOR_FORMAT; - - - -typedef enum -{ - NV_COLOR_COLORIMETRY_RGB = 0, - NV_COLOR_COLORIMETRY_YCC601, - NV_COLOR_COLORIMETRY_YCC709, - NV_COLOR_COLORIMETRY_XVYCC601, - NV_COLOR_COLORIMETRY_XVYCC709, - NV_COLOR_COLORIMETRY_SYCC601, - NV_COLOR_COLORIMETRY_ADOBEYCC601, - NV_COLOR_COLORIMETRY_ADOBERGB, - NV_COLOR_COLORIMETRY_BT2020RGB, - NV_COLOR_COLORIMETRY_BT2020YCC, - NV_COLOR_COLORIMETRY_BT2020cYCC, - - NV_COLOR_COLORIMETRY_DEFAULT = 0xFE, - NV_COLOR_COLORIMETRY_AUTO = 0xFF -} NV_COLOR_COLORIMETRY; - -typedef enum _NV_DYNAMIC_RANGE -{ - NV_DYNAMIC_RANGE_VESA = 0x0, - NV_DYNAMIC_RANGE_CEA = 0x1, - - NV_DYNAMIC_RANGE_AUTO = 0xFF -} NV_DYNAMIC_RANGE; - -typedef enum _NV_BPC -{ - NV_BPC_DEFAULT = 0, - NV_BPC_6 = 1, - NV_BPC_8 = 2, - NV_BPC_10 = 3, - NV_BPC_12 = 4, - NV_BPC_16 = 5, -} NV_BPC; - -typedef enum _NV_COLOR_SELECTION_POLICY -{ - NV_COLOR_SELECTION_POLICY_USER = 0, //!< app/nvcpl make decision to select the desire color format - NV_COLOR_SELECTION_POLICY_BEST_QUALITY = 1, //!< driver/ OS make decision to select the best color format - NV_COLOR_SELECTION_POLICY_DEFAULT = NV_COLOR_SELECTION_POLICY_BEST_QUALITY, - NV_COLOR_SELECTION_POLICY_UNKNOWN = 0xFF, -} NV_COLOR_SELECTION_POLICY; - -typedef enum _NV_DESKTOP_COLOR_DEPTH -{ - NV_DESKTOP_COLOR_DEPTH_DEFAULT = 0x0, // set if the current setting should be kept - NV_DESKTOP_COLOR_DEPTH_8BPC = 0x1, //8 bit int per color component (8 bit int alpha) - NV_DESKTOP_COLOR_DEPTH_10BPC = 0x2, //10 bit int per color component (2 bit int alpha) - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT = 0x3, //16 bit float per color component (16 bit float alpha) - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_WCG = 0x4, //16 bit float per color component (16 bit float alpha) wide color gamut - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR = 0x5, //16 bit float per color component (16 bit float alpha) HDR - NV_DESKTOP_COLOR_DEPTH_MAX_VALUE = NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR, // must be set to highest enum value -} NV_DESKTOP_COLOR_DEPTH; - -typedef struct _NV_COLOR_DATA_V1 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - } data; -} NV_COLOR_DATA_V1; - -typedef struct _NV_COLOR_DATA_V2 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - } data; -} NV_COLOR_DATA_V2; - -typedef struct _NV_COLOR_DATA_V3 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - } data; -} NV_COLOR_DATA_V3; - -typedef struct _NV_COLOR_DATA_V4 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy - } data; -} NV_COLOR_DATA_V4; - -typedef struct _NV_COLOR_DATA_V5 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy - NV_DESKTOP_COLOR_DEPTH depth; //!< One of NV_DESKTOP_COLOR_DEPTH enum values. - } data; -} NV_COLOR_DATA_V5; - -typedef NV_COLOR_DATA_V5 NV_COLOR_DATA; - -#define NV_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V1, 1) -#define NV_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V2, 2) -#define NV_COLOR_DATA_VER3 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V3, 3) -#define NV_COLOR_DATA_VER4 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V4, 4) -#define NV_COLOR_DATA_VER5 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V5, 5) -#define NV_COLOR_DATA_VER NV_COLOR_DATA_VER5 - -NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData); - -//! @} - - -typedef enum -{ - NV_STATIC_METADATA_TYPE_1 = 0 //!< Tells the type of structure used to define the Static Metadata Descriptor block. -}NV_STATIC_METADATA_DESCRIPTOR_ID; - -typedef struct _NV_HDR_CAPABILITIES_V1 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 reserved :27; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - }display_data; -} NV_HDR_CAPABILITIES_V1; - -typedef struct _NV_HDR_CAPABILITIES_V2 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isDolbyVisionSupported :1; //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported; - NvU32 reserved :26; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - }display_data; - - struct - { - NvU32 VSVDB_version : 3; //!< Version of Vendor Data block,Version 0: 25 bytes Version 1: 14 bytes - NvU32 dm_version : 8; //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM - NvU32 supports_2160p60hz : 1; //!< If set sink is capable of 4kx2k @ 60hz - NvU32 supports_YUV422_12bit : 1; //!< If set, sink is capable of YUV422-12 bit - NvU32 supports_global_dimming : 1; //!< Indicates if sink supports global dimming - NvU32 colorimetry : 1; //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise - NvU32 supports_backlight_control : 2; //!< This is set when sink is using lowlatency interface and can control its backlight. - NvU32 backlt_min_luma : 2; //!< It is the level for Backlt min luminance value. - NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink. - NvU32 supports_10b_12b_444 : 2; //!< It is set when interface supported is low latency, it tells whether it supports 10 bit or 12 bit RGB 4:4:4 or YCbCr 4:4:4 or both. - NvU32 reserved : 9; //!< Should be set to zero - //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode - NvU16 target_min_luminance; //!< Represents min luminance level of Sink - NvU16 target_max_luminance; //!< Represents max luminance level of sink - NvU16 cc_red_x; //!< Red primary chromaticity coordinate x - NvU16 cc_red_y; //!< Red primary chromaticity coordinate y - NvU16 cc_green_x; //!< Green primary chromaticity coordinate x - NvU16 cc_green_y; //!< Green primary chromaticity coordinate Y - NvU16 cc_blue_x; //!< Blue primary chromaticity coordinate x - NvU16 cc_blue_y; //!< Blue primary chromaticity coordinate y - NvU16 cc_white_x; //!< White primary chromaticity coordinate x - NvU16 cc_white_y; //!< White primary chromaticity coordinate y - }dv_static_metadata; - -} NV_HDR_CAPABILITIES_V2; - -typedef struct _NV_HDR_CAPABILITIES_V3 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isDolbyVisionSupported :1; //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported; - NvU32 isHdr10PlusSupported :1; //!< HDR10+ (Sink Side Tonemapping) is supported - NvU32 isHdr10PlusGamingSupported :1; //!< HDR10+ Gaming, a.k.a HDR10+ Source Side Tonemapping (SSTM), is supported - NvU32 reserved :24; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - }display_data; - - struct - { - NvU32 VSVDB_version : 3; //!< Version of Vendor Data block,Version 0: 25 bytes Version 1: 14 bytes - NvU32 dm_version : 8; //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM - NvU32 supports_2160p60hz : 1; //!< If set sink is capable of 4kx2k @ 60hz - NvU32 supports_YUV422_12bit : 1; //!< If set, sink is capable of YUV422-12 bit - NvU32 supports_global_dimming : 1; //!< Indicates if sink supports global dimming - NvU32 colorimetry : 1; //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise - NvU32 supports_backlight_control : 2; //!< This is set when sink is using lowlatency interface and can control its backlight. - NvU32 backlt_min_luma : 2; //!< It is the level for Backlt min luminance value (reserved = 0x3 in latest DV spec). - NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink. - NvU32 supports_10b_12b_444 : 2; //!< It is set when interface supported is low latency, it tells whether it supports 10 bit or 12 bit RGB 4:4:4 or YCbCr 4:4:4 or both. - NvU32 parity : 1; //!< resolution and frame-rate relationships between Dolby Vision and other video processing - NvU32 reserved : 8; //!< Should be set to zero - - //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode - NvU16 target_min_luminance; //!< Represents min luminance level of Sink - NvU16 target_max_luminance; //!< Represents max luminance level of sink - NvU16 cc_red_x; //!< Red primary chromaticity coordinate x - NvU16 cc_red_y; //!< Red primary chromaticity coordinate y - NvU16 cc_green_x; //!< Green primary chromaticity coordinate x - NvU16 cc_green_y; //!< Green primary chromaticity coordinate Y - NvU16 cc_blue_x; //!< Blue primary chromaticity coordinate x - NvU16 cc_blue_y; //!< Blue primary chromaticity coordinate y - NvU16 cc_white_x; //!< White primary chromaticity coordinate x - NvU16 cc_white_y; //!< White primary chromaticity coordinate y - }dv_static_metadata; - - struct - { - NvU16 application_version : 2; //!< Application version of HDR10+ Vendor Specific Video Data Block - NvU16 full_frame_peak_luminance_index : 2; //!< Full frame peak luminance index - NvU16 peak_luminance_index : 4; //!< Peak luminance index - NvU16 reserved : 8; - }hdr10plus_vsvdb; - -} NV_HDR_CAPABILITIES_V3; - -#define NV_HDR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V1, 1) -#define NV_HDR_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V2, 2) -#define NV_HDR_CAPABILITIES_VER3 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V3, 3) -#define NV_HDR_CAPABILITIES_VER NV_HDR_CAPABILITIES_VER3 -typedef NV_HDR_CAPABILITIES_V3 NV_HDR_CAPABILITIES; - -//! \ingroup dispcontrol -//! @{ -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetHdrCapabilities -// -//! \fn NvAPI_Disp_GetHdrCapabilities(NvU32 displayId, NV_HDR_CAPABILITIES *pHdrCapabilities) -//! DESCRIPTION: This API gets High Dynamic Range (HDR) capabilities of the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pHdrCapabilities display's HDR capabilities -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetHdrCapabilities(__in NvU32 displayId, __inout NV_HDR_CAPABILITIES *pHdrCapabilities); - -//! @} - - -typedef enum -{ - NV_HDR_CMD_GET = 0, //!< Get current HDR output configuration - NV_HDR_CMD_SET = 1 //!< Set HDR output configuration -} NV_HDR_CMD; - -typedef enum -{ - // Official production-ready HDR modes - NV_HDR_MODE_OFF = 0, //!< Turn off HDR - NV_HDR_MODE_UHDA = 2, //!< Source: CCCS [a.k.a FP16 scRGB, linear, sRGB primaries, [-65504,0, 65504] range, RGB(1,1,1) = 80nits] Output : UHDA HDR [a.k.a HDR10, RGB/YCC 10/12bpc ST2084(PQ) EOTF RGB(1,1,1) = 10000 nits, Rec2020 color primaries, ST2086 static HDR metadata]. This is the only supported production HDR mode. - - // Experimental - NV_HDR_MODE_UHDA_PASSTHROUGH = 5, //!< Experimental mode only, not for production! Source: HDR10 RGB 10bpc Output: HDR10 RGB 10 bpc - signal UHDA HDR mode (PQ + Rec2020) to the sink but send source pixel values unmodified (no PQ or Rec2020 conversions) - assumes source is already in HDR10 format. - NV_HDR_MODE_DOLBY_VISION = 7, //!< Experimental mode only, not for production! Source: RGB8 Dolby Vision encoded (12 bpc YCbCr422 packed into RGB8) Output: Dolby Vision encoded : Application is to encoded frames in DV format and embed DV dynamic metadata as described in Dolby Vision specification. - - // Unsupported/obsolete HDR modes - NV_HDR_MODE_EDR = 3, //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : EDR (Extended Dynamic Range) - HDR content is tonemapped and gamut mapped to output on regular SDR display set to max luminance ( ~300 nits ). - NV_HDR_MODE_SDR = 4, //!< Do not use! Internal test mode only, to be removed. Source: any Output: SDR (Standard Dynamic Range), we continuously send SDR EOTF InfoFrame signaling, HDMI compliance testing. - NV_HDR_MODE_UHDA_NB = 6, //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : notebook HDR - NV_HDR_MODE_UHDBD = 2 //!< Do not use! Obsolete, to be removed. NV_HDR_MODE_UHDBD == NV_HDR_MODE_UHDA, reflects obsolete pre-UHDA naming convention. - -} NV_HDR_MODE; - -typedef struct _NV_HDR_COLOR_DATA_V1 -{ - NvU32 version; //!< Version of this structure - NV_HDR_CMD cmd; //!< Command get/set - NV_HDR_MODE hdrMode; //!< HDR mode - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - } mastering_display_data; -} NV_HDR_COLOR_DATA_V1; - -typedef struct _NV_HDR_COLOR_DATA_V2 -{ - NvU32 version; //!< Version of this structure - NV_HDR_CMD cmd; //!< Command get/set - NV_HDR_MODE hdrMode; //!< HDR mode - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - } mastering_display_data; - - NV_COLOR_FORMAT hdrColorFormat; //!< Optional, One of NV_COLOR_FORMAT enum values, if set it will apply requested color format for HDR session - NV_DYNAMIC_RANGE hdrDynamicRange; //!< Optional, One of NV_DYNAMIC_RANGE enum values, if set it will apply requested dynamic range for HDR session - NV_BPC hdrBpc; //!< Optional, One of NV_BPC enum values, if set it will apply requested color depth - //!< Dolby Vision mode: DV supports specific combinations of colorformat, dynamic range and bpc. Please refer Dolby Vision specification. - //!< If invalid or no combination is passed driver will force default combination of RGB format + full range + 8bpc. - //!< HDR mode: These fields are ignored in hdr mode -} NV_HDR_COLOR_DATA_V2; - -#define NV_HDR_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V1, 1) -#define NV_HDR_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V2, 2) - -#ifndef NV_HDR_COLOR_DATA_VER -#define NV_HDR_COLOR_DATA_VER NV_HDR_COLOR_DATA_VER2 -typedef NV_HDR_COLOR_DATA_V2 NV_HDR_COLOR_DATA; -#endif - -//! \ingroup dispcontrol -//! @{ - /////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_HdrColorControl -// -//! \fn NvAPI_Disp_HdrColorControl(NvU32 displayId, NV_HDR_COLOR_DATA *pHdrColorData) -//! DESCRIPTION: This API configures High Dynamic Range (HDR) and Extended Dynamic Range (EDR) output. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pHdrColorData HDR configuration data -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_HdrColorControl(__in NvU32 displayId, __inout NV_HDR_COLOR_DATA *pHdrColorData); - -typedef enum _NV_COLORSPACE_TYPE -{ - NV_COLORSPACE_sRGB = 0, //!< sRGB IEC 61966-2-1:1999 == DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - NV_COLORSPACE_xRGB = 1, //!< FP16 linear with sRGB color primaries == DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - NV_COLORSPACE_REC2100 = 12, //!< ITU-R Rec BT.2100 (HDR10) == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 -} NV_COLORSPACE_TYPE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetSourceColorSpace -// -//! \fn NvAPI_Disp_SetSourceColorSpace(__in NvU32 displayId, __in NV_SOURCE_COLORSPACE colorSpace) -//! DESCRIPTION: This API sets colorspace of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [in] colorSpaceType Source colorspace type -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetSourceColorSpace(__in NvU32 displayId, __in NV_COLORSPACE_TYPE colorSpaceType); - -#define NV_SOURCE_PID_CURRENT 0 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetSourceColorSpace -// -//! \fn NvAPI_Disp_GetSourceColorSpace(__in NvU32 displayId, __inout NV_SOURCE_COLORSPACE* pColorSpace) -//! DESCRIPTION: This API gets colorspace of the source identified by the process id. -//! Set sourcePID = NV_SOURCE_PID_CURRENT to use the process id of the caller. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pColorSpaceType Source colorspace type -//! \param [in] sourcePID Source process id (PID) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetSourceColorSpace(__in NvU32 displayId, __inout NV_COLORSPACE_TYPE* pColorSpaceType, NvU64 sourcePID); - -typedef struct _NV_HDR_METADATA_V1 -{ - NvU32 version; //!< Version of this structure - - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) -} NV_HDR_METADATA_V1; - -#define NV_HDR_METADATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_METADATA_V1, 1) -#define NV_HDR_METADATA_VER NV_HDR_METADATA_VER1 -typedef NV_HDR_METADATA_V1 NV_HDR_METADATA; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetSourceHdrMetadata -// -//! \fn NvAPI_Disp_SetSourceHdrMetadata(__in NvU32 displayId, __in NV_HDR_METADATA* pMetadata) -//! DESCRIPTION: This API sets HDR metadata of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [in] pMetadata HDR metadata -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetSourceHdrMetadata(__in NvU32 displayId, __in NV_HDR_METADATA* pMetadata); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetSourceHdrMetadata -// -//! \fn NvAPI_NvAPI_Disp_GetSourceHdrMetadata(__in NvU32 displayId, __inout NV_HDR_METADATA* pMetadata) -//! DESCRIPTION: This API gets HDR metadata of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pMetadata HDR metadata -//! \param [in] sourcePID Source process id (PID) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetSourceHdrMetadata(__in NvU32 displayId, __inout NV_HDR_METADATA* pMetadata, NvU64 sourcePID); - -typedef enum _NV_DISPLAY_OUTPUT_MODE -{ - NV_DISPLAY_OUTPUT_MODE_SDR = 0, - NV_DISPLAY_OUTPUT_MODE_HDR10 = 1, - NV_DISPLAY_OUTPUT_MODE_HDR10PLUS_GAMING = 2 -} NV_DISPLAY_OUTPUT_MODE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetOutputMode -// -//! \fn NvAPI_Disp_SetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode) -//! DESCRIPTION: This API sets display output mode and returns the display output mode used by the OS before the API call. -//! Only one application at a time can override OS display output mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [in, out] pDisplayMode New/original display output mode -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_RESOURCE_IN_USE the output mode can't be changed as it is already overriden by another application. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetOutputMode -// -//! \fn NvAPI_Disp_GetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode) -//! DESCRIPTION: This API gets display output mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [out] pDisplayMode Current display output mode -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode); - -typedef enum _NV_HDR_TONEMAPPING_METHOD -{ - NV_HDR_TONEMAPPING_APP = 0, - NV_HDR_TONEMAPPING_GPU = 1 -} NV_HDR_TONEMAPPING_METHOD; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetHdrToneMapping -// -//! \fn NvAPI_Disp_SetHdrToneMapping(__in NvU32 displayId, __in NV_HDR_TONEMAPPING_METHOD hdrTonemapping) -//! DESCRIPTION: This API sets HDR tonemapping method for the display -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [in] hdrTonemapping HDR tonemapping method -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetHdrToneMapping(__in NvU32 displayId, __in NV_HDR_TONEMAPPING_METHOD hdrTonemapping); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetHdrToneMapping -// -//! \fn NvAPI_Disp_GetHdrToneMapping(__in NvU32 displayId, __inout NV_HDR_TONEMAPPING_METHOD* pHdrTonemapping) -//! DESCRIPTION: This API gets HDR tonemapping method for the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId display identifier -//! \param [out] pHdrTonemapping HDR tonemapping method -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetHdrToneMapping(__in NvU32 displayId, __inout NV_HDR_TONEMAPPING_METHOD* pHdrTonemapping); -//! @} - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_GetTiming(). -typedef struct -{ - NvU32 isInterlaced : 4; //!< To retrieve interlaced/progressive timing - NvU32 reserved0 : 12; - union - { - NvU32 tvFormat : 8; //!< The actual analog HD/SDTV format. Used when the timing type is - //! NV_TIMING_OVERRIDE_ANALOG_TV and width==height==rr==0. - NvU32 ceaId : 8; //!< The EIA/CEA 861B/D predefined short timing descriptor ID. - //! Used when the timing type is NV_TIMING_OVERRIDE_EIA861 - //! and width==height==rr==0. - NvU32 nvPsfId : 8; //!< The NV predefined PsF format Id. - //! Used when the timing type is NV_TIMING_OVERRIDE_NV_PREDEFINED. - }; - NvU32 scaling : 8; //!< Define preferred scaling -}NV_TIMING_FLAG; - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_GetTiming(). -typedef struct _NV_TIMING_INPUT -{ - NvU32 version; //!< (IN) structure version - - NvU32 width; //!< Visible horizontal size - NvU32 height; //!< Visible vertical size - float rr; //!< Timing refresh rate - - NV_TIMING_FLAG flag; //!< Flag containing additional info for timing calculation. - - NV_TIMING_OVERRIDE type; //!< Timing type(formula) to use for calculating the timing -}NV_TIMING_INPUT; - -#define NV_TIMING_INPUT_VER MAKE_NVAPI_VERSION(NV_TIMING_INPUT,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetTiming -// -//! DESCRIPTION: This function calculates the timing from the visible width/height/refresh-rate and timing type info. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] displayId Display ID of the display. -//! \param [in] timingInput Inputs used for calculating the timing. -//! \param [out] pTiming Pointer to the NV_TIMING structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetTiming( __in NvU32 displayId,__in NV_TIMING_INPUT *timingInput, __out NV_TIMING *pTiming); - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetMonitorCapabilities -// -//! \fn NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities) -//! DESCRIPTION: This API returns the Monitor capabilities -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pMonitorCapabilities The monitor support info -//! -//! \return ::NVAPI_OK, -//! ::NVAPI_ERROR, -//! ::NVAPI_INVALID_ARGUMENT -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -//! @{ - - -//! HDMI-related and extended CAPs -typedef enum -{ - // hdmi related caps - NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000, - NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001, - // backend caps - NV_MONITOR_CAPS_TYPE_GENERIC = 0x1002, -} NV_MONITOR_CAPS_TYPE; - - - -typedef struct _NV_MONITOR_CAPS_VCDB -{ - NvU8 quantizationRangeYcc : 1; - NvU8 quantizationRangeRgb : 1; - NvU8 scanInfoPreferredVideoFormat : 2; - NvU8 scanInfoITVideoFormats : 2; - NvU8 scanInfoCEVideoFormats : 2; -} NV_MONITOR_CAPS_VCDB; - - -//! See NvAPI_DISP_GetMonitorCapabilities(). -typedef struct _NV_MONITOR_CAPS_VSDB -{ - // byte 1 - NvU8 sourcePhysicalAddressB : 4; //!< Byte 1 - NvU8 sourcePhysicalAddressA : 4; //!< Byte 1 - // byte 2 - NvU8 sourcePhysicalAddressD : 4; //!< Byte 2 - NvU8 sourcePhysicalAddressC : 4; //!< Byte 2 - // byte 3 - NvU8 supportDualDviOperation : 1; //!< Byte 3 - NvU8 reserved6 : 2; //!< Byte 3 - NvU8 supportDeepColorYCbCr444 : 1; //!< Byte 3 - NvU8 supportDeepColor30bits : 1; //!< Byte 3 - NvU8 supportDeepColor36bits : 1; //!< Byte 3 - NvU8 supportDeepColor48bits : 1; //!< Byte 3 - NvU8 supportAI : 1; //!< Byte 3 - // byte 4 - NvU8 maxTmdsClock; //!< Bye 4 - // byte 5 - NvU8 cnc0SupportGraphicsTextContent : 1; //!< Byte 5 - NvU8 cnc1SupportPhotoContent : 1; //!< Byte 5 - NvU8 cnc2SupportCinemaContent : 1; //!< Byte 5 - NvU8 cnc3SupportGameContent : 1; //!< Byte 5 - NvU8 reserved8 : 1; //!< Byte 5 - NvU8 hasVicEntries : 1; //!< Byte 5 - NvU8 hasInterlacedLatencyField : 1; //!< Byte 5 - NvU8 hasLatencyField : 1; //!< Byte 5 - // byte 6 - NvU8 videoLatency; //!< Byte 6 - // byte 7 - NvU8 audioLatency; //!< Byte 7 - // byte 8 - NvU8 interlacedVideoLatency; //!< Byte 8 - // byte 9 - NvU8 interlacedAudioLatency; //!< Byte 9 - // byte 10 - NvU8 reserved13 : 7; //!< Byte 10 - NvU8 has3dEntries : 1; //!< Byte 10 - // byte 11 - NvU8 hdmi3dLength : 5; //!< Byte 11 - NvU8 hdmiVicLength : 3; //!< Byte 11 - // Remaining bytes - NvU8 hdmi_vic[7]; //!< Keeping maximum length for 3 bits - NvU8 hdmi_3d[31]; //!< Keeping maximum length for 5 bits -} NV_MONITOR_CAPS_VSDB; - -typedef struct _NV_MONITOR_CAPS_GENERIC -{ - NvU8 supportVRR : 1; //!< monitor supports variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 supportULMB : 1; //!< monitor supports ULMB with variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 isTrueGsync : 1; //!< whether the monitor is actually GSYNC or adaptive sync monitor : 0 for adaptive sync. - NvU8 isRLACapable : 1; //!< whether monitor supports RLA - NvU8 currentlyCapableOfVRR : 1; //!< monitor currently supports VRR on applied display settings. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 reserved : 3; -} NV_MONITOR_CAPS_GENERIC; - -//! See NvAPI_DISP_GetMonitorCapabilities(). -typedef struct _NV_MONITOR_CAPABILITIES_V1 -{ - NvU32 version; - NvU16 size; - NvU32 infoType; - NvU32 connectorType; //!< Out: VGA, TV, DVI, HDMI, DP - NvU8 bIsValidInfo : 1; //!< Boolean : Returns invalid if requested info is not present such as VCDB not present - union { - NV_MONITOR_CAPS_VSDB vsdb; - NV_MONITOR_CAPS_VCDB vcdb; - NV_MONITOR_CAPS_GENERIC caps; - } data; -} NV_MONITOR_CAPABILITIES_V1; - -typedef NV_MONITOR_CAPABILITIES_V1 NV_MONITOR_CAPABILITIES; - -//! Macro for constructing the version field of ::NV_MONITOR_CAPABILITIES_V1 -#define NV_MONITOR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES_V1,1) -#define NV_MONITOR_CAPABILITIES_VER NV_MONITOR_CAPABILITIES_VER1 - -//! @} - -//! SUPPORTED OS: Windows 7 and higher -//! -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(__in NvU32 displayId, __inout NV_MONITOR_CAPABILITIES *pMonitorCapabilities); - -//! \ingroup dispcontrol -typedef struct _NV_MONITOR_COLOR_DATA -{ - NvU32 version; -// We are only supporting DP monitors for now. We need to extend this to HDMI panels as well - NV_DP_COLOR_FORMAT colorFormat; //!< One of the supported color formats - NV_DP_BPC backendBitDepths; //!< One of the supported bit depths -} NV_MONITOR_COLOR_CAPS_V1; - -typedef NV_MONITOR_COLOR_CAPS_V1 NV_MONITOR_COLOR_CAPS; - -//! \ingroup dispcontrol -#define NV_MONITOR_COLOR_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_COLOR_CAPS_V1,1) -#define NV_MONITOR_COLOR_CAPS_VER NV_MONITOR_COLOR_CAPS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetMonitorColorCapabilities -// -//! DESCRIPTION: This API returns all the color formats and bit depth values supported by a given DP monitor. -//! -//! USAGE: Sequence of calls which caller should make to get the information. -//! 1. First call NvAPI_DISP_GetMonitorColorCapabilities() with pMonitorColorCapabilities as NULL to get the count. -//! 2. Allocate memory for color caps(NV_MONITOR_COLOR_CAPS) array. -//! 3. Call NvAPI_DISP_GetMonitorColorCapabilities() again with the pointer to the memory allocated to get all the -//! color capabilities. -//! -//! Note : -//! 1. pColorCapsCount should never be NULL, else the API will fail with NVAPI_INVALID_ARGUMENT. -//! 2. *pColorCapsCount returned from the API will always be the actual count in any/every call. -//! 3. Memory size to be allocated should be (*pColorCapsCount * sizeof(NV_MONITOR_COLOR_CAPS)). -//! 4. If the memory allocated is less than what is required to return all the timings, this API will return the -//! amount of information which can fit in user provided buffer and API will return NVAPI_INSUFFICIENT_BUFFER. -//! 5. If the caller specifies a greater value for *pColorCapsCount in second call to NvAPI_DISP_GetMonitorColorCapabilities() -//! than what was returned from first call, the API will return only the actual number of elements in the color -//! capabilities array and the extra buffer will remain unused. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in, out] pMonitorColorCapabilities The monitor color capabilities information -//! \param [in, out] pColorCapsCount - During input, the number of elements allocated for the pMonitorColorCapabilities pointer -//! - During output, the actual number of color data elements the monitor supports -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INSUFFICIENT_BUFFER The input buffer size is not sufficient to hold the total contents. In this case -//! *pColorCapsCount will hold the required amount of elements. -//! \retval NVAPI_INVALID_DISPLAY_ID The input monitor is either not connected or is not a DP panel. -//! -//! \ingroup dispcontrol -//! -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetMonitorColorCapabilities(__in NvU32 displayId, __inout_ecount_part_opt(*pColorCapsCount, *pColorCapsCount) NV_MONITOR_COLOR_CAPS *pMonitorColorCapabilities, __inout NvU32 *pColorCapsCount); - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay(). -typedef struct -{ - NvU32 version; - - // the source mode information - NvU32 width; //!< Source surface(source mode) width - NvU32 height; //!< Source surface(source mode) height - NvU32 depth; //!< Source surface color depth."0" means all 8/16/32bpp - NV_FORMAT colorFormat; //!< Color format (optional) - - NV_VIEWPORTF srcPartition; //!< For multimon support, should be set to (0,0,1.0,1.0) for now. - - float xRatio; //!< Horizontal scaling ratio - float yRatio; //!< Vertical scaling ratio - - NV_TIMING timing; //!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc. - NvU32 hwModeSetOnly : 1; //!< If set, it means a hardware modeset without OS update - -}NV_CUSTOM_DISPLAY; - -//! \ingroup dispcontrol -//! Used in NV_CUSTOM_DISPLAY. -#define NV_CUSTOM_DISPLAY_VER MAKE_NVAPI_VERSION(NV_CUSTOM_DISPLAY,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_EnumCustomDisplay -// -//! DESCRIPTION: This API enumerates the custom timing specified by the enum index. -//! The client should keep enumerating until it returns NVAPI_END_ENUMERATION. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] displayId Dispaly ID of the display. -//! \param [in] index Enum index -//! \param [inout] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_EnumCustomDisplay( __in NvU32 displayId, __in NvU32 index, __inout NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_TryCustomDisplay -// -//! DESCRIPTION: This API is used to set up a custom display without saving the configuration on multiple displays. -//! -//! \note -//! All the members of srcPartition, present in NV_CUSTOM_DISPLAY structure, should have their range in (0.0,1.0). -//! In clone mode the timings can applied to both the target monitors but only one target at a time. \n -//! For the secondary target the applied timings works under the following conditions: -//! - If the secondary monitor EDID supports the selected timing, OR -//! - If the selected custom timings can be scaled by the secondary monitor for the selected source resolution on the primary, OR -//! - If the selected custom timings matches the existing source resolution on the primary. -//! Setting up a custom display on non-active but connected monitors is supported only for Win7 and above. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of the target display Dispaly IDs - See \ref handles. -//! \param [in] count Total number of the incoming Display IDs and corresponding NV_CUSTOM_DISPLAY structure. This is for the multi-head support. -//! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure array. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_TryCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in_ecount(count) NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_DeleteCustomDisplay -// -//! DESCRIPTION: This function deletes the custom display configuration, specified from the registry for all the displays whose display IDs are passed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved. -//! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support. -//! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_DeleteCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SaveCustomDisplay -// -//! DESCRIPTION: This function saves the current hardware display configuration on the specified Display IDs as a custom display configuration. -//! This function should be called right after NvAPI_DISP_TryCustomDisplay() to save the custom display from the current -//! hardware context. This function will not do anything if the custom display configuration is not tested on the hardware. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved. -//! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support. -//! \param [in] isThisOutputIdOnly If set, the saved custom display will only be applied on the monitor with the same outputId (see \ref handles). -//! \param [in] isThisMonitorIdOnly If set, the saved custom display will only be applied on the monitor with the same EDID ID or -//! the same TV connector in case of analog TV. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SaveCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NvU32 isThisOutputIdOnly, __in NvU32 isThisMonitorIdOnly); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_RevertCustomDisplayTrial -// -//! DESCRIPTION: This API is used to restore the display configuration, that was changed by calling NvAPI_DISP_TryCustomDisplay(). This function -//! must be called only after a custom display configuration is tested on the hardware, using NvAPI_DISP_TryCustomDisplay(), -//! otherwise no action is taken. On Vista, NvAPI_DISP_RevertCustomDisplayTrial should be called with an active display that -//! was affected during the NvAPI_DISP_TryCustomDisplay() call, per GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Pointer to display Id, of an active display. -//! \param [in] count Total number of incoming Display IDs. For future use only. Currently it is expected to be passed as 1. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_RevertCustomDisplayTrial( __in_ecount(count) NvU32* pDisplayIds, __in NvU32 count); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetView -// -//! This API lets caller retrieve the target display arrangement for selected source display handle. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW. -//! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] pTargets User allocated storage to retrieve an array of NV_VIEW_TARGET_INFO. Can be NULL to retrieve -//! the targetCount. -//! \param [in,out] targetMaskCount Count of target device mask specified in pTargetMask. -//! \param [out] targetView Target view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.") -NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView); - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetViewEx -// -//! DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW. -//! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in,out] pPathInfo Count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount. -//! \param [in,out] pPathCount Number of elements in array pPathInfo->path. -//! \param [out] pTargetViewMode Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.") -NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetSupportedViews -// -//! This API lets caller enumerate all the supported NVIDIA display views - nView and Dualview modes. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] pTargetViews Array of supported views. Can be NULL to retrieve the pViewCount first. -//! \param [in,out] pViewCount Count of supported views. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount); - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetDisplayIdByDisplayName -// -//! DESCRIPTION: This API retrieves the Display Id of a given display by -//! display name. The display must be active to retrieve the -//! displayId. In the case of clone mode or Surround gaming, -//! the primary or top-left display will be returned. -//! -//! \param [in] displayName Name of display (Eg: "\\DISPLAY1" to -//! retrieve the displayId for. -//! \param [out] displayId Display ID of the requested display. -//! -//! retval ::NVAPI_OK: Capabilties have been returned. -//! retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetDisplayIdByDisplayName(const char *displayName, NvU32* displayId); - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetDisplayConfig -// -//! DESCRIPTION: This API lets caller retrieve the current global display -//! configuration. -//! USAGE: The caller might have to call this three times to fetch all the required configuration details as follows: -//! First Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set to NULL to fetch pathInfoCount. -//! Second Pass: Allocate memory for pathInfo with respect to the number of pathInfoCount(from First Pass) to fetch -//! targetInfoCount. If sourceModeInfo is needed allocate memory or it can be initialized to NULL. -//! Third Pass(Optional, only required if target information is required): Allocate memory for targetInfo with respect -//! to number of targetInfoCount(from Second Pass). -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in,out] pathInfoCount Number of elements in pathInfo array, returns number of valid topologies, this cannot be null. -//! \param [in,out] pathInfo Array of path information -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_ARGUMENT - Invalid input parameter. Following can be the reason for this return value: -//! -# pathInfoCount is NULL. -//! -# *pathInfoCount is 0 and pathInfo is not NULL. -//! -# *pathInfoCount is not 0 and pathInfo is NULL. -//! \retval NVAPI_DEVICE_BUSY - ModeSet has not yet completed. Please wait and call it again. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetDisplayConfig(__inout NvU32 *pathInfoCount, __out_ecount_full_opt(*pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SetDisplayConfig -// -// -//! DESCRIPTION: This API lets caller apply a global display configuration -//! across multiple GPUs. -//! -//! If all sourceIds are zero, then NvAPI will pick up sourceId's based on the following criteria : -//! - If user provides sourceModeInfo then we are trying to assign 0th sourceId always to GDIPrimary. -//! This is needed since active windows always moves along with 0th sourceId. -//! - For rest of the paths, we are incrementally assigning the sourceId per adapter basis. -//! - If user doesn't provide sourceModeInfo then NVAPI just picks up some default sourceId's in incremental order. -//! Note : NVAPI will not intelligently choose the sourceIDs for any configs that does not need a modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pathInfoCount Number of supplied elements in pathInfo -//! \param [in] pathInfo Array of path information -//! \param [in] flags A bitwise OR of supported flags from NV_DISPLAYCONFIG_FLAGS. -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SetDisplayConfig(__in NvU32 pathInfoCount, __in_ecount(pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO* pathInfo, __in NvU32 flags); - - - -//! \ingroup dispcontrol -//! @{ -typedef struct _NV_EDID_DATA_V1 -{ - NvU32 version; //!< Structure version. - NvU8 *pEDID; //!< Pointer to EDID data. - NvU32 sizeOfEDID; //!< Size of EDID data. -} NV_EDID_DATA_V1; - -typedef struct _NV_EDID_DATA_V2 -{ - NvU32 version; //!< Structure version. - NvU8 *pEDID; //!< Pointer to EDID data. - NvU32 sizeOfEDID; //!< Size of EDID data. - NvU32 reserved[8]; //!< Reserved for future use. -} NV_EDID_DATA_V2; - -typedef NV_EDID_DATA_V2 NV_EDID_DATA; -#define NV_EDID_DATA_VER1 MAKE_NVAPI_VERSION(NV_EDID_DATA_V1, 1) -#define NV_EDID_DATA_VER2 MAKE_NVAPI_VERSION(NV_EDID_DATA_V2, 2) - -#define NV_EDID_DATA_VER NV_EDID_DATA_VER2 -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetEdidData -// -//! \code -//! DESCRIPTION: This API returns the EDID data for the specified display Id. -//! (NvAPI_GPU_GetConnectedDisplayIds() can be used to get the DisplayIds). -//! -//! USAGE: The caller has to call this API two times to fetch the required details as follows: -//! First Pass : Caller should call NvAPI_DISP_GetEdidData() with pEdidParams->pEDID set to NULL, -//! to get the size of the EDID buffer in pEdidParams->sizeOfEDID. -//! Second Pass: Allocate memory for the EDID buffer of the size - pEdidParams->sizeOfEDID, -//! and call the API again to get the EDID buffer populated. -//! -//! -//! \param [in] displayId - NVIDIA Display ID -//! \param [inout] pEdidParams - Pointer to the structure that contains - pointer to EDID buffer and its size -//! \param [inout] pFlag - The type of EDID to be retrieved (IN). -//! To only retrieve the EDID type, the user should send pEdidParams->pEDID as NULL and -//! pEdidParams->sizeOfEDID as 0. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 400 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! NVAPI_INSUFFICIENT_BUFFER: Reallocate buffer with pEdidParams->sizeOfEDID and call again to get complete data. -//! In this case pEdidParams->pEDID contains undefined data. -//! This error occurs only when pEdidParams->pEDID is present. -//! \endcode -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetEdidData(__in NvU32 displayId, __inout NV_EDID_DATA *pEdidParams, __inout NV_EDID_FLAG *pFlag); -//! @} - -typedef struct _NV_GET_ADAPTIVE_SYNC_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 maxFrameInterval; //!< [out] maximum frame interval in micro seconds as set previously using NvAPI_DISP_SetAdaptiveSyncData function. - //!< If default values from EDID are used, this parameter returns 0. - NvU32 bDisableAdaptiveSync : 1; //!< [out] Indicates if adaptive sync is disabled on the display. - NvU32 bDisableFrameSplitting : 1; //!< [out] Indicates if frame splitting is disabled on the display. - NvU32 reserved : 30; //!< reserved for future use. - NvU32 lastFlipRefreshCount; //!< [out] Number of times the last flip was shown on the screen - NvU64 lastFlipTimeStamp; //!< [out] Timestamp for the lastest flip on the screen - NvU32 reservedEx[4]; //!< reserved for future use. -} NV_GET_ADAPTIVE_SYNC_DATA_V1; - -#define NV_GET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_GET_ADAPTIVE_SYNC_DATA_V1,1) -#define NV_GET_ADAPTIVE_SYNC_DATA_VER NV_GET_ADAPTIVE_SYNC_DATA_VER1 - -typedef NV_GET_ADAPTIVE_SYNC_DATA_V1 NV_GET_ADAPTIVE_SYNC_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData) -//! \code -//! DESCRIPTION: This function is used to get data for the Adaptive Sync Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 415 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pAdaptiveSyncData - A pointer to NV_GET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData); - -typedef struct _NV_SET_ADAPTIVE_SYNC_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 maxFrameInterval; //!< [in] maximum frame interval in micro seconds. - //!< If maxFrameInterval is send as 0, default values from EDID will be used. - NvU32 bDisableAdaptiveSync : 1; //!< [in] Indicates if adaptive sync is disabled on the display. - NvU32 bDisableFrameSplitting : 1; //!< [in] Indicates if Frame Splitting should be disabled. - NvU32 reserved : 30; //!< reserved for future use. - NvU32 reservedEx[7]; //!< reserved for future use. -} NV_SET_ADAPTIVE_SYNC_DATA_V1; - -#define NV_SET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_SET_ADAPTIVE_SYNC_DATA_V1,1) -#define NV_SET_ADAPTIVE_SYNC_DATA_VER NV_SET_ADAPTIVE_SYNC_DATA_VER1 - -typedef NV_SET_ADAPTIVE_SYNC_DATA_V1 NV_SET_ADAPTIVE_SYNC_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData) -//! \code -//! DESCRIPTION: This function is used to set data for Adaptive Sync Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 415 -//! -//! \param [in] displayId - display id of the display -//! \param [in] pAdaptiveSyncData - A pointer to NV_SET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be set on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData); - - -typedef struct _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 frameIntervalUs; //!< [out] frame interval in micro seconds if Virtual RR is currently applied - NvU32 reservedEx[8]; //!< reserved for future use. -} NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1; - -#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1,1) -#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1 - -typedef NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_GET_VIRTUAL_REFRESH_RATE_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData) -//! \code -//! DESCRIPTION: This function is used to get Virtual Refresh Rate data for a VRR Capable Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 510 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pVirtualRefreshRateData - A pointer to NV_GET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData); - -typedef struct _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 frameIntervalUs; //!< [in] frame interval in micro seconds if Virtual RR is currently applied - NvU32 reservedEx[8]; //!< reserved for future use. -} NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1; - -#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1,1) -#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1 - -typedef NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_SET_VIRTUAL_REFRESH_RATE_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData) -//! \code -//! DESCRIPTION: This function is used to set Virtual Refresh Rate data for a VRR Capable Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 510 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pVirtualRefreshRateData - A pointer to NV_SET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData); - -//! \ingroup dispcontrol -typedef struct -{ - NvU32 version; //!< [in] Structure version - NvU32 displayId; //!< [in] Monitor Identifier to be set - NvU32 reserved; //!< Reserved for future use without adding versioning -} NV_SET_PREFERRED_STEREO_DISPLAY_V1; - -//! \ingroup dispcontrol -typedef NV_SET_PREFERRED_STEREO_DISPLAY_V1 NV_SET_PREFERRED_STEREO_DISPLAY; - -//! \ingroup dispcontrol -#define NV_SET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_SET_PREFERRED_STEREO_DISPLAY_V1,1) - -//! \ingroup dispcontrol -#define NV_SET_PREFERRED_STEREO_DISPLAY_VER NV_SET_PREFERRED_STEREO_DISPLAY_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SetPreferredStereoDisplay -// -//! DESCRIPTION: Specifies a display output that drives the 3pin DIN output signal -//! in a workstation stereo system environment. -//! If display output is specified as a displayId of 0, the preferred -//! stereo display target is reset to the driver default selection. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 470 -//! -//! \param [in] pPreferredStereoDisplay Pointer to a NV_SET_PREFERRED_STEREO_DISPLAY structure -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SetPreferredStereoDisplay(__in NV_SET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay); - -//! \ingroup dispcontrol -typedef struct -{ - NvU32 version; //!< [in] Structure version - NvU32 displayId; //!< [out] The queried stereo display - NvU32 reserved; //!< Reserved for future use without adding versioning -} NV_GET_PREFERRED_STEREO_DISPLAY_V1; - -//! \ingroup dispcontrol -typedef NV_GET_PREFERRED_STEREO_DISPLAY_V1 NV_GET_PREFERRED_STEREO_DISPLAY; - -//! \ingroup dispcontrol -#define NV_GET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_GET_PREFERRED_STEREO_DISPLAY_V1,1) - -//! \ingroup dispcontrol -#define NV_GET_PREFERRED_STEREO_DISPLAY_VER NV_GET_PREFERRED_STEREO_DISPLAY_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetPreferredStereoDisplay -// -//! DESCRIPTION: Queries the displayId of the display output driving the 3pin -//! DIN stereo signal, if any. -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 470 -//! -//! \param [inout] pPreferredStereoDisplay Pointer to a NV_GET_PREFERRED_STEREO_DISPLAY structure -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument (probably NULL). -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetPreferredStereoDisplay(__inout NV_GET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay); - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) - -typedef struct _NV_MANAGED_DEDICATED_DISPLAY_INFO -{ - NvU32 version; //!< [in] Version of this structure. - NvU32 displayId; //!< [out] DisplayId. - NvU32 isAcquired : 1; //!< [out] If bit is set, this display has been acquired by another process through NvAPI_DISP_AcquireDedicatedDisplay(). - NvU32 isMosaic : 1; //!< [out] If bit is set, this display represents a Mosaic grid. - NvU32 reserved : 30; //!< [out] Reserved for future use without adding versioning. -} NV_MANAGED_DEDICATED_DISPLAY_INFO_V1; - -#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1 MAKE_NVAPI_VERSION(NV_MANAGED_DEDICATED_DISPLAY_INFO_V1,1) -#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1 - -typedef NV_MANAGED_DEDICATED_DISPLAY_INFO_V1 NV_MANAGED_DEDICATED_DISPLAY_INFO; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetNvManagedDedicatedDisplays -// -//! DESCRIPTION: This API returns the count of dedicated displays managed by -//! the Nvidia driver, and specific driver info of each display. -//! This API does not return VR displays. -//! -//! HOW TO USE: 1) First make a call NvAPI_DISP_GetNvManagedDedicatedDisplays to get the number of dedicated displays managed by the Nvidia driver -//! by passing pDedicatedDisplays as NULL. -//! On call success: -//! 2) Allocate memory based on pDisplayCount, then call NvAPI_DISP_GetNvManagedDedicatedDisplays to populate pDedicatedDisplays. -//! -//! \since Release: 495 -//! -//! \param [in/out] pDedicatedDisplayCount The count of dedicated displays managed by the Nvidia driver. -//! \param [in/out] pDedicatedDisplays Pointer to an array of NV_MANAGED_DEDICATED_DISPLAY_INFO data structure. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API is not implemented in current driver. -//! \retval ::NVAPI_OUT_OF_MEMORY Could not allocate sufficient memory to complete the call. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not initialized. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of NV_MANAGED_DEDICATED_DISPLAY_INFO structure is invalid. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetNvManagedDedicatedDisplays(__inout NvU32* pDedicatedDisplayCount, __inout NV_MANAGED_DEDICATED_DISPLAY_INFO* pDedicatedDisplays); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_AcquireDedicatedDisplay -// -//! DESCRIPTION: This API requests exclusive access to the specified dedicated -//! display managed by the Nvidia driver. If the call succeeds, a handle -//! is returned which could be opened as a DisplaySource. -//! The call fails if the display is not managed by the Nvidia driver. -//! The call fails if the display has already been acquired by another process. -//! -//! \since Release: 495 -//! -//! \param [in] displayId Display ID of the dedicated display to be acquired. -//! \param [in/out] pDisplaySourceHandle Pointer to memory that receives the shared handle to a DisplaySource. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API not implemented. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_INVALID_DISPLAY_ID An invalid displayId was passed as an argument. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver. -//! \retval ::NVAPI_RESOURCE_IN_USE The display has already been acquired by another process. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_AcquireDedicatedDisplay(__in NvU32 displayId, __inout NvU64* pDisplaySourceHandle); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_ReleaseDedicatedDisplay -// -//! DESCRIPTION: This API releases the exclusive ownership of a specific dedicated -//! display previously acquired by the process. -//! -//! \since Release: 495 -//! -//! \param [in] displayId Display ID of the dedicated display to be released. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API not implemented. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver. -//! \retval ::NVAPI_DDISPLAY_NOT_ACQUIRED The display is not acquired by the process. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_ReleaseDedicatedDisplay(__in NvU32 displayId); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 11 and higher -//! -#if defined(__cplusplus) - -typedef struct _NV_MANAGED_DEDICATED_DISPLAY_METADATA -{ - NvU32 version; //!< [in] Version of this structure. - NvU32 displayId; //!< [in] DisplayId to identify the display connector the metadata operation is requested for. - NvU32 bSetPosition : 1; //!< [in] Set call: 1 in case the information in variables/fields "positionX" and "positionY" should be stored as metadata. 0 otherwise. - NvU32 bRemovePosition : 1; //!< [in] Set call: 1 in case the stored positionX and positionY metadata should be set to 'not defined', N/A. 0 otherwise. - NvU32 bPositionIsAvailable : 1; //!< [out] Query call: 1 in case the information in variables/fields "positionX" and "positionY" is valid (has been set before). 0 otherwise. - NvU32 bSetName : 1; //!< [in] Set call: 1 in case the information in variable/field "name" should be stored as metadata. 0 otherwise. - NvU32 bRemoveName : 1; //!< [in] Set call: 1 in case the stored name metadata should be set to 'not defined',N/A. 0 otherwise. - NvU32 bNameIsAvailable : 1; //!< [out] Query call: 1 in case the information in variable/field "name" is valid (has been set before). 0 otherwise. - NvU32 reserved : 26; //!< [in][out] Reserved for future use without adding versioning. - NvS32 positionX; //!< [in][out] Metadata for the virtual horizontal position for the display connector specified by displayId. - NvS32 positionY; //!< [in][out] Metadata for the virtual vertical position for the display connector specified by displayId. - NvAPI_ShortString name; //!< [in][out] Metadata for the virtual name of for the display connector specified by displayId. - //!< Valid characters are in the range of 32 ' ' (space) to 126 '~' (both included). -} NV_MANAGED_DEDICATED_DISPLAY_METADATA_V1; - -#define NV_MANAGED_DEDICATED_DISPLAY_METADATA_VER1 MAKE_NVAPI_VERSION(NV_MANAGED_DEDICATED_DISPLAY_METADATA_V1,1) -#define NV_MANAGED_DEDICATED_DISPLAY_METADATA_VER NV_MANAGED_DEDICATED_DISPLAY_METADATA_VER1 - -typedef NV_MANAGED_DEDICATED_DISPLAY_METADATA_V1 NV_MANAGED_DEDICATED_DISPLAY_METADATA; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetNvManagedDedicatedDisplayMetadata -// -//! DESCRIPTION: This API returns metadata which has been set for the display connector in question. -//! Main use case would be to query the data for an Nvidia managed dedicated display. -//! The function will work for any valid displayId though. -//! -//! \since Release: 550 -//! -//! \param [in/out] pDedicatedDisplayMetadata Data structure containing input and output data. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API is not implemented in current driver. -//! \retval ::NVAPI_NOT_SUPPORTED The API is not supported on the current operating system or gpu. -//! \retval ::NVAPI_OUT_OF_MEMORY There wasn't sufficient memory to complete the call. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not initialized. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the NV_MANAGED_DEDICATED_DISPLAY_METADATA structure is invalid. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetNvManagedDedicatedDisplayMetadata(__inout NV_MANAGED_DEDICATED_DISPLAY_METADATA* pDedicatedDisplayMetadata); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 11 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_SetNvManagedDedicatedDisplayMetadata -// -//! DESCRIPTION: This API allows to set metadata for the display connector in question. -//! Main use case would be to set the data for an Nvidia managed dedicated display. -//! The function will work for any valid displayId though. -//! -//! \since Release: 550 -//! -//! \param [in/out] pDedicatedDisplayMetadata Data structure containing input and output data. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API is not implemented in current driver. -//! \retval ::NVAPI_NOT_SUPPORTED The API is not supported on the current operating system or gpu. -//! \retval ::NVAPI_OUT_OF_MEMORY There wasn't sufficient memory to complete the call. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not initialized. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the NV_MANAGED_DEDICATED_DISPLAY_METADATA structure is invalid. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE The caller doesn't have the required administrator privileges to access this API. -//! \retval ::NVAPI_INVALID_ARGUMENT Characters in pDedicatedDisplayMetadata->name are out of the allowed range. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SetNvManagedDedicatedDisplayMetadata(__inout NV_MANAGED_DEDICATED_DISPLAY_METADATA* pDedicatedDisplayMetadata); -#endif // defined(__cplusplus) - - -#if defined (_WINNT_) - -//! \ingroup dispcontrol - -typedef struct _NV_DISPLAY_ID_INFO_DATA_V1 -{ - NvU32 version; //!< [in] Structure version - LUID adapterId; //!< [out] Locally unique ID (LUID) of the display adapter on which the given display is present. - NvU32 targetId; //!< [out] The target identifier of the given display. This is also called AdapterRelativeId. - NvU32 reserved[4]; //!< Reserved for future use. -} NV_DISPLAY_ID_INFO_DATA_V1; - -#define NV_DISPLAY_ID_INFO_DATA_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_ID_INFO_DATA_V1,1) -#define NV_DISPLAY_ID_INFO_DATA_VER NV_DISPLAY_ID_INFO_DATA_VER1 - -typedef NV_DISPLAY_ID_INFO_DATA_V1 NV_DISPLAY_ID_INFO_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetDisplayIdInfo -// -//! DESCRIPTION: This API returns information related to the given displayId. -//! It returns adapterId and targetId (AdapterRelativeId) corresponding to the given displayId. -//! If the displayId is part of a display grid (Mosaic/Surround), then every displayId that is part of the same display grid -//! outputs the same (adapterId, targetId) pair, and no other displayId outputs this pair. -//! Otherwise, the (adapterId, targetId) pair is unique to this displayId. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 530 -//! -//! \param [in] displayId DisplayId of the display. -//! \param [inout] pDisplayIdInfoData Pointer to the NV_DISPLAY_ID_INFO_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetDisplayIdInfo(__in NvU32 displayId, __inout NV_DISPLAY_ID_INFO_DATA* pDisplayIdInfoData); - -#endif - - -//! \ingroup dispcontrol - -#if defined (_WINNT_) - -typedef struct _NV_TARGET_INFO_DATA_V1 -{ - NvU32 version; //!< [in] Structure version - LUID adapterId; //!< [in] Locally unique ID (LUID) of the display adapter on which the target is present. - NvU32 targetId; //!< [in] The target identifier. This is also called AdapterRelativeId. - NvU32 displayId[NVAPI_MAX_DISPLAYS]; //!< [out] An array of displayIds corresponding to the input adapterId and targetId. - //!< If the input (targetId, adapterId) pair is a display grid (Mosaic/Surround), - //!< then the output contains the displayId of every display that is part of the display grid. - //!< Otherwise, it contains exactly one displayId. - //!< These displayId values are unique to this (targetId, adapterId) pair. - NvU32 displayIdCount; //!< [out] The number of displays returned in displayId array. - NvU32 reserved[4]; //!< Reserved for future use. -} NV_TARGET_INFO_DATA_V1; - -#define NV_TARGET_INFO_DATA_VER1 MAKE_NVAPI_VERSION(NV_TARGET_INFO_DATA_V1,1) -#define NV_TARGET_INFO_DATA_VER NV_TARGET_INFO_DATA_VER1 - -typedef NV_TARGET_INFO_DATA_V1 NV_TARGET_INFO_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetDisplayIdsFromTarget -// -//! DESCRIPTION: This API returns displayId(s) corresponding to the given target. -//! If the input (targetId, adapterId) pair is a display grid (Mosaic/Surround), then the output contains the displayId of every display -//! that is part of the display grid. Otherwise, it contains exactly one displayId. -//! These displayId values are unique to this (targetId, adapterId) pair. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 530 -//! -//! \param [inout] pTargetInfoData Pointer to the NV_TARGET_INFO_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetDisplayIdsFromTarget(__inout NV_TARGET_INFO_DATA* pTargetInfoData); - -#endif - - -//! \ingroup dispcontrol - -typedef struct _NV_GET_VRR_INFO_V1 -{ - NvU32 version; //!< [in] Structure version - NvU32 bIsVRREnabled : 1; //!< [out] Set if VRR Mode is currently active on given display. - NvU32 bIsVRRPossible : 1; //!< [out] Set to true if VRR Mode is possible on the given display. - NvU32 bIsVRRRequested : 1; //!< [out] Set to true if VRR Mode is requested for the given display. - NvU32 bIsVRRIndicatorEnabled : 1; //!< [out] Set to true if the VRR indicator is enabled. This can be done through the NVIDIA Control Panel. - NvU32 bIsDisplayInVRRMode : 1; //!< [out] Set to true if the display is in VRR Mode. - NvU32 reserved : 27; //!< Reserved for future use. - NvU32 reservedEx[4]; //!< Reserved for future use -} NV_GET_VRR_INFO_V1; - -#define NV_GET_VRR_INFO_VER1 MAKE_NVAPI_VERSION(NV_GET_VRR_INFO_V1,1) -#define NV_GET_VRR_INFO_VER NV_GET_VRR_INFO_VER1 - -typedef NV_GET_VRR_INFO_V1 NV_GET_VRR_INFO; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetVRRInfo -// -//! DESCRIPTION: This API returns Variable Refresh Rate(VRR) information for the given display ID. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [inout] pVrrInfo Pointer to the NV_GET_VRR_INFO structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetVRRInfo(__in NvU32 displayId, __inout NV_GET_VRR_INFO *pVrrInfo); - - - -//////////////////////////////////////////////////////////////////////////////////////// -// -// MOSAIC allows a multi display target output scanout on a single source. -// -// SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap -// -//+-------------------------++-------------------------++-------------------------++-------------------------+ -//| || || || | -//| || || || | -//| || || || | -//| DVI1 || DVI2 || DVI3 || DVI4 | -//| || || || | -//| || || || | -//| || || || | -//| || || || | -//+-------------------------++-------------------------++-------------------------++-------------------------+ - - -//! \addtogroup mosaicapi -//! @{ - -#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8 -#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8 -// -// These bits are used to describe the validity of a topo. -// -#define NV_MOSAIC_TOPO_VALIDITY_VALID 0x00000000 //!< The topology is valid -#define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU 0x00000001 //!< Not enough SLI GPUs were found to fill the entire - //! topology. hPhysicalGPU will be 0 for these. -#define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY 0x00000002 //!< Not enough displays were found to fill the entire - //! topology. displayOutputId will be 0 for these. -#define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004 //!< The topoogy is only possible with displays of the same - //! NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make - //! sure they are all CRTs, or all DFPs. - - -// -//! This structure defines the topology details. -typedef struct -{ - NvU32 version; //!< Version of this structure - NvLogicalGpuHandle hLogicalGPU; //!< Logical GPU for this topology - NvU32 validityMask; //!< 0 means topology is valid with the current hardware. - //! If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*. - NvU32 rowCount; //!< Number of displays in a row - NvU32 colCount; //!< Number of displays in a column - - struct - { - NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology (0 if GPU missing) - NvU32 displayOutputId; //!< Connected display target (0 if no display connected) - NvS32 overlapX; //!< Pixels of overlap on left of target: (+overlap, -gap) - NvS32 overlapY; //!< Pixels of overlap on top of target: (+overlap, -gap) - - } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS]; - -} NV_MOSAIC_TOPO_DETAILS; - -//! Macro for constructing te vesion field of NV_MOSAIC_TOPO_DETAILS -#define NVAPI_MOSAIC_TOPO_DETAILS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS,1) - - -// -//! These values refer to the different types of Mosaic topologies that are possible. When -//! getting the supported Mosaic topologies, you can specify one of these types to narrow down -//! the returned list to only those that match the given type. -typedef enum -{ - NV_MOSAIC_TOPO_TYPE_ALL, //!< All mosaic topologies - NV_MOSAIC_TOPO_TYPE_BASIC, //!< Basic Mosaic topologies - NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO, //!< Passive Stereo topologies - NV_MOSAIC_TOPO_TYPE_SCALED_CLONE, //!< Not supported at this time - NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE, //!< Not supported at this time - NV_MOSAIC_TOPO_TYPE_MAX, //!< Always leave this at end of the enum -} NV_MOSAIC_TOPO_TYPE; - - -// -//! This is a complete list of supported Mosaic topologies. -//! -//! Using a "Basic" topology combines multiple monitors to create a single desktop. -//! -//! Using a "Passive" topology combines multiples monitors to create a passive stereo desktop. -//! In passive stereo, two identical topologies combine - one topology is used for the right eye and the other identical //! topology (targeting different displays) is used for the left eye. \n -//! NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums. If this -//! enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO -//! please update the corresponding value in nvEscDef.h -typedef enum -{ - NV_MOSAIC_TOPO_NONE, - - // 'BASIC' topos start here - // - // The result of using one of these Mosaic topos is that multiple monitors - // will combine to create a single desktop. - // - NV_MOSAIC_TOPO_BEGIN_BASIC, - NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC, - NV_MOSAIC_TOPO_2x1_BASIC, - NV_MOSAIC_TOPO_1x3_BASIC, - NV_MOSAIC_TOPO_3x1_BASIC, - NV_MOSAIC_TOPO_1x4_BASIC, - NV_MOSAIC_TOPO_4x1_BASIC, - NV_MOSAIC_TOPO_2x2_BASIC, - NV_MOSAIC_TOPO_2x3_BASIC, - NV_MOSAIC_TOPO_2x4_BASIC, - NV_MOSAIC_TOPO_3x2_BASIC, - NV_MOSAIC_TOPO_4x2_BASIC, - NV_MOSAIC_TOPO_1x5_BASIC, - NV_MOSAIC_TOPO_1x6_BASIC, - NV_MOSAIC_TOPO_7x1_BASIC, - - // Add padding for 10 more entries. 6 will be enough room to specify every - // possible topology with 8 or fewer displays, so this gives us a little - // extra should we need it. - NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9, - - // 'PASSIVE_STEREO' topos start here - // - // The result of using one of these Mosaic topos is that multiple monitors - // will combine to create a single PASSIVE STEREO desktop. What this means is - // that there will be two topos that combine to create the overall desktop. - // One topo will be used for the left eye, and the other topo (of the - // same rows x cols), will be used for the right eye. The difference between - // the two topos is that different GPUs and displays will be used. - // - NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, // value shadowed in nvEscDef.h - NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, - NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO, - NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO, - NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO, - NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4, - - - // - // Total number of topos. Always leave this at the end of the enumeration. - // - NV_MOSAIC_TOPO_MAX //! Total number of topologies. - -} NV_MOSAIC_TOPO; - - -// -//! This is a "topology brief" structure. It tells you what you need to know about -//! a topology at a high level. A list of these is returned when you query for the -//! supported Mosaic information. -//! -//! If you need more detailed information about the topology, call -//! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure. -typedef struct -{ - NvU32 version; //!< Version of this structure - NV_MOSAIC_TOPO topo; //!< The topology - NvU32 enabled; //!< 1 if topo is enabled, else 0 - NvU32 isPossible; //!< 1 if topo *can* be enabled, else 0 - -} NV_MOSAIC_TOPO_BRIEF; - -//! Macro for constructing the version field of NV_MOSAIC_TOPO_BRIEF -#define NVAPI_MOSAIC_TOPO_BRIEF_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF,1) - - -// -//! Basic per-display settings that are used in setting/getting the Mosaic mode -typedef struct _NV_MOSAIC_DISPLAY_SETTING_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 width; //!< Per-display width - NvU32 height; //!< Per-display height - NvU32 bpp; //!< Bits per pixel - NvU32 freq; //!< Display frequency -} NV_MOSAIC_DISPLAY_SETTING_V1; - -typedef struct NV_MOSAIC_DISPLAY_SETTING_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 width; //!< Per-display width - NvU32 height; //!< Per-display height - NvU32 bpp; //!< Bits per pixel - NvU32 freq; //!< Display frequency - NvU32 rrx1k; //!< Display frequency in x1k -} NV_MOSAIC_DISPLAY_SETTING_V2; - -typedef NV_MOSAIC_DISPLAY_SETTING_V2 NV_MOSAIC_DISPLAY_SETTING; - -//! Macro for constructing the version field of NV_MOSAIC_DISPLAY_SETTING -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V1,1) -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V2,2) -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER NVAPI_MOSAIC_DISPLAY_SETTING_VER2 - - -// -// Set a reasonable max number of display settings to support -// so arrays are bound. -// -#define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40 //!< Set a reasonable maximum number of display settings to support - //! so arrays are bound. - - -// -//! This structure is used to contain a list of supported Mosaic topologies -//! along with the display settings that can be used. -typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 topoBriefsCount; //!< Number of topologies in below array - NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details - NvU32 displaySettingsCount; //!< Number of display settings in below array - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible - -} NV_MOSAIC_SUPPORTED_TOPO_INFO_V1; - -typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 topoBriefsCount; //!< Number of topologies in below array - NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details - NvU32 displaySettingsCount; //!< Number of display settings in below array - NV_MOSAIC_DISPLAY_SETTING_V2 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible - -} NV_MOSAIC_SUPPORTED_TOPO_INFO_V2; - -typedef NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 NV_MOSAIC_SUPPORTED_TOPO_INFO; - -//! Macro forconstructing the version field of NV_MOSAIC_SUPPORTED_TOPO_INFO -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V1,1) -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V2,2) -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 - - -// -// Indices to use to access the topos array within the mosaic topology -#define NV_MOSAIC_TOPO_IDX_DEFAULT 0 - -#define NV_MOSAIC_TOPO_IDX_LEFT_EYE 0 -#define NV_MOSAIC_TOPO_IDX_RIGHT_EYE 1 -#define NV_MOSAIC_TOPO_NUM_EYES 2 - - -// -//! This defines the maximum number of topos that can be in a topo group. -//! At this time, it is set to 2 because our largest topo group (passive -//! stereo) only needs 2 topos (left eye and right eye). -//! -//! If a new topo group with more than 2 topos is added above, then this -//! number will also have to be incremented. -#define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2 - - -// -//! This structure defines a group of topologies that work together to create one -//! overall layout. All of the supported topologies are represented with this -//! structure. -//! -//! For example, a 'Passive Stereo' topology would be represented with this -//! structure, and would have separate topology details for the left and right eyes. -//! The count would be 2. A 'Basic' topology is also represented by this structure, -//! with a count of 1. -//! -//! The structure is primarily used internally, but is exposed to applications in a -//! read-only fashion because there are some details in it that might be useful -//! (like the number of rows/cols, or connected display information). A user can -//! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup(). -//! -//! You can then look at the detailed values within the structure. There are no -//! entrypoints which take this structure as input (effectively making it read-only). -typedef struct -{ - NvU32 version; //!< Version of this structure - NV_MOSAIC_TOPO_BRIEF brief; //!< The brief details of this topo - NvU32 count; //!< Number of topos in array below - NV_MOSAIC_TOPO_DETAILS topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP]; - -} NV_MOSAIC_TOPO_GROUP; - -//! Macro for constructing the version field of NV_MOSAIC_TOPO_GROUP -#define NVAPI_MOSAIC_TOPO_GROUP_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP,1) - -//! @} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetSupportedTopoInfo -// -//! DESCRIPTION: This API returns information on the topologies and display resolutions -//! supported by Mosaic mode. -//! -//! NOTE: Not all topologies returned can be set immediately. -//! See 'OUT' Notes below. -//! -//! Once you get the list of supported topologies, you can call -//! NvAPI_Mosaic_GetTopoGroup() with one of the Mosaic topologies if you need -//! more information about it. -//! -//! 'IN' Notes: pSupportedTopoInfo->version must be set before calling this function. -//! If the specified version is not supported by this implementation, -//! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION). -//! -//! 'OUT' Notes: Some of the topologies returned might not be valid for one reason or -//! another. It could be due to mismatched or missing displays. It -//! could also be because the required number of GPUs is not found. -//! At a high level, you can see if the topology is valid and can be enabled -//! by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag. -//! If this is true, the topology can be enabled. If it -//! is false, you can find out why it cannot be enabled by getting the -//! details of the topology via NvAPI_Mosaic_GetTopoGroup(). From there, -//! look at the validityMask of the individual topologies. The bits can -//! be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits. -//! -//! It is possible for this function to return NVAPI_OK with no topologies -//! listed in the return structure. If this is the case, it means that -//! the current hardware DOES support Mosaic, but with the given configuration -//! no valid topologies were found. This most likely means that SLI was not -//! enabled for the hardware. Once enabled, you should see valid topologies -//! returned from this function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! -//! \param [in,out] pSupportedTopoInfo Information about what topologies and display resolutions -//! are supported for Mosaic. -//! \param [in] type The type of topologies the caller is interested in -//! getting. See NV_MOSAIC_TOPO_TYPE for possible values. -//! -//! \retval ::NVAPI_OK No errors in returning supported topologies. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -// compatible with this entry point. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetTopoGroup -// -//! DESCRIPTION: This API returns a structure filled with the details -//! of the specified Mosaic topology. -//! -//! If the pTopoBrief passed in matches the current topology, -//! then information in the brief and group structures -//! will reflect what is current. Thus the brief would have -//! the current 'enable' status, and the group would have the -//! current overlap values. If there is no match, then the -//! returned brief has an 'enable' status of FALSE (since it -//! is obviously not enabled), and the overlap values will be 0. -//! -//! 'IN' Notes: pTopoGroup->version must be set before calling this function. -//! If the specified version is not supported by this implementation, -//! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION). -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology for getting the details -//! This must be one of the topology briefs -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in,out] pTopoGroup The topology details matching the brief -//! -//! \retval ::NVAPI_OK Details were retrieved successfully. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -// compatible with this entry point. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetOverlapLimits -// -//! DESCRIPTION: This API returns the X and Y overlap limits required if -//! the given Mosaic topology and display settings are to be used. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology for getting limits -//! This must be one of the topo briefs -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in] pDisplaySetting The display settings for getting the limits. -//! This must be one of the settings -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [out] pMinOverlapX X overlap minimum -//! \param [out] pMaxOverlapX X overlap maximum -//! \param [out] pMinOverlapY Y overlap minimum -//! \param [out] pMaxOverlapY Y overlap maximum -//! -//! \retval ::NVAPI_OK Details were retrieved successfully. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -//! compatible with this entry point. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_SetCurrentTopo -// -//! DESCRIPTION: This API sets the Mosaic topology and performs a mode switch -//! using the given display settings. -//! -//! If NVAPI_OK is returned, the current Mosaic topology was set -//! correctly. Any other status returned means the -//! topology was not set, and remains what it was before this -//! function was called. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology to set. This must be one of the topologies returned from -//! NvAPI_Mosaic_GetSupportedTopoInfo(), and it must have an isPossible value of 1. -//! \param [in] pDisplaySetting The per display settings to be used in the Mosaic mode. This must be one of the -//! settings returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in] overlapX The pixel overlap to use between horizontal displays (use positive a number for -//! overlap, or a negative number to create a gap.) If the overlap is out of bounds -//! for what is possible given the topo and display setting, the overlap will be clamped. -//! \param [in] overlapY The pixel overlap to use between vertical displays (use positive a number for -//! overlap, or a negative number to create a gap.) If the overlap is out of bounds for -//! what is possible given the topo and display setting, the overlap will be clamped. -//! \param [in] enable If 1, the topology being set will also be enabled, meaning that the mode set will -//! occur. \n -//! If 0, you don't want to be in Mosaic mode right now, but want to set the current -//! Mosaic topology so you can enable it later with NvAPI_Mosaic_EnableCurrentTopo(). -//! -//! \retval ::NVAPI_OK The Mosaic topology was set. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE The topology passed in is not currently possible. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -//! compatible with this entrypoint. -//! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetCurrentTopo -// -//! DESCRIPTION: This API returns information for the current Mosaic topology. -//! This includes topology, display settings, and overlap values. -//! -//! You can call NvAPI_Mosaic_GetTopoGroup() with the topology -//! if you require more information. -//! -//! If there isn't a current topology, then pTopoBrief->topo will -//! be NV_MOSAIC_TOPO_NONE. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [out] pTopoBrief The current Mosaic topology -//! \param [out] pDisplaySetting The current per-display settings -//! \param [out] pOverlapX The pixel overlap between horizontal displays -//! \param [out] pOverlapY The pixel overlap between vertical displays -//! -//! \retval ::NVAPI_OK Success getting current info. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entry point not available. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnableCurrentTopo -// -//! DESCRIPTION: This API enables or disables the current Mosaic topology -//! based on the setting of the incoming 'enable' parameter. -//! -//! An "enable" setting enables the current (previously set) Mosaic topology. -//! Note that when the current Mosaic topology is retrieved, it must have an isPossible value of 1 or -//! an error will occur. -//! -//! A "disable" setting disables the current Mosaic topology. -//! The topology information will persist, even across reboots. -//! To re-enable the Mosaic topology, call this function -//! again with the enable parameter set to 1. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] enable 1 to enable the current Mosaic topo, 0 to disable it. -//! -//! \retval ::NVAPI_OK The Mosaic topo was enabled/disabled. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE The current topology is not currently possible. -//! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable); - -//! \ingroup mosaicapi -//! @{ -typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V1 -{ - NvU32 displayId; //!< DisplayID of the display - NvS32 overlapX; //!< (+overlap, -gap) - NvS32 overlapY; //!< (+overlap, -gap) - NV_ROTATE rotation; //!< Rotation of display - NvU32 cloneGroup; //!< Reserved, must be 0 -} NV_MOSAIC_GRID_TOPO_DISPLAY_V1; - -typedef enum _NV_PIXEL_SHIFT_TYPE -{ - NV_PIXEL_SHIFT_TYPE_NO_PIXEL_SHIFT = 0, //!< No pixel shift will be applied to this display. - NV_PIXEL_SHIFT_TYPE_2x2_TOP_LEFT_PIXELS = 1, //!< This display will be used to scanout top left pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_RIGHT_PIXELS = 2, //!< This display will be used to scanout bottom right pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_TOP_RIGHT_PIXELS = 4, //!< This display will be used to scanout top right pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_LEFT_PIXELS = 8, //!< This display will be used to scanout bottom left pixels in 2x2 PixelShift configuration -} NV_PIXEL_SHIFT_TYPE; - -typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V2 -{ - NvU32 version; //!< Version of this structure - - NvU32 displayId; //!< DisplayID of the display - NvS32 overlapX; //!< (+overlap, -gap) - NvS32 overlapY; //!< (+overlap, -gap) - NV_ROTATE rotation; //!< Rotation of display - NvU32 cloneGroup; //!< Reserved, must be 0 - NV_PIXEL_SHIFT_TYPE pixelShiftType; //!< Type of the pixel shift enabled display -} NV_MOSAIC_GRID_TOPO_DISPLAY_V2; - -#ifndef NV_MOSAIC_GRID_TOPO_DISPLAY_VER - -typedef NV_MOSAIC_GRID_TOPO_DISPLAY_V1 NV_MOSAIC_GRID_TOPO_DISPLAY; - -#endif - -typedef struct _NV_MOSAIC_GRID_TOPO_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 rows; //!< Number of rows - NvU32 columns; //!< Number of columns - NvU32 displayCount; //!< Number of display details - NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution - NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only) - NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only) - NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get. - NvU32 acceleratePrimaryDisplay : 1; //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get. - NvU32 reserved : 27; //!< Reserved, must be 0 - NV_MOSAIC_GRID_TOPO_DISPLAY_V1 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column] - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings -} NV_MOSAIC_GRID_TOPO_V1; - -typedef struct _NV_MOSAIC_GRID_TOPO_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 rows; //!< Number of rows - NvU32 columns; //!< Number of columns - NvU32 displayCount; //!< Number of display details - NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution - NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only) - NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only) - NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get. - NvU32 acceleratePrimaryDisplay : 1; //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get. - NvU32 pixelShift : 1; //!< Enable Pixel shift - NvU32 reserved : 26; //!< Reserved, must be 0 - NV_MOSAIC_GRID_TOPO_DISPLAY_V2 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column] - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings -} NV_MOSAIC_GRID_TOPO_V2; - -//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO -#define NV_MOSAIC_GRID_TOPO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V1,1) -#define NV_MOSAIC_GRID_TOPO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V2,2) -#ifndef NV_MOSAIC_GRID_TOPO_VER - -typedef NV_MOSAIC_GRID_TOPO_V2 NV_MOSAIC_GRID_TOPO; - -//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO -#define NV_MOSAIC_GRID_TOPO_VER NV_MOSAIC_GRID_TOPO_VER2 - -#endif - -//! @} - -//! since Release R290 - -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_INVALID_GPU NV_BIT(0) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_WRONG_CONNECTOR NV_BIT(1) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_COMMON_TIMINGS NV_BIT(2) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_EDID_AVAILABLE NV_BIT(3) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_MISMATCHED_OUTPUT_TYPE NV_BIT(4) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_DISPLAY_CONNECTED NV_BIT(5) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_GPU_TOPOLOGY NV_BIT(6) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NOT_SUPPORTED NV_BIT(7) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_SLI_BRIDGE NV_BIT(8) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_ECC_ENABLED NV_BIT(9) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_GPU_TOPOLOGY_NOT_SUPPORTED NV_BIT(10) - - - - - - - -//! Do not change the current GPU topology. If the NO_DRIVER_RELOAD bit is not -//! specified, then it may still require a driver reload. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_CURRENT_GPU_TOPOLOGY NV_BIT(0) - -//! Do not allow a driver reload. That is, stick with the same master GPU as well as the -//! same SLI configuration. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_NO_DRIVER_RELOAD NV_BIT(1) - -//! When choosing a GPU topology, choose the topology with the best performance. -//! Without this flag, it will choose the topology that uses the smallest number -//! of GPU's. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_MAXIMIZE_PERFORMANCE NV_BIT(2) - -//! Do not return an error if no configuration will work with all of the grids. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_ALLOW_INVALID NV_BIT(3) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_SetDisplayGrids -// -//! DESCRIPTION: Sets a new display topology, replacing any existing topologies -//! that use the same displays. -//! -//! This function will look for an SLI configuration that will -//! allow the display topology to work. -//! -//! To revert to a single display, specify that display as a 1x1 -//! grid. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pGridTopologies The topology details to set. -//! \param [in] gridCount The number of elements in the pGridTopologies array. -//! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_* -//! flags. -//! -//! -//! \retval ::NVAPI_OK Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY No matching GPU topologies could be found. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE One or more of the display grids are not valid. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_SetDisplayGrids(__in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, __in NvU32 gridCount, __in NvU32 setTopoFlags); - - -//! \ingroup mosaicapi -//! Indicates that a display's position in the grid is sub-optimal. -#define NV_MOSAIC_DISPLAYTOPO_WARNING_DISPLAY_POSITION NV_BIT(0) - -//! \ingroup mosaicapi -//! Indicates that SetDisplaySettings would need to perform a driver reload. -#define NV_MOSAIC_DISPLAYTOPO_WARNING_DRIVER_RELOAD_REQUIRED NV_BIT(1) - -//! \ingroup mosaicapi -typedef struct -{ - NvU32 version; - NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags. - NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags. - - NvU32 displayCount; //!< (OUT) The number of valid entries in the displays array. - struct - { - NvU32 displayId; //!< (OUT) The DisplayID of this display. - NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYCAPS_PROBLEM_* flags. - NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags. - - NvU32 supportsRotation : 1; //!< (OUT) This display can be rotated - NvU32 reserved : 31; //!< (OUT) reserved - } displays[NVAPI_MAX_DISPLAYS]; -} NV_MOSAIC_DISPLAY_TOPO_STATUS; - -//! \ingroup mosaicapi -#define NV_MOSAIC_DISPLAY_TOPO_STATUS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_TOPO_STATUS,1) - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_ValidateDisplayGrids -// -//! DESCRIPTION: Determines if a list of grid topologies is valid. It will choose an SLI -//! configuration in the same way that NvAPI_Mosaic_SetDisplayGrids() does. -//! -//! On return, each element in the pTopoStatus array will contain any errors or -//! warnings about each grid topology. If any error flags are set, then the topology -//! is not valid. If any warning flags are set, then the topology is valid, but -//! sub-optimal. -//! -//! If the ALLOW_INVALID flag is set, then it will continue to validate the grids -//! even if no SLI configuration will allow all of the grids. In this case, a grid -//! grid with no matching GPU topology will have the error -//! flags NO_GPU_TOPOLOGY or NOT_SUPPORTED set. -//! -//! If the ALLOW_INVALID flag is not set and no matching SLI configuration is -//! found, then it will skip the rest of the validation and return -//! NVAPI_NO_ACTIVE_SLI_TOPOLOGY. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_* -//! flags. -//! \param [in] pGridTopologies The array of grid topologies to verify. -//! \param [in,out] pTopoStatus The array of problems and warnings with each grid topology. -//! \param [in] gridCount The number of elements in the pGridTopologies and -//! pTopoStatus arrays. -//! -//! -//! \retval ::NVAPI_OK: Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY: No matching GPU topologies could be found. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_ValidateDisplayGrids(__in NvU32 setTopoFlags, - __in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, - __inout_ecount_full(gridCount) NV_MOSAIC_DISPLAY_TOPO_STATUS *pTopoStatus, - __in NvU32 gridCount); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnumDisplayModes -// -//! DESCRIPTION: Determines the set of available display modes for a given grid topology. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pGridTopology The grid topology to use. -//! \param [in,out] pDisplaySettings A pointer to an array of display settings to populate, -//! or NULL to find out the total number of available modes. -//! \param [in,out] pDisplayCount If pDisplaySettings is not NULL, then pDisplayCount -//! should point to the number of elements in the -//! pDisplaySettings array. On return, it will contain the -//! number of modes that were actually returned. If -//! pDisplaySettings is NULL, then pDisplayCount will receive -//! the total number of modes that are available. -//! -//! -//! \retval ::NVAPI_OK Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaciapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayModes(__in NV_MOSAIC_GRID_TOPO *pGridTopology, - __inout_ecount_part_opt(*pDisplayCount, *pDisplayCount) NV_MOSAIC_DISPLAY_SETTING *pDisplaySettings, - __inout NvU32 *pDisplayCount); - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnumDisplayGrids -// -//! DESCRIPTION: Enumerates the current active grid topologies. This includes Mosaic, IG, and -//! Panoramic topologies, as well as single displays. -//! -//! If pGridTopologies is NULL, then pGridCount will be set to the number of active -//! grid topologies. -//! -//! If pGridTopologies is not NULL, then pGridCount contains the maximum number of -//! grid topologies to return. On return, pGridCount will be set to the number of -//! grid topologies that were returned. -//! -//! \param [out] pGridTopologies The list of active grid topologies. -//! \param [in,out] pGridCount A pointer to the number of grid topologies returned. -//! -//! \retval ::NVAPI_OK Capabilties have been returned. -//! \retval ::NVAPI_END_ENUMERATION There are no more topologies to return. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayGrids(__inout_ecount_part_opt(*pGridCount, *pGridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, - __inout NvU32 *pGridCount); - - -//////////////////////////////////////////////////////////////////////////////////////// -// -// ########################################################################### -// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS -// -// Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain -// once Phase 2 is complete. For a small amount of time, the two will co-exist. As -// soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2 -// entrypoints, the code below will be deleted. -// -// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS -// ########################################################################### -// -// Supported topos 1x4, 4x1 and 2x2 to start with. -// -// Selected scan out targets can be one per GPU or more than one on the same GPU. -// -// SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap -// -//+-------------------------++-------------------------++-------------------------++-------------------------+ -//| || || || | -//| || || || | -//| || || || | -//| DVI1 || DVI2 || DVI3 || DVI4 | -//| || || || | -//| || || || | -//| || || || | -//| || || || | -//+-------------------------++-------------------------++-------------------------++-------------------------+ - - -//! \addtogroup mosaicapi -//! @{ - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8 - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8 - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_TOPOS 16 - -//! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology(). -typedef struct -{ - NvU32 version; //!< Version number of the mosaic topology - NvU32 rowCount; //!< Horizontal display count - NvU32 colCount; //!< Vertical display count - - struct - { - NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology - NvU32 displayOutputId; //!< Connected display target - NvS32 overlapX; //!< Pixels of overlap on the left of target: (+overlap, -gap) - NvS32 overlapY; //!< Pixels of overlap on the top of target: (+overlap, -gap) - - } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS]; - -} NV_MOSAIC_TOPOLOGY; - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MOSAIC_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY,1) - -//! Used in NvAPI_GetSupportedMosaicTopologies(). -typedef struct -{ - NvU32 version; - NvU32 totalCount; //!< Count of valid topologies - NV_MOSAIC_TOPOLOGY topos[NVAPI_MAX_MOSAIC_TOPOS]; //!< Maximum number of topologies - -} NV_MOSAIC_SUPPORTED_TOPOLOGIES; - -//! Used in NV_MOSAIC_SUPPORTED_TOPOLOGIES. -#define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES,1) - -//!@} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetSupportedMosaicTopologies -// -//! DESCRIPTION: This API returns all valid Mosaic topologies. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [out] pMosaicTopos An array of valid Mosaic topologies. -//! -//! \retval NVAPI_OK Call succeeded; 1 or more topologies were returned -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_MIXED_TARGET_TYPES Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetCurrentMosaicTopology -// -//! DESCRIPTION: This API gets the current Mosaic topology. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [out] pMosaicTopo The current Mosaic topology -//! \param [out] pEnabled TRUE if returned topology is currently enabled, else FALSE -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetCurrentMosaicTopology -// -//! DESCRIPTION: This API sets the Mosaic topology, and enables it so that the -//! Mosaic display settings are enumerated upon request. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [in] pMosaicTopo A valid Mosaic topology -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnableCurrentMosaicTopology -// -//! DESCRIPTION: This API enables or disables the current Mosaic topology. -//! When enabling, the last Mosaic topology will be set. -//! -//! - If enabled, enumeration of display settings will include valid Mosaic resolutions. -//! - If disabled, enumeration of display settings will not include Mosaic resolutions. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [in] enable TRUE to enable the Mosaic Topology, FALSE to disable it. -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable); - - -#define NVAPI_MAX_GSYNC_DEVICES 4 - - -// Sync Display APIs - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_EnumSyncDevices -// -//! DESCRIPTION: This API returns an array of Sync device handles. A Sync device handle represents a -//! single Sync device on the system. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [out] nvGSyncHandles- The caller provides an array of handles, which must contain at least -//! NVAPI_MAX_GSYNC_DEVICES elements. The API will zero out the entire array and then fill in one -//! or more handles. If an error occurs, the array is invalid. -//! \param [out] *gsyncCount- The caller provides the storage space. NvAPI_GSync_EnumSyncDevices -//! sets *gsyncCount to indicate how many of the elements in the nvGSyncHandles[] array are valid. -//! If an error occurs, *gsyncCount will be set to zero. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT nvGSyncHandles or gsyncCount is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_EnumSyncDevices(__out NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES], __out NvU32 *gsyncCount); - - -// GSync boardId values -#define NVAPI_GSYNC_BOARD_ID_P358 856 //!< GSync board ID 0x358, see NV_GSYNC_CAPABILITIES -#define NVAPI_GSYNC_BOARD_ID_P2060 8288 //!< GSync board ID 0x2060, see NV_GSYNC_CAPABILITIES - -//! \since Release: 375 -#define NVAPI_GSYNC_BOARD_ID_P2061 8289 //!< GSync board ID 0x2061, see NV_GSYNC_CAPABILITIES - - -//! Used in NvAPI_GSync_QueryCapabilities(). -typedef struct _NV_GSYNC_CAPABILITIES_V1 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA Revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use -} NV_GSYNC_CAPABILITIES_V1; - -typedef struct _NV_GSYNC_CAPABILITIES_V2 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA major revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use - NvU32 extendedRevision; //!< FPGA minor revision -} NV_GSYNC_CAPABILITIES_V2; - -typedef struct _NV_GSYNC_CAPABILITIES_V3 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA major revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use - NvU32 extendedRevision; //!< FPGA minor revision - NvU32 bIsMulDivSupported : 1; //!< Indicates if multiplication/division of the frequency of house sync signal is supported. - NvU32 reserved : 31; //!< Reserved for future use - NvU32 maxMulDivValue; //!< This parameter returns the maximum possible value that can be programmed - //!< for multiplying / dividing house sync. Only valid if bIsMulDivSupported is set to 1. -} NV_GSYNC_CAPABILITIES_V3; - -typedef NV_GSYNC_CAPABILITIES_V3 NV_GSYNC_CAPABILITIES; - - -//! \ingroup gsyncapi -//! Macro for constructing the version field of NV_GSYNC_CAPABILITIES. -#define NV_GSYNC_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V1,1) -#define NV_GSYNC_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V2,2) -#define NV_GSYNC_CAPABILITIES_VER3 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V3,3) -#define NV_GSYNC_CAPABILITIES_VER NV_GSYNC_CAPABILITIES_VER3 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_QueryCapabilities -// -//! DESCRIPTION: This API returns the capabilities of the Sync device. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The handle for a Sync device for which the capabilities will be queried. -//! \param [inout] *pNvGSyncCapabilities- The caller provides the storage space. NvAPI_GSync_QueryCapabilities() sets -//! *pNvGSyncCapabilities to the version and capabilities details of the Sync device -//! If an error occurs, *pNvGSyncCapabilities will be set to NULL. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_QueryCapabilities(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CAPABILITIES *pNvGSyncCapabilities); - - - -//! Connector values for a GPU. Used in NV_GSYNC_GPU. -typedef enum _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR -{ - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE = 0, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY = 1, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY = 2, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY = 3, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY = 4, -} NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR; - -//! Display sync states. Used in NV_GSYNC_DISPLAY. -typedef enum _NVAPI_GSYNC_DISPLAY_SYNC_STATE -{ - NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED = 0, - NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE = 1, - NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER = 2, -} NVAPI_GSYNC_DISPLAY_SYNC_STATE; - -typedef struct _NV_GSYNC_GPU -{ - NvU32 version; //!< Version of the structure - NvPhysicalGpuHandle hPhysicalGpu; //!< GPU handle - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR connector; //!< Indicates which connector on the device the GPU is connected to. - NvPhysicalGpuHandle hProxyPhysicalGpu; //!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected) - //!< - this is NULL otherwise - NvU32 isSynced : 1; //!< Whether this GPU is sync'd or not. - NvU32 reserved : 31; //!< Should be set to ZERO -} NV_GSYNC_GPU; - -typedef struct _NV_GSYNC_DISPLAY -{ - NvU32 version; //!< Version of the structure - NvU32 displayId; //!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId - NvU32 isMasterable : 1; //!< Can this display be the master? (Read only) - NvU32 reserved : 31; //!< Should be set to ZERO - NVAPI_GSYNC_DISPLAY_SYNC_STATE syncState; //!< Is this display slave/master - //!< (Retrieved with topology or set by caller for enable/disable sync) -} NV_GSYNC_DISPLAY; - -#define NV_GSYNC_DISPLAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DISPLAY,1) -#define NV_GSYNC_GPU_VER MAKE_NVAPI_VERSION(NV_GSYNC_GPU,1) - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetTopology -// -//! DESCRIPTION: This API returns the topology for the specified Sync device. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle for a Sync device for which the topology will be queried. -//! \param [in, out] gsyncGpuCount- It returns number of GPUs connected to Sync device -//! \param [in, out] gsyncGPUs- It returns info about GPUs connected to Sync device -//! \param [in, out] gsyncDisplayCount- It returns number of active displays that belongs to Sync device -//! \param [in, out] gsyncDisplays- It returns info about all active displays that belongs to Sync device -//! -//! HOW TO USE: 1) make a call to get the number of GPUs connected OR displays synced through Sync device -//! by passing the gsyncGPUs OR gsyncDisplays as NULL respectively. Both gsyncGpuCount and gsyncDisplayCount can be retrieved in same call by passing -//! both gsyncGPUs and gsyncDisplays as NULL -//! On call success: -//! 2) Allocate memory based on gsyncGpuCount(for gsyncGPUs) and/or gsyncDisplayCount(for gsyncDisplays) then make a call to populate gsyncGPUs and/or gsyncDisplays respectively. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_INSUFFICIENT_BUFFER When the actual number of GPUs/displays in the topology exceed the number of elements allocated for SyncGPUs/SyncDisplays respectively. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetTopology(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout_opt NvU32 *gsyncGpuCount, __inout_ecount_part_opt(*gsyncGpuCount, *gsyncGpuCount) NV_GSYNC_GPU *gsyncGPUs, - __inout_opt NvU32 *gsyncDisplayCount, __inout_ecount_part_opt(*gsyncDisplayCount, *gsyncDisplayCount) NV_GSYNC_DISPLAY *gsyncDisplays); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_SetSyncStateSettings -// -//! DESCRIPTION: Sets a new sync state for the displays in system. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] gsyncDisplayCount- The number of displays in gsyncDisplays. -//! \param [in] pGsyncDisplays- The caller provides the structure containing all displays that need to be synchronized in the system. -//! The displays that are not part of pGsyncDisplays, will be un-synchronized. -//! \param [in] flags- Reserved for future use. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT If the display topology or count not valid. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_INVALID_SYNC_TOPOLOGY 1.If any mosaic grid is partial. -//! 2.If timing(HVisible/VVisible/refreshRate) applied of any display is different. -//! 3.If There is a across GPU mosaic grid in system and that is not a part of pGsyncDisplays. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_SetSyncStateSettings(__in NvU32 gsyncDisplayCount, __in_ecount(gsyncDisplayCount) NV_GSYNC_DISPLAY *pGsyncDisplays, __in NvU32 flags); - - -//! \ingroup gsyncapi - -//! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_POLARITY -{ - NVAPI_GSYNC_POLARITY_RISING_EDGE = 0, - NVAPI_GSYNC_POLARITY_FALLING_EDGE = 1, - NVAPI_GSYNC_POLARITY_BOTH_EDGES = 2, -} NVAPI_GSYNC_POLARITY; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_VIDEO_MODE -{ - NVAPI_GSYNC_VIDEO_MODE_NONE = 0, - NVAPI_GSYNC_VIDEO_MODE_TTL = 1, - NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM = 2, - NVAPI_GSYNC_VIDEO_MODE_HDTV = 3, - NVAPI_GSYNC_VIDEO_MODE_COMPOSITE = 4, -} NVAPI_GSYNC_VIDEO_MODE; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_SYNC_SOURCE -{ - NVAPI_GSYNC_SYNC_SOURCE_VSYNC = 0, - NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC = 1, -} NVAPI_GSYNC_SYNC_SOURCE; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef struct _NV_GSYNC_DELAY -{ - NvU32 version; //!< Version of the structure - NvU32 numLines; //!< delay to be induced in number of horizontal lines. - NvU32 numPixels; //!< delay to be induced in number of pixels. - NvU32 maxLines; //!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only. - NvU32 minPixels; //!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only. -} NV_GSYNC_DELAY; - -#define NV_GSYNC_DELAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DELAY,1) - -//! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters(). -typedef struct _NV_GSYNC_CONTROL_PARAMS_V1 -{ - NvU32 version; //!< Version of the structure - NVAPI_GSYNC_POLARITY polarity; //!< Leading edge / Falling edge / both - NVAPI_GSYNC_VIDEO_MODE vmode; //!< None, TTL, NTSCPALSECAM, HDTV - NvU32 interval; //!< Number of pulses to wait between framelock signal generation - NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync - NvU32 interlaceMode:1; //!< interlace mode for a Sync device - NvU32 syncSourceIsOutput:1; //!< Set this to make house sync as an output; valid only when NV_GSYNC_CONTROL_PARAMS::source is NVAPI_GSYNC_SYNC_SOURCE_VSYNC on P2061 boards. - //!< syncSourceIsOutput should always be NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC i.e. 0 on P2060 boards or when NV_GSYNC_CONTROL_PARAMS::source is set to NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU32 reserved:30; //!< should be set zero - NV_GSYNC_DELAY syncSkew; //!< The time delay between the frame sync signal and the GPUs signal. - NV_GSYNC_DELAY startupDelay; //!< Sync start delay for master. -} NV_GSYNC_CONTROL_PARAMS_V1; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE -{ - NVAPI_GSYNC_UNDEFINED_MODE = 0, - NVAPI_GSYNC_MULTIPLY_MODE = 1, - NVAPI_GSYNC_DIVIDE_MODE = 2, -} NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE; - -typedef struct _NV_GSYNC_CONTROL_PARAMS_V2 -{ - NvU32 version; //!< Version of the structure - NVAPI_GSYNC_POLARITY polarity; //!< Leading edge / Falling edge / both - NVAPI_GSYNC_VIDEO_MODE vmode; //!< None, TTL, NTSCPALSECAM, HDTV - NvU32 interval; //!< Number of pulses to wait between framelock signal generation - NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync - NvU32 interlaceMode:1; //!< interlace mode for a Sync device - NvU32 syncSourceIsOutput:1; //!< Set this to make house sync as an output; valid only when NV_GSYNC_CONTROL_PARAMS::source is NVAPI_GSYNC_SYNC_SOURCE_VSYNC on P2061 boards. - //!< syncSourceIsOutput should always be NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC i.e. 0 on P2060 boards or when NV_GSYNC_CONTROL_PARAMS::source is set to NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU32 reserved:30; //!< should be set zero - NV_GSYNC_DELAY syncSkew; //!< The time delay between the frame sync signal and the GPUs signal. - NV_GSYNC_DELAY startupDelay; //!< Sync start delay for master. - NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE multiplyDivideMode; //!< Indicates multiplier/divider mode for the housesync signal. - //!< While setting multiplyDivideMode, source needs to be set as NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU8 multiplyDivideValue; //!< Indicates the multiplier/divider value for the housesync signal. Only supported if bIsMulDivSupported field of the structure NV_GSYNC_CAPABILITIES is set to 1. - //!< The maximum supported value for this field can be obtained from maxMulDivValue field of the structure NV_GSYNC_CAPABILITIES. -} NV_GSYNC_CONTROL_PARAMS_V2; - -typedef NV_GSYNC_CONTROL_PARAMS_V2 NV_GSYNC_CONTROL_PARAMS; -#define NV_GSYNC_CONTROL_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS_V1,1) -#define NV_GSYNC_CONTROL_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS_V2,2) -#define NV_GSYNC_CONTROL_PARAMS_VER NV_GSYNC_CONTROL_PARAMS_VER2 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetControlParameters -// -//! DESCRIPTION: This API queries for sync control parameters as defined in NV_GSYNC_CONTROL_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [inout] *pGsyncControls- The caller provides the storage space. NvAPI_GSync_GetControlParameters() populates *pGsyncControls with values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls); - - - -////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_SetControlParameters -// -//! DESCRIPTION: This API sets control parameters as defined in NV_SYNC_CONTROL_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [inout] *pGsyncControls- The caller provides NV_GSYNC_CONTROL_PARAMS. skew and startDelay will be updated to the applied values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_SetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls); - - - - -//! Used in NvAPI_GSync_AdjustSyncDelay() -typedef enum _NVAPI_GSYNC_DELAY_TYPE -{ - NVAPI_GSYNC_DELAY_TYPE_UNKNOWN = 0, - NVAPI_GSYNC_DELAY_TYPE_SYNC_SKEW = 1, - NVAPI_GSYNC_DELAY_TYPE_STARTUP = 2 -} NVAPI_GSYNC_DELAY_TYPE; - -////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_AdjustSyncDelay -// -//! DESCRIPTION: This API adjusts the skew and startDelay to the closest possible values. Use this API before calling NvAPI_GSync_SetControlParameters for skew or startDelay. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 319 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [in] delayType- Specifies whether the delay is syncSkew or startupDelay. -//! \param [inout] *pGsyncDelay- The caller provides NV_GSYNC_DELAY. skew and startDelay will be adjusted and updated to the closest values. -//! \param [out] *syncSteps- This parameter is optional. It returns the sync delay in unit steps. If 0, it means either the NV_GSYNC_DELAY::numPixels is less than NV_GSYNC_DELAY::minPixels or NV_GSYNC_DELAY::numOfLines exceeds the NV_GSYNC_DELAY::maxLines. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_AdjustSyncDelay(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NVAPI_GSYNC_DELAY_TYPE delayType, __inout NV_GSYNC_DELAY *pGsyncDelay, __out_opt NvU32* syncSteps); - - - -//! Used in NvAPI_GSync_GetSyncStatus(). -typedef struct _NV_GSYNC_STATUS -{ - NvU32 version; //!< Version of the structure - NvU32 bIsSynced; //!< Is timing in sync? - NvU32 bIsStereoSynced; //!< Does the phase of the timing signal from the GPU = the phase of the master sync signal? - NvU32 bIsSyncSignalAvailable; //!< Is the sync signal available? -} NV_GSYNC_STATUS; - -//! Macro for constructing the version field for NV_GSYNC_STATUS. -#define NV_GSYNC_STATUS_VER MAKE_NVAPI_VERSION(NV_GSYNC_STATUS,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetSyncStatus -// -//! DESCRIPTION: This API queries the sync status of a GPU - timing, stereosync and sync signal availability. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- Handle of the Sync device -//! \param [in] hPhysicalGpu- GPU to be queried for sync status. -//! \param [out] *status- The caller provides the storage space. NvAPI_GSync_GetSyncStatus() populates *status with -//! values - timing, stereosync and signal availability. On error, *status is set to NULL. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / SyncTarget is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any G-Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetSyncStatus(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GSYNC_STATUS *status); - - -//! \ingroup gsyncapi - -#define NVAPI_MAX_RJ45_PER_GSYNC 2 - -//! Used in NV_GSYNC_STATUS_PARAMS. -typedef enum _NVAPI_GSYNC_RJ45_IO -{ - NVAPI_GSYNC_RJ45_OUTPUT = 0, - NVAPI_GSYNC_RJ45_INPUT = 1, - NVAPI_GSYNC_RJ45_UNUSED = 2 //!< This field is used to notify that the framelock is not actually present. - -} NVAPI_GSYNC_RJ45_IO; - -//! \ingroup gsyncapi -//! Used in NvAPI_GSync_GetStatusParameters(). -typedef struct _NV_GSYNC_STATUS_PARAMS_V1 -{ - NvU32 version; - NvU32 refreshRate; //!< The refresh rate - NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output - NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!] - NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz - NvU32 bHouseSync; //!< Is house sync connected? -} NV_GSYNC_STATUS_PARAMS_V1; - -typedef struct _NV_GSYNC_STATUS_PARAMS_V2 -{ - NvU32 version; - NvU32 refreshRate; //!< The refresh rate - NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output - NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!] - NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz - NvU32 bHouseSync; //!< Is house sync connected? - NvU32 bInternalSlave : 1; //!< Valid only for P2061 board. - //!< If set to 1, it means that this P2061 board receives input from another P2061 board. - NvU32 reserved : 31; //!< Reserved for future use. -} NV_GSYNC_STATUS_PARAMS_V2; - - -typedef NV_GSYNC_STATUS_PARAMS_V2 NV_GSYNC_STATUS_PARAMS; - -//! \ingroup gsyncapi -//! Macro for constructing the version field of NV_GSYNC_STATUS_PARAMS -#define NV_GSYNC_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V1,1) -#define NV_GSYNC_STATUS_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V2,2) -#define NV_GSYNC_STATUS_PARAMS_VER NV_GSYNC_STATUS_PARAMS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetStatusParameters -// -//! DESCRIPTION: This API queries for sync status parameters as defined in NV_GSYNC_STATUS_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice The caller provides the handle of the GSync device for which to get parameters -//! \param [out] *pStatusParams The caller provides the storage space. NvAPI_GSync_GetStatusParameters populates *pStatusParams with -//! values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / pStatusParams is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any GSync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetStatusParameters(NvGSyncDeviceHandle hNvGSyncDevice, NV_GSYNC_STATUS_PARAMS *pStatusParams); - -//! @} - - - - - - - - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_RegisterResource -// -//! DESCRIPTION: This API binds a resource (surface/texture) so that it can be retrieved -//! internally by NVAPI. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] pResource surface/texture -//! -//! \return ::NVAPI_OK, ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResource); -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_UnregisterResource -// -//! DESCRIPTION: This API unbinds a resource (surface/texture) after use. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pResource surface/texture -//! -//! \return ::NVAPI_OK, ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9* pResource); - -#endif //defined(_D3D9_H_) - - - - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture -// -//! \fn NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev, -//! IDirect3DSurface9* pSurface, -//! IDirect3DTexture9 **ppTexture, -//! DWORD dwFlag); -//! DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI. The -//! new texture can be bound with IDirect3DDevice9::SetTexture(). Note that the texture must -//! be unbound before drawing to the surface again. -//! Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before -//! being used as a texture. MSAA depth buffers are resolved with a point filter, -//! and non-depth MSAA surfaces are resolved with a linear filter. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The D3D device that owns the objects -//! \param [in] pSurface Pointer to a surface that has been registered with NvAPI -//! to which a texture alias is to be provided -//! \param [out] ppTexture Fill with the texture created -//! \param [in] dwFlag NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument -//! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid, probably dwFlag. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE pSurface has not been registered with NvAPI -//! \retval ::NVAPI_ERROR error occurred -// -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dx -//! See NvAPI_D3D9_AliasSurfaceAsTexture(). -typedef enum { - NVAPI_ALIAS_SURFACE_FLAG_NONE = 0x00000000, - NVAPI_ALIAS_SURFACE_FLAG_USE_SUPER = 0x00000001, //!< Use the surface's msaa buffer directly as a texture, rather than resolving. (This is much slower, but potentially has higher quality.) - NVAPI_ALIAS_SURFACE_FLAG_MASK = 0x00000001 -} NVAPI_ALIAS_SURFACE_FLAG; - - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev, - IDirect3DSurface9* pSurface, - IDirect3DTexture9 **ppTexture, - DWORD dwFlag); -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_StretchRectEx -// -//! DESCRIPTION: This API copies the contents of the source resource to the destination -//! resource. This function can convert -//! between a wider range of surfaces than -//! IDirect3DDevice9::StretchRect. For example, it can copy -//! from a depth/stencil surface to a texture. -//! -//! The source and destination resources *must* be registered -//! with NvAPI before being used with NvAPI_D3D9_StretchRectEx(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device that owns the objects. -//! \param [in] pSourceResource Pointer to the source resource. -//! \param [in] pSrcRect Defines the rectangle on the source to copy from. If NULL, copy from the entire resource. -//! \param [in] pDestResource Pointer to the destination resource. -//! \param [in] pDstRect Defines the rectangle on the destination to copy to. If NULL, copy to the entire resource. -//! \param [in] Filter Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR. -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid -//! \retval ::NVAPI_UNREGISTERED_RESOURCE a resource was passed in without being registered -//! \retval ::NVAPI_ERROR error occurred -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 * pDevice, - IDirect3DResource9 * pSourceResource, - CONST RECT * pSourceRect, - IDirect3DResource9 * pDestResource, - CONST RECT * pDestRect, - D3DTEXTUREFILTERTYPE Filter); - -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_ClearRT -// -//! DESCRIPTION: This API Clears the currently bound render target(s) with the -//! given color -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device that owns the objects. -//! \param [in] dwNumRects The no of rectangles to clear. If 0, clear the entire surface (clipped to viewport) -//! \param [in] pRects Defines the rectangles to clear. Should be NULL if dwNumRects == 0 -//! \param [in] r red component of the clear color -//! \param [in] g green component of the clear color -//! \param [in] b blue component of the clear color -//! \param [in] a alpha component of the clear color -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_ClearRT(IDirect3DDevice9 * pDevice, - NvU32 dwNumRects, - CONST RECT * pRects, - float r, float g, float b, float a); -#endif //if defined(_D3D9_H_) - - - - - - - - - - -#if defined(_D3D9_H_) && defined(__cplusplus) -//! SUPPORTED OS: Windows 7 and higher -//! - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_GetSurfaceHandle -// -//! This function gets the handle of a given surface. This handle uniquely -//! identifies the surface through all NvAPI entries. -//! -//! -//! \since Release: 313 -//! -//! \param [in] pSurface Surface to be identified -//! \param [out] pHandle Will be filled by the return handle -//! -//! \return An int which could be an NvAPI status or DX HRESULT code -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_GetSurfaceHandle(IDirect3DSurface9 *pSurface, - NVDX_ObjectHandle *pHandle); - -#endif //defined(_D3D9_H_) && defined(__cplusplus) - -#if defined(_D3D9_H_) && defined(__cplusplus) -//! SUPPORTED OS: Windows 7 and higher -//! -//! \addtogroup dxvidcontrol -//! @{ - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION_NAME: NvAPI_D3D9_VideoSetStereoInfo -// -//! \fn NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev, -//! NV_DX_VIDEO_STEREO_INFO *pStereoInfo); -//! \code -//! DESCRIPTION: This api specifies the stereo format of a surface, so that the -//! surface could be used for stereo video processing or compositing. -//! In particular, this api could be used to link the left and right -//! views of a decoded picture. -//! -//! \since Release: 313 -//! -//! INPUT: pDev - The device on which the stereo surface will be used -//! pStereoInfo - The stereo format of the surface -//! -//! RETURN STATUS: an int which could be an NvAPI status or DX HRESULT code -//! \endcode -/////////////////////////////////////////////////////////////////////////////// - -#ifndef NV_STEREO_VIDEO_FORMAT_DEFINE -#define NV_STEREO_VIDEO_FORMAT_DEFINE - - -typedef enum _NV_STEREO_VIDEO_FORMAT -{ - NV_STEREO_VIDEO_FORMAT_NOT_STEREO = 0, - - NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_LR = 1, - NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_RL = 2, - NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_LR = 3, - NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_RL = 4, - NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_LR = 5, - NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_RL = 6, - NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR = 7, - NV_STEREO_VIDEO_FORMAT_MONO_PLUS_OFFSET = 8, - - NV_STEREO_VIDEO_FORMAT_LAST = 9, -} NV_STEREO_VIDEO_FORMAT; - -#endif // NV_STEREO_VIDEO_FORMAT_DEFINE - - -typedef struct _NV_DX_VIDEO_STEREO_INFO { - NvU32 dwVersion; //!< Must be NV_DX_VIDEO_STEREO_INFO_VER - NVDX_ObjectHandle hSurface; //!< The surface whose stereo format is to be set - NVDX_ObjectHandle hLinkedSurface; //!< The linked surface (must be valid when eFormat==NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR) - NV_STEREO_VIDEO_FORMAT eFormat; //!< Stereo format of the surface - NvS32 sViewOffset; //!< Signed offset of each view (positive offset indicating left view is shifted left) - BOOL bStereoEnable; //!< Whether stereo rendering should be enabled (if FALSE, only left view will be used) -} NV_DX_VIDEO_STEREO_INFO; - -//! Macro for constructing the version field of ::NV_DX_VIDEO_STEREO_INFO -#define NV_DX_VIDEO_STEREO_INFO_VER MAKE_NVAPI_VERSION(NV_DX_VIDEO_STEREO_INFO,1) - -NVAPI_INTERFACE NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev, - NV_DX_VIDEO_STEREO_INFO *pStereoInfo); - -//! @} -#endif //defined(_D3D9_H_) && defined(__cplusplus) - - -#if defined(__cplusplus) && defined(__d3d10_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D10_SetDepthBoundsTest -// -//! DESCRIPTION: This function enables/disables the depth bounds test. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device to set the depth bounds test -//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test -//! \param [in] fMinDepth The minimum depth for the depth bounds test -//! \param [in] fMaxDepth The maximum depth for the depth bounds test \n -//! The valid values for fMinDepth and fMaxDepth -//! are such that 0 <= fMinDepth <= fMaxDepth <= 1 -//! -//! \return NVAPI_OK if the depth bounds test was correctly enabled or disabled -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D10_SetDepthBoundsTest(ID3D10Device *pDev, - NvU32 bEnable, - float fMinDepth, - float fMaxDepth); - -#endif //defined(__cplusplus) && defined(__d3d10_h__) - - - - - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_IsNvShaderExtnOpCodeSupported -// -//! DESCRIPTION: This function checks if a nv HLSL shader extension opcode is -//! supported on current hardware. List of opcodes is in nvShaderExtnEnums.h -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device on which to query for support, -//! should be a ID3D11Device+ device -//! \param [in] opCode the opcode to check -//! \param [out] pSupported true if supported, false otherwise -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK if the call succeeded -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_IsNvShaderExtnOpCodeSupported(__in IUnknown *pDev, - __in NvU32 opCode, - __out bool *pSupported); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlot -// -//! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL -//! shader extensions globally. All createShader calls made to the driver after -//! setting this slot would treat writes/reads to this UAV in a -//! different way. Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D11Device+ device -//! \param [in] uavSlot the uav slot to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlot(__in IUnknown *pDev, - __in NvU32 uavSlot); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && defined (__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpace -// -//! DESCRIPTION: This function is specifically created for ray tracing since we do not -//! currently support PSOs with DXR. -//! This function sets the device's fake UAV slot and space that is used by Nvidia HLSL -//! shader extensions globally. All state objects created by the driver after -//! setting this slot would treat writes/reads to this UAV in a -//! different way. Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D12Device+ device -//! \param [in] uavSlot The uav slot to use -//! \param [in] uavSpace The uav space to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpace(__in IUnknown *pDev, - __in NvU32 uavSlot, - __in NvU32 uavSpace); - - /////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread -// -//! DESCRIPTION: This function is specifically created for ray tracing shaders since we do not -//! currently support PSOs with DXR. -//! This function sets the device's fake UAV slot that is used by Nvidia HLSL -//! shader extensions on local thread. All state objects created by the driver -//! on the same thread that call this function after setting this slot would treat writes/reads -//! to this UAV in a different way. -//! Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages for the device. -//! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! \since Release: 387 -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D12Device+ device -//! \param [in] uavSlot the uav slot to use -//! \param [in] uavSpace the uav space to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread(__in IUnknown *pDev, - __in NvU32 uavSlot, - __in NvU32 uavSpace); - -#endif //defined (__cplusplus) && defined (__d3d12_h__) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlotLocalThread -// -//! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL -//! shader extensions on local thread. All createShader calls on the same thread -//! that calls this function after setting this slot would treat writes/reads -//! to this UAV in a different way. -//! Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 387 -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D11Device+ device -//! \param [in] uavSlot the uav slot to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlotLocalThread(__in IUnknown *pDev, - __in NvU32 uavSlot); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlapEx -// -//! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs. -//! Applications must use this with caution otherwise this might cause data hazards when -//! multiple draw calls/compute shader launches are accessing same memory locations -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! \param [in] insertWFIFlags bit fields to indicate which WFI would be inserted (gfx / compute / both). -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -typedef enum _NVAPI_D3D11_INSERTWFI_FLAG -{ - NVAPI_D3D_BEGIN_UAV_OVERLAP_NO_WFI = 0x00000000, //!< no WFI - NVAPI_D3D_BEGIN_UAV_OVERLAP_GFX_WFI = 0x00000001, //!< (bit 0) force graphics WFI - NVAPI_D3D_BEGIN_UAV_OVERLAP_COMP_WFI = 0x00000002, //!< (bit 1) force compute WFI -} NVAPI_D3D11_INSERTWFI_FLAG; - -NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlapEx(__in IUnknown *pDeviceOrContext, __in NvU32 insertWFIFlags); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlap -// -//! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs. -//! Applications must use this with caution otherwise this might cause data hazards when -//! multiple draw calls/compute shader launches are accessing same memory locations -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlap(__in IUnknown *pDeviceOrContext); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_EndUAVOverlap -// -//! DESCRIPTION: Re-enables driver synchronization between calls that access same UAVs -//! See NvAPI_D3D_BeginUAVOverlap for more details. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_EndUAVOverlap(__in IUnknown *pDeviceOrContext); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined(__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_GetResourceHandle -// -//! \code -//! DESCRIPTION: This function retrieves a driver handle to a DX10 resource -//! -//! INPUT: pDev The device on which the resource was created -//! pResource The resource for which we want to retrieve a -//! driver handle. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! OUTPUT: phObject Pointer to an NvAPI handle to be populated -//! on success -//! -//! RETURN STATUS: NVAPI_OK if and only if phObject was populated with a valid -//! driver handle -//! \endcode -//! \ingroup nsightapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_GetResourceHandle(ID3D11Device *pDev, - ID3D11Resource* pResource, - NVDX_ObjectHandle* phObject); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetFPSIndicatorState -// -//! DESCRIPTION: Display an overlay that tracks the number of times the app presents per second, or, -//! the number of frames-per-second (FPS) -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] bool Whether or not to enable the fps indicator. -//! -//! \return ::NVAPI_OK, -//! ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetFPSIndicatorState(IUnknown *pDev, NvU8 doEnable); - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_Present -// -//! DESCRIPTION: This API presents the contents of the next buffer in the sequence of back buffers -//! owned by a IDirect3DDevice9 device. -//! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain -//! that owns the back buffer to be presented. -//! -//! NOTE: NvAPI_D3D9_Present is a wrapper of the method IDirect3DDevice9::Present which -//! additionally notifies the D3D driver of the SwapChain used by the runtime for -//! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier -//! functionality to that SwapChain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The IDirect3DDevice9 interface that is used to issue the Present, -//! using the following IDirect3DDevice9::Present input parameters -//! \param [in] pSwapChain Optional pointer to a IDirect3DSwapChain9 interface. If provided, the presentation is executed -//! using this interface (i.e. pSwapChain->Present()) for the given swapchain only. -//! If NULL, the presentation is executed on the device for all swapchains as in pDevice->Present() -//! \param [in] pSourceRect A pointer to a RECT structure containing the source rectangle. -//! If NULL, the entire source surface is presented. -//! \param [in] pDestRect A pointer to a RECT structure containing the destination rectangle, in window client coordinates. -//! If NULL, the entire client area is filled. -//! \param [in] hDestWindowOverride A pointer to a destination window whose client area is taken as the target for this presentation. -//! If this value is NULL, then the hWndDeviceWindow member of D3DPRESENT_PARAMTERS is taken. -//! \param [in] pDirtyRegion (IN) A pointer to a region to be presented. It must be NULL unless the swap chain was reated with -//! D3DSWAPEFFECT_COPY. If this value is non-NULL, the contained region is expressed in back buffer coordinates. -//! -//! \retval ::NVAPI_OK the Present operation was successfully executed -//! \retval ::NVAPI_D3D_DEVICE_LOST D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET, the caller has to reset device -//! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error other than D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET -//! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//!\ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_Present(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - const RECT *pSourceRect, - const RECT *pDestRect, - HWND hDestWindowOverride, - const RGNDATA *pDirtyRegion); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QueryFrameCount -// -//! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device -//! \param [out] pFrameCount The caller provides the storage space where the framecount is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK *pFrameCount populated with framecount value. -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QueryFrameCount(IDirect3DDevice9 *pDevice, - NvU32 *pFrameCount); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_ResetFrameCount -// -//! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK framecounter has been reset -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_ResetFrameCount(IDirect3DDevice9 *pDevice); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QueryMaxSwapGroup -// -//! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored. -//! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QueryMaxSwapGroup(IDirect3DDevice9 *pDevice, - NvU32 *pMaxGroups, - NvU32 *pMaxBarriers); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QuerySwapGroup -// -//! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain -//! that belongs to the swapgroup client device -//! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored. -//! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QuerySwapGroup(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - NvU32 *pSwapGroup, - NvU32 *pSwapBarrier); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_JoinSwapGroup -// -//! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain -//! that belongs to the swapgroup client device -//! \param [in] group The caller specifies the SwapGroup which the SwapChain should join. -//! - If the value of group is zero, the SwapChain leaves the SwapGroup. -//! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or -//! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block -//! until all members of the SwapGroup are ready and the presentation was actually executed. -//! A boolean value of false means the Present operation returns immediately and a value of true -//! means the Present operation is blocking. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_JoinSwapGroup(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - NvU32 group, - BOOL blocking); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_BindSwapBarrier -// -//! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier. -//! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to. -//! - If the value of barrier is zero, the SwapGroup will be released from the SwapBarrier. -//! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive -//! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapGroup is bound to or released from the specified SwapBarrier -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_BindSwapBarrier(IDirect3DDevice9 *pDevice, - NvU32 group, - NvU32 barrier); -#endif //if defined(_D3D9_H_) - -//! \ingroup dx -typedef enum -{ - NVAPI_VSYNC_DEFAULT, //!< Fall back to the default settings - NVAPI_VSYNC_OFF, //!< Force vertical sync off when performance is more important than image quality and for benchmarking" - NVAPI_VSYNC_ON, //!< Force vertical sync on when image quality is more important than performance - NVAPI_VSYNC_ADAPTIVE, //!< Select adaptive to turn vertical sync on or off based on the frame rate. - //! Vertical sync will only be on for frame rates above the monitor refresh rate. - NVAPI_VSYNC_ADAPTIVE_HALF_REFRESH_RATE //!< - -} NVAPI_VSYNC_MODE; - - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetVerticalSyncMode -// -//! DESCRIPTION: This API set the vertical sync mode for the given device context. -//! -//! \param [in] pDevice The caller provides the device and can be either IDirect3DDevice9 or ID3D10Device or ID3D10Device1 or ID3D11Device. -//! \param [in] vsyncMode The caller specifies the NVAPI_VSYNC_MODE to be set. -//! -//! SUPPORTED OS: Windows Vista -//! -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetVerticalSyncMode(__in IUnknown *pDevice, __in NVAPI_VSYNC_MODE vsyncMode); - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_Present -// -//! DESCRIPTION: Presents the contents of the next buffer in the sequence of back buffers -//! owned by a D3D device. -//! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain -//! that owns the back buffer to be presented. -//! -//! NOTE: NvAPI_D3D1x_Present is a wrapper of the method IDXGISwapChain::Present which -//! additionally notifies the D3D driver of the SwapChain used by the runtime for -//! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier -//! functionality to that SwapChain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device interface that is used to issue the Present operation, -//! using the following IDirect3DDevice9::Present input parameters. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is intended to present -//! \param [in] SyncInterval An integer that specifies the how to synchronize presentation of a frame with the vertical blank. -//! Values are: -//! - 0: The presentation occurs immediately, there is no synchronization. -//! - 1,2,3,4 : Synchronize presentation after the n'th vertical blank. -//! \param [in] Flags An integer value that contains swap-chain presentation options as defined in DXGI_PRESENT. -//! -//! \retval ::NVAPI_OK the Present operation was successfully executed -//! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error DXGI_ERROR_DEVICE_RESET or DXGI_ERROR_DEVICE_REMOVED, -// DXGI_STATUS_OCCLUDED, or D3DDDIERR_DEVICEREMOVED. -//! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_Present(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - UINT SyncInterval, - UINT Flags); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QueryFrameCount -// -//! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device, -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [out] pFrameCount The caller provides the storage space where the framecount is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK *pFrameCount populated with framecount value. -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QueryFrameCount(IUnknown *pDevice, - NvU32 *pFrameCount); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_ResetFrameCount -// -//! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device, -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK framecounter has been reset -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT pDevice arg passed in is invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_ResetFrameCount(IUnknown *pDevice); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QueryMaxSwapGroup -// -//! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system. -//! -//! \param [in] pDevice The caller provides the D3D device that is intended to use SwapGroup functionality. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored. -//! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QueryMaxSwapGroup(IUnknown *pDevice, - NvU32 *pMaxGroups, - NvU32 *pMaxBarriers); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QuerySwapGroup -// -//! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client. -//! -//! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored. -//! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QuerySwapGroup(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - NvU32 *pSwapGroup, - NvU32 *pSwapBarrier); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_JoinSwapGroup -// -//! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client. -//! \param [in] group The caller specifies the SwapGroup which the SwapChain should join. -//! - If the value of group is zero, the SwapChain leaves the SwapGroup. -//! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or -//! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block -//! until all members of the SwapGroup are ready and the presentation was actually executed. -//! A boolean value of false means the Present operation returns immediately and a value of true -//! means the Present operation is blocking. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_JoinSwapGroup(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - NvU32 group, - BOOL blocking); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_BindSwapBarrier -// -//! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier. -//! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to. -//! - If the value of barrier is zero, the SwapGroup releases the SwapBarrier. -//! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive -//! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_D3D1x_QueryMaxSwapGroup. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapGroup is bound to the specified SwapBarrier -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_BindSwapBarrier(IUnknown *pDevice, - NvU32 group, - NvU32 barrier); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryPresentBarrierSupport -// -//! DESCRIPTION: This API returns if presentBarrier feature is supported on the specified device. -//! -//! \since Release: 470 -//! -//! \param [in] pDevice The ID3D12Device device which owns the SwapChain as a PresentBarrier client. -//! \param [out] pSupported Pointer to a boolean returning true if supported, false otherwise. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_QueryPresentBarrierSupport(__in ID3D12Device *pDevice, __out bool *pSupported); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreatePresentBarrierClient -// -//! DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle, which -//! owns the swapchain to be synchronized through PresentBarrier. -//! This handle is used in other PresentBarrier functions. -//! -//! \since Release: 470 -//! -//! \param [in] pDevice The ID3D12Device device which owns the SwapChain as a PresentBarrier client. -//! \param [in] pSwapChain The IDXGISwapChain interface that presentBarrier is operated on. -//! \param [OUT] pPresentBarrierClient Pointer to an NvPresentBarrierClientHandle handle created by the driver -//! on success. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreatePresentBarrierClient(__in ID3D12Device *pDevice, - __in IDXGISwapChain *pSwapChain, - __out NvPresentBarrierClientHandle *pPresentBarrierClient); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RegisterPresentBarrierResources -// -//! DESCRIPTION: This API registers scanout resources of a presentBarrier client -//! to the presentBarrier, and a fence object which is used for -//! presentBarrier synchronization. Once the registration has completed -//! successfully, it is not allowed to add additional resources, i.e. the -//! number of back buffers and fence object are not allowed to be -//! changed. However, application must call this function whenever the -//! back buffers are changed, e.g. ResizeBuffers() is called. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient The NvPresentBarrierClientHandle client handle that owns the resources. -//! \param [in] pFence An ID3D12Fence object created by the application and used for present -//! synchronization through presentBarrier. Application must wait on this -//! fence to ensure the scanout resources are ready for use in the next -//! rendering loop. The fence is only signaled by the driver and must not -//! be signaled through any other queue command. The fence value must be -//! monotonically increasing on every present call, and tracked by the -//! application. -//! \param [in] ppResources An array of ID3D12Resource to be synchronized through presentBarrier, and -//! the size is specified by numResources. -//! \param [in] numResources The number of ID3D12Resource elements in ppResources. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \return ::NVAPI_INVALID_ARGUMENT an invalid number of resources was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RegisterPresentBarrierResources(__in NvPresentBarrierClientHandle presentBarrierClient, - __in ID3D12Fence *pFence, - __in ID3D12Resource **ppResources, - __in NvU32 numResources); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DestroyPresentBarrierClient -// -//! DESCRIPTION: This API destroys a presentBarrier client, and must be called -//! after client leaves presentBarrier to avoid memory leak. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DestroyPresentBarrierClient(__in NvPresentBarrierClientHandle presentBarrierClient); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -typedef struct _NV_JOIN_PRESENT_BARRIER_PARAMS -{ - NvU32 dwVersion; //!< Must be NV_JOIN_PRESENT_BARRIER_PARAMS_VER1 -} NV_JOIN_PRESENT_BARRIER_PARAMS; - -//! Macro for constructing the version field of ::NV_JOIN_PRESENT_BARRIER_PARAMS -#define NV_JOIN_PRESENT_BARRIER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_JOIN_PRESENT_BARRIER_PARAMS, 1) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_JoinPresentBarrier -// -//! DESCRIPTION: This API adds a registered PresentBarrier client to the presentBarrier. -//! If the call suceeds, image present of the registered scanout resources -//! from this client is under the synchronization of presentBarrier. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient -//! \param [in] pParams Parameters to joining presentBarrier. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of data structure is not correct -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_JoinPresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient, __in NV_JOIN_PRESENT_BARRIER_PARAMS *pParams); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_LeavePresentBarrier -// -//! DESCRIPTION: This API removes a registered client from presentBarrier. If this -//! client does not join presentBarrier, this function does nothing. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_LeavePresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) - -#define NV_PRESENT_BARRIER_FRAME_STATICS_VER1 MAKE_NVAPI_VERSION(NV_PRESENT_BARRIER_FRAME_STATISTICS,1) - -typedef enum _NV_PRESENT_BARRIER_SYNC_MODE -{ - PRESENT_BARRIER_NOT_JOINED = 0x00000000, //!< The client hasn't joined presentBarrier - PRESENT_BARRIER_SYNC_CLIENT = 0x00000001, //!< The client joined the presentBarrier, but is not synchronized with - //! any other presentBarrier clients. This happens if the back buffers - //! of this client are composited instead of being flipped out to screen - PRESENT_BARRIER_SYNC_SYSTEM = 0x00000002, //!< The client joined the presentBarrier, and is synchronized with other - //! presentBarrier clients within the system - PRESENT_BARRIER_SYNC_CLUSTER = 0x00000003, //!< The client joined the presentBarrier, and is synchronized with other - //! clients within the system and across systems through QSync devices -} NV_PRESENT_BARRIER_SYNC_MODE; - -typedef struct _NV_PRESENT_BARRIER_FRAME_STATISTICS -{ - NvU32 dwVersion; //!< Must be NV_PRESENT_BARRIER_FRAME_STATICS_VER1 - NV_PRESENT_BARRIER_SYNC_MODE SyncMode; //!< The presentBarrier mode of this client from last present call - NvU32 PresentCount; //!< The total count of times that a frame has been presented from this - //! client after it joined presentBarrier successfully. - NvU32 PresentInSyncCount; //!< The total count of times that a frame has been presented from this - //! client and that has happened since the returned SyncMode is - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - NvU32 FlipInSyncCount; //!< The total count of flips from this client since the returned SyncMode - //! is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - NvU32 RefreshCount; //!< The total count of v-blanks since the returned SyncMode of this client - //! is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. -} NV_PRESENT_BARRIER_FRAME_STATISTICS; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_QueryPresentBarrierFrameStatistics -// -//! DESCRIPTION: This API returns the presentBarrier frame statistics of last -//! present call from this client. If the client did not join -//! presentBarrier, the SyncMode is returned as PRESENT_BARRIER_NOT_JOINED, -//! and all other fields are reset. Driver does not retain any -//! presentBarrier info of the client once it leaves presentBarrier. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient. -//! \param [out] pFrameStats Pointer to NV_PRESENT_BARRIER_FRAME_STATISTICS structure about presentBarrier statistics. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION invalid version of frameStatistics params -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_QueryPresentBarrierFrameStatistics(__in NvPresentBarrierClientHandle presentBarrierClient, - __out NV_PRESENT_BARRIER_FRAME_STATISTICS *pFrameStats); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateDDisplayPresentBarrierClient -// -//! DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle. -//! -//! \since Release: 510 -//! -//! \param [in] pDevice The ID3D12Device device which executes the rendering commands of this PresentBarrier -//! client. It must be created on the same adapter as DisplayDevice. -//! \param [in] sourceId The adapter-relative identifier for the DisplaySource obtained from DisplaySource.SourceId(). -//! \param [OUT] pPresentBarrierClient Pointer to an NvPresentBarrierClientHandle handle created by the driver on success. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_INVALID_HANDLE the input displaySource handle is not owned by the process -//! \return ::NVAPI_NOT_SUPPORTED PresentBarrier featue is not supported on this configuration -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateDDisplayPresentBarrierClient(__in ID3D12Device *pDevice, __in NvU32 sourceId, __out NvPresentBarrierClientHandle *pPresentBarrierClient); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__)) - -enum NVAPI_QUAD_FILLMODE -{ - NVAPI_QUAD_FILLMODE_DISABLED = 0, - NVAPI_QUAD_FILLMODE_BBOX = 1, - NVAPI_QUAD_FILLMODE_FULL_VIEWPORT = 2, -}; - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -typedef struct NvAPI_D3D11_RASTERIZER_DESC_EX -{ - // D3D11_RASTERIZER_DESC member variables - D3D11_FILL_MODE FillMode; - D3D11_CULL_MODE CullMode; - BOOL FrontCounterClockwise; - INT DepthBias; - FLOAT DepthBiasClamp; - FLOAT SlopeScaledDepthBias; - BOOL DepthClipEnable; - BOOL ScissorEnable; - BOOL MultisampleEnable; - BOOL AntialiasedLineEnable; - - // NvAPI_D3D11_RASTERIZER_DESC_EX specific member variables - NvU32 ForcedSampleCount; //1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set - NvU8 SamplePositionsX[16]; // 1 && (pDesc->MiscFlags&D3D11_RESOURCE_MISC_TILED) -//! \param [in] pInitialData A pointer to an array of D3D11_SUBRESOURCE_DATA structures that describe subresources for the 2D texture resource. -//! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the created texture. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateTiledTexture2DArray(__in ID3D11Device *pDevice, - __in const D3D11_TEXTURE2D_DESC *pDesc, - __in const D3D11_SUBRESOURCE_DATA *pInitialData, - __out ID3D11Texture2D **ppTexture2D); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -typedef enum _NV_D3D11_FEATURE -{ - NV_D3D11_FEATURE_RASTERIZER, -} NV_D3D11_FEATURE; - -typedef struct _NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT -{ - BOOL TargetIndependentRasterWithDepth; - BOOL ProgrammableSamplePositions; - BOOL InterleavedSampling; - BOOL ConservativeRaster; - BOOL PostZCoverage; - BOOL CoverageToColor; -} NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CheckFeatureSupport -// -//! DESCRIPTION: This function gets information about the features that are supported by the current graphics driver. -//! -//! -//! -//! \param [in] pDevice The device on which to query for support. -//! \param [in] Feature A member of the NvAPI_D3D11_FEATURE enumerated type that describes which feature to query for suppor. -//! \param [in] pFeatureSupportData Upon completion of the method, the passed structure is filled with data that describes the feature support. -//! \param [out] FeatureSupportDataSize The size of the structure passed to the pFeatureSupportData parameter. -//! -//! \since Release: 410 -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! \retval :: Returns NVAPI_OK if successful; returns NVAPI_INVALID_ARGUMENT if an unsupported data type is passed to the pFeatureSupportData parameter -//! or a size mismatch is detected for the FeatureSupportDataSize parameter; -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CheckFeatureSupport(__in ID3D11Device *pDevice, - __in NV_D3D11_FEATURE Feature, - __out void *pFeatureSupportData, - __in UINT FeatureSupportDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateImplicitMSAATexture2D -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_CreateImplicitMSAATexture2D is a simple wrapper of ID3D11Device::CreateTexture2D -//! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture. -//! -//! \param [in] pDevice Current d3d device -//! \param [in] pDesc A pointer to a D3D11_TEXTURE2D_DESC structure that describes a 2D texture resource. -//! To create a typeless resource that can be interpreted at runtime into different, -//! compatible formats, specify a typeless format in the texture description. -//! To generatemipmap levels automatically, set the number of mipmap levels to 0. -//! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object -//! sees resource as non-multisampled. -//! -//! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the -//! created texture. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateImplicitMSAATexture2D(__in ID3D11Device *pDevice, - __in const D3D11_TEXTURE2D_DESC *pDesc, - __out ID3D11Texture2D **ppTexture2D); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateImplicitMSAATexture2D -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D is a simple wrapper of ID3D12Device::CreateCommittedResource -//! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture. -//! -//! \param [in] pDevice Current d3d device -//! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes a 2D texture resource. -//! To create a typeless resource that can be interpreted at runtime into different, -//! compatible formats, specify a typeless format in the texture description. -//! To generatemipmap levels automatically, set the number of mipmap levels to 0. -//! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object -//! sees resource as non-multisampled. -//! \param [in] pHeapProperties, HeapFlags, InitialResourceState, pOptimizedClearValue, riidResource See D3D12 docs -//! -//! \param [out] ppResource Same ID3D12Device::CreateCommittedResource -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D( - __in ID3D12Device* pDevice, - __in const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - __in const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - __in_opt const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riidResource, - __out void **ppvResource); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -//! SUPPORTED OS: Windows 10 and higher -//! - -//! \ingroup dx -//! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion -typedef enum _NV_RESOLVE_MODE { - NV_RESOLVE_MODE_SAMPLE_0, -} NV_RESOLVE_MODE; - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_ResolveSubresourceRegion -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion. -//! -//! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled. -//! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index. -//! \param [in] DstX The X coordinate of the left-most edge of the destination region. -//! The width of the destination region is the same as the width of the source rect. -//! -//! \param [in] DstY The Y coordinate of the top-most edge of the destination region. -//! The height of the destination region is the same as the height of the source rect. -//! -//! \param [in] pSrcResource Source resource. Must be multisampled. -//! \param [in] SrcSubresource The source subresource of the source resource. -//! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved. -//! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved. -//! -//! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource. -//! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode. -//! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_ResolveSubresourceRegion( - __in ID3D11Device *pDevice, - __in ID3D11Texture2D *pDstResource, - __in UINT DstSubresource, - __in UINT DstX, - __in UINT DstY, - __in ID3D11Texture2D *pSrcResource, - __in UINT SrcSubresource, - __in_opt const RECT *pSrcRect, - __in DXGI_FORMAT Format, - __in NV_RESOLVE_MODE ResolveMode); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_ResolveSubresourceRegion -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion. -//! -//! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled. -//! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index. -//! \param [in] DstX The X coordinate of the left-most edge of the destination region. -//! The width of the destination region is the same as the width of the source rect. -//! -//! \param [in] DstY The Y coordinate of the top-most edge of the destination region. -//! The height of the destination region is the same as the height of the source rect. -//! -//! \param [in] pSrcResource Source resource. Must be multisampled. -//! \param [in] SrcSubresource The source subresource of the source resource. -//! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved. -//! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved. -//! -//! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource. -//! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode. -//! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_ResolveSubresourceRegion( - __in ID3D12GraphicsCommandList1*pCommandList, - __in ID3D12Resource *pDstResource, - __in UINT DstSubresource, - __in UINT DstX, - __in UINT DstY, - __in ID3D12Resource *pSrcResource, - __in UINT SrcSubresource, - __in_opt RECT *pSrcRect, - __in DXGI_FORMAT Format, - __in NV_RESOLVE_MODE ResolveMode); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_TiledTexture2DArrayGetDesc -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_TiledTexture2DArrayGetDesc is an simple wrapper of ID3D11Texture2D::GetDesc -//! when pTiledTexture2DArray is created with NvAPI_D3D11_CreateTiledTexture2DArray. -//! Runtime doesn't know the created resource is actually a tiled resource. -//! So calling ID3D11Texture2D::GetDesc will get a desc without D3D11_RESOURCE_MISC_TILED in MiscFlags. -//! This wrapper API just adds D3D11_RESOURCE_MISC_TILED back. -//! -//! \param [in] pTiledTexture2DArray Pointer of tiled texture2D array to get resource desc from. -//! \param [out] pDesc Pointer to a resource description. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_TiledTexture2DArrayGetDesc(__in ID3D11Texture2D *pTiledTexture2DArray, - __out D3D11_TEXTURE2D_DESC *pDesc); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_UpdateTileMappings -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_UpdateTileMappings is an extension of ID3D11DeviceContext2::UpdateTileMappings. -//! It allows pTiledResource to be a resource created with NvAPI_D3D11_CreateTiledTexture2DArray, and should be used only in such case. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pTiledResource A pointer to the tiled texture 2D array resource created by NvAPI_D3D11_CreateTiledTexture2DArray. -//! \param [in] NumTiledResourceRegions The number of tiled resource regions. -//! \param [in] pTiledResourceRegionStartCoordinates An array of D3D11_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL. -//! \param [in] pTiledResourceRegionSizes An array of D3D11_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL. -//! \param [in] pTilePool A pointer to the tile pool. This resource should be created by standard API. -//! \param [in] NumRanges The number of tile-pool ranges. -//! \param [in] pRangeFlags An array of D3D11_TILE_RANGE_FLAG values that describe each tile-pool range. -//! \param [in] pTilePoolStartOffsets An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes). -//! \param [in] pRangeTileCounts An array of values that specify the number of tiles in each tile-pool range. -//! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_UpdateTileMappings( - __in ID3D11DeviceContext2 *pDeviceContext, - __in ID3D11Resource *pTiledResource, - __in UINT NumTiledResourceRegions, - __in const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates, - __in const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes, - __in ID3D11Buffer *pTilePool, - __in UINT NumRanges, - __in const UINT *pRangeFlags, - __in const UINT *pTilePoolStartOffsets, - __in const UINT *pRangeTileCounts, - __in UINT Flags); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CopyTileMappings -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_CopyTileMappings is an extension of ID3D11DeviceContext2::CopyTileMappings -//! It allows pDestTiledResource or pSourceTiledResource or both to be created with NvAPI_D3D11_CreateTiledTexture2DArray. -//! It should be used only in such case. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pDestTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings into. -//! \param [in] pDestRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination tiled resource. -//! \param [in] pSourceTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings from. -//! \param [in] pSourceRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source tiled resource. -//! \param [in] pTileRegionSize A pointer to a D3D11_TILE_REGION_SIZE structure that describes the size of the tiled region. -//! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CopyTileMappings( - __in ID3D11DeviceContext *pDeviceContext, - __in ID3D11Resource *pDestTiledResource, - __in const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate, - __in ID3D11Resource *pSourceTiledResource, - __in const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate, - __in const D3D11_TILE_REGION_SIZE *pTileRegionSize, - __in UINT Flags); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_TiledResourceBarrier -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_TiledResourceBarrier is an extension of ID3D11DeviceContext2::TiledResourceBarrier, but only works on ID3D11Resource(no support for ID3D11View). -//! If pTiledResourceAccessBeforeBarrier or pTiledResourceAccessAfterBarrier or both are created by NvAPI_D3D11_CreateTiledTexture2DArray, -//! NvAPI_D3D11_TiledResourceBarrier must be used instead of ID3D11DeviceContext2::TiledResourceBarrier. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pTiledResourceAccessBeforeBarrier Access operations on this resource must complete before the access operations on the object that pTiledResourceAccessAfterBarrier specifies. -//! \param [in] pTiledResourceAccessAfterBarrier Access operations on this resource must begin after the access operations on the object that pTiledResourceAccessBeforeBarrier specifies. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_TiledResourceBarrier( - __in ID3D11DeviceContext *pDeviceContext, - __in ID3D11Resource *pTiledResourceAccessBeforeBarrier, - __in ID3D11Resource *pTiledResourceAccessAfterBarrier); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA -// -//! \code -//! DESCRIPTION: This function allows creating (aliasing) a non-MSAA Texture2D object using the same memory as the given multi-sampled -//! texture (pInputTex). The surface created would be bloated in width and height but it will have SampleCount = 1 -//! For 2X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height -//! For 4X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height * 2 -//! For 8X MSAA: OutTex.Width = InputTex.Width * 4, outTex.Height = InputTex.Height * 2 -//! Only textures SampleQuality = 0 can be aliased as Non MSAA -//! The app should ensure that original texture is released only after the aliased copy is released. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \param [in] pDevice current d3d device -//! \param [in] pInputTex The MultiSampled Texture2D resource that is being aliased -//! \param [out] ppOutTex The aliased non AA copy MultiSampled Texture2D resource -//! -//! -//! \return :: NVAPI_OK if the call succeeds. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA(__in ID3D11Device *pDevice, - __in ID3D11Texture2D *pInputTex, - __out ID3D11Texture2D **ppOutTex); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) -typedef UINT NvAPI_D3D11_SWIZZLE_MODE; - -typedef enum _NV_SWIZZLE_MODE -{ - NV_SWIZZLE_POS_X = 0, - NV_SWIZZLE_NEG_X = 1, - NV_SWIZZLE_POS_Y = 2, - NV_SWIZZLE_NEG_Y = 3, - NV_SWIZZLE_POS_Z = 4, - NV_SWIZZLE_NEG_Z = 5, - NV_SWIZZLE_POS_W = 6, - NV_SWIZZLE_NEG_W = 7 -}NV_SWIZZLE_MODE; - -typedef enum _NV_SWIZZLE_OFFSET -{ - NV_SWIZZLE_OFFSET_X = 0, - NV_SWIZZLE_OFFSET_Y = 4, - NV_SWIZZLE_OFFSET_Z = 8, - NV_SWIZZLE_OFFSET_W = 12 -}NV_SWIZZLE_OFFSET; - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) -#define NV_CUSTOM_SEMANTIC_MAX_LIMIT 32 - -typedef enum NV_CUSTOM_SEMANTIC_TYPE -{ - NV_NONE_SEMANTIC = 0, - NV_X_RIGHT_SEMANTIC = 1, - NV_VIEWPORT_MASK_SEMANTIC = 2, - NV_XYZW_RIGHT_SEMANTIC = 3, - NV_VIEWPORT_MASK_2_SEMANTIC = 4, - - NV_POSITION_SEMANTIC = 5, - NV_CLIP_DISTANCE_0_SEMANTIC = 6, // MultiView can accept upto two vec4 values. So the application should not use - NV_CLIP_DISTANCE_1_SEMANTIC = 7, // more than 2 of the below Clip / Cull semantics in a single shader. - NV_CULL_DISTANCE_0_SEMANTIC = 8, - NV_CULL_DISTANCE_1_SEMANTIC = 9, - NV_GENERIC_ATTRIBUTE_SEMANTIC = 10, - - NV_PACKED_EYE_INDEX_SEMANTIC = 17, - NV_CUSTOM_SEMANTIC_MAX = NV_CUSTOM_SEMANTIC_MAX_LIMIT, -} NV_CUSTOM_SEMANTIC_TYPE; - -typedef struct _NV_CUSTOM_SEMANTIC -{ - UINT version; // NV_CUSTOM_SEMANTIC_VERSION - - NV_CUSTOM_SEMANTIC_TYPE NVCustomSemanticType; // type of custom semantic (NV_CUSTOM_SEMANTIC_TYPE) - NvAPI_LongString NVCustomSemanticNameString; // name of custom semantic e.g. "NV_X_RIGHT", "NV_VIEWPORT_MASK" - BOOL RegisterSpecified; // (optional) set to TRUE to explicitly provide register number and mask as below - NvU32 RegisterNum; // (optional) output register which has the custom semantic. - NvU32 RegisterMask; // (optional) output register component mask which has the custom semantic (X:1, Y:2, Z:4) - NvU32 Reserved; // reserved -} NV_CUSTOM_SEMANTIC; - -#define NV_CUSTOM_SEMANTIC_VERSION MAKE_NVAPI_VERSION(NV_CUSTOM_SEMANTIC, 1) - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -typedef struct NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 -{ - UINT version; - - BOOL UseViewportMask; - BOOL OffsetRtIndexByVpIndex; - BOOL ForceFastGS; - BOOL DontUseViewportOrder; - BOOL UseAttributeSkipMask; - BOOL UseCoordinateSwizzle; - NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL ConvertToFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5; - -typedef NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX; -#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5, 5) -#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VERSION NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateGeometryShaderEx -// -//! \fn NvAPI_D3D11_CreateGeometryShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of geometry shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateGeometryShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter is UseViewportMask which is to tell the driver to create a shader -//! that outputs a viewport mask instead when a viewport index is indicated. -//! Outputting a viewport mask allows a single primitive to land on many different viewports -//! as specified by the bits set in the mask, rather than to rely on a single number that tells it -//! which unique viewport it would be drawn on. -//! This can be used for example in conjunction with the setting of coordinates swizzling (see XXX_NVAPI function) -//! to generates multiple adjacent views of the same primitive in a more efficient fashion -//! (outputting the primitive only once). -//! -//! This function is free-threaded create compatible i.e. it can be called from a different -//! thread than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] UseViewportMask Set to FALSE for custom semantic shaders. Tell the driver to create a shader that outputs the viewport mask in lieu of the viewport index. See above description. -//! \param [in] OffsetRtIndexByVpIndex Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index -//! \param [in] ForceFastGS If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification -//! \param [in] DontUseViewportOrder Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow). -//! \param [in] UseAttributeSkipMask reserved -//! \param [in] UseCoordinateSwizzle reserved -//! \param [in] pCoordinateSwizzling reserved -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] ConvertToFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateGeometryShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX *pCreateGeometryShaderExArgs, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2; - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3; - -typedef NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 NvAPI_D3D11_CREATE_VERTEX_SHADER_EX; -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 3) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VERSION NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateVertexShaderEx -// -//! \fn NvAPI_D3D11_CreateVertexShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of vertex shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateVertexShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled vertex shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppVertexShader Address of a pointer to a ID3D11VertexShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateVertexShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_VERTEX_SHADER_EX *pCreateVertexShaderExArgs, - __out ID3D11VertexShader **ppVertexShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2; - -typedef NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 NvAPI_D3D11_CREATE_HULL_SHADER_EX; -#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 2) -#define NVAPI_D3D11_CREATEHULLSHADEREX_VERSION NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateHullShaderEx -// -//! \fn NvAPI_D3D11_CreateHullShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of hull shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateHullShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled hull shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppHullShader Address of a pointer to a ID3D11HullShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateHullShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_HULL_SHADER_EX *pCreateHullShaderExArgs, - __out ID3D11HullShader **ppHullShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2; - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3; - -typedef NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX; -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3, 3) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VERSION NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDomainShaderEx -// -//! \fn NvAPI_D3D11_CreateDomainShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of domain shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateDomainShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled domain shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppDomainShader Address of a pointer to a ID3D11DomainShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateDomainShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX *pCreateDomainShaderExArgs, - __out ID3D11DomainShader **ppDomainShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1; - -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1, 1) - -typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 -{ - UINT version; // Always use NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - NvU32 bEnableSuperSamplingPredicationForVRS : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for relevant attributes tagged with "sample" modifier - NvU32 bEnableSuperSamplingPredicationForVRSAllAttributes : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for all relevant attributes - NvU32 reserved : 30; // Reserved for further use -} NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2; - -typedef NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 NvAPI_D3D11_CREATE_PIXEL_SHADER_EX; -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreatePixelShaderEx_2 -// -//! \fn NvAPI_D3D11_CreatePixelShaderEx_2 -//! -//! DESCRIPTION: This function allows us to extend the creation of pixel shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreatePixelShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled domain shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [out] ppPixelShader Address of a pointer to a ID3D11PixelShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreatePixelShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_PIXEL_SHADER_EX *pCreatePixelShaderExArgs, - __out ID3D11PixelShader **ppPixelShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -typedef enum _NV_FASTGS_FLAGS -{ - NV_FASTGS_USE_VIEWPORT_MASK = 0x01, // Causes SV_ViewportArrayIndex value to be interpreted as a bitmask of viewports to broadcast to. - NV_FASTGS_OFFSET_RT_INDEX_BY_VP_INDEX = 0x02, // Causes SV_RenderTargetArrayIndex value to be offset by the viewport index when broadcasting. - NV_FASTGS_STRICT_API_ORDER = 0x04, // Causes broadcast primitives to be rendered strictly in API order (slow). - // By default, primitives may be batched per viewport to improve performance. -} NV_FASTGS_FLAGS; - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -struct NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 -{ - NvU32 version; // ALWAYS == NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER - NvU32 flags; // A combination of flags from NV_FASTGS_FLAGS - NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used. - // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their - // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport - // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after - // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK) - // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i. - // See NV_SWIZZLE_MODE for values of allowed swizzle modes. - // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component. - // For example : - // 1. To set swizzle for viewport 0 such that - w and z are unchanged and values of x and y are swapped : - // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) | - // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) | - // (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) | - // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X); - // 2. To set swizzle for viewport 0 such that - w, z and y are unchanged and value of x is negated : - // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) | - // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) | - // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) | - // (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X); - // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set. - // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device. -}; - -#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1, 1) -#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 - -typedef NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC; - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShaderExplicit -// -//! \fn NvAPI_D3D11_CreateFastGeometryShaderExplicit -//! -//! DESCRIPTION: This function will create a fast geometry shader written using an "explicit" -//! coding style, rather than converting a standard GS. For the explicit coding -//! style, the GS must be written with maxvertexcount(1), and must pass-through -//! input vertex 0 to the output without modification. -//! -//! Additional per-primitive outputs may also be computed and written to the single -//! output vertex. If these outputs are read by the pixel shader, they must be -//! declared with the "nointerpolation" attribute in the PS input signature; -//! otherwise, visual corruption may occur. Also, unlike D3D API, there is no guarantee -//! that pixel shader will get the default value of an attribute if that attribute is not written -//! by the earlier shader stage in the pipeline. -//! -//! The first four parameters are identical to ID3D11Device::CreateGeometryShader(), -//! so please refer to its documentation for their usage. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] pCreateFastGSArgs A pointer to a NvAPI_D3D11_CREATE_FASTGS_EXPLICIT struct. -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShaderExplicit(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC *pCreateFastGSArgs, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) -//////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShader -// -//! \fn NvAPI_D3D11_CreateFastGeometryShader -//! -//! DESCRIPTION: This function will convert a regular geometry shader into a fast GS variant if possible. -//! It will not do any validation regarding the compatibility of the resulting fast GS with any -//! Pixel shader. The validation has to be done by the application manually. -//! -//! The parameters are identical to ID3D11Device::CreateGeometryShader() -//! so please refer to its documentation for their usage. -//! -//! If the shader is too complex or is not in adequate form to be converted to fast GS -//! this function will simply fail. You should then call ID3D11Device::CreateGeometryShader() -//! to create the regular geometry shader. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShader(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_DecompressView -// -//! \code -//! DESCRIPTION: This function is used to decompress a surface using the currently bound programmable sample positions. -//! -//! This is needed: -//! - When writing to a surface in a region previously rendered by different sample positions and no clear was done. -//! - When reading a surface in a shader that was rendered using non-standard sample positions. -//! - When copying from a surface that was rendered using non-standard sample positions. -//! -//! \param [in] pDevice Current d3d11 device -//! \param [in] pDeviceContext Current d3d11 device context -//! \param [in] pView Current view to decompress -//! -//! -//! \return ::NVAPI_OK if the call succeeds. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_DecompressView(__in ID3D11Device* pDevice, __in ID3D11DeviceContext *pDeviceContext, __in ID3D11View* pView); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) - -//! Enum for CreatePSO extensions. -//! \ingroup dx -//! constant 5 is assigned to two members of this enum becuase the first member name contains a typo: EXTNENSION. Please use the correctly-spelled enumerator. -typedef enum _NV_PSO_EXTENSION -{ - NV_PSO_RASTER_EXTENSION = 0, - NV_PSO_REQUEST_FASTGS_EXTENSION = 1, - NV_PSO_GEOMETRY_SHADER_EXTENSION = 2, - NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION = 3, - NV_PSO_EXPLICIT_FASTGS_EXTENSION = 4, - NV_PSO_SET_SHADER_EXTNENSION_SLOT_AND_SPACE = 5, - NV_PSO_SET_SHADER_EXTENSION_SLOT_AND_SPACE = 5, - NV_PSO_VERTEX_SHADER_EXTENSION = 6, - NV_PSO_DOMAIN_SHADER_EXTENSION = 7, - NV_PSO_HULL_SHADER_EXTENSION = 9, -}NV_PSO_EXTENSION; - -struct NVAPI_D3D12_PSO_EXTENSION_DESC_V1 -{ - NvU32 baseVersion; //1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set - NvU8 SamplePositionsX[16]; //= 201103L - -#define compile_time_assert(b) static_assert((b), "Compile time assertion failed: "#b) - -enum NV_META_COMMAND_TENSOR_DATA_TYPE : NvU64 -{ - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32, - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16, - NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32, - - NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT, -}; - - -enum NV_META_COMMAND_TENSOR_LAYOUT : NvU64 -{ - NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout - NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost) - NV_META_COMMAND_TENSOR_LAYOUT_COUNT, -}; - -enum NV_META_COMMAND_TENSOR_FLAGS : NvU64 -{ - NV_META_COMMAND_TENSOR_FLAG_NONE = 0, - NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording) -}; - -enum NV_META_COMMAND_PRECISION : NvU64 -{ - NV_META_COMMAND_PRECISION_FLOAT32, - NV_META_COMMAND_PRECISION_FLOAT16, - NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32, - - NV_META_COMMAND_PRECISION_COUNT, -}; - -struct NV_META_COMMAND_TENSOR_DESC -{ - NV_META_COMMAND_TENSOR_DATA_TYPE DataType; - NV_META_COMMAND_TENSOR_LAYOUT Layout; - NV_META_COMMAND_TENSOR_FLAGS Flags; - NvU64 DimensionCount; // 4 or 5 - NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM]; - NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD -}; - -enum NV_META_COMMAND_ACTIVATION_FUNCTION : NvU64 -{ - NV_META_COMMAND_ACTIVATION_FUNCTION_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY, - NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR, - NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN, - NV_META_COMMAND_ACTIVATION_FUNCTION_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU, - - NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT, -}; - -struct NV_META_COMMAND_ACTIVATION_DESC -{ - NV_META_COMMAND_ACTIVATION_FUNCTION Function; - float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS]; -}; - -#else - -#define compile_time_assert(b) typedef char compile_time_assertion_failed_in_line_##__LINE__[(b)?1:-1] - -enum NV_META_COMMAND_TENSOR_DATA_TYPE -{ - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32, - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16, - NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32, - - NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT, -}; - - -enum NV_META_COMMAND_TENSOR_LAYOUT -{ - NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout - NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost) - NV_META_COMMAND_TENSOR_LAYOUT_COUNT, -}; - -enum NV_META_COMMAND_TENSOR_FLAGS -{ - NV_META_COMMAND_TENSOR_FLAG_NONE = 0, - NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording) -}; - -enum NV_META_COMMAND_PRECISION -{ - NV_META_COMMAND_PRECISION_FLOAT32, - NV_META_COMMAND_PRECISION_FLOAT16, - NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32, - - NV_META_COMMAND_PRECISION_COUNT, -}; - -struct NV_META_COMMAND_TENSOR_DESC -{ - NvU64 DataType; // NV_META_COMMAND_TENSOR_DATA_TYPE - NvU64 Layout; // NV_META_COMMAND_TENSOR_LAYOUT - NvU64 Flags; // NV_META_COMMAND_TENSOR_FLAGS - NvU64 DimensionCount; // 4 or 5 - NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM]; - NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD -}; - -enum NV_META_COMMAND_ACTIVATION_FUNCTION -{ - NV_META_COMMAND_ACTIVATION_FUNCTION_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY, - NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR, - NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN, - NV_META_COMMAND_ACTIVATION_FUNCTION_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU, - - NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT, -}; - -struct NV_META_COMMAND_ACTIVATION_DESC -{ - NvU64 Function; // NV_META_COMMAND_ACTIVATION_FUNCTION - float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS]; -}; - -#endif - -struct NV_META_COMMAND_OPTIONAL_TENSOR_DESC : NV_META_COMMAND_TENSOR_DESC -{ - // true when the tensor isn't needed (e.g, bias is optional) - NV_META_COMMAND_BOOL IsNull; -}; - - -struct NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC : NV_META_COMMAND_ACTIVATION_DESC -{ - // true when activation isn't needed - NV_META_COMMAND_BOOL IsNull; -}; - - -enum NV_META_COMMAND_PADDING_MODE -{ - NV_META_COMMAND_PADDING_ZEROS, - NV_META_COMMAND_PADDING_MIRROR, - NV_META_COMMAND_PADDING_CLAMP, - NV_META_COMMAND_PADDING_CONSTANT, - - NV_META_COMMAND_PADDING_COUNT, -}; - -struct NV_META_COMMAND_PADDING_DESC -{ - NV_META_COMMAND_PADDING_MODE Mode; - - // used with NV_META_COMMAND_PADDING_CONSTANT - float ConstantPadVal; -}; - -// use this enum to query resource sizes using GetRequiredParameterResourceSize() call -enum NV_META_COMMAND_RESOURCE_TYPE -{ - NV_META_COMMAND_RESOURCE_TYPE_INPUT = 0, - NV_META_COMMAND_RESOURCE_TYPE_OUTPUT = 1, - - NV_META_COMMAND_RESOURCE_TYPE_FILTER = 2, - NV_META_COMMAND_RESOURCE_TYPE_WEIGHT = 2, - NV_META_COMMAND_RESOURCE_TYPE_BIAS = 3, - - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_A = 0, - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_B = 2, - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_C = 3, - - NV_META_COMMAND_RESOURCE_TYPE_PERSISTENT = 4, - NV_META_COMMAND_RESOURCE_TYPE_TEMPORARY = 5, -}; - - -// Extended version of convolution operation that performs: -// -// y = act ( alpha1 * conv(x) + alpha2 * z + bias ) -// -// alpha1 and alpha2 are either scalars or if PerChannelScaling is TRUE, they are vectors of -// same dimension as the bias tensor (vector of size equal to number of output channels) -// -// z (SkipConnectionResource) has same dimension as output tensor y (OutputResource). - -static const GUID MetaCommand_ConvolutionEx = -{ 0xa7666f1e, 0x9c55, 0x47ee, { 0x9e, 0xb3, 0xe1, 0x62, 0x0, 0x92, 0xd1, 0xe9 } }; - -#define NV_META_COMMAND_NUM_SPATIAL_DIM 3 -// D, H, W when DimensionCount is 3 -// H, W when DimensionCount is 2 - - -#if __cplusplus >= 201103L -enum NV_META_COMMAND_CONVOLUTION_DIRECTION : NvU64 -{ - NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution - NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose - - NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_MODE : NvU64 -{ - NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION, - NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION, - - NV_META_COMMAND_CONVOLUTION_MODE_COUNT, -}; - -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - // Descriptor of the input tensor - NV_META_COMMAND_TENSOR_DESC DescIn; - - // Descriptor of the tensor acting as the filter kernel - NV_META_COMMAND_TENSOR_DESC DescFilter; - - // Descriptor of the optional bias tensor - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias; - - // Descriptor of the output tensor - NV_META_COMMAND_TENSOR_DESC DescOut; - - // Convolution mode (CROSS_CORRELATION or CONVOLUTION) - NV_META_COMMAND_CONVOLUTION_MODE Mode; - - // Convolution direction (FORWARD or BACKWARD) - NV_META_COMMAND_CONVOLUTION_DIRECTION Direction; - - // Precision at which convolution is done - NV_META_COMMAND_PRECISION Precision; - - // Optional activation function - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; - - // Padding mode (only used when output tensor dimensions are different from input tensor dimensions) - NV_META_COMMAND_PADDING_DESC Padding; - - // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource - // instead of Alpha1 and Alpha2 below - NV_META_COMMAND_BOOL PerChannelScaling; - - // scaling factors used when PerChannelScaling is FALSE - // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions - // that don't need scaling or skip connection - float Alpha1; - float Alpha2; - - // Strides for the filter kernel position - NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // The distance per dimension between elements that are multiplied - NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the start of each dimension - NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the end of each dimension - NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Number of dimensions to which convolution occurs (2 or 3) - NvU64 DimensionCount; - - // Number of channel groups convolved independently - NvU64 GroupCount; -}; - -#else - -enum NV_META_COMMAND_CONVOLUTION_DIRECTION -{ - NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution - NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose - - NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_MODE -{ - NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION, - NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION, - - NV_META_COMMAND_CONVOLUTION_MODE_COUNT, -}; - -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - // Descriptor of the input tensor - NV_META_COMMAND_TENSOR_DESC DescIn; - - // Descriptor of the tensor acting as the filter kernel - NV_META_COMMAND_TENSOR_DESC DescFilter; - - // Descriptor of the optional bias tensor - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias; - - // Descriptor of the output tensor - NV_META_COMMAND_TENSOR_DESC DescOut; - - // Convolution mode (CROSS_CORRELATION or CONVOLUTION) - NvU64 Mode; // NV_META_COMMAND_CONVOLUTION_MODE - - // Convolution direction (FORWARD or BACKWARD) - NvU64 Direction; // NV_META_COMMAND_CONVOLUTION_DIRECTION - - // Precision at which convolution is done - NvU64 Precision; // NV_META_COMMAND_PRECISION - - // Optional activation function - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; - - // Padding mode (only used when output tensor dimensions are different from input tensor dimensions) - NV_META_COMMAND_PADDING_DESC Padding; - - // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource - // instead of Alpha1 and Alpha2 below - NV_META_COMMAND_BOOL PerChannelScaling; - - // scaling factors used when PerChannelScaling is FALSE - // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions - // that don't need scaling or skip connection - float Alpha1; - float Alpha2; - - // Strides for the filter kernel position - NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // The distance per dimension between elements that are multiplied - NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the start of each dimension - NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the end of each dimension - NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Number of dimensions to which convolution occurs (2 or 3) - NvU64 DimensionCount; - - // Number of channel groups convolved independently - NvU64 GroupCount; -}; -#endif - - -// Fused Convolution variants - -// supported combinations right now are: -// - Convolution + Max Pooling (also optionally outputs pre-pool data) -// - 2x2 upsample + (optional) residual add + Convolution -// -// other combinations may be exposed in future - -static const GUID MetaCommand_ConvolutionExFused = -{ 0xe1b112eb, 0xdecd, 0x4ff6,{ 0x85, 0xbb, 0x1f, 0xe, 0x3a, 0xb0, 0x4, 0x14 } }; - - -enum NV_META_COMMAND_CONVOLUTION_POOL_MODE -{ - NV_META_COMMAND_CONVOLUTION_POOL_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MAX, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_AVG, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MIN, - - NV_META_COMMAND_CONVOLUTION_POOL_MODE_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE -{ - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_REPLICATE, - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_BILINEAR, - - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_SKIP_MODE -{ - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_ADD, - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_CONCAT, - - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_COUNT, -}; - -struct NV_META_COMMAND_CONVOLUTION_FUSE_DESC -{ - NV_META_COMMAND_CONVOLUTION_POOL_MODE PoolMode; - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE UpsampleMode; - NV_META_COMMAND_CONVOLUTION_SKIP_MODE SkipMode; - - NV_META_COMMAND_BOOL OutputPrepool; // used with NV_META_COMMAND_CONVOLUTION_POOL_MODE -}; - -// uses same structures for init and execute descriptors -// SkipConnectionResource is used to specify the resource for pre-pool data or residual add -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC : NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - NV_META_COMMAND_CONVOLUTION_FUSE_DESC FuseDesc; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_META_COMMAND_TENSOR_DESC) == 112); -compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC) == 640); -compile_time_assert(sizeof(NV_META_COMMAND_CONVOLUTION_FUSE_DESC) == 20); -compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC) == 660); - - -// GEMM (General matrix multiply) -// -// Y = alpha * t(A) * t(B) + beta * C, -// -// where t is a matrix transform option -// -// If C is null, and beta is non-zero, the output -// matrix is used as C matrix. i.e, the operation performed is: -// Y = alpha * t(A) * t(B) + beta * Y -// -static const GUID MetaCommand_Gemm = - { 0x8f9ff059, 0xfe72, 0x488e, { 0xa0, 0x66, 0xb1, 0x4e, 0x79, 0x48, 0xec, 0x8 } }; - -#if __cplusplus >= 201103L - -enum NV_META_COMMAND_MATRIX_TRANSFORM : NvU64 -{ - NV_META_COMMAND_MATRIX_TRANSFORM_NONE, - NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE, - - NV_META_COMMAND_MATRIX_TRANSFORM_COUNT, -}; - -struct NV_META_COMMAND_CREATE_GEMM_DESC -{ - NV_META_COMMAND_TENSOR_DESC DescA; - NV_META_COMMAND_TENSOR_DESC DescB; - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC; - NV_META_COMMAND_TENSOR_DESC DescOut; - NV_META_COMMAND_PRECISION Precision; - - NV_META_COMMAND_MATRIX_TRANSFORM TransA; - NV_META_COMMAND_MATRIX_TRANSFORM TransB; - float Alpha; - float Beta; - - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; -}; - -#else - -enum NV_META_COMMAND_MATRIX_TRANSFORM -{ - NV_META_COMMAND_MATRIX_TRANSFORM_NONE, - NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE, - - NV_META_COMMAND_MATRIX_TRANSFORM_COUNT, -}; - -struct NV_META_COMMAND_CREATE_GEMM_DESC -{ - NV_META_COMMAND_TENSOR_DESC DescA; - NV_META_COMMAND_TENSOR_DESC DescB; - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC; - NV_META_COMMAND_TENSOR_DESC DescOut; - NvU64 Precision; // NV_META_COMMAND_PRECISION - - NvU64 TransA; // NV_META_COMMAND_MATRIX_TRANSFORM - NvU64 TransB; // NV_META_COMMAND_MATRIX_TRANSFORM - float Alpha; - float Beta; - - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; -}; - -#endif - - -#pragma pack(pop) - -#endif // #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_EnumerateMetaCommands -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Enumerates MetaCommands supported on the system -//! -//! \param [in] pDevice A pointer to D3D11 device. -//! \param [in/out] pNumMetaCommands Should be non-null. When the value pointed by pNumMetaCommands is 0 (or when pDescs is NULL), the function returns number of metacommands supported. -//! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array. -//! \param [out] pDescs Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands. -//! Otherwise should have enough space to hold *pNumMetaCommands descriptors -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_EnumerateMetaCommands(__in ID3D11Device *pDevice, - __inout NvU32 *pNumMetaCommands, - __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions. -//! -//! \param [in] pDevice A pointer to D3D11 device. -//! \param [in] CommandId GUID of the operations to perform -//! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand -//! \param [in] CreationParametersDataSize size of parameter data structure -//! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object. -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! NVAPI_NOT_SUPPORTED - The requested Metacommand is not supported. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -#pragma pack(push, 4) -struct NV_D3D11_META_COMMAND_RESOURCE -{ - union - { - NVDX_ObjectHandle ResourceHandle; // NVAPI handle of a buffer resource (use NvAPI_D3D11_GetResourceHandle to get this handle) - NvU64 unused; // to get correct sturcutre size on 32 bit builds - }; - NvU64 Offset; // offset within the resource in bytes -}; - -struct NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC -{ - // Persistent resource used as scratch space by driver - // it's written at time of init, and read at time of execute - // use GetRequiredParameterResourceSize to query its size - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; -}; - -struct NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE InputResource; - NV_D3D11_META_COMMAND_RESOURCE FilterResource; - NV_D3D11_META_COMMAND_RESOURCE BiasResource; // optional - NV_D3D11_META_COMMAND_RESOURCE OutputResource; - - // Alpha1Resource and Alpha2Resource are used only when - // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used - // should have same dimension as bias - NV_D3D11_META_COMMAND_RESOURCE Alpha1Resource; - NV_D3D11_META_COMMAND_RESOURCE Alpha2Resource; - - // optional, same dimension/descriptor as output - NV_D3D11_META_COMMAND_RESOURCE SkipConnectionResource; - - - // should point to same memory that was specified at time of init - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; - - // temporary resource used as scratch space by driver - // used for both read and write at the time of execute - // use GetRequiredParameterResourceSize to query its size - NV_D3D11_META_COMMAND_RESOURCE TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 16); -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 144); - -struct NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; -}; - -struct NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE AResource; - NV_D3D11_META_COMMAND_RESOURCE BResource; - NV_D3D11_META_COMMAND_RESOURCE CResource; - NV_D3D11_META_COMMAND_RESOURCE OutputResource; - - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; - NV_D3D11_META_COMMAND_RESOURCE TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC) == 16); -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC) == 96); - - -#pragma pack(pop) - -DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D11NvMetaCommand_V1, IUnknown) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // ** ID3D11NvMetaCommand methods *** - // Return size of parameter - STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE; - - END_INTERFACE -}; - -typedef ID3D11NvMetaCommand_V1 ID3D11NvMetaCommand; -#define ID3D11NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D11NvMetaCommand_V1, 1) -#define ID3D11NvMetaCommand_VER ID3D11NvMetaCommand_VER1 - -NVAPI_INTERFACE NvAPI_D3D11_CreateMetaCommand(__in ID3D11Device *pDevice, - __in REFGUID CommandId, - __in_bcount(CreationParametersDataSize) const void *pCreationParametersData, - __in NvU32 CreationParametersDataSize, - __out ID3D11NvMetaCommand **ppMetaCommand); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_InitializeMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in -//! -//! \param [in] pDeviceContext A pointer to the d3d11 device context -//! \param [in] pMetaCommand the MetaCommand to initialize -//! \param [in] pInitializationParametersData Structure containing parameters -//! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_InitializeMetaCommand(__in ID3D11DeviceContext *pDeviceContext, - __in ID3D11NvMetaCommand *pMetaCommand, - __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData, - __in NvU32 InitializationParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_ExecuteMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Executes the given MetaCommand with the parameters passed in -//! -//! \param [in] pDeviceContext A pointer to the d3d11 device context -//! \param [in] pMetaCommand the MetaCommand to execute -//! \param [in] pExecutionParametersData Structure containing parameters -//! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_ExecuteMetaCommand(__in ID3D11DeviceContext *pDeviceContext, - __in ID3D11NvMetaCommand *pMetaCommand, - __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData, - __in NvU32 ExecutionParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EnumerateMetaCommands -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Enumerates MetaCommands supported on the system -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in/out] pNumMetaCommands Should be non-null. When the value pointed by pNumMetaCommands is 0 or when pDescs is NULL, the function returns number of metacommands supported. -//! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array. -//! \param [out] pDescs Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands. -//! Otherwise should have enough space to hold *pNumMetaCommands descriptors -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_EnumerateMetaCommands(__in ID3D12Device *pDevice, - __inout NvU32 *pNumMetaCommands, - __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions. -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in] CommandId GUID of the operations to perform -//! \param [in] NodeMask GPU mask for which metacommand is to be created. Set it to 0 for single GPU systems -//! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand -//! \param [in] CreationParametersDataSize size of parameter data structure -//! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object. -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! NVAPI_NOT_SUPPORTED - The requested Metacommand is not supported. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -#pragma pack(push, 4) -struct NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC -{ - // Persistent resource used as scratch space by driver - // it's written at time of init, and read at time of execute - // use GetRequiredParameterResourceSize to query its size - D3D12_GPU_VIRTUAL_ADDRESS PersistentResource; -}; - -struct NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS InputResource; - D3D12_GPU_VIRTUAL_ADDRESS FilterResource; - D3D12_GPU_VIRTUAL_ADDRESS BiasResource; // optional - D3D12_GPU_VIRTUAL_ADDRESS OutputResource; - - // Alpha1Resource and Alpha2Resource are used only when - // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used - // should have same dimension as bias - D3D12_GPU_VIRTUAL_ADDRESS Alpha1Resource; - D3D12_GPU_VIRTUAL_ADDRESS Alpha2Resource; - - // optional, same dimension/descriptor as output - D3D12_GPU_VIRTUAL_ADDRESS SkipConnectionResource; - - // should point to same memory that was specified at time of init - D3D12_GPU_VIRTUAL_ADDRESS PersistentResource; - - // temporary resource used as scratch space by driver - // both written and read at time of execute - // use GetRequiredParameterResourceSize to query its size - D3D12_GPU_VIRTUAL_ADDRESS TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 8); -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 72); - -struct NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC -{ - NvU64 PersistentResource; -}; - -struct NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC -{ - NvU64 AResource; - NvU64 BResource; - NvU64 CResource; - NvU64 OutputResource; - - NvU64 PersistentResource; - NvU64 TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC) == 8); -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC) == 48); - - -#pragma pack(pop) - -DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D12NvMetaCommand_V1, IUnknown) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // ** ID3D12NvMetaCommand methods *** - // Return size of parameter - STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE; - - END_INTERFACE -}; - -typedef ID3D12NvMetaCommand_V1 ID3D12NvMetaCommand; -#define ID3D12NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D12NvMetaCommand_V1, 1) -#define ID3D12NvMetaCommand_VER ID3D12NvMetaCommand_VER1 - -NVAPI_INTERFACE NvAPI_D3D12_CreateMetaCommand(__in ID3D12Device *pDevice, - __in REFGUID CommandId, - __in NvU32 NodeMask, - __in_bcount(CreationParametersDataSize) const void *pCreationParametersData, - __in NvU32 CreationParametersDataSize, - __out ID3D12NvMetaCommand **ppMetaCommand); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_InitializeMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in -//! -//! \param [in] pCommandList A pointer to D3D12 command list. -//! \param [in] pMetaCommand the MetaCommand to initialize -//! \param [in] pInitializationParametersData Structure containing parameters -//! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_InitializeMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist, - __in ID3D12NvMetaCommand *pMetaCommand, - __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData, - __in NvU32 InitializationParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_ExecuteMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Executes the given MetaCommand with the parameters passed in -//! -//! \param [in] pCommandList A pointer to D3D12 command list. -//! \param [in] pMetaCommand the MetaCommand to execute -//! \param [in] pExecutionParametersData Structure containing parameters -//! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_ExecuteMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist, - __in ID3D12NvMetaCommand *pMetaCommand, - __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData, - __in NvU32 ExecutionParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateCommittedResource -// -//! \since Release: 384 -// -//! \code -//! DESCRIPTION: Wrapper around ID3D12Device::CreateCommittedResource to allow creation of resources according to params provided. -//! HTEX resource is created when NV_D3D12_RESOURCE_FLAG_HTEX is set in the nvResourceFlags parameter. -//! NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM gives driver hint to create the resource on cpu visible vidmem -//! only upload resources use this flag currently, others behave exactly as ID3D12Device::CreateCommittedResource -//! Otherwise the function behaves exactly same as regular ID3D12Device::CreateCommittedResource. -//! When NV_D3D12_RESOURCE_FLAG_HTEX is set, the texels are centered on integer coordinates and filtering -//! and LOD are calculated based on the size minus one, which then allows the edges to filter to the exact texels on the edge, -//! eliminating the border/edge filtering issue. Dimension of next mip level is CEIL(currentMipDimension/2), and size of smallest mip is 2x2. -//! Note that NV_D3D12_RESOURCE_FLAG_HTEX can't be used for shared resources. -//! Best practice: Query available space in cpu visible vidmem using NvAPI_D3D12_QueryCpuVisibleVidmem -//! before using NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in] pHeapProperties A pointer to a D3D12_HEAP_PROPERTIES structure that provides properties for the resource's heap. -//! \param [in] HeapFlags Heap options, as a bitwise-OR'd combination of D3D12_HEAP_FLAGS enumeration constants. -//! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes the resource. -//! \param [in] InitialState The initial state of the resource, as a bitwise-OR'd combination of D3D12_RESOURCE_STATES enumeration constants. -//! \param [in] pOptimizedClearValue Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color. -//! \param [in] pNVResourceParams A pointer to a structure containing additional NV specific resource creation information (see NV_D3D12_RESOURCE_FLAGS below for more info on flags) -//! \param [in] riid The globally unique identifier (GUID) for the resource interface. -//! \param [out] ppvResource A pointer to memory that receives the requested interface pointer to the created resource object. -//! ppvResource can be NULL, to enable capability testing. When ppvResource is NULL, no object will be created and pSupported -//! will be set to true when pResourceDesc is valid. -//! \param [out] pSupported optional, needed only for capability testing when ppvResource is NULL -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -typedef enum { - NV_D3D12_RESOURCE_FLAG_NONE = 0, - NV_D3D12_RESOURCE_FLAG_HTEX = 1, //!< Create HTEX texture - NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM= 2, //!< Hint to create resource in cpuvisible vidmem -} NV_D3D12_RESOURCE_FLAGS; - -typedef struct _NV_RESOURCE_PARAMS_V1 -{ - NvU32 version; //!SetFence(dstGpu, hFence, Value); \ - pMultiGPUDevice->WaitForFence(1 << (srcGpu), hFence, Value); \ - Value++; - -#define FENCE_SYNCHRONIZATION_END(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \ - pMultiGPUDevice->SetFence(srcGpu, hFence, Value); \ - pMultiGPUDevice->WaitForFence(1 << (dstGpu), hFence, Value); \ - Value++; - -//! PresentCompositingConfig method flags. -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_USE_VIDEO_BRIDGE 0x01 -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_CLEAR_OUTBANDS 0x02 -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_GET_VIDEO_BRIDGE_STATUS 0x80000000 - -#define NVAPI_VIDEO_BRIDGE_STATUS_AVAILABLE 0 -#define NVAPI_VIDEO_BRIDGE_STATUS_NOT_AVAILABLE 1 -#define NVAPI_VIDEO_BRIDGE_STATUS_FAILED_ACCESS 2 -#define NVAPI_VIDEO_BRIDGE_STATUS_UNKNOWN 3 - -#define NVAPI_ALL_GPUS 0 -typedef ID3D11MultiGPUDevice_V1 ID3D11MultiGPUDevice; - -#define ID3D11MultiGPUDevice_VER1 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 1) -#define ID3D11MultiGPUDevice_VER2 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 2) -#define ID3D11MultiGPUDevice_VER3 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 3) -#define ID3D11MultiGPUDevice_VER ID3D11MultiGPUDevice_VER3 - -#define ALL_GPUS 0 - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D11_CreateMultiGPUDevice(__in ID3D11Device *pDevice, __in ULONG version, __out ULONG *currentVersion, __out ID3D11MultiGPUDevice **ppD3D11MultiGPUDevice, __in UINT maxGpus=ALL_GPUS); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of Single Pass Stereo HW feature -//! \ingroup dx -typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 -{ - NvU32 version; // parameter struct version - NvU32 bSinglePassStereoSupported; // Single Pass Stereo supported -} NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1; - -typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 bSinglePassStereoSupported : 1; // _OUT_ Single Pass Stereo supported - NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ Single Pass Stereo XYZW supported - NvU32 reserved : 30; // _INOUT_ bits reserved for future use -} NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2; - -typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS; -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2, 2) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 - -#ifndef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER -typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS; -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 -#endif - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QuerySinglePassStereoSupport -// -//! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pSinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QuerySinglePassStereoSupport(__in IUnknown *pDevice, - __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetSinglePassStereoMode -// -//! DESCRIPTION: Set the Single Pass Stereo state -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that Single Pass Stereo is supported or is set in hardware. -//! One must call NvAPI_D3D_QuerySinglePassStereoSupport() to confirm that the current setup -//! supports Single Pass Stereo before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] numViews Number of views to render. -//! \param [in] renderTargetIndexOffset Offset between render targets of the different views. -//! \param [in] independentViewportMaskEnable Is the independent viewport mask enabled. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetSinglePassStereoMode(__in IUnknown *pDevOrContext, __in NvU32 numViews, __in NvU32 renderTargetIndexOffset, __in NvU8 independentViewportMaskEnable); - -#endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QuerySinglePassStereoSupport -// -//! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pDevice The IDirect3DDevice12 to use. -//! \param [inout] pQuerySinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_QuerySinglePassStereoSupport(__in ID3D12Device *pDevice, - __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetSinglePassStereoMode -// -//! DESCRIPTION: Set the Single Pass Stereo state. -//! -//! \note Note that Single Pass Stereo state persists on a particular CommandList till it is closed. -//! The state is reset to default (disabled) for every newly created CommandList. -//! One must call NvAPI_D3D12_QuerySinglePassStereoSupport() to confirm that the current setup -//! supports Single Pass Stereo before calling this set-function. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Single Pass Stereo feature -//! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature. -//! \param [in] numViews Number of views to render. -//! \param [in] RenderTargetIndexOffset Offset between render targets of the different views. -//! \param [in] IndependentViewportMaskEnable Is the independent viewport mask enabled. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_SetSinglePassStereoMode(__in ID3D12GraphicsCommandList* pCommandList, - __in NvU32 numViews, - __in NvU32 renderTargetIndexOffset, - __in NvU8 independentViewportMaskEnable); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of MultiView HW feature -//! \ingroup dx - -typedef struct _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 bMultiViewSupported : 1; // _OUT_ MultiView supported (Render 4 views in a single pass) - NvU32 bSinglePassStereoSupported : 1; // _OUT_ StereoX supported (Render 2 views in a single pass) - NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ StereoXYZW supported (Render 2 views in a single pass) - NvU32 reserved : 29; // _INOUT_ bits reserved for future use -} NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 NV_QUERY_MULTIVIEW_SUPPORT_PARAMS; -#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 -#define NV_MULTIVIEW_MAX_SUPPORTED_VIEWS 4 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryMultiViewSupport -// -//! DESCRIPTION: Queries the support of MultiView feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pMultiViewSupportedParams Stores value of whether MultiView is supported on current setup or not. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryMultiViewSupport(__in IUnknown *pDevice, - __inout NV_QUERY_MULTIVIEW_SUPPORT_PARAMS *pQueryMultiViewSupportedParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used for setting the Mode for MultiView HW Feature. -//! \ingroup dx -typedef struct _NV_MULTIVIEW_PARAMS_V1 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 numViews; // _IN_ Number of views to render. - NvU32 renderTargetIndexOffset[NV_MULTIVIEW_MAX_SUPPORTED_VIEWS]; // _IN_ Offset between render targets for each of the per views. - NvU8 independentViewportMaskEnable; // _IN_ Is the independent viewport mask enabled. -} NV_MULTIVIEW_PARAMS_V1; - -typedef NV_MULTIVIEW_PARAMS_V1 NV_MULTIVIEW_PARAMS; -#define NV_MULTIVIEW_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MULTIVIEW_PARAMS_V1, 1) -#define NV_MULTIVIEW_PARAMS_VER NV_MULTIVIEW_PARAMS_VER1 - -#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetMultiViewMode -// -//! DESCRIPTION: Set the MultiView state -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that MultiView is supported or is set in hardware. -//! One must call NvAPI_D3D_QueryMultiViewSupport() to confirm that the current setup -//! supports MultiView before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] pMultiViewParams MultiView Params -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetMultiViewMode(__in IUnknown *pDevOrContext, __in NV_MULTIVIEW_PARAMS *pMultiViewParams); - -#endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of Lens Matched Shading HW feature -//! \ingroup dx -typedef struct _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS -{ - NvU32 version; // parameter struct version - NvU32 bModifiedWSupported; // Modified W supported -} NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1 NV_QUERY_MODIFIED_W_SUPPORT_PARAMS; -#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryModifiedWSupport -// -//! DESCRIPTION: Queries the support of Modified W feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified W is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryModifiedWSupport(__in IUnknown *pDev, - __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#define NV_MODIFIED_W_MAX_VIEWPORTS 16 - -typedef struct _NV_MODIFIED_W_COEFFICIENTS -{ - float fA; // A coefficient in w' = w + Ax + By - float fB; // B coefficient in w' = w + Ax + By - float fAReserved; // reserved - float fBReserved; // reserved - - float fReserved[2]; // reserved -} NV_MODIFIED_W_COEFFICIENTS; - -typedef struct _NV_MODIFIED_W_PARAMS -{ - NvU32 version; // parameter struct version - NvU32 numEntries; // number of valid NV_MODIFIED_W_COEFFICIENTS structs in array - NV_MODIFIED_W_COEFFICIENTS modifiedWCoefficients[NV_MODIFIED_W_MAX_VIEWPORTS]; // coefficients - - NvU32 id; // reserved - NvU32 reserved[NV_MODIFIED_W_MAX_VIEWPORTS]; // reserved -} NV_MODIFIED_W_PARAMS_V1; - -typedef NV_MODIFIED_W_PARAMS_V1 NV_MODIFIED_W_PARAMS; -#define NV_MODIFIED_W_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MODIFIED_W_PARAMS_V1, 1) -#define NV_MODIFIED_W_PARAMS_VER NV_MODIFIED_W_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetModifiedWMode -// -//! DESCRIPTION: Set the Modified W state and A,B coefficients for HW support -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that Modified-W is supported or is set in hardware. -//! One must call NvAPI_D3D_QueryModifiedWSupport() to confirm that the current setup -//! supports Modified-W before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] psModifiedWParams Modified W parameters. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetModifiedWMode(__in IUnknown *pDevOrContext, __in NV_MODIFIED_W_PARAMS *psModifiedWParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryModifiedWSupport -// -//! DESCRIPTION: Queries the support of Modified-W feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pDevice The ID3D12Device Device created by application -//! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified-W is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_QueryModifiedWSupport(__in ID3D12Device *pDevice, - __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetModifiedWMode -// -//! DESCRIPTION: Set the Modified-W state and A, B coefficients for HW support -//! -//! \note Note that Modified-W state persists on a particular CommandList till it is closed. -//! The state is reset to default (disabled) for every newly created CommandList. -//! One must call NvAPI_D3D12_QueryModifiedWSupport() to confirm that the current setup -//! supports Modified-W before calling this set-function. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Modified-W feature -//! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature. -//! \param [in] pModifiedWParams Modified-W parameters. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_SetModifiedWMode(__in ID3D12GraphicsCommandList* pCommandList, - __in NV_MODIFIED_W_PARAMS *pModifiedWParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -//! \ingroup dx -//! See NvAPI_D3D_CreateLateLatchObject -DECLARE_INTERFACE(ID3DLateLatchObject_V1) -{ - STDMETHOD_(UINT,Release) (THIS) PURE; //! Release the created LateLatch object and associated buffers. - STDMETHOD_(NvAPI_Status,Latch) (THIS_ __in IUnknown* pContext = NULL) PURE; //! Request to queue the latch operation to the GPU. - STDMETHOD_(ID3D11Buffer*,GetD3D11Buffer) (THIS_ __in UINT index = 0) PURE; //! Get ID3D11Buffer* available at the given 'index' - STDMETHOD_(UINT,GetBufferCount) (THIS) PURE; //! Returns the number of late latch buffers created for this LateLatchObject. - STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void **ppData) PURE; //! Fully update all LateLatch buffers with new data. - STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void *pData, __in size_t offset, - __in size_t size, __in UINT index = 0) PURE; //! Partially update one of the LateLatch buffers with new data. -}; - -//! \ingroup dx -//! See NvAPI_D3D_CreateLateLatchObject -typedef ID3DLateLatchObject_V1 ID3DLateLatchObject; -#define ID3DLateLatchObject_VER1 MAKE_NVAPI_VERSION(ID3DLateLatchObject_V1, 1) -#define ID3DLateLatchObject_VER ID3DLateLatchObject_VER1 - -typedef struct _NV_D3D_LATELATCH_OBJECT_DESC_V1 -{ - NvU32 version; - NvU32 numBuffers; // _IN_ Number of LateLatch buffers that the app wants to create. - D3D11_BUFFER_DESC **ppBufferDesc; // _IN_ Description of buffers - ID3DLateLatchObject **ppD3DLateLatchObject; // _Out_ Pointer to created interface -} NV_D3D_LATELATCH_OBJECT_DESC_V1; - -typedef NV_D3D_LATELATCH_OBJECT_DESC_V1 NV_D3D_LATELATCH_OBJECT_DESC; -#define NV_D3D_LATELATCH_OBJECT_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D_LATELATCH_OBJECT_DESC_V1, 1) -#define NV_D3D_LATELATCH_OBJECT_DESC_VER NV_D3D_LATELATCH_OBJECT_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_CreateLateLatchObject -// -//! DESCRIPTION: Creates a Late Latch Object interface -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 384 -//! -//! \param [in] pDevice Current ID3D11Device. -//! \param [inout] pLateLatchObjectDesc Pointer to in/out structure for late latch object creation -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_CreateLateLatchObject(__in IUnknown *pDevice, __inout NV_D3D_LATELATCH_OBJECT_DESC* pLateLatchObjectDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - - - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D_QueryLateLatchSupport -typedef struct _NV_QUERY_LATELATCH_SUPPORT_PARAMS -{ - NvU32 version; //!< (IN) Parameter structure version - NvU32 bLateLatchSupported; //!< (OUT) LateLatch supported -} NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1 NV_QUERY_LATELATCH_SUPPORT_PARAMS; -#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryLateLatchSupport -// -//! DESCRIPTION: Queries the support of DX11 Late Latch feature on current setup. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 384 -//! -//! \param [in] pDevice Current ID3D11Device. -//! \param [inout] pQueryLateLatchSupportParams Stores value of whether Late Latch is supported on current setup or not. -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryLateLatchSupport(__in IUnknown *pDevice, - __inout NV_QUERY_LATELATCH_SUPPORT_PARAMS *pQueryLateLatchSupportParams); -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - - - -#if defined (__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_RegisterDevice -// -//! DESCRIPTION: Tells NvAPI about a D3D device. This must be called prior to using any DX1x -//! deferred-context calls. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The ID3D10Device or ID3D11Device to use. -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_RegisterDevice(__in IUnknown *pDev); - -#endif //if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - - - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_MultiDrawInstancedIndirect -// -//! DESCRIPTION: Extension of DrawInstancedIndirect that takes a draw count in. The effect of this function is to loop over -//! that draw count and perform the DrawInstancedIndirect operation each time, incrementing the buffer offset -//! by the supplied stride each time. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC) -//! \param [in] drawCount Do DrawInstancedIndirect operation this many times -//! \param [in] *pBuffer ID3D11Buffer that contains the command parameters -//! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters -//! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 4 * sizeof(NvU32) -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet -//! been registered (NvAPI_D3D_RegisterDevice), this error is returned. -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_MultiDrawInstancedIndirect(__in ID3D11DeviceContext *pDevContext11, - __in NvU32 drawCount, - __in ID3D11Buffer *pBuffer, - __in NvU32 alignedByteOffsetForArgs, - __in NvU32 alignedByteStrideForArgs); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_MultiDrawIndexedInstancedIndirect -// -//! DESCRIPTION: Extension of DrawIndexedInstancedIndirect that takes a draw count in. The effect of this function is to loop over -//! that draw count and perform the DrawIndexedInstancedIndirect operation each time, incrementing the buffer offset -//! by the supplied stride each time. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC) -//! \param [in] drawCount Do DrawIndexedInstancedIndirect operation this many times -//! \param [in] *pBuffer ID3D11Buffer that contains the command parameters -//! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters -//! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 5 * sizeof(NvU32) -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet -//! been registered (NvAPI_D3D_RegisterDevice), this error is returned. -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_MultiDrawIndexedInstancedIndirect(__in ID3D11DeviceContext *pDevContext11, - __in NvU32 drawCount, - __in ID3D11Buffer *pBuffer, - __in NvU32 alignedByteOffsetForArgs, - __in NvU32 alignedByteStrideForArgs); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) ) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_ImplicitSLIControl -// -//! This function enables/disables the SLI rendering mode. It has to be called prior to D3D device creation. Once this function is called with DISABLE_IMPLICIT_SLI -//! parameter all subsequently created devices will be forced to run in a single gpu mode until the same function is called with ENABLE_IMPLICIT_SLI parameter. The enable -//! call will force all subsequently created devices to run in default implicit SLI mode being determined by an application profile or a global control panel SLI setting. -//! This NvAPI call is supported in all DX10+ versions of the driver. It is supported on all Windows versions. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Error occurred -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dx -typedef enum _IMPLICIT_SLI_CONTROL -{ - DISABLE_IMPLICIT_SLI = 0, - ENABLE_IMPLICIT_SLI = 1, -} IMPLICIT_SLI_CONTROL; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_ImplicitSLIControl(__in IMPLICIT_SLI_CONTROL implicitSLIControl); - -#endif //defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) ) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetNeedsAppFPBlendClamping -// -//! \code -//! DESCRIPTION: This function returns whether the application needs to do FP blend clamping itself -//! -//! \param [in] pDevice Current d3d device -//! \param [out] pAppClampNeeded If true, app needs to clamp. If false, HW does the clamping -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \since Release: 375 -//! -//! SUPPORTED OS: Windows 10 -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_GetNeedsAppFPBlendClamping(__in ID3D12Device *pDevice, - __out bool *pAppClampNeeded); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_UseDriverHeapPriorities -// -//! \code -//! DESCRIPTION: Sets the driver to override Microsoft's heap allocation priority values with Nvidia driver priority values. Use this once per process before allocating resources. -//! -//! \param [in] pDevice The IDirect3DDevice12 to use. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \since Release: 381 -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_UseDriverHeapPriorities(__in ID3D12Device *pDevice); - -#endif // defined (__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && ( defined(__d3d12_h__)) - - -typedef struct _NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS -{ - __in NvU32 version; //!< Structure version - __in ID3D12Device *pDevice; //!< The ID3D12Device created by application. - __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain that has companion allocations. - __in NvU32 companionBufferCount; //!< The number of ID3D12Resource pointers requested to be returned in the ppComanionResources array, which should match ID3D12Device::GetNodeCount for the complete set of companion allocations. - __inout ID3D12Resource **ppCompanionResources; //!< An array of ID3D12Resource pointers sized to match companionBufferCount, which will receive the companion allocations. -} NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1; - -typedef NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1 NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS; -#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1, 1) -#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_Mosaic_GetCompanionAllocations -// -//! DESCRIPTION: Queries the driver for internally created allocations that accompany a swap chain buffer for present-related operations. -//! Surfaces returned by this interface must be destroied at the same time that the original swap chain buffer is destroyed. -//! In general this occurs prior to a ResizeBuffers call, or when the swap chain is released. -//! Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display -//! rotation will result in failure. -//! -//! \param [inout] companionBufferCount The parameters for this function. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! \retval NVAPI_INVALID_CALL System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetCompanionAllocations(__inout NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS *params); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && ( defined(__d3d12_h__)) - -typedef struct _NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS -{ - __in NvU32 version; //!< Structure version - __in ID3D12Device *pDevice; //!< The ID3D12Device created by application. - __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain. - __inout NvU32 *pPartitionCount; //!< A variable to receive the number of NV_MGPU_MOSAIC_DISPLAY_SURFACE_PARTITION elements returned or that holds the size of pPartitions when it is non-NULL. - __inout RECT *pViewport; //!< An optional array to hold the viewport information per partition. When this is valid pNodeMask must also be valid. - __inout NvU32 *pNodeMask; //!< An optional array to hold the GPU mask where this viewport must be valid per partition. When this is valid pViewport must also be valid. -} NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1; - -typedef NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1 NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS; -#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1, 1) -#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions -// -//! DESCRIPTION: Queries the driver for how a swap chain display surface is subdivided across devices in relation to display connectivity. -//! Call this interface with NULL pPartitions in order to know how many subdivisions exist and allocate the proper size to hold all data. -//! Call it a second time with a properly sized partitions array to receive all subdivisions along with GPU node masks of each rectangle. -//! Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display -//! rotation will result in failure. -//! -//! \param [inout] params The parameters for this function. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! \retval NVAPI_INVALID_CALL System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions(__inout NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS *params); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -//! \ingroup dx -//! See NvAPI_D3D1x_GetGraphicsCapabilities - -typedef struct _NV_D3D1x_GRAPHICS_CAPS_V1 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 reservedBits : 30; // Reserved bits for future expansion - NvU32 reserved[7]; // Reserved for future expansion -} NV_D3D1x_GRAPHICS_CAPS_V1; - -#define NV_D3D1x_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V1, 1) - -typedef struct _NV_D3D1x_GRAPHICS_CAPS_V2 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 bFastUAVClearSupported : 1; //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader - NvU32 reservedBits : 29; // Reserved bits for future expansion - NvU16 majorSMVersion; //!< (OUT) Major SM version of the device - NvU16 minorSMVersion; //!< (OUT) Minor SM version of the device - NvU32 reserved[14]; // Reserved for future expansion -} NV_D3D1x_GRAPHICS_CAPS_V2; - -typedef NV_D3D1x_GRAPHICS_CAPS_V2 NV_D3D1x_GRAPHICS_CAPS; -#define NV_D3D1x_GRAPHICS_CAPS_VER2 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V2, 2) -#define NV_D3D1x_GRAPHICS_CAPS_VER NV_D3D1x_GRAPHICS_CAPS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_GetGraphicsCapabilities -// -//! DESCRIPTION: Get the graphics capabilities for current hardware/software setup -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D11Device device to be used for getting the graphics capabilities. -//! \param [in] structVersion Version of the caps struct. Should be set to NV_D3D1x_GRAPHICS_CAPS_VER. -//! \param [inout] pGraphicsCaps Pointer to a NV_D3D1x_GRAPHICS_CAPS_CAPS struct created by app. -//! Graphics capabilities will be filled in this struct by the driver. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D1x_GetGraphicsCapabilities(__in IUnknown *pDevice, - __in NvU32 structVersion, - __inout NV_D3D1x_GRAPHICS_CAPS *pGraphicsCaps); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D12_GetGraphicsCapabilities - -typedef struct _NV_D3D12_GRAPHICS_CAPS_V1 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 bFastUAVClearSupported : 1; //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader - NvU32 reservedBits : 29; // Reserved bits for future expansion - NvU16 majorSMVersion; //!< (OUT) Major SM version of the device - NvU16 minorSMVersion; //!< (OUT) Minor SM version of the device - NvU32 reserved[6]; // Reserved for future expansion -} NV_D3D12_GRAPHICS_CAPS_V1; - -typedef NV_D3D12_GRAPHICS_CAPS_V1 NV_D3D12_GRAPHICS_CAPS; -#define NV_D3D12_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_GRAPHICS_CAPS_V1, 1) -#define NV_D3D12_GRAPHICS_CAPS_VER NV_D3D12_GRAPHICS_CAPS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetGraphicsCapabilities -// -//! DESCRIPTION: Get the graphics capabilities for current hardware/software setup -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D12Device device to be used for getting the graphics capabilities. -//! \param [in] structVersion Version of the caps struct. Should be set to NV_D3D12_GRAPHICS_CAPS_VER. -//! \param [inout] pGraphicsCaps Pointer to a NV_D3D12_GRAPHICS_CAPS_CAPS struct created by app. -//! Graphics capabilities will be filled in this struct by the driver. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_GetGraphicsCapabilities(__in IUnknown *pDevice, - __in NvU32 structVersion, - __inout NV_D3D12_GRAPHICS_CAPS *pGraphicsCaps); - -#endif // defined(__cplusplus) && (defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -#define NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS 16 -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSSetExclusiveScissorRects - -typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 -{ - bool enableExclusiveScissorRect; //!< (IN) Control of enabling Exclusive ScissorRect per rect - D3D11_RECT scissorRect; //!< (IN) Single rect dimensions -} NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1; - -typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 -{ - NvU32 version; //!< (IN) Parameter struct version - NvU32 numRects; //!< (IN) Number of Exclusive Scissor Rects to be set. - // \note Passing zero will globally disable Exclusive Scissor Rects - // \note Max value can be equal to NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS - NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 *pRects; //!< (IN) Array of NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC with number of elements equal to Exclusive Scissor Rects -} NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1; - -typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC; -typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC; -#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1, 1) -#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetExclusiveScissorRects -// -//! DESCRIPTION: Sets Exclusive Scissor Rects. The content bounded within the Scissor Rects -//! will be excluded from rendering unlike regular Scissor Rects. These are -//! orthogonal with Regular Scissor Rects. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Exclusive Scissor Rects. -//! \param [in] pExclusiveScissorRectsDesc Description of the Exclusive Scissor Rects duly filled with their dimensions -//! and control over enablement of individual ScissorRect -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetExclusiveScissorRects(__in IUnknown *pContext, - __in NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC *pExclusiveScissorRectsDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSSetViewportsPixelShadingRates - -#define NV_MAX_PIXEL_SHADING_RATES 16 // Currently only 12 Shading Rates are available -#define NV_MAX_NUM_VIEWPORTS 16 - -// Every element in Shading Rate Resource represents the shading rate for all pixels in the corresponding tile -// The Shading Rate Resource dimensions must be the bound render target size divided by the tile dimensions (width/height) - -#define NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH 16 // Width of the tile, in pixels -#define NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT 16 // Height of the tile, in pixels - -typedef enum -{ - NV_PIXEL_X0_CULL_RASTER_PIXELS, // No shading, tiles are culled - NV_PIXEL_X16_PER_RASTER_PIXEL, // 16 shading passes per 1 raster pixel - NV_PIXEL_X8_PER_RASTER_PIXEL, // 8 shading passes per 1 raster pixel - NV_PIXEL_X4_PER_RASTER_PIXEL, // 4 shading passes per 1 raster pixel - NV_PIXEL_X2_PER_RASTER_PIXEL, // 2 shading passes per 1 raster pixel - NV_PIXEL_X1_PER_RASTER_PIXEL, // Per-pixel shading - NV_PIXEL_X1_PER_2X1_RASTER_PIXELS, // 1 shading pass per 2 raster pixels - NV_PIXEL_X1_PER_1X2_RASTER_PIXELS, // 1 shading pass per 2 raster pixels - NV_PIXEL_X1_PER_2X2_RASTER_PIXELS, // 1 shading pass per 4 raster pixels - NV_PIXEL_X1_PER_4X2_RASTER_PIXELS, // 1 shading pass per 8 raster pixels - NV_PIXEL_X1_PER_2X4_RASTER_PIXELS, // 1 shading pass per 8 raster pixels - NV_PIXEL_X1_PER_4X4_RASTER_PIXELS // 1 shading pass per 16 raster pixels -} NV_PIXEL_SHADING_RATE; -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 -{ - bool enableVariablePixelShadingRate; //!< (IN) Control of enabling Variable Pixel Shading Rate per viewport - NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (IN) Lookup table of converting Shading Rate Index to NV_PIXEL_SHADING_RATE - // \note Shading Rate Resource View would be populated by application with indices of this table -} NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1; - -typedef struct _NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 numViewports; //!< (IN) Number of viewports with shading rate set. - // \note Passing zero will globally disable Variable Pixel Rate Shading for all viewports immaterial of values in pViewports - // \note Max value can be equal to NV_MAX_NUM_VIEWPORTS - NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 *pViewports; //!< (IN) Array of NV_D3D11_VIEWPORT_SHADING_RATE_DESC with number of elements equal to NumViewports -} NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1; - -typedef NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORTS_SHADING_RATE_DESC; -typedef NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORT_SHADING_RATE_DESC; -#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1, 1) -#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetViewportsPixelShadingRates -// -//! DESCRIPTION: Sets Pixel Shading Rates and Enables/Disables per-viewport Variable Pixel Shading Rate feature -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Viewports Shading Rates -//! \param [in] pShadingRateDesc Shading rate descriptor -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetViewportsPixelShadingRates(__in IUnknown *pContext, - __in NV_D3D11_VIEWPORTS_SHADING_RATE_DESC *pShadingRateDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -typedef enum _NV_SRRV_DIMENSION -{ - NV_SRRV_DIMENSION_TEXTURE2D = 4, - NV_SRRV_DIMENSION_TEXTURE2DARRAY = 5, -} NV_SRRV_DIMENSION; - -typedef struct _NV_TEX2D_SRRV -{ - UINT MipSlice; -} NV_TEX2D_SRRV; - -typedef struct _NV_TEX2D_ARRAY_SRRV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} NV_TEX2D_ARRAY_SRRV; -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 -{ - NvU32 version; //!< (IN) Parameter struct version - DXGI_FORMAT Format; //!< (IN) Format of the resource used as Shading Rate Surface. Should be either DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS - NV_SRRV_DIMENSION ViewDimension; //!< (IN) This declares whether the Shading Rate Surface is a simple 2D Texture or Array of 2D Textures - union - { - NV_TEX2D_SRRV Texture2D; - NV_TEX2D_ARRAY_SRRV Texture2DArray; - }; -} NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1; - -typedef NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC; -#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1, 1) -#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 - -DECLARE_INTERFACE_(__declspec(uuid("E14BE7F6-8FF5-4F5E-B63A-AD016EB8FBE5"))ID3D11NvShadingRateResourceView_V1, ID3D11View) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // **** ID3D11View method **/ - // Get Shading Rate Resource used while creating the Shading Rate Resource View - STDMETHOD_(void,GetResource)(THIS_ _Outptr_ ID3D11Resource **ppResource) PURE; - - // ** ID3D11NvShadingRateResourceView methods *** - // The descriptor used while creating the Shading Rate Resource View - STDMETHOD(GetDesc)(THIS_ NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC* pDesc) PURE; - - END_INTERFACE -}; - -typedef ID3D11NvShadingRateResourceView_V1 ID3D11NvShadingRateResourceView; -#define ID3D11NvShadingRateResourceView_VER1 MAKE_NVAPI_VERSION(ID3D11NvShadingRateResourceView_V1, 1) -#define ID3D11NvShadingRateResourceView_VER ID3D11NvShadingRateResourceView_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateShadingRateResourceView -// -//! DESCRIPTION: Creates Shading Rate Resource View by taking ID3D11Resource as an input Shading Rate Surface. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The device to be used for creating the Shading Rate Resource View -//! \param [in] pShadingRateResource Shading Rate Resource on which the view is to be created. -//! \note This should be of format DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS -//! \note This should be confined to size calculated using render target dimensions, -//! NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH and NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT -//! \param [in] pShadingRateDesc Shading Rate Resource View descriptor -//! \param [out] ppShadingRateResourceView Address of a pointer to ID3D11NvShadingRateResourceView for returning the newly created Shading Rate Resource View -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateShadingRateResourceView(__in ID3D11Device *pDevice, - __in ID3D11Resource *pShadingRateResource, - __in NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC *pShadingRateResourceViewDesc, - __out ID3D11NvShadingRateResourceView **ppShadingRateResourceView); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetShadingRateResourceView -// -//! DESCRIPTION: Sets Shading Rate Resource View -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Resource View -//! \param [out] pShadingRateResourceView Shading Rate Resource View to be set -//! \note See NvAPI_D3D11_CreateShadingRateResourceView -//! \note Passing this as null will reset Shading Rate Resource View to defaults -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetShadingRateResourceView(__in IUnknown *pContext, - __in ID3D11NvShadingRateResourceView *pShadingRateResourceView); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSGetPixelShadingRateSampleOrder -//! See NvAPI_D3D11_RSSetPixelShadingRateSampleOrder - -// X, Y = sample position. S = sample number. -// The inner-most dimension is the sample number, followed by X and Y. - -typedef struct _NV_PIXEL_SRSO_1x2 -{ - struct NV_PIXEL_SRSO_1x2_X1 { NvU8 Y[2]; } X1; - struct NV_PIXEL_SRSO_1x2_X2 { NvU8 YS[2][2]; } X2; - struct NV_PIXEL_SRSO_1x2_X4 { NvU8 YS[2][4]; } X4; - struct NV_PIXEL_SRSO_1x2_X8 { NvU8 YS[2][8]; } X8; -} NV_PIXEL_SRSO_1x2; - -typedef struct _NV_PIXEL_SRSO_2x1 -{ - struct NV_PIXEL_SRSO_2x1_X1 { NvU8 X[2]; } X1; - struct NV_PIXEL_SRSO_2x1_X2 { NvU8 XS[2][2]; } X2; - struct NV_PIXEL_SRSO_2x1_X4 { NvU8 XS[2][4]; } X4; -} NV_PIXEL_SRSO_2x1; - -typedef struct _NV_PIXEL_SRSO_2x2 -{ - struct NV_PIXEL_SRSO_2x2_X1 { NvU8 YX[2][2]; } X1; - struct NV_PIXEL_SRSO_2x2_X2 { NvU8 YXS[2][2][2]; } X2; - struct NV_PIXEL_SRSO_2x2_X4 { NvU8 YXS[2][2][4]; } X4; -} NV_PIXEL_SRSO_2x2; - -typedef struct _NV_PIXEL_SRSO_2x4 -{ - struct NV_PIXEL_SRSO_2x4_X1 { NvU8 YX[4][2]; } X1; - struct NV_PIXEL_SRSO_2x4_X2 { NvU8 YXS[4][2][2]; } X2; -} NV_PIXEL_SRSO_2x4; - -typedef struct _NV_PIXEL_SRSO_4x2 -{ - struct NV_PIXEL_SRSO_4x2_X1 { NvU8 YX[2][4]; } X1; -} NV_PIXEL_SRSO_4x2; - -typedef struct _NV_PIXEL_SRSO_4x4 -{ - struct NV_PIXEL_SRSO_4x4_X1 { NvU8 YX[4][4]; } X1; -} NV_PIXEL_SRSO_4x4; - -typedef struct _NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 -{ - NvU32 version; - NV_PIXEL_SRSO_1x2 Pixel_1x2; - NV_PIXEL_SRSO_2x1 Pixel_2x1; - NV_PIXEL_SRSO_2x2 Pixel_2x2; - NV_PIXEL_SRSO_2x4 Pixel_2x4; - NV_PIXEL_SRSO_4x2 Pixel_4x2; - NV_PIXEL_SRSO_4x4 Pixel_4x4; -} NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1; - -typedef NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE; -#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 MAKE_NVAPI_VERSION(NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1, 1) -#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 - -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSGetPixelShadingRateSampleOrder -// -//! DESCRIPTION: Get the Sample Order for Variable Shading Rate -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for getting the Shading Rate Sample Order -//! \param [out] pSampleOrderTable A pointer to NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE where the current Sample Order for Variable Pixel Rate Shading that is returned -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSGetPixelShadingRateSampleOrder(__in IUnknown *pContext, - __out NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetPixelShadingRateSampleOrder -// -//! DESCRIPTION: Set the Sample Order for Variable Shading Rate -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Sample Order -//! \param [out] pSampleOrderTable Sample Order for Variable Shading Rate to be set -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetPixelShadingRateSampleOrder(__in IUnknown *pContext, - __in NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use -} NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1; - -typedef NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 NV_VRS_HELPER_LATCH_GAZE_PARAMS; -#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1, 1) -#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 - -typedef enum _NV_VRS_CONTENT_TYPE -{ - NV_VRS_CONTENT_TYPE_INVALID = 0x0, - NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING = 0x1, - NV_VRS_CONTENT_TYPE_MAX = NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING -} NV_VRS_CONTENT_TYPE; - -typedef enum _NV_FOVEATED_RENDERING_SHADING_RATE_PRESET -{ - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_INVALID = 0, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_PERFORMANCE = 1, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_PERFORMANCE = 2, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_BALANCED = 3, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_QUALITY = 4, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_QUALITY = 5, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM = 6, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_MAX = NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM -} NV_FOVEATED_RENDERING_SHADING_RATE_PRESET; - -typedef struct _NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 -{ - NvU32 version; - - NV_PIXEL_SHADING_RATE InnerMostRegionShadingRate; //!< (IN) Shading Rate for the inner-most region of the foveated rendering pattern - NV_PIXEL_SHADING_RATE MiddleRegionShadingRate; //!< (IN) Shading Rate for the middle region of the foveated rendering pattern - NV_PIXEL_SHADING_RATE PeripheralRegionShadingRate; //!< (IN) Shading Rate for the peripheral region of the foveated rendering pattern -} NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1; - -typedef NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC; -#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 - -typedef enum _NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET -{ - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_INVALID = 0, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_WIDE = 1, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_BALANCED = 2, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_NARROW = 3, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM = 4, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_MAX = NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM -} NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET; - -typedef struct _NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 -{ - NvU32 version; - - float fInnermostRadii[2]; //!< (IN) Horizontal and vertical radius for the inner-most region of the foveated rendering pattern - float fMiddleRadii[2]; //!< (IN) Horizontal and vertical radius for the middle region of the foveated rendering pattern - float fPeripheralRadii[2]; //!< (IN) Horizontal and vertical radius for the peripheral region of the foveated rendering pattern -} NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1; - -typedef NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC; -#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 - -typedef struct _NV_FOVEATED_RENDERING_DESC_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET ShadingRatePreset; //!< (IN) Preset of the shading rate - NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 ShadingRateCustomPresetDesc; //!< (IN) To be provided only if ShadingRatePreset is NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM - - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET FoveationPatternPreset; //!< (IN) Preset of the foveation pattern - NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 FoveationPatternCustomPresetDesc; //!< (IN) To be provided only if FoveationPatternPreset is NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - -} NV_FOVEATED_RENDERING_DESC_V1; - -typedef NV_FOVEATED_RENDERING_DESC_V1 NV_FOVEATED_RENDERING_DESC; -#define NV_FOVEATED_RENDERING_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_DESC_VER NV_FOVEATED_RENDERING_DESC_VER1 - -typedef enum _NV_VRS_RENDER_MODE -{ - NV_VRS_RENDER_MODE_INVALID = 0, - NV_VRS_RENDER_MODE_MONO = 1, // States mono rendering on the entire render target - NV_VRS_RENDER_MODE_LEFT_EYE = 2, // States Left eye rendering of a stereo pair on the entire render target - NV_VRS_RENDER_MODE_RIGHT_EYE = 3, // States Right eye rendering of a stereo pair on the entire render target - NV_VRS_RENDER_MODE_STEREO = 4, // States side-by-side stereo rendering on the render target - NV_VRS_RENDER_MODE_MAX = NV_VRS_RENDER_MODE_STEREO -} NV_VRS_RENDER_MODE; - -#define MAX_NUMBER_OF_GAZE_DATA_PROVIDERS 8 // Maximum number of gaze data providers / devices. - -typedef struct _NV_VRS_HELPER_ENABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NV_VRS_RENDER_MODE RenderMode; //!< (IN) This defines whether subsequent render calls are for mono/stereo - NV_VRS_CONTENT_TYPE ContentType; //!< (IN) This defines the type of content with which the VRS pattern will be generated - - NV_FOVEATED_RENDERING_DESC_V1 sFoveatedRenderingDesc; //!< (IN) Provide this if ContentType has NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING flag -} NV_VRS_HELPER_ENABLE_PARAMS_V1; - -typedef NV_VRS_HELPER_ENABLE_PARAMS_V1 NV_VRS_HELPER_ENABLE_PARAMS; -#define NV_VRS_HELPER_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_ENABLE_PARAMS_V1, 1) -#define NV_VRS_HELPER_ENABLE_PARAMS_VER NV_VRS_HELPER_ENABLE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_DISABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 reserved; //!< (IN) Reserved for future use -} NV_VRS_HELPER_DISABLE_PARAMS_V1; - -typedef NV_VRS_HELPER_DISABLE_PARAMS_V1 NV_VRS_HELPER_DISABLE_PARAMS; -#define NV_VRS_HELPER_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_DISABLE_PARAMS_V1, 1) -#define NV_VRS_HELPER_DISABLE_PARAMS_VER NV_VRS_HELPER_DISABLE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - IUnknown **ppShadingRateResource; //!< (OUT) Pointer to 2D Texture resource with currently applied shading rate pattern - NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (OUT) Shading Rate Table filled by the driver -} NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1; - -typedef NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS; -#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1, 1) -#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 reserved; //!< (IN) Reserved for future use -} NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1; - -typedef NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS; -#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1, 1) -#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 - -DECLARE_INTERFACE(ID3DNvVRSHelper_V1) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Latches the latest gaze which will be used for subsequent foveated rendering. Recommended to be called once per frame before scene drawing begins. - STDMETHOD_(NvAPI_Status,LatchGaze)(THIS_ IUnknown* pContext, NV_VRS_HELPER_LATCH_GAZE_PARAMS* pLatchGazeParams) PURE; - - // Enables VRS with sepcified content type and preset. This can be called per draw call. - STDMETHOD_(NvAPI_Status,Enable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_ENABLE_PARAMS* pEnableParams) PURE; - - // Disables VRS till re-enabled. - STDMETHOD_(NvAPI_Status,Disable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_DISABLE_PARAMS* pDisableParams) PURE; - - // Creates a 2D texture, copies the current shading rate pattern on it and returns the pointer to this texture. - // It also returns an array that conveys which value in the shading rate resource corresponds to which exact pixel shading rate. - STDMETHOD_(NvAPI_Status,GetShadingRateResource)(THIS_ IUnknown* pContext, NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS *pGetShadingRateResourceParams) PURE; - - // Destroys all internally created shading rate resources and views. - STDMETHOD_(NvAPI_Status,PurgeInternalShadingRateResources)(THIS_ IUnknown* pContext, NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS* pPurgeParams) PURE; - - END_INTERFACE -}; - -typedef ID3DNvVRSHelper_V1 ID3DNvVRSHelper; -#define ID3DNvVRSHelper_VER1 MAKE_NVAPI_VERSION(ID3DNvVRSHelper_V1, 1) -#define ID3DNvVRSHelper_VER ID3DNvVRSHelper_VER1 - -typedef struct _NV_VRS_HELPER_INIT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - ID3DNvVRSHelper_V1 **ppVRSHelper; //!< (OUT) Interface for Shading Rate Pattern Tracker -} NV_VRS_HELPER_INIT_PARAMS_V1; - -typedef NV_VRS_HELPER_INIT_PARAMS_V1 NV_VRS_HELPER_INIT_PARAMS; -#define NV_VRS_HELPER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_INIT_PARAMS_V1, 1) -#define NV_VRS_HELPER_INIT_PARAMS_VER NV_VRS_HELPER_INIT_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeVRSHelper -// -//! DESCRIPTION: Creates an interface for updating, enabling and disabling internally tracked shading rate pattern for Variable Rate Shading -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 430 -//! -//! \param [in] pDevice The device to be used for creating the VRS Handler interface -//! \note This should be same the device used for Gaze Handler. See also: NvAPI_D3D_InitializeNvGazeHandler. -//! \param [in] pInitializeVRSHelperParams Descriptor for VRS Helper initialization -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_InitializeVRSHelper(__in IUnknown *pDevice, - __inout NV_VRS_HELPER_INIT_PARAMS *pInitializeVRSHelperParams); - -typedef enum _NV_GAZE_DATA_VALIDITY_FLAGS -{ - NV_GAZE_ORIGIN_VALID = 0x1, - NV_GAZE_DIRECTION_VALID = 0x2, - NV_GAZE_LOCATION_VALID = 0x4, - NV_GAZE_VELOCITY_VALID = 0x8, - NV_GAZE_PUPIL_DIAMETER_VALID = 0x10, - NV_GAZE_EYE_OPENNESS_VALID = 0x20, - NV_GAZE_EYE_SACCADE_DATA_VALID = 0x40 -} NV_GAZE_DATA_VALIDITY_FLAGS; - -typedef struct _NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE -{ - NvU32 version; //!< (IN) Version of the structure - - NvU32 GazeDataValidityFlags; //!< (IN) To be populated with OR'ing flags from NV_GAZE_DATA_VALIDITY_FLAGS - - float fGazeOrigin_mm[3]; //!< (IN) Use flag NV_GAZE_ORIGIN_VALID. Origin of the eye in millimeters. Used mainly to detect whether Left Eye or Right Eye. - float fGazeDirection[3]; //!< (IN) Use flag NV_GAZE_DIRECTION_VALID. Normalized direction of the gaze of the eye. Used for calculating the gaze location using the FOV. - float fGazeNormalizedLocation[2]; //!< (IN) Use flag NV_GAZE_LOCATION_VALID. Precalculated normalized gaze location in limits (-1 to +1) for X and Y. Center of the screen denotes (0, 0). If this is valid, this will be given higher priority than direction. - float fGazeVelocity[2]; //!< (IN) Use flag NV_GAZE_VELOCITY_VALID. Optional: Velocity of the eye on the normalized space in each direction. Central foveated region would be skewed in the direction of the velocity. - float fPupilDiameter_mm; //!< (IN) Use flag NV_GAZE_PUPIL_DIAMETER_VALID. Unused at the moment. - float fEyeOpenness; //!< (IN) Use flag NV_GAZE_EYE_OPENNESS_VALID. Unused at the moment. - BOOL bInSaccade; //!< (IN) Use flag NV_GAZE_EYE_SACCADE_DATA_VALID. Denotes whether eye is currently in saccade movement or not. -} NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1; - -typedef NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE; -#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1, 1) -#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 - -typedef struct _NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NvU64 Timestamp; //!< (IN) Timestamp at which the gaze data has been captured. Should be larger than timestamp provided at previous update. - union - { - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sMonoData; //!< (IN) Gaze data for Mono rendering mode - struct - { - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sLeftEye; //!< (IN) Gaze data for Left Eye of Stereo rendering mode - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sRightEye; //!< (IN) Gaze data for Right Eye of Stereo rendering mode - } sStereoData; - }; -} NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1; - -typedef NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1 NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS; -#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1, 1) -#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 - - -DECLARE_INTERFACE(ID3DNvGazeHandler_V2) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Updates the gaze data for foveated rendering - STDMETHOD_(NvAPI_Status,UpdateGazeData)(THIS_ IUnknown* pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS* pUpdateGazeDataParams) PURE; - - - END_INTERFACE -}; -typedef ID3DNvGazeHandler_V2 ID3DNvGazeHandler; -#define ID3DNvGazeHandler_VER2 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V2, 2) -#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER2 - -DECLARE_INTERFACE(ID3DNvGazeHandler_V1) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Updates the gaze data for foveated rendering - STDMETHOD_(NvAPI_Status,UpdateGazeData)(THIS_ IUnknown* pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS* pUpdateGazeDataParams) PURE; - - END_INTERFACE -}; -#define ID3DNvGazeHandler_VER1 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V1, 1) -#ifndef ID3DNvGazeHandler_VER -typedef ID3DNvGazeHandler_V1 ID3DNvGazeHandler; -#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER1 -#endif - -typedef enum _NV_GAZE_DATA_TYPE -{ - NV_GAZE_DATA_INVALID = 0, - NV_GAZE_DATA_MONO = 1, - NV_GAZE_DATA_STEREO = 2, - NV_GAZE_DATA_MAX = NV_GAZE_DATA_STEREO -} NV_GAZE_DATA_TYPE; - -typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V2 -{ - NvU32 version; //!< (IN) Struct version - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - - NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo - NvU32 flags; //!< (IN) Reserved for future use - float fHorizontalFOV; //!< (IN) Horizontal Field of View - float fVericalFOV; //!< (IN) Vertical Field of View - - ID3DNvGazeHandler_V2 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler -} NV_GAZE_HANDLER_INIT_PARAMS_V2; - -typedef NV_GAZE_HANDLER_INIT_PARAMS_V2 NV_GAZE_HANDLER_INIT_PARAMS; -#define NV_GAZE_HANDLER_INIT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V2, 2) -#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER2 - -typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - - NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo - NvU32 flags; //!< (IN) Reserved for future use - float fHorizontalFOV; //!< (IN) Horizontal Field of View - float fVericalFOV; //!< (IN) Vertical Field of View - - ID3DNvGazeHandler_V1 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler -} NV_GAZE_HANDLER_INIT_PARAMS_V1; - -#define NV_GAZE_HANDLER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V1, 1) -#ifndef NV_GAZE_HANDLER_INIT_PARAMS_VER -typedef NV_GAZE_HANDLER_INIT_PARAMS_V1 NV_GAZE_HANDLER_INIT_PARAMS; -#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER1 -#endif - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeNvGazeHandler -// -//! DESCRIPTION: Creates an interface for updating and managing gaze data -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 430 -//! -//! \param [in] pDevice The device to be used for creating the Gaze Handler interface -//! \note This should be same as the device used with VRS Handler. See also: NvAPI_D3D_InitializeVRSHelper. -//! \param [in] pInitializeNvGazeHandlerParams Descriptor for Gaze Data Handler initialization -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_InitializeNvGazeHandler(__in IUnknown *pDevice, - __inout NV_GAZE_HANDLER_INIT_PARAMS *pInitializeNvGazeHandlerParams); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && defined(__d3d11_h__) - -//! \ingroup dx - -typedef enum NV_SMP_ASSIST_TYPE -{ - NV_SMP_ASSIST_NONE = 0, - NV_SMP_ASSIST_MRS = 1, // SMP Assist required for Multi-Res Shading - NV_SMP_ASSIST_LMS = 2, // SMP Assist required for Lens Matched Shading - NV_SMP_ASSIST_NUM_TYPES -} NV_SMP_ASSIST_TYPE; - -typedef enum NV_SMP_ASSIST_LEVEL -{ - NV_SMP_ASSIST_LEVEL_FULL = 0, // Full assistance. App selects a pre-baked MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS - NV_SMP_ASSIST_LEVEL_PARTIAL = 1, // Partial assistance. App provides a custom MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS - NV_SMP_ASSIST_LEVEL_MINIMAL = 2, // Minimal assistance. App provides viewports and scissors. App sets FastGS as required. App sets LMS params as required (NvAPI_D3D_SetModifiedWMode). App provides SMPType as NONE. Driver handles correct setting of viewports and scissors. - NV_SMP_ASSIST_NUM_LEVELS -} NV_SMP_ASSIST_LEVEL; - -typedef enum NV_MRS_CONFIG -{ - NV_MRS_CONFIG_BALANCED = 0, - NV_MRS_CONFIG_AGGRESSIVE = 1, - NV_MRS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 2, - NV_MRS_CONFIG_OCULUSRIFT_CV1_BALANCED = 3, - NV_MRS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 4, - NV_MRS_CONFIG_HTC_VIVE_CONSERVATIVE = 5, - NV_MRS_CONFIG_HTC_VIVE_BALANCED = 6, - NV_MRS_CONFIG_HTC_VIVE_AGGRESSIVE = 7, - NV_MRS_NUM_CONFIGS -} NV_MRS_CONFIG; - -typedef enum NV_LMS_CONFIG -{ - NV_LMS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 0, - NV_LMS_CONFIG_OCULUSRIFT_CV1_BALANCED = 1, - NV_LMS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 2, - NV_LMS_CONFIG_HTC_VIVE_CONSERVATIVE = 3, - NV_LMS_CONFIG_HTC_VIVE_BALANCED = 4, - NV_LMS_CONFIG_HTC_VIVE_AGGRESSIVE = 5, - NV_LMS_NUM_CONFIGS -} NV_LMS_CONFIG; - -#define NV_SMP_ASSIST_FLAGS_DEFAULT 0x00000000 - -#define NV_SMP_ASSIST_MAX_VIEWPORTS 16 - -typedef struct _NV_MRS_CUSTOM_CONFIG_V1 -{ - float centerWidth; //!< (IN) Size of the central viewport, ranging (0,1], where 1 is full original viewport size - float centerHeight; - float centerX; //!< (IN) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen - float centerY; - float densityScaleX[3]; //!< (IN) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density) - float densityScaleY[3]; -} NV_MRS_CUSTOM_CONFIG_V1; - -typedef NV_MRS_CUSTOM_CONFIG_V1 NV_MRS_CUSTOM_CONFIG; - -typedef struct _NV_MRS_INSTANCED_STEREO_CONFIG_V1 -{ //!< (OUT) MRS Instanced stereo config returned by the SMP Assist GetConstants API - float centerWidth[2]; //!< (OUT) Size of the central viewport, ranging (0,1], where 1 is full original viewport size - float centerHeight; - float centerX[2]; //!< (OUT) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen - float centerY; - float densityScaleX[5]; //!< (OUT) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density) - float densityScaleY[3]; -} NV_MRS_INSTANCED_STEREO_CONFIG_V1; - -typedef NV_MRS_INSTANCED_STEREO_CONFIG_V1 NV_MRS_INSTANCED_STEREO_CONFIG; - -typedef struct _NV_LMS_CUSTOM_CONFIG_V1 -{ - float warpLeft; //!< (IN) LMS params to control warping of the 2 left quadrants - float warpRight; //!< (IN) LMS params to control warping of the 2 right quadrants - float warpUp; //!< (IN) LMS params to control warping of the 2 upper quadrants - float warpDown; //!< (IN) LMS params to control warping of the 2 lower quadrants - - float relativeSizeLeft; //!< (IN) LMS params to control the width of the 2 left quandrants relative to the bounding box width - float relativeSizeRight; //!< (IN) LMS params to control the width of the 2 right quandrants relative to the bounding box width - float relativeSizeUp; //!< (IN) LMS params to control the height of the 2 upper quandrants relative to the bounding box height - float relativeSizeDown; //!< (IN) LMS params to control the height of the 2 lower quandrants relative to the bounding box height -} NV_LMS_CUSTOM_CONFIG_V1; - -typedef NV_LMS_CUSTOM_CONFIG_V1 NV_LMS_CUSTOM_CONFIG; - -typedef struct _NV_LMS_INSTANCED_STEREO_CONFIG_V1 -{ //!< (OUT) LMS Instanced stereo config returned by the SMP Assist GetConstants API - NV_LMS_CUSTOM_CONFIG_V1 sLeftConfig; //!< (OUT) LMS config for the Left eye view - NV_LMS_CUSTOM_CONFIG_V1 sRightConfig; //!< (OUT) LMS config for the Right eye view -} NV_LMS_INSTANCED_STEREO_CONFIG_V1; - -typedef NV_LMS_INSTANCED_STEREO_CONFIG_V1 NV_LMS_INSTANCED_STEREO_CONFIG; - -typedef enum _NV_SMP_ASSIST_EYE_INDEX -{ - NV_SMP_ASSIST_EYE_INDEX_MONO = 0, // Non-stereo rendering - NV_SMP_ASSIST_EYE_INDEX_LEFT_EYE = 1, // Stereo - Rendering left eye - NV_SMP_ASSIST_EYE_INDEX_RIGHT_EYE = 2, // Stereo - Rendering right eye - NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO = 3, // Stereo - Rendering both eyes -} NV_SMP_ASSIST_EYE_INDEX; - -#define NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES 4 - -typedef struct _NV_CUSTOM_RECTS_V1 -{ - NvU32 numViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; - D3D11_VIEWPORT *pViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; //!< (IN) Viewports, for each eye index, that should be set when app calls Enable(eyeIndex) - D3D11_RECT *pScissors[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; //!< (IN) Scissors, for each eye index, that should be set when app calls Enable(eyeIndex) -} NV_CUSTOM_RECTS_V1; - -typedef NV_CUSTOM_RECTS_V1 NV_CUSTOM_RECTS; - -typedef struct _NV_SMP_ASSIST_ENABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Rendering mode for upcoming draw calls (Mono/Stereo-Left/Stereo-Right/Instanced Stereo) -} NV_SMP_ASSIST_ENABLE_PARAMS_V1; - -typedef NV_SMP_ASSIST_ENABLE_PARAMS_V1 NV_SMP_ASSIST_ENABLE_PARAMS; -#define NV_SMP_ASSIST_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_ENABLE_PARAMS_V1, 1) -#define NV_SMP_ASSIST_ENABLE_PARAMS_VER NV_SMP_ASSIST_ENABLE_PARAMS_VER1 - -typedef struct _NV_SMP_ASSIST_DISABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NvU32 Reserved; //!< (IN) Unused. -} NV_SMP_ASSIST_DISABLE_PARAMS_V1; - -typedef NV_SMP_ASSIST_DISABLE_PARAMS_V1 NV_SMP_ASSIST_DISABLE_PARAMS; -#define NV_SMP_ASSIST_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_DISABLE_PARAMS_V1, 1) -#define NV_SMP_ASSIST_DISABLE_PARAMS_VER NV_SMP_ASSIST_DISABLE_PARAMS_VER1 - -// FastGS constant buffer data returned by the GetConstants API. -// Refer VRWorks SDK's multiprojection_dx app (struct FastGSCBData) -typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_V1 -{ - float NDCSplitsX[2]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading/ Lens Matched Shading - float NDCSplitsY[2]; -} NV_SMP_ASSIST_FASTGSCBDATA_V1; - -typedef NV_SMP_ASSIST_FASTGSCBDATA_V1 NV_SMP_ASSIST_FASTGSCBDATA; - -typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 -{ - float NDCSplitsX[4]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading (Instanced stereo). 2 splits for left eye followed by 2 splits for right eye - float NDCSplitsY[2]; -} NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1; - -typedef NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO; - -// Constant buffer data to supply the UV-remapping helper functions -// Refer VRWorks SDK's multiprojection_dx app (struct RemapCBData) -typedef struct _NV_SMP_ASSIST_REMAPCBDATA_V1 -{ - //!< (OUT) Constant buffer data to supply the UV-remapping helper functions - float ClipToWindowSplitsX[2]; - float ClipToWindowSplitsY[2]; - float ClipToWindowX[3][2]; // ClipToWindowX[i][0] is Scale and ClipToWindowX[i][1] is Bias - float ClipToWindowY[3][2]; // ClipToWindowY[i][0] is Scale and ClipToWindowY[i][1] is Bias - float ClipToWindowZ[2]; // ClipToWindowZ[0] is Scale and ClipToWindowZ[1] is Bias - - float WindowToClipSplitsX[2]; - float WindowToClipSplitsY[2]; - float WindowToClipX[3][2]; // WindowToClipX[i][0] is Scale and WindowToClipX[i][1] is Bias - float WindowToClipY[3][2]; // WindowToClipY[i][0] is Scale and WindowToClipY[i][1] is Bias - float WindowToClipZ[2]; // WindowToClipZ[0] is Scale and WindowToClipZ[1] is Bias - - float BoundingRectOriginX; - float BoundingRectOriginY; - float BoundingRectSizeWidth; - float BoundingRectSizeHeight; - float BoundingRectSizeInvWidth; - float BoundingRectSizeInvHeight; - - float Padding[2]; -}NV_SMP_ASSIST_REMAPCBDATA_V1; - -typedef NV_SMP_ASSIST_REMAPCBDATA_V1 NV_SMP_ASSIST_REMAPCBDATA; - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_GET_CONSTANTS_V3 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Viewports/scissors/constant buffer data corresponding to the input eEyeIndex will be returned - NvU32 numViewports; //!< (OUT) Number of valid viewport entries - D3D11_VIEWPORT *pViewports; //!< (OUT) If not NULL, this will contain the viewports computed by driver based on init params - D3D11_RECT *pScissors; //!< (OUT) If not NULL, this will contain the scissors computed by the driver based on init params - - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (OUT) SMP type provided in Init call - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (OUT) SMP Assist level provided in Init call - - union - { - NV_MRS_CUSTOM_CONFIG_V1 sMRSConfig; //!< (OUT) If eSMPAssistType is MRS, then MRS config will be populated - NV_LMS_CUSTOM_CONFIG_V1 sLMSConfig; //!< (OUT) If eSMPAssistType is LMS, then LMS config will be populated - }; - - float projectionSizeWidth; //!< (OUT) MRS/LMS projection size - float projectionSizeHeight; //!< (OUT) - - NV_SMP_ASSIST_FASTGSCBDATA_V1 *pFastGSCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the FastGS for culling primitives per-viewport - NV_SMP_ASSIST_REMAPCBDATA_V1 *pRemapCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the UV-remapping helper functions - - D3D11_VIEWPORT boundingViewport; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual viewports populated in pViewports - D3D11_RECT boundingScissor; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual scissor rects populated in pScissors - - union - { - NV_MRS_INSTANCED_STEREO_CONFIG_V1 sMRS_ISConfig; //!< (OUT) If eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo config will be populated - NV_LMS_INSTANCED_STEREO_CONFIG_V1 sLMS_ISConfig; //!< (OUT) If eSMPAssistType is LMS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then LMS Instanced stereo config will be populated - }; - - NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 *pFastGSCBDataMRS_IS; //!< (OUT) If non-NULL and eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo FastGS constant buffer data will be populated -} NV_SMP_ASSIST_GET_CONSTANTS_V3; - -#define NV_SMP_ASSIST_GET_CONSTANTS_VER3 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_GET_CONSTANTS_V3, 3) -typedef NV_SMP_ASSIST_GET_CONSTANTS_V3 NV_SMP_ASSIST_GET_CONSTANTS; -#define NV_SMP_ASSIST_GET_CONSTANTS_VER NV_SMP_ASSIST_GET_CONSTANTS_VER3 - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_SETUP_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - union - { - NV_MRS_CONFIG eMRSConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Full then provide MRS config enum - NV_LMS_CONFIG eLMSConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Full then provide LMS config enum - NV_MRS_CUSTOM_CONFIG_V1 sMRSCustomConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Partial, then provide MRS config - NV_LMS_CUSTOM_CONFIG_V1 sLMSCustomConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Partial, then provide LMS config - NV_CUSTOM_RECTS_V1 sCustomRects; //!< (IN) If SMP Assist Level is Minimal, provide custom viewports and scissor rects for each eye index. - }; - - float resolutionScale; //!< (IN) A resolution multiplier in the range [0.1, 3.0] if app wants to render at higher resolution - D3D11_VIEWPORT boundingBox; //!< (IN) Rect on the rendertarget, to place the projection - float vpOffsets[2]; //!< (IN) Default set to 0. If non-zero, MRS/LMS viewports' TopLeftX and TopLeftY will be - //!< offset by vpOffsets[0] and vpOffsets[1] respectively. -} NV_SMP_ASSIST_SETUP_PARAMS_V1; - -typedef NV_SMP_ASSIST_SETUP_PARAMS_V1 NV_SMP_ASSIST_SETUP_PARAMS; -#define NV_SMP_ASSIST_SETUP_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_SETUP_PARAMS_V1, 1) -#define NV_SMP_ASSIST_SETUP_PARAMS_VER NV_SMP_ASSIST_SETUP_PARAMS_VER1 - -typedef struct _NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; // Patch instanced stereo shaders (created with packed eye index) with this SMPAssistType (NV_SMP_ASSIST_LMS only) - float leftCoeffs[4]; // Left eye: outpos.x = dotproduct(outputpos, leftCoeffs) + leftConst - float leftConst; - float rightCoeffs[4]; // Right eye: outpos.x = dotproduct(outputpos, rightCoeffs) + rightConst - float rightConst; -} NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1; - -typedef NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS; -#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1, 1) -#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! - -DECLARE_INTERFACE(ID3DNvSMPAssist_V1) -{ -////////////////////////////// VER1 methods ////////////////////////////////////////// - // Disable SMP Assist for further Draw calls - STDMETHOD_(NvAPI_Status,Disable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_DISABLE_PARAMS *psSMPAssistDisableParams) PURE; - - // Enable SMP Assist for further Draw calls. App has to provide the type of rendering done in upcoming Draw calls - Mono/Left eye/Right eye/Instanced Stereo - STDMETHOD_(NvAPI_Status,Enable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_ENABLE_PARAMS *psSMPAssistEnableParams) PURE; - - // Get the constants used by the drivers - STDMETHOD_(NvAPI_Status,GetConstants)(THIS_ __inout NV_SMP_ASSIST_GET_CONSTANTS *psSMPAssistGetConstants) PURE; - - // Setup the projections (rects, constant buffer data etc.) - STDMETHOD_(NvAPI_Status,SetupProjections)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_SETUP_PARAMS *psSMPAssistSetupParams) PURE; - - // Update instanced stereo specific data - STDMETHOD_(NvAPI_Status,UpdateInstancedStereoData)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS *psSMPAssistInstancedStereoParams) PURE; -////////////////////////////// end of VER1 methods ////////////////////////////////////////// -}; - -typedef ID3DNvSMPAssist_V1 ID3DNvSMPAssist; -#define ID3DNVSMPASSIST_VER1 MAKE_NVAPI_VERSION(ID3DNvSMPAssist_V1, 1) -#define ID3DNVSMPASSIST_VER ID3DNVSMPASSIST_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal - NvU32 flags; //!< (IN) Flags, if any - - ID3DNvSMPAssist **ppD3DNvSMPAssist; //!< (OUT) Interface pointer returned by the Init call. Use for future Enable/Disable etc. calls - -} NV_SMP_ASSIST_INITIALIZE_PARAMS_V1; - -#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_INITIALIZE_PARAMS_V1, 1) -#ifndef NV_SMP_ASSIST_INITIALIZE_PARAMS_VER -typedef NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 NV_SMP_ASSIST_INITIALIZE_PARAMS; -#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeSMPAssist -// -//! DESCRIPTION: Initialize SMP Assist extension. Take the SMPAssist(MRS/LMS) params from the application. -//! Provide the application with a interface pointer for future use. -//! -//! \since Release: 396 -//! \param [in] pDevice Pointer to IUnknown (Currently supports ID3D11Device) -//! \param [inout] pSMPAssistInitParams SMP Assist initialization params -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_OK Call succeeded. -//! \retval ::NVAPI_ERROR Call failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One of the required input arguments was NULL -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_InitializeSMPAssist(__in IUnknown *pDevice, __inout NV_SMP_ASSIST_INITIALIZE_PARAMS *pSMPAssistInitParams); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && defined(__d3d11_h__) -//! \ingroup dx -typedef struct _NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal - NvBool bSMPAssistSupported; //!< (OUT) SMP Assist supported or not -} NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS; -#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QuerySMPAssistSupport -// -//! DESCRIPTION: Query SMP assist extension support. -//! -//! \since Release: 396 -//! \param [in] pDev Pointer to IUnknown (Currently supports ID3D11Device) -//! \param [out] pQuerySMPAssistSupportParams Pointer to a structure returning requested SMP assist support -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_NOT_SUPPORTED Requested SMP assist is not supported. -//! \retval ::NVAPI_OK Call succeeded. Check value of pQuerySMPAssistSupportParams->bSMPAssistSupported -//! \retval ::NVAPI_INVALID_POINTER pDev or pQuerySMPAssistSupportParams was a NULL pointer -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QuerySMPAssistSupport(__in IUnknown *pDev, __inout NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS *pQuerySMPAssistSupportParams); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to get sleep status -//! \ingroup dx -typedef struct _NV_GET_SLEEP_STATUS_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvBool bLowLatencyMode; //!< (OUT) Is low latency mode enabled? - NvBool bFsVrr; //!< (OUT) Is fullscreen VRR enabled? - NvBool bCplVsyncOn; //!< (OUT) Is Control Panel overriding VSYNC ON? - NvU32 sleepIntervalUs; //!< (OUT) Latest sleep interval in microseconds. - NvBool bUseGameSleep; //!< (OUT) Is NvAPI_D3D_Sleep() being called? - NvU8 rsvd[121]; //!< (IN) Reserved. Must be set to 0s. -} NV_GET_SLEEP_STATUS_PARAMS_V1; - -typedef NV_GET_SLEEP_STATUS_PARAMS_V1 NV_GET_SLEEP_STATUS_PARAMS; -#define NV_GET_SLEEP_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GET_SLEEP_STATUS_PARAMS_V1, 1) -#define NV_GET_SLEEP_STATUS_PARAMS_VER NV_GET_SLEEP_STATUS_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetSleepStatus -// -//! DESCRIPTION: This function can be used to get the latest sleep status: -//! bLowLatencyMode indicates whether low latency mode is currently -//! enabled in the driver. -//! Note that it may not always reflect the previously requested sleep mode, -//! as the feature may not be available on the platform, or the setting has -//! been overridden by the control panel, for example. -//! bFsVrr indicates fullscreen GSYNC or GSYNC Compatible mode. It is valid -//! only when the application is in the foreground. -//! bCplVsyncOn indicates Control Panel VSYNC ON override. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! \param [in] pGetSleepStatusParams Sleep status params. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetSleepStatus(__in IUnknown *pDev, __in NV_GET_SLEEP_STATUS_PARAMS *pGetSleepStatusParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to set sleep mode -//! \ingroup dx -typedef struct _NV_SET_SLEEP_MODE_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvBool bLowLatencyMode; //!< (IN) Low latency mode enable/disable. - NvBool bLowLatencyBoost; //!< (IN) Request maximum GPU clock frequency regardless of workload. - NvU32 minimumIntervalUs; //!< (IN) Minimum frame interval in microseconds. 0 = no frame rate limit. - NvBool bUseMarkersToOptimize; //!< (IN) Allow latency markers to be used for runtime optimizations. - NvU8 rsvd[31]; //!< (IN) Reserved. Must be set to 0s. -} NV_SET_SLEEP_MODE_PARAMS_V1; - -typedef NV_SET_SLEEP_MODE_PARAMS_V1 NV_SET_SLEEP_MODE_PARAMS; -#define NV_SET_SLEEP_MODE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SET_SLEEP_MODE_PARAMS_V1, 1) -#define NV_SET_SLEEP_MODE_PARAMS_VER NV_SET_SLEEP_MODE_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetSleepMode -// -//! DESCRIPTION: This function can be used to update sleep mode dynamically. -//! The settings are not dependent to each other, meaning low latency mode -//! can be enabled/disabled regardless of whether minimum interval is set or -//! not. The former is to intelligently lower latency without impacting frame -//! rate. The later is to limit frame rate (e.g. minimumIntervalUs = 10000 -//! limits frame rate to 100 FPS). They work well separately and/or together. -//! Note that minimumIntervalUs usage is not limited to lowering latency, so -//! feel free to use it to limit frame rate for menu, cut scenes, etc. -//! Note that low latency mode can be enabled, and/or minimum interval can -//! be set, even without using NvAPI_D3D_Sleep(). However, without it, the -//! sleep to achieve these features would happen at a less optimal point, -//! resulting in higher overall latency. -//! The bLowLatencyBoost will request the GPU run at max clocks even in -//! scenarios where it is idle most of the frame and would normally try -//! to save power. This can decrease latency in CPU-limited scenarios. -//! While this function can be called as often as needed, it is not -//! necessary nor recommended to call this too frequently (e.g. every frame), -//! as the settings persist for the target device. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! \param [in] pSetSleepModeParams Sleep mode params. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetSleepMode(__in IUnknown *pDev, __in NV_SET_SLEEP_MODE_PARAMS *pSetSleepModeParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_Sleep -// -//! DESCRIPTION: It is recommended to call this function at the very start of -//! each frame (e.g. before input sampling). If there is a need to sleep, -//! due to frame rate limit and/or low latency features, for example, -//! this call provides an entry point for the driver to sleep at the most -//! optimal spot to achieve the lowest latency. -//! It is recommended to call this function even when low latency mode is -//! disabled and minimum interval is 0. Other features, such as Maximum Frame -//! Rate setting, could be enabled in the control panel to benefit from this. -//! It is OK to start (or stop) using this function at any time. However, -//! when using this function, it must be called exactly once on each frame. -//! If this function is not called, after several frames, the driver would -//! fallback to sleep at its less optimal spot. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_Sleep(__in IUnknown *pDev); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -//! Used to send Reflex Sync data to UMD -//! \ingroup dx -typedef struct _NV_SET_REFLEX_SYNC_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvU32 bEnable:1; //!< (IN) Enable Reflex Sync - NvU32 bDisable:1; //!< (IN) Disable Reflex Sync - NvU32 flagsRsvd:30; //!< (IN) Reserved flag bits. Must be set to 0s. - NvU32 vblankIntervalUs; //!< (IN) Interval between VBLANKs in microseconds. (0 means N/A) - NvS32 timeInQueueUs; //!< (IN) Amount of time in the completed frame queue. Can be negative. (0 means N/A) - NvU32 timeInQueueUsTarget; //!< (IN) Target amount of time in the completed frame queue. (0 means N/A) - NvU8 rsvd[28]; //!< (IN) Reserved. Must be set to 0s. -} NV_SET_REFLEX_SYNC_PARAMS_V1; - -typedef NV_SET_REFLEX_SYNC_PARAMS_V1 NV_SET_REFLEX_SYNC_PARAMS; -#define NV_SET_REFLEX_SYNC_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SET_REFLEX_SYNC_PARAMS_V1, 1) -#define NV_SET_REFLEX_SYNC_PARAMS_VER NV_SET_REFLEX_SYNC_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetReflexSync -// -//! DESCRIPTION: This function can be used to enable/disable Reflex Sync, -//! and to pass in essential data for the Reflex Sync operation. -//! -//! \since Release: 530 -//! \param [in] pDev The target device. -//! \param [in] pSetReflexSyncParams Reflex Sync params. -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetReflexSync(__in IUnknown *pDev, __in NV_SET_REFLEX_SYNC_PARAMS *pSetReflexSyncParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to get latency report. -//! \ingroup dx - -typedef struct _NV_LATENCY_RESULT_PARAMS -{ - NvU32 version; //!< (IN) Structure version - struct FrameReport { - NvU64 frameID; - NvU64 inputSampleTime; - NvU64 simStartTime; - NvU64 simEndTime; - NvU64 renderSubmitStartTime; - NvU64 renderSubmitEndTime; - NvU64 presentStartTime; - NvU64 presentEndTime; - NvU64 driverStartTime; - NvU64 driverEndTime; - NvU64 osRenderQueueStartTime; - NvU64 osRenderQueueEndTime; - NvU64 gpuRenderStartTime; - NvU64 gpuRenderEndTime; - NvU32 gpuActiveRenderTimeUs; //!< (OUT) Difference between gpuRenderStartTime and gpuRenderEndTime, excluding the idles in between, in microseconds. - NvU32 gpuFrameTimeUs; //!< (OUT) Difference between previous and current frame's gpuRenderEndTime, in microseconds. - NvU8 rsvd[120]; - } frameReport[64]; - NvU8 rsvd[32]; -} NV_LATENCY_RESULT_PARAMS_V1; - -typedef NV_LATENCY_RESULT_PARAMS_V1 NV_LATENCY_RESULT_PARAMS; -#define NV_LATENCY_RESULT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_RESULT_PARAMS_V1, 1) -#define NV_LATENCY_RESULT_PARAMS_VER NV_LATENCY_RESULT_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetLatency -// -//! DESCRIPTION: Get a latency report including the timestamps of the -//! application latency markers set with NvAPI_D3D_SetLatencyMarker as well -//! as driver, OS queue and graphics hardware times. Requires calling -//! NvAPI_D3D_SetLatencyMarker with incrementing frameID for valid results. -//! Rendering for at least 90 frames is recommended to properly fill out the -//! structure. The newest completed frame is at the end (element 63) and -//! is preceeded by older frames. If not enough frames are valid then all -//! frames are returned with all zeroes. -//! -//! \since Release: 455 -//! \param [in] pDev The target device -//! \param [in] pGetLatencyParams The latency result structure. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetLatency(__in IUnknown *pDev, __out NV_LATENCY_RESULT_PARAMS *pGetLatencyParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used define latency marker type -//! \ingroup dx -typedef enum -{ - SIMULATION_START = 0, - SIMULATION_END = 1, - RENDERSUBMIT_START = 2, - RENDERSUBMIT_END = 3, - PRESENT_START = 4, - PRESENT_END = 5, - INPUT_SAMPLE = 6, - TRIGGER_FLASH = 7, - PC_LATENCY_PING = 8, - OUT_OF_BAND_RENDERSUBMIT_START = 9, - OUT_OF_BAND_RENDERSUBMIT_END = 10, - OUT_OF_BAND_PRESENT_START = 11, - OUT_OF_BAND_PRESENT_END = 12, -} NV_LATENCY_MARKER_TYPE; - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used set latency markers -//! \ingroup dx -typedef struct _NV_LATENCY_MARKER_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvU64 frameID; - NV_LATENCY_MARKER_TYPE markerType; - NvU64 rsvd0; - NvU8 rsvd[56]; -} NV_LATENCY_MARKER_PARAMS_V1; - -typedef NV_LATENCY_MARKER_PARAMS_V1 NV_LATENCY_MARKER_PARAMS; -#define NV_LATENCY_MARKER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_MARKER_PARAMS_V1, 1) -#define NV_LATENCY_MARKER_PARAMS_VER NV_LATENCY_MARKER_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetLatencyMarker -// -//! DESCRIPTION: Set a latency marker to be tracked by the -//! NvAPI_D3D_GetLatency function. SIMULATION_START must be the first marker -//! sent in a frame, after the previous frame's Sleep call (if used). -//! INPUT_SAMPLE may be sent to record the moment user input was sampled and -//! should come between SIMULATION_START and SIMULATION_END. -//! RENDERSUBMIT_START should come before any Direct3D calls are made for -//! the given frame and RENDERSUBMIT_END should come before calling Present. -//! PRESENT_START and END should wrap the Present call to inform the driver -//! of a present block done by the OS before the driver receives the Present. -//! TRIGGER_FLASH tells the driver to render its flash indicator for latency -//! testing, typically driven by a mouse click. -//! The frameID can start at an abitrary moment in the application lifetime -//! but must strictly increment from that point forward for consistent results. -//! -//! \since Release: 455 -//! \param [in] pDev The target device -//! \param [in] pSetLatencyMarkerParams The latency marker structure -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetLatencyMarker(__in IUnknown *pDev, __in NV_LATENCY_MARKER_PARAMS* pSetLatencyMarkerParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -//! Used in NvAPI_D3D12_SetAsyncFrameMarker -//! \ingroup dx -typedef struct _NV_ASYNC_FRAME_MARKER_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NvU64 frameID; - NV_LATENCY_MARKER_TYPE markerType; - NvU64 presentFrameID; - NvU8 rsvd[56]; -} NV_ASYNC_FRAME_MARKER_PARAMS_V1; - -typedef NV_ASYNC_FRAME_MARKER_PARAMS_V1 NV_ASYNC_FRAME_MARKER_PARAMS; -#define NV_ASYNC_FRAME_MARKER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_ASYNC_FRAME_MARKER_PARAMS_V1, 1) -#define NV_ASYNC_FRAME_MARKER_PARAMS_VER NV_ASYNC_FRAME_MARKER_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetAsyncFrameMarker -// -//! DESCRIPTION: Set an async frame marker for present and out-of-band render tracking. -//! -//! \since Release: 520 -//! \param [in] pCommandQueue The D3D12CommandQueue -//! \param [in] pSetAsyncFrameMarkerParams The async frame marker structure -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetAsyncFrameMarker(__in ID3D12CommandQueue *pCommandQueue, __in NV_ASYNC_FRAME_MARKER_PARAMS* pSetAsyncFrameMarkerParams); -#endif //defined(__cplusplus) && (defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -//! Used in NvAPI_D3D12_NotifyOutOfBandCommandQueue -//! \ingroup dx -typedef enum -{ - OUT_OF_BAND_RENDER = 0, - OUT_OF_BAND_PRESENT = 1, - OUT_OF_BAND_IGNORE = 2, -} NV_OUT_OF_BAND_CQ_TYPE; - -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_NotifyOutOfBandCommandQueue -// -//! DESCRIPTION: Notifies the driver that this command queue runs out of band -//! from the application's frame cadence. -//! -//! \since Release: 520 -//! \param [in] pCommandQueue The D3D12CommandQueue -//! \param [in] cqType The type of out of band command queue -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_NotifyOutOfBandCommandQueue(__in ID3D12CommandQueue *pCommandQueue, __in NV_OUT_OF_BAND_CQ_TYPE cqType); -#endif //defined(__cplusplus) && defined(__d3d12_h__)) - - -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetCreateCommandQueueLowLatencyHint -// -//! DESCRIPTION: Reserved call. -//! -//! \since Release: 530 -//! \param [in] pDevice The creating device -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetCreateCommandQueueLowLatencyHint(__in ID3D12Device *pDevice); -#endif //defined(__cplusplus) && defined(__d3d12_h__)) - -#if defined (__cplusplus) && defined(__d3d12_h__) - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -typedef struct NVAPI_D3D12_CREATE_CUBIN_SHADER_PARAMS -{ - size_t structSizeIn; //!< [in] Caller's version of input params - size_t structSizeOut; //!< [out] Driver's version of input params - - ID3D12Device* pDevice; //!< [in] pointer to ID3D12Device object - const void* pCubin; //!< [in] pointer to blob containing the cubin - NvU32 size; //!< [in] size of pCubin blob in bytes - NvU32 blockX; //!< [in] size of CTA / thread block/group - NvU32 blockY; //!< [in] - NvU32 blockZ; //!< [in] - NvU32 dynSharedMemBytes; //!< [in] dynamic shared memory required by the shader in bytes - const char* pShaderName; //!< [in] pointer to shader name, acts as identifier for SLI special handling, doesn't need to be accurate - NvU32 flags; //!< [in] reserved, set to 0 - NVDX_ObjectHandle hShader; //!< [out] variable that receives the handle to the created shader. - -} NVAPI_D3D12_CREATE_CUBIN_SHADER_PARAMS; - -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderExV2(__inout NVAPI_D3D12_CREATE_CUBIN_SHADER_PARAMS* pParams); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShader(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderEx(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in NvU32 dynSharedMemBytes, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderWithName(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_LaunchCubinShader(__in ID3D12GraphicsCommandList* pCommandList, - __in NVDX_ObjectHandle hShader, - __in NvU32 gridX, - __in NvU32 gridY, - __in NvU32 gridZ, - __in const void* pParams, - __in NvU32 paramSize); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCubinComputeShader(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hShader); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -#if defined(__d3d12_h__) -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! - -typedef struct NVAPI_D3D12_GET_CUDA_MERGED_TEXTURE_SAMPLER_OBJECT_PARAMS -{ - size_t structSizeIn; //!< [in] Caller's version of input params - size_t structSizeOut; //!< [out] Driver's version of input params - - ID3D12Device* pDevice; //!< [in] pointer to ID3D12Device object - D3D12_CPU_DESCRIPTOR_HANDLE texDesc; //!< [in] CPU descriptor handle of the texture (SRV) - D3D12_CPU_DESCRIPTOR_HANDLE smpDesc; //!< [in] CPU descriptor handle of the sampler (set to 0 if sampler isn't required) - NvU64 textureHandle; //!< [out] A variable that receives the driver handle - -} NVAPI_D3D12_GET_CUDA_MERGED_TEXTURE_SAMPLER_OBJECT_PARAMS; - -NVAPI_INTERFACE NvAPI_D3D12_GetCudaMergedTextureSamplerObject(__inout NVAPI_D3D12_GET_CUDA_MERGED_TEXTURE_SAMPLER_OBJECT_PARAMS* pParams); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -typedef enum _NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_TYPE -{ - NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_SURFACE = 0, - NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_TEXTURE = 1, - NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_SAMPLER = 2, - -} NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_TYPE; - -typedef struct NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_PARAMS -{ - size_t structSizeIn; //!< [in] Caller's version of input params - size_t structSizeOut; //!< [out] Driver's version of input params - - ID3D12Device* pDevice; //!< [in] Pointer to ID3D12Device object - NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_TYPE type; //!< [in] Type of the descriptor - D3D12_CPU_DESCRIPTOR_HANDLE desc; //!< [in] CPU descriptor handle of the UAV - NvU64 handle; //!< [out] A pointer to memory that receives the driver handle - -} NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_PARAMS; - -NVAPI_INTERFACE NvAPI_D3D12_GetCudaIndependentDescriptorObject(__inout NVAPI_D3D12_GET_CUDA_INDEPENDENT_DESCRIPTOR_OBJECT_PARAMS* pParams); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_GetCudaTextureObject(__in ID3D12Device* pDevice, - __in D3D12_CPU_DESCRIPTOR_HANDLE texDesc, - __in D3D12_CPU_DESCRIPTOR_HANDLE smpDesc, - __out NvU32* pTextureHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_GetCudaSurfaceObject(__in ID3D12Device* pDevice, - __in D3D12_CPU_DESCRIPTOR_HANDLE uavDesc, - __out NvU32* pSurfaceHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_IsFatbinPTXSupported(__in ID3D12Device *pDevice, - __out bool *pSupported); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCuModule(__in ID3D12Device* pDevice, - __in const void* pBlob, - __in NvU32 size, - __out NVDX_ObjectHandle* phModule); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_EnumFunctionsInModule(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule, - __inout NvU32* pArraySize, - __out const char** const pFunctionNames); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCuFunction(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule, - __in const char* pName, - __out NVDX_ObjectHandle* phFunction); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! - -typedef struct _NVAPI_DIM3 -{ - NvU32 x; - NvU32 y; - NvU32 z; -} NVAPI_DIM3; - -typedef struct _NVAPI_CU_KERNEL_LAUNCH_PARAMS -{ - NVDX_ObjectHandle hFunction; - NVAPI_DIM3 gridDim; - NVAPI_DIM3 blockDim; - NvU32 dynSharedMemBytes; - void const * pParams; - NvU32 paramSize; -} NVAPI_CU_KERNEL_LAUNCH_PARAMS; - -NVAPI_INTERFACE NvAPI_D3D12_LaunchCuKernelChain(__in ID3D12GraphicsCommandList* pCommandList, - __in const NVAPI_CU_KERNEL_LAUNCH_PARAMS* pKernels, - __in NvU32 numKernels); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! - -typedef struct _NVAPI_CU_KERNEL_LAUNCH_PARAMS_EX -{ - NVDX_ObjectHandle hFunction; - NVAPI_DIM3 gridDim; - NVAPI_DIM3 blockDim; - NvU32 dynSharedMemBytes; - - // either pParams/paramsSize is used or kernelParams is used - void const * pParams; - NvU32 paramSize; - void **kernelParams; -} NVAPI_CU_KERNEL_LAUNCH_PARAMS_EX; - -NVAPI_INTERFACE NvAPI_D3D12_LaunchCuKernelChainEx(__in ID3D12GraphicsCommandList* pCommandList, - __in const NVAPI_CU_KERNEL_LAUNCH_PARAMS_EX* pKernels, - __in NvU32 numKernels); - - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCuModule(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCuFunction(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hFunction); -#endif //if defined (__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShader(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderEx(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in NvU32 dynSharedMemBytes, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderWithName(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_LaunchCubinShader(__in ID3D11DeviceContext *pDeviceContext, - __in NVDX_ObjectHandle hShader, - __in NvU32 gridX, - __in NvU32 gridY, - __in NvU32 gridZ, - __in const void* pParams, - __in NvU32 paramSize, - __in const NVDX_ObjectHandle* pReadResources, - __in NvU32 numReadResources, - __in const NVDX_ObjectHandle* pWriteResources, - __in NvU32 numWriteResources); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_DestroyCubinComputeShader(__in ID3D11Device* pDevice, - __in NVDX_ObjectHandle hShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_IsFatbinPTXSupported(__in ID3D11Device *pDevice, - __out bool *pSupported); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateUnorderedAccessView(__in ID3D11Device* pDevice, - __in ID3D11Resource* pResource, - __in const D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc, - __out ID3D11UnorderedAccessView** ppUAV, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateShaderResourceView(__in ID3D11Device* pDevice, - __in ID3D11Resource* pResource, - __in const D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc, - __out ID3D11ShaderResourceView** ppSRV, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateSamplerState(__in ID3D11Device* pDevice, - __in const D3D11_SAMPLER_DESC* pSamplerDesc, - __out ID3D11SamplerState** ppSamplerState, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_GetCudaTextureObject(__in ID3D11Device* pDevice, - __in NvU32 srvDriverHandle, - __in NvU32 samplerDriverHandle, - __out NvU32* pCudaTextureHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_GetResourceGPUVirtualAddress(__in ID3D11Device* pDevice, - __in const NVDX_ObjectHandle hResource, - __out NvU64* pGpuVA); -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined(__cplusplus) && defined(__d3d12_h__) -//! Flags specifying raytracing thread reordering hardware support. -//! Additional flags will be added as support becomes available. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS -{ - NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAP_NONE = 0x0, //!< Thread reordering acts as a no-op - NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAP_STANDARD = NV_BIT(0) //!< Standard thread reordering is supported -} NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS; - -//! Flags specifying raytracing Opacity Micromap support. -//! Additional flags will be added as support becomes available. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_NONE = 0x0, //!< Opacity Micromap support is not available. - //!< The application must not attempt to use any OMM entrypoints or flags. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_STANDARD = NV_BIT(0) //!< Standard Opacity Micromap support is available -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS; - -//! Flags specifying raytracing Displacement Micromap support. -//! Additional flags will be added as support becomes available. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_CAPS -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_CAP_NONE = 0x0, //!< Displacement Micromap support is not available. - //!< The application must not attempt to use any DMM entrypoints or flags. - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_CAP_STANDARD = NV_BIT(0) //!< Standard Displacement Micromap support is available -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_CAPS; - -//! List of Raytracing CAPS types that can be queried. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_CAPS_TYPE -{ - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_THREAD_REORDERING = 0, - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_OPACITY_MICROMAP = 1, - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_DISPLACEMENT_MICROMAP = 2, - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_INVALID = -1 -} NVAPI_D3D12_RAYTRACING_CAPS_TYPE; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingCaps -// -//! DESCRIPTION: Query raytracing capabilities of a device. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Pointer to the device on which raytracing caps should be queried from. -//! \param [in] type Raytracing caps type requested. (ex: NVAPI_D3D12_RAYTRACING_CAPS_TYPE_THREAD_REORDERING) -//! \param [out] pData Pointer to memory that receives caps. (ex: NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS*) -//! \param [in] dataSize Size in bytes to return to pData. Must match the size of the caps data requested. (ex: sizeof(NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS)) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument -//! \retval ::NVAPI_INVALID_ARGUMENT At least one of the arguments are invalid -//! \retval ::NVAPI_ERROR Error occurred -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingCaps( - __in ID3D12Device* pDevice, - __in NVAPI_D3D12_RAYTRACING_CAPS_TYPE type, - __out void* pData, - __in size_t dataSize); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Flags specifying validation behaviour for raytracing operations. -//! \ingroup dx -//! See NvAPI_D3D12_EnableRaytracingValidation -typedef enum _NVAPI_D3D12_RAYTRACING_VALIDATION_FLAGS -{ - NVAPI_D3D12_RAYTRACING_VALIDATION_FLAG_NONE = 0x0, //!< No validation flags. -} NVAPI_D3D12_RAYTRACING_VALIDATION_FLAGS; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EnableRaytracingValidation -// -//! DESCRIPTION: Enable raytracing validation for a device. -//! This function must be called before any other raytracing-related function -//! is invoked on the device. Raytracing validation can only be enabled when -//! the NV_ALLOW_RAYTRACING_VALIDATION envvar is set to 1. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 545 -//! -//! \param [in] pDevice Pointer to the device on which raytracing validation should be enabled. -//! \param [in] flags Raytracing validation flags. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as device argument -//! \retval ::NVAPI_INVALID_ARGUMENT An unsupported flag was specified -//! \retval ::NVAPI_INVALID_CALL The call was made too late (other raytracing-related calls have already been made) -//! \retval ::NVAPI_ACCESS_DENIED Validation is not allowed by envvar -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_EnableRaytracingValidation( - __in ID3D12Device5* pDevice, - __in NVAPI_D3D12_RAYTRACING_VALIDATION_FLAGS flags); - - - -//! Severity classification of validation messages. -//! \ingroup dx -//! See NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_CALLBACK -typedef enum _NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_SEVERITY -{ - NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_SEVERITY_ERROR = 0x0, //!< Error message (indicates likely bug) - NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_SEVERITY_WARNING = 0x1 //!< Warning message (indicates inadvisable usage or possible bug) -} NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_SEVERITY; - -//! Callback for raytracing validation messages. -//! \param [in] pUserData User data pointer as provided to callback registration. -//! \param [in] severity Severity of message. -//! \param [in] messageCode Type of reported validation message. -//! \param [in] message Human-readable description of what the message code means. -//! \param [in] messageDetails Additional human-readable context for validation message. May contain newlines. -//! \ingroup dx -//! See NvAPI_D3D12_RegisterRaytracingValidationMessageCallback -typedef void(__stdcall *NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_CALLBACK)(void* pUserData, NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_SEVERITY severity, const char* messageCode, const char* message, const char* messageDetails); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RegisterRaytracingValidationMessageCallback -// -//! DESCRIPTION: Register a message callback for raytracing validation messages. -//! The provided callback may be invoked by the driver using any thread at any time until the callback is unregistered. -//! It is invalid to register/unregister callbacks from within the callback. -//! It is invalid to create or destroy objects for the device or record commands onto command lists from within the callback. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 545 -//! -//! \param [in] pDevice Pointer to the device from which to obtain raytracing validation messages. -//! \param [in] pfnMessageCallback Callback used to report validation messages. -//! \param [in] pUserData [optional] User data to pass as argument to message callback. -//! \param [out] pHandle Handle that may be used to unregister the callback. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RegisterRaytracingValidationMessageCallback( - __in ID3D12Device5* pDevice, - __in NVAPI_D3D12_RAYTRACING_VALIDATION_MESSAGE_CALLBACK pfnMessageCallback, - __in_opt void* pUserData, - __out void** pHandle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_UnregisterRaytracingValidationMessageCallback -// -//! DESCRIPTION: Unregister a previously registered message callback for raytracing validation messages. -//! The provided callback will not be invoked once the unregister call has returned. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 545 -//! -//! \param [in] pDevice Pointer to the device from which to stop obtaining raytracing validation messages. -//! \param [in] handle Handle to which callback should be unregistered, obtained at registration. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as device argument -//! \retval ::NVAPI_INVALID_ARGUMENT Callback handle not recognized -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_UnregisterRaytracingValidationMessageCallback( - __in ID3D12Device5* pDevice, - __in void* handle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_FlushRaytracingValidationMessages -// -//! DESCRIPTION: Flush any validation messages that have not yet been reported. -//! This guarantees that any validation messages for work which is known to be complete on the GPU -//! at the time of the call are reported to registered callbacks. -//! This operation is lightweight if the flushed device does not have raytracing validation enabled. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 545 -//! -//! \param [in] pDevice Pointer to the device on which raytracing validation messages should be flushed. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as device argument -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_FlushRaytracingValidationMessages( - __in ID3D12Device5* pDevice); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -// Types used by both device and command list functions. - -//! Flags specifying building instructions and hints when constructing a DMM Array. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAGS -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAG_NONE = 0x0, //!< No options specified for the DMM Array build. - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE = NV_BIT(0), //!< Allow the DMM Array build to take a little longer in order to optimize for traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD. - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD = NV_BIT(1) //!< Spend as little time as possible on the DMM Array build with some potential loss to traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAGS; - -//! Specifies the input Displacement Micromap formats. -//! The DC1 (Displacement Compression 1) format follows the space-filling curve in barycentric space over the uniformly tessellated micro-triangles. -//! -//! \note This is a 16-bit value when used in #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DESC -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT_DC1_64_TRIS_64_BYTES = 0x1, //!< 64 micro-triangles packed into 64 bytes - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT_DC1_256_TRIS_128_BYTES = 0x2, //!< 256 micro-triangles packed into 128 bytes - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT_DC1_1024_TRIS_128_BYTES = 0x3, //!< 1024 micro-triangles packed into 128 bytes - -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT; - -//! Number of DMMs of a specific configuration in a DMM Array or BLAS build. -//! Used to compute conservative buffer size estimates for DMM Array and BLAS builds. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_USAGE_COUNT -{ - NvU32 count; //!< For DMM Array builds: total number of DMMs in the DMM Array with the particular \p subdivisionLevel and \p format specified in this descriptor. - //!< For BLAS builds: total number of DMMs with the \p subdivisionLevel and \p format combination that is referenced from the BLAS. - NvU32 subdivisionLevel; //!< Number of subdivisions for the DMM; valid inputs are [0, 5] (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT format; //!< Displacement Micromap format. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_USAGE_COUNT; - -//! Describes one Displacement Micromap. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DESC -{ - NvU32 byteOffset; //!< Byte offset from the \c inputBuffer, specified in the input structure #NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_INPUTS, to where the input DMM data is located. - NvU16 subdivisionLevel; //!< Number of subdivisions for the DMM; valid inputs are [0, 5] (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NvU16 format; //!< Format of the DMM of type #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_FORMAT. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DESC; - -//! Input structure to DMM Array construction. -//! Individual DMMs are accessed via indices when used in bottom-level acceleration structure (BLAS) construction. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_INPUTS -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BUILD_FLAGS flags; //!< Flags which apply to all DMMs in the array. - NvU32 numDMMUsageCounts; //!< Number of DMM usage count entries in the \p pDMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_USAGE_COUNT* pDMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the DMM entries in the build. - D3D12_GPU_VIRTUAL_ADDRESS inputBuffer; //!< Address for raw DMM input data; it must be 256-byte aligned (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BYTE_ALIGNMENT) - //!< It is recommended to try to organize DMMs together in memory that are expected to be used close together spatially. - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE perDMMDescs; //!< GPU array with one #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DESC entry per DMM. -} NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_INPUTS; - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Conservative memory requirements for building a DMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO -{ - NvU64 resultDataMaxSizeInBytes; //!< Size required to hold the result of a DMM Array build based on the specified inputs. - NvU64 scratchDataSizeInBytes; //!< Scratch storage on GPU required during DMM Array build based on the specified inputs. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO; - -//! Parameters given to NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_INPUTS* pDesc; //!< [in] Description of the DMM Array build. - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO* pInfo; //!< [out] Result of the query. -} NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1; -#define NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS; -#define NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo -// -//! DESCRIPTION: Query conservative memory requirements for building a DMM (Displacement Micromap) Array. -//! The returned size is conservative for DMM Array builds containing -//! a lower or equal number of entries for each resolution and format combination. -//! -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] pDevice Device on which the DMM Array will be built. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo( - __in ID3D12Device5* pDevice, - __inout NVAPI_GET_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -// Types used by both device and command list functions. - -//! Flags specifying building instructions and hints when constructing an OMM Array. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_NONE = 0x0, //!< No options specified for the OMM Array build. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE = NV_BIT(0), //!< Allow the OMM Array build to take a little longer in order to optimize for traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD = NV_BIT(1) //!< Spend as little time as possible on the OMM Array build with some potential loss to traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS; - -//! Specifies the input Opacity Micromap formats. -//! The OC1 (Opacity Compression 1) format follows the space-filling curve in barycentric space over the uniformly tessellated micro-triangles. -//! -//! \note This is a 16-bit value when used in #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT_OC1_2_STATE = 0x1, //!< 2-state (Transparent/Opaque) format. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT_OC1_4_STATE = 0x2 //!< 4-state (Transparent/Opaque, Known/Unknown) format. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT; - -//! Number of OMMs of a specific configuration in an OMM Array. -//! Used to compute conservative buffer size estimates for OMM Array builds. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT -{ - NvU32 count; //!< Total number of OMMs in the OMM Array with the particular \p subdivisionLevel and \p format specified in this descriptor. - NvU32 subdivisionLevel; //!< Number of subdivisions for the OMM; valid inputs are [0, 12] (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT format; //!< Opacity Micromap format. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT; - -//! Describes one Opacity Micromap. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC -{ - NvU32 byteOffset; //!< Byte offset from the \c inputBuffer, specified in the input structure #NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS, to where the input OMM data is located. - NvU16 subdivisionLevel; //!< Number of subdivisions for the OMM; valid inputs are [0, 12] (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NvU16 format; //!< Format of the OMM of type #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC; - -//! Input structure to OMM Array construction. -//! Individual OMMs are accessed via indices when used in bottom-level acceleration structure (BLAS) construction. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS flags; //!< Flags which apply to all OMMs in the array. - NvU32 numOMMUsageCounts; //!< Number of OMM usage count entries in the \p pOMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT* pOMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the OMM entries in the build. - D3D12_GPU_VIRTUAL_ADDRESS inputBuffer; //!< Address for raw OMM input data; it must be 256-byte aligned. - //!< It is recommended to try to organize OMMs together in memory that are expected to be used close together spatially. - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE perOMMDescs; //!< GPU array with one #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC entry per OMM. -} NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS; - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Conservative memory requirements for building an OMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO -{ - NvU64 resultDataMaxSizeInBytes; //!< Size required to hold the result of an OMM Array build based on the specified inputs. - NvU64 scratchDataSizeInBytes; //!< Scratch storage on GPU required during OMM Array build based on the specified inputs. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO; - -//! Parameters given to NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS* pDesc; //!< [in] Description of the OMM Array build. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO* pInfo; //!< [out] Result of the query. -} NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1; -#define NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS; -#define NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo -// -//! DESCRIPTION: Query conservative memory requirements for building an OMM (Opacity Micromap) Array. -//! The returned size is conservative for OMM Array builds containing -//! a lower or equal number of entries for each resolution and format combination. -//! -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the OMM Array will be built. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo( - __in ID3D12Device5* pDevice, - __inout NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Pipeline creation state flags. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS -{ - NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS_NONE = 0, //!< [in] No pipeline flags. - NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS_ENABLE_OMM_SUPPORT = NV_BIT(0), //!< [in] Change whether raytracing pipelines are created with support for Opacity Micromaps. - //!< If a triangle with an OMM is encountered during traversal and the pipeline was not created with support for them, behavior is undefined. - //!< Support should only be enabled if there are OMMs present, since it may incur a small penalty on traversal performance overall. - NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS_ENABLE_DMM_SUPPORT = NV_BIT(1), //!< [in] Change whether raytracing pipelines are created with support for Displacement Micromaps. - //!< If a triangle with a DMM is encountered during traversal and the pipeline was not created with support for them, behavior is undefined. - //!< Support should only be enabled if there are DMMs present, since it may incur a small penalty on traversal performance overall. -} NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS; - -//! State used when creating new pipelines. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER. - NvU32 flags; //!< [in] A bitwise OR of one or more #NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS flags for raytracing pipeline creation. -} NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1; -#define NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1, 1) -typedef NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1 NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS; -#define NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetCreatePipelineStateOptions -// -//! DESCRIPTION: Globally change the state affecting pipeline creations. -//! This affects all pipelines created after this call, and until this function is called again. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the pipelines will be created. -//! \param [in] pState State to be applied to all future pipeline creations. - -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetCreatePipelineStateOptions( - __in ID3D12Device5* pDevice, - __in const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* pState); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Type of serialized data. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX -{ - // D3D12_SERIALIZED_DATA_TYPE flags - NVAPI_D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE_EX = 0x0, //!< Serialized data contains a raytracing acceleration structure. - //!< Starting from offset 0, the first bytes of the serialized acceleration structure can be reinterpreted as \c D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER. - //!< That structure contains the identifier to be passed along to NvAPI_D3D12_CheckDriverMatchingIdentifierEx(). - - // NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX specific flags - NVAPI_D3D12_SERIALIZED_DATA_RAYTRACING_OPACITY_MICROMAP_ARRAY_EX = 0x1, //!< Data blob contains an OMM Array. - //!< Starting from offset 0, the first bytes of the OMM Array can be reinterpreted as \c D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER. - NVAPI_D3D12_SERIALIZED_DATA_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_EX = 0x2, //!< Data blob contains a DMM Array. - //!< Starting from offset 0, the first bytes of the DMM Array can be reinterpreted as \c D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER. - -} NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX; - -//! Parameters given to NvAPI_D3D12_CheckDriverMatchingIdentifierEx(). -//! -//! \ingroup dx -typedef struct _NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER. - NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX serializedDataType; //!< [in] Type of data to be deserialized; see #NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX. - const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER* pIdentifierToCheck; //!< [in] Identifier from the header of the serialized data to check with the driver; see \c D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER. - //!< Information about how to retrieve that identifier can be found in the description of each #NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX enum. - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS checkStatus; //!< [out] Result of the check; see \c D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS. -} NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1; -#define NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1, 1) -typedef NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1 NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS; -#define NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CheckDriverMatchingIdentifierEx -// -//! DESCRIPTION: This function is an extension of ID3D12Device5::CheckDriverMatchingIdentifier() with additional serialized data types. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the data will be deserialized. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CheckDriverMatchingIdentifierEx( - __in ID3D12Device5* pDevice, - __inout NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! This enum extends \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS with modified and additional values. -//! Only modified/new values are fully described; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX -{ - // D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS flags - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE_EX = 0x0, //!< No options specified for the acceleration structure build. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE_EX = NV_BIT(0), //!< Allow the acceleration structure to later be updated (via the flag #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE_EX), rather than always requiring a full rebuild. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION_EX = NV_BIT(1), //!< Allow for the acceleration structure to later be compacted. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE_EX = NV_BIT(2), //!< Favorize higher raytracing performance at the cost of longer build times. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD_EX = NV_BIT(3), //!< Favorize faster build times at the cost of lower raytracing performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY_EX = NV_BIT(4), //!< Minimize the memory footprint of the produced acceleration structure, potentially at the cost of longer build time or lower raytracing performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE_EX = NV_BIT(5), //!< Instead of rebuilding the acceleration structure from scratch, the existing acceleration structure will be updated. - //!< Added behaviour: If #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX is specified, OMM references may be changed along with positions when an update is performed. - - // NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX specific flags - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX = NV_BIT(6), //!< The acceleration structure (AS) supports updating OMM contents (base OMM Array and/or indices). - //!< Specifying this flag may result in larger AS size and may reduce traversal performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DISABLE_OMMS_EX = NV_BIT(7), //!< Only applicable for BLAS builds. If enabled, any instances referencing this BLAS are allowed to disable the OMM test through the #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX flag. - //!< Specifying this build flag may result in some reductions in traversal performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_OPACITY_STATES_UPDATE_EX = NV_BIT(8), //!< The acceleration structure (AS) supports updating OMM data (encoded opacity values). - //!< Specifying this flag may reduce traversal performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DATA_ACCESS_EX = NV_BIT(9), //!< Allows triangle and micro-triangle data to be accessed through the BLAS via shader intrinsics. - -} NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX; - -//! This enum extends \c D3D12_RAYTRACING_GEOMETRY_TYPE with additional values. -//! Only new values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX -{ - // D3D12_RAYTRACING_GEOMETRY_TYPE flags - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES_EX = 0x0, //!< This geometry is made of basic triangles. - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS_EX = 0x1, //!< This geometry is made of axis-aligned bounding boxes (AABBs). - - // NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX specific flags - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_OMM_TRIANGLES_EX = 0x2, //!< Shares most fields with the basic triangle geometry type, but allows an OMM Array to be attached to the geometry. - //!< The basic triangle type and this OMM-enabled type geometries may be mixed in the same BLAS build. - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_DMM_TRIANGLES_EX = 0x3, //!< Triangle geometry with attached DMM data. - //!< This geometry cannot be mixed with other geometry types in the same BLAS. - -} NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX; - -//! If a triangle has a uniform OMM state in a BLAS build, it is preferable to signal this explicitly rather than attaching a single state OMM. -//! This can be accomplished by supplying these special indices as entries in \c opacityMicromapIndexBuffer, in #NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT = -1, //!< Uniform transparent OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE = -2, //!< Uniform opaque OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT = -3, //!< Uniform unknown-transparent OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE = -4 //!< Uniform unknown-opaque OMM state. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX; - -//! Geometry descriptor attachment with Opacity Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE opacityMicromapIndexBuffer; //!< Optional buffer specifying which OMM index to use for each triangle; if \c NULL, there is a 1:1 mapping between input triangles and OMM Array entries. - //!< Special values can be used to encode OMMs with uniform state for individual triangles (see #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX). - //!< For BLAS updates, this input buffer must match that of the original build if the #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX build flag is not set. - DXGI_FORMAT opacityMicromapIndexFormat; //!< Format of \c opacityMicromapIndexBuffer, either \c DXGI_FORMAT_R32_UINT or \c DXGI_FORMAT_R16_UINT. - NvU32 opacityMicromapBaseLocation; //!< Constant added to all non-negative OMM indices in \p opacityMicromapIndexBuffer. - D3D12_GPU_VIRTUAL_ADDRESS opacityMicromapArray; //!< Pointer to an OMM Array used by this geometry; it may be set to \c NULL if no non-uniform OMMs are used. - //!< Unlike vertex, index, and transform buffers, this resource is dereferenced during raytracing. - - NvU32 numOMMUsageCounts; //!< Number of OMM usage count entries in the \p pOMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT* pOMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the OMM entries referred-to by the OMM index buffer specified by this geometry. - -} NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC; - -//! The edge vA..vB is decimated: after subdivision the number of micro-triangles on that edge is halved. -//! (i.e. the neighboring primitive can have a lower subdivision level without introducing cracks) -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAGS -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAG_DECIMATE_01 = NV_BIT(0), - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAG_DECIMATE_12 = NV_BIT(1), - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAG_DECIMATE_20 = NV_BIT(2), - -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAGS; - -//! Geometry descriptor attachment with Displacement Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_ATTACHMENT_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE triangleMicromapIndexBuffer; //!< Optional buffer specifying which DMM index to use for each triangle; if \c NULL, there is a 1:1 mapping between input triangles and DMM Array entries. - //!< For BLAS updates, this input buffer must match that of the original build. - DXGI_FORMAT triangleMicromapIndexFormat; //!< Format of \c displacementMicromapIndexBuffer, either \c DXGI_FORMAT_R32_UINT or \c DXGI_FORMAT_R16_UINT. - NvU32 triangleMicromapBaseLocation; //!< Constant added to all DMM indices in \p displacementMicromapIndexBuffer. - - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE trianglePrimitiveFlagsBuffer; //!< Optional, per-triangle UINT8 mode flags (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_PRIMITIVE_FLAGS) - - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE vertexBiasAndScaleBuffer; //!< Optional displacement base vertex bias and displacement vector scale buffer. If not supplied, bias defaults to 0 and scale to 1. - DXGI_FORMAT vertexBiasAndScaleFormat; //!< Format of \c displacementBiasAndScaleBuffer. Supported formats are \c DXGI_FORMAT_R16G16_FLOAT and \c DXGI_FORMAT_R32G32_FLOAT - - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE vertexDisplacementVectorBuffer; //!< Per-vertex displacement vector buffer. This buffer is indexed using the index buffer from the base triangle geometry. - DXGI_FORMAT vertexDisplacementVectorFormat; //!< Format of \c displacementVectorBuffer. Supported formats are \c DXGI_FORMAT_R32G32B32_FLOAT, \c DXGI_FORMAT_R32G32B32A32_FLOAT, and \c DXGI_FORMAT_R16G16B16A16_FLOAT (The Alpha channel is ignored, and stride can be set accordingly). - - D3D12_GPU_VIRTUAL_ADDRESS displacementMicromapArray; //!< Pointer to a DMM Array used by this geometry. - //!< Unlike vertex, index, and transform buffers, this resource is dereferenced during raytracing. - - NvU32 numDMMUsageCounts; //!< Number of DMM usage count entries in the \p pDMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_USAGE_COUNT* pDMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the DMM entries referred-to by the DMM index buffer specified by this geometry. - -} NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_ATTACHMENT_DESC; - -//! Geometry triangle descriptor with attached augmented Displacement Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_TRIANGLES_DESC -{ - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC triangles; //!< Triangle mesh descriptor. - NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_ATTACHMENT_DESC dmmAttachment; //!< Displacement Micromap attachment descriptor. -} NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_TRIANGLES_DESC; - -//! Geometry triangle descriptor with attached augmented Opacity Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC -{ - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC triangles; //!< Triangle mesh descriptor. - NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC ommAttachment; //!< Opacity Micromap attachment descriptor. -} NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC; - -//! This structure extends \c D3D12_RAYTRACING_GEOMETRY_DESC by supporting additional geometry types. -//! Only new members are fully described below; for more information on the other members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX -{ - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX type; //!< The type of geometry stored in the union of this structure. - D3D12_RAYTRACING_GEOMETRY_FLAGS flags; //!< Flags affecting how this geometry is processed by the raytracing pipeline. - union - { - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC triangles; //!< Describes triangle geometry if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - D3D12_RAYTRACING_GEOMETRY_AABBS_DESC aabbs; //!< Describes AABB geometry if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC ommTriangles; //!< Describes triangle geometry which may optionally use Opacity Micromaps, if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_OMM_TRIANGLES_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - NVAPI_D3D12_RAYTRACING_GEOMETRY_DMM_TRIANGLES_DESC dmmTriangles; //!< Describes micro-triangle geometry, if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_DMM_TRIANGLES_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - }; -} NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX; - -//! This enum extends \c D3D12_RAYTRACING_INSTANCE_FLAGS with additional values. -//! Only new values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX -{ - // D3D12_RAYTRACING_INSTANCE_FLAGS flags - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_NONE_EX = 0x0, //!< No options specified for this instance. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE_EX = NV_BIT(0), //!< Disable triangle culling for this instance. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE_EX = NV_BIT(1), //!< Use counter-clockwise winding for defining front faces, instead of the default of clockwise winding. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE_EX = NV_BIT(2), //!< Force all geometries in this instance to be opaque. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE_EX = NV_BIT(3), //!< All geometries in this instance will be processed as if they never had the \c D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE flag applied to them. - - // NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX specific flags - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OMM_2_STATE_EX = NV_BIT(4), //!< Ignore the Unknown state and only consider the Transparent/Opaque bit for all 4-state OMMs encountered during traversal. - //!< This flag has no effect if #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX is set. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX = NV_BIT(5) //!< Disable OMMs for all triangles, and revert to using geometry opaque/non-opaque state instead (legacy behavior). - //!< This flag is only valid if the referenced BLAS was built with the #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DISABLE_OMMS_EX flag; omitting that flag during BLAS build will result in undefined behavior. -} NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX; - -//! This structure extends \c D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS by supporting additional geometry types. -//! Only modified members are fully described below; for more information on the other members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX -{ - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE type; //!< Whether a top-level acceleration structure (TLAS) or bottom-level acceleration structure (BLAS) will be built using this information. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX flags; //!< Options influencing how the acceleration structure is built and which of its features can be used. - NvU32 numDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, it represents the number of descriptions stored in \c instanceDescs. - //!< Otherwise, it contains the number of geometry descriptions stored in \c pGeometryDescs or \c ppGeometryDescs. - D3D12_ELEMENTS_LAYOUT descsLayout; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL, it specifies which of \c pGeometryDescs and \c ppGeometryDescs to use. - //!< Otherwise, this parameter is unused. - NvU32 geometryDescStrideInBytes; //!< Stride between consecutive geometry descriptors. Should typically be set to sizeof(NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX). - //!< Only used if \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY. - //!< This field guarantees backwards compatibility, even if the geometry descriptor size increases in future NVAPI versions. - union - { - D3D12_GPU_VIRTUAL_ADDRESS instanceDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, the referenced instance structures can used the extended set of flags #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX in place of the \c D3D12_RAYTRACING_INSTANCE_FLAGS mentioned in \c D3D12_RAYTRACING_INSTANCE_DESC. - //!< Otherwise, this parameter is unused (space repurposed in a union). - const NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX* pGeometryDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY, it contains the descriptions of all geometries to be built into a BLAS. - //!< Otherwise, this parameter is unused (space repurposed in a union). - const NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX*const* ppGeometryDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS, it contains the addresses of descriptions for all geometries to be built into a BLAS. - //!< Otherwise, this parameter is unused (space repurposed in a union). - }; -} NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX; - -//! Parameters given to NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx(). -//! -//! \ingroup dx -typedef struct _NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX* pDesc; //!< [in] Description of the acceleration-structure build. - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO* pInfo; //!< [out] Result of the query. -} NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1; -#define NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1, 1) -typedef NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1 NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS; -#define NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx -// -//! DESCRIPTION: This function is an extension of ID3D12Device5::GetRaytracingAccelerationStructurePrebuildInfo() with additional input types. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the acceleration structure will be built. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx( - __in ID3D12Device5* pDevice, - __inout NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Description of the inputs and memory areas used during the building of OMM Arrays. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destOpacityMicromapArrayData; //!< Output location for the OMM Array build. - //!< NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() reports the amount of memory required for the result given a set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). - NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS inputs; //!< Description of the input data for the OMM Array build. - D3D12_GPU_VIRTUAL_ADDRESS scratchOpacityMicromapArrayData; //!< Location where the build will store temporary data. - //!< NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() reports the amount of scratch memory the implementation will need for a given set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). - //!< Contents of this memory going into a build on the GPU timeline are irrelevant and will not be preserved. - //!< After the build is complete on the GPU timeline, the memory is left with whatever undefined contents the build finished with. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. -} NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC; - -//! Structure emitted by NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo(), and optionally NvAPI_D3D12_BuildRaytracingOpacityMicromapArray(), when \c type equals #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC -{ - NvU64 currentSizeInBytes; //!< Size of the OMM Array buffer. - //!< The queried size may be smaller than the size reported by NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo(). - //!< This allows the application to move and relocate the OMM Array to a smaller buffer to reclaim any unused memory after the OMM Array build is complete. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC; - -//! Type of postbuild info to emit after an OMM Array build. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE = 0x0 //!< Size of the current OMM Array. May be smaller than reported by the NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() call. - //!< Unused memory can be reclaimed by copying the OMM Array into a new resource; see #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE; - -//! Description of the postbuild information to generate from an OMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destBuffer; //!< Result storage. - //!< Size required and the layout of the contents written by the system depend on \p infoType. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. - //!< The memory must be aligned to the natural alignment for the members of the particular output structure being generated (e.g. 8 bytes for a struct with the largest member being \c NvU64). - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE infoType; //!< Type of postbuild information to retrieve. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC; - -//! Parameters given to NvAPI_D3D12_BuildRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC* pDesc; //!< [in] Description of the OMM Array build. - NvU32 numPostbuildInfoDescs; //!< [in] Size of postbuild info desc array. Set to 0 if none are needed. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pPostbuildInfoDescs; //!< [in] Optional array of descriptions for postbuild info to generate describing properties of the acceleration structure that was built. - //!< [in] Any given postbuild info type, \c D3D12_RAYTRACING_ACCEELRATION_STRUCTURE_POSTBUILD_INFO_TYPE, can only be selected for output by at most one array entry. -} NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS; -#define NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_BuildRaytracingOpacityMicromapArray -// -//! DESCRIPTION: Construct OMM Array for a collection of OMMs on the GPU. -//! The CPU-side input buffers are not referenced after this call. -//! The GPU-side input resources are not referenced after the build has concluded after ExecuteCommandList(). -//! Additionally, the application may optionally output postbuild information immediately after the build. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_COMBINATION pParams->pPostbuildInfoDescs was set to \c NULL while pParams->numPostbuildInfoDescs is non zero. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_BuildRaytracingOpacityMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER. - D3D12_GPU_VIRTUAL_ADDRESS opacityMicromapArray; //!< [in] OMM Array current memory address; it must be 256-byte aligned (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). -} NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS; -#define NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray -// -//! DESCRIPTION: Makes the OMM Array usable at its current location in memory. -//! An OMM Array that has been copied to a new location must be relocated using this function before it may be attached to any BLAS. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Description of the inputs and memory areas used during the building of DMM Arrays. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destDisplacementMicromapArrayData; //!< Output location for the DMM Array build. - //!< NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo() reports the amount of memory required for the result given a set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BYTE_ALIGNMENT). - NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_INPUTS inputs; //!< Description of the input data for the DMM Array build. - D3D12_GPU_VIRTUAL_ADDRESS scratchDisplacementMicromapArrayData; //!< Location where the build will store temporary data. - //!< NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo() reports the amount of scratch memory the implementation will need for a given set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BYTE_ALIGNMENT). - //!< Contents of this memory going into a build on the GPU timeline are irrelevant and will not be preserved. - //!< After the build is complete on the GPU timeline, the memory is left with whatever undefined contents the build finished with. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. -} NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_DESC; - -//! Structure emitted by NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo(), and optionally NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray(), when \c type equals #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC -{ - NvU64 currentSizeInBytes; //!< Size of the DMM Array buffer. - //!< The queried size may be smaller than the size reported by NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo(). - //!< This allows the application to move and relocate the DMM Array to a smaller buffer to reclaim any unused memory after the DMM Array build is complete. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC; - -//! Type of postbuild info to emit after a DMM Array build. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE -{ - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE = 0x0, //!< Size of the current DMM Array. May be smaller than reported by the NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo() call. - //!< Unused memory can be reclaimed by copying the DMM Array into a new resource; see #NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE; - -//! Description of the postbuild information to generate from a DMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destBuffer; //!< Result storage. - //!< Size required and the layout of the contents written by the system depend on \p infoType. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. - //!< The memory must be aligned to the natural alignment for the members of the particular output structure being generated (e.g. 8 bytes for a struct with the largest member being \c NvU64). - NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE infoType; //!< Type of postbuild information to retrieve. -} NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_DESC; - -//! Parameters given to NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_DESC* pDesc; //!< [in] Description of the DMM Array build. - NvU32 numPostbuildInfoDescs; //!< [in] Size of postbuild info desc array. Set to 0 if none are needed. - const NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pPostbuildInfoDescs; //!< [in] Optional array of descriptions for postbuild info to generate describing properties of the acceleration structure that was built. - //!< [in] Any given postbuild info type, \c D3D12_RAYTRACING_ACCEELRATION_STRUCTURE_POSTBUILD_INFO_TYPE, can only be selected for output by at most one array entry. -} NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1 NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS; -#define NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray -// -//! DESCRIPTION: Construct DMM Array for a collection of DMMs on the GPU. -//! The CPU-side input buffers are not referenced after this call. -//! The GPU-side input resources are not referenced after the build has concluded after ExecuteCommandList(). -//! Additionally, the application may optionally output postbuild information immediately after the build. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_COMBINATION pParams->pPostbuildInfoDescs was set to \c NULL while pParams->numPostbuildInfoDescs is non zero. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in NVAPI_BUILD_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER. - D3D12_GPU_VIRTUAL_ADDRESS displacementMicromapArray; //!< [in] DMM Array current memory address; it must be 256-byte aligned (#NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BYTE_ALIGNMENT). -} NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_V1 NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS; -#define NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray -// -//! DESCRIPTION: Makes the DMM Array usable at its current location in memory. -//! A DMM Array that has been copied to a new location must be relocated using this function before it may be attached to any BLAS. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_RELOCATE_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pDesc; //!< [in] Description of which postbuild info to emit. - NvU32 numSources; //!< [in] Number of DMM Arrays in \p pSources. - const D3D12_GPU_VIRTUAL_ADDRESS* pSources; //!< [in] List of DMM Arrays for which postbuild info should be emitted. -} NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1; -#define NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS; -#define NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo -// -//! DESCRIPTION: Emits information about one or more DMM Arrays, only available after the DMM Array constructions have finished. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_EMIT_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pDesc; //!< [in] Description of which postbuild info to emit. - NvU32 numSources; //!< [in] Number of OMM Arrays in \p pSources. - const D3D12_GPU_VIRTUAL_ADDRESS* pSources; //!< [in] List of OMM Arrays for which postbuild info should be emitted. -} NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1; -#define NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS; -#define NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo -// -//! DESCRIPTION: Emits information about one or more OMM Arrays, only available after the OMM Array constructions have finished. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! This structure extends \c D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC by supporting additional geometry types as inputs. -//! For more information on the different members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX -{ - D3D12_GPU_VIRTUAL_ADDRESS destAccelerationStructureData; //!< Memory where the resulting acceleration structure will be stored. - NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX inputs; //!< The inputs to the build process. - D3D12_GPU_VIRTUAL_ADDRESS sourceAccelerationStructureData; //!< The acceleration structure to be updated. - //!< Otherwise if the acceleration structure should be rebuilt entirely, this value must be \c NULL. - D3D12_GPU_VIRTUAL_ADDRESS scratchAccelerationStructureData; //!< Memory that will be temporarily used during the building process. -} NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX; - -//! Parameters given to NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX* pDesc; //!< [in] Description of the acceleration structure to build. - NvU32 numPostbuildInfoDescs; //!< [in] Size of postbuild info desc array. Set to 0 if none are needed. - const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC* pPostbuildInfoDescs; //!< [in] Optional array of descriptions for postbuild info to generate describing properties of the acceleration structure that was built. - //!< Any given postbuild info type, \c D3D12_RAYTRACING_ACCEELRATION_STRUCTURE_POSTBUILD_INFO_TYPE, can only be selected for output by at most one array entry. -} NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1; -#define NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1, 1) -typedef NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1 NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS; -#define NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_BuildRaytracingAccelerationStructureEx -// -//! DESCRIPTION: Perform an acceleration structure build on the GPU. -//! Also optionally output postbuild information immediately after the build. -//! This function is an extension of ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure() with additional serialized data types. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_COMBINATION pParams->pPostbuildInfoDescs was set to \c NULL while pParams->numPostbuildInfoDescs is non zero. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_BuildRaytracingAccelerationStructureEx( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -/////////////////////////////////////////////////////////////////////////////// -// -// Miscellaneous -// -/////////////////////////////////////////////////////////////////////////////// - -//! Opacity Micromap micro-triangle states. -//! Not part of any input, but listed here for convenience. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_TRANSPARENT = 0, //!< Transparent OMM state: hit is ignored. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_OPAQUE = 1, //!< Opaque OMM state: hit is committed. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_UNKNOWN_TRANSPARENT = 2, //!< Unknown-transparent OMM state. - //!< * If operating in 2-state mode, ignore hit. - //!< * If operating in 4-state mode, invoke any-hit shader. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_UNKNOWN_OPAQUE = 3 //!< Unknown-opaque OMM state. - //!< * If operating in 2-state mode, commit hit. - //!< * If operating in 4-state mode, invoke any-hit shader. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE; - -//! Mandatory alignment for the address of an OMM Array. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT 256 - -//! Highest subdivision-level allowed with OC1. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL 12 - -//! A list of flags that can be given to the \c TraceRay() function in HLSL. -//! Only new or modified values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_RAY_FLAGS_EX -{ - // RAY_FLAGS flags - NVAPI_RAY_FLAG_NONE_EX = 0x0, //!< No flag specified. - NVAPI_RAY_FLAG_FORCE_OPAQUE_EX = NV_BIT( 0), //!< Consider all intersected geometries to be opaque, regardless of the flags specified at the geometry and instance level. - NVAPI_RAY_FLAG_FORCE_NON_OPAQUE_EX = NV_BIT( 1), //!< Consider all intersected geometries to be non-opaque, regardless of the flags specified at the geometry and instance level. - NVAPI_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH_EX = NV_BIT( 2), //!< End the traversal as soon as a geometry is hit, and that hit is not ignored by the any hit shader. - NVAPI_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER_EX = NV_BIT( 3), //!< Do not invoke the closest hit shader once the traversal ends. - NVAPI_RAY_FLAG_CULL_BACK_FACING_TRIANGLES_EX = NV_BIT( 4), //!< Never intersect triangle geometries that are back facing with regard to the ray. - NVAPI_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES_EX = NV_BIT( 5), //!< Never intersect triangle geometries that are front facing with regard to the ray. - NVAPI_RAY_FLAG_CULL_OPAQUE_EX = NV_BIT( 6), //!< Never intersect geometries that were flagged as opaque. - NVAPI_RAY_FLAG_CULL_NON_OPAQUE_EX = NV_BIT( 7), //!< Never intersect geometries that were not flagged as opaque. - NVAPI_RAY_FLAG_SKIP_TRIANGLES_EX = NV_BIT( 8), //!< Never intersect triangle geometries. - NVAPI_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES_EX = NV_BIT( 9), //!< Never intersect AABB geometries. - - // NVAPI_RAY_FLAGS_EX specific flags - NVAPI_RAY_FLAG_FORCE_OMM_2_STATE_EX = NV_BIT(10), //!< Treat unknown-opaque and unknown-transparent as opaque and transparent, respectively, during traversal. - //!< If an instance is flagged with #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX, that takes precedence over this flag. -} NVAPI_RAY_FLAG_EX; - -//! Mandatory alignment for the address of a DMM Array. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_ARRAY_BYTE_ALIGNMENT 256 - -//! Highest subdivision-level allowed with DC1. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_DC1_MAX_SUBDIVISION_LEVEL 5 - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - - -//! \ingroup DX -typedef enum _NV_D3D12_WORKSTATION_FEATURE_TYPE -{ - NV_D3D12_WORKSTATION_FEATURE_TYPE_PRESENT_BARRIER = 1, // PresentBarrier feature - NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_SUPPORT = 2, // RDMA heap supported via Bar1 carveout -} NV_D3D12_WORKSTATION_FEATURE_TYPE; - -// parameter structure for NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_AVAILABLE related information -typedef struct _NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES -{ - NvU64 rdmaHeapSize; // maximum available Bar1 heap size for RDMA allocations -} NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES; - -// parameter structure for querying workstation feature information -typedef struct _NV_D3D12_WORKSTATION_FEATURE_PROPERTIES -{ - NvU32 version; //!< (IN) Structure version - NV_D3D12_WORKSTATION_FEATURE_TYPE workstationFeatureType; //!< (IN) the type of workstation feature to be queried - NvBool supported; //!< (OUT) boolean returning if feature is supported - union - { - NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES rdmaInfo; //!< (OUT) RDMA feature related information, returned only if - //!< workstationFeatureType is NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_SUPPORT - }; -} NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1; - -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1,1) -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER1 -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1 - - -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryWorkstationFeatureProperties -// -//! DESCRIPTION: This API returns information about the properties of specific workstation features on the specified device. -//! -//! \since Release: 530 -//! -//! \param [in] pDevice The ID3D12Device device which is queried for feature properties -//! \param [inout] pWorkstationFeatureProperties Pointer to a structure containing workstation feature query information. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_QueryWorkstationFeatureProperties(__in ID3D12Device *pDevice, __inout NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS *pWorkstationFeatureProperties); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateCommittedRDMABuffer -// -//! \since Release: 530 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_CreateCommittedRDMABuffer is a wrapper of ID3D12Device::CreateCommittedResource -//! which allows to allocate linear memory which can be used for remote direct memory access (RDMA) from other devices. -//! It creates an implicit D3D12 heap of the requested size, allocates the resource and returns an RDMA address for remote direct memory access. -//! The created memory will reside on the specified device local memory and won't be cpu accessible. -//! -//! \param [in] pDevice A pointer to a D3D12 device. -//! \param [in] size Size in bytes of the linear buffer to be allocated for the resource. -//! \param [in] heapCreationNodeMask This mask indicates the node where the resource should be created. -//! \param [in] heapVisibleNodeMask This mask indicates on which nodes the resource is accessible. -//! \param [in] riidResource The globally unique identifier (GUID) for the resource interface. -//! \param [out] ppvResource A pointer to memory that receives the requested interface pointer to the created resource object. -//! \param [out] ppRDMAAddress A pointer to memory that receives the Bar1 memory region for remote direct memory access. - -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedRDMABuffer( - __in ID3D12Device* pDevice, - __in NvU64 size, - __in NvU32 heapCreationNodeMask, - __in NvU32 heapVisibleNodeMask, - __in REFIID riidResource, - __out void **ppvResource, - __out void **ppRDMAAddress); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// NVAPI DIRECT TYPE NAME: INvAPI_DirectD3D12GraphicsCommandList -// -/////////////////////////////////////////////////////////////////////////////// -class INvAPI_DirectD3D12GraphicsCommandList -{ -public: - virtual bool IsValid() const = 0; - virtual ID3D12GraphicsCommandList* GetID3D12GraphicsCommandList() const = 0; - - void DispatchGraphics(NvU32 numDispatches); - void SetMarker(void* pMarkerData, NvU32 markerSize); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// NVAPI DIRECT FUNCTION NAME: NvAPI_DirectD3D12GraphicsCommandList_Create -// -//! DESCRIPTION: Create the NvAPI_DirectD3D12GraphicsCommandList handle. -//! This function must be called after ID3D12Device::CreateCommandList. -//! -//! \param [in] pDXD3D12GraphicsCommandList The ID3D12GraphicsCommandList -//! \param [out] ppReturnD3D12GraphicsCommandList The corresponding NvAPI_DirectD3D12GraphicsCommandList handle -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DirectD3D12GraphicsCommandList_Create(__in ID3D12GraphicsCommandList *pDXD3D12GraphicsCommandList, - __out INvAPI_DirectD3D12GraphicsCommandList **ppReturnD3D12GraphicsCommandList); - -/////////////////////////////////////////////////////////////////////////////// -// -// NVAPI DIRECT FUNCTION NAME: NvAPI_DirectD3D12GraphicsCommandList_Release -// -//! DESCRIPTION: release the NvAPI_DirectD3D12GraphicsCommandList handle. -//! -//! \param [in] pD3D12GraphicsCommandList The NvAPI_DirectD3D12GraphicsCommandList handle to release -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DirectD3D12GraphicsCommandList_Release(__in INvAPI_DirectD3D12GraphicsCommandList *pD3D12GraphicsCommandList); - - -/////////////////////////////////////////////////////////////////////////////// -// -// NVAPI DIRECT FUNCTION NAME: NvAPI_DirectD3D12GraphicsCommandList_Reset -// -//! DESCRIPTION: reset the NvAPI_DirectD3D12GraphicsCommandList handle. -//! This function must be called after ID3D12GraphicsCommandList::Reset() and before any other NvAPI_Direct -//! function calls such as dispatchGraphics() etc. -//! -//! \param [in] pD3D12GraphicsCommandList The NvAPI_DirectD3D12GraphicsCommandList handle to reset -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DirectD3D12GraphicsCommandList_Reset(__in INvAPI_DirectD3D12GraphicsCommandList *pD3D12GraphicsCommandList); -#endif - - - -///////////////////////////////////////////////////////////////////////// -// Video Input Output (VIO) API -///////////////////////////////////////////////////////////////////////// - - - -//! \ingroup vidio -//! Unique identifier for VIO owner (process identifier or NVVIOOWNERID_NONE) -typedef NvU32 NVVIOOWNERID; - - -//! \addtogroup vidio -//! @{ - - -#define NVVIOOWNERID_NONE 0 //!< Unregistered ownerId - - -//! Owner type for device -typedef enum _NVVIOOWNERTYPE -{ - NVVIOOWNERTYPE_NONE , //!< No owner for the device - NVVIOOWNERTYPE_APPLICATION , //!< Application owns the device - NVVIOOWNERTYPE_DESKTOP , //!< Desktop transparent mode owns the device (not applicable for video input) -}NVVIOOWNERTYPE; - -// Access rights for NvAPI_VIO_Open() - -//! Read access (not applicable for video output) -#define NVVIO_O_READ 0x00000000 - -//! Write exclusive access (not applicable for video input) -#define NVVIO_O_WRITE_EXCLUSIVE 0x00010001 - -//! -#define NVVIO_VALID_ACCESSRIGHTS (NVVIO_O_READ | \ - NVVIO_O_WRITE_EXCLUSIVE ) - - -//! VIO_DATA.ulOwnerID high-bit is set only if device has been initialized by VIOAPI -//! examined at NvAPI_GetCapabilities|NvAPI_VIO_Open to determine if settings need to be applied from registry or POR state read -#define NVVIO_OWNERID_INITIALIZED 0x80000000 - -//! VIO_DATA.ulOwnerID next-bit is set only if device is currently in exclusive write access mode from NvAPI_VIO_Open() -#define NVVIO_OWNERID_EXCLUSIVE 0x40000000 - -//! VIO_DATA.ulOwnerID lower bits are: -//! NVGVOOWNERTYPE_xxx enumerations indicating use context -#define NVVIO_OWNERID_TYPEMASK 0x0FFFFFFF //!< mask for NVVIOOWNERTYPE_xxx - - -//! @} - -//--------------------------------------------------------------------- -// Enumerations -//--------------------------------------------------------------------- - - -//! \addtogroup vidio -//! @{ - -//! Video signal format and resolution -typedef enum _NVVIOSIGNALFORMAT -{ - NVVIOSIGNALFORMAT_NONE, //!< Invalid signal format - NVVIOSIGNALFORMAT_487I_59_94_SMPTE259_NTSC, //!< 01 487i 59.94Hz (SMPTE259) NTSC - NVVIOSIGNALFORMAT_576I_50_00_SMPTE259_PAL, //!< 02 576i 50.00Hz (SMPTE259) PAL - NVVIOSIGNALFORMAT_1035I_60_00_SMPTE260, //!< 03 1035i 60.00Hz (SMPTE260) - NVVIOSIGNALFORMAT_1035I_59_94_SMPTE260, //!< 04 1035i 59.94Hz (SMPTE260) - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE295, //!< 05 1080i 50.00Hz (SMPTE295) - NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274, //!< 06 1080i 60.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274, //!< 07 1080i 59.94Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274, //!< 08 1080i 50.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274, //!< 09 1080p 30.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274, //!< 10 1080p 29.97Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274, //!< 11 1080p 25.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274, //!< 12 1080p 24.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_23_976_SMPTE274, //!< 13 1080p 23.976Hz (SMPTE274) - NVVIOSIGNALFORMAT_720P_60_00_SMPTE296, //!< 14 720p 60.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_59_94_SMPTE296, //!< 15 720p 59.94Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_50_00_SMPTE296, //!< 16 720p 50.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274, //!< 17 1080I 48.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274, //!< 18 1080I 47.96Hz (SMPTE274) - NVVIOSIGNALFORMAT_720P_30_00_SMPTE296, //!< 19 720p 30.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_29_97_SMPTE296, //!< 20 720p 29.97Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_25_00_SMPTE296, //!< 21 720p 25.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_24_00_SMPTE296, //!< 22 720p 24.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_23_98_SMPTE296, //!< 23 720p 23.98Hz (SMPTE296) - NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372, //!< 24 2048p 30.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372, //!< 25 2048p 29.97Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372, //!< 26 2048i 60.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372, //!< 27 2048i 59.94Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372, //!< 28 2048p 25.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372, //!< 29 2048i 50.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372, //!< 30 2048p 24.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372, //!< 31 2048p 23.98Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372, //!< 32 2048i 48.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372, //!< 33 2048i 47.96Hz (SMPTE372) - - NVVIOSIGNALFORMAT_1080PSF_25_00_SMPTE274, //!< 34 1080PsF 25.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_29_97_SMPTE274, //!< 35 1080PsF 29.97Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_30_00_SMPTE274, //!< 36 1080PsF 30.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_24_00_SMPTE274, //!< 37 1080PsF 24.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_23_98_SMPTE274, //!< 38 1080PsF 23.98Hz (SMPTE274) - - NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_A, //!< 39 1080P 50.00Hz (SMPTE274) 3G Level A - NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_A, //!< 40 1080P 59.94Hz (SMPTE274) 3G Level A - NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_A, //!< 41 1080P 60.00Hz (SMPTE274) 3G Level A - - NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_B, //!< 42 1080p 60.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274_3G_LEVEL_B, //!< 43 1080i 60.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372_3G_LEVEL_B, //!< 44 2048i 60.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_B, //!< 45 1080p 50.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274_3G_LEVEL_B, //!< 46 1080i 50.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372_3G_LEVEL_B, //!< 47 2048i 50.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274_3G_LEVEL_B, //!< 48 1080p 30.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372_3G_LEVEL_B, //!< 49 2048p 30.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274_3G_LEVEL_B, //!< 50 1080p 25.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372_3G_LEVEL_B, //!< 51 2048p 25.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274_3G_LEVEL_B, //!< 52 1080p 24.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372_3G_LEVEL_B, //!< 53 2048p 24.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274_3G_LEVEL_B, //!< 54 1080i 48.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372_3G_LEVEL_B, //!< 55 2048i 48.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_B, //!< 56 1080p 59.94Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274_3G_LEVEL_B, //!< 57 1080i 59.94Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372_3G_LEVEL_B, //!< 58 2048i 59.94Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274_3G_LEVEL_B, //!< 59 1080p 29.97Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372_3G_LEVEL_B, //!< 60 2048p 29.97Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_23_98_SMPTE274_3G_LEVEL_B, //!< 61 1080p 29.98Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372_3G_LEVEL_B, //!< 62 2048p 29.98Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274_3G_LEVEL_B, //!< 63 1080i 47.96Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372_3G_LEVEL_B, //!< 64 2048i 47.96Hz (SMPTE372) 3G Level B - - NVVIOSIGNALFORMAT_END //!< 65 To indicate end of signal format list - -}NVVIOSIGNALFORMAT; - -//! SMPTE standards format -typedef enum _NVVIOVIDEOSTANDARD -{ - NVVIOVIDEOSTANDARD_SMPTE259 , //!< SMPTE259 - NVVIOVIDEOSTANDARD_SMPTE260 , //!< SMPTE260 - NVVIOVIDEOSTANDARD_SMPTE274 , //!< SMPTE274 - NVVIOVIDEOSTANDARD_SMPTE295 , //!< SMPTE295 - NVVIOVIDEOSTANDARD_SMPTE296 , //!< SMPTE296 - NVVIOVIDEOSTANDARD_SMPTE372 , //!< SMPTE372 -}NVVIOVIDEOSTANDARD; - -//! HD or SD video type -typedef enum _NVVIOVIDEOTYPE -{ - NVVIOVIDEOTYPE_SD , //!< Standard-definition (SD) - NVVIOVIDEOTYPE_HD , //!< High-definition (HD) -}NVVIOVIDEOTYPE; - -//! Interlace mode -typedef enum _NVVIOINTERLACEMODE -{ - NVVIOINTERLACEMODE_PROGRESSIVE , //!< Progressive (p) - NVVIOINTERLACEMODE_INTERLACE , //!< Interlace (i) - NVVIOINTERLACEMODE_PSF , //!< Progressive Segment Frame (psf) -}NVVIOINTERLACEMODE; - -//! Video data format -typedef enum _NVVIODATAFORMAT -{ - NVVIODATAFORMAT_UNKNOWN = -1 , //!< Invalid DataFormat - NVVIODATAFORMAT_R8G8B8_TO_YCRCB444 , //!< R8:G8:B8 => YCrCb (4:4:4) - NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4444 , //!< R8:G8:B8:A8 => YCrCbA (4:4:4:4) - NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4444 , //!< R8:G8:B8:Z10 => YCrCbZ (4:4:4:4) - NVVIODATAFORMAT_R8G8B8_TO_YCRCB422 , //!< R8:G8:B8 => YCrCb (4:2:2) - NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4224 , //!< R8:G8:B8:A8 => YCrCbA (4:2:2:4) - NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4224 , //!< R8:G8:B8:Z10 => YCrCbZ (4:2:2:4) - NVVIODATAFORMAT_X8X8X8_444_PASSTHRU , //!< R8:G8:B8 => RGB (4:4:4) - NVVIODATAFORMAT_X8X8X8A8_4444_PASSTHRU , //!< R8:G8:B8:A8 => RGBA (4:4:4:4) - NVVIODATAFORMAT_X8X8X8Z10_4444_PASSTHRU , //!< R8:G8:B8:Z10 => RGBZ (4:4:4:4) - NVVIODATAFORMAT_X10X10X10_444_PASSTHRU , //!< Y10:CR10:CB10 => YCrCb (4:4:4) - NVVIODATAFORMAT_X10X8X8_444_PASSTHRU , //!< Y10:CR8:CB8 => YCrCb (4:4:4) - NVVIODATAFORMAT_X10X8X8A10_4444_PASSTHRU , //!< Y10:CR8:CB8:A10 => YCrCbA (4:4:4:4) - NVVIODATAFORMAT_X10X8X8Z10_4444_PASSTHRU , //!< Y10:CR8:CB8:Z10 => YCrCbZ (4:4:4:4) - NVVIODATAFORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422 , //!< R8:G8:B8 + R8:G8:B8 => YCrCb (4:2:2 + 4:2:2) - NVVIODATAFORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU , //!< Y8:CR8:CB8 + Y8:CR8:CB8 => YCrCb (4:2:2 + 4:2:2) - NVVIODATAFORMAT_R10G10B10_TO_YCRCB422 , //!< R10:G10:B10 => YCrCb (4:2:2) - NVVIODATAFORMAT_R10G10B10_TO_YCRCB444 , //!< R10:G10:B10 => YCrCb (4:4:4) - NVVIODATAFORMAT_X12X12X12_444_PASSTHRU , //!< X12:X12:X12 => XXX (4:4:4) - NVVIODATAFORMAT_X12X12X12_422_PASSTHRU , //!< X12:X12:X12 => XXX (4:2:2) - NVVIODATAFORMAT_Y10CR10CB10_TO_YCRCB422 , //!< Y10:CR10:CB10 => YCrCb (4:2:2) - NVVIODATAFORMAT_Y8CR8CB8_TO_YCRCB422 , //!< Y8:CR8:CB8 => YCrCb (4:2:2) - NVVIODATAFORMAT_Y10CR8CB8A10_TO_YCRCBA4224 , //!< Y10:CR8:CB8:A10 => YCrCbA (4:2:2:4) - NVVIODATAFORMAT_R10G10B10_TO_RGB444 , //!< R10:G10:B10 => RGB (4:4:4) - NVVIODATAFORMAT_R12G12B12_TO_YCRCB444 , //!< R12:G12:B12 => YCrCb (4:4:4) - NVVIODATAFORMAT_R12G12B12_TO_YCRCB422 , //!< R12:G12:B12 => YCrCb (4:2:2) -}NVVIODATAFORMAT; - -//! Video output area -typedef enum _NVVIOOUTPUTAREA -{ - NVVIOOUTPUTAREA_FULLSIZE , //!< Output to entire video resolution (full size) - NVVIOOUTPUTAREA_SAFEACTION , //!< Output to centered 90% of video resolution (safe action) - NVVIOOUTPUTAREA_SAFETITLE , //!< Output to centered 80% of video resolution (safe title) -}NVVIOOUTPUTAREA; - -//! Synchronization source -typedef enum _NVVIOSYNCSOURCE -{ - NVVIOSYNCSOURCE_SDISYNC , //!< SDI Sync (Digital input) - NVVIOSYNCSOURCE_COMPSYNC , //!< COMP Sync (Composite input) -}NVVIOSYNCSOURCE; - -//! Composite synchronization type -typedef enum _NVVIOCOMPSYNCTYPE -{ - NVVIOCOMPSYNCTYPE_AUTO , //!< Auto-detect - NVVIOCOMPSYNCTYPE_BILEVEL , //!< Bi-level signal - NVVIOCOMPSYNCTYPE_TRILEVEL , //!< Tri-level signal -}NVVIOCOMPSYNCTYPE; - -//! Video input output status -typedef enum _NVVIOINPUTOUTPUTSTATUS -{ - NVINPUTOUTPUTSTATUS_OFF , //!< Not in use - NVINPUTOUTPUTSTATUS_ERROR , //!< Error detected - NVINPUTOUTPUTSTATUS_SDI_SD , //!< SDI (standard-definition) - NVINPUTOUTPUTSTATUS_SDI_HD , //!< SDI (high-definition) -}NVVIOINPUTOUTPUTSTATUS; - -//! Synchronization input status -typedef enum _NVVIOSYNCSTATUS -{ - NVVIOSYNCSTATUS_OFF , //!< Sync not detected - NVVIOSYNCSTATUS_ERROR , //!< Error detected - NVVIOSYNCSTATUS_SYNCLOSS , //!< Genlock in use, format mismatch with output - NVVIOSYNCSTATUS_COMPOSITE , //!< Composite sync - NVVIOSYNCSTATUS_SDI_SD , //!< SDI sync (standard-definition) - NVVIOSYNCSTATUS_SDI_HD , //!< SDI sync (high-definition) -}NVVIOSYNCSTATUS; - -//! Video Capture Status -typedef enum _NVVIOCAPTURESTATUS -{ - NVVIOSTATUS_STOPPED , //!< Sync not detected - NVVIOSTATUS_RUNNING , //!< Error detected - NVVIOSTATUS_ERROR , //!< Genlock in use, format mismatch with output -}NVVIOCAPTURESTATUS; - -//! Video Capture Status -typedef enum _NVVIOSTATUSTYPE -{ - NVVIOSTATUSTYPE_IN , //!< Input Status - NVVIOSTATUSTYPE_OUT , //!< Output Status -}NVVIOSTATUSTYPE; - - -//! Assumption, maximum 4 SDI input and 4 SDI output cards supported on a system -#define NVAPI_MAX_VIO_DEVICES 8 - -//! 4 physical jacks supported on each SDI input card. -#define NVAPI_MAX_VIO_JACKS 4 - - -//! Each physical jack an on SDI input card can have -//! two "channels" in the case of "3G" VideoFormats, as specified -//! by SMPTE 425; for non-3G VideoFormats, only the first channel within -//! a physical jack is valid. -#define NVAPI_MAX_VIO_CHANNELS_PER_JACK 2 - -//! 4 Streams, 1 per physical jack -#define NVAPI_MAX_VIO_STREAMS 4 - -#define NVAPI_MIN_VIO_STREAMS 1 - -//! SDI input supports a max of 2 links per stream -#define NVAPI_MAX_VIO_LINKS_PER_STREAM 2 - - -#define NVAPI_MAX_FRAMELOCK_MAPPING_MODES 20 - -//! Min number of capture images -#define NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES 1 - -//! Max number of capture images -#define NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES 32 - -//! Default number of capture images -#define NVAPI_GVI_DEFAULT_RAW_CAPTURE_IMAGES 5 - - - -// Data Signal notification events. These need a event handler in RM. -// Register/Unregister and PopEvent NVAPI's are already available. - -//! Device configuration -typedef enum _NVVIOCONFIGTYPE -{ - NVVIOCONFIGTYPE_IN , //!< Input Status - NVVIOCONFIGTYPE_OUT , //!< Output Status -}NVVIOCONFIGTYPE; - -typedef enum _NVVIOCOLORSPACE -{ - NVVIOCOLORSPACE_UNKNOWN, - NVVIOCOLORSPACE_YCBCR, - NVVIOCOLORSPACE_YCBCRA, - NVVIOCOLORSPACE_YCBCRD, - NVVIOCOLORSPACE_GBR, - NVVIOCOLORSPACE_GBRA, - NVVIOCOLORSPACE_GBRD, -} NVVIOCOLORSPACE; - -//! Component sampling -typedef enum _NVVIOCOMPONENTSAMPLING -{ - NVVIOCOMPONENTSAMPLING_UNKNOWN, - NVVIOCOMPONENTSAMPLING_4444, - NVVIOCOMPONENTSAMPLING_4224, - NVVIOCOMPONENTSAMPLING_444, - NVVIOCOMPONENTSAMPLING_422 -} NVVIOCOMPONENTSAMPLING; - -typedef enum _NVVIOBITSPERCOMPONENT -{ - NVVIOBITSPERCOMPONENT_UNKNOWN, - NVVIOBITSPERCOMPONENT_8, - NVVIOBITSPERCOMPONENT_10, - NVVIOBITSPERCOMPONENT_12, -} NVVIOBITSPERCOMPONENT; - -typedef enum _NVVIOLINKID -{ - NVVIOLINKID_UNKNOWN, - NVVIOLINKID_A, - NVVIOLINKID_B, - NVVIOLINKID_C, - NVVIOLINKID_D -} NVVIOLINKID; - - -typedef enum _NVVIOANCPARITYCOMPUTATION -{ - NVVIOANCPARITYCOMPUTATION_AUTO, - NVVIOANCPARITYCOMPUTATION_ON, - NVVIOANCPARITYCOMPUTATION_OFF -} NVVIOANCPARITYCOMPUTATION; - - - -//! @} - - -//--------------------------------------------------------------------- -// Structures -//--------------------------------------------------------------------- - -//! \addtogroup vidio -//! @{ - - -//! Supports Serial Digital Interface (SDI) output -#define NVVIOCAPS_VIDOUT_SDI 0x00000001 - -//! Supports Internal timing source -#define NVVIOCAPS_SYNC_INTERNAL 0x00000100 - -//! Supports Genlock timing source -#define NVVIOCAPS_SYNC_GENLOCK 0x00000200 - -//! Supports Serial Digital Interface (SDI) synchronization input -#define NVVIOCAPS_SYNCSRC_SDI 0x00001000 - -//! Supports Composite synchronization input -#define NVVIOCAPS_SYNCSRC_COMP 0x00002000 - -//! Supports Desktop transparent mode -#define NVVIOCAPS_OUTPUTMODE_DESKTOP 0x00010000 - -//! Supports OpenGL application mode -#define NVVIOCAPS_OUTPUTMODE_OPENGL 0x00020000 - -//! Supports Serial Digital Interface (SDI) input -#define NVVIOCAPS_VIDIN_SDI 0x00100000 - -//! Supports Packed ANC -#define NVVIOCAPS_PACKED_ANC_SUPPORTED 0x00200000 - -//! Supports ANC audio blanking -#define NVVIOCAPS_AUDIO_BLANKING_SUPPORTED 0x00400000 - -//! SDI-class interface: SDI output with two genlock inputs -#define NVVIOCLASS_SDI 0x00000001 - -//! Device capabilities -typedef struct _NVVIOCAPS -{ - NvU32 version; //!< Structure version - NvAPI_String adapterName; //!< Graphics adapter name - NvU32 adapterClass; //!< Graphics adapter classes (NVVIOCLASS_SDI mask) - NvU32 adapterCaps; //!< Graphics adapter capabilities (NVVIOCAPS_* mask) - NvU32 dipSwitch; //!< On-board DIP switch settings bits - NvU32 dipSwitchReserved; //!< On-board DIP switch settings reserved bits - NvU32 boardID; //!< Board ID - //! Driver version - struct // - { - NvU32 majorVersion; //!< Major version. For GVI, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD) - NvU32 minorVersion; //!< Minor version. For GVI, minorVersion contains Revison(HIWORD) And Build(LOWORD) - } driver; // - //! Firmware version - struct - { - NvU32 majorVersion; //!< Major version. In version 2, for both GVI and GVO, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD) - NvU32 minorVersion; //!< Minor version. In version 2, for both GVI and GVO, minorVersion contains Revison(HIWORD) And Build(LOWORD) - } firmWare; // - NVVIOOWNERID ownerId; //!< Unique identifier for owner of video output (NVVIOOWNERID_INVALID if free running) - NVVIOOWNERTYPE ownerType; //!< Owner type (OpenGL application or Desktop mode) -} NVVIOCAPS; - -//! Macro for constructing the version field of NVVIOCAPS -#define NVVIOCAPS_VER1 MAKE_NVAPI_VERSION(NVVIOCAPS,1) -#define NVVIOCAPS_VER2 MAKE_NVAPI_VERSION(NVVIOCAPS,2) -#define NVVIOCAPS_VER NVVIOCAPS_VER2 - -//! Input channel status -typedef struct _NVVIOCHANNELSTATUS -{ - NvU32 smpte352; //!< 4-byte SMPTE 352 video payload identifier - NVVIOSIGNALFORMAT signalFormat; //!< Signal format - NVVIOBITSPERCOMPONENT bitsPerComponent; //!< Bits per component - NVVIOCOMPONENTSAMPLING samplingFormat; //!< Sampling format - NVVIOCOLORSPACE colorSpace; //!< Color space - NVVIOLINKID linkID; //!< Link ID -} NVVIOCHANNELSTATUS; - -//! Input device status -typedef struct _NVVIOINPUTSTATUS -{ - NVVIOCHANNELSTATUS vidIn[NVAPI_MAX_VIO_JACKS][NVAPI_MAX_VIO_CHANNELS_PER_JACK]; //!< Video input status per channel within a jack - NVVIOCAPTURESTATUS captureStatus; //!< status of video capture -} NVVIOINPUTSTATUS; - -//! Output device status -typedef struct _NVVIOOUTPUTSTATUS -{ - NVVIOINPUTOUTPUTSTATUS vid1Out; //!< Video 1 output status - NVVIOINPUTOUTPUTSTATUS vid2Out; //!< Video 2 output status - NVVIOSYNCSTATUS sdiSyncIn; //!< SDI sync input status - NVVIOSYNCSTATUS compSyncIn; //!< Composite sync input status - NvU32 syncEnable; //!< Sync enable (TRUE if using syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSIGNALFORMAT syncFormat; //!< Sync format - NvU32 frameLockEnable; //!< Framelock enable flag - NvU32 outputVideoLocked; //!< Output locked status - NvU32 dataIntegrityCheckErrorCount; //!< Data integrity check error count - NvU32 dataIntegrityCheckEnabled; //!< Data integrity check status enabled - NvU32 dataIntegrityCheckFailed; //!< Data integrity check status failed - NvU32 uSyncSourceLocked; //!< genlocked to framelocked to ref signal - NvU32 uPowerOn; //!< TRUE: indicates there is sufficient power -} NVVIOOUTPUTSTATUS; - -//! Video device status. -typedef struct _NVVIOSTATUS -{ - NvU32 version; //!< Structure version - NVVIOSTATUSTYPE nvvioStatusType; //!< Input or Output status - union - { - NVVIOINPUTSTATUS inStatus; //!< Input device status - NVVIOOUTPUTSTATUS outStatus; //!< Output device status - }vioStatus; -} NVVIOSTATUS; - -//! Macro for constructingthe version field of NVVIOSTATUS -#define NVVIOSTATUS_VER MAKE_NVAPI_VERSION(NVVIOSTATUS,1) - -//! Output region -typedef struct _NVVIOOUTPUTREGION -{ - NvU32 x; //!< Horizontal origin in pixels - NvU32 y; //!< Vertical origin in pixels - NvU32 width; //!< Width of region in pixels - NvU32 height; //!< Height of region in pixels -} NVVIOOUTPUTREGION; - -//! Gamma ramp (8-bit index) -typedef struct _NVVIOGAMMARAMP8 -{ - NvU16 uRed[256]; //!< Red channel gamma ramp (8-bit index, 16-bit values) - NvU16 uGreen[256]; //!< Green channel gamma ramp (8-bit index, 16-bit values) - NvU16 uBlue[256]; //!< Blue channel gamma ramp (8-bit index, 16-bit values) -} NVVIOGAMMARAMP8; - -//! Gamma ramp (10-bit index) -typedef struct _NVVIOGAMMARAMP10 -{ - NvU16 uRed[1024]; //!< Red channel gamma ramp (10-bit index, 16-bit values) - NvU16 uGreen[1024]; //!< Green channel gamma ramp (10-bit index, 16-bit values) - NvU16 uBlue[1024]; //!< Blue channel gamma ramp (10-bit index, 16-bit values) -} NVVIOGAMMARAMP10; - - -//! Sync delay -typedef struct _NVVIOSYNCDELAY -{ - NvU32 version; //!< Structure version - NvU32 horizontalDelay; //!< Horizontal delay in pixels - NvU32 verticalDelay; //!< Vertical delay in lines -} NVVIOSYNCDELAY; - -//! Macro for constructing the version field of NVVIOSYNCDELAY -#define NVVIOSYNCDELAY_VER MAKE_NVAPI_VERSION(NVVIOSYNCDELAY,1) - - -//! Video mode information -typedef struct _NVVIOVIDEOMODE -{ - NvU32 horizontalPixels; //!< Horizontal resolution (in pixels) - NvU32 verticalLines; //!< Vertical resolution for frame (in lines) - float fFrameRate; //!< Frame rate - NVVIOINTERLACEMODE interlaceMode; //!< Interlace mode - NVVIOVIDEOSTANDARD videoStandard; //!< SMPTE standards format - NVVIOVIDEOTYPE videoType; //!< HD or SD signal classification -} NVVIOVIDEOMODE; - -//! Signal format details -typedef struct _NVVIOSIGNALFORMATDETAIL -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format enumerated value - NVVIOVIDEOMODE videoMode; //!< Video mode for signal format -}NVVIOSIGNALFORMATDETAIL; - - -//! R8:G8:B8 -#define NVVIOBUFFERFORMAT_R8G8B8 0x00000001 - -//! R8:G8:B8:Z24 -#define NVVIOBUFFERFORMAT_R8G8B8Z24 0x00000002 - -//! R8:G8:B8:A8 -#define NVVIOBUFFERFORMAT_R8G8B8A8 0x00000004 - -//! R8:G8:B8:A8:Z24 -#define NVVIOBUFFERFORMAT_R8G8B8A8Z24 0x00000008 - -//! R16FP:G16FP:B16FP -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FP 0x00000010 - -//! R16FP:G16FP:B16FP:Z24 -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPZ24 0x00000020 - -//! R16FP:G16FP:B16FP:A16FP -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FP 0x00000040 - -//! R16FP:G16FP:B16FP:A16FP:Z24 -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FPZ24 0x00000080 - - - -//! Data format details -typedef struct _NVVIODATAFORMATDETAIL -{ - NVVIODATAFORMAT dataFormat; //!< Data format enumerated value - NvU32 vioCaps; //!< Data format capabilities (NVVIOCAPS_* mask) -}NVVIODATAFORMATDETAIL; - -//! Colorspace conversion -typedef struct _NVVIOCOLORCONVERSION -{ - NvU32 version; //!< Structure version - float colorMatrix[3][3]; //!< Output[n] = - float colorOffset[3]; //!< Input[0] * colorMatrix[n][0] + - float colorScale[3]; //!< Input[1] * colorMatrix[n][1] + - //!< Input[2] * colorMatrix[n][2] + - //!< OutputRange * colorOffset[n] - //!< where OutputRange is the standard magnitude of - //!< Output[n][n] and colorMatrix and colorOffset - //!< values are within the range -1.0 to +1.0 - NvU32 compositeSafe; //!< compositeSafe constrains luminance range when using composite output -} NVVIOCOLORCONVERSION; - -//! macro for constructing the version field of _NVVIOCOLORCONVERSION. -#define NVVIOCOLORCONVERSION_VER MAKE_NVAPI_VERSION(NVVIOCOLORCONVERSION,1) - -//! Gamma correction -typedef struct _NVVIOGAMMACORRECTION -{ - NvU32 version; //!< Structure version - NvU32 vioGammaCorrectionType; //!< Gamma correction type (8-bit or 10-bit) - //! Gamma correction: - union - { - NVVIOGAMMARAMP8 gammaRamp8; //!< Gamma ramp (8-bit index, 16-bit values) - NVVIOGAMMARAMP10 gammaRamp10; //!< Gamma ramp (10-bit index, 16-bit values) - }gammaRamp; - float fGammaValueR; //!< Red Gamma value within gamma ranges. 0.5 - 6.0 - float fGammaValueG; //!< Green Gamma value within gamma ranges. 0.5 - 6.0 - float fGammaValueB; //!< Blue Gamma value within gamma ranges. 0.5 - 6.0 -} NVVIOGAMMACORRECTION; - -//! Macro for constructing thevesion field of _NVVIOGAMMACORRECTION -#define NVVIOGAMMACORRECTION_VER MAKE_NVAPI_VERSION(NVVIOGAMMACORRECTION,1) - -//! Maximum number of ranges per channel -#define MAX_NUM_COMPOSITE_RANGE 2 - - -typedef struct _NVVIOCOMPOSITERANGE -{ - NvU32 uRange; - NvU32 uEnabled; - NvU32 uMin; - NvU32 uMax; -} NVVIOCOMPOSITERANGE; - - - -// Device configuration (fields masks indicating NVVIOCONFIG fields to use for NvAPI_VIO_GetConfig/NvAPI_VIO_SetConfig() ) -// -#define NVVIOCONFIG_SIGNALFORMAT 0x00000001 //!< fields: signalFormat -#define NVVIOCONFIG_DATAFORMAT 0x00000002 //!< fields: dataFormat -#define NVVIOCONFIG_OUTPUTREGION 0x00000004 //!< fields: outputRegion -#define NVVIOCONFIG_OUTPUTAREA 0x00000008 //!< fields: outputArea -#define NVVIOCONFIG_COLORCONVERSION 0x00000010 //!< fields: colorConversion -#define NVVIOCONFIG_GAMMACORRECTION 0x00000020 //!< fields: gammaCorrection -#define NVVIOCONFIG_SYNCSOURCEENABLE 0x00000040 //!< fields: syncSource and syncEnable -#define NVVIOCONFIG_SYNCDELAY 0x00000080 //!< fields: syncDelay -#define NVVIOCONFIG_COMPOSITESYNCTYPE 0x00000100 //!< fields: compositeSyncType -#define NVVIOCONFIG_FRAMELOCKENABLE 0x00000200 //!< fields: EnableFramelock -#define NVVIOCONFIG_422FILTER 0x00000400 //!< fields: bEnable422Filter -#define NVVIOCONFIG_COMPOSITETERMINATE 0x00000800 //!< fields: bCompositeTerminate (Not supported on Quadro FX 4000 SDI) -#define NVVIOCONFIG_DATAINTEGRITYCHECK 0x00001000 //!< fields: bEnableDataIntegrityCheck (Not supported on Quadro FX 4000 SDI) -#define NVVIOCONFIG_CSCOVERRIDE 0x00002000 //!< fields: colorConversion override -#define NVVIOCONFIG_FLIPQUEUELENGTH 0x00004000 //!< fields: flipqueuelength control -#define NVVIOCONFIG_ANCTIMECODEGENERATION 0x00008000 //!< fields: bEnableANCTimeCodeGeneration -#define NVVIOCONFIG_COMPOSITE 0x00010000 //!< fields: bEnableComposite -#define NVVIOCONFIG_ALPHAKEYCOMPOSITE 0x00020000 //!< fields: bEnableAlphaKeyComposite -#define NVVIOCONFIG_COMPOSITE_Y 0x00040000 //!< fields: compRange -#define NVVIOCONFIG_COMPOSITE_CR 0x00080000 //!< fields: compRange -#define NVVIOCONFIG_COMPOSITE_CB 0x00100000 //!< fields: compRange -#define NVVIOCONFIG_FULL_COLOR_RANGE 0x00200000 //!< fields: bEnableFullColorRange -#define NVVIOCONFIG_RGB_DATA 0x00400000 //!< fields: bEnableRGBData -#define NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE 0x00800000 //!< fields: bEnableSDIOutput -#define NVVIOCONFIG_STREAMS 0x01000000 //!< fields: streams -#define NVVIOCONFIG_ANC_PARITY_COMPUTATION 0x02000000 //!< fields: ancParityComputation -#define NVVIOCONFIG_ANC_AUDIO_REPEAT 0x04000000 //!< fields: enableAudioBlanking - - -// Don't forget to update NVVIOCONFIG_VALIDFIELDS in nvapi.spec when NVVIOCONFIG_ALLFIELDS changes. -#define NVVIOCONFIG_ALLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_GAMMACORRECTION | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_FLIPQUEUELENGTH | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_FULL_COLOR_RANGE | \ - NVVIOCONFIG_RGB_DATA | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_STREAMS | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT ) - -#define NVVIOCONFIG_VALIDFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_GAMMACORRECTION | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_FLIPQUEUELENGTH | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_FULL_COLOR_RANGE | \ - NVVIOCONFIG_RGB_DATA | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_STREAMS | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT) - -#define NVVIOCONFIG_DRIVERFIELDS ( NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_FLIPQUEUELENGTH) - -#define NVVIOCONFIG_GAMMAFIELDS ( NVVIOCONFIG_GAMMACORRECTION ) - -#define NVVIOCONFIG_RMCTRLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB) - -#define NVVIOCONFIG_RMSKEWFIELDS ( NVVIOCONFIG_SYNCDELAY ) - -#define NVVIOCONFIG_ALLOWSDIRUNNING_FIELDS ( NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION) - - - #define NVVIOCONFIG_RMMODESET_FIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT) - - -//! Output device configuration -// No members can be deleted from below structure. Only add new members at the -// end of the structure. -typedef struct _NVVIOOUTPUTCONFIG_V1 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flipqueue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Inicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format -} NVVIOOUTPUTCONFIG_V1; - -typedef struct _NVVIOOUTPUTCONFIG_V2 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format - NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off) -} NVVIOOUTPUTCONFIG_V2; - -typedef struct _NVVIOOUTPUTCONFIG_V3 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format - NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off) - NvU32 enableAudioBlanking; //!< Enable HANC audio blanking on repeat frames -} NVVIOOUTPUTCONFIG_V3; - -//! Stream configuration -typedef struct _NVVIOSTREAM -{ - NvU32 bitsPerComponent; //!< Bits per component - NVVIOCOMPONENTSAMPLING sampling; //!< Sampling - NvU32 expansionEnable; //!< Enable/disable 4:2:2->4:4:4 expansion - NvU32 numLinks; //!< Number of active links - struct - { - NvU32 jack; //!< This stream's link[i] will use the specified (0-based) channel within the - NvU32 channel; //!< specified (0-based) jack - } links[NVAPI_MAX_VIO_LINKS_PER_STREAM]; -} NVVIOSTREAM; - -//! Input device configuration -typedef struct _NVVIOINPUTCONFIG -{ - NvU32 numRawCaptureImages; //!< numRawCaptureImages is the number of frames to keep in the capture queue. - //!< must be between NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES and NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES, - NVVIOSIGNALFORMAT signalFormat; //!< Signal format. - //!< Please note that both numRawCaptureImages and signalFormat should be set together. - NvU32 numStreams; //!< Number of active streams. - NVVIOSTREAM streams[NVAPI_MAX_VIO_STREAMS]; //!< Stream configurations - NvU32 bTestMode; //!< This attribute controls the GVI test mode. - //!< Possible values 0/1. When testmode enabled, the - //!< GVI device will generate fake data as quickly as possible. -} NVVIOINPUTCONFIG; - -typedef struct _NVVIOCONFIG_V1 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V1 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V1; - - -typedef struct _NVVIOCONFIG_V2 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V2 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V2; - -typedef struct _NVVIOCONFIG_V3 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V3 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V3; -typedef NVVIOOUTPUTCONFIG_V3 NVVIOOUTPUTCONFIG; -typedef NVVIOCONFIG_V3 NVVIOCONFIG; - -#define NVVIOCONFIG_VER1 MAKE_NVAPI_VERSION(NVVIOCONFIG_V1,1) -#define NVVIOCONFIG_VER2 MAKE_NVAPI_VERSION(NVVIOCONFIG_V2,2) -#define NVVIOCONFIG_VER3 MAKE_NVAPI_VERSION(NVVIOCONFIG_V3,3) -#define NVVIOCONFIG_VER NVVIOCONFIG_VER3 - - -typedef struct -{ - NvPhysicalGpuHandle hPhysicalGpu; //!< Handle to Physical GPU (This could be NULL for GVI device if its not binded) - NvVioHandle hVioHandle; //!Create Stereo Handle->InitActivation->Reset Device -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 302 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] bDelayed Use delayed activation -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup stereoapi -//! @{ - -//! InitActivation Flags -typedef enum _NVAPI_STEREO_INIT_ACTIVATION_FLAGS -{ - NVAPI_STEREO_INIT_ACTIVATION_IMMEDIATE = 0X00, - NVAPI_STEREO_INIT_ACTIVATION_DELAYED = 0x01, -} NVAPI_STEREO_INIT_ACTIVATION_FLAGS; - -NVAPI_INTERFACE NvAPI_Stereo_InitActivation(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_INIT_ACTIVATION_FLAGS flags); - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Trigger_Activation -// -//! DESCRIPTION: This API allows an application to trigger creation of a stereo desktop, -//! in case the creation was stopped on application launch. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 302 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE - Stereo InitActivation not called. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Trigger_Activation(__in StereoHandle hStereoHandle); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_CapturePngImage -// -//! DESCRIPTION: This API captures the current stereo image in PNG stereo format. -//! Only the last capture call per flip will be effective. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! -//! \retval ::NVAPI_OK Image captured. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_CapturePngImage(StereoHandle stereoHandle); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl -// -//! DESCRIPTION: This API turns on/off reverse stereo blit. -//! -//! HOW TO USE: Use after the stereo handle for the device interface is created via successfull call to the appropriate -//! NvAPI_Stereo_CreateHandleFrom() function. -//! After reversed stereo blit control is turned on, blits from the stereo surface will -//! produce the right-eye image in the left side of the destination surface and the left-eye -//! image in the right side of the destination surface. -//! -//! In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used. -//! Conditions: -//! - DstWidth == 2*SrcWidth -//! - DstHeight == SrcHeight -//! - Src surface is the stereo surface. -//! - SrcRect must be {0,0,SrcWidth,SrcHeight} -//! - DstRect must be {0,0,DstWidth,DstHeight} -//! -//! In DirectX 10, ResourceCopyRegion must be used. -//! Conditions: -//! - DstWidth == 2*SrcWidth -//! - DstHeight == SrcHeight -//! - dstX == 0, -//! - dstY == 0, -//! - dstZ == 0, -//! - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1; -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] TurnOn != 0 : Turns on \n -//! == 0 : Turns off -//! -//! -//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_ReverseStereoBlitControl(StereoHandle hStereoHandle, NvU8 TurnOn); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage -// -//! DESCRIPTION: This API is a Setup notification message that the stereo driver uses to notify the application -//! when the user changes the stereo driver state. -//! -//! When the user changes the stereo state (Activated or Deactivated, separation or conversion) -//! the stereo driver posts a defined message with the following parameters: -//! -//! lParam is the current conversion. (Actual conversion is *(float*)&lParam ) -//! -//! wParam == MAKEWPARAM(l, h) where -//! - l == 0 if stereo is deactivated -//! - l == 1 if stereo is deactivated -//! - h is the current separation. (Actual separation is float(h*100.f/0xFFFF) -//! -//! Call this API with NULL hWnd to prohibit notification. -//! -//! WHEN TO USE: Use after the stereo handle for device interface is created via successful call to appropriate -//! NvAPI_Stereo_CreateHandleFrom() function. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] hWnd Window HWND that will be notified when the user changes the stereo driver state. -//! Actual HWND must be cast to an NvU64. -//! \param [in] messageID MessageID of the message that will be posted to hWnd -//! -//! \retval ::NVAPI_OK Notification set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetNotificationMessage(StereoHandle hStereoHandle, NvU64 hWnd,NvU64 messageID); - - - - - - - - - - - - - - - -//! \ingroup stereoapi -#define NVAPI_STEREO_QUADBUFFERED_API_VERSION 0x2 - -//! \ingroup stereoapi - typedef enum _NV_StereoSwapChainMode - { - NVAPI_STEREO_SWAPCHAIN_DEFAULT = 0, - NVAPI_STEREO_SWAPCHAIN_STEREO = 1, - NVAPI_STEREO_SWAPCHAIN_MONO = 2, - } NV_STEREO_SWAPCHAIN_MODE; - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_CreateSwapChain -// -//! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain. -//! -//! NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which -//! additionally notifies the D3D driver of the mode in which stereo mode the swap chain is to be -//! created. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! A pointer to the device that will write 2D images to the swap chain. -//! \param [in] pDesc A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter cannot be NULL. -//! \param [out] ppSwapChain A pointer to the swap chain created. -//! \param [in] mode The stereo mode fot the swap chain. -//! NVAPI_STEREO_SWAPCHAIN_DEFAULT -//! NVAPI_STEREO_SWAPCHAIN_STEREO -//! NVAPI_STEREO_SWAPCHAIN_MONO -//! -//! \retval ::NVAPI_OK The swap chain was created successfully. -//! \retval ::NVAPI_ERROR The operation failed. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_CreateSwapChain(StereoHandle hStereoHandle, - DXGI_SWAP_CHAIN_DESC* pDesc, - IDXGISwapChain** ppSwapChain, - NV_STEREO_SWAPCHAIN_MODE mode); - -#endif //if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - - -#if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_CreateSwapChain -// -//! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain. -//! -//! NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which -//! additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono. -//! -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [in, out] pPresentationParameters A pointer to the swap-chain description (DXGI). This parameter cannot be NULL. -//! \param [out] ppSwapChain A pointer to the swap chain created. -//! \param [in] mode The stereo mode for the swap chain. -//! NVAPI_STEREO_SWAPCHAIN_DEFAULT -//! NVAPI_STEREO_SWAPCHAIN_STEREO -//! NVAPI_STEREO_SWAPCHAIN_MONO -//! -//! \retval ::NVAPI_OK The swap chain creation was successful -//! \retval ::NVAPI_ERROR The operation failed. -//! -//!\ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_CreateSwapChain(StereoHandle hStereoHandle, - D3DPRESENT_PARAMETERS *pPresentationParameters, - IDirect3DSwapChain9 **ppSwapChain, - NV_STEREO_SWAPCHAIN_MODE mode); -#endif //if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain - - - - - -//! \addtogroup drsapi -//! @{ - - -// GPU Profile APIs - -NV_DECLARE_HANDLE(NvDRSSessionHandle); -NV_DECLARE_HANDLE(NvDRSProfileHandle); - -#define NVAPI_DRS_GLOBAL_PROFILE ((NvDRSProfileHandle) -1) - -#define NVAPI_SETTING_MAX_VALUES 100 - -typedef enum _NVDRS_SETTING_TYPE -{ - NVDRS_DWORD_TYPE, - NVDRS_BINARY_TYPE, - NVDRS_STRING_TYPE, - NVDRS_WSTRING_TYPE -} NVDRS_SETTING_TYPE; - -typedef enum _NVDRS_SETTING_LOCATION -{ - NVDRS_CURRENT_PROFILE_LOCATION, - NVDRS_GLOBAL_PROFILE_LOCATION, - NVDRS_BASE_PROFILE_LOCATION, - NVDRS_DEFAULT_PROFILE_LOCATION -} NVDRS_SETTING_LOCATION; - - -typedef struct _NVDRS_GPU_SUPPORT -{ - NvU32 geforce : 1; - NvU32 quadro : 1; - NvU32 nvs : 1; - NvU32 reserved4 : 1; - NvU32 reserved5 : 1; - NvU32 reserved6 : 1; - NvU32 reserved7 : 1; - NvU32 reserved8 : 1; - NvU32 reserved9 : 1; - NvU32 reserved10 : 1; - NvU32 reserved11 : 1; - NvU32 reserved12 : 1; - NvU32 reserved13 : 1; - NvU32 reserved14 : 1; - NvU32 reserved15 : 1; - NvU32 reserved16 : 1; - NvU32 reserved17 : 1; - NvU32 reserved18 : 1; - NvU32 reserved19 : 1; - NvU32 reserved20 : 1; - NvU32 reserved21 : 1; - NvU32 reserved22 : 1; - NvU32 reserved23 : 1; - NvU32 reserved24 : 1; - NvU32 reserved25 : 1; - NvU32 reserved26 : 1; - NvU32 reserved27 : 1; - NvU32 reserved28 : 1; - NvU32 reserved29 : 1; - NvU32 reserved30 : 1; - NvU32 reserved31 : 1; - NvU32 reserved32 : 1; -} NVDRS_GPU_SUPPORT; - -//! Enum to decide on the datatype of setting value. -typedef struct _NVDRS_BINARY_SETTING -{ - NvU32 valueLength; //!< valueLength should always be in number of bytes. - NvU8 valueData[NVAPI_BINARY_DATA_MAX]; -} NVDRS_BINARY_SETTING; - -typedef struct _NVDRS_SETTING_VALUES -{ - NvU32 version; //!< Structure Version - NvU32 numSettingValues; //!< Total number of values available in a setting. - NVDRS_SETTING_TYPE settingType; //!< Type of setting value. - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32DefaultValue; //!< Accessing default DWORD value of this setting. - NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in. - NvAPI_UnicodeString wszDefaultValue; //!< Accessing default unicode string value of this setting. - }; - union //!< Setting values can be of either DWORD, Binary values or String type, - { //!< NOT mixed types. - NvU32 u32Value; //!< All possible DWORD values for a setting - NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting - NvAPI_UnicodeString wszValue; //!< Accessing current unicode string value of this setting. - }settingValues[NVAPI_SETTING_MAX_VALUES]; -} NVDRS_SETTING_VALUES; - -//! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES -#define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1) - -typedef struct _NVDRS_SETTING_V1 -{ - NvU32 version; //!< Structure Version - NvAPI_UnicodeString settingName; //!< String name of setting - NvU32 settingId; //!< 32 bit setting Id - NVDRS_SETTING_TYPE settingType; //!< Type of setting value. - NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from. - NvU32 isCurrentPredefined; //!< It is different than 0 if the currentValue is a predefined Value, - //!< 0 if the currentValue is a user value. - NvU32 isPredefinedValid; //!< It is different than 0 if the PredefinedValue union contains a valid value. - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32PredefinedValue; //!< Accessing default DWORD value of this setting. - NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, - //!< or only valueLength will be filled in. - NvAPI_UnicodeString wszPredefinedValue; //!< Accessing default unicode string value of this setting. - }; - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32CurrentValue; //!< Accessing current DWORD value of this setting. - NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, - //!< or only valueLength will be filled in. - NvAPI_UnicodeString wszCurrentValue; //!< Accessing current unicode string value of this setting. - }; -} NVDRS_SETTING_V1; - -//! Macro for constructing the version field of ::_NVDRS_SETTING -#define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1) - -typedef NVDRS_SETTING_V1 NVDRS_SETTING; -#define NVDRS_SETTING_VER NVDRS_SETTING_VER1 - -typedef struct _NVDRS_APPLICATION_V1 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the application -} NVDRS_APPLICATION_V1; - -typedef struct _NVDRS_APPLICATION_V2 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. -} NVDRS_APPLICATION_V2; - -typedef struct _NVDRS_APPLICATION_V3 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. - NvU32 isMetro:1; //!< Windows 8 style app - NvU32 isCommandLine:1; //!< Command line parsing for the application name - NvU32 reserved:30; //!< Reserved. Should be 0. -} NVDRS_APPLICATION_V3; - -typedef struct _NVDRS_APPLICATION_V4 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. - NvU32 isMetro:1; //!< Windows 8 style app - NvU32 isCommandLine:1; //!< Command line parsing for the application name - NvU32 reserved:30; //!< Reserved. Should be 0. - NvAPI_UnicodeString commandLine; //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1 - //!< this contains application's command line as if it was returned by GetCommandLineW. -} NVDRS_APPLICATION_V4; - -#define NVDRS_APPLICATION_VER_V1 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V1,1) -#define NVDRS_APPLICATION_VER_V2 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V2,2) -#define NVDRS_APPLICATION_VER_V3 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V3,3) -#define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4,4) - -typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION; -#define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4 - -typedef struct _NVDRS_PROFILE_V1 -{ - NvU32 version; //!< Structure Version - NvAPI_UnicodeString profileName; //!< String name of the Profile - NVDRS_GPU_SUPPORT gpuSupport; //!< This read-only flag indicates the profile support on either - //!< Quadro, or Geforce, or both. - NvU32 isPredefined; //!< Is the Profile user-defined, or predefined - NvU32 numOfApps; //!< Total number of applications that belong to this profile. Read-only - NvU32 numOfSettings; //!< Total number of settings applied for this Profile. Read-only -} NVDRS_PROFILE_V1; - -typedef NVDRS_PROFILE_V1 NVDRS_PROFILE; - -//! Macro for constructing the version field of ::NVDRS_PROFILE -#define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1,1) -#define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateSession -// -//! DESCRIPTION: This API allocates memory and initializes the session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] *phSession Return pointer to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR: For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DestroySession -// -//! DESCRIPTION: This API frees the allocation: cleanup of NvDrsSession. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_LoadSettings -// -//! DESCRIPTION: This API loads and parses the settings data. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SaveSettings -// -//! DESCRIPTION: This API saves the settings data to the system. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SaveSettings(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_LoadSettingsFromFile -// -//! DESCRIPTION: This API loads settings from the given file path. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle -//! \param [in] fileName Binary File Name/Path -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_LoadSettingsFromFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SaveSettingsToFile -// -//! DESCRIPTION: This API saves settings to the given file path. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] fileName Binary File Name/Path -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SaveSettingsToFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName); - -//! @} - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateProfile -// -//! DESCRIPTION: This API creates an empty profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] *pProfileInfo Input pointer to NVDRS_PROFILE. -//! \param [in] *phProfile Returns pointer to profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateProfile(NvDRSSessionHandle hSession, NVDRS_PROFILE *pProfileInfo, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteProfile -// -//! DESCRIPTION: This API deletes a profile or sets it back to a predefined value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetCurrentGlobalProfile -// -//! DESCRIPTION: This API sets the current global profile in the driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] wszGlobalProfileName Input current Global profile name. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvAPI_UnicodeString wszGlobalProfileName); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetCurrentGlobalProfile -// -//! DESCRIPTION: This API returns the handle to the current global profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [out] *phProfile Returns current Global profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetProfileInfo -// -//! DESCRIPTION: This API gets information about the given profile. User needs to specify the name of the Profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [out] *pProfileInfo Return the profile info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetProfileInfo -// -//! DESCRIPTION: Specifies flags for a given profile. Currently only the NVDRS_GPU_SUPPORT is -//! used to update the profile. Neither the name, number of settings or applications -//! or other profile information can be changed with this function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pProfileInfo Input the new profile info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_FindProfileByName -// -//! DESCRIPTION: This API finds a profile in the current session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] profileName Input profileName. -//! \param [out] phProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_FindProfileByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString profileName, NvDRSProfileHandle* phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumProfiles -// -//! DESCRIPTION: This API enumerates through all the profiles in the session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] index Input the index for enumeration. -//! \param [out] *phProfile Returns profile handle. -//! -//! RETURN STATUS: NVAPI_OK: SUCCESS if the profile is found -//! NVAPI_ERROR: For miscellaneous errors. -//! NVAPI_END_ENUMERATION: index exceeds the total number of available Profiles in DB. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumProfiles(NvDRSSessionHandle hSession, NvU32 index, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetNumProfiles -// -//! DESCRIPTION: This API obtains the number of profiles in the current session object. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param out] *numProfiles Returns count of profiles in the current hSession. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_API_NOT_INTIALIZED Failed to initialize. -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid Arguments. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetNumProfiles(NvDRSSessionHandle hSession, NvU32 *numProfiles); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateApplication -// -//! DESCRIPTION: This API adds an executable name to a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pApplication Input NVDRS_APPLICATION struct with the executable name to be added. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApplication); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteApplicationEx -// -//! DESCRIPTION: This API removes an executable from a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession - Input to the session handle. -//! \param [in] hProfile - Input profile handle. -//! \param [in] *pApp - Input all the information about the application to be removed. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables, -//! this error will be returned. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteApplicationEx(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApp); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteApplication -// -//! DESCRIPTION: This API removes an executable name from a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSessionPARAMETERS Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] appName Input the executable name to be removed. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables, -//! this error will be returned -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetApplicationInfo -// -//! DESCRIPTION: This API gets information about the given application. The input application name -//! must match exactly what the Profile has stored for the application. -//! This function is better used to retrieve application information from a previous -//! enumeration. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] appName Input application name. -//! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS The application name could not -// single out only one executable. -//! \retval ::NVAPI_EXECUTABLE_NOT_FOUND No application with that name is found on the profile. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetApplicationInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName, NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumApplications -// -//! DESCRIPTION: This API enumerates all the applications in a given profile from the starting index to the maximum length. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] startIndex Indicates starting index for enumeration. -//! \param [in,out] *appCount Input maximum length of the passed in arrays. Returns the actual length. -//! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumApplications(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *appCount, NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_FindApplicationByName -// -//! DESCRIPTION: This API searches the application and the associated profile for the given application name. -//! If a fully qualified path is provided, this function will always return the profile -//! the driver will apply upon running the application (on the path provided). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the hSession handle -//! \param [in] appName Input appName. For best results, provide a fully qualified path of the type -//! c:/Folder1/Folder2/App.exe -//! \param [out] *phProfile Returns profile handle. -//! \param [in,out] *pApplication Returns NVDRS_APPLICATION struct pointer. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below: -//! \retval ::NVAPI_APPLICATION_NOT_FOUND If App not found -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the input appName was not fully qualified, this error might return in the case of multiple matches -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_FindApplicationByName(__in NvDRSSessionHandle hSession, __in NvAPI_UnicodeString appName, __out NvDRSProfileHandle *phProfile, __inout NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetSetting -// -//! DESCRIPTION: This API adds/modifies a setting to a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pSetting Input NVDRS_SETTING struct pointer. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_SETTING *pSetting); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSetting -// -//! DESCRIPTION: This API gets information about the given setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId. -//! \param [out] *pSetting Returns all the setting info -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumSettings -// -//! DESCRIPTION: This API enumerates all the settings of a given profile from startIndex to the maximum length. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] startIndex Indicates starting index for enumeration. -//! \param [in,out] *settingsCount Input max length of the passed in arrays, Returns the actual length. -//! \param [out] *pSetting Returns all the settings info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumSettings(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *settingsCount, NVDRS_SETTING *pSetting); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingIds -// -//! DESCRIPTION: This API enumerates all the Ids of all the settings recognized by NVAPI. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] pSettingIds User-provided array of length *pMaxCount that NVAPI will fill with IDs. -//! \param [in,out] pMaxCount Input max length of the passed in array, Returns the actual length. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! NVAPI_END_ENUMERATION: the provided pMaxCount is not enough to hold all settingIds. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingIds(NvU32 *pSettingIds, NvU32 *pMaxCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingValues -// -//! DESCRIPTION: This API enumerates all available setting values for a given setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingId Input settingId. -//! \param [in,out] pMaxNumValues Input max length of the passed in arrays, Returns the actual length. -//! \param [out] *pSettingValues Returns all available setting values and its count. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingValues(NvU32 settingId, NvU32 *pMaxNumValues, NVDRS_SETTING_VALUES *pSettingValues); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSettingIdFromName -// -//! DESCRIPTION: This API gets the binary ID of a setting given the setting name. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingName Input Unicode settingName. -//! \param [out] *pSettingId Returns corresponding settingId. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSettingIdFromName(NvAPI_UnicodeString settingName, NvU32 *pSettingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSettingNameFromId -// -//! DESCRIPTION: This API gets the setting name given the binary ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingId Input settingId. -//! \param [in] *pSettingName Returns corresponding Unicode settingName. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSettingNameFromId(NvU32 settingId, NvAPI_UnicodeString *pSettingName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteProfileSetting -// -//! DESCRIPTION: This API deletes a setting or sets it back to predefined value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId to be deleted. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteProfileSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreAllDefaults -// -//! DESCRIPTION: This API restores the whole system to predefined(default) values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreAllDefaults(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreProfileDefault -// -//! DESCRIPTION: This API restores the given profile to predefined(default) values. -//! Any and all user specified modifications will be removed. -//! If the whole profile was set by the user, the profile will be removed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_PROFILE_REMOVED SUCCESS, and the hProfile is no longer valid. -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefault(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreProfileDefaultSetting -// -//! DESCRIPTION: This API restores the given profile setting to predefined(default) values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefaultSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetBaseProfile -// -//! DESCRIPTION: Returns the handle to the current global profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] *phProfile Returns Base profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile); - - - - -//! \addtogroup sysgeneral -//! @{ - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< Chipset vendor identification - NvU32 deviceId; //!< Chipset device identification - NvAPI_ShortString szVendorName; //!< Chipset vendor Name - NvAPI_ShortString szChipsetName; //!< Chipset device Name - NvU32 flags; //!< Chipset info flags - obsolete - NvU32 subSysVendorId; //!< Chipset subsystem vendor identification - NvU32 subSysDeviceId; //!< Chipset subsystem device identification - NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name - NvU32 HBvendorId; //!< Host bridge vendor identification - NvU32 HBdeviceId; //!< Host bridge device identification - NvU32 HBsubSysVendorId; //!< Host bridge subsystem vendor identification - NvU32 HBsubSysDeviceId; //!< Host bridge subsystem device identification - -} NV_CHIPSET_INFO_v4; - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< vendor ID - NvU32 deviceId; //!< device ID - NvAPI_ShortString szVendorName; //!< vendor Name - NvAPI_ShortString szChipsetName; //!< device Name - NvU32 flags; //!< Chipset info flags - obsolete - NvU32 subSysVendorId; //!< subsystem vendor ID - NvU32 subSysDeviceId; //!< subsystem device ID - NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name -} NV_CHIPSET_INFO_v3; - -typedef enum -{ - NV_CHIPSET_INFO_HYBRID = 0x00000001, -} NV_CHIPSET_INFO_FLAGS; - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< vendor ID - NvU32 deviceId; //!< device ID - NvAPI_ShortString szVendorName; //!< vendor Name - NvAPI_ShortString szChipsetName; //!< device Name - NvU32 flags; //!< Chipset info flags -} NV_CHIPSET_INFO_v2; - -typedef struct -{ - NvU32 version; //structure version - NvU32 vendorId; //vendor ID - NvU32 deviceId; //device ID - NvAPI_ShortString szVendorName; //vendor Name - NvAPI_ShortString szChipsetName; //device Name -} NV_CHIPSET_INFO_v1; - -#define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1) -#define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2) -#define NV_CHIPSET_INFO_VER_3 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v3,3) -#define NV_CHIPSET_INFO_VER_4 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v4,4) - -#define NV_CHIPSET_INFO NV_CHIPSET_INFO_v4 -#define NV_CHIPSET_INFO_VER NV_CHIPSET_INFO_VER_4 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetChipSetInfo -// -//! This function returns information about the system's chipset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT pChipSetInfo is NULL. -//! \retval NVAPI_OK *pChipSetInfo is now set. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_CHIPSET_INFO version not compatible with driver. -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo); - - -//! \ingroup sysgeneral -//! Lid and dock information - used in NvAPI_GetLidDockInfo() -typedef struct -{ - NvU32 version; //! Structure version, constructed from the macro #NV_LID_DOCK_PARAMS_VER - NvU32 currentLidState; - NvU32 currentDockState; - NvU32 currentLidPolicy; - NvU32 currentDockPolicy; - NvU32 forcedLidMechanismPresent; - NvU32 forcedDockMechanismPresent; -}NV_LID_DOCK_PARAMS; - - -//! ingroup sysgeneral -#define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLidDockInfo -// -//! DESCRIPTION: This function returns the current lid and dock information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 177 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_NOT_SUPPORTED -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock); - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetDisplayIdFromGpuAndOutputId -// -//! DESCRIPTION: This API converts a Physical GPU handle and output ID to a -//! display ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu Handle to the physical GPU -//! \param [in] outputId Connected display output ID on the -//! target GPU - must only have one bit set -//! \param [out] displayId Pointer to an NvU32 which contains -//! the display ID -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDisplayIdFromGpuAndOutputId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NvU32* displayId); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetGpuAndOutputIdFromDisplayId -// -//! DESCRIPTION: This API converts a display ID to a Physical GPU handle and output ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Display ID of display to retrieve -//! GPU and outputId for -//! \param [out] hPhysicalGpu Handle to the physical GPU -//! \param [out] outputId ) Connected display output ID on the -//! target GPU will only have one bit set. -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_ID_OUT_OF_RANGE The DisplayId corresponds to a -//! display which is not within the -//! normal outputId range. -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetGpuAndOutputIdFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu, NvU32 *outputId); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetPhysicalGpuFromDisplayId -// -//! \code -//! DESCRIPTION: This API retrieves the Physical GPU handle of the connected display -//! -//! \since Release: 313 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! PARAMETERS: displayId(IN) - Display ID of display to retrieve -//! GPU handle -//! hPhysicalGpu(OUT) - Handle to the physical GPU -//! -//! RETURN STATUS: -//! NVAPI_OK - completed request -//! NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! NVAPI_ERROR - miscellaneous error occurred -//! NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! \endcode -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetPhysicalGpuFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu); - -typedef struct _NV_DISPLAY_DRIVER_INFO -{ - NvU32 version; //!< Structure Version. - NvU32 driverVersion; //!< Contains the driver version after successful return. - NvAPI_ShortString szBuildBranch; //!< Contains the driver-branch string after successful return. - NvU32 bIsDCHDriver : 1; //!< Contains the driver DCH status after successful return. - //!< Value of 1 means that this is DCH driver. - //!< Value of 0 means that this is not a DCH driver (NVAPI may be unable to query the DCH status of the driver due to some registry API errors, in that case the API will return with NVAPI_ERROR) - NvU32 bIsNVIDIAStudioPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Studio Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Studio Driver package. - NvU32 bIsNVIDIAGameReadyPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Game Ready Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Game Ready Driver package. - NvU32 bIsNVIDIARTXProductionBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX Enterprise Production Branch which offers ISV certifications, long life-cycle support, regular security updates, and access to the same functionality as corresponding NVIDIA Studio Driver Packages (i.e., of the same driver version number). - //!< Value of 1 means that this driver is from the NVIDIA RTX Enterprise Production Branch package. - NvU32 bIsNVIDIARTXNewFeatureBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX New Feature Branch. - //!< This driver typically gives access to new features, bug fixes, new operating system support, and other driver enhancements offered between NVIDIA RTX Enterprise Production Branch releases. Support duration for NVIDIA RTX New Feature Branches is shorter than that for NVIDIA RTX Enterprise Production Branches. - //!< Value of 1 means that this driver is from the NVIDIA RTX New Feature Branch package. - NvU32 reserved : 27; //!< Reserved for future use. -} NV_DISPLAY_DRIVER_INFO_V1; - -typedef struct _NV_DISPLAY_DRIVER_INFO_V2 -{ - NvU32 version; //!< Structure Version. - NvU32 driverVersion; //!< Contains the driver version after successful return. - NvAPI_ShortString szBuildBranch; //!< Contains the driver-branch string after successful return. - NvU32 bIsDCHDriver : 1; //!< Contains the driver DCH status after successful return. - //!< Value of 1 means that this is DCH driver. - //!< Value of 0 means that this is not a DCH driver (NVAPI may be unable to query the DCH status of the driver due to some registry API errors, in that case the API will return with NVAPI_ERROR) - NvU32 bIsNVIDIAStudioPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Studio Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Studio Driver package. - NvU32 bIsNVIDIAGameReadyPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Game Ready Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Game Ready Driver package. - NvU32 bIsNVIDIARTXProductionBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX Enterprise Production Branch which offers ISV certifications, long life-cycle support, regular security updates, and access to the same functionality as corresponding NVIDIA Studio Driver Packages (i.e., of the same driver version number). - //!< Value of 1 means that this driver is from the NVIDIA RTX Enterprise Production Branch package. - NvU32 bIsNVIDIARTXNewFeatureBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX New Feature Branch. - //!< This driver typically gives access to new features, bug fixes, new operating system support, and other driver enhancements offered between NVIDIA RTX Enterprise Production Branch releases. Support duration for NVIDIA RTX New Feature Branches is shorter than that for NVIDIA RTX Enterprise Production Branches. - //!< Value of 1 means that this driver is from the NVIDIA RTX New Feature Branch package. - NvU32 reserved : 27; //!< Reserved for future use. - NvAPI_ShortString szBuildBaseBranch; //!< (OUT) Contains the driver base branch string after successful return. - NvU32 reservedEx; //!< Reserved for future use -} NV_DISPLAY_DRIVER_INFO_V2; - -#define NV_DISPLAY_DRIVER_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_INFO_V1, 1) -#define NV_DISPLAY_DRIVER_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_INFO_V2, 2) -typedef NV_DISPLAY_DRIVER_INFO_V2 NV_DISPLAY_DRIVER_INFO; -#define NV_DISPLAY_DRIVER_INFO_VER NV_DISPLAY_DRIVER_INFO_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetDisplayDriverInfo -// -//! DESCRIPTION: This API will return information related to the NVIDIA Display Driver. -//! Note that out of the driver types - Studio, Game Ready, RTX Production Branch, RTX New Feature Branch - only one driver type can be available in system. -//! If NVAPI is unable to get the information of particular driver type, we report all flags as 0 (Unknown). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 396 -//! -//! \param [inout] pDriverInfo - This structure will be filled with required information. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDisplayDriverInfo(__inout NV_DISPLAY_DRIVER_INFO *pDriverInfo); - - -typedef struct _NV_PHYSICAL_GPU_HANDLE_DATA -{ - NvPhysicalGpuHandle hPhysicalGpu; // 1399) && !defined(NVAPI_INTERNAL) && !defined(NVAPI_DEPRECATED_OLD) -#ifndef __nvapi_deprecated_function -#define __nvapi_deprecated_function(message) __declspec(deprecated(message)) -#endif -#ifndef __nvapi_deprecated_datatype -#define __nvapi_deprecated_datatype(FirstRelease) __declspec(deprecated("Do not use this data type - it is deprecated in release " #FirstRelease ".")) -#endif -#else -#ifndef __nvapi_deprecated_function -#define __nvapi_deprecated_function(message) -#endif -#ifndef __nvapi_deprecated_datatype -#define __nvapi_deprecated_datatype(FirstRelease) -#endif -#endif - - -/* 64-bit types for compilers that support them, plus some obsolete variants */ -#if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64) -typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */ -typedef long long NvS64; /* -9223372036854775808 to 9223372036854775807 */ -#else -typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */ -typedef __int64 NvS64; /* -9223372036854775808 to 9223372036854775807 */ -#endif - -#if NVAPI_USE_STDINT -typedef uint32_t NvV32; /* "void": enumerated or multiple fields */ -typedef uint32_t NvU32; /* 0 to 4294967295 */ -typedef int32_t NvS32; /* -2147483648 to 2147483647 */ - -#else -// mac os 32-bit still needs this -#if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__) -typedef signed long NvS32; /* -2147483648 to 2147483647 */ -#else -typedef signed int NvS32; /* -2147483648 to 2147483647 */ -#endif - -#if !(NVOS_IS_UNIX || (defined(__unix))) -// mac os 32-bit still needs this -#if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \ - (!defined(macintosh) && defined(__NVAPI_RESERVED0__)) ) -typedef unsigned int NvU32; /* 0 to 4294967295 */ -#else -typedef unsigned long NvU32; /* 0 to 4294967295 */ -#endif -#else -typedef unsigned int NvU32; /* 0 to 4294967295 */ -#endif -#endif - -typedef unsigned long temp_NvU32; /* 0 to 4294967295 */ -typedef signed short NvS16; -typedef unsigned short NvU16; -typedef unsigned char NvU8; -typedef signed char NvS8; -typedef float NvF32; -typedef double NvF64; - -/*! - * Macro to convert NvU32 to NvF32. - */ -#define NvU32TONvF32(_pData) *(NvF32 *)(_pData) -/*! - * Macro to convert NvF32 to NvU32. - */ -#define NvF32TONvU32(_pData) *(NvU32 *)(_pData) - -/* Boolean type */ -typedef NvU8 NvBool; -#define NV_TRUE ((NvBool)(0 == 0)) -#define NV_FALSE ((NvBool)(0 != 0)) - -typedef struct _NV_RECT -{ - NvU32 left; - NvU32 top; - NvU32 right; - NvU32 bottom; -} NV_RECT; - - -#define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name - -//! \addtogroup nvapihandles -//! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI -//! These are meant to be opaque types. Do not assume they correspond to indices, HDCs, -//! display indexes or anything else. -//! -//! Most handles remain valid until a display re-configuration (display mode set) or GPU -//! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED -//! is received by an app, it should discard all handles, and re-enumerate them. -//! @{ -NV_DECLARE_HANDLE(NvLogicalGpuHandle); //!< One or more physical GPUs acting in concert (SLI) -NV_DECLARE_HANDLE(NvPhysicalGpuHandle); //!< A single physical GPU -NV_DECLARE_HANDLE(NvDisplayHandle); //!< Display Device driven by NVIDIA GPU(s) (an attached display) -NV_DECLARE_HANDLE(NvMonitorHandle); //!< Monitor handle -NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); //!< Unattached Display Device driven by NVIDIA GPU(s) -NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); //!< A handle to a Visual Computing Device -NV_DECLARE_HANDLE(NvEventHandle); //!< A handle to an event registration instance - - -NV_DECLARE_HANDLE(NvHICHandle); //!< A handle to a Host Interface Card -NV_DECLARE_HANDLE(NvGSyncDeviceHandle); //!< A handle to a Sync device -NV_DECLARE_HANDLE(NvVioHandle); //!< A handle to an SDI device -NV_DECLARE_HANDLE(NvTransitionHandle); //!< A handle to address a single transition request -NV_DECLARE_HANDLE(NvAudioHandle); //!< NVIDIA HD Audio Device -NV_DECLARE_HANDLE(Nv3DVPContextHandle); //!< A handle for a 3D Vision Pro (3DVP) context -NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); //!< A handle for a 3DVP RF transceiver -NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); //!< A handle for a pair of 3DVP RF shutter glasses -NV_DECLARE_HANDLE(NvPcfClientHandle); //!< A handle for NVPCF clients - -typedef void* StereoHandle; //!< A stereo handle, that corresponds to the device interface - -NV_DECLARE_HANDLE(NvSourceHandle); //!< Unique source handle on the system -NV_DECLARE_HANDLE(NvTargetHandle); //!< Unique target handle on the system -NV_DECLARE_HANDLE(NVDX_SwapChainHandle); //!< DirectX SwapChain objects -static const NVDX_SwapChainHandle NVDX_SWAPCHAIN_NONE = 0; -NV_DECLARE_HANDLE(NvPresentBarrierClientHandle); //!< PresentBarrier client object -//! @} - -//! \ingroup nvapihandles -//! @{ -#define NVAPI_DEFAULT_HANDLE 0 -#define NV_BIT(x) (1 << (x)) -//! @} - - - -//! \addtogroup nvapitypes -//! @{ -#define NVAPI_GENERIC_STRING_MAX 4096 -#define NVAPI_LONG_STRING_MAX 256 -#define NVAPI_SHORT_STRING_MAX 64 - -typedef struct -{ - NvS32 sX; - NvS32 sY; - NvS32 sWidth; - NvS32 sHeight; -} NvSBox; - -#ifndef NvGUID_Defined -#define NvGUID_Defined - -typedef struct -{ - NvU32 data1; - NvU16 data2; - NvU16 data3; - NvU8 data4[8]; -} NvGUID, NvLUID; - - -#endif //#ifndef NvGUID_Defined -#define NVAPI_MAX_PHYSICAL_GPUS 64 - - -#define NVAPI_MAX_PHYSICAL_BRIDGES 100 -#define NVAPI_PHYSICAL_GPUS 32 -#define NVAPI_MAX_LOGICAL_GPUS 64 -#define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256 -#define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256 -#define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS -#define NVAPI_MAX_GPU_PER_TOPOLOGY 8 -#define NVAPI_MAX_DISPLAY_HEADS 2 -#define NVAPI_ADVANCED_DISPLAY_HEADS 4 -#define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS -#define NVAPI_MAX_ACPI_IDS 16 -#define NVAPI_MAX_VIEW_MODES 8 - - -#define NVAPI_SYSTEM_MAX_HWBCS 128 -#define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff - -#define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS -#define NV_MAX_HEADS 4 //!< Maximum heads, each with NVAPI_DESKTOP_RES resolution -#define NVAPI_MAX_HEADS_PER_GPU 32 -#define NV_MAX_VID_STREAMS 4 //!< Maximum number of input video streams, each with a #NVAPI_VIDEO_SRC_INFO -#define NV_MAX_VID_STREAMS_EX 20 //!< Increasing MAX no. of input video streams, each with a #NVAPI_VIDEO_SRC_INFO -#define NV_MAX_VID_PROFILES 4 //!< Maximum number of output video profiles supported - -#define NVAPI_MAX_AUDIO_DEVICES 16 - - -typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX]; -typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX]; -typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX]; -typedef NvU16 NvAPI_UnicodeShortString[NVAPI_SHORT_STRING_MAX]; -//! @} - - -// ========================================================================================= -//! NvAPI Version Definition \n -//! Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro. \n -//! Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1) -//! \ingroup nvapitypes -// ========================================================================================= -#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16)) - -//! \ingroup nvapitypes -#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16) - -//! \ingroup nvapitypes -#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff) - - -// ==================================================== -//! NvAPI Status Values -//! All NvAPI functions return one of these codes. -//! \ingroup nvapistatus -// ==================================================== - - -typedef enum _NvAPI_Status -{ - NVAPI_OK = 0, //!< Success. Request is completed. - NVAPI_ERROR = -1, //!< Generic error - NVAPI_LIBRARY_NOT_FOUND = -2, //!< NVAPI support library cannot be loaded. - NVAPI_NO_IMPLEMENTATION = -3, //!< not implemented in current driver installation - NVAPI_API_NOT_INITIALIZED = -4, //!< NvAPI_Initialize has not been called (successfully) - NVAPI_INVALID_ARGUMENT = -5, //!< The argument/parameter value is not valid or NULL. - NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, //!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found. - NVAPI_END_ENUMERATION = -7, //!< No more items to enumerate - NVAPI_INVALID_HANDLE = -8, //!< Invalid handle - NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, //!< An argument's structure version is not supported - NVAPI_HANDLE_INVALIDATED = -10, //!< The handle is no longer valid (likely due to GPU or display re-configuration) - NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, //!< No NVIDIA OpenGL context is current (but needs to be) - NVAPI_INVALID_POINTER = -14, //!< An invalid pointer, usually NULL, was passed as a parameter - NVAPI_NO_GL_EXPERT = -12, //!< OpenGL Expert is not supported by the current drivers - NVAPI_INSTRUMENTATION_DISABLED = -13, //!< OpenGL Expert is supported, but driver instrumentation is currently disabled - NVAPI_NO_GL_NSIGHT = -15, //!< OpenGL does not support Nsight - - NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, //!< Expected a logical GPU handle for one or more parameters - NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, //!< Expected a physical GPU handle for one or more parameters - NVAPI_EXPECTED_DISPLAY_HANDLE = -102, //!< Expected an NV display handle for one or more parameters - NVAPI_INVALID_COMBINATION = -103, //!< The combination of parameters is not valid. - NVAPI_NOT_SUPPORTED = -104, //!< Requested feature is not supported in the selected GPU - NVAPI_PORTID_NOT_FOUND = -105, //!< No port ID was found for the I2C transaction - NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, //!< Expected an unattached display handle as one of the input parameters. - NVAPI_INVALID_PERF_LEVEL = -107, //!< Invalid perf level - NVAPI_DEVICE_BUSY = -108, //!< Device is busy; request not fulfilled - NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, //!< NV persist file is not found - NVAPI_PERSIST_DATA_NOT_FOUND = -110, //!< NV persist data is not found - NVAPI_EXPECTED_TV_DISPLAY = -111, //!< Expected a TV output display - NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, //!< Expected a TV output on the D Connector - HDTV_EIAJ4120. - NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, //!< SLI is not active on this device. - NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, //!< Setup of SLI rendering mode is not possible right now. - NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, //!< Expected a digital flat panel. - NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, //!< Argument exceeds the expected size. - NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, //!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active. - NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, //!< Testing of clocks is not supported. - NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, //!< The specified underscan config is from an unknown source (e.g. INF) - NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, //!< Timeout while reconfiguring GPUs - NVAPI_DATA_NOT_FOUND = -121, //!< Requested data was not found - NVAPI_EXPECTED_ANALOG_DISPLAY = -122, //!< Expected an analog display - NVAPI_NO_VIDLINK = -123, //!< No SLI video bridge is present - NVAPI_REQUIRES_REBOOT = -124, //!< NVAPI requires a reboot for the settings to take effect - NVAPI_INVALID_HYBRID_MODE = -125, //!< The function is not supported with the current Hybrid mode. - NVAPI_MIXED_TARGET_TYPES = -126, //!< The target types are not all the same - NVAPI_SYSWOW64_NOT_SUPPORTED = -127, //!< The function is not supported from 32-bit on a 64-bit system. - NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology. - NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //!< Prompt the user to close all non-migratable applications. - NVAPI_OUT_OF_MEMORY = -130, //!< Could not allocate sufficient memory to complete the call. - NVAPI_WAS_STILL_DRAWING = -131, //!< The previous operation that is transferring information to or from this surface is incomplete. - NVAPI_FILE_NOT_FOUND = -132, //!< The file was not found. - NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, //!< There are too many unique instances of a particular type of state object. - NVAPI_INVALID_CALL = -134, //!< The method call is invalid. For example, a method's parameter may not be a valid pointer. - NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, //!< d3d10_1.dll cannot be loaded. - NVAPI_FUNCTION_NOT_FOUND = -136, //!< Couldn't find the function in the loaded DLL. - NVAPI_INVALID_USER_PRIVILEGE = -137, //!< The application will require Administrator privileges to access this API. - //!< The application can be elevated to a higher permission level by selecting "Run as Administrator". - NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, //!< The handle corresponds to GDIPrimary. - NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, //!< Setting Physx GPU requires that the GPU is compute-capable. - NVAPI_STEREO_NOT_INITIALIZED = -140, //!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed. - NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, //!< Access to stereo-related registry keys or values has failed. - NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, //!< The given registry profile type is not supported. - NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, //!< The given registry value is not supported. - NVAPI_STEREO_NOT_ENABLED = -144, //!< Stereo is not enabled and the function needed it to execute completely. - NVAPI_STEREO_NOT_TURNED_ON = -145, //!< Stereo is not turned on and the function needed it to execute completely. - NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, //!< Invalid device interface. - NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, //!< Separation percentage or JPEG image capture quality is out of [0-100] range. - NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, //!< The given frustum adjust mode is not supported. - NVAPI_TOPO_NOT_POSSIBLE = -149, //!< The mosaic topology is not possible given the current state of the hardware. - NVAPI_MODE_CHANGE_FAILED = -150, //!< An attempt to do a display resolution mode change has failed. - NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, //!< d3d11.dll/d3d11_beta.dll cannot be loaded. - NVAPI_INVALID_ADDRESS = -152, //!< Address is outside of valid range. - NVAPI_STRING_TOO_SMALL = -153, //!< The pre-allocated string is too small to hold the result. - NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, //!< The input does not match any of the available devices. - NVAPI_DRIVER_RUNNING = -155, //!< Driver is running. - NVAPI_DRIVER_NOTRUNNING = -156, //!< Driver is not running. - NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, //!< A driver reload is required to apply these settings. - NVAPI_SET_NOT_ALLOWED = -158, //!< Intended setting is not allowed. - NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, //!< Information can't be returned due to "advanced display topology". - NVAPI_SETTING_NOT_FOUND = -160, //!< Setting is not found. - NVAPI_SETTING_SIZE_TOO_LARGE = -161, //!< Setting size is too large. - NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, //!< There are too many settings for a profile. - NVAPI_PROFILE_NOT_FOUND = -163, //!< Profile is not found. - NVAPI_PROFILE_NAME_IN_USE = -164, //!< Profile name is duplicated. - NVAPI_PROFILE_NAME_EMPTY = -165, //!< Profile name is empty. - NVAPI_EXECUTABLE_NOT_FOUND = -166, //!< Application not found in the Profile. - NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, //!< Application already exists in the other profile. - NVAPI_DATATYPE_MISMATCH = -168, //!< Data Type mismatch - NVAPI_PROFILE_REMOVED = -169, //!< The profile passed as parameter has been removed and is no longer valid. - NVAPI_UNREGISTERED_RESOURCE = -170, //!< An unregistered resource was passed as a parameter. - NVAPI_ID_OUT_OF_RANGE = -171, //!< The DisplayId corresponds to a display which is not within the normal outputId range. - NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, //!< Display topology is not valid so the driver cannot do a mode set on this configuration. - NVAPI_DPMST_CHANGED = -173, //!< Display Port Multi-Stream topology has been changed. - NVAPI_INSUFFICIENT_BUFFER = -174, //!< Input buffer is insufficient to hold the contents. - NVAPI_ACCESS_DENIED = -175, //!< No access to the caller. - NVAPI_MOSAIC_NOT_ACTIVE = -176, //!< The requested action cannot be performed without Mosaic being enabled. - NVAPI_SHARE_RESOURCE_RELOCATED = -177, //!< The surface is relocated away from video memory. - NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, //!< The user should disable DWM before calling NvAPI. - NVAPI_D3D_DEVICE_LOST = -179, //!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device. - NVAPI_INVALID_CONFIGURATION = -180, //!< The requested action cannot be performed in the current state. - NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, //!< Call failed as stereo handshake not completed. - NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, //!< The path provided was too short to determine the correct NVDRS_APPLICATION - NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, //!< Default stereo profile is not currently defined - NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, //!< Default stereo profile does not exist - NVAPI_CLUSTER_ALREADY_EXISTS = -185, //!< A cluster is already defined with the given configuration. - NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, //!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology - NVAPI_INVALID_DISPLAY_ID = -187, //!< The input display id is not valid or the monitor associated to it does not support the current operation - NVAPI_STREAM_IS_OUT_OF_SYNC = -188, //!< While playing secure audio stream, stream goes out of sync - NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, //!< Older audio driver version than required - NVAPI_VALUE_ALREADY_SET = -190, //!< Value already set, setting again not allowed. - NVAPI_TIMEOUT = -191, //!< Requested operation timed out - NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, //!< The requested workstation feature set has incomplete driver internal allocation resources - NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, //!< Call failed because InitActivation was not called. - NVAPI_SYNC_NOT_ACTIVE = -194, //!< The requested action cannot be performed without Sync being enabled. - NVAPI_SYNC_MASTER_NOT_FOUND = -195, //!< The requested action cannot be performed without Sync Master being enabled. - NVAPI_INVALID_SYNC_TOPOLOGY = -196, //!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer. - NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, //!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value. - NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, //!< The encrypted public key verification has failed. - NVAPI_FIRMWARE_OUT_OF_DATE = -199, //!< The device's firmware is out of date. - NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED = -200, //!< The device's firmware is not supported. - NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED = -201, //!< The caller is not authorized to modify the License. - NVAPI_D3D_DEVICE_NOT_REGISTERED = -202, //!< The user tried to use a deferred context without registering the device first - NVAPI_RESOURCE_NOT_ACQUIRED = -203, //!< Head or SourceId was not reserved for the VR Display before doing the Modeset or the dedicated display. - NVAPI_TIMING_NOT_SUPPORTED = -204, //!< Provided timing is not supported. - NVAPI_HDCP_ENCRYPTION_FAILED = -205, //!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable. - NVAPI_PCLK_LIMITATION_FAILED = -206, //!< Provided mode is over sink device pclk limitation. - NVAPI_NO_CONNECTOR_FOUND = -207, //!< No connector on GPU found. - NVAPI_HDCP_DISABLED = -208, //!< When a non-HDCP capable HMD is connected, we would inform user by this code. - NVAPI_API_IN_USE = -209, //!< Atleast an API is still being called - NVAPI_NVIDIA_DISPLAY_NOT_FOUND = -210, //!< No display found on Nvidia GPU(s). - NVAPI_PRIV_SEC_VIOLATION = -211, //!< Priv security violation, improper access to a secured register. - NVAPI_INCORRECT_VENDOR = -212, //!< NVAPI cannot be called by this vendor - NVAPI_DISPLAY_IN_USE = -213, //!< DirectMode Display is already in use - NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD = -214, //!< The Config is having Non-NVidia GPU with Non-HDCP HMD connected - NVAPI_MAX_DISPLAY_LIMIT_REACHED = -215, //!< GPU's Max Display Limit has Reached - NVAPI_INVALID_DIRECT_MODE_DISPLAY = -216, //!< DirectMode not Enabled on the Display - NVAPI_GPU_IN_DEBUG_MODE = -217, //!< GPU is in debug mode, OC is NOT allowed. - NVAPI_D3D_CONTEXT_NOT_FOUND = -218, //!< No NvAPI context was found for this D3D object - NVAPI_STEREO_VERSION_MISMATCH = -219, //!< there is version mismatch between stereo driver and dx driver - NVAPI_GPU_NOT_POWERED = -220, //!< GPU is not powered and so the request cannot be completed. - NVAPI_ERROR_DRIVER_RELOAD_IN_PROGRESS = -221, //!< The display driver update in progress. - NVAPI_WAIT_FOR_HW_RESOURCE = -222, //!< Wait for HW resources allocation - NVAPI_REQUIRE_FURTHER_HDCP_ACTION = -223, //!< operation requires further HDCP action - NVAPI_DISPLAY_MUX_TRANSITION_FAILED = -224, //!< Dynamic Mux transition failure - NVAPI_INVALID_DSC_VERSION = -225, //!< Invalid DSC version - NVAPI_INVALID_DSC_SLICECOUNT = -226, //!< Invalid DSC slice count - NVAPI_INVALID_DSC_OUTPUT_BPP = -227, //!< Invalid DSC output BPP - NVAPI_FAILED_TO_LOAD_FROM_DRIVER_STORE = -228, //!< There was an error while loading nvapi.dll from the driver store. - NVAPI_NO_VULKAN = -229, //!< OpenGL does not export Vulkan fake extensions - NVAPI_REQUEST_PENDING = -230, //!< A request for NvTOPPs telemetry CData has already been made and is pending a response. - NVAPI_RESOURCE_IN_USE = -231, //!< Operation cannot be performed because the resource is in use. - NVAPI_INVALID_IMAGE = -232, //!< Device kernel image is invalid - NVAPI_INVALID_PTX = -233, //!< PTX JIT compilation failed - NVAPI_NVLINK_UNCORRECTABLE = -234, //!< Uncorrectable NVLink error was detected during the execution - NVAPI_JIT_COMPILER_NOT_FOUND = -235, //!< PTX JIT compiler library was not found. - NVAPI_INVALID_SOURCE = -236, //!< Device kernel source is invalid. - NVAPI_ILLEGAL_INSTRUCTION = -237, //!< While executing a kernel, the device encountered an illegal instruction. - NVAPI_INVALID_PC = -238, //!< While executing a kernel, the device program counter wrapped its address space - NVAPI_LAUNCH_FAILED = -239, //!< An exception occurred on the device while executing a kernel - NVAPI_NOT_PERMITTED = -240, //!< Attempted operation is not permitted. - NVAPI_CALLBACK_ALREADY_REGISTERED = -241, //!< The callback function has already been registered. - NVAPI_CALLBACK_NOT_FOUND = -242, //!< The callback function is not found or not registered. - NVAPI_INVALID_OUTPUT_WIRE_FORMAT = -243, //!< Invalid Wire Format for the VR HMD -} NvAPI_Status; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion -// -//! DESCRIPTION: This API returns display driver version and driver-branch string. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] pDriverVersion Contains the driver version after successful return. -//! \param [out] szBuildBranchString Contains the driver-branch string after successful return. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString); -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - -} NV_DISPLAY_DRIVER_MEMORY_INFO_V1; - - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces. - -} NV_DISPLAY_DRIVER_MEMORY_INFO_V2; - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces. - NvU32 dedicatedVideoMemoryEvictionsSize; //!< Size(in kb) of the total size of memory released as a result of the evictions. - NvU32 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU - //!< video memory to make room for other allocations. -} NV_DISPLAY_DRIVER_MEMORY_INFO_V3; - -//! \ingroup driverapi -typedef NV_DISPLAY_DRIVER_MEMORY_INFO_V3 NV_DISPLAY_DRIVER_MEMORY_INFO; - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V1 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V1,1) - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V2 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V2,2) - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V3 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3,3) - -//! \ingroup driverapi -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetMemoryInfo -// -//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU. -//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_DISPLAY_DRIVER_MEMORY_INFO). -//! -//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 177 -//! -//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted. -//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_DISPLAY_DRIVER_MEMORY_INFO. -//! -//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_DISPLAY_DRIVER_MEMORY_INFO structure version mismatch. -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.") -NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_DISPLAY_DRIVER_MEMORY_INFO *pMemoryInfo); - - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfoEx(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU64 dedicatedVideoMemory; //!< Size(in bytes) of the physical framebuffer. Refers to the dedicated video memory on discrete GPUs. - //! It is more performant for GPU operations than the reserved systemVideoMemory. - NvU64 availableDedicatedVideoMemory; //!< Size(in bytes) of the available physical framebuffer for allocating video memory surfaces. - NvU64 systemVideoMemory; //!< Size(in bytes) of system memory the driver allocates at load time. It is a substitute for dedicated video memory. - //!< Typically used with integrated GPUs that do not have dedicated video memory. - NvU64 sharedSystemMemory; //!< Size(in bytes) of shared system memory that driver is allowed to commit for surfaces across all allocations. - //!< On discrete GPUs, it is used to utilize system memory for various operations. It does not need to be reserved during boot. - //!< It may be used by both GPU and CPU, and has an on-demand type of usage. - NvU64 curAvailableDedicatedVideoMemory; //!< Size(in bytes) of the current available physical framebuffer for allocating video memory surfaces. - NvU64 dedicatedVideoMemoryEvictionsSize; //!< Size(in bytes) of the total size of memory released as a result of the evictions. - NvU64 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU - //!< video memory to make room for other allocations. - NvU64 dedicatedVideoMemoryPromotionsSize; //!< Size(in bytes) of the total size of memory allocated as a result of the promotions. - NvU64 dedicatedVideoMemoryPromotionCount; //!< Indicates the number of promotion events that caused an allocation to be promoted to dedicated video memory -} NV_GPU_MEMORY_INFO_EX_V1; - -//! \ingroup driverapi -typedef NV_GPU_MEMORY_INFO_EX_V1 NV_GPU_MEMORY_INFO_EX; - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_GPU_MEMORY_INFO_EX_V1 -#define NV_GPU_MEMORY_INFO_EX_VER_1 MAKE_NVAPI_VERSION(NV_GPU_MEMORY_INFO_EX_V1,1) - -//! \ingroup driverapi -#define NV_GPU_MEMORY_INFO_EX_VER NV_GPU_MEMORY_INFO_EX_VER_1 - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetMemoryInfoEx -// -//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU. -//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_GPU_MEMORY_INFO_EX). -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! MCDM_SUPPORTED -//! -//! \since Release: 520 -//! -//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted. -//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_GPU_MEMORY_INFO_EX. -//! -//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_GPU_MEMORY_INFO_EX structure version mismatch. -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_MEMORY_INFO_EX *pMemoryInfo); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumPhysicalGPUs -// -//! This function returns an array of physical GPU handles. -//! Each handle represents a physical GPU present in the system. -//! That GPU may be part of an SLI configuration, or may not be visible to the OS directly. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! \note In drivers older than 105.00, all physical GPU handles get invalidated on a -//! modeset. So the calling applications need to renum the handles after every modeset.\n -//! With drivers 105.00 and up, all physical GPU handles are constant. -//! Physical GPU handles are constant as long as the GPUs are not physically moved and -//! the SBIOS VGA order is unchanged. -//! -//! For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs() -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \par Introduced in -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -NV_DECLARE_HANDLE(NVDX_ObjectHandle); // DX Objects -static const NVDX_ObjectHandle NVDX_OBJECT_NONE = 0; - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetObjectHandleForResource -// -//! DESCRIPTION: This API gets a handle to a resource. -//! -//! \param [in] pDev The ID3D11Device, ID3D10Device or IDirect3DDevice9 or ID3D11DeviceContext to use -//! \param [in] pResource The ID3D11Resource, ID3D10Resource or IDirect3DResource9 from which -//! we want the NvAPI handle -//! \param [out] pHandle A handle to the resource -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \return ::NVAPI_OK if the handle was populated. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetObjectHandleForResource( - IUnknown *pDevice, - IUnknown *pResource, - NVDX_ObjectHandle *pHandle); - - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#include"nvapi_lite_salend.h" -#ifdef __cplusplus -} -#endif -#pragma pack(pop) diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_d3dext.h b/参考/NexBox-main/R560-developer/nvapi_lite_d3dext.h deleted file mode 100644 index bf5d8a6..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_d3dext.h +++ /dev/null @@ -1,191 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ -#pragma once -#include"nvapi_lite_salstart.h" -#include"nvapi_lite_common.h" -#pragma pack(push,8) -#ifdef __cplusplus -extern "C" { -#endif -#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -//! \ingroup dx -//! D3D_FEATURE_LEVEL supported - used in NvAPI_D3D11_CreateDevice() and NvAPI_D3D11_CreateDeviceAndSwapChain() -typedef enum -{ - NVAPI_DEVICE_FEATURE_LEVEL_NULL = -1, - NVAPI_DEVICE_FEATURE_LEVEL_10_0 = 0, - NVAPI_DEVICE_FEATURE_LEVEL_10_0_PLUS = 1, - NVAPI_DEVICE_FEATURE_LEVEL_10_1 = 2, - NVAPI_DEVICE_FEATURE_LEVEL_11_0 = 3, -} NVAPI_DEVICE_FEATURE_LEVEL; - -#endif //defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDevice -// -//! DESCRIPTION: This function tries to create a DirectX 11 device. If the call fails (if we are running -//! on pre-DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR DirectX 10.0+ -//! OR DirectX 10.0 device. The function call is the same as D3D11CreateDevice(), but with an extra -//! argument (D3D_FEATURE_LEVEL supported by the device) that the function fills in. This argument -//! can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel is less than DirecX 10.0. -//! -//! NOTE: When NvAPI_D3D11_CreateDevice is called with 10+ feature level we have an issue on few set of -//! tesla hardware (G80/G84/G86/G92/G94/G96) which does not support all feature level 10+ functionality -//! e.g. calling driver with mismatch between RenderTarget and Depth Buffer. App developers should -//! take into consideration such limitation when using NVAPI on such tesla hardwares. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pAdapter -//! \param [in] DriverType -//! \param [in] Software -//! \param [in] Flags -//! \param [in] *pFeatureLevels -//! \param [in] FeatureLevels -//! \param [in] SDKVersion -//! \param [in] **ppDevice -//! \param [in] *pFeatureLevel -//! \param [in] **ppImmediateContext -//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported -//! -//! \return NVAPI_OK if the createDevice call succeeded. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateDevice(IDXGIAdapter* pAdapter, - D3D_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - CONST D3D_FEATURE_LEVEL *pFeatureLevels, - UINT FeatureLevels, - UINT SDKVersion, - ID3D11Device **ppDevice, - D3D_FEATURE_LEVEL *pFeatureLevel, - ID3D11DeviceContext **ppImmediateContext, - NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel); - - -#endif //defined(__cplusplus) && defined(__d3d11_h__) -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDeviceAndSwapChain -// -//! DESCRIPTION: This function tries to create a DirectX 11 device and swap chain. If the call fails (if we are -//! running on pre=DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR -//! DirectX 10.0+ OR DirectX 10.0 device. The function call is the same as D3D11CreateDeviceAndSwapChain, -//! but with an extra argument (D3D_FEATURE_LEVEL supported by the device) that the function fills -//! in. This argument can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel -//! is less than DirectX 10.0. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pAdapter -//! \param [in] DriverType -//! \param [in] Software -//! \param [in] Flags -//! \param [in] *pFeatureLevels -//! \param [in] FeatureLevels -//! \param [in] SDKVersion -//! \param [in] *pSwapChainDesc -//! \param [in] **ppSwapChain -//! \param [in] **ppDevice -//! \param [in] *pFeatureLevel -//! \param [in] **ppImmediateContext -//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported -//! -//!return NVAPI_OK if the createDevice with swap chain call succeeded. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter, - D3D_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - CONST D3D_FEATURE_LEVEL *pFeatureLevels, - UINT FeatureLevels, - UINT SDKVersion, - CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, - IDXGISwapChain **ppSwapChain, - ID3D11Device **ppDevice, - D3D_FEATURE_LEVEL *pFeatureLevel, - ID3D11DeviceContext **ppImmediateContext, - NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel); - - - -#endif //defined(__cplusplus) && defined(__d3d11_h__) -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetDepthBoundsTest -// -//! DESCRIPTION: This function enables/disables the depth bounds test -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDeviceOrContext The device or device context to set depth bounds test -//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test -//! \param [in] fMinDepth The minimum depth for depth bounds test -//! \param [in] fMaxDepth The maximum depth for depth bounds test -//! The valid values for fMinDepth and fMaxDepth -//! are such that 0 <= fMinDepth <= fMaxDepth <= 1 -//! -//! \return ::NVAPI_OK if the depth bounds test was correcly enabled or disabled -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetDepthBoundsTest(IUnknown* pDeviceOrContext, - NvU32 bEnable, - float fMinDepth, - float fMaxDepth); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#include"nvapi_lite_salend.h" -#ifdef __cplusplus -} -#endif -#pragma pack(pop) diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_salend.h b/参考/NexBox-main/R560-developer/nvapi_lite_salend.h deleted file mode 100644 index b252780..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_salend.h +++ /dev/null @@ -1,816 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ -#ifndef __NVAPI_EMPTY_SAL -#ifdef __nvapi_undef__ecount - #undef __ecount - #undef __nvapi_undef__ecount -#endif -#ifdef __nvapi_undef__bcount - #undef __bcount - #undef __nvapi_undef__bcount -#endif -#ifdef __nvapi_undef__in - #undef __in - #undef __nvapi_undef__in -#endif -#ifdef __nvapi_undef__in_ecount - #undef __in_ecount - #undef __nvapi_undef__in_ecount -#endif -#ifdef __nvapi_undef__in_bcount - #undef __in_bcount - #undef __nvapi_undef__in_bcount -#endif -#ifdef __nvapi_undef__in_z - #undef __in_z - #undef __nvapi_undef__in_z -#endif -#ifdef __nvapi_undef__in_ecount_z - #undef __in_ecount_z - #undef __nvapi_undef__in_ecount_z -#endif -#ifdef __nvapi_undef__in_bcount_z - #undef __in_bcount_z - #undef __nvapi_undef__in_bcount_z -#endif -#ifdef __nvapi_undef__in_nz - #undef __in_nz - #undef __nvapi_undef__in_nz -#endif -#ifdef __nvapi_undef__in_ecount_nz - #undef __in_ecount_nz - #undef __nvapi_undef__in_ecount_nz -#endif -#ifdef __nvapi_undef__in_bcount_nz - #undef __in_bcount_nz - #undef __nvapi_undef__in_bcount_nz -#endif -#ifdef __nvapi_undef__out - #undef __out - #undef __nvapi_undef__out -#endif -#ifdef __nvapi_undef__out_ecount - #undef __out_ecount - #undef __nvapi_undef__out_ecount -#endif -#ifdef __nvapi_undef__out_bcount - #undef __out_bcount - #undef __nvapi_undef__out_bcount -#endif -#ifdef __nvapi_undef__out_ecount_part - #undef __out_ecount_part - #undef __nvapi_undef__out_ecount_part -#endif -#ifdef __nvapi_undef__out_bcount_part - #undef __out_bcount_part - #undef __nvapi_undef__out_bcount_part -#endif -#ifdef __nvapi_undef__out_ecount_full - #undef __out_ecount_full - #undef __nvapi_undef__out_ecount_full -#endif -#ifdef __nvapi_undef__out_bcount_full - #undef __out_bcount_full - #undef __nvapi_undef__out_bcount_full -#endif -#ifdef __nvapi_undef__out_z - #undef __out_z - #undef __nvapi_undef__out_z -#endif -#ifdef __nvapi_undef__out_z_opt - #undef __out_z_opt - #undef __nvapi_undef__out_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_z - #undef __out_ecount_z - #undef __nvapi_undef__out_ecount_z -#endif -#ifdef __nvapi_undef__out_bcount_z - #undef __out_bcount_z - #undef __nvapi_undef__out_bcount_z -#endif -#ifdef __nvapi_undef__out_ecount_part_z - #undef __out_ecount_part_z - #undef __nvapi_undef__out_ecount_part_z -#endif -#ifdef __nvapi_undef__out_bcount_part_z - #undef __out_bcount_part_z - #undef __nvapi_undef__out_bcount_part_z -#endif -#ifdef __nvapi_undef__out_ecount_full_z - #undef __out_ecount_full_z - #undef __nvapi_undef__out_ecount_full_z -#endif -#ifdef __nvapi_undef__out_bcount_full_z - #undef __out_bcount_full_z - #undef __nvapi_undef__out_bcount_full_z -#endif -#ifdef __nvapi_undef__out_nz - #undef __out_nz - #undef __nvapi_undef__out_nz -#endif -#ifdef __nvapi_undef__out_nz_opt - #undef __out_nz_opt - #undef __nvapi_undef__out_nz_opt -#endif -#ifdef __nvapi_undef__out_ecount_nz - #undef __out_ecount_nz - #undef __nvapi_undef__out_ecount_nz -#endif -#ifdef __nvapi_undef__out_bcount_nz - #undef __out_bcount_nz - #undef __nvapi_undef__out_bcount_nz -#endif -#ifdef __nvapi_undef__inout - #undef __inout - #undef __nvapi_undef__inout -#endif -#ifdef __nvapi_undef__inout_ecount - #undef __inout_ecount - #undef __nvapi_undef__inout_ecount -#endif -#ifdef __nvapi_undef__inout_bcount - #undef __inout_bcount - #undef __nvapi_undef__inout_bcount -#endif -#ifdef __nvapi_undef__inout_ecount_part - #undef __inout_ecount_part - #undef __nvapi_undef__inout_ecount_part -#endif -#ifdef __nvapi_undef__inout_bcount_part - #undef __inout_bcount_part - #undef __nvapi_undef__inout_bcount_part -#endif -#ifdef __nvapi_undef__inout_ecount_full - #undef __inout_ecount_full - #undef __nvapi_undef__inout_ecount_full -#endif -#ifdef __nvapi_undef__inout_bcount_full - #undef __inout_bcount_full - #undef __nvapi_undef__inout_bcount_full -#endif -#ifdef __nvapi_undef__inout_z - #undef __inout_z - #undef __nvapi_undef__inout_z -#endif -#ifdef __nvapi_undef__inout_ecount_z - #undef __inout_ecount_z - #undef __nvapi_undef__inout_ecount_z -#endif -#ifdef __nvapi_undef__inout_bcount_z - #undef __inout_bcount_z - #undef __nvapi_undef__inout_bcount_z -#endif -#ifdef __nvapi_undef__inout_nz - #undef __inout_nz - #undef __nvapi_undef__inout_nz -#endif -#ifdef __nvapi_undef__inout_ecount_nz - #undef __inout_ecount_nz - #undef __nvapi_undef__inout_ecount_nz -#endif -#ifdef __nvapi_undef__inout_bcount_nz - #undef __inout_bcount_nz - #undef __nvapi_undef__inout_bcount_nz -#endif -#ifdef __nvapi_undef__ecount_opt - #undef __ecount_opt - #undef __nvapi_undef__ecount_opt -#endif -#ifdef __nvapi_undef__bcount_opt - #undef __bcount_opt - #undef __nvapi_undef__bcount_opt -#endif -#ifdef __nvapi_undef__in_opt - #undef __in_opt - #undef __nvapi_undef__in_opt -#endif -#ifdef __nvapi_undef__in_ecount_opt - #undef __in_ecount_opt - #undef __nvapi_undef__in_ecount_opt -#endif -#ifdef __nvapi_undef__in_bcount_opt - #undef __in_bcount_opt - #undef __nvapi_undef__in_bcount_opt -#endif -#ifdef __nvapi_undef__in_z_opt - #undef __in_z_opt - #undef __nvapi_undef__in_z_opt -#endif -#ifdef __nvapi_undef__in_ecount_z_opt - #undef __in_ecount_z_opt - #undef __nvapi_undef__in_ecount_z_opt -#endif -#ifdef __nvapi_undef__in_bcount_z_opt - #undef __in_bcount_z_opt - #undef __nvapi_undef__in_bcount_z_opt -#endif -#ifdef __nvapi_undef__in_nz_opt - #undef __in_nz_opt - #undef __nvapi_undef__in_nz_opt -#endif -#ifdef __nvapi_undef__in_ecount_nz_opt - #undef __in_ecount_nz_opt - #undef __nvapi_undef__in_ecount_nz_opt -#endif -#ifdef __nvapi_undef__in_bcount_nz_opt - #undef __in_bcount_nz_opt - #undef __nvapi_undef__in_bcount_nz_opt -#endif -#ifdef __nvapi_undef__out_opt - #undef __out_opt - #undef __nvapi_undef__out_opt -#endif -#ifdef __nvapi_undef__out_ecount_opt - #undef __out_ecount_opt - #undef __nvapi_undef__out_ecount_opt -#endif -#ifdef __nvapi_undef__out_bcount_opt - #undef __out_bcount_opt - #undef __nvapi_undef__out_bcount_opt -#endif -#ifdef __nvapi_undef__out_ecount_part_opt - #undef __out_ecount_part_opt - #undef __nvapi_undef__out_ecount_part_opt -#endif -#ifdef __nvapi_undef__out_bcount_part_opt - #undef __out_bcount_part_opt - #undef __nvapi_undef__out_bcount_part_opt -#endif -#ifdef __nvapi_undef__out_ecount_full_opt - #undef __out_ecount_full_opt - #undef __nvapi_undef__out_ecount_full_opt -#endif -#ifdef __nvapi_undef__out_bcount_full_opt - #undef __out_bcount_full_opt - #undef __nvapi_undef__out_bcount_full_opt -#endif -#ifdef __nvapi_undef__out_ecount_z_opt - #undef __out_ecount_z_opt - #undef __nvapi_undef__out_ecount_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_z_opt - #undef __out_bcount_z_opt - #undef __nvapi_undef__out_bcount_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_part_z_opt - #undef __out_ecount_part_z_opt - #undef __nvapi_undef__out_ecount_part_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_part_z_opt - #undef __out_bcount_part_z_opt - #undef __nvapi_undef__out_bcount_part_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_full_z_opt - #undef __out_ecount_full_z_opt - #undef __nvapi_undef__out_ecount_full_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_full_z_opt - #undef __out_bcount_full_z_opt - #undef __nvapi_undef__out_bcount_full_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_nz_opt - #undef __out_ecount_nz_opt - #undef __nvapi_undef__out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__out_bcount_nz_opt - #undef __out_bcount_nz_opt - #undef __nvapi_undef__out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__inout_opt - #undef __inout_opt - #undef __nvapi_undef__inout_opt -#endif -#ifdef __nvapi_undef__inout_ecount_opt - #undef __inout_ecount_opt - #undef __nvapi_undef__inout_ecount_opt -#endif -#ifdef __nvapi_undef__inout_bcount_opt - #undef __inout_bcount_opt - #undef __nvapi_undef__inout_bcount_opt -#endif -#ifdef __nvapi_undef__inout_ecount_part_opt - #undef __inout_ecount_part_opt - #undef __nvapi_undef__inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__inout_bcount_part_opt - #undef __inout_bcount_part_opt - #undef __nvapi_undef__inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__inout_ecount_full_opt - #undef __inout_ecount_full_opt - #undef __nvapi_undef__inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__inout_bcount_full_opt - #undef __inout_bcount_full_opt - #undef __nvapi_undef__inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__inout_z_opt - #undef __inout_z_opt - #undef __nvapi_undef__inout_z_opt -#endif -#ifdef __nvapi_undef__inout_ecount_z_opt - #undef __inout_ecount_z_opt - #undef __nvapi_undef__inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__inout_ecount_z_opt - #undef __inout_ecount_z_opt - #undef __nvapi_undef__inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__inout_bcount_z_opt - #undef __inout_bcount_z_opt - #undef __nvapi_undef__inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__inout_nz_opt - #undef __inout_nz_opt - #undef __nvapi_undef__inout_nz_opt -#endif -#ifdef __nvapi_undef__inout_ecount_nz_opt - #undef __inout_ecount_nz_opt - #undef __nvapi_undef__inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__inout_bcount_nz_opt - #undef __inout_bcount_nz_opt - #undef __nvapi_undef__inout_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_ecount - #undef __deref_ecount - #undef __nvapi_undef__deref_ecount -#endif -#ifdef __nvapi_undef__deref_bcount - #undef __deref_bcount - #undef __nvapi_undef__deref_bcount -#endif -#ifdef __nvapi_undef__deref_out - #undef __deref_out - #undef __nvapi_undef__deref_out -#endif -#ifdef __nvapi_undef__deref_out_ecount - #undef __deref_out_ecount - #undef __nvapi_undef__deref_out_ecount -#endif -#ifdef __nvapi_undef__deref_out_bcount - #undef __deref_out_bcount - #undef __nvapi_undef__deref_out_bcount -#endif -#ifdef __nvapi_undef__deref_out_ecount_part - #undef __deref_out_ecount_part - #undef __nvapi_undef__deref_out_ecount_part -#endif -#ifdef __nvapi_undef__deref_out_bcount_part - #undef __deref_out_bcount_part - #undef __nvapi_undef__deref_out_bcount_part -#endif -#ifdef __nvapi_undef__deref_out_ecount_full - #undef __deref_out_ecount_full - #undef __nvapi_undef__deref_out_ecount_full -#endif -#ifdef __nvapi_undef__deref_out_bcount_full - #undef __deref_out_bcount_full - #undef __nvapi_undef__deref_out_bcount_full -#endif -#ifdef __nvapi_undef__deref_out_z - #undef __deref_out_z - #undef __nvapi_undef__deref_out_z -#endif -#ifdef __nvapi_undef__deref_out_ecount_z - #undef __deref_out_ecount_z - #undef __nvapi_undef__deref_out_ecount_z -#endif -#ifdef __nvapi_undef__deref_out_bcount_z - #undef __deref_out_bcount_z - #undef __nvapi_undef__deref_out_bcount_z -#endif -#ifdef __nvapi_undef__deref_out_nz - #undef __deref_out_nz - #undef __nvapi_undef__deref_out_nz -#endif -#ifdef __nvapi_undef__deref_out_ecount_nz - #undef __deref_out_ecount_nz - #undef __nvapi_undef__deref_out_ecount_nz -#endif -#ifdef __nvapi_undef__deref_out_bcount_nz - #undef __deref_out_bcount_nz - #undef __nvapi_undef__deref_out_bcount_nz -#endif -#ifdef __nvapi_undef__deref_inout - #undef __deref_inout - #undef __nvapi_undef__deref_inout -#endif -#ifdef __nvapi_undef__deref_inout_z - #undef __deref_inout_z - #undef __nvapi_undef__deref_inout_z -#endif -#ifdef __nvapi_undef__deref_inout_ecount - #undef __deref_inout_ecount - #undef __nvapi_undef__deref_inout_ecount -#endif -#ifdef __nvapi_undef__deref_inout_bcount - #undef __deref_inout_bcount - #undef __nvapi_undef__deref_inout_bcount -#endif -#ifdef __nvapi_undef__deref_inout_ecount_part - #undef __deref_inout_ecount_part - #undef __nvapi_undef__deref_inout_ecount_part -#endif -#ifdef __nvapi_undef__deref_inout_bcount_part - #undef __deref_inout_bcount_part - #undef __nvapi_undef__deref_inout_bcount_part -#endif -#ifdef __nvapi_undef__deref_inout_ecount_full - #undef __deref_inout_ecount_full - #undef __nvapi_undef__deref_inout_ecount_full -#endif -#ifdef __nvapi_undef__deref_inout_bcount_full - #undef __deref_inout_bcount_full - #undef __nvapi_undef__deref_inout_bcount_full -#endif -#ifdef __nvapi_undef__deref_inout_z - #undef __deref_inout_z - #undef __nvapi_undef__deref_inout_z -#endif -#ifdef __nvapi_undef__deref_inout_ecount_z - #undef __deref_inout_ecount_z - #undef __nvapi_undef__deref_inout_ecount_z -#endif -#ifdef __nvapi_undef__deref_inout_bcount_z - #undef __deref_inout_bcount_z - #undef __nvapi_undef__deref_inout_bcount_z -#endif -#ifdef __nvapi_undef__deref_inout_nz - #undef __deref_inout_nz - #undef __nvapi_undef__deref_inout_nz -#endif -#ifdef __nvapi_undef__deref_inout_ecount_nz - #undef __deref_inout_ecount_nz - #undef __nvapi_undef__deref_inout_ecount_nz -#endif -#ifdef __nvapi_undef__deref_inout_bcount_nz - #undef __deref_inout_bcount_nz - #undef __nvapi_undef__deref_inout_bcount_nz -#endif -#ifdef __nvapi_undef__deref_ecount_opt - #undef __deref_ecount_opt - #undef __nvapi_undef__deref_ecount_opt -#endif -#ifdef __nvapi_undef__deref_bcount_opt - #undef __deref_bcount_opt - #undef __nvapi_undef__deref_bcount_opt -#endif -#ifdef __nvapi_undef__deref_out_opt - #undef __deref_out_opt - #undef __nvapi_undef__deref_out_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_opt - #undef __deref_out_ecount_opt - #undef __nvapi_undef__deref_out_ecount_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_opt - #undef __deref_out_bcount_opt - #undef __nvapi_undef__deref_out_bcount_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_part_opt - #undef __deref_out_ecount_part_opt - #undef __nvapi_undef__deref_out_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_part_opt - #undef __deref_out_bcount_part_opt - #undef __nvapi_undef__deref_out_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_full_opt - #undef __deref_out_ecount_full_opt - #undef __nvapi_undef__deref_out_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_full_opt - #undef __deref_out_bcount_full_opt - #undef __nvapi_undef__deref_out_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_out_z_opt - #undef __deref_out_z_opt - #undef __nvapi_undef__deref_out_z_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_z_opt - #undef __deref_out_ecount_z_opt - #undef __nvapi_undef__deref_out_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_z_opt - #undef __deref_out_bcount_z_opt - #undef __nvapi_undef__deref_out_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_out_nz_opt - #undef __deref_out_nz_opt - #undef __nvapi_undef__deref_out_nz_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_nz_opt - #undef __deref_out_ecount_nz_opt - #undef __nvapi_undef__deref_out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_nz_opt - #undef __deref_out_bcount_nz_opt - #undef __nvapi_undef__deref_out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_opt - #undef __deref_inout_opt - #undef __nvapi_undef__deref_inout_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_opt - #undef __deref_inout_ecount_opt - #undef __nvapi_undef__deref_inout_ecount_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_opt - #undef __deref_inout_bcount_opt - #undef __nvapi_undef__deref_inout_bcount_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_part_opt - #undef __deref_inout_ecount_part_opt - #undef __nvapi_undef__deref_inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_part_opt - #undef __deref_inout_bcount_part_opt - #undef __nvapi_undef__deref_inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_full_opt - #undef __deref_inout_ecount_full_opt - #undef __nvapi_undef__deref_inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_full_opt - #undef __deref_inout_bcount_full_opt - #undef __nvapi_undef__deref_inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_inout_z_opt - #undef __deref_inout_z_opt - #undef __nvapi_undef__deref_inout_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_z_opt - #undef __deref_inout_ecount_z_opt - #undef __nvapi_undef__deref_inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_z_opt - #undef __deref_inout_bcount_z_opt - #undef __nvapi_undef__deref_inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_nz_opt - #undef __deref_inout_nz_opt - #undef __nvapi_undef__deref_inout_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_nz_opt - #undef __deref_inout_ecount_nz_opt - #undef __nvapi_undef__deref_inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_nz_opt - #undef __deref_inout_bcount_nz_opt - #undef __nvapi_undef__deref_inout_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_ecount - #undef __deref_opt_ecount - #undef __nvapi_undef__deref_opt_ecount -#endif -#ifdef __nvapi_undef__deref_opt_bcount - #undef __deref_opt_bcount - #undef __nvapi_undef__deref_opt_bcount -#endif -#ifdef __nvapi_undef__deref_opt_out - #undef __deref_opt_out - #undef __nvapi_undef__deref_opt_out -#endif -#ifdef __nvapi_undef__deref_opt_out_z - #undef __deref_opt_out_z - #undef __nvapi_undef__deref_opt_out_z -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount - #undef __deref_opt_out_ecount - #undef __nvapi_undef__deref_opt_out_ecount -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount - #undef __deref_opt_out_bcount - #undef __nvapi_undef__deref_opt_out_bcount -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_part - #undef __deref_opt_out_ecount_part - #undef __nvapi_undef__deref_opt_out_ecount_part -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_part - #undef __deref_opt_out_bcount_part - #undef __nvapi_undef__deref_opt_out_bcount_part -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_full - #undef __deref_opt_out_ecount_full - #undef __nvapi_undef__deref_opt_out_ecount_full -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_full - #undef __deref_opt_out_bcount_full - #undef __nvapi_undef__deref_opt_out_bcount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout - #undef __deref_opt_inout - #undef __nvapi_undef__deref_opt_inout -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount - #undef __deref_opt_inout_ecount - #undef __nvapi_undef__deref_opt_inout_ecount -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount - #undef __deref_opt_inout_bcount - #undef __nvapi_undef__deref_opt_inout_bcount -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_part - #undef __deref_opt_inout_ecount_part - #undef __nvapi_undef__deref_opt_inout_ecount_part -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_part - #undef __deref_opt_inout_bcount_part - #undef __nvapi_undef__deref_opt_inout_bcount_part -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_full - #undef __deref_opt_inout_ecount_full - #undef __nvapi_undef__deref_opt_inout_ecount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_full - #undef __deref_opt_inout_bcount_full - #undef __nvapi_undef__deref_opt_inout_bcount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout_z - #undef __deref_opt_inout_z - #undef __nvapi_undef__deref_opt_inout_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_z - #undef __deref_opt_inout_ecount_z - #undef __nvapi_undef__deref_opt_inout_ecount_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_z - #undef __deref_opt_inout_bcount_z - #undef __nvapi_undef__deref_opt_inout_bcount_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_nz - #undef __deref_opt_inout_nz - #undef __nvapi_undef__deref_opt_inout_nz -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_nz - #undef __deref_opt_inout_ecount_nz - #undef __nvapi_undef__deref_opt_inout_ecount_nz -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_nz - #undef __deref_opt_inout_bcount_nz - #undef __nvapi_undef__deref_opt_inout_bcount_nz -#endif -#ifdef __nvapi_undef__deref_opt_ecount_opt - #undef __deref_opt_ecount_opt - #undef __nvapi_undef__deref_opt_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_bcount_opt - #undef __deref_opt_bcount_opt - #undef __nvapi_undef__deref_opt_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_opt - #undef __deref_opt_out_opt - #undef __nvapi_undef__deref_opt_out_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_opt - #undef __deref_opt_out_ecount_opt - #undef __nvapi_undef__deref_opt_out_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_opt - #undef __deref_opt_out_bcount_opt - #undef __nvapi_undef__deref_opt_out_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_part_opt - #undef __deref_opt_out_ecount_part_opt - #undef __nvapi_undef__deref_opt_out_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_part_opt - #undef __deref_opt_out_bcount_part_opt - #undef __nvapi_undef__deref_opt_out_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_full_opt - #undef __deref_opt_out_ecount_full_opt - #undef __nvapi_undef__deref_opt_out_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_full_opt - #undef __deref_opt_out_bcount_full_opt - #undef __nvapi_undef__deref_opt_out_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_z_opt - #undef __deref_opt_out_z_opt - #undef __nvapi_undef__deref_opt_out_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_z_opt - #undef __deref_opt_out_ecount_z_opt - #undef __nvapi_undef__deref_opt_out_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_z_opt - #undef __deref_opt_out_bcount_z_opt - #undef __nvapi_undef__deref_opt_out_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_nz_opt - #undef __deref_opt_out_nz_opt - #undef __nvapi_undef__deref_opt_out_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_nz_opt - #undef __deref_opt_out_ecount_nz_opt - #undef __nvapi_undef__deref_opt_out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_nz_opt - #undef __deref_opt_out_bcount_nz_opt - #undef __nvapi_undef__deref_opt_out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_opt - #undef __deref_opt_inout_opt - #undef __nvapi_undef__deref_opt_inout_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_opt - #undef __deref_opt_inout_ecount_opt - #undef __nvapi_undef__deref_opt_inout_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_opt - #undef __deref_opt_inout_bcount_opt - #undef __nvapi_undef__deref_opt_inout_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_part_opt - #undef __deref_opt_inout_ecount_part_opt - #undef __nvapi_undef__deref_opt_inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_part_opt - #undef __deref_opt_inout_bcount_part_opt - #undef __nvapi_undef__deref_opt_inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_full_opt - #undef __deref_opt_inout_ecount_full_opt - #undef __nvapi_undef__deref_opt_inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_full_opt - #undef __deref_opt_inout_bcount_full_opt - #undef __nvapi_undef__deref_opt_inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_z_opt - #undef __deref_opt_inout_z_opt - #undef __nvapi_undef__deref_opt_inout_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_z_opt - #undef __deref_opt_inout_ecount_z_opt - #undef __nvapi_undef__deref_opt_inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_z_opt - #undef __deref_opt_inout_bcount_z_opt - #undef __nvapi_undef__deref_opt_inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_nz_opt - #undef __deref_opt_inout_nz_opt - #undef __nvapi_undef__deref_opt_inout_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_nz_opt - #undef __deref_opt_inout_ecount_nz_opt - #undef __nvapi_undef__deref_opt_inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_nz_opt - #undef __deref_opt_inout_bcount_nz_opt - #undef __nvapi_undef__deref_opt_inout_bcount_nz_opt -#endif -#ifdef __nvapi_success - #undef __success - #undef __nvapi_success -#endif -#ifdef __nvapi__Ret_notnull_ - #undef __nvapi__Ret_notnull_ - #undef _Ret_notnull_ -#endif -#ifdef __nvapi__Post_writable_byte_size_ - #undef __nvapi__Post_writable_byte_size_ - #undef _Post_writable_byte_size_ -#endif -#ifdef __nvapi_Outptr_ - #undef __nvapi_Outptr_ - #undef _Outptr_ -#endif - -#endif // __NVAPI_EMPTY_SAL diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_salstart.h b/参考/NexBox-main/R560-developer/nvapi_lite_salstart.h deleted file mode 100644 index a079ec3..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_salstart.h +++ /dev/null @@ -1,821 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -// ==================================================== -// SAL related support -// ==================================================== - -#ifndef __ecount - #define __nvapi_undef__ecount - #define __ecount(size) -#endif -#ifndef __bcount - #define __nvapi_undef__bcount - #define __bcount(size) -#endif -#ifndef __in - #define __nvapi_undef__in - #define __in -#endif -#ifndef __in_ecount - #define __nvapi_undef__in_ecount - #define __in_ecount(size) -#endif -#ifndef __in_bcount - #define __nvapi_undef__in_bcount - #define __in_bcount(size) -#endif -#ifndef __in_z - #define __nvapi_undef__in_z - #define __in_z -#endif -#ifndef __in_ecount_z - #define __nvapi_undef__in_ecount_z - #define __in_ecount_z(size) -#endif -#ifndef __in_bcount_z - #define __nvapi_undef__in_bcount_z - #define __in_bcount_z(size) -#endif -#ifndef __in_nz - #define __nvapi_undef__in_nz - #define __in_nz -#endif -#ifndef __in_ecount_nz - #define __nvapi_undef__in_ecount_nz - #define __in_ecount_nz(size) -#endif -#ifndef __in_bcount_nz - #define __nvapi_undef__in_bcount_nz - #define __in_bcount_nz(size) -#endif -#ifndef __out - #define __nvapi_undef__out - #define __out -#endif -#ifndef __out_ecount - #define __nvapi_undef__out_ecount - #define __out_ecount(size) -#endif -#ifndef __out_bcount - #define __nvapi_undef__out_bcount - #define __out_bcount(size) -#endif -#ifndef __out_ecount_part - #define __nvapi_undef__out_ecount_part - #define __out_ecount_part(size,length) -#endif -#ifndef __out_bcount_part - #define __nvapi_undef__out_bcount_part - #define __out_bcount_part(size,length) -#endif -#ifndef __out_ecount_full - #define __nvapi_undef__out_ecount_full - #define __out_ecount_full(size) -#endif -#ifndef __out_bcount_full - #define __nvapi_undef__out_bcount_full - #define __out_bcount_full(size) -#endif -#ifndef __out_z - #define __nvapi_undef__out_z - #define __out_z -#endif -#ifndef __out_z_opt - #define __nvapi_undef__out_z_opt - #define __out_z_opt -#endif -#ifndef __out_ecount_z - #define __nvapi_undef__out_ecount_z - #define __out_ecount_z(size) -#endif -#ifndef __out_bcount_z - #define __nvapi_undef__out_bcount_z - #define __out_bcount_z(size) -#endif -#ifndef __out_ecount_part_z - #define __nvapi_undef__out_ecount_part_z - #define __out_ecount_part_z(size,length) -#endif -#ifndef __out_bcount_part_z - #define __nvapi_undef__out_bcount_part_z - #define __out_bcount_part_z(size,length) -#endif -#ifndef __out_ecount_full_z - #define __nvapi_undef__out_ecount_full_z - #define __out_ecount_full_z(size) -#endif -#ifndef __out_bcount_full_z - #define __nvapi_undef__out_bcount_full_z - #define __out_bcount_full_z(size) -#endif -#ifndef __out_nz - #define __nvapi_undef__out_nz - #define __out_nz -#endif -#ifndef __out_nz_opt - #define __nvapi_undef__out_nz_opt - #define __out_nz_opt -#endif -#ifndef __out_ecount_nz - #define __nvapi_undef__out_ecount_nz - #define __out_ecount_nz(size) -#endif -#ifndef __out_bcount_nz - #define __nvapi_undef__out_bcount_nz - #define __out_bcount_nz(size) -#endif -#ifndef __inout - #define __nvapi_undef__inout - #define __inout -#endif -#ifndef __inout_ecount - #define __nvapi_undef__inout_ecount - #define __inout_ecount(size) -#endif -#ifndef __inout_bcount - #define __nvapi_undef__inout_bcount - #define __inout_bcount(size) -#endif -#ifndef __inout_ecount_part - #define __nvapi_undef__inout_ecount_part - #define __inout_ecount_part(size,length) -#endif -#ifndef __inout_bcount_part - #define __nvapi_undef__inout_bcount_part - #define __inout_bcount_part(size,length) -#endif -#ifndef __inout_ecount_full - #define __nvapi_undef__inout_ecount_full - #define __inout_ecount_full(size) -#endif -#ifndef __inout_bcount_full - #define __nvapi_undef__inout_bcount_full - #define __inout_bcount_full(size) -#endif -#ifndef __inout_z - #define __nvapi_undef__inout_z - #define __inout_z -#endif -#ifndef __inout_ecount_z - #define __nvapi_undef__inout_ecount_z - #define __inout_ecount_z(size) -#endif -#ifndef __inout_bcount_z - #define __nvapi_undef__inout_bcount_z - #define __inout_bcount_z(size) -#endif -#ifndef __inout_nz - #define __nvapi_undef__inout_nz - #define __inout_nz -#endif -#ifndef __inout_ecount_nz - #define __nvapi_undef__inout_ecount_nz - #define __inout_ecount_nz(size) -#endif -#ifndef __inout_bcount_nz - #define __nvapi_undef__inout_bcount_nz - #define __inout_bcount_nz(size) -#endif -#ifndef __ecount_opt - #define __nvapi_undef__ecount_opt - #define __ecount_opt(size) -#endif -#ifndef __bcount_opt - #define __nvapi_undef__bcount_opt - #define __bcount_opt(size) -#endif -#ifndef __in_opt - #define __nvapi_undef__in_opt - #define __in_opt -#endif -#ifndef __in_ecount_opt - #define __nvapi_undef__in_ecount_opt - #define __in_ecount_opt(size) -#endif -#ifndef __in_bcount_opt - #define __nvapi_undef__in_bcount_opt - #define __in_bcount_opt(size) -#endif -#ifndef __in_z_opt - #define __nvapi_undef__in_z_opt - #define __in_z_opt -#endif -#ifndef __in_ecount_z_opt - #define __nvapi_undef__in_ecount_z_opt - #define __in_ecount_z_opt(size) -#endif -#ifndef __in_bcount_z_opt - #define __nvapi_undef__in_bcount_z_opt - #define __in_bcount_z_opt(size) -#endif -#ifndef __in_nz_opt - #define __nvapi_undef__in_nz_opt - #define __in_nz_opt -#endif -#ifndef __in_ecount_nz_opt - #define __nvapi_undef__in_ecount_nz_opt - #define __in_ecount_nz_opt(size) -#endif -#ifndef __in_bcount_nz_opt - #define __nvapi_undef__in_bcount_nz_opt - #define __in_bcount_nz_opt(size) -#endif -#ifndef __out_opt - #define __nvapi_undef__out_opt - #define __out_opt -#endif -#ifndef __out_ecount_opt - #define __nvapi_undef__out_ecount_opt - #define __out_ecount_opt(size) -#endif -#ifndef __out_bcount_opt - #define __nvapi_undef__out_bcount_opt - #define __out_bcount_opt(size) -#endif -#ifndef __out_ecount_part_opt - #define __nvapi_undef__out_ecount_part_opt - #define __out_ecount_part_opt(size,length) -#endif -#ifndef __out_bcount_part_opt - #define __nvapi_undef__out_bcount_part_opt - #define __out_bcount_part_opt(size,length) -#endif -#ifndef __out_ecount_full_opt - #define __nvapi_undef__out_ecount_full_opt - #define __out_ecount_full_opt(size) -#endif -#ifndef __out_bcount_full_opt - #define __nvapi_undef__out_bcount_full_opt - #define __out_bcount_full_opt(size) -#endif -#ifndef __out_ecount_z_opt - #define __nvapi_undef__out_ecount_z_opt - #define __out_ecount_z_opt(size) -#endif -#ifndef __out_bcount_z_opt - #define __nvapi_undef__out_bcount_z_opt - #define __out_bcount_z_opt(size) -#endif -#ifndef __out_ecount_part_z_opt - #define __nvapi_undef__out_ecount_part_z_opt - #define __out_ecount_part_z_opt(size,length) -#endif -#ifndef __out_bcount_part_z_opt - #define __nvapi_undef__out_bcount_part_z_opt - #define __out_bcount_part_z_opt(size,length) -#endif -#ifndef __out_ecount_full_z_opt - #define __nvapi_undef__out_ecount_full_z_opt - #define __out_ecount_full_z_opt(size) -#endif -#ifndef __out_bcount_full_z_opt - #define __nvapi_undef__out_bcount_full_z_opt - #define __out_bcount_full_z_opt(size) -#endif -#ifndef __out_ecount_nz_opt - #define __nvapi_undef__out_ecount_nz_opt - #define __out_ecount_nz_opt(size) -#endif -#ifndef __out_bcount_nz_opt - #define __nvapi_undef__out_bcount_nz_opt - #define __out_bcount_nz_opt(size) -#endif -#ifndef __inout_opt - #define __nvapi_undef__inout_opt - #define __inout_opt -#endif -#ifndef __inout_ecount_opt - #define __nvapi_undef__inout_ecount_opt - #define __inout_ecount_opt(size) -#endif -#ifndef __inout_bcount_opt - #define __nvapi_undef__inout_bcount_opt - #define __inout_bcount_opt(size) -#endif -#ifndef __inout_ecount_part_opt - #define __nvapi_undef__inout_ecount_part_opt - #define __inout_ecount_part_opt(size,length) -#endif -#ifndef __inout_bcount_part_opt - #define __nvapi_undef__inout_bcount_part_opt - #define __inout_bcount_part_opt(size,length) -#endif -#ifndef __inout_ecount_full_opt - #define __nvapi_undef__inout_ecount_full_opt - #define __inout_ecount_full_opt(size) -#endif -#ifndef __inout_bcount_full_opt - #define __nvapi_undef__inout_bcount_full_opt - #define __inout_bcount_full_opt(size) -#endif -#ifndef __inout_z_opt - #define __nvapi_undef__inout_z_opt - #define __inout_z_opt -#endif -#ifndef __inout_ecount_z_opt - #define __nvapi_undef__inout_ecount_z_opt - #define __inout_ecount_z_opt(size) -#endif -#ifndef __inout_ecount_z_opt - #define __nvapi_undef__inout_ecount_z_opt - #define __inout_ecount_z_opt(size) -#endif -#ifndef __inout_bcount_z_opt - #define __nvapi_undef__inout_bcount_z_opt - #define __inout_bcount_z_opt(size) -#endif -#ifndef __inout_nz_opt - #define __nvapi_undef__inout_nz_opt - #define __inout_nz_opt -#endif -#ifndef __inout_ecount_nz_opt - #define __nvapi_undef__inout_ecount_nz_opt - #define __inout_ecount_nz_opt(size) -#endif -#ifndef __inout_bcount_nz_opt - #define __nvapi_undef__inout_bcount_nz_opt - #define __inout_bcount_nz_opt(size) -#endif -#ifndef __deref_ecount - #define __nvapi_undef__deref_ecount - #define __deref_ecount(size) -#endif -#ifndef __deref_bcount - #define __nvapi_undef__deref_bcount - #define __deref_bcount(size) -#endif -#ifndef __deref_out - #define __nvapi_undef__deref_out - #define __deref_out -#endif -#ifndef __deref_out_ecount - #define __nvapi_undef__deref_out_ecount - #define __deref_out_ecount(size) -#endif -#ifndef __deref_out_bcount - #define __nvapi_undef__deref_out_bcount - #define __deref_out_bcount(size) -#endif -#ifndef __deref_out_ecount_part - #define __nvapi_undef__deref_out_ecount_part - #define __deref_out_ecount_part(size,length) -#endif -#ifndef __deref_out_bcount_part - #define __nvapi_undef__deref_out_bcount_part - #define __deref_out_bcount_part(size,length) -#endif -#ifndef __deref_out_ecount_full - #define __nvapi_undef__deref_out_ecount_full - #define __deref_out_ecount_full(size) -#endif -#ifndef __deref_out_bcount_full - #define __nvapi_undef__deref_out_bcount_full - #define __deref_out_bcount_full(size) -#endif -#ifndef __deref_out_z - #define __nvapi_undef__deref_out_z - #define __deref_out_z -#endif -#ifndef __deref_out_ecount_z - #define __nvapi_undef__deref_out_ecount_z - #define __deref_out_ecount_z(size) -#endif -#ifndef __deref_out_bcount_z - #define __nvapi_undef__deref_out_bcount_z - #define __deref_out_bcount_z(size) -#endif -#ifndef __deref_out_nz - #define __nvapi_undef__deref_out_nz - #define __deref_out_nz -#endif -#ifndef __deref_out_ecount_nz - #define __nvapi_undef__deref_out_ecount_nz - #define __deref_out_ecount_nz(size) -#endif -#ifndef __deref_out_bcount_nz - #define __nvapi_undef__deref_out_bcount_nz - #define __deref_out_bcount_nz(size) -#endif -#ifndef __deref_inout - #define __nvapi_undef__deref_inout - #define __deref_inout -#endif -#ifndef __deref_inout_z - #define __nvapi_undef__deref_inout_z - #define __deref_inout_z -#endif -#ifndef __deref_inout_ecount - #define __nvapi_undef__deref_inout_ecount - #define __deref_inout_ecount(size) -#endif -#ifndef __deref_inout_bcount - #define __nvapi_undef__deref_inout_bcount - #define __deref_inout_bcount(size) -#endif -#ifndef __deref_inout_ecount_part - #define __nvapi_undef__deref_inout_ecount_part - #define __deref_inout_ecount_part(size,length) -#endif -#ifndef __deref_inout_bcount_part - #define __nvapi_undef__deref_inout_bcount_part - #define __deref_inout_bcount_part(size,length) -#endif -#ifndef __deref_inout_ecount_full - #define __nvapi_undef__deref_inout_ecount_full - #define __deref_inout_ecount_full(size) -#endif -#ifndef __deref_inout_bcount_full - #define __nvapi_undef__deref_inout_bcount_full - #define __deref_inout_bcount_full(size) -#endif -#ifndef __deref_inout_z - #define __nvapi_undef__deref_inout_z - #define __deref_inout_z -#endif -#ifndef __deref_inout_ecount_z - #define __nvapi_undef__deref_inout_ecount_z - #define __deref_inout_ecount_z(size) -#endif -#ifndef __deref_inout_bcount_z - #define __nvapi_undef__deref_inout_bcount_z - #define __deref_inout_bcount_z(size) -#endif -#ifndef __deref_inout_nz - #define __nvapi_undef__deref_inout_nz - #define __deref_inout_nz -#endif -#ifndef __deref_inout_ecount_nz - #define __nvapi_undef__deref_inout_ecount_nz - #define __deref_inout_ecount_nz(size) -#endif -#ifndef __deref_inout_bcount_nz - #define __nvapi_undef__deref_inout_bcount_nz - #define __deref_inout_bcount_nz(size) -#endif -#ifndef __deref_ecount_opt - #define __nvapi_undef__deref_ecount_opt - #define __deref_ecount_opt(size) -#endif -#ifndef __deref_bcount_opt - #define __nvapi_undef__deref_bcount_opt - #define __deref_bcount_opt(size) -#endif -#ifndef __deref_out_opt - #define __nvapi_undef__deref_out_opt - #define __deref_out_opt -#endif -#ifndef __deref_out_ecount_opt - #define __nvapi_undef__deref_out_ecount_opt - #define __deref_out_ecount_opt(size) -#endif -#ifndef __deref_out_bcount_opt - #define __nvapi_undef__deref_out_bcount_opt - #define __deref_out_bcount_opt(size) -#endif -#ifndef __deref_out_ecount_part_opt - #define __nvapi_undef__deref_out_ecount_part_opt - #define __deref_out_ecount_part_opt(size,length) -#endif -#ifndef __deref_out_bcount_part_opt - #define __nvapi_undef__deref_out_bcount_part_opt - #define __deref_out_bcount_part_opt(size,length) -#endif -#ifndef __deref_out_ecount_full_opt - #define __nvapi_undef__deref_out_ecount_full_opt - #define __deref_out_ecount_full_opt(size) -#endif -#ifndef __deref_out_bcount_full_opt - #define __nvapi_undef__deref_out_bcount_full_opt - #define __deref_out_bcount_full_opt(size) -#endif -#ifndef __deref_out_z_opt - #define __nvapi_undef__deref_out_z_opt - #define __deref_out_z_opt -#endif -#ifndef __deref_out_ecount_z_opt - #define __nvapi_undef__deref_out_ecount_z_opt - #define __deref_out_ecount_z_opt(size) -#endif -#ifndef __deref_out_bcount_z_opt - #define __nvapi_undef__deref_out_bcount_z_opt - #define __deref_out_bcount_z_opt(size) -#endif -#ifndef __deref_out_nz_opt - #define __nvapi_undef__deref_out_nz_opt - #define __deref_out_nz_opt -#endif -#ifndef __deref_out_ecount_nz_opt - #define __nvapi_undef__deref_out_ecount_nz_opt - #define __deref_out_ecount_nz_opt(size) -#endif -#ifndef __deref_out_bcount_nz_opt - #define __nvapi_undef__deref_out_bcount_nz_opt - #define __deref_out_bcount_nz_opt(size) -#endif -#ifndef __deref_inout_opt - #define __nvapi_undef__deref_inout_opt - #define __deref_inout_opt -#endif -#ifndef __deref_inout_ecount_opt - #define __nvapi_undef__deref_inout_ecount_opt - #define __deref_inout_ecount_opt(size) -#endif -#ifndef __deref_inout_bcount_opt - #define __nvapi_undef__deref_inout_bcount_opt - #define __deref_inout_bcount_opt(size) -#endif -#ifndef __deref_inout_ecount_part_opt - #define __nvapi_undef__deref_inout_ecount_part_opt - #define __deref_inout_ecount_part_opt(size,length) -#endif -#ifndef __deref_inout_bcount_part_opt - #define __nvapi_undef__deref_inout_bcount_part_opt - #define __deref_inout_bcount_part_opt(size,length) -#endif -#ifndef __deref_inout_ecount_full_opt - #define __nvapi_undef__deref_inout_ecount_full_opt - #define __deref_inout_ecount_full_opt(size) -#endif -#ifndef __deref_inout_bcount_full_opt - #define __nvapi_undef__deref_inout_bcount_full_opt - #define __deref_inout_bcount_full_opt(size) -#endif -#ifndef __deref_inout_z_opt - #define __nvapi_undef__deref_inout_z_opt - #define __deref_inout_z_opt -#endif -#ifndef __deref_inout_ecount_z_opt - #define __nvapi_undef__deref_inout_ecount_z_opt - #define __deref_inout_ecount_z_opt(size) -#endif -#ifndef __deref_inout_bcount_z_opt - #define __nvapi_undef__deref_inout_bcount_z_opt - #define __deref_inout_bcount_z_opt(size) -#endif -#ifndef __deref_inout_nz_opt - #define __nvapi_undef__deref_inout_nz_opt - #define __deref_inout_nz_opt -#endif -#ifndef __deref_inout_ecount_nz_opt - #define __nvapi_undef__deref_inout_ecount_nz_opt - #define __deref_inout_ecount_nz_opt(size) -#endif -#ifndef __deref_inout_bcount_nz_opt - #define __nvapi_undef__deref_inout_bcount_nz_opt - #define __deref_inout_bcount_nz_opt(size) -#endif -#ifndef __deref_opt_ecount - #define __nvapi_undef__deref_opt_ecount - #define __deref_opt_ecount(size) -#endif -#ifndef __deref_opt_bcount - #define __nvapi_undef__deref_opt_bcount - #define __deref_opt_bcount(size) -#endif -#ifndef __deref_opt_out - #define __nvapi_undef__deref_opt_out - #define __deref_opt_out -#endif -#ifndef __deref_opt_out_z - #define __nvapi_undef__deref_opt_out_z - #define __deref_opt_out_z -#endif -#ifndef __deref_opt_out_ecount - #define __nvapi_undef__deref_opt_out_ecount - #define __deref_opt_out_ecount(size) -#endif -#ifndef __deref_opt_out_bcount - #define __nvapi_undef__deref_opt_out_bcount - #define __deref_opt_out_bcount(size) -#endif -#ifndef __deref_opt_out_ecount_part - #define __nvapi_undef__deref_opt_out_ecount_part - #define __deref_opt_out_ecount_part(size,length) -#endif -#ifndef __deref_opt_out_bcount_part - #define __nvapi_undef__deref_opt_out_bcount_part - #define __deref_opt_out_bcount_part(size,length) -#endif -#ifndef __deref_opt_out_ecount_full - #define __nvapi_undef__deref_opt_out_ecount_full - #define __deref_opt_out_ecount_full(size) -#endif -#ifndef __deref_opt_out_bcount_full - #define __nvapi_undef__deref_opt_out_bcount_full - #define __deref_opt_out_bcount_full(size) -#endif -#ifndef __deref_opt_inout - #define __nvapi_undef__deref_opt_inout - #define __deref_opt_inout -#endif -#ifndef __deref_opt_inout_ecount - #define __nvapi_undef__deref_opt_inout_ecount - #define __deref_opt_inout_ecount(size) -#endif -#ifndef __deref_opt_inout_bcount - #define __nvapi_undef__deref_opt_inout_bcount - #define __deref_opt_inout_bcount(size) -#endif -#ifndef __deref_opt_inout_ecount_part - #define __nvapi_undef__deref_opt_inout_ecount_part - #define __deref_opt_inout_ecount_part(size,length) -#endif -#ifndef __deref_opt_inout_bcount_part - #define __nvapi_undef__deref_opt_inout_bcount_part - #define __deref_opt_inout_bcount_part(size,length) -#endif -#ifndef __deref_opt_inout_ecount_full - #define __nvapi_undef__deref_opt_inout_ecount_full - #define __deref_opt_inout_ecount_full(size) -#endif -#ifndef __deref_opt_inout_bcount_full - #define __nvapi_undef__deref_opt_inout_bcount_full - #define __deref_opt_inout_bcount_full(size) -#endif -#ifndef __deref_opt_inout_z - #define __nvapi_undef__deref_opt_inout_z - #define __deref_opt_inout_z -#endif -#ifndef __deref_opt_inout_ecount_z - #define __nvapi_undef__deref_opt_inout_ecount_z - #define __deref_opt_inout_ecount_z(size) -#endif -#ifndef __deref_opt_inout_bcount_z - #define __nvapi_undef__deref_opt_inout_bcount_z - #define __deref_opt_inout_bcount_z(size) -#endif -#ifndef __deref_opt_inout_nz - #define __nvapi_undef__deref_opt_inout_nz - #define __deref_opt_inout_nz -#endif -#ifndef __deref_opt_inout_ecount_nz - #define __nvapi_undef__deref_opt_inout_ecount_nz - #define __deref_opt_inout_ecount_nz(size) -#endif -#ifndef __deref_opt_inout_bcount_nz - #define __nvapi_undef__deref_opt_inout_bcount_nz - #define __deref_opt_inout_bcount_nz(size) -#endif -#ifndef __deref_opt_ecount_opt - #define __nvapi_undef__deref_opt_ecount_opt - #define __deref_opt_ecount_opt(size) -#endif -#ifndef __deref_opt_bcount_opt - #define __nvapi_undef__deref_opt_bcount_opt - #define __deref_opt_bcount_opt(size) -#endif -#ifndef __deref_opt_out_opt - #define __nvapi_undef__deref_opt_out_opt - #define __deref_opt_out_opt -#endif -#ifndef __deref_opt_out_ecount_opt - #define __nvapi_undef__deref_opt_out_ecount_opt - #define __deref_opt_out_ecount_opt(size) -#endif -#ifndef __deref_opt_out_bcount_opt - #define __nvapi_undef__deref_opt_out_bcount_opt - #define __deref_opt_out_bcount_opt(size) -#endif -#ifndef __deref_opt_out_ecount_part_opt - #define __nvapi_undef__deref_opt_out_ecount_part_opt - #define __deref_opt_out_ecount_part_opt(size,length) -#endif -#ifndef __deref_opt_out_bcount_part_opt - #define __nvapi_undef__deref_opt_out_bcount_part_opt - #define __deref_opt_out_bcount_part_opt(size,length) -#endif -#ifndef __deref_opt_out_ecount_full_opt - #define __nvapi_undef__deref_opt_out_ecount_full_opt - #define __deref_opt_out_ecount_full_opt(size) -#endif -#ifndef __deref_opt_out_bcount_full_opt - #define __nvapi_undef__deref_opt_out_bcount_full_opt - #define __deref_opt_out_bcount_full_opt(size) -#endif -#ifndef __deref_opt_out_z_opt - #define __nvapi_undef__deref_opt_out_z_opt - #define __deref_opt_out_z_opt -#endif -#ifndef __deref_opt_out_ecount_z_opt - #define __nvapi_undef__deref_opt_out_ecount_z_opt - #define __deref_opt_out_ecount_z_opt(size) -#endif -#ifndef __deref_opt_out_bcount_z_opt - #define __nvapi_undef__deref_opt_out_bcount_z_opt - #define __deref_opt_out_bcount_z_opt(size) -#endif -#ifndef __deref_opt_out_nz_opt - #define __nvapi_undef__deref_opt_out_nz_opt - #define __deref_opt_out_nz_opt -#endif -#ifndef __deref_opt_out_ecount_nz_opt - #define __nvapi_undef__deref_opt_out_ecount_nz_opt - #define __deref_opt_out_ecount_nz_opt(size) -#endif -#ifndef __deref_opt_out_bcount_nz_opt - #define __nvapi_undef__deref_opt_out_bcount_nz_opt - #define __deref_opt_out_bcount_nz_opt(size) -#endif -#ifndef __deref_opt_inout_opt - #define __nvapi_undef__deref_opt_inout_opt - #define __deref_opt_inout_opt -#endif -#ifndef __deref_opt_inout_ecount_opt - #define __nvapi_undef__deref_opt_inout_ecount_opt - #define __deref_opt_inout_ecount_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_opt - #define __nvapi_undef__deref_opt_inout_bcount_opt - #define __deref_opt_inout_bcount_opt(size) -#endif -#ifndef __deref_opt_inout_ecount_part_opt - #define __nvapi_undef__deref_opt_inout_ecount_part_opt - #define __deref_opt_inout_ecount_part_opt(size,length) -#endif -#ifndef __deref_opt_inout_bcount_part_opt - #define __nvapi_undef__deref_opt_inout_bcount_part_opt - #define __deref_opt_inout_bcount_part_opt(size,length) -#endif -#ifndef __deref_opt_inout_ecount_full_opt - #define __nvapi_undef__deref_opt_inout_ecount_full_opt - #define __deref_opt_inout_ecount_full_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_full_opt - #define __nvapi_undef__deref_opt_inout_bcount_full_opt - #define __deref_opt_inout_bcount_full_opt(size) -#endif -#ifndef __deref_opt_inout_z_opt - #define __nvapi_undef__deref_opt_inout_z_opt - #define __deref_opt_inout_z_opt -#endif -#ifndef __deref_opt_inout_ecount_z_opt - #define __nvapi_undef__deref_opt_inout_ecount_z_opt - #define __deref_opt_inout_ecount_z_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_z_opt - #define __nvapi_undef__deref_opt_inout_bcount_z_opt - #define __deref_opt_inout_bcount_z_opt(size) -#endif -#ifndef __deref_opt_inout_nz_opt - #define __nvapi_undef__deref_opt_inout_nz_opt - #define __deref_opt_inout_nz_opt -#endif -#ifndef __deref_opt_inout_ecount_nz_opt - #define __nvapi_undef__deref_opt_inout_ecount_nz_opt - #define __deref_opt_inout_ecount_nz_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_nz_opt - #define __nvapi_undef__deref_opt_inout_bcount_nz_opt - #define __deref_opt_inout_bcount_nz_opt(size) -#endif -#ifndef __success - #define __nvapi_success - #define __success(epxr) -#endif -#ifndef _Ret_notnull_ - #define __nvapi__Ret_notnull_ - #define _Ret_notnull_ -#endif -#ifndef _Post_writable_byte_size_ - #define __nvapi__Post_writable_byte_size_ - #define _Post_writable_byte_size_(n) -#endif -#ifndef _Outptr_ - #define __nvapi_Outptr_ - #define _Outptr_ -#endif - - -#define NVAPI_INTERFACE extern __success(return == NVAPI_OK) NvAPI_Status __cdecl diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_sli.h b/参考/NexBox-main/R560-developer/nvapi_lite_sli.h deleted file mode 100644 index 59ed3c5..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_sli.h +++ /dev/null @@ -1,255 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -#pragma once -#include"nvapi_lite_salstart.h" -#include"nvapi_lite_common.h" -#pragma pack(push,8) -#ifdef __cplusplus -extern "C" { -#endif -//----------------------------------------------------------------------------- -// DirectX APIs -//----------------------------------------------------------------------------- - - -//! \ingroup dx -//! Used in NvAPI_D3D10_GetCurrentSLIState(), and NvAPI_D3D_GetCurrentSLIState(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups - NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system - NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered - NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present) - NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet) - NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group - -} NV_GET_CURRENT_SLI_STATE_V1; - -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups - NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system - NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered - NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present) - NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet) - NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group - NvU32 numVRSLIGpus; //!< [OUT] The number of GPUs used in VR-SLI. If it is 0 VR-SLI is not active - -} NV_GET_CURRENT_SLI_STATE_V2; - -//! \ingroup dx -#define NV_GET_CURRENT_SLI_STATE_VER1 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V1,1) -#define NV_GET_CURRENT_SLI_STATE_VER2 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V2,1) -#define NV_GET_CURRENT_SLI_STATE_VER NV_GET_CURRENT_SLI_STATE_VER2 -#define NV_GET_CURRENT_SLI_STATE NV_GET_CURRENT_SLI_STATE_V2 -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetCurrentSLIState -// -//! DESCRIPTION: This function returns the current SLI state for the specified device. The structure -//! contains the number of AFR groups, the current AFR group index, -//! and what the AFR group index will be for the next frame. \p -//! pDevice can be either a IDirect3DDevice9 or ID3D10Device pointer. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 173 -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Error occurred -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET_CURRENT_SLI_STATE *pSliState); -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetResourceHint -// -//! \fn NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj, -//! NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory, -//! NvU32 dwHintName, -//! NvU32 *pdwHintValue) -//! -//! DESCRIPTION: This is a general purpose function for passing down various resource -//! related hints to the driver. Hints are divided into categories -//! and types within each category. For DX11 devices this function is free-threaded. -//! An application is responsible to complete this call before making use of the resource -//! in a rendering context (therefore applying inter-thread synchronization as appropriate). -//! As a debug help to an application the driver enforces that a resource in this call was never bound. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev The ID3D10Device or IDirect3DDevice9 that is a using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] dwHintCategory Category of the hints -//! \param [in] dwHintName A hint within this category -//! \param [in/out] *pdwHintValue Pointer to location containing hint value, function returns previous hint value in this slot -//! -//! \return an int which could be an NvAPI status or DX HRESULT code -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_INVALID_ARGUMENT -//! \retval ::NVAPI_INVALID_CALL It is illegal to change a hint dynamically when the resource is already bound. -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dx -//! Valid categories for NvAPI_D3D_SetResourceHint() -typedef enum _NVAPI_D3D_SETRESOURCEHINT_CATEGORY -{ - NVAPI_D3D_SRH_CATEGORY_SLI = 1 -} NVAPI_D3D_SETRESOURCEHINT_CATEGORY; - - -// -// NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: -// NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USING: -// NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: - - -//! \ingroup dx -//! Types of SLI hints; \n -//! NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will not track any rendering operations that would mark this resource as dirty, -//! avoiding any form of synchronization across frames rendered in parallel in multiple GPUs in AFR mode. -//! -//! NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will try to perform operations which involved target resource in broadcast, -//! where it's possible. Hint is static and must be set before resource starts using. -//! -//! NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will do dirty resource resolve regardless of discard flags in the application profile or -//! AFR-FriendlyD3DHints.exe name using. -//! -typedef enum _NVAPI_D3D_SETRESOURCEHINT_SLI -{ - NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC = 1, - NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE = 2, - NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC = 3 -} NVAPI_D3D_SETRESOURCEHINT_SLI; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj, - NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory, - NvU32 dwHintName, - NvU32 *pdwHintValue); -#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_BeginResourceRendering -// -//! \fn NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags) -//! DESCRIPTION: This function tells the driver that the resource will begin to receive updates. It must be used in combination with NvAPI_D3D_EndResourceRendering(). -//! The primary use of this function is allow the driver to initiate early inter-frame synchronization of resources while running in AFR SLI mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] Flags The flags for functionality applied to resource while being used. -//! -//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources. -//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values -//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dx -//! Used in NvAPI_D3D_BeginResourceRendering(). -typedef enum _NVAPI_D3D_RESOURCERENDERING_FLAG -{ - NVAPI_D3D_RR_FLAG_DEFAULTS = 0x00000000, //!< All bits set to 0 are defaults. - NVAPI_D3D_RR_FLAG_FORCE_DISCARD_CONTENT = 0x00000001, //!< (bit 0) The flag forces to discard previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint - NVAPI_D3D_RR_FLAG_FORCE_KEEP_CONTENT = 0x00000002, //!< (bit 1) The flag forces to respect previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint - NVAPI_D3D_RR_FLAG_MULTI_FRAME = 0x00000004 //!< (bit 2) The flag hints the driver that content will be used for many frames. If not specified then the driver assumes that content is used only on the next frame -} NVAPI_D3D_RESOURCERENDERING_FLAG; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags); - -#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_EndResourceRendering -// -//! DESCRIPTION: This function tells the driver that the resource is done receiving updates. It must be used in combination with -//! NvAPI_D3D_BeginResourceRendering(). -//! The primary use of this function is allow the driver to initiate early inter-frame syncs of resources while running in AFR SLI mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] Flags Reserved, must be zero -// -//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources. -//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values -//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_EndResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags); -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -#include"nvapi_lite_salend.h" -#ifdef __cplusplus -} -#endif -#pragma pack(pop) diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_stereo.h b/参考/NexBox-main/R560-developer/nvapi_lite_stereo.h deleted file mode 100644 index f1776c0..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_stereo.h +++ /dev/null @@ -1,600 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright © 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -#pragma once -#include"nvapi_lite_salstart.h" -#include"nvapi_lite_common.h" -#pragma pack(push,8) -#ifdef __cplusplus -extern "C" { -#endif -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Enable -// -//! DESCRIPTION: This APU enables stereo mode in the registry. -//! Calls to this function affect the entire system. -//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect, -//! and will return the appropriate error code. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \retval ::NVAPI_OK Stereo is now enabled. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Enable(void); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Disable -// -//! DESCRIPTION: This API disables stereo mode in the registry. -//! Calls to this function affect the entire system. -//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect, -//! and will return the appropriate error code. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \retval ::NVAPI_OK Stereo is now disabled. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Disable(void); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_IsEnabled -// -//! DESCRIPTION: This API checks if stereo mode is enabled in the registry. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [out] pIsStereoEnabled Address where the result of the inquiry will be placed. -//! -//! \retval ::NVAPI_OK Check was sucessfully completed and result reflects current state of stereo availability. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_IsEnabled(NvU8 *pIsStereoEnabled); -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)|| defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown -// -//! DESCRIPTION: This API creates a stereo handle that is used in subsequent calls related to a given device interface. -//! This must be called before any other NvAPI_Stereo_ function for that handle. -//! Multiple devices can be used at one time using multiple calls to this function (one per each device). -//! -//! HOW TO USE: After the Direct3D device is created, create the stereo handle. -//! On call success: -//! -# Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter. -//! -# After the device interface that corresponds to the the stereo handle is destroyed, -//! the application should call NvAPI_DestroyStereoHandle() for that stereo handle. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] pDevice Pointer to IUnknown interface that is IDirect3DDevice9* in DX9, ID3D10Device*. -//! \param [out] pStereoHandle Pointer to the newly created stereo handle. -//! -//! \retval ::NVAPI_OK Stereo handle is created for given device interface. -//! \retval ::NVAPI_INVALID_ARGUMENT Provided device interface is invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_CreateHandleFromIUnknown(IUnknown *pDevice, StereoHandle *pStereoHandle); - -#endif // defined(_D3D9_H_) || defined(__d3d10_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_DestroyHandle -// -//! DESCRIPTION: This API destroys the stereo handle created with one of the NvAPI_Stereo_CreateHandleFrom() functions. -//! This should be called after the device corresponding to the handle has been destroyed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that is to be destroyed. -//! -//! \retval ::NVAPI_OK Stereo handle is destroyed. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_DestroyHandle(StereoHandle stereoHandle); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Activate -// -//! DESCRIPTION: This API activates stereo for the device interface corresponding to the given stereo handle. -//! Activating stereo is possible only if stereo was enabled previously in the registry. -//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect, -//! and will return the appropriate error code. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! -//! \retval ::NVAPI_OK Stereo is turned on. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Activate(StereoHandle stereoHandle); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Deactivate -// -//! DESCRIPTION: This API deactivates stereo for the given device interface. -//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect, -//! and will return the appropriate error code. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! -//! \retval ::NVAPI_OK Stereo is turned off. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Deactivate(StereoHandle stereoHandle); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_IsActivated -// -//! DESCRIPTION: This API checks if stereo is activated for the given device interface. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] pIsStereoOn Address where result of the inquiry will be placed. -//! -//! \retval ::NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off). -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR - Something is wrong (generic error). -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_IsActivated(StereoHandle stereoHandle, NvU8 *pIsStereoOn); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetSeparation -// -//! DESCRIPTION: This API gets current separation value (in percents). -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pSeparationPercentage Address of @c float type variable to store current separation percentage in. -//! -//! \retval ::NVAPI_OK Retrieval of separation percentage was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetSeparation(StereoHandle stereoHandle, float *pSeparationPercentage); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetSeparation -// -//! DESCRIPTION: This API sets separation to given percentage. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] newSeparationPercentage New value for separation percentage. -//! -//! \retval ::NVAPI_OK Setting of separation percentage was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE Given separation percentage is out of [0..100] range. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetSeparation(StereoHandle stereoHandle, float newSeparationPercentage); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetConvergence -// -//! DESCRIPTION: This API gets the current convergence value. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pConvergence Address of @c float type variable to store current convergence value in. -//! -//! \retval ::NVAPI_OK Retrieval of convergence value was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetConvergence(StereoHandle stereoHandle, float *pConvergence); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetConvergence -// -//! DESCRIPTION: This API sets convergence to the given value. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] newConvergence New value for convergence. -//! -//! \retval ::NVAPI_OK Setting of convergence value was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetConvergence(StereoHandle stereoHandle, float newConvergence); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetActiveEye -// -//! \fn NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye); -//! DESCRIPTION: This API sets the back buffer to left or right in Direct stereo mode. -//! -//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate -//! NvAPI_Stereo_CreateHandleFrom function. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] StereoEye Defines active eye in Direct stereo mode -//! -//! \retval ::NVAPI_OK - Active eye is set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_INVALID_ARGUMENT - StereoEye parameter has not allowed value. -//! \retval ::NVAPI_SET_NOT_ALLOWED - Current stereo mode is not Direct -//! \retval ::NVAPI_ERROR - Something is wrong (generic error). -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NV_StereoActiveEye -{ - NVAPI_STEREO_EYE_RIGHT = 1, - NVAPI_STEREO_EYE_LEFT = 2, - NVAPI_STEREO_EYE_MONO = 3, -} NV_STEREO_ACTIVE_EYE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetDriverMode -// -//! \fn NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode ); -//! DESCRIPTION: This API sets the 3D stereo driver mode: Direct or Automatic -//! -//! HOW TO USE: This API must be called before the device is created. -//! Applies to DirectX 9 and higher. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] mode Defines the 3D stereo driver mode: Direct or Automatic -//! -//! \retval ::NVAPI_OK Active eye is set. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_INVALID_ARGUMENT mode parameter has not allowed value. -//! \retval ::NVAPI_ERROR Something is wrong (generic error). -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NV_StereoDriverMode -{ - NVAPI_STEREO_DRIVER_MODE_AUTOMATIC = 0, - NVAPI_STEREO_DRIVER_MODE_DIRECT = 2, -} NV_STEREO_DRIVER_MODE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode ); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetEyeSeparation -// -//! DESCRIPTION: This API returns eye separation as a ratio of /. -//! -//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate API. Applies only to DirectX 9 and up. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pSeparation Eye separation. -//! -//! \retval ::NVAPI_OK Active eye is set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR (generic error). -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetEyeSeparation(StereoHandle hStereoHandle, float *pSeparation ); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_IsWindowedModeSupported -// -//! DESCRIPTION: This API returns availability of windowed mode stereo -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] bSupported(OUT) != 0 - supported, \n -//! == 0 - is not supported -//! -//! -//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR Something is wrong (generic error). -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_IsWindowedModeSupported(NvU8* bSupported); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetSurfaceCreationMode -// -//! \function NvAPI_Stereo_SetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE creationMode) -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] creationMode New surface creation mode for this device interface. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API sets surface creation mode for this device interface. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NVAPI_STEREO_SURFACECREATEMODE -{ - NVAPI_STEREO_SURFACECREATEMODE_AUTO, //!< Use driver registry profile settings for surface creation mode. - NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO, //!< Always create stereo surfaces. - NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO //!< Always create mono surfaces. -} NVAPI_STEREO_SURFACECREATEMODE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE creationMode); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetSurfaceCreationMode -// -//! \function NvAPI_Stereo_GetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE* pCreationMode) -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pCreationMode The current creation mode for this device interface. -//! -//! \since Release: 295 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API gets surface creation mode for this device interface. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_GetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE* pCreationMode); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Debug_WasLastDrawStereoized -// -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pWasStereoized Address where result of the inquiry will be placed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API checks if the last draw call was stereoized. It is a very expensive to call and should be used for debugging purpose *only*. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Debug_WasLastDrawStereoized(__in StereoHandle hStereoHandle, __out NvU8 *pWasStereoized); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetDefaultProfile -// -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API defines the stereo profile used by the driver in case the application has no associated profile. -//! -//! WHEN TO USE: To take effect, this API must be called before D3D device is created. Calling once a device has been created will not affect the current device. -//! -//! \param [in] szProfileName Default profile name. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! Error codes specific to this API are described below. -//! -//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName. -//! \retval NVAPI_INVALID_ARGUMENT - szProfileName == NULL. -//! \retval NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST - Default stereo profile does not exist -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetDefaultProfile(__in const char* szProfileName); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetDefaultProfile -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API retrieves the current default stereo profile. -//! -//! After call cbSizeOut contain 0 if default profile is not set required buffer size cbSizeOut. -//! To get needed buffer size this function can be called with szProfileName==0 and cbSizeIn == 0. -//! -//! WHEN TO USE: This API can be called at any time. -//! -//! -//! \param [in] cbSizeIn Size of buffer allocated for default stereo profile name. -//! \param [out] szProfileName Default stereo profile name. -//! \param [out] pcbSizeOut Required buffer size. -//! # ==0 - there is no default stereo profile name currently set -//! # !=0 - size of buffer required for currently set default stereo profile name including trailing '0'. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! Error codes specific to this API are described below. -//! -//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName. -//! \retval NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED - There is no default stereo profile set at this time. -//! \retval NVAPI_INVALID_ARGUMENT - pcbSizeOut == 0 or cbSizeIn >= *pcbSizeOut && szProfileName == 0 -//! \retval NVAPI_INSUFFICIENT_BUFFER - cbSizeIn < *pcbSizeOut -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetDefaultProfile( __in NvU32 cbSizeIn, __out_bcount_part_opt(cbSizeIn, *pcbSizeOut) char* szProfileName, __out NvU32 *pcbSizeOut); - -#include"nvapi_lite_salend.h" -#ifdef __cplusplus -} -#endif -#pragma pack(pop) diff --git a/参考/NexBox-main/R560-developer/nvapi_lite_surround.h b/参考/NexBox-main/R560-developer/nvapi_lite_surround.h deleted file mode 100644 index 43b7000..0000000 --- a/参考/NexBox-main/R560-developer/nvapi_lite_surround.h +++ /dev/null @@ -1,103 +0,0 @@ - /************************************************************************************************************************************\ -|* *| -|* Copyright ? 2012 NVIDIA Corporation. All rights reserved. *| -|* *| -|* NOTICE TO USER: *| -|* *| -|* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *| -|* *| -|* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *| -|* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *| -|* Otherwise, you have no rights to use or access this software in any manner. *| -|* *| -|* If not covered by the applicable NVIDIA software license agreement: *| -|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *| -|* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *| -|* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *| -|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *| -|* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *| -|* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *| -|* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *| -|* *| -|* U.S. Government End Users. *| -|* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *| -|* consisting of "commercial computer software" and "commercial computer software documentation" *| -|* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *| -|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *| -|* all U.S. Government End Users acquire the software with only those rights set forth herein. *| -|* *| -|* Any use of this software in individual and commercial software must include, *| -|* in the user documentation and internal comments to the code, *| -|* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *| -|* *| - \************************************************************************************************************************************/ - -#pragma once -#include"nvapi_lite_salstart.h" -#include"nvapi_lite_common.h" -#pragma pack(push,8) -#ifdef __cplusplus -extern "C" { -#endif -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetGDIPrimaryDisplayId -// -//! DESCRIPTION: This API returns the Display ID of the GDI Primary. -//! -//! \param [out] displayId Display ID of the GDI Primary display. -//! -//! \retval ::NVAPI_OK: Capabilties have been returned. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND: GDI Primary not on an NVIDIA GPU. -//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetGDIPrimaryDisplayId(NvU32* displayId); -#define NV_MOSAIC_MAX_DISPLAYS (64) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetDisplayViewportsByResolution -// -//! DESCRIPTION: This API returns the viewports that would be applied on -//! the requested display. -//! -//! \param [in] displayId Display ID of a single display in the active -//! mosaic topology to query. -//! \param [in] srcWidth Width of full display topology. If both -//! width and height are 0, the current -//! resolution is used. -//! \param [in] srcHeight Height of full display topology. If both -//! width and height are 0, the current -//! resolution is used. -//! \param [out] viewports Array of NV_RECT viewports. -//! SUPPORTED OS: Windows 7 and higher -//! -//! If the requested resolution is a single-wide -//! resolution, only viewports[0] will -//! contain the viewport details, regardless -//! of which display is driving the display. -//! \param [out] bezelCorrected Returns 1 if the requested resolution is -//! bezel corrected. May be NULL. -//! -//! \retval ::NVAPI_OK Capabilties have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_MOSAIC_NOT_ACTIVE The display does not belong to an active Mosaic Topology -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetDisplayViewportsByResolution(NvU32 displayId, NvU32 srcWidth, NvU32 srcHeight, NV_RECT viewports[NV_MOSAIC_MAX_DISPLAYS], NvU8* bezelCorrected); - -#include"nvapi_lite_salend.h" -#ifdef __cplusplus -} -#endif -#pragma pack(pop) diff --git a/参考/NexBox-main/R560-developer/x86/nvapi.lib b/参考/NexBox-main/R560-developer/x86/nvapi.lib deleted file mode 100644 index 6af8b06..0000000 Binary files a/参考/NexBox-main/R560-developer/x86/nvapi.lib and /dev/null differ diff --git a/参考/NexBox-main/aq_registry/MMCSS完整游戏配置.reg b/参考/NexBox-main/aq_registry/MMCSS完整游戏配置.reg deleted file mode 100644 index a7ba0d4..0000000 --- a/参考/NexBox-main/aq_registry/MMCSS完整游戏配置.reg +++ /dev/null @@ -1,25 +0,0 @@ -Windows Registry Editor Version 5.00 - -; MMCSS 完整游戏配置文件 -; 设置 Games 任务最高优先级、音频任务高优先级 -; 禁用懒模式,GPU 优先级 8,SFIO 优先级 High - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] -"NoLazyMode"=dword:00000001 -"AlwaysOn"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] -"Affinity"=dword:00000000 -"Background Only"="False" -"Clock Rate"=dword:00002710 -"GPU Priority"=dword:00000008 -"Priority"=dword:00000006 -"Scheduling Category"="High" -"SFIO Priority"="High" - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Pro Audio] -"Priority"=dword:00000001 -"Scheduling Category"="High" -"SFIO Priority"="High" -"GPU Priority"=dword:00000008 -"Clock Rate"=dword:00002710 diff --git a/参考/NexBox-main/aq_registry/NVIDIA低延迟阈值优化.reg b/参考/NexBox-main/aq_registry/NVIDIA低延迟阈值优化.reg deleted file mode 100644 index 1d28b3d..0000000 --- a/参考/NexBox-main/aq_registry/NVIDIA低延迟阈值优化.reg +++ /dev/null @@ -1,29 +0,0 @@ -Windows Registry Editor Version 5.00 - -; NVIDIA 低延迟阈值优化 -; 调整 GPU 调度器各项延迟阈值到最低值 -; 减少 D3PC 延迟、F1 切换延迟、3D 低延迟模式、GSPC 调度周期等 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"D3PCLatency"=dword:00000001 -"F1TransitionLatency"=dword:00000001 -"Node3DLowLatency"=dword:00000001 -"RmGspcMaxFtuS"=dword:00000001 -"RmGspcMinFtuS"=dword:00000001 -"RmGspcPerioduS"=dword:00000001 -"RMLpwrEiIdleThreshold"=dword:00000001 -"RMLpwrGrIdleThreshold"=dword:00000001 -"RMLpwrGrRgIdleThreshold"=dword:00000001 -"RMLpwrMsIdleThreshold"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"D3PCLatency"=dword:00000001 -"F1TransitionLatency"=dword:00000001 -"Node3DLowLatency"=dword:00000001 -"RmGspcMaxFtuS"=dword:00000001 -"RmGspcMinFtuS"=dword:00000001 -"RmGspcPerioduS"=dword:00000001 -"RMLpwrEiIdleThreshold"=dword:00000001 -"RMLpwrGrIdleThreshold"=dword:00000001 -"RMLpwrGrRgIdleThreshold"=dword:00000001 -"RMLpwrMsIdleThreshold"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/NVMe调优.reg b/参考/NexBox-main/aq_registry/NVMe调优.reg deleted file mode 100644 index e6ce00e..0000000 --- a/参考/NexBox-main/aq_registry/NVMe调优.reg +++ /dev/null @@ -1,11 +0,0 @@ -Windows Registry Editor Version 5.00 - -; NVMe 固态硬盘调优 -; ContiguousMemoryFromAnyNode:允许从任意 NUMA 节点分配连续内存 -; LogSize 设为 0:禁用驱动日志以减少写入 -; IdlePowerMode 设为 0:禁用空闲节能,保持全速响应 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device] -"ContiguousMemoryFromAnyNode"=dword:00000001 -"LogSize"=dword:00000000 -"IdlePowerMode"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/优先考虑游戏责任.reg b/参考/NexBox-main/aq_registry/优先考虑游戏责任.reg deleted file mode 100644 index 5ea4636..0000000 Binary files a/参考/NexBox-main/aq_registry/优先考虑游戏责任.reg and /dev/null differ diff --git a/参考/NexBox-main/aq_registry/关闭自动色彩管理.reg b/参考/NexBox-main/aq_registry/关闭自动色彩管理.reg deleted file mode 100644 index ea01f13..0000000 --- a/参考/NexBox-main/aq_registry/关闭自动色彩管理.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 关闭 DirectX 自动色彩管理 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"AutoColorManagementEnable"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/合并ServiceHost进程.reg b/参考/NexBox-main/aq_registry/合并ServiceHost进程.reg deleted file mode 100644 index 43987d9..0000000 --- a/参考/NexBox-main/aq_registry/合并ServiceHost进程.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 增大 ServiceHost 拆分阈值,减少 svchost.exe 进程数量 -; 设为 16GB (16777216 KB),低于此内存的系统不会合并 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] -"SvcHostSplitThresholdInKB"=dword:01000000 diff --git a/参考/NexBox-main/aq_registry/启用DirectX AutoHDR.reg b/参考/NexBox-main/aq_registry/启用DirectX AutoHDR.reg deleted file mode 100644 index ece7765..0000000 --- a/参考/NexBox-main/aq_registry/启用DirectX AutoHDR.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 启用 DirectX Auto HDR 自动高动态范围 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"AutoHDREnable"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/启用DirectX Flip Model.reg b/参考/NexBox-main/aq_registry/启用DirectX Flip Model.reg deleted file mode 100644 index dff2f44..0000000 --- a/参考/NexBox-main/aq_registry/启用DirectX Flip Model.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 强制启用 DirectX Flip Model 呈现模式 -; 减少帧延迟,改善 VSync 和 VRR 兼容性 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences] -"DirectXUserGlobalSettings"="SwapEffectUpgradeEnable=1;" diff --git a/参考/NexBox-main/aq_registry/启用DirectX VRR优化.reg b/参考/NexBox-main/aq_registry/启用DirectX VRR优化.reg deleted file mode 100644 index 156e563..0000000 --- a/参考/NexBox-main/aq_registry/启用DirectX VRR优化.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 启用 DirectX VRR (可变刷新率) 优化 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"VRROptimizeEnable"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/启用Intel TSX.reg b/参考/NexBox-main/aq_registry/启用Intel TSX.reg deleted file mode 100644 index 5b69742..0000000 --- a/参考/NexBox-main/aq_registry/启用Intel TSX.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 启用 Intel TSX(事务性同步扩展) -; TSX 可以提升多线程应用性能 -; 仅对支持 TSX 的 Intel CPU 有效 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel] -"DisableTsx"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/启用NVIDIA Per-CPU DPC.reg b/参考/NexBox-main/aq_registry/启用NVIDIA Per-CPU DPC.reg deleted file mode 100644 index fc694a6..0000000 --- a/参考/NexBox-main/aq_registry/启用NVIDIA Per-CPU DPC.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 启用 NVIDIA Per-CPU Core DPC -; 让 GPU 中断分散到多个 CPU 核心处理,减少单核瓶颈 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RmGpsPsEnablePerCpuCoreDpc"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RmGpsPsEnablePerCpuCoreDpc"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/启用NVIDIA锐化.reg b/参考/NexBox-main/aq_registry/启用NVIDIA锐化.reg deleted file mode 100644 index 4473a89..0000000 --- a/参考/NexBox-main/aq_registry/启用NVIDIA锐化.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 启用 NVIDIA Image Sharpening 全局锐化 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\FTS] -"EnableGR535"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\FTS] -"EnableGR535"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/强制启用AMD Shader Cache.reg b/参考/NexBox-main/aq_registry/强制启用AMD Shader Cache.reg deleted file mode 100644 index 3772b89..0000000 --- a/参考/NexBox-main/aq_registry/强制启用AMD Shader Cache.reg +++ /dev/null @@ -1,11 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 强制启用 AMD Shader Cache -; 确保着色器缓存始终处于开启状态 -; 减少游戏首次加载和场景切换时的编译卡顿 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000\UMD] -"ShaderCache"=dword:00000032 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001\UMD] -"ShaderCache"=dword:00000032 diff --git a/参考/NexBox-main/aq_registry/改进网络和 SR 响应能力.reg b/参考/NexBox-main/aq_registry/改进网络和 SR 响应能力.reg deleted file mode 100644 index 1480b98..0000000 --- a/参考/NexBox-main/aq_registry/改进网络和 SR 响应能力.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -;To keep the internet connection stable on your PC, Windows will sometimes throttle your network, which can reduce its speed. For online gaming this can result in a higher ping. -;You can rectify that by disabling Network Throttling and System Responsiveness for pure gaming and streaming. - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] -"NetworkThrottlingIndex"=dword:ffffffff -"SystemResponsiveness"=dword:00000000 - -!MADE BY OGTech! \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry/暂停Windows更新.reg b/参考/NexBox-main/aq_registry/暂停Windows更新.reg deleted file mode 100644 index 82b39d4..0000000 --- a/参考/NexBox-main/aq_registry/暂停Windows更新.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings] -"FlightSettingsMaxPauseDays"=dword:00001b58 -"PauseFeatureUpdatesStartTime"="2023-07-07T10:00:52Z" -"PauseFeatureUpdatesEndTime"="2042-09-05T09:59:52Z" -"PauseQualityUpdatesStartTime"="2023-07-07T10:00:52Z" -"PauseQualityUpdatesEndTime"="2042-09-05T09:59:52Z" -"PauseUpdatesStartTime"="2023-07-07T09:59:52Z" -"PauseUpdatesExpiryTime"="2042-09-05T09:59:52Z" \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry/禁用 GPU 抢占.reg b/参考/NexBox-main/aq_registry/禁用 GPU 抢占.reg deleted file mode 100644 index 007160e..0000000 Binary files a/参考/NexBox-main/aq_registry/禁用 GPU 抢占.reg and /dev/null differ diff --git a/参考/NexBox-main/aq_registry/禁用8.3文件名.reg b/参考/NexBox-main/aq_registry/禁用8.3文件名.reg deleted file mode 100644 index 1ba5893..0000000 --- a/参考/NexBox-main/aq_registry/禁用8.3文件名.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable 8.3 short filename creation on NTFS -;Reduces overhead when creating files - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] -"NtfsDisable8dot3NameCreation"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用CEIP-SQM.reg b/参考/NexBox-main/aq_registry/禁用CEIP-SQM.reg deleted file mode 100644 index 284816f..0000000 --- a/参考/NexBox-main/aq_registry/禁用CEIP-SQM.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable CEIP/SQM data collection - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\Windows] -"CEIPEnable"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows] -"CEIPEnable"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用DCOM.reg b/参考/NexBox-main/aq_registry/禁用DCOM.reg deleted file mode 100644 index 58cdb84..0000000 --- a/参考/NexBox-main/aq_registry/禁用DCOM.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 DCOM(分布式组件对象模型) -; 减少 RPC 通信开销,适合不使用远程管理/OLE 自动化的场景 -; 注意:某些旧版企业软件可能依赖 DCOM - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole] -"EnableDCOM"="N" diff --git a/参考/NexBox-main/aq_registry/禁用DX最大化窗口模式.reg b/参考/NexBox-main/aq_registry/禁用DX最大化窗口模式.reg deleted file mode 100644 index ab8e596..0000000 --- a/参考/NexBox-main/aq_registry/禁用DX最大化窗口模式.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 全局禁用 DirectX 最大化窗口模式 -; 强制游戏使用独占全屏或普通窗口,避免 DWM 合成延迟 -; 通过环境变量 __COMPAT_LAYER 实现 - -[HKEY_CURRENT_USER\Environment] -"__COMPAT_LAYER"="~ DISABLEDXMAXIMIZEDWINDOWEDMODE" diff --git a/参考/NexBox-main/aq_registry/禁用DotNet遥测.reg b/参考/NexBox-main/aq_registry/禁用DotNet遥测.reg deleted file mode 100644 index 8a2bc64..0000000 --- a/参考/NexBox-main/aq_registry/禁用DotNet遥测.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable .NET CLI Telemetry - -[HKEY_CURRENT_USER\Environment] -"DOTNET_CLI_TELEMETRY_OPTOUT"="1" diff --git a/参考/NexBox-main/aq_registry/禁用Edge启动加速.reg b/参考/NexBox-main/aq_registry/禁用Edge启动加速.reg deleted file mode 100644 index 6dfa264..0000000 --- a/参考/NexBox-main/aq_registry/禁用Edge启动加速.reg +++ /dev/null @@ -1,11 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Microsoft Edge Startup Boost and background running -;StartupBoostEnabled=0 prevents Edge from pre-launching at system startup -;AllowPrelaunch=0 prevents Edge from pre-launching in the background -;BackgroundModeEnabled=0 prevents Edge from running in the background after closing - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge] -"StartupBoostEnabled"=dword:00000000 -"AllowPrelaunch"=dword:00000000 -"BackgroundModeEnabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用GameBar提示.reg b/参考/NexBox-main/aq_registry/禁用GameBar提示.reg deleted file mode 100644 index bec49c7..0000000 --- a/参考/NexBox-main/aq_registry/禁用GameBar提示.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 Game Bar 控制器快捷键和启动面板提示 - -[HKEY_CURRENT_USER\Software\Microsoft\GameBar] -"UseNexusForGameBarEnabled"=dword:00000000 -"ShowStartupPanel"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用Miracast和Overlay.reg b/参考/NexBox-main/aq_registry/禁用Miracast和Overlay.reg deleted file mode 100644 index e6e4368..0000000 --- a/参考/NexBox-main/aq_registry/禁用Miracast和Overlay.reg +++ /dev/null @@ -1,13 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 Miracast 和 NVIDIA 覆盖层 -; Miracast 是无线投屏协议,不用时可禁用减少后台 -; Overlay 是驱动叠加层(非 MPO),影响帧延迟 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"PlatformSupportMiracast"=dword:00000000 -"DisableOverlay"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"PlatformSupportMiracast"=dword:00000000 -"DisableOverlay"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用NTFS加密.reg b/参考/NexBox-main/aq_registry/禁用NTFS加密.reg deleted file mode 100644 index 8c0407b..0000000 --- a/参考/NexBox-main/aq_registry/禁用NTFS加密.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NTFS 文件系统加密支持 -; 关闭 EFS(Encrypting File System)功能 -; 减少文件系统开销,大多数家庭用户不使用 EFS - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies] -"NtfsDisableEncryption"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA GPU电源管理.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA GPU电源管理.reg deleted file mode 100644 index 41b0b84..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA GPU电源管理.reg +++ /dev/null @@ -1,13 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA GPU 电源管理 -; 关闭运行时电源管理和 ASPM(活动状态电源管理) -; 确保 PCIe 链路始终保持全速 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"EnableRuntimePowerManagement"=dword:00000000 -"DisableGpuASPMFlags"=dword:00000003 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"EnableRuntimePowerManagement"=dword:00000000 -"DisableGpuASPMFlags"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA HDCP.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA HDCP.reg deleted file mode 100644 index 683684b..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA HDCP.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA HDCP (High-bandwidth Digital Content Protection) -; 减少显卡处理 HDCP 握手的开销,对游戏和非 DRM 内容无负面影响 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RMHdcpKeyglobZero"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RMHdcpKeyglobZero"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA写合并.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA写合并.reg deleted file mode 100644 index 0b5695a..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA写合并.reg +++ /dev/null @@ -1,11 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA 写合并(Write Combining) -; 关闭 CPU 对 GPU 内存写操作的合并缓冲 -; 可能降低延迟但会增加总线流量,适合竞技场景 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"DisableWriteCombining"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"DisableWriteCombining"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA时钟门控.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA时钟门控.reg deleted file mode 100644 index 5efc2bd..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA时钟门控.reg +++ /dev/null @@ -1,19 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA 5 类时钟门控(Clock Gating) -; BLCG / ELCG / ELPG / FSPG / SLCG -; 时钟门控是省电机制,禁用后 GPU 各单元始终保持时钟信号,减少微卡顿 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RMDisableBlcg"=dword:00000001 -"RMDisableElcg"=dword:00000001 -"RMDisableElpg"=dword:00000001 -"RMDisableFspg"=dword:00000001 -"RMDisableSlcg"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RMDisableBlcg"=dword:00000001 -"RMDisableElcg"=dword:00000001 -"RMDisableElpg"=dword:00000001 -"RMDisableFspg"=dword:00000001 -"RMDisableSlcg"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA遥测.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA遥测.reg deleted file mode 100644 index f926e45..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA遥测.reg +++ /dev/null @@ -1,15 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA 遥测数据收集 -; 阻止 GeForce Experience 和驱动发送使用统计 - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\NvControlPanel2\Client] -"OptInOrOutPreference"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\FTS] -"EnableRID66610"=dword:00000000 -"EnableRID64640"=dword:00000000 -"EnableRID44231"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NvTelemetryContainer] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用NVIDIA驱动日志.reg b/参考/NexBox-main/aq_registry/禁用NVIDIA驱动日志.reg deleted file mode 100644 index e7197be..0000000 --- a/参考/NexBox-main/aq_registry/禁用NVIDIA驱动日志.reg +++ /dev/null @@ -1,17 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 NVIDIA 驱动内部日志记录 -; 关闭 Warning/Paging/Event/Error 日志条目 -; 减少驱动层面的 I/O 开销 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"LogWarningEntries"=dword:00000000 -"LogPagingEntries"=dword:00000000 -"LogEventEntries"=dword:00000000 -"LogErrorEntries"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"LogWarningEntries"=dword:00000000 -"LogPagingEntries"=dword:00000000 -"LogEventEntries"=dword:00000000 -"LogErrorEntries"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用StorageSense.reg b/参考/NexBox-main/aq_registry/禁用StorageSense.reg deleted file mode 100644 index 2262e77..0000000 --- a/参考/NexBox-main/aq_registry/禁用StorageSense.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 Storage Sense 自动清理 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\StorageSense] -"AllowStorageSenseGlobal"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用UCPD.reg b/参考/NexBox-main/aq_registry/禁用UCPD.reg deleted file mode 100644 index d4dc6fa..0000000 --- a/参考/NexBox-main/aq_registry/禁用UCPD.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable UCPD (User Choice Protection Driver) - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UCPD] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用Windows错误报告.reg b/参考/NexBox-main/aq_registry/禁用Windows错误报告.reg deleted file mode 100644 index 14a1949..0000000 --- a/参考/NexBox-main/aq_registry/禁用Windows错误报告.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Windows Error Reporting - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting] -"Disabled"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting] -"Disabled"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用下载地图管理器.reg b/参考/NexBox-main/aq_registry/禁用下载地图管理器.reg deleted file mode 100644 index 8e41583..0000000 --- a/参考/NexBox-main/aq_registry/禁用下载地图管理器.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Windows service for application access to downloaded maps.This service is started on-demand by application accessing downloaded maps. -;Disabling this service will prevent apps from accessing maps. - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker] -"Start"=dword:00000004 - -!MADE BY OGTech! \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry/禁用交付优化.reg b/参考/NexBox-main/aq_registry/禁用交付优化.reg deleted file mode 100644 index ebffcc6..0000000 --- a/参考/NexBox-main/aq_registry/禁用交付优化.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Delivery Optimization (P2P update distribution) -;Prevents Windows from using peer-to-peer technology to distribute updates -;DODownloadMode=0 disables P2P downloads entirely - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization] -"DODownloadMode"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用传感器服务.reg b/参考/NexBox-main/aq_registry/禁用传感器服务.reg deleted file mode 100644 index 0e14884..0000000 --- a/参考/NexBox-main/aq_registry/禁用传感器服务.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用传感器监控服务 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SensrSvc] -"Start"=dword:00000004 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SensorDataService] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用传真服务.reg b/参考/NexBox-main/aq_registry/禁用传真服务.reg deleted file mode 100644 index 2d94206..0000000 --- a/参考/NexBox-main/aq_registry/禁用传真服务.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用传真服务 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用写入反馈.reg b/参考/NexBox-main/aq_registry/禁用写入反馈.reg deleted file mode 100644 index ecc594d..0000000 --- a/参考/NexBox-main/aq_registry/禁用写入反馈.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable handwriting input feedback/writing data collection - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\TabletTip\1.7] -"EnableInkingWithTouch"=dword:00000000 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Input\TIPC] -"Enabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用后台应用.reg b/参考/NexBox-main/aq_registry/禁用后台应用.reg deleted file mode 100644 index b2b0a1a..0000000 --- a/参考/NexBox-main/aq_registry/禁用后台应用.reg +++ /dev/null @@ -1,12 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Closing programs running in the background on your computer can free up system resources for your other programs. -;This can resolve problems where your system is running slowly. - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications] -"GlobalUserDisabled"=dword:00000001 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] -"BackgroundAppGlobalToggle"=dword:00000000 - -!MADE BY OGTech! \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry/禁用启动延迟.reg b/参考/NexBox-main/aq_registry/禁用启动延迟.reg deleted file mode 100644 index 709a42a..0000000 --- a/参考/NexBox-main/aq_registry/禁用启动延迟.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 移除启动延迟,让开机后程序更快加载 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize] -"StartupDelayInMSec"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用广播DVR服务.reg b/参考/NexBox-main/aq_registry/禁用广播DVR服务.reg deleted file mode 100644 index 1068f9c..0000000 --- a/参考/NexBox-main/aq_registry/禁用广播DVR服务.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用广播 DVR 用户服务 -; BcastDVRUserService 是 Windows 游戏录制后台服务 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BcastDVRUserService] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用应用影响遥测.reg b/参考/NexBox-main/aq_registry/禁用应用影响遥测.reg deleted file mode 100644 index f6dad09..0000000 --- a/参考/NexBox-main/aq_registry/禁用应用影响遥测.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Application Impact Telemetry (policy level) - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"AITEnable"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用应用影响遥测代理.reg b/参考/NexBox-main/aq_registry/禁用应用影响遥测代理.reg deleted file mode 100644 index 9691e8e..0000000 --- a/参考/NexBox-main/aq_registry/禁用应用影响遥测代理.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Application Impact Telemetry Agent - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"AITEnable"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用应用程序兼容性.reg b/参考/NexBox-main/aq_registry/禁用应用程序兼容性.reg deleted file mode 100644 index 3fbe1a2..0000000 --- a/参考/NexBox-main/aq_registry/禁用应用程序兼容性.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Application Compatibility Engine, Telemetry and PCA - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"DisableEngine"=dword:00000001 -"AITEnable"=dword:00000000 -"DisablePCA"=dword:00000001 -"DisableUAR"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用性能提醒.reg b/参考/NexBox-main/aq_registry/禁用性能提醒.reg deleted file mode 100644 index f312dc1..0000000 --- a/参考/NexBox-main/aq_registry/禁用性能提醒.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable performance improvement app suggestions - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager] -"SubscribedContent-314559Enabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用打印服务.reg b/参考/NexBox-main/aq_registry/禁用打印服务.reg deleted file mode 100644 index a44578f..0000000 --- a/参考/NexBox-main/aq_registry/禁用打印服务.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用打印后台处理程序服务 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/禁用搜索WebView2.reg b/参考/NexBox-main/aq_registry/禁用搜索WebView2.reg deleted file mode 100644 index ca3ccaf..0000000 --- a/参考/NexBox-main/aq_registry/禁用搜索WebView2.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用 Windows Search 中的 WebView2 渲染 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] -"WebView2Enabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用搜索全文件系统.reg b/参考/NexBox-main/aq_registry/禁用搜索全文件系统.reg deleted file mode 100644 index a42134d..0000000 --- a/参考/NexBox-main/aq_registry/禁用搜索全文件系统.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 禁用搜索全文件系统(仅搜索索引位置) - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings] -"IsWholeFileSystemSearchEnabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用更新保留存储.reg b/参考/NexBox-main/aq_registry/禁用更新保留存储.reg deleted file mode 100644 index b957e7e..0000000 --- a/参考/NexBox-main/aq_registry/禁用更新保留存储.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Reserved Storage for Windows Updates -;Frees up ~7GB of reserved disk space - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager] -"ShippedWithReserves"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用最后访问更新.reg b/参考/NexBox-main/aq_registry/禁用最后访问更新.reg deleted file mode 100644 index db8541d..0000000 --- a/参考/NexBox-main/aq_registry/禁用最后访问更新.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable NTFS Last Access Time Update -;Reduces disk writes on every file access - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] -"NtfsDisableLastAccessUpdate"=dword:80000003 diff --git a/参考/NexBox-main/aq_registry/禁用步骤记录器.reg b/参考/NexBox-main/aq_registry/禁用步骤记录器.reg deleted file mode 100644 index 1691f35..0000000 --- a/参考/NexBox-main/aq_registry/禁用步骤记录器.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Steps Recorder (Problem Steps Recorder) - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"DisableUAR"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用游戏硬盘录像机Game DVR.reg b/参考/NexBox-main/aq_registry/禁用游戏硬盘录像机Game DVR.reg deleted file mode 100644 index 5796e0c..0000000 Binary files a/参考/NexBox-main/aq_registry/禁用游戏硬盘录像机Game DVR.reg and /dev/null differ diff --git a/参考/NexBox-main/aq_registry/禁用省电模式.reg b/参考/NexBox-main/aq_registry/禁用省电模式.reg deleted file mode 100644 index 3236b14..0000000 --- a/参考/NexBox-main/aq_registry/禁用省电模式.reg +++ /dev/null @@ -1,17 +0,0 @@ -Windows Registry Editor Version 5.00 - -;NOTE!! I RECOMMEND TO USE THIS TWEAK ONLY ON PCs, IF YOU ARE A LAPTOP USER USING THIS TWEAK WILL DRAIN YOUR BATTERY LIFE. -;(IF YOU DON'T MIND A SHORTER BATTERY LIFE, THEN IT'S OKAY TO DISABLE) - -;Power throttling that limits the apps from draining your battery or using an excessive amount of power. -;Hibernate mode saves all of your open documents and running apps while turning off the PC and resumes everything where you left off when you wake your PC/Laptop up. -;The power saving modes reduces the performance by throttling the CPU/GPU clock speed. -;By disabling this, you will be able to gain more frames per second.  - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling] -"PowerThrottlingOff"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power] -"HibernateEnabledDefault"=dword:00000000 - -!MADE BY OGTech! \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry/禁用网络摄像头遥测.reg b/参考/NexBox-main/aq_registry/禁用网络摄像头遥测.reg deleted file mode 100644 index ce4da6c..0000000 --- a/参考/NexBox-main/aq_registry/禁用网络摄像头遥测.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable webcam telemetry at system level - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam] -"Value"="Deny" diff --git a/参考/NexBox-main/aq_registry/禁用自动维护.reg b/参考/NexBox-main/aq_registry/禁用自动维护.reg deleted file mode 100644 index bcc4ad0..0000000 --- a/参考/NexBox-main/aq_registry/禁用自动维护.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Windows Automatic Maintenance - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance] -"MaintenanceDisabled"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用计划诊断.reg b/参考/NexBox-main/aq_registry/禁用计划诊断.reg deleted file mode 100644 index 1b99978..0000000 --- a/参考/NexBox-main/aq_registry/禁用计划诊断.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable Scheduled Diagnostics - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScheduledDiagnostics] -"EnabledExecution"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/禁用许可遥测.reg b/参考/NexBox-main/aq_registry/禁用许可遥测.reg deleted file mode 100644 index bbcbd53..0000000 --- a/参考/NexBox-main/aq_registry/禁用许可遥测.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable License Telemetry - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform] -"NoGenTicket"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/禁用遥测服务.reg b/参考/NexBox-main/aq_registry/禁用遥测服务.reg deleted file mode 100644 index a8e4dd1..0000000 --- a/参考/NexBox-main/aq_registry/禁用遥测服务.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Disable DiagTrack and dmwappushservice telemetry services - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack] -"Start"=dword:00000004 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice] -"Start"=dword:00000004 diff --git a/参考/NexBox-main/aq_registry/精简Edge广告推荐.reg b/参考/NexBox-main/aq_registry/精简Edge广告推荐.reg deleted file mode 100644 index cbed778..0000000 --- a/参考/NexBox-main/aq_registry/精简Edge广告推荐.reg +++ /dev/null @@ -1,19 +0,0 @@ -Windows Registry Editor Version 5.00 - -;Reduce Microsoft Edge recommendations, ads, shopping assistant, first-run prompts, and new tab noise -;This uses Microsoft Edge policies only. It does not uninstall, block, or disable Edge updates. - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge] -"HideFirstRunExperience"=dword:00000001 -"HubsSidebarEnabled"=dword:00000000 -"PersonalizationReportingEnabled"=dword:00000000 -"AdsSettingForIntrusiveAdsSites"=dword:00000002 -"NewTabPageContentEnabled"=dword:00000000 -"NewTabPageQuickLinksEnabled"=dword:00000000 -"ConfigureDoNotTrack"=dword:00000001 -"SearchSuggestEnabled"=dword:00000000 -"EdgeShoppingAssistantEnabled"=dword:00000000 -"DiagnosticData"=dword:00000001 -"NewTabPageHideDefaultTopSites"=dword:00000001 -"ShowRecommendationsEnabled"=dword:00000000 -"SpotlightExperiencesAndRecommendationsEnabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry/缩短任务超时.reg b/参考/NexBox-main/aq_registry/缩短任务超时.reg deleted file mode 100644 index 491030b..0000000 --- a/参考/NexBox-main/aq_registry/缩短任务超时.reg +++ /dev/null @@ -1,8 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 缩短系统超时值,加快关机和应用响应 - -[HKEY_CURRENT_USER\Control Panel\Desktop] -"HungAppTimeout"="1000" -"WaitToKillAppTimeout"="2000" -"LowLevelHooksTimeout"="1000" diff --git a/参考/NexBox-main/aq_registry/缩短服务超时.reg b/参考/NexBox-main/aq_registry/缩短服务超时.reg deleted file mode 100644 index 89cc49b..0000000 --- a/参考/NexBox-main/aq_registry/缩短服务超时.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 缩短服务关闭超时,加快关机速度 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] -"WaitToKillServiceTimeout"="2000" diff --git a/参考/NexBox-main/aq_registry/锁定NVIDIA P-State 0.reg b/参考/NexBox-main/aq_registry/锁定NVIDIA P-State 0.reg deleted file mode 100644 index c36a4a0..0000000 --- a/参考/NexBox-main/aq_registry/锁定NVIDIA P-State 0.reg +++ /dev/null @@ -1,11 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 锁定 NVIDIA GPU P-State 到 P0(最高性能状态) -; 防止显卡在游戏中动态降频,保持最大时钟频率 -; 注意:会增加待机功耗和温度 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"DisableDynamicPstate"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"DisableDynamicPstate"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry/鼠标悬停延迟优化.reg b/参考/NexBox-main/aq_registry/鼠标悬停延迟优化.reg deleted file mode 100644 index 8d76d32..0000000 --- a/参考/NexBox-main/aq_registry/鼠标悬停延迟优化.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 将鼠标悬停延迟从默认 400ms 降低到 10ms -; 让工具提示和悬停效果更快响应 - -[HKEY_CURRENT_USER\Control Panel\Mouse] -"MouseHoverTime"="10" diff --git a/参考/NexBox-main/aq_registry_restore/MMCSS完整游戏配置.restore.reg b/参考/NexBox-main/aq_registry_restore/MMCSS完整游戏配置.restore.reg deleted file mode 100644 index a2aaa63..0000000 --- a/参考/NexBox-main/aq_registry_restore/MMCSS完整游戏配置.restore.reg +++ /dev/null @@ -1,21 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] -"NoLazyMode"=- -"AlwaysOn"=- - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] -"Affinity"=dword:00000000 -"Background Only"="False" -"Clock Rate"=dword:00002710 -"GPU Priority"=dword:00000008 -"Priority"=dword:00000002 -"Scheduling Category"="Medium" -"SFIO Priority"="Normal" - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Pro Audio] -"Priority"=dword:00000001 -"Scheduling Category"="High" -"SFIO Priority"="High" -"GPU Priority"=dword:00000008 -"Clock Rate"=dword:00002710 diff --git a/参考/NexBox-main/aq_registry_restore/NVIDIA低延迟阈值优化.restore.reg b/参考/NexBox-main/aq_registry_restore/NVIDIA低延迟阈值优化.restore.reg deleted file mode 100644 index c2011d0..0000000 --- a/参考/NexBox-main/aq_registry_restore/NVIDIA低延迟阈值优化.restore.reg +++ /dev/null @@ -1,25 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"D3PCLatency"=- -"F1TransitionLatency"=- -"Node3DLowLatency"=- -"RmGspcMaxFtuS"=- -"RmGspcMinFtuS"=- -"RmGspcPerioduS"=- -"RMLpwrEiIdleThreshold"=- -"RMLpwrGrIdleThreshold"=- -"RMLpwrGrRgIdleThreshold"=- -"RMLpwrMsIdleThreshold"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"D3PCLatency"=- -"F1TransitionLatency"=- -"Node3DLowLatency"=- -"RmGspcMaxFtuS"=- -"RmGspcMinFtuS"=- -"RmGspcPerioduS"=- -"RMLpwrEiIdleThreshold"=- -"RMLpwrGrIdleThreshold"=- -"RMLpwrGrRgIdleThreshold"=- -"RMLpwrMsIdleThreshold"=- diff --git a/参考/NexBox-main/aq_registry_restore/NVMe调优.restore.reg b/参考/NexBox-main/aq_registry_restore/NVMe调优.restore.reg deleted file mode 100644 index 079ff22..0000000 --- a/参考/NexBox-main/aq_registry_restore/NVMe调优.restore.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device] -"ContiguousMemoryFromAnyNode"=- -"LogSize"=- -"IdlePowerMode"=- diff --git a/参考/NexBox-main/aq_registry_restore/优先考虑游戏责任.restore.reg b/参考/NexBox-main/aq_registry_restore/优先考虑游戏责任.restore.reg deleted file mode 100644 index 73b626d..0000000 --- a/参考/NexBox-main/aq_registry_restore/优先考虑游戏责任.restore.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] -"Affinity"=dword:00000000 -"Background Only"="False" -"Clock Rate"=dword:00002710 -"GPU Priority"=dword:00000008 -"Priority"=dword:00000002 -"Scheduling Category"="Medium" -"SFIO Priority"="Normal" diff --git a/参考/NexBox-main/aq_registry_restore/关闭自动色彩管理.restore.reg b/参考/NexBox-main/aq_registry_restore/关闭自动色彩管理.restore.reg deleted file mode 100644 index 29615e6..0000000 --- a/参考/NexBox-main/aq_registry_restore/关闭自动色彩管理.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"AutoColorManagementEnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/合并ServiceHost进程.restore.reg b/参考/NexBox-main/aq_registry_restore/合并ServiceHost进程.restore.reg deleted file mode 100644 index 4ffa4df..0000000 --- a/参考/NexBox-main/aq_registry_restore/合并ServiceHost进程.restore.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -; 恢复默认拆分阈值 (380000 KB ≈ 3.8GB) - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] -"SvcHostSplitThresholdInKB"=dword:0005cdd4 diff --git a/参考/NexBox-main/aq_registry_restore/启用DirectX AutoHDR.restore.reg b/参考/NexBox-main/aq_registry_restore/启用DirectX AutoHDR.restore.reg deleted file mode 100644 index a29b19a..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用DirectX AutoHDR.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"AutoHDREnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/启用DirectX Flip Model.restore.reg b/参考/NexBox-main/aq_registry_restore/启用DirectX Flip Model.restore.reg deleted file mode 100644 index afdcfb3..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用DirectX Flip Model.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences] -"DirectXUserGlobalSettings"=- diff --git a/参考/NexBox-main/aq_registry_restore/启用DirectX VRR优化.restore.reg b/参考/NexBox-main/aq_registry_restore/启用DirectX VRR优化.restore.reg deleted file mode 100644 index 7fadba4..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用DirectX VRR优化.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\DirectX\GraphicsSettings] -"VRROptimizeEnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/启用Intel TSX.restore.reg b/参考/NexBox-main/aq_registry_restore/启用Intel TSX.restore.reg deleted file mode 100644 index eab6eb0..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用Intel TSX.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel] -"DisableTsx"=- diff --git a/参考/NexBox-main/aq_registry_restore/启用NVIDIA Per-CPU DPC.restore.reg b/参考/NexBox-main/aq_registry_restore/启用NVIDIA Per-CPU DPC.restore.reg deleted file mode 100644 index 0ae51fe..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用NVIDIA Per-CPU DPC.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RmGpsPsEnablePerCpuCoreDpc"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RmGpsPsEnablePerCpuCoreDpc"=- diff --git a/参考/NexBox-main/aq_registry_restore/启用NVIDIA锐化.restore.reg b/参考/NexBox-main/aq_registry_restore/启用NVIDIA锐化.restore.reg deleted file mode 100644 index 5389cf6..0000000 --- a/参考/NexBox-main/aq_registry_restore/启用NVIDIA锐化.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\FTS] -"EnableGR535"=- - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\FTS] -"EnableGR535"=- diff --git a/参考/NexBox-main/aq_registry_restore/强制启用AMD Shader Cache.restore.reg b/参考/NexBox-main/aq_registry_restore/强制启用AMD Shader Cache.restore.reg deleted file mode 100644 index 541faa2..0000000 --- a/参考/NexBox-main/aq_registry_restore/强制启用AMD Shader Cache.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000\UMD] -"ShaderCache"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001\UMD] -"ShaderCache"=- diff --git a/参考/NexBox-main/aq_registry_restore/改进网络和 SR 响应能力.restore.reg b/参考/NexBox-main/aq_registry_restore/改进网络和 SR 响应能力.restore.reg deleted file mode 100644 index cd0be1e..0000000 --- a/参考/NexBox-main/aq_registry_restore/改进网络和 SR 响应能力.restore.reg +++ /dev/null @@ -1,5 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] -"NetworkThrottlingIndex"=dword:0000000a -"SystemResponsiveness"=dword:00000014 diff --git a/参考/NexBox-main/aq_registry_restore/暂停Windows更新.restore.reg b/参考/NexBox-main/aq_registry_restore/暂停Windows更新.restore.reg deleted file mode 100644 index 3d603d9..0000000 --- a/参考/NexBox-main/aq_registry_restore/暂停Windows更新.restore.reg +++ /dev/null @@ -1,10 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings] -"FlightSettingsMaxPauseDays"=- -"PauseFeatureUpdatesStartTime"=- -"PauseFeatureUpdatesEndTime"=- -"PauseQualityUpdatesStartTime"=- -"PauseQualityUpdatesEndTime"=- -"PauseUpdatesStartTime"=- -"PauseUpdatesExpiryTime"=- \ No newline at end of file diff --git a/参考/NexBox-main/aq_registry_restore/禁用 GPU 抢占.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用 GPU 抢占.restore.reg deleted file mode 100644 index 4dc3eee..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用 GPU 抢占.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Scheduler] -"EnablePreemption"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用8.3文件名.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用8.3文件名.restore.reg deleted file mode 100644 index 3c4540c..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用8.3文件名.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] -"NtfsDisable8dot3NameCreation"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry_restore/禁用CEIP-SQM.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用CEIP-SQM.restore.reg deleted file mode 100644 index d2e6787..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用CEIP-SQM.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\Windows] -"CEIPEnable"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows] -"CEIPEnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用DCOM.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用DCOM.restore.reg deleted file mode 100644 index 4632655..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用DCOM.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole] -"EnableDCOM"="Y" diff --git a/参考/NexBox-main/aq_registry_restore/禁用DX最大化窗口模式.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用DX最大化窗口模式.restore.reg deleted file mode 100644 index f3fe044..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用DX最大化窗口模式.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Environment] -"__COMPAT_LAYER"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用DotNet遥测.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用DotNet遥测.restore.reg deleted file mode 100644 index b5498bf..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用DotNet遥测.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Environment] -"DOTNET_CLI_TELEMETRY_OPTOUT"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用Edge启动加速.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用Edge启动加速.restore.reg deleted file mode 100644 index 0370555..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用Edge启动加速.restore.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge] -"StartupBoostEnabled"=- -"AllowPrelaunch"=- -"BackgroundModeEnabled"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用GameBar提示.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用GameBar提示.restore.reg deleted file mode 100644 index b771d8b..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用GameBar提示.restore.reg +++ /dev/null @@ -1,5 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\GameBar] -"UseNexusForGameBarEnabled"=dword:00000001 -"ShowStartupPanel"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用Miracast和Overlay.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用Miracast和Overlay.restore.reg deleted file mode 100644 index e519f97..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用Miracast和Overlay.restore.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"PlatformSupportMiracast"=- -"DisableOverlay"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"PlatformSupportMiracast"=- -"DisableOverlay"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用NTFS加密.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NTFS加密.restore.reg deleted file mode 100644 index 5ff65e4..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NTFS加密.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies] -"NtfsDisableEncryption"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA GPU电源管理.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA GPU电源管理.restore.reg deleted file mode 100644 index daed3c9..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA GPU电源管理.restore.reg +++ /dev/null @@ -1,9 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"EnableRuntimePowerManagement"=- -"DisableGpuASPMFlags"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"EnableRuntimePowerManagement"=- -"DisableGpuASPMFlags"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA HDCP.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA HDCP.restore.reg deleted file mode 100644 index b0dd133..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA HDCP.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RMHdcpKeyglobZero"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RMHdcpKeyglobZero"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA写合并.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA写合并.restore.reg deleted file mode 100644 index 48a10f3..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA写合并.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"DisableWriteCombining"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"DisableWriteCombining"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA时钟门控.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA时钟门控.restore.reg deleted file mode 100644 index 997b600..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA时钟门控.restore.reg +++ /dev/null @@ -1,15 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"RMDisableBlcg"=- -"RMDisableElcg"=- -"RMDisableElpg"=- -"RMDisableFspg"=- -"RMDisableSlcg"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"RMDisableBlcg"=- -"RMDisableElcg"=- -"RMDisableElpg"=- -"RMDisableFspg"=- -"RMDisableSlcg"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA遥测.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA遥测.restore.reg deleted file mode 100644 index b5fe5a1..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA遥测.restore.reg +++ /dev/null @@ -1,12 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\NvControlPanel2\Client] -"OptInOrOutPreference"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\FTS] -"EnableRID66610"=- -"EnableRID64640"=- -"EnableRID44231"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NvTelemetryContainer] -"Start"=dword:00000002 diff --git a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA驱动日志.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用NVIDIA驱动日志.restore.reg deleted file mode 100644 index 6969d58..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用NVIDIA驱动日志.restore.reg +++ /dev/null @@ -1,13 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"LogWarningEntries"=- -"LogPagingEntries"=- -"LogEventEntries"=- -"LogErrorEntries"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"LogWarningEntries"=- -"LogPagingEntries"=- -"LogEventEntries"=- -"LogErrorEntries"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用StorageSense.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用StorageSense.restore.reg deleted file mode 100644 index ee4cd3a..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用StorageSense.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\StorageSense] -"AllowStorageSenseGlobal"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用UCPD.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用UCPD.restore.reg deleted file mode 100644 index 5bac760..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用UCPD.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UCPD] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/禁用Windows错误报告.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用Windows错误报告.restore.reg deleted file mode 100644 index da2d1a5..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用Windows错误报告.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting] -"Disabled"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting] -"Disabled"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用下载地图管理器.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用下载地图管理器.restore.reg deleted file mode 100644 index eebb53a..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用下载地图管理器.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/禁用交付优化.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用交付优化.restore.reg deleted file mode 100644 index 64a2407..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用交付优化.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization] -"DODownloadMode"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用传感器服务.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用传感器服务.restore.reg deleted file mode 100644 index 0fd091d..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用传感器服务.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SensrSvc] -"Start"=dword:00000003 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SensorDataService] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/禁用传真服务.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用传真服务.restore.reg deleted file mode 100644 index 304f3fe..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用传真服务.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/禁用写入反馈.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用写入反馈.restore.reg deleted file mode 100644 index 63ba83e..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用写入反馈.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\TabletTip\1.7] -"EnableInkingWithTouch"=dword:00000001 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Input\TIPC] -"Enabled"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用后台应用.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用后台应用.restore.reg deleted file mode 100644 index f2c71c5..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用后台应用.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications] -"GlobalUserDisabled"=dword:00000000 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] -"BackgroundAppGlobalToggle"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用启动延迟.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用启动延迟.restore.reg deleted file mode 100644 index f0d4d2f..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用启动延迟.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize] -"StartupDelayInMSec"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用广播DVR服务.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用广播DVR服务.restore.reg deleted file mode 100644 index b1ab3fc..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用广播DVR服务.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BcastDVRUserService] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测.restore.reg deleted file mode 100644 index e5593aa..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"AITEnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测代理.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测代理.restore.reg deleted file mode 100644 index e5593aa..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用应用影响遥测代理.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"AITEnable"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用应用程序兼容性.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用应用程序兼容性.restore.reg deleted file mode 100644 index c922b31..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用应用程序兼容性.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"DisableEngine"=- -"AITEnable"=- -"DisablePCA"=- -"DisableUAR"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用性能提醒.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用性能提醒.restore.reg deleted file mode 100644 index e4bc3f4..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用性能提醒.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager] -"SubscribedContent-314559Enabled"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用打印服务.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用打印服务.restore.reg deleted file mode 100644 index 869f61c..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用打印服务.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler] -"Start"=dword:00000002 diff --git a/参考/NexBox-main/aq_registry_restore/禁用搜索WebView2.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用搜索WebView2.restore.reg deleted file mode 100644 index 379c45e..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用搜索WebView2.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] -"WebView2Enabled"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用搜索全文件系统.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用搜索全文件系统.restore.reg deleted file mode 100644 index 5bfac4f..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用搜索全文件系统.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings] -"IsWholeFileSystemSearchEnabled"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用更新保留存储.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用更新保留存储.restore.reg deleted file mode 100644 index 0c4f8a9..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用更新保留存储.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager] -"ShippedWithReserves"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用最后访问更新.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用最后访问更新.restore.reg deleted file mode 100644 index d6e89cf..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用最后访问更新.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] -"NtfsDisableLastAccessUpdate"=dword:80000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用步骤记录器.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用步骤记录器.restore.reg deleted file mode 100644 index 08c6df0..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用步骤记录器.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat] -"DisableUAR"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用游戏硬盘录像机Game DVR.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用游戏硬盘录像机Game DVR.restore.reg deleted file mode 100644 index 87e18de..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用游戏硬盘录像机Game DVR.restore.reg +++ /dev/null @@ -1,17 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\System\GameConfigStore] -"GameDVR_Enabled"=dword:00000001 -"GameDVR_FSEBehaviorMode"=- -"GameDVR_HonorUserFSEBehaviorMode"=- -"GameDVR_DXGIHonorFSEWindowsCompatible"=- -"GameDVR_EFSEFeatureFlags"=- -"GameDVR_FSEBehavior"=- - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR] -"value"=- - -[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR] -"AppCaptureEnabled"=dword:00000001 - -[-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR] diff --git a/参考/NexBox-main/aq_registry_restore/禁用省电模式.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用省电模式.restore.reg deleted file mode 100644 index a5b1288..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用省电模式.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling] -"PowerThrottlingOff"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power] -"HibernateEnabledDefault"=dword:00000001 diff --git a/参考/NexBox-main/aq_registry_restore/禁用网络摄像头遥测.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用网络摄像头遥测.restore.reg deleted file mode 100644 index 15c397d..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用网络摄像头遥测.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam] -"Value"="Allow" diff --git a/参考/NexBox-main/aq_registry_restore/禁用自动维护.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用自动维护.restore.reg deleted file mode 100644 index 690351a..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用自动维护.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance] -"MaintenanceDisabled"=dword:00000000 diff --git a/参考/NexBox-main/aq_registry_restore/禁用计划诊断.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用计划诊断.restore.reg deleted file mode 100644 index 4c637cb..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用计划诊断.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScheduledDiagnostics] -"EnabledExecution"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用许可遥测.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用许可遥测.restore.reg deleted file mode 100644 index 6bf240e..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用许可遥测.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform] -"NoGenTicket"=- diff --git a/参考/NexBox-main/aq_registry_restore/禁用遥测服务.restore.reg b/参考/NexBox-main/aq_registry_restore/禁用遥测服务.restore.reg deleted file mode 100644 index eaf315a..0000000 --- a/参考/NexBox-main/aq_registry_restore/禁用遥测服务.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack] -"Start"=dword:00000002 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice] -"Start"=dword:00000003 diff --git a/参考/NexBox-main/aq_registry_restore/精简Edge广告推荐.restore.reg b/参考/NexBox-main/aq_registry_restore/精简Edge广告推荐.restore.reg deleted file mode 100644 index 859cfba..0000000 --- a/参考/NexBox-main/aq_registry_restore/精简Edge广告推荐.restore.reg +++ /dev/null @@ -1,16 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge] -"HideFirstRunExperience"=- -"HubsSidebarEnabled"=- -"PersonalizationReportingEnabled"=- -"AdsSettingForIntrusiveAdsSites"=- -"NewTabPageContentEnabled"=- -"NewTabPageQuickLinksEnabled"=- -"ConfigureDoNotTrack"=- -"SearchSuggestEnabled"=- -"EdgeShoppingAssistantEnabled"=- -"DiagnosticData"=- -"NewTabPageHideDefaultTopSites"=- -"ShowRecommendationsEnabled"=- -"SpotlightExperiencesAndRecommendationsEnabled"=- diff --git a/参考/NexBox-main/aq_registry_restore/缩短任务超时.restore.reg b/参考/NexBox-main/aq_registry_restore/缩短任务超时.restore.reg deleted file mode 100644 index 2a7ddb2..0000000 --- a/参考/NexBox-main/aq_registry_restore/缩短任务超时.restore.reg +++ /dev/null @@ -1,6 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Control Panel\Desktop] -"HungAppTimeout"="5000" -"WaitToKillAppTimeout"="20000" -"LowLevelHooksTimeout"=- diff --git a/参考/NexBox-main/aq_registry_restore/缩短服务超时.restore.reg b/参考/NexBox-main/aq_registry_restore/缩短服务超时.restore.reg deleted file mode 100644 index ff292c1..0000000 --- a/参考/NexBox-main/aq_registry_restore/缩短服务超时.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] -"WaitToKillServiceTimeout"="5000" diff --git a/参考/NexBox-main/aq_registry_restore/锁定NVIDIA P-State 0.restore.reg b/参考/NexBox-main/aq_registry_restore/锁定NVIDIA P-State 0.restore.reg deleted file mode 100644 index a3b3f32..0000000 --- a/参考/NexBox-main/aq_registry_restore/锁定NVIDIA P-State 0.restore.reg +++ /dev/null @@ -1,7 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] -"DisableDynamicPstate"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001] -"DisableDynamicPstate"=- diff --git a/参考/NexBox-main/aq_registry_restore/鼠标悬停延迟优化.restore.reg b/参考/NexBox-main/aq_registry_restore/鼠标悬停延迟优化.restore.reg deleted file mode 100644 index c8e4e4a..0000000 --- a/参考/NexBox-main/aq_registry_restore/鼠标悬停延迟优化.restore.reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Control Panel\Mouse] -"MouseHoverTime"="400" diff --git a/参考/NexBox-main/bun.lock b/参考/NexBox-main/bun.lock deleted file mode 100644 index 184df37..0000000 --- a/参考/NexBox-main/bun.lock +++ /dev/null @@ -1,1244 +0,0 @@ -{ - "lockfileVersion": 1, - "configVersion": 0, - "workspaces": { - "": { - "name": "nexbox", - "dependencies": { - "@chakra-ui/react": "^2.10.9", - "@dnd-kit/core": "^6.3.1", - "@dnd-kit/sortable": "^10.0.0", - "@dnd-kit/utilities": "^3.2.2", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@tauri-apps/api": "^2.10.1", - "@tauri-apps/plugin-clipboard-manager": "^2.3.2", - "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-process": "^2.3.1", - "@tauri-apps/plugin-shell": "^2.3.5", - "@tauri-apps/plugin-store": "^2.4.3", - "antd": "^5.22.6", - "dayjs": "^1.11.19", - "framer-motion": "^11.18.2", - "i18next": "^26.0.5", - "i18next-browser-languagedetector": "^8.2.1", - "lucide-react": "^0.487.0", - "pptxgenjs": "^4.0.1", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-i18next": "^17.0.4", - "react-icons": "^5.6.0", - "react-router-dom": "^7.1.5", - "zustand": "^5.0.2", - }, - "devDependencies": { - "@emotion/babel-plugin": "^11.13.5", - "@eslint/eslintrc": "^3.3.0", - "@tauri-apps/cli": "^2.10.1", - "@types/node": "^22.13.10", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "eslint": "^9.22.0", - "eslint-config-next": "^15.2.4", - "husky": "^9.1.7", - "prettier": "^3.5.3", - "typescript": "^5.8.2", - "vite": "^6.0.11", - }, - }, - }, - "packages": { - "@ant-design/colors": ["@ant-design/colors@7.2.1", "https://registry.npmmirror.com/@ant-design/colors/-/colors-7.2.1.tgz", { "dependencies": { "@ant-design/fast-color": "^2.0.6" } }, "sha512-lCHDcEzieu4GA3n8ELeZ5VQ8pKQAWcGGLRTQ50aQM2iqPpq2evTxER84jfdPvsPAtEcZ7m44NI45edFMo8oOYQ=="], - - "@ant-design/cssinjs": ["@ant-design/cssinjs@1.24.0", "https://registry.npmmirror.com/@ant-design/cssinjs/-/cssinjs-1.24.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.1", "@emotion/hash": "^0.8.0", "@emotion/unitless": "^0.7.5", "classnames": "^2.3.1", "csstype": "^3.1.3", "rc-util": "^5.35.0", "stylis": "^4.3.4" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-K4cYrJBsgvL+IoozUXYjbT6LHHNt+19a9zkvpBPxLjFHas1UpPM2A5MlhROb0BT8N8WoavM5VsP9MeSeNK/3mg=="], - - "@ant-design/cssinjs-utils": ["@ant-design/cssinjs-utils@1.1.3", "https://registry.npmmirror.com/@ant-design/cssinjs-utils/-/cssinjs-utils-1.1.3.tgz", { "dependencies": { "@ant-design/cssinjs": "^1.21.0", "@babel/runtime": "^7.23.2", "rc-util": "^5.38.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-nOoQMLW1l+xR1Co8NFVYiP8pZp3VjIIzqV6D6ShYF2ljtdwWJn5WSsH+7kvCktXL/yhEtWURKOfH5Xz/gzlwsg=="], - - "@ant-design/fast-color": ["@ant-design/fast-color@2.0.6", "https://registry.npmmirror.com/@ant-design/fast-color/-/fast-color-2.0.6.tgz", { "dependencies": { "@babel/runtime": "^7.24.7" } }, "sha512-y2217gk4NqL35giHl72o6Zzqji9O7vHh9YmhUVkPtAOpoTCH4uWxo/pr4VE8t0+ChEPs0qo4eJRC5Q1eXWo3vA=="], - - "@ant-design/icons": ["@ant-design/icons@5.6.1", "https://registry.npmmirror.com/@ant-design/icons/-/icons-5.6.1.tgz", { "dependencies": { "@ant-design/colors": "^7.0.0", "@ant-design/icons-svg": "^4.4.0", "@babel/runtime": "^7.24.8", "classnames": "^2.2.6", "rc-util": "^5.31.1" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-0/xS39c91WjPAZOWsvi1//zjx6kAp4kxWwctR6kuU6p133w8RU0D2dSCvZC19uQyharg/sAvYxGYWl01BbZZfg=="], - - "@ant-design/icons-svg": ["@ant-design/icons-svg@4.4.2", "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz", {}, "sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA=="], - - "@ant-design/react-slick": ["@ant-design/react-slick@1.1.2", "https://registry.npmmirror.com/@ant-design/react-slick/-/react-slick-1.1.2.tgz", { "dependencies": { "@babel/runtime": "^7.10.4", "classnames": "^2.2.5", "json2mq": "^0.2.0", "resize-observer-polyfill": "^1.5.1", "throttle-debounce": "^5.0.0" }, "peerDependencies": { "react": ">=16.9.0" } }, "sha512-EzlvzE6xQUBrZuuhSAFTdsr4P2bBBHGZwKFemEfq8gIGyIQCxalYfZW/T2ORbtQx5rU69o+WycP3exY/7T1hGA=="], - - "@babel/code-frame": ["@babel/code-frame@7.29.0", "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.29.0.tgz", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], - - "@babel/compat-data": ["@babel/compat-data@7.29.0", "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.29.0.tgz", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="], - - "@babel/core": ["@babel/core@7.29.0", "https://registry.npmmirror.com/@babel/core/-/core-7.29.0.tgz", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-module-transforms": "^7.28.6", "@babel/helpers": "^7.28.6", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="], - - "@babel/generator": ["@babel/generator@7.29.1", "https://registry.npmmirror.com/@babel/generator/-/generator-7.29.1.tgz", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="], - - "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.28.6", "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="], - - "@babel/helper-globals": ["@babel/helper-globals@7.28.0", "https://registry.npmmirror.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="], - - "@babel/helper-module-imports": ["@babel/helper-module-imports@7.28.6", "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", { "dependencies": { "@babel/traverse": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="], - - "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.6", "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", { "dependencies": { "@babel/helper-module-imports": "^7.28.6", "@babel/helper-validator-identifier": "^7.28.5", "@babel/traverse": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="], - - "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.28.6", "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", {}, "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug=="], - - "@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="], - - "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="], - - "@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="], - - "@babel/helpers": ["@babel/helpers@7.29.2", "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.29.2.tgz", { "dependencies": { "@babel/template": "^7.28.6", "@babel/types": "^7.29.0" } }, "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw=="], - - "@babel/parser": ["@babel/parser@7.29.2", "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.2.tgz", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": { "parser": "bin/babel-parser.js" } }, "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA=="], - - "@babel/plugin-transform-react-jsx-self": ["@babel/plugin-transform-react-jsx-self@7.27.1", "https://registry.npmmirror.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw=="], - - "@babel/plugin-transform-react-jsx-source": ["@babel/plugin-transform-react-jsx-source@7.27.1", "https://registry.npmmirror.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw=="], - - "@babel/runtime": ["@babel/runtime@7.29.2", "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.2.tgz", {}, "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g=="], - - "@babel/template": ["@babel/template@7.28.6", "https://registry.npmmirror.com/@babel/template/-/template-7.28.6.tgz", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="], - - "@babel/traverse": ["@babel/traverse@7.29.0", "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.29.0.tgz", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/types": "^7.29.0", "debug": "^4.3.1" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="], - - "@babel/types": ["@babel/types@7.29.0", "https://registry.npmmirror.com/@babel/types/-/types-7.29.0.tgz", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="], - - "@chakra-ui/anatomy": ["@chakra-ui/anatomy@2.3.6", "https://registry.npmmirror.com/@chakra-ui/anatomy/-/anatomy-2.3.6.tgz", {}, "sha512-TjmjyQouIZzha/l8JxdBZN1pKZTj7sLpJ0YkFnQFyqHcbfWggW9jKWzY1E0VBnhtFz/xF3KC6UAVuZVSJx+y0g=="], - - "@chakra-ui/hooks": ["@chakra-ui/hooks@2.4.5", "https://registry.npmmirror.com/@chakra-ui/hooks/-/hooks-2.4.5.tgz", { "dependencies": { "@chakra-ui/utils": "2.2.5", "@zag-js/element-size": "0.31.1", "copy-to-clipboard": "3.3.3", "framesync": "6.1.2" }, "peerDependencies": { "react": ">=18" } }, "sha512-601fWfHE2i7UjaxK/9lDLlOni6vk/I+04YDbM0BrelJy+eqxdlOmoN8Z6MZ3PzFh7ofERUASor+vL+/HaCaZ7w=="], - - "@chakra-ui/react": ["@chakra-ui/react@2.10.9", "https://registry.npmmirror.com/@chakra-ui/react/-/react-2.10.9.tgz", { "dependencies": { "@chakra-ui/hooks": "2.4.5", "@chakra-ui/styled-system": "2.12.4", "@chakra-ui/theme": "3.4.9", "@chakra-ui/utils": "2.2.5", "@popperjs/core": "^2.11.8", "@zag-js/focus-visible": "^0.31.1", "aria-hidden": "^1.2.3", "react-fast-compare": "3.2.2", "react-focus-lock": "^2.9.6", "react-remove-scroll": "^2.5.7" }, "peerDependencies": { "@emotion/react": ">=11", "@emotion/styled": ">=11", "framer-motion": ">=4.0.0", "react": ">=18", "react-dom": ">=18" } }, "sha512-lhdcgoocOiURwBNR3L8OioCNIaGCZqRfuKioLyaQLjOanl4jr0PQclsGb+w0cmito252vEWpsz2xRqF7y+Flrw=="], - - "@chakra-ui/styled-system": ["@chakra-ui/styled-system@2.12.4", "https://registry.npmmirror.com/@chakra-ui/styled-system/-/styled-system-2.12.4.tgz", { "dependencies": { "@chakra-ui/utils": "2.2.5", "csstype": "^3.1.2" } }, "sha512-oa07UG7Lic5hHSQtGRiMEnYjuhIa8lszyuVhZjZqR2Ap3VMF688y1MVPJ1pK+8OwY5uhXBgVd5c0+rI8aBZlwg=="], - - "@chakra-ui/theme": ["@chakra-ui/theme@3.4.9", "https://registry.npmmirror.com/@chakra-ui/theme/-/theme-3.4.9.tgz", { "dependencies": { "@chakra-ui/anatomy": "2.3.6", "@chakra-ui/theme-tools": "2.2.9", "@chakra-ui/utils": "2.2.5" }, "peerDependencies": { "@chakra-ui/styled-system": ">=2.8.0" } }, "sha512-GAom2SjSdRWTcX76/2yJOFJsOWHQeBgaynCUNBsHq62OafzvELrsSHDUw0bBqBb1c2ww0CclIvGilPup8kXBFA=="], - - "@chakra-ui/theme-tools": ["@chakra-ui/theme-tools@2.2.9", "https://registry.npmmirror.com/@chakra-ui/theme-tools/-/theme-tools-2.2.9.tgz", { "dependencies": { "@chakra-ui/anatomy": "2.3.6", "@chakra-ui/utils": "2.2.5", "color2k": "^2.0.2" }, "peerDependencies": { "@chakra-ui/styled-system": ">=2.0.0" } }, "sha512-PcbYL19lrVvEc7Oydy//jsy/MO/rZz1DvLyO6AoI+bI/+Kwz9WfOKsspbulEhRg5COayE0R/IZPsskXZ7Mp4bA=="], - - "@chakra-ui/utils": ["@chakra-ui/utils@2.2.5", "https://registry.npmmirror.com/@chakra-ui/utils/-/utils-2.2.5.tgz", { "dependencies": { "@types/lodash.mergewith": "4.6.9", "lodash.mergewith": "4.6.2" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-KTBCK+M5KtXH6p54XS39ImQUMVtAx65BoZDoEms3LuObyTo1+civ1sMm4h3nRT320U6H5H7D35WnABVQjqU/4g=="], - - "@dnd-kit/accessibility": ["@dnd-kit/accessibility@3.1.1", "https://registry.npmmirror.com/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw=="], - - "@dnd-kit/core": ["@dnd-kit/core@6.3.1", "https://registry.npmmirror.com/@dnd-kit/core/-/core-6.3.1.tgz", { "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ=="], - - "@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "https://registry.npmmirror.com/@dnd-kit/sortable/-/sortable-10.0.0.tgz", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="], - - "@dnd-kit/utilities": ["@dnd-kit/utilities@3.2.2", "https://registry.npmmirror.com/@dnd-kit/utilities/-/utilities-3.2.2.tgz", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="], - - "@emnapi/core": ["@emnapi/core@1.10.0", "https://registry.npmmirror.com/@emnapi/core/-/core-1.10.0.tgz", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="], - - "@emnapi/runtime": ["@emnapi/runtime@1.10.0", "https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.10.0.tgz", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="], - - "@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.1", "https://registry.npmmirror.com/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="], - - "@emotion/babel-plugin": ["@emotion/babel-plugin@11.13.5", "https://registry.npmmirror.com/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", { "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/serialize": "^1.3.3", "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", "stylis": "4.2.0" } }, "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ=="], - - "@emotion/cache": ["@emotion/cache@11.14.0", "https://registry.npmmirror.com/@emotion/cache/-/cache-11.14.0.tgz", { "dependencies": { "@emotion/memoize": "^0.9.0", "@emotion/sheet": "^1.4.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "stylis": "4.2.0" } }, "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA=="], - - "@emotion/hash": ["@emotion/hash@0.9.2", "https://registry.npmmirror.com/@emotion/hash/-/hash-0.9.2.tgz", {}, "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g=="], - - "@emotion/is-prop-valid": ["@emotion/is-prop-valid@1.4.0", "https://registry.npmmirror.com/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", { "dependencies": { "@emotion/memoize": "^0.9.0" } }, "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw=="], - - "@emotion/memoize": ["@emotion/memoize@0.9.0", "https://registry.npmmirror.com/@emotion/memoize/-/memoize-0.9.0.tgz", {}, "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ=="], - - "@emotion/react": ["@emotion/react@11.14.0", "https://registry.npmmirror.com/@emotion/react/-/react-11.14.0.tgz", { "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", "@emotion/cache": "^11.14.0", "@emotion/serialize": "^1.3.3", "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "hoist-non-react-statics": "^3.3.1" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA=="], - - "@emotion/serialize": ["@emotion/serialize@1.3.3", "https://registry.npmmirror.com/@emotion/serialize/-/serialize-1.3.3.tgz", { "dependencies": { "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/unitless": "^0.10.0", "@emotion/utils": "^1.4.2", "csstype": "^3.0.2" } }, "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA=="], - - "@emotion/sheet": ["@emotion/sheet@1.4.0", "https://registry.npmmirror.com/@emotion/sheet/-/sheet-1.4.0.tgz", {}, "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg=="], - - "@emotion/styled": ["@emotion/styled@11.14.1", "https://registry.npmmirror.com/@emotion/styled/-/styled-11.14.1.tgz", { "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", "@emotion/is-prop-valid": "^1.3.0", "@emotion/serialize": "^1.3.3", "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2" }, "peerDependencies": { "@emotion/react": "^11.0.0-rc.0", "react": ">=16.8.0" } }, "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw=="], - - "@emotion/unitless": ["@emotion/unitless@0.10.0", "https://registry.npmmirror.com/@emotion/unitless/-/unitless-0.10.0.tgz", {}, "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg=="], - - "@emotion/use-insertion-effect-with-fallbacks": ["@emotion/use-insertion-effect-with-fallbacks@1.2.0", "https://registry.npmmirror.com/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", { "peerDependencies": { "react": ">=16.8.0" } }, "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg=="], - - "@emotion/utils": ["@emotion/utils@1.4.2", "https://registry.npmmirror.com/@emotion/utils/-/utils-1.4.2.tgz", {}, "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA=="], - - "@emotion/weak-memoize": ["@emotion/weak-memoize@0.4.0", "https://registry.npmmirror.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", {}, "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg=="], - - "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.12", "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", { "os": "aix", "cpu": "ppc64" }, "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA=="], - - "@esbuild/android-arm": ["@esbuild/android-arm@0.25.12", "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz", { "os": "android", "cpu": "arm" }, "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg=="], - - "@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", { "os": "android", "cpu": "arm64" }, "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg=="], - - "@esbuild/android-x64": ["@esbuild/android-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz", { "os": "android", "cpu": "x64" }, "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg=="], - - "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", { "os": "darwin", "cpu": "arm64" }, "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg=="], - - "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", { "os": "darwin", "cpu": "x64" }, "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA=="], - - "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", { "os": "freebsd", "cpu": "arm64" }, "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg=="], - - "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", { "os": "freebsd", "cpu": "x64" }, "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ=="], - - "@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", { "os": "linux", "cpu": "arm" }, "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw=="], - - "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ=="], - - "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", { "os": "linux", "cpu": "ia32" }, "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA=="], - - "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", { "os": "linux", "cpu": "none" }, "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng=="], - - "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", { "os": "linux", "cpu": "none" }, "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw=="], - - "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", { "os": "linux", "cpu": "ppc64" }, "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA=="], - - "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", { "os": "linux", "cpu": "none" }, "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w=="], - - "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", { "os": "linux", "cpu": "s390x" }, "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg=="], - - "@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", { "os": "linux", "cpu": "x64" }, "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw=="], - - "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", { "os": "none", "cpu": "arm64" }, "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg=="], - - "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", { "os": "none", "cpu": "x64" }, "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ=="], - - "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", { "os": "openbsd", "cpu": "arm64" }, "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A=="], - - "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", { "os": "openbsd", "cpu": "x64" }, "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw=="], - - "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", { "os": "none", "cpu": "arm64" }, "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg=="], - - "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", { "os": "sunos", "cpu": "x64" }, "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w=="], - - "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.12", "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", { "os": "win32", "cpu": "arm64" }, "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg=="], - - "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.12", "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", { "os": "win32", "cpu": "ia32" }, "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ=="], - - "@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.12", "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", { "os": "win32", "cpu": "x64" }, "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA=="], - - "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "https://registry.npmmirror.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="], - - "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "https://registry.npmmirror.com/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="], - - "@eslint/config-array": ["@eslint/config-array@0.21.2", "https://registry.npmmirror.com/@eslint/config-array/-/config-array-0.21.2.tgz", { "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.5" } }, "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw=="], - - "@eslint/config-helpers": ["@eslint/config-helpers@0.4.2", "https://registry.npmmirror.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", { "dependencies": { "@eslint/core": "^0.17.0" } }, "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw=="], - - "@eslint/core": ["@eslint/core@0.17.0", "https://registry.npmmirror.com/@eslint/core/-/core-0.17.0.tgz", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ=="], - - "@eslint/eslintrc": ["@eslint/eslintrc@3.3.5", "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", { "dependencies": { "ajv": "^6.14.0", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" } }, "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg=="], - - "@eslint/js": ["@eslint/js@9.39.4", "https://registry.npmmirror.com/@eslint/js/-/js-9.39.4.tgz", {}, "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw=="], - - "@eslint/object-schema": ["@eslint/object-schema@2.1.7", "https://registry.npmmirror.com/@eslint/object-schema/-/object-schema-2.1.7.tgz", {}, "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA=="], - - "@eslint/plugin-kit": ["@eslint/plugin-kit@0.4.1", "https://registry.npmmirror.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", { "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" } }, "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA=="], - - "@humanfs/core": ["@humanfs/core@0.19.2", "https://registry.npmmirror.com/@humanfs/core/-/core-0.19.2.tgz", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="], - - "@humanfs/node": ["@humanfs/node@0.16.8", "https://registry.npmmirror.com/@humanfs/node/-/node-0.16.8.tgz", { "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="], - - "@humanfs/types": ["@humanfs/types@0.15.0", "https://registry.npmmirror.com/@humanfs/types/-/types-0.15.0.tgz", {}, "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q=="], - - "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "https://registry.npmmirror.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="], - - "@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "https://registry.npmmirror.com/@humanwhocodes/retry/-/retry-0.4.3.tgz", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="], - - "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], - - "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], - - "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], - - "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], - - "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - - "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@0.2.12", "https://registry.npmmirror.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@tybys/wasm-util": "^0.10.0" } }, "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ=="], - - "@next/eslint-plugin-next": ["@next/eslint-plugin-next@15.5.15", "https://registry.npmmirror.com/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.15.tgz", { "dependencies": { "fast-glob": "3.3.1" } }, "sha512-ExQoBfyKMjAUQ2nuF39ryQsG26H374ZfH13dlOZqf6TaE9ycRbIm+qUbUFCliU4BtQhiqtS7cnGA1yWfPMQ+jA=="], - - "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], - - "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "https://registry.npmmirror.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="], - - "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "https://registry.npmmirror.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], - - "@nolyfill/is-core-module": ["@nolyfill/is-core-module@1.0.39", "https://registry.npmmirror.com/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", {}, "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA=="], - - "@popperjs/core": ["@popperjs/core@2.11.8", "https://registry.npmmirror.com/@popperjs/core/-/core-2.11.8.tgz", {}, "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="], - - "@rc-component/async-validator": ["@rc-component/async-validator@5.1.0", "https://registry.npmmirror.com/@rc-component/async-validator/-/async-validator-5.1.0.tgz", { "dependencies": { "@babel/runtime": "^7.24.4" } }, "sha512-n4HcR5siNUXRX23nDizbZBQPO0ZM/5oTtmKZ6/eqL0L2bo747cklFdZGRN2f+c9qWGICwDzrhW0H7tE9PptdcA=="], - - "@rc-component/color-picker": ["@rc-component/color-picker@2.0.1", "https://registry.npmmirror.com/@rc-component/color-picker/-/color-picker-2.0.1.tgz", { "dependencies": { "@ant-design/fast-color": "^2.0.6", "@babel/runtime": "^7.23.6", "classnames": "^2.2.6", "rc-util": "^5.38.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-WcZYwAThV/b2GISQ8F+7650r5ZZJ043E57aVBFkQ+kSY4C6wdofXgB0hBx+GPGpIU0Z81eETNoDUJMr7oy/P8Q=="], - - "@rc-component/context": ["@rc-component/context@1.4.0", "https://registry.npmmirror.com/@rc-component/context/-/context-1.4.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "rc-util": "^5.27.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-kFcNxg9oLRMoL3qki0OMxK+7g5mypjgaaJp/pkOis/6rVxma9nJBF/8kCIuTYHUQNr0ii7MxqE33wirPZLJQ2w=="], - - "@rc-component/mini-decimal": ["@rc-component/mini-decimal@1.1.3", "https://registry.npmmirror.com/@rc-component/mini-decimal/-/mini-decimal-1.1.3.tgz", { "dependencies": { "@babel/runtime": "^7.18.0" } }, "sha512-bk/FJ09fLf+NLODMAFll6CfYrHPBioTedhW6lxDBuuWucJEqFUd4l/D/5JgIi3dina6sYahB8iuPAZTNz2pMxw=="], - - "@rc-component/mutate-observer": ["@rc-component/mutate-observer@1.1.0", "https://registry.npmmirror.com/@rc-component/mutate-observer/-/mutate-observer-1.1.0.tgz", { "dependencies": { "@babel/runtime": "^7.18.0", "classnames": "^2.3.2", "rc-util": "^5.24.4" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-QjrOsDXQusNwGZPf4/qRQasg7UFEj06XiCJ8iuiq/Io7CrHrgVi6Uuetw60WAMG1799v+aM8kyc+1L/GBbHSlw=="], - - "@rc-component/portal": ["@rc-component/portal@1.1.2", "https://registry.npmmirror.com/@rc-component/portal/-/portal-1.1.2.tgz", { "dependencies": { "@babel/runtime": "^7.18.0", "classnames": "^2.3.2", "rc-util": "^5.24.4" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-6f813C0IsasTZms08kfA8kPAGxbbkYToa8ALaiDIGGECU4i9hj8Plgbx0sNJDrey3EtHO30hmdaxtT0138xZcg=="], - - "@rc-component/qrcode": ["@rc-component/qrcode@1.1.1", "https://registry.npmmirror.com/@rc-component/qrcode/-/qrcode-1.1.1.tgz", { "dependencies": { "@babel/runtime": "^7.24.7" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-LfLGNymzKdUPjXUbRP+xOhIWY4jQ+YMj5MmWAcgcAq1Ij8XP7tRmAXqyuv96XvLUBE/5cA8hLFl9eO1JQMujrA=="], - - "@rc-component/tour": ["@rc-component/tour@1.15.1", "https://registry.npmmirror.com/@rc-component/tour/-/tour-1.15.1.tgz", { "dependencies": { "@babel/runtime": "^7.18.0", "@rc-component/portal": "^1.0.0-9", "@rc-component/trigger": "^2.0.0", "classnames": "^2.3.2", "rc-util": "^5.24.4" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Tr2t7J1DKZUpfJuDZWHxyxWpfmj8EZrqSgyMZ+BCdvKZ6r1UDsfU46M/iWAAFBy961Ssfom2kv5f3UcjIL2CmQ=="], - - "@rc-component/trigger": ["@rc-component/trigger@2.3.1", "https://registry.npmmirror.com/@rc-component/trigger/-/trigger-2.3.1.tgz", { "dependencies": { "@babel/runtime": "^7.23.2", "@rc-component/portal": "^1.1.0", "classnames": "^2.3.2", "rc-motion": "^2.0.0", "rc-resize-observer": "^1.3.1", "rc-util": "^5.44.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ORENF39PeXTzM+gQEshuk460Z8N4+6DkjpxlpE7Q3gYy1iBpLrx0FOJz3h62ryrJZ/3zCAUIkT1Pb/8hHWpb3A=="], - - "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-beta.27", "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", {}, "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA=="], - - "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", { "os": "android", "cpu": "arm" }, "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA=="], - - "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", { "os": "android", "cpu": "arm64" }, "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA=="], - - "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", { "os": "darwin", "cpu": "arm64" }, "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw=="], - - "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", { "os": "darwin", "cpu": "x64" }, "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew=="], - - "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", { "os": "freebsd", "cpu": "arm64" }, "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w=="], - - "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", { "os": "freebsd", "cpu": "x64" }, "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g=="], - - "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", { "os": "linux", "cpu": "arm" }, "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g=="], - - "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", { "os": "linux", "cpu": "arm" }, "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg=="], - - "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ=="], - - "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA=="], - - "@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ=="], - - "@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw=="], - - "@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", { "os": "linux", "cpu": "ppc64" }, "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw=="], - - "@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", { "os": "linux", "cpu": "ppc64" }, "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg=="], - - "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg=="], - - "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg=="], - - "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", { "os": "linux", "cpu": "s390x" }, "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ=="], - - "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg=="], - - "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w=="], - - "@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", { "os": "openbsd", "cpu": "x64" }, "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw=="], - - "@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", { "os": "none", "cpu": "arm64" }, "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA=="], - - "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", { "os": "win32", "cpu": "arm64" }, "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g=="], - - "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", { "os": "win32", "cpu": "ia32" }, "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg=="], - - "@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", { "os": "win32", "cpu": "x64" }, "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg=="], - - "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.60.1", "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", { "os": "win32", "cpu": "x64" }, "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ=="], - - "@rtsao/scc": ["@rtsao/scc@1.1.0", "https://registry.npmmirror.com/@rtsao/scc/-/scc-1.1.0.tgz", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="], - - "@rushstack/eslint-patch": ["@rushstack/eslint-patch@1.16.1", "https://registry.npmmirror.com/@rushstack/eslint-patch/-/eslint-patch-1.16.1.tgz", {}, "sha512-TvZbIpeKqGQQ7X0zSCvPH9riMSFQFSggnfBjFZ1mEoILW+UuXCKwOoPcgjMwiUtRqFZ8jWhPJc4um14vC6I4ag=="], - - "@tauri-apps/api": ["@tauri-apps/api@2.11.0", "https://registry.npmmirror.com/@tauri-apps/api/-/api-2.11.0.tgz", {}, "sha512-7CinYODhky9lmO23xHnUFv0Xt43fbtWMyxZcLcRBlFkcgXKuEirBvHpmtJ89YMhyeGcq20Wuc47Fa4XjyniywA=="], - - "@tauri-apps/cli": ["@tauri-apps/cli@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli/-/cli-2.10.1.tgz", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.10.1", "@tauri-apps/cli-darwin-x64": "2.10.1", "@tauri-apps/cli-linux-arm-gnueabihf": "2.10.1", "@tauri-apps/cli-linux-arm64-gnu": "2.10.1", "@tauri-apps/cli-linux-arm64-musl": "2.10.1", "@tauri-apps/cli-linux-riscv64-gnu": "2.10.1", "@tauri-apps/cli-linux-x64-gnu": "2.10.1", "@tauri-apps/cli-linux-x64-musl": "2.10.1", "@tauri-apps/cli-win32-arm64-msvc": "2.10.1", "@tauri-apps/cli-win32-ia32-msvc": "2.10.1", "@tauri-apps/cli-win32-x64-msvc": "2.10.1" }, "bin": { "tauri": "tauri.js" } }, "sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g=="], - - "@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.10.1.tgz", { "os": "darwin", "cpu": "arm64" }, "sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ=="], - - "@tauri-apps/cli-darwin-x64": ["@tauri-apps/cli-darwin-x64@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.10.1.tgz", { "os": "darwin", "cpu": "x64" }, "sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw=="], - - "@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/cli-linux-arm-gnueabihf@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.10.1.tgz", { "os": "linux", "cpu": "arm" }, "sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w=="], - - "@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/cli-linux-arm64-gnu@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.10.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA=="], - - "@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/cli-linux-arm64-musl@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.10.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg=="], - - "@tauri-apps/cli-linux-riscv64-gnu": ["@tauri-apps/cli-linux-riscv64-gnu@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.10.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw=="], - - "@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/cli-linux-x64-gnu@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.10.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw=="], - - "@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/cli-linux-x64-musl@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.10.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ=="], - - "@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/cli-win32-arm64-msvc@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.10.1.tgz", { "os": "win32", "cpu": "arm64" }, "sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg=="], - - "@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/cli-win32-ia32-msvc@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.10.1.tgz", { "os": "win32", "cpu": "ia32" }, "sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw=="], - - "@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.10.1", "https://registry.npmmirror.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.10.1.tgz", { "os": "win32", "cpu": "x64" }, "sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg=="], - - "@tauri-apps/plugin-clipboard-manager": ["@tauri-apps/plugin-clipboard-manager@2.3.2", "https://registry.npmmirror.com/@tauri-apps/plugin-clipboard-manager/-/plugin-clipboard-manager-2.3.2.tgz", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-CUlb5Hqi2oZbcZf4VUyUH53XWPPdtpw43EUpCza5HWZJwxEoDowFzNUDt1tRUXA8Uq+XPn17Ysfptip33sG4eQ=="], - - "@tauri-apps/plugin-opener": ["@tauri-apps/plugin-opener@2.5.4", "https://registry.npmmirror.com/@tauri-apps/plugin-opener/-/plugin-opener-2.5.4.tgz", { "dependencies": { "@tauri-apps/api": "^2.11.0" } }, "sha512-1HnPkb+AmgO29HBazm4uPLKB+r7zzcTBW1d0fyYp1uP+jwtpoiNDGKMMzz58SFp49nOIrxdE3aUJtT57lfO9CQ=="], - - "@tauri-apps/plugin-process": ["@tauri-apps/plugin-process@2.3.1", "https://registry.npmmirror.com/@tauri-apps/plugin-process/-/plugin-process-2.3.1.tgz", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-nCa4fGVaDL/B9ai03VyPOjfAHRHSBz5v6F/ObsB73r/dA3MHHhZtldaDMIc0V/pnUw9ehzr2iEG+XkSEyC0JJA=="], - - "@tauri-apps/plugin-shell": ["@tauri-apps/plugin-shell@2.3.5", "https://registry.npmmirror.com/@tauri-apps/plugin-shell/-/plugin-shell-2.3.5.tgz", { "dependencies": { "@tauri-apps/api": "^2.10.1" } }, "sha512-jewtULhiQ7lI7+owCKAjc8tYLJr92U16bPOeAa472LHJdgaibLP83NcfAF2e+wkEcA53FxKQAZ7byDzs2eeizg=="], - - "@tauri-apps/plugin-store": ["@tauri-apps/plugin-store@2.4.3", "https://registry.npmmirror.com/@tauri-apps/plugin-store/-/plugin-store-2.4.3.tgz", { "dependencies": { "@tauri-apps/api": "^2.11.0" } }, "sha512-9LWPj9yMphRi9czEtUv87XHbl1b6xgd9EXpPrUnq6nG7+nbtoF84d4Kwz9xhAv/Hf30sr58pq7EOlyI936y8qw=="], - - "@tybys/wasm-util": ["@tybys/wasm-util@0.10.2", "https://registry.npmmirror.com/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg=="], - - "@types/babel__core": ["@types/babel__core@7.20.5", "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], - - "@types/babel__generator": ["@types/babel__generator@7.27.0", "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="], - - "@types/babel__template": ["@types/babel__template@7.4.4", "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="], - - "@types/babel__traverse": ["@types/babel__traverse@7.28.0", "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], - - "@types/estree": ["@types/estree@1.0.8", "https://registry.npmmirror.com/@types/estree/-/estree-1.0.8.tgz", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], - - "@types/json-schema": ["@types/json-schema@7.0.15", "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], - - "@types/json5": ["@types/json5@0.0.29", "https://registry.npmmirror.com/@types/json5/-/json5-0.0.29.tgz", {}, "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="], - - "@types/lodash": ["@types/lodash@4.17.24", "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.24.tgz", {}, "sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ=="], - - "@types/lodash.mergewith": ["@types/lodash.mergewith@4.6.9", "https://registry.npmmirror.com/@types/lodash.mergewith/-/lodash.mergewith-4.6.9.tgz", { "dependencies": { "@types/lodash": "*" } }, "sha512-fgkoCAOF47K7sxrQ7Mlud2TH023itugZs2bUg8h/KzT+BnZNrR2jAOmaokbLunHNnobXVWOezAeNn/lZqwxkcw=="], - - "@types/node": ["@types/node@22.19.17", "https://registry.npmmirror.com/@types/node/-/node-22.19.17.tgz", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q=="], - - "@types/parse-json": ["@types/parse-json@4.0.2", "https://registry.npmmirror.com/@types/parse-json/-/parse-json-4.0.2.tgz", {}, "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="], - - "@types/react": ["@types/react@19.2.14", "https://registry.npmmirror.com/@types/react/-/react-19.2.14.tgz", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="], - - "@types/react-dom": ["@types/react-dom@19.2.3", "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.2.3.tgz", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="], - - "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.2.tgz", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.58.2", "@typescript-eslint/type-utils": "8.58.2", "@typescript-eslint/utils": "8.58.2", "@typescript-eslint/visitor-keys": "8.58.2", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.58.2", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-aC2qc5thQahutKjP+cl8cgN9DWe3ZUqVko30CMSZHnFEHyhOYoZSzkGtAI2mcwZ38xeImDucI4dnqsHiOYuuCw=="], - - "@typescript-eslint/parser": ["@typescript-eslint/parser@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/parser/-/parser-8.58.2.tgz", { "dependencies": { "@typescript-eslint/scope-manager": "8.58.2", "@typescript-eslint/types": "8.58.2", "@typescript-eslint/typescript-estree": "8.58.2", "@typescript-eslint/visitor-keys": "8.58.2", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-/Zb/xaIDfxeJnvishjGdcR4jmr7S+bda8PKNhRGdljDM+elXhlvN0FyPSsMnLmJUrVG9aPO6dof80wjMawsASg=="], - - "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/project-service/-/project-service-8.58.2.tgz", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.58.2", "@typescript-eslint/types": "^8.58.2", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Cq6UfpZZk15+r87BkIh5rDpi38W4b+Sjnb8wQCPPDDweS/LRCFjCyViEbzHk5Ck3f2QDfgmlxqSa7S7clDtlfg=="], - - "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-8.58.2.tgz", { "dependencies": { "@typescript-eslint/types": "8.58.2", "@typescript-eslint/visitor-keys": "8.58.2" } }, "sha512-SgmyvDPexWETQek+qzZnrG6844IaO02UVyOLhI4wpo82dpZJY9+6YZCKAMFzXb7qhx37mFK1QcPQ18tud+vo6Q=="], - - "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.2.tgz", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-3SR+RukipDvkkKp/d0jP0dyzuls3DbGmwDpVEc5wqk5f38KFThakqAAO0XMirWAE+kT00oTauTbzMFGPoAzB0A=="], - - "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-8.58.2.tgz", { "dependencies": { "@typescript-eslint/types": "8.58.2", "@typescript-eslint/typescript-estree": "8.58.2", "@typescript-eslint/utils": "8.58.2", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Z7EloNR/B389FvabdGeTo2XMs4W9TjtPiO9DAsmT0yom0bwlPyRjkJ1uCdW1DvrrrYP50AJZ9Xc3sByZA9+dcg=="], - - "@typescript-eslint/types": ["@typescript-eslint/types@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/types/-/types-8.58.2.tgz", {}, "sha512-9TukXyATBQf/Jq9AMQXfvurk+G5R2MwfqQGDR2GzGz28HvY/lXNKGhkY+6IOubwcquikWk5cjlgPvD2uAA7htQ=="], - - "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.58.2.tgz", { "dependencies": { "@typescript-eslint/project-service": "8.58.2", "@typescript-eslint/tsconfig-utils": "8.58.2", "@typescript-eslint/types": "8.58.2", "@typescript-eslint/visitor-keys": "8.58.2", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-ELGuoofuhhoCvNbQjFFiobFcGgcDCEm0ThWdmO4Z0UzLqPXS3KFvnEZ+SHewwOYHjM09tkzOWXNTv9u6Gqtyuw=="], - - "@typescript-eslint/utils": ["@typescript-eslint/utils@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-8.58.2.tgz", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.58.2", "@typescript-eslint/types": "8.58.2", "@typescript-eslint/typescript-estree": "8.58.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-QZfjHNEzPY8+l0+fIXMvuQ2sJlplB4zgDZvA+NmvZsZv3EQwOcc1DuIU1VJUTWZ/RKouBMhDyNaBMx4sWvrzRA=="], - - "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.58.2", "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.58.2.tgz", { "dependencies": { "@typescript-eslint/types": "8.58.2", "eslint-visitor-keys": "^5.0.0" } }, "sha512-f1WO2Lx8a9t8DARmcWAUPJbu0G20bJlj8L4z72K00TMeJAoyLr/tHhI/pzYBLrR4dXWkcxO1cWYZEOX8DKHTqA=="], - - "@unrs/resolver-binding-android-arm-eabi": ["@unrs/resolver-binding-android-arm-eabi@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", { "os": "android", "cpu": "arm" }, "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw=="], - - "@unrs/resolver-binding-android-arm64": ["@unrs/resolver-binding-android-arm64@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", { "os": "android", "cpu": "arm64" }, "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g=="], - - "@unrs/resolver-binding-darwin-arm64": ["@unrs/resolver-binding-darwin-arm64@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", { "os": "darwin", "cpu": "arm64" }, "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g=="], - - "@unrs/resolver-binding-darwin-x64": ["@unrs/resolver-binding-darwin-x64@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", { "os": "darwin", "cpu": "x64" }, "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ=="], - - "@unrs/resolver-binding-freebsd-x64": ["@unrs/resolver-binding-freebsd-x64@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", { "os": "freebsd", "cpu": "x64" }, "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw=="], - - "@unrs/resolver-binding-linux-arm-gnueabihf": ["@unrs/resolver-binding-linux-arm-gnueabihf@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", { "os": "linux", "cpu": "arm" }, "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw=="], - - "@unrs/resolver-binding-linux-arm-musleabihf": ["@unrs/resolver-binding-linux-arm-musleabihf@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", { "os": "linux", "cpu": "arm" }, "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw=="], - - "@unrs/resolver-binding-linux-arm64-gnu": ["@unrs/resolver-binding-linux-arm64-gnu@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ=="], - - "@unrs/resolver-binding-linux-arm64-musl": ["@unrs/resolver-binding-linux-arm64-musl@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", { "os": "linux", "cpu": "arm64" }, "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w=="], - - "@unrs/resolver-binding-linux-ppc64-gnu": ["@unrs/resolver-binding-linux-ppc64-gnu@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", { "os": "linux", "cpu": "ppc64" }, "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA=="], - - "@unrs/resolver-binding-linux-riscv64-gnu": ["@unrs/resolver-binding-linux-riscv64-gnu@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ=="], - - "@unrs/resolver-binding-linux-riscv64-musl": ["@unrs/resolver-binding-linux-riscv64-musl@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", { "os": "linux", "cpu": "none" }, "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew=="], - - "@unrs/resolver-binding-linux-s390x-gnu": ["@unrs/resolver-binding-linux-s390x-gnu@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", { "os": "linux", "cpu": "s390x" }, "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg=="], - - "@unrs/resolver-binding-linux-x64-gnu": ["@unrs/resolver-binding-linux-x64-gnu@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w=="], - - "@unrs/resolver-binding-linux-x64-musl": ["@unrs/resolver-binding-linux-x64-musl@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", { "os": "linux", "cpu": "x64" }, "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA=="], - - "@unrs/resolver-binding-wasm32-wasi": ["@unrs/resolver-binding-wasm32-wasi@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", { "dependencies": { "@napi-rs/wasm-runtime": "^0.2.11" }, "cpu": "none" }, "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ=="], - - "@unrs/resolver-binding-win32-arm64-msvc": ["@unrs/resolver-binding-win32-arm64-msvc@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", { "os": "win32", "cpu": "arm64" }, "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw=="], - - "@unrs/resolver-binding-win32-ia32-msvc": ["@unrs/resolver-binding-win32-ia32-msvc@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", { "os": "win32", "cpu": "ia32" }, "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ=="], - - "@unrs/resolver-binding-win32-x64-msvc": ["@unrs/resolver-binding-win32-x64-msvc@1.11.1", "https://registry.npmmirror.com/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", { "os": "win32", "cpu": "x64" }, "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g=="], - - "@vitejs/plugin-react": ["@vitejs/plugin-react@4.7.0", "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", { "dependencies": { "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA=="], - - "@zag-js/dom-query": ["@zag-js/dom-query@0.31.1", "https://registry.npmmirror.com/@zag-js/dom-query/-/dom-query-0.31.1.tgz", {}, "sha512-oiuohEXAXhBxpzzNm9k2VHGEOLC1SXlXSbRPcfBZ9so5NRQUA++zCE7cyQJqGLTZR0t3itFLlZqDbYEXRrefwg=="], - - "@zag-js/element-size": ["@zag-js/element-size@0.31.1", "https://registry.npmmirror.com/@zag-js/element-size/-/element-size-0.31.1.tgz", {}, "sha512-4T3yvn5NqqAjhlP326Fv+w9RqMIBbNN9H72g5q2ohwzhSgSfZzrKtjL4rs9axY/cw9UfMfXjRjEE98e5CMq7WQ=="], - - "@zag-js/focus-visible": ["@zag-js/focus-visible@0.31.1", "https://registry.npmmirror.com/@zag-js/focus-visible/-/focus-visible-0.31.1.tgz", { "dependencies": { "@zag-js/dom-query": "0.31.1" } }, "sha512-dbLksz7FEwyFoANbpIlNnd3bVm0clQSUsnP8yUVQucStZPsuWjCrhL2jlAbGNrTrahX96ntUMXHb/sM68TibFg=="], - - "acorn": ["acorn@8.16.0", "https://registry.npmmirror.com/acorn/-/acorn-8.16.0.tgz", { "bin": "bin/acorn" }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="], - - "acorn-jsx": ["acorn-jsx@5.3.2", "https://registry.npmmirror.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], - - "ajv": ["ajv@6.14.0", "https://registry.npmmirror.com/ajv/-/ajv-6.14.0.tgz", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw=="], - - "ansi-styles": ["ansi-styles@4.3.0", "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - - "antd": ["antd@5.29.3", "https://registry.npmmirror.com/antd/-/antd-5.29.3.tgz", { "dependencies": { "@ant-design/colors": "^7.2.1", "@ant-design/cssinjs": "^1.23.0", "@ant-design/cssinjs-utils": "^1.1.3", "@ant-design/fast-color": "^2.0.6", "@ant-design/icons": "^5.6.1", "@ant-design/react-slick": "~1.1.2", "@babel/runtime": "^7.26.0", "@rc-component/color-picker": "~2.0.1", "@rc-component/mutate-observer": "^1.1.0", "@rc-component/qrcode": "~1.1.0", "@rc-component/tour": "~1.15.1", "@rc-component/trigger": "^2.3.0", "classnames": "^2.5.1", "copy-to-clipboard": "^3.3.3", "dayjs": "^1.11.11", "rc-cascader": "~3.34.0", "rc-checkbox": "~3.5.0", "rc-collapse": "~3.9.0", "rc-dialog": "~9.6.0", "rc-drawer": "~7.3.0", "rc-dropdown": "~4.2.1", "rc-field-form": "~2.7.1", "rc-image": "~7.12.0", "rc-input": "~1.8.0", "rc-input-number": "~9.5.0", "rc-mentions": "~2.20.0", "rc-menu": "~9.16.1", "rc-motion": "^2.9.5", "rc-notification": "~5.6.4", "rc-pagination": "~5.1.0", "rc-picker": "~4.11.3", "rc-progress": "~4.0.0", "rc-rate": "~2.13.1", "rc-resize-observer": "^1.4.3", "rc-segmented": "~2.7.0", "rc-select": "~14.16.8", "rc-slider": "~11.1.9", "rc-steps": "~6.0.1", "rc-switch": "~4.1.0", "rc-table": "~7.54.0", "rc-tabs": "~15.7.0", "rc-textarea": "~1.10.2", "rc-tooltip": "~6.4.0", "rc-tree": "~5.13.1", "rc-tree-select": "~5.27.0", "rc-upload": "~4.11.0", "rc-util": "^5.44.4", "scroll-into-view-if-needed": "^3.1.0", "throttle-debounce": "^5.0.2" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-3DdbGCa9tWAJGcCJ6rzR8EJFsv2CtyEbkVabZE14pfgUHfCicWCj0/QzQVLDYg8CPfQk9BH7fHCoTXHTy7MP/A=="], - - "argparse": ["argparse@2.0.1", "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], - - "aria-hidden": ["aria-hidden@1.2.6", "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="], - - "aria-query": ["aria-query@5.3.2", "https://registry.npmmirror.com/aria-query/-/aria-query-5.3.2.tgz", {}, "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw=="], - - "array-buffer-byte-length": ["array-buffer-byte-length@1.0.2", "https://registry.npmmirror.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", { "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" } }, "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw=="], - - "array-includes": ["array-includes@3.1.9", "https://registry.npmmirror.com/array-includes/-/array-includes-3.1.9.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.0", "es-object-atoms": "^1.1.1", "get-intrinsic": "^1.3.0", "is-string": "^1.1.1", "math-intrinsics": "^1.1.0" } }, "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ=="], - - "array.prototype.findlast": ["array.prototype.findlast@1.2.5", "https://registry.npmmirror.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" } }, "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ=="], - - "array.prototype.findlastindex": ["array.prototype.findlastindex@1.2.6", "https://registry.npmmirror.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-shim-unscopables": "^1.1.0" } }, "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ=="], - - "array.prototype.flat": ["array.prototype.flat@1.3.3", "https://registry.npmmirror.com/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg=="], - - "array.prototype.flatmap": ["array.prototype.flatmap@1.3.3", "https://registry.npmmirror.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg=="], - - "array.prototype.tosorted": ["array.prototype.tosorted@1.1.4", "https://registry.npmmirror.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.3", "es-errors": "^1.3.0", "es-shim-unscopables": "^1.0.2" } }, "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA=="], - - "arraybuffer.prototype.slice": ["arraybuffer.prototype.slice@1.0.4", "https://registry.npmmirror.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", { "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "is-array-buffer": "^3.0.4" } }, "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ=="], - - "ast-types-flow": ["ast-types-flow@0.0.8", "https://registry.npmmirror.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz", {}, "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ=="], - - "async-function": ["async-function@1.0.0", "https://registry.npmmirror.com/async-function/-/async-function-1.0.0.tgz", {}, "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA=="], - - "available-typed-arrays": ["available-typed-arrays@1.0.7", "https://registry.npmmirror.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="], - - "axe-core": ["axe-core@4.11.3", "https://registry.npmmirror.com/axe-core/-/axe-core-4.11.3.tgz", {}, "sha512-zBQouZixDTbo3jMGqHKyePxYxr1e5W8UdTmBQ7sNtaA9M2bE32daxxPLS/jojhKOHxQ7LWwPjfiwf/fhaJWzlg=="], - - "axobject-query": ["axobject-query@4.1.0", "https://registry.npmmirror.com/axobject-query/-/axobject-query-4.1.0.tgz", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="], - - "babel-plugin-macros": ["babel-plugin-macros@3.1.0", "https://registry.npmmirror.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", { "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", "resolve": "^1.19.0" } }, "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg=="], - - "balanced-match": ["balanced-match@1.0.2", "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - - "baseline-browser-mapping": ["baseline-browser-mapping@2.10.19", "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.19.tgz", { "bin": "dist/cli.cjs" }, "sha512-qCkNLi2sfBOn8XhZQ0FXsT1Ki/Yo5P90hrkRamVFRS7/KV9hpfA4HkoWNU152+8w0zPjnxo5psx5NL3PSGgv5g=="], - - "brace-expansion": ["brace-expansion@1.1.14", "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.14.tgz", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g=="], - - "braces": ["braces@3.0.3", "https://registry.npmmirror.com/braces/-/braces-3.0.3.tgz", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], - - "browserslist": ["browserslist@4.28.2", "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.2.tgz", { "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", "electron-to-chromium": "^1.5.328", "node-releases": "^2.0.36", "update-browserslist-db": "^1.2.3" }, "bin": "cli.js" }, "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg=="], - - "call-bind": ["call-bind@1.0.9", "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.9.tgz", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "get-intrinsic": "^1.3.0", "set-function-length": "^1.2.2" } }, "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ=="], - - "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], - - "call-bound": ["call-bound@1.0.4", "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], - - "callsites": ["callsites@3.1.0", "https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], - - "caniuse-lite": ["caniuse-lite@1.0.30001788", "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001788.tgz", {}, "sha512-6q8HFp+lOQtcf7wBK+uEenxymVWkGKkjFpCvw5W25cmMwEDU45p1xQFBQv8JDlMMry7eNxyBaR+qxgmTUZkIRQ=="], - - "chalk": ["chalk@4.1.2", "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], - - "classnames": ["classnames@2.5.1", "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", {}, "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow=="], - - "color-convert": ["color-convert@2.0.1", "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], - - "color-name": ["color-name@1.1.4", "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], - - "color2k": ["color2k@2.0.3", "https://registry.npmmirror.com/color2k/-/color2k-2.0.3.tgz", {}, "sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog=="], - - "compute-scroll-into-view": ["compute-scroll-into-view@3.1.1", "https://registry.npmmirror.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz", {}, "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw=="], - - "concat-map": ["concat-map@0.0.1", "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], - - "convert-source-map": ["convert-source-map@1.9.0", "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-1.9.0.tgz", {}, "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="], - - "cookie": ["cookie@1.1.1", "https://registry.npmmirror.com/cookie/-/cookie-1.1.1.tgz", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="], - - "copy-to-clipboard": ["copy-to-clipboard@3.3.3", "https://registry.npmmirror.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", { "dependencies": { "toggle-selection": "^1.0.6" } }, "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA=="], - - "core-util-is": ["core-util-is@1.0.3", "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="], - - "cosmiconfig": ["cosmiconfig@7.1.0", "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="], - - "cross-spawn": ["cross-spawn@7.0.6", "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], - - "csstype": ["csstype@3.2.3", "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], - - "damerau-levenshtein": ["damerau-levenshtein@1.0.8", "https://registry.npmmirror.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", {}, "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA=="], - - "data-view-buffer": ["data-view-buffer@1.0.2", "https://registry.npmmirror.com/data-view-buffer/-/data-view-buffer-1.0.2.tgz", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ=="], - - "data-view-byte-length": ["data-view-byte-length@1.0.2", "https://registry.npmmirror.com/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ=="], - - "data-view-byte-offset": ["data-view-byte-offset@1.0.1", "https://registry.npmmirror.com/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" } }, "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ=="], - - "dayjs": ["dayjs@1.11.21", "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.21.tgz", {}, "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA=="], - - "debug": ["debug@4.4.3", "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], - - "deep-is": ["deep-is@0.1.4", "https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="], - - "define-data-property": ["define-data-property@1.1.4", "https://registry.npmmirror.com/define-data-property/-/define-data-property-1.1.4.tgz", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="], - - "define-properties": ["define-properties@1.2.1", "https://registry.npmmirror.com/define-properties/-/define-properties-1.2.1.tgz", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="], - - "detect-node-es": ["detect-node-es@1.1.0", "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="], - - "doctrine": ["doctrine@2.1.0", "https://registry.npmmirror.com/doctrine/-/doctrine-2.1.0.tgz", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw=="], - - "dunder-proto": ["dunder-proto@1.0.1", "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], - - "electron-to-chromium": ["electron-to-chromium@1.5.340", "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.340.tgz", {}, "sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA=="], - - "emoji-regex": ["emoji-regex@9.2.2", "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-9.2.2.tgz", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], - - "error-ex": ["error-ex@1.3.4", "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.4.tgz", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], - - "es-abstract": ["es-abstract@1.24.2", "https://registry.npmmirror.com/es-abstract/-/es-abstract-1.24.2.tgz", { "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", "get-intrinsic": "^1.3.0", "get-proto": "^1.0.1", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "internal-slot": "^1.1.0", "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", "is-data-view": "^1.0.2", "is-negative-zero": "^2.0.3", "is-regex": "^1.2.1", "is-set": "^2.0.3", "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", "is-weakref": "^1.1.1", "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.4", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.4", "safe-array-concat": "^1.1.3", "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", "set-proto": "^1.0.0", "stop-iteration-iterator": "^1.1.0", "string.prototype.trim": "^1.2.10", "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.3", "typed-array-byte-length": "^1.0.3", "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", "which-typed-array": "^1.1.19" } }, "sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg=="], - - "es-define-property": ["es-define-property@1.0.1", "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], - - "es-errors": ["es-errors@1.3.0", "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], - - "es-iterator-helpers": ["es-iterator-helpers@1.3.2", "https://registry.npmmirror.com/es-iterator-helpers/-/es-iterator-helpers-1.3.2.tgz", { "dependencies": { "call-bind": "^1.0.9", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.2", "es-errors": "^1.3.0", "es-set-tostringtag": "^2.1.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.3.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "iterator.prototype": "^1.1.5", "math-intrinsics": "^1.1.0" } }, "sha512-HVLACW1TppGYjJ8H6/jqH/pqOtKRw6wMlrB23xfExmFWxFquAIWCmwoLsOyN96K4a5KbmOf5At9ZUO3GZbetAw=="], - - "es-object-atoms": ["es-object-atoms@1.1.1", "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="], - - "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], - - "es-shim-unscopables": ["es-shim-unscopables@1.1.0", "https://registry.npmmirror.com/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw=="], - - "es-to-primitive": ["es-to-primitive@1.3.0", "https://registry.npmmirror.com/es-to-primitive/-/es-to-primitive-1.3.0.tgz", { "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", "is-symbol": "^1.0.4" } }, "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g=="], - - "esbuild": ["esbuild@0.25.12", "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.12.tgz", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": "bin/esbuild" }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="], - - "escalade": ["escalade@3.2.0", "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], - - "escape-string-regexp": ["escape-string-regexp@4.0.0", "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], - - "eslint": ["eslint@9.39.4", "https://registry.npmmirror.com/eslint/-/eslint-9.39.4.tgz", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.2", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.5", "@eslint/js": "9.39.4", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": "bin/eslint.js" }, "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ=="], - - "eslint-config-next": ["eslint-config-next@15.5.15", "https://registry.npmmirror.com/eslint-config-next/-/eslint-config-next-15.5.15.tgz", { "dependencies": { "@next/eslint-plugin-next": "15.5.15", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^5.0.0" }, "peerDependencies": { "eslint": "^7.23.0 || ^8.0.0 || ^9.0.0", "typescript": ">=3.3.1" } }, "sha512-mI5KIONOIosjF3jK2z9a8fY2LePNeW5C4lRJ+XZoJHAKkwx2MQjMPQ2/kL7tsMRPcQPZc/UBtCfqxElluL1CBg=="], - - "eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.10", "https://registry.npmmirror.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.10.tgz", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.16.1", "resolve": "^2.0.0-next.6" } }, "sha512-tRrKqFyCaKict5hOd244sL6EQFNycnMQnBe+j8uqGNXYzsImGbGUU4ibtoaBmv5FLwJwcFJNeg1GeVjQfbMrDQ=="], - - "eslint-import-resolver-typescript": ["eslint-import-resolver-typescript@3.10.1", "https://registry.npmmirror.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.10.1.tgz", { "dependencies": { "@nolyfill/is-core-module": "1.0.39", "debug": "^4.4.0", "get-tsconfig": "^4.10.0", "is-bun-module": "^2.0.0", "stable-hash": "^0.0.5", "tinyglobby": "^0.2.13", "unrs-resolver": "^1.6.2" }, "peerDependencies": { "eslint": "*", "eslint-plugin-import": "*", "eslint-plugin-import-x": "*" }, "optionalPeers": ["eslint-plugin-import-x"] }, "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ=="], - - "eslint-module-utils": ["eslint-module-utils@2.12.1", "https://registry.npmmirror.com/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", { "dependencies": { "debug": "^3.2.7" } }, "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw=="], - - "eslint-plugin-import": ["eslint-plugin-import@2.32.0", "https://registry.npmmirror.com/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", { "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", "array.prototype.findlastindex": "^1.2.6", "array.prototype.flat": "^1.3.3", "array.prototype.flatmap": "^1.3.3", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", "eslint-module-utils": "^2.12.1", "hasown": "^2.0.2", "is-core-module": "^2.16.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", "object.values": "^1.2.1", "semver": "^6.3.1", "string.prototype.trimend": "^1.0.9", "tsconfig-paths": "^3.15.0" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA=="], - - "eslint-plugin-jsx-a11y": ["eslint-plugin-jsx-a11y@6.10.2", "https://registry.npmmirror.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", { "dependencies": { "aria-query": "^5.3.2", "array-includes": "^3.1.8", "array.prototype.flatmap": "^1.3.2", "ast-types-flow": "^0.0.8", "axe-core": "^4.10.0", "axobject-query": "^4.1.0", "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", "hasown": "^2.0.2", "jsx-ast-utils": "^3.3.5", "language-tags": "^1.0.9", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "safe-regex-test": "^1.0.3", "string.prototype.includes": "^2.0.1" }, "peerDependencies": { "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" } }, "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q=="], - - "eslint-plugin-react": ["eslint-plugin-react@7.37.5", "https://registry.npmmirror.com/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", { "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", "array.prototype.flatmap": "^1.3.3", "array.prototype.tosorted": "^1.1.4", "doctrine": "^2.1.0", "es-iterator-helpers": "^1.2.1", "estraverse": "^5.3.0", "hasown": "^2.0.2", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", "object.entries": "^1.1.9", "object.fromentries": "^2.0.8", "object.values": "^1.2.1", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.5", "semver": "^6.3.1", "string.prototype.matchall": "^4.0.12", "string.prototype.repeat": "^1.0.0" }, "peerDependencies": { "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA=="], - - "eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@5.2.0", "https://registry.npmmirror.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", { "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" } }, "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg=="], - - "eslint-scope": ["eslint-scope@8.4.0", "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-8.4.0.tgz", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg=="], - - "eslint-visitor-keys": ["eslint-visitor-keys@4.2.1", "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", {}, "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ=="], - - "espree": ["espree@10.4.0", "https://registry.npmmirror.com/espree/-/espree-10.4.0.tgz", { "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.1" } }, "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ=="], - - "esquery": ["esquery@1.7.0", "https://registry.npmmirror.com/esquery/-/esquery-1.7.0.tgz", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="], - - "esrecurse": ["esrecurse@4.3.0", "https://registry.npmmirror.com/esrecurse/-/esrecurse-4.3.0.tgz", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="], - - "estraverse": ["estraverse@5.3.0", "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], - - "esutils": ["esutils@2.0.3", "https://registry.npmmirror.com/esutils/-/esutils-2.0.3.tgz", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], - - "fast-deep-equal": ["fast-deep-equal@3.1.3", "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], - - "fast-glob": ["fast-glob@3.3.1", "https://registry.npmmirror.com/fast-glob/-/fast-glob-3.3.1.tgz", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" } }, "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg=="], - - "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "https://registry.npmmirror.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], - - "fast-levenshtein": ["fast-levenshtein@2.0.6", "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="], - - "fastq": ["fastq@1.20.1", "https://registry.npmmirror.com/fastq/-/fastq-1.20.1.tgz", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="], - - "fdir": ["fdir@6.5.0", "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz", { "peerDependencies": { "picomatch": "^3 || ^4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], - - "file-entry-cache": ["file-entry-cache@8.0.0", "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="], - - "fill-range": ["fill-range@7.1.1", "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], - - "find-root": ["find-root@1.1.0", "https://registry.npmmirror.com/find-root/-/find-root-1.1.0.tgz", {}, "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="], - - "find-up": ["find-up@5.0.0", "https://registry.npmmirror.com/find-up/-/find-up-5.0.0.tgz", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], - - "flat-cache": ["flat-cache@4.0.1", "https://registry.npmmirror.com/flat-cache/-/flat-cache-4.0.1.tgz", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="], - - "flatted": ["flatted@3.4.2", "https://registry.npmmirror.com/flatted/-/flatted-3.4.2.tgz", {}, "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA=="], - - "focus-lock": ["focus-lock@1.3.6", "https://registry.npmmirror.com/focus-lock/-/focus-lock-1.3.6.tgz", { "dependencies": { "tslib": "^2.0.3" } }, "sha512-Ik/6OCk9RQQ0T5Xw+hKNLWrjSMtv51dD4GRmJjbD5a58TIEpI5a5iXagKVl3Z5UuyslMCA8Xwnu76jQob62Yhg=="], - - "for-each": ["for-each@0.3.5", "https://registry.npmmirror.com/for-each/-/for-each-0.3.5.tgz", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="], - - "framer-motion": ["framer-motion@11.18.2", "https://registry.npmmirror.com/framer-motion/-/framer-motion-11.18.2.tgz", { "dependencies": { "motion-dom": "^11.18.1", "motion-utils": "^11.18.1", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-5F5Och7wrvtLVElIpclDT0CBzMVg3dL22B64aZwHtsIY8RB4mXICLrkajK4G9R+ieSAGcgrLeae2SeUTg2pr6w=="], - - "framesync": ["framesync@6.1.2", "https://registry.npmmirror.com/framesync/-/framesync-6.1.2.tgz", { "dependencies": { "tslib": "2.4.0" } }, "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g=="], - - "fsevents": ["fsevents@2.3.3", "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], - - "function-bind": ["function-bind@1.1.2", "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], - - "function.prototype.name": ["function.prototype.name@1.1.8", "https://registry.npmmirror.com/function.prototype.name/-/function.prototype.name-1.1.8.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "functions-have-names": "^1.2.3", "hasown": "^2.0.2", "is-callable": "^1.2.7" } }, "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q=="], - - "functions-have-names": ["functions-have-names@1.2.3", "https://registry.npmmirror.com/functions-have-names/-/functions-have-names-1.2.3.tgz", {}, "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ=="], - - "generator-function": ["generator-function@2.0.1", "https://registry.npmmirror.com/generator-function/-/generator-function-2.0.1.tgz", {}, "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g=="], - - "gensync": ["gensync@1.0.0-beta.2", "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], - - "get-intrinsic": ["get-intrinsic@1.3.0", "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], - - "get-nonce": ["get-nonce@1.0.1", "https://registry.npmmirror.com/get-nonce/-/get-nonce-1.0.1.tgz", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="], - - "get-proto": ["get-proto@1.0.1", "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], - - "get-symbol-description": ["get-symbol-description@1.1.0", "https://registry.npmmirror.com/get-symbol-description/-/get-symbol-description-1.1.0.tgz", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6" } }, "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg=="], - - "get-tsconfig": ["get-tsconfig@4.14.0", "https://registry.npmmirror.com/get-tsconfig/-/get-tsconfig-4.14.0.tgz", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA=="], - - "glob-parent": ["glob-parent@6.0.2", "https://registry.npmmirror.com/glob-parent/-/glob-parent-6.0.2.tgz", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], - - "globals": ["globals@14.0.0", "https://registry.npmmirror.com/globals/-/globals-14.0.0.tgz", {}, "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ=="], - - "globalthis": ["globalthis@1.0.4", "https://registry.npmmirror.com/globalthis/-/globalthis-1.0.4.tgz", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="], - - "gopd": ["gopd@1.2.0", "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], - - "has-bigints": ["has-bigints@1.1.0", "https://registry.npmmirror.com/has-bigints/-/has-bigints-1.1.0.tgz", {}, "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg=="], - - "has-flag": ["has-flag@4.0.0", "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], - - "has-property-descriptors": ["has-property-descriptors@1.0.2", "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="], - - "has-proto": ["has-proto@1.2.0", "https://registry.npmmirror.com/has-proto/-/has-proto-1.2.0.tgz", { "dependencies": { "dunder-proto": "^1.0.0" } }, "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ=="], - - "has-symbols": ["has-symbols@1.1.0", "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], - - "has-tostringtag": ["has-tostringtag@1.0.2", "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], - - "hasown": ["hasown@2.0.3", "https://registry.npmmirror.com/hasown/-/hasown-2.0.3.tgz", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg=="], - - "hoist-non-react-statics": ["hoist-non-react-statics@3.3.2", "https://registry.npmmirror.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", { "dependencies": { "react-is": "^16.7.0" } }, "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw=="], - - "html-parse-stringify": ["html-parse-stringify@3.0.1", "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", { "dependencies": { "void-elements": "3.1.0" } }, "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg=="], - - "https": ["https@1.0.0", "https://registry.npmmirror.com/https/-/https-1.0.0.tgz", {}, "sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg=="], - - "husky": ["husky@9.1.7", "https://registry.npmmirror.com/husky/-/husky-9.1.7.tgz", { "bin": "bin.js" }, "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA=="], - - "i18next": ["i18next@26.0.5", "https://registry.npmmirror.com/i18next/-/i18next-26.0.5.tgz", { "dependencies": { "@babel/runtime": "^7.29.2" }, "peerDependencies": { "typescript": "^5 || ^6" } }, "sha512-9uHb4T27TdV36phJXcbpnRPt5yzAfqHXVrdASvmHZyPuZJtrLythd+GyXhiaHV5LlpuuskbAqhwPjmfTbKbi8w=="], - - "i18next-browser-languagedetector": ["i18next-browser-languagedetector@8.2.1", "https://registry.npmmirror.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.1.tgz", { "dependencies": { "@babel/runtime": "^7.23.2" } }, "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw=="], - - "ignore": ["ignore@5.3.2", "https://registry.npmmirror.com/ignore/-/ignore-5.3.2.tgz", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], - - "image-size": ["image-size@1.2.1", "https://registry.npmmirror.com/image-size/-/image-size-1.2.1.tgz", { "dependencies": { "queue": "6.0.2" }, "bin": "bin/image-size.js" }, "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw=="], - - "immediate": ["immediate@3.0.6", "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz", {}, "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="], - - "import-fresh": ["import-fresh@3.3.1", "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.1.tgz", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], - - "imurmurhash": ["imurmurhash@0.1.4", "https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], - - "inherits": ["inherits@2.0.4", "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], - - "internal-slot": ["internal-slot@1.1.0", "https://registry.npmmirror.com/internal-slot/-/internal-slot-1.1.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw=="], - - "is-array-buffer": ["is-array-buffer@3.0.5", "https://registry.npmmirror.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A=="], - - "is-arrayish": ["is-arrayish@0.2.1", "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.2.1.tgz", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], - - "is-async-function": ["is-async-function@2.1.1", "https://registry.npmmirror.com/is-async-function/-/is-async-function-2.1.1.tgz", { "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ=="], - - "is-bigint": ["is-bigint@1.1.0", "https://registry.npmmirror.com/is-bigint/-/is-bigint-1.1.0.tgz", { "dependencies": { "has-bigints": "^1.0.2" } }, "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ=="], - - "is-boolean-object": ["is-boolean-object@1.2.2", "https://registry.npmmirror.com/is-boolean-object/-/is-boolean-object-1.2.2.tgz", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A=="], - - "is-bun-module": ["is-bun-module@2.0.0", "https://registry.npmmirror.com/is-bun-module/-/is-bun-module-2.0.0.tgz", { "dependencies": { "semver": "^7.7.1" } }, "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ=="], - - "is-callable": ["is-callable@1.2.7", "https://registry.npmmirror.com/is-callable/-/is-callable-1.2.7.tgz", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="], - - "is-core-module": ["is-core-module@2.16.1", "https://registry.npmmirror.com/is-core-module/-/is-core-module-2.16.1.tgz", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="], - - "is-data-view": ["is-data-view@1.0.2", "https://registry.npmmirror.com/is-data-view/-/is-data-view-1.0.2.tgz", { "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" } }, "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw=="], - - "is-date-object": ["is-date-object@1.1.0", "https://registry.npmmirror.com/is-date-object/-/is-date-object-1.1.0.tgz", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg=="], - - "is-extglob": ["is-extglob@2.1.1", "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], - - "is-finalizationregistry": ["is-finalizationregistry@1.1.1", "https://registry.npmmirror.com/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg=="], - - "is-generator-function": ["is-generator-function@1.1.2", "https://registry.npmmirror.com/is-generator-function/-/is-generator-function-1.1.2.tgz", { "dependencies": { "call-bound": "^1.0.4", "generator-function": "^2.0.0", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA=="], - - "is-glob": ["is-glob@4.0.3", "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], - - "is-map": ["is-map@2.0.3", "https://registry.npmmirror.com/is-map/-/is-map-2.0.3.tgz", {}, "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw=="], - - "is-negative-zero": ["is-negative-zero@2.0.3", "https://registry.npmmirror.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz", {}, "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw=="], - - "is-number": ["is-number@7.0.0", "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], - - "is-number-object": ["is-number-object@1.1.1", "https://registry.npmmirror.com/is-number-object/-/is-number-object-1.1.1.tgz", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw=="], - - "is-regex": ["is-regex@1.2.1", "https://registry.npmmirror.com/is-regex/-/is-regex-1.2.1.tgz", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="], - - "is-set": ["is-set@2.0.3", "https://registry.npmmirror.com/is-set/-/is-set-2.0.3.tgz", {}, "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg=="], - - "is-shared-array-buffer": ["is-shared-array-buffer@1.0.4", "https://registry.npmmirror.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A=="], - - "is-string": ["is-string@1.1.1", "https://registry.npmmirror.com/is-string/-/is-string-1.1.1.tgz", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA=="], - - "is-symbol": ["is-symbol@1.1.1", "https://registry.npmmirror.com/is-symbol/-/is-symbol-1.1.1.tgz", { "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", "safe-regex-test": "^1.1.0" } }, "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w=="], - - "is-typed-array": ["is-typed-array@1.1.15", "https://registry.npmmirror.com/is-typed-array/-/is-typed-array-1.1.15.tgz", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="], - - "is-weakmap": ["is-weakmap@2.0.2", "https://registry.npmmirror.com/is-weakmap/-/is-weakmap-2.0.2.tgz", {}, "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w=="], - - "is-weakref": ["is-weakref@1.1.1", "https://registry.npmmirror.com/is-weakref/-/is-weakref-1.1.1.tgz", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew=="], - - "is-weakset": ["is-weakset@2.0.4", "https://registry.npmmirror.com/is-weakset/-/is-weakset-2.0.4.tgz", { "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ=="], - - "isarray": ["isarray@1.0.0", "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", {}, "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="], - - "isexe": ["isexe@2.0.0", "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], - - "iterator.prototype": ["iterator.prototype@1.1.5", "https://registry.npmmirror.com/iterator.prototype/-/iterator.prototype-1.1.5.tgz", { "dependencies": { "define-data-property": "^1.1.4", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "get-proto": "^1.0.0", "has-symbols": "^1.1.0", "set-function-name": "^2.0.2" } }, "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g=="], - - "js-tokens": ["js-tokens@4.0.0", "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], - - "js-yaml": ["js-yaml@4.1.1", "https://registry.npmmirror.com/js-yaml/-/js-yaml-4.1.1.tgz", { "dependencies": { "argparse": "^2.0.1" }, "bin": "bin/js-yaml.js" }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="], - - "jsesc": ["jsesc@3.1.0", "https://registry.npmmirror.com/jsesc/-/jsesc-3.1.0.tgz", { "bin": "bin/jsesc" }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], - - "json-buffer": ["json-buffer@3.0.1", "https://registry.npmmirror.com/json-buffer/-/json-buffer-3.0.1.tgz", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="], - - "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], - - "json-schema-traverse": ["json-schema-traverse@0.4.1", "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], - - "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "https://registry.npmmirror.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="], - - "json2mq": ["json2mq@0.2.0", "https://registry.npmmirror.com/json2mq/-/json2mq-0.2.0.tgz", { "dependencies": { "string-convert": "^0.2.0" } }, "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA=="], - - "json5": ["json5@2.2.3", "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", { "bin": "lib/cli.js" }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], - - "jsx-ast-utils": ["jsx-ast-utils@3.3.5", "https://registry.npmmirror.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", { "dependencies": { "array-includes": "^3.1.6", "array.prototype.flat": "^1.3.1", "object.assign": "^4.1.4", "object.values": "^1.1.6" } }, "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ=="], - - "jszip": ["jszip@3.10.1", "https://registry.npmmirror.com/jszip/-/jszip-3.10.1.tgz", { "dependencies": { "lie": "~3.3.0", "pako": "~1.0.2", "readable-stream": "~2.3.6", "setimmediate": "^1.0.5" } }, "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g=="], - - "keyv": ["keyv@4.5.4", "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="], - - "language-subtag-registry": ["language-subtag-registry@0.3.23", "https://registry.npmmirror.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", {}, "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="], - - "language-tags": ["language-tags@1.0.9", "https://registry.npmmirror.com/language-tags/-/language-tags-1.0.9.tgz", { "dependencies": { "language-subtag-registry": "^0.3.20" } }, "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA=="], - - "levn": ["levn@0.4.1", "https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], - - "lie": ["lie@3.3.0", "https://registry.npmmirror.com/lie/-/lie-3.3.0.tgz", { "dependencies": { "immediate": "~3.0.5" } }, "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ=="], - - "lines-and-columns": ["lines-and-columns@1.2.4", "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], - - "locate-path": ["locate-path@6.0.0", "https://registry.npmmirror.com/locate-path/-/locate-path-6.0.0.tgz", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], - - "lodash.merge": ["lodash.merge@4.6.2", "https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="], - - "lodash.mergewith": ["lodash.mergewith@4.6.2", "https://registry.npmmirror.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", {}, "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ=="], - - "loose-envify": ["loose-envify@1.4.0", "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": "cli.js" }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="], - - "lru-cache": ["lru-cache@5.1.1", "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], - - "lucide-react": ["lucide-react@0.487.0", "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.487.0.tgz", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-aKqhOQ+YmFnwq8dWgGjOuLc8V1R9/c/yOd+zDY4+ohsR2Jo05lSGc3WsstYPIzcTpeosN7LoCkLReUUITvaIvw=="], - - "math-intrinsics": ["math-intrinsics@1.1.0", "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], - - "merge2": ["merge2@1.4.1", "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], - - "micromatch": ["micromatch@4.0.8", "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.8.tgz", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], - - "minimatch": ["minimatch@3.1.5", "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.5.tgz", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="], - - "minimist": ["minimist@1.2.8", "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], - - "motion-dom": ["motion-dom@11.18.1", "https://registry.npmmirror.com/motion-dom/-/motion-dom-11.18.1.tgz", { "dependencies": { "motion-utils": "^11.18.1" } }, "sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw=="], - - "motion-utils": ["motion-utils@11.18.1", "https://registry.npmmirror.com/motion-utils/-/motion-utils-11.18.1.tgz", {}, "sha512-49Kt+HKjtbJKLtgO/LKj9Ld+6vw9BjH5d9sc40R/kVyH8GLAXgT42M2NnuPcJNuA3s9ZfZBUcwIgpmZWGEE+hA=="], - - "ms": ["ms@2.1.3", "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], - - "nanoid": ["nanoid@3.3.11", "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", { "bin": "bin/nanoid.cjs" }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], - - "napi-postinstall": ["napi-postinstall@0.3.4", "https://registry.npmmirror.com/napi-postinstall/-/napi-postinstall-0.3.4.tgz", { "bin": "lib/cli.js" }, "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ=="], - - "natural-compare": ["natural-compare@1.4.0", "https://registry.npmmirror.com/natural-compare/-/natural-compare-1.4.0.tgz", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], - - "node-exports-info": ["node-exports-info@1.6.0", "https://registry.npmmirror.com/node-exports-info/-/node-exports-info-1.6.0.tgz", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw=="], - - "node-releases": ["node-releases@2.0.37", "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.37.tgz", {}, "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg=="], - - "object-assign": ["object-assign@4.1.1", "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], - - "object-inspect": ["object-inspect@1.13.4", "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], - - "object-keys": ["object-keys@1.1.1", "https://registry.npmmirror.com/object-keys/-/object-keys-1.1.1.tgz", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="], - - "object.assign": ["object.assign@4.1.7", "https://registry.npmmirror.com/object.assign/-/object.assign-4.1.7.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="], - - "object.entries": ["object.entries@1.1.9", "https://registry.npmmirror.com/object.entries/-/object.entries-1.1.9.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-object-atoms": "^1.1.1" } }, "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw=="], - - "object.fromentries": ["object.fromentries@2.0.8", "https://registry.npmmirror.com/object.fromentries/-/object.fromentries-2.0.8.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0" } }, "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ=="], - - "object.groupby": ["object.groupby@1.0.3", "https://registry.npmmirror.com/object.groupby/-/object.groupby-1.0.3.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2" } }, "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ=="], - - "object.values": ["object.values@1.2.1", "https://registry.npmmirror.com/object.values/-/object.values-1.2.1.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA=="], - - "optionator": ["optionator@0.9.4", "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], - - "own-keys": ["own-keys@1.0.1", "https://registry.npmmirror.com/own-keys/-/own-keys-1.0.1.tgz", { "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", "safe-push-apply": "^1.0.0" } }, "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg=="], - - "p-limit": ["p-limit@3.1.0", "https://registry.npmmirror.com/p-limit/-/p-limit-3.1.0.tgz", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], - - "p-locate": ["p-locate@5.0.0", "https://registry.npmmirror.com/p-locate/-/p-locate-5.0.0.tgz", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], - - "pako": ["pako@1.0.11", "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="], - - "parent-module": ["parent-module@1.0.1", "https://registry.npmmirror.com/parent-module/-/parent-module-1.0.1.tgz", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], - - "parse-json": ["parse-json@5.2.0", "https://registry.npmmirror.com/parse-json/-/parse-json-5.2.0.tgz", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], - - "path-exists": ["path-exists@4.0.0", "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], - - "path-key": ["path-key@3.1.1", "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], - - "path-parse": ["path-parse@1.0.7", "https://registry.npmmirror.com/path-parse/-/path-parse-1.0.7.tgz", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], - - "path-type": ["path-type@4.0.0", "https://registry.npmmirror.com/path-type/-/path-type-4.0.0.tgz", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], - - "picocolors": ["picocolors@1.1.1", "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - - "picomatch": ["picomatch@4.0.4", "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.4.tgz", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], - - "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "https://registry.npmmirror.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], - - "postcss": ["postcss@8.5.10", "https://registry.npmmirror.com/postcss/-/postcss-8.5.10.tgz", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ=="], - - "pptxgenjs": ["pptxgenjs@4.0.1", "https://registry.npmmirror.com/pptxgenjs/-/pptxgenjs-4.0.1.tgz", { "dependencies": { "@types/node": "^22.8.1", "https": "^1.0.0", "image-size": "^1.2.1", "jszip": "^3.10.1" } }, "sha512-TeJISr8wouAuXw4C1F/mC33xbZs/FuEG6nH9FG1Zj+nuPcGMP5YRHl6X+j3HSUnS1f3at6k75ZZXPMZlA5Lj9A=="], - - "prelude-ls": ["prelude-ls@1.2.1", "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], - - "prettier": ["prettier@3.8.3", "https://registry.npmmirror.com/prettier/-/prettier-3.8.3.tgz", { "bin": "bin/prettier.cjs" }, "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw=="], - - "process-nextick-args": ["process-nextick-args@2.0.1", "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", {}, "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="], - - "prop-types": ["prop-types@15.8.1", "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], - - "punycode": ["punycode@2.3.1", "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], - - "queue": ["queue@6.0.2", "https://registry.npmmirror.com/queue/-/queue-6.0.2.tgz", { "dependencies": { "inherits": "~2.0.3" } }, "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA=="], - - "queue-microtask": ["queue-microtask@1.2.3", "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], - - "rc-cascader": ["rc-cascader@3.34.0", "https://registry.npmmirror.com/rc-cascader/-/rc-cascader-3.34.0.tgz", { "dependencies": { "@babel/runtime": "^7.25.7", "classnames": "^2.3.1", "rc-select": "~14.16.2", "rc-tree": "~5.13.0", "rc-util": "^5.43.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-KpXypcvju9ptjW9FaN2NFcA2QH9E9LHKq169Y0eWtH4e/wHQ5Wh5qZakAgvb8EKZ736WZ3B0zLLOBsrsja5Dag=="], - - "rc-checkbox": ["rc-checkbox@3.5.0", "https://registry.npmmirror.com/rc-checkbox/-/rc-checkbox-3.5.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.3.2", "rc-util": "^5.25.2" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-aOAQc3E98HteIIsSqm6Xk2FPKIER6+5vyEFMZfo73TqM+VVAIqOkHoPjgKLqSNtVLWScoaM7vY2ZrGEheI79yg=="], - - "rc-collapse": ["rc-collapse@3.9.0", "https://registry.npmmirror.com/rc-collapse/-/rc-collapse-3.9.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", "rc-motion": "^2.3.4", "rc-util": "^5.27.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-swDdz4QZ4dFTo4RAUMLL50qP0EY62N2kvmk2We5xYdRwcRn8WcYtuetCJpwpaCbUfUt5+huLpVxhvmnK+PHrkA=="], - - "rc-dialog": ["rc-dialog@9.6.0", "https://registry.npmmirror.com/rc-dialog/-/rc-dialog-9.6.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/portal": "^1.0.0-8", "classnames": "^2.2.6", "rc-motion": "^2.3.0", "rc-util": "^5.21.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ApoVi9Z8PaCQg6FsUzS8yvBEQy0ZL2PkuvAgrmohPkN3okps5WZ5WQWPc1RNuiOKaAYv8B97ACdsFU5LizzCqg=="], - - "rc-drawer": ["rc-drawer@7.3.0", "https://registry.npmmirror.com/rc-drawer/-/rc-drawer-7.3.0.tgz", { "dependencies": { "@babel/runtime": "^7.23.9", "@rc-component/portal": "^1.1.1", "classnames": "^2.2.6", "rc-motion": "^2.6.1", "rc-util": "^5.38.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-DX6CIgiBWNpJIMGFO8BAISFkxiuKitoizooj4BDyee8/SnBn0zwO2FHrNDpqqepj0E/TFTDpmEBCyFuTgC7MOg=="], - - "rc-dropdown": ["rc-dropdown@4.2.1", "https://registry.npmmirror.com/rc-dropdown/-/rc-dropdown-4.2.1.tgz", { "dependencies": { "@babel/runtime": "^7.18.3", "@rc-component/trigger": "^2.0.0", "classnames": "^2.2.6", "rc-util": "^5.44.1" }, "peerDependencies": { "react": ">=16.11.0", "react-dom": ">=16.11.0" } }, "sha512-YDAlXsPv3I1n42dv1JpdM7wJ+gSUBfeyPK59ZpBD9jQhK9jVuxpjj3NmWQHOBceA1zEPVX84T2wbdb2SD0UjmA=="], - - "rc-field-form": ["rc-field-form@2.7.1", "https://registry.npmmirror.com/rc-field-form/-/rc-field-form-2.7.1.tgz", { "dependencies": { "@babel/runtime": "^7.18.0", "@rc-component/async-validator": "^5.0.3", "rc-util": "^5.32.2" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-vKeSifSJ6HoLaAB+B8aq/Qgm8a3dyxROzCtKNCsBQgiverpc4kWDQihoUwzUj+zNWJOykwSY4dNX3QrGwtVb9A=="], - - "rc-image": ["rc-image@7.12.0", "https://registry.npmmirror.com/rc-image/-/rc-image-7.12.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.2", "@rc-component/portal": "^1.0.2", "classnames": "^2.2.6", "rc-dialog": "~9.6.0", "rc-motion": "^2.6.2", "rc-util": "^5.34.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-cZ3HTyyckPnNnUb9/DRqduqzLfrQRyi+CdHjdqgsyDpI3Ln5UX1kXnAhPBSJj9pVRzwRFgqkN7p9b6HBDjmu/Q=="], - - "rc-input": ["rc-input@1.8.0", "https://registry.npmmirror.com/rc-input/-/rc-input-1.8.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", "rc-util": "^5.18.1" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-KXvaTbX+7ha8a/k+eg6SYRVERK0NddX8QX7a7AnRvUa/rEH0CNMlpcBzBkhI0wp2C8C4HlMoYl8TImSN+fuHKA=="], - - "rc-input-number": ["rc-input-number@9.5.0", "https://registry.npmmirror.com/rc-input-number/-/rc-input-number-9.5.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/mini-decimal": "^1.0.1", "classnames": "^2.2.5", "rc-input": "~1.8.0", "rc-util": "^5.40.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-bKaEvB5tHebUURAEXw35LDcnRZLq3x1k7GxfAqBMzmpHkDGzjAtnUL8y4y5N15rIFIg5IJgwr211jInl3cipag=="], - - "rc-mentions": ["rc-mentions@2.20.0", "https://registry.npmmirror.com/rc-mentions/-/rc-mentions-2.20.0.tgz", { "dependencies": { "@babel/runtime": "^7.22.5", "@rc-component/trigger": "^2.0.0", "classnames": "^2.2.6", "rc-input": "~1.8.0", "rc-menu": "~9.16.0", "rc-textarea": "~1.10.0", "rc-util": "^5.34.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-w8HCMZEh3f0nR8ZEd466ATqmXFCMGMN5UFCzEUL0bM/nGw/wOS2GgRzKBcm19K++jDyuWCOJOdgcKGXU3fXfbQ=="], - - "rc-menu": ["rc-menu@9.16.1", "https://registry.npmmirror.com/rc-menu/-/rc-menu-9.16.1.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/trigger": "^2.0.0", "classnames": "2.x", "rc-motion": "^2.4.3", "rc-overflow": "^1.3.1", "rc-util": "^5.27.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ghHx6/6Dvp+fw8CJhDUHFHDJ84hJE3BXNCzSgLdmNiFErWSOaZNsihDAsKq9ByTALo/xkNIwtDFGIl6r+RPXBg=="], - - "rc-motion": ["rc-motion@2.9.5", "https://registry.npmmirror.com/rc-motion/-/rc-motion-2.9.5.tgz", { "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", "rc-util": "^5.44.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-w+XTUrfh7ArbYEd2582uDrEhmBHwK1ZENJiSJVb7uRxdE7qJSYjbO2eksRXmndqyKqKoYPc9ClpPh5242mV1vA=="], - - "rc-notification": ["rc-notification@5.6.4", "https://registry.npmmirror.com/rc-notification/-/rc-notification-5.6.4.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", "rc-motion": "^2.9.0", "rc-util": "^5.20.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-KcS4O6B4qzM3KH7lkwOB7ooLPZ4b6J+VMmQgT51VZCeEcmghdeR4IrMcFq0LG+RPdnbe/ArT086tGM8Snimgiw=="], - - "rc-overflow": ["rc-overflow@1.5.0", "https://registry.npmmirror.com/rc-overflow/-/rc-overflow-1.5.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", "rc-resize-observer": "^1.0.0", "rc-util": "^5.37.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Lm/v9h0LymeUYJf0x39OveU52InkdRXqnn2aYXfWmo8WdOonIKB2kfau+GF0fWq6jPgtdO9yMqveGcK6aIhJmg=="], - - "rc-pagination": ["rc-pagination@5.1.0", "https://registry.npmmirror.com/rc-pagination/-/rc-pagination-5.1.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.3.2", "rc-util": "^5.38.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-8416Yip/+eclTFdHXLKTxZvn70duYVGTvUUWbckCCZoIl3jagqke3GLsFrMs0bsQBikiYpZLD9206Ej4SOdOXQ=="], - - "rc-picker": ["rc-picker@4.11.3", "https://registry.npmmirror.com/rc-picker/-/rc-picker-4.11.3.tgz", { "dependencies": { "@babel/runtime": "^7.24.7", "@rc-component/trigger": "^2.0.0", "classnames": "^2.2.1", "rc-overflow": "^1.3.2", "rc-resize-observer": "^1.4.0", "rc-util": "^5.43.0" }, "peerDependencies": { "date-fns": ">= 2.x", "dayjs": ">= 1.x", "luxon": ">= 3.x", "moment": ">= 2.x", "react": ">=16.9.0", "react-dom": ">=16.9.0" }, "optionalPeers": ["date-fns", "luxon", "moment"] }, "sha512-MJ5teb7FlNE0NFHTncxXQ62Y5lytq6sh5nUw0iH8OkHL/TjARSEvSHpr940pWgjGANpjCwyMdvsEV55l5tYNSg=="], - - "rc-progress": ["rc-progress@4.0.0", "https://registry.npmmirror.com/rc-progress/-/rc-progress-4.0.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.6", "rc-util": "^5.16.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-oofVMMafOCokIUIBnZLNcOZFsABaUw8PPrf1/y0ZBvKZNpOiu5h4AO9vv11Sw0p4Hb3D0yGWuEattcQGtNJ/aw=="], - - "rc-rate": ["rc-rate@2.13.1", "https://registry.npmmirror.com/rc-rate/-/rc-rate-2.13.1.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", "rc-util": "^5.0.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-QUhQ9ivQ8Gy7mtMZPAjLbxBt5y9GRp65VcUyGUMF3N3fhiftivPHdpuDIaWIMOTEprAjZPC08bls1dQB+I1F2Q=="], - - "rc-resize-observer": ["rc-resize-observer@1.4.3", "https://registry.npmmirror.com/rc-resize-observer/-/rc-resize-observer-1.4.3.tgz", { "dependencies": { "@babel/runtime": "^7.20.7", "classnames": "^2.2.1", "rc-util": "^5.44.1", "resize-observer-polyfill": "^1.5.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-YZLjUbyIWox8E9i9C3Tm7ia+W7euPItNWSPX5sCcQTYbnwDb5uNpnLHQCG1f22oZWUhLw4Mv2tFmeWe68CDQRQ=="], - - "rc-segmented": ["rc-segmented@2.7.1", "https://registry.npmmirror.com/rc-segmented/-/rc-segmented-2.7.1.tgz", { "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", "rc-motion": "^2.4.4", "rc-util": "^5.17.0" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-izj1Nw/Dw2Vb7EVr+D/E9lUTkBe+kKC+SAFSU9zqr7WV2W5Ktaa9Gc7cB2jTqgk8GROJayltaec+DBlYKc6d+g=="], - - "rc-select": ["rc-select@14.16.8", "https://registry.npmmirror.com/rc-select/-/rc-select-14.16.8.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/trigger": "^2.1.1", "classnames": "2.x", "rc-motion": "^2.0.1", "rc-overflow": "^1.3.1", "rc-util": "^5.16.1", "rc-virtual-list": "^3.5.2" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-NOV5BZa1wZrsdkKaiK7LHRuo5ZjZYMDxPP6/1+09+FB4KoNi8jcG1ZqLE3AVCxEsYMBe65OBx71wFoHRTP3LRg=="], - - "rc-slider": ["rc-slider@11.1.9", "https://registry.npmmirror.com/rc-slider/-/rc-slider-11.1.9.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", "rc-util": "^5.36.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-h8IknhzSh3FEM9u8ivkskh+Ef4Yo4JRIY2nj7MrH6GQmrwV6mcpJf5/4KgH5JaVI1H3E52yCdpOlVyGZIeph5A=="], - - "rc-steps": ["rc-steps@6.0.1", "https://registry.npmmirror.com/rc-steps/-/rc-steps-6.0.1.tgz", { "dependencies": { "@babel/runtime": "^7.16.7", "classnames": "^2.2.3", "rc-util": "^5.16.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-lKHL+Sny0SeHkQKKDJlAjV5oZ8DwCdS2hFhAkIjuQt1/pB81M0cA0ErVFdHq9+jmPmFw1vJB2F5NBzFXLJxV+g=="], - - "rc-switch": ["rc-switch@4.1.0", "https://registry.npmmirror.com/rc-switch/-/rc-switch-4.1.0.tgz", { "dependencies": { "@babel/runtime": "^7.21.0", "classnames": "^2.2.1", "rc-util": "^5.30.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-TI8ufP2Az9oEbvyCeVE4+90PDSljGyuwix3fV58p7HV2o4wBnVToEyomJRVyTaZeqNPAp+vqeo4Wnj5u0ZZQBg=="], - - "rc-table": ["rc-table@7.54.0", "https://registry.npmmirror.com/rc-table/-/rc-table-7.54.0.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/context": "^1.4.0", "classnames": "^2.2.5", "rc-resize-observer": "^1.1.0", "rc-util": "^5.44.3", "rc-virtual-list": "^3.14.2" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-/wDTkki6wBTjwylwAGjpLKYklKo9YgjZwAU77+7ME5mBoS32Q4nAwoqhA2lSge6fobLW3Tap6uc5xfwaL2p0Sw=="], - - "rc-tabs": ["rc-tabs@15.7.0", "https://registry.npmmirror.com/rc-tabs/-/rc-tabs-15.7.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.2", "classnames": "2.x", "rc-dropdown": "~4.2.0", "rc-menu": "~9.16.0", "rc-motion": "^2.6.2", "rc-resize-observer": "^1.0.0", "rc-util": "^5.34.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ZepiE+6fmozYdWf/9gVp7k56PKHB1YYoDsKeQA1CBlJ/POIhjkcYiv0AGP0w2Jhzftd3AVvZP/K+V+Lpi2ankA=="], - - "rc-textarea": ["rc-textarea@1.10.2", "https://registry.npmmirror.com/rc-textarea/-/rc-textarea-1.10.2.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.1", "rc-input": "~1.8.0", "rc-resize-observer": "^1.0.0", "rc-util": "^5.27.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-HfaeXiaSlpiSp0I/pvWpecFEHpVysZ9tpDLNkxQbMvMz6gsr7aVZ7FpWP9kt4t7DB+jJXesYS0us1uPZnlRnwQ=="], - - "rc-tooltip": ["rc-tooltip@6.4.0", "https://registry.npmmirror.com/rc-tooltip/-/rc-tooltip-6.4.0.tgz", { "dependencies": { "@babel/runtime": "^7.11.2", "@rc-component/trigger": "^2.0.0", "classnames": "^2.3.1", "rc-util": "^5.44.3" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-kqyivim5cp8I5RkHmpsp1Nn/Wk+1oeloMv9c7LXNgDxUpGm+RbXJGL+OPvDlcRnx9DBeOe4wyOIl4OKUERyH1g=="], - - "rc-tree": ["rc-tree@5.13.1", "https://registry.npmmirror.com/rc-tree/-/rc-tree-5.13.1.tgz", { "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", "rc-motion": "^2.0.1", "rc-util": "^5.16.1", "rc-virtual-list": "^3.5.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-FNhIefhftobCdUJshO7M8uZTA9F4OPGVXqGfZkkD/5soDeOhwO06T/aKTrg0WD8gRg/pyfq+ql3aMymLHCTC4A=="], - - "rc-tree-select": ["rc-tree-select@5.27.0", "https://registry.npmmirror.com/rc-tree-select/-/rc-tree-select-5.27.0.tgz", { "dependencies": { "@babel/runtime": "^7.25.7", "classnames": "2.x", "rc-select": "~14.16.2", "rc-tree": "~5.13.0", "rc-util": "^5.43.0" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-2qTBTzwIT7LRI1o7zLyrCzmo5tQanmyGbSaGTIf7sYimCklAToVVfpMC6OAldSKolcnjorBYPNSKQqJmN3TCww=="], - - "rc-upload": ["rc-upload@4.11.0", "https://registry.npmmirror.com/rc-upload/-/rc-upload-4.11.0.tgz", { "dependencies": { "@babel/runtime": "^7.18.3", "classnames": "^2.2.5", "rc-util": "^5.2.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ZUyT//2JAehfHzjWowqROcwYJKnZkIUGWaTE/VogVrepSl7AFNbQf4+zGfX4zl9Vrj/Jm8scLO0R6UlPDKK4wA=="], - - "rc-util": ["rc-util@5.44.4", "https://registry.npmmirror.com/rc-util/-/rc-util-5.44.4.tgz", { "dependencies": { "@babel/runtime": "^7.18.3", "react-is": "^18.2.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-resueRJzmHG9Q6rI/DfK6Kdv9/Lfls05vzMs1Sk3M2P+3cJa+MakaZyWY8IPfehVuhPJFKrIY1IK4GqbiaiY5w=="], - - "rc-virtual-list": ["rc-virtual-list@3.19.2", "https://registry.npmmirror.com/rc-virtual-list/-/rc-virtual-list-3.19.2.tgz", { "dependencies": { "@babel/runtime": "^7.20.0", "classnames": "^2.2.6", "rc-resize-observer": "^1.0.0", "rc-util": "^5.36.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Ys6NcjwGkuwkeaWBDqfI3xWuZ7rDiQXlH1o2zLfFzATfEgXcqpk8CkgMfbJD81McqjcJVez25a3kPxCR807evA=="], - - "react": ["react@19.2.5", "https://registry.npmmirror.com/react/-/react-19.2.5.tgz", {}, "sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA=="], - - "react-clientside-effect": ["react-clientside-effect@1.2.8", "https://registry.npmmirror.com/react-clientside-effect/-/react-clientside-effect-1.2.8.tgz", { "dependencies": { "@babel/runtime": "^7.12.13" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-ma2FePH0z3px2+WOu6h+YycZcEvFmmxIlAb62cF52bG86eMySciO/EQZeQMXd07kPCYB0a1dWDT5J+KE9mCDUw=="], - - "react-dom": ["react-dom@19.2.5", "https://registry.npmmirror.com/react-dom/-/react-dom-19.2.5.tgz", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.5" } }, "sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag=="], - - "react-fast-compare": ["react-fast-compare@3.2.2", "https://registry.npmmirror.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz", {}, "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="], - - "react-focus-lock": ["react-focus-lock@2.13.7", "https://registry.npmmirror.com/react-focus-lock/-/react-focus-lock-2.13.7.tgz", { "dependencies": { "@babel/runtime": "^7.0.0", "focus-lock": "^1.3.6", "prop-types": "^15.6.2", "react-clientside-effect": "^1.2.7", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-20lpZHEQrXPb+pp1tzd4ULL6DyO5D2KnR0G69tTDdydrmNhU7pdFmbQUYVyHUgp+xN29IuFR0PVuhOmvaZL9Og=="], - - "react-i18next": ["react-i18next@17.0.4", "https://registry.npmmirror.com/react-i18next/-/react-i18next-17.0.4.tgz", { "dependencies": { "@babel/runtime": "^7.29.2", "html-parse-stringify": "^3.0.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "i18next": ">= 26.0.1", "react": ">= 16.8.0", "typescript": "^5 || ^6" } }, "sha512-hQipmK4EF0y6RO6tt6WuqnmWpWYEXmQUUzecmMBuNsIgYd3smXcG4GtYPWhvgxn0pqMOItKlEO8H24HCs5hc3g=="], - - "react-icons": ["react-icons@5.6.0", "https://registry.npmmirror.com/react-icons/-/react-icons-5.6.0.tgz", { "peerDependencies": { "react": "*" } }, "sha512-RH93p5ki6LfOiIt0UtDyNg/cee+HLVR6cHHtW3wALfo+eOHTp8RnU2kRkI6E+H19zMIs03DyxUG/GfZMOGvmiA=="], - - "react-is": ["react-is@16.13.1", "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], - - "react-refresh": ["react-refresh@0.17.0", "https://registry.npmmirror.com/react-refresh/-/react-refresh-0.17.0.tgz", {}, "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ=="], - - "react-remove-scroll": ["react-remove-scroll@2.7.2", "https://registry.npmmirror.com/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q=="], - - "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "https://registry.npmmirror.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], - - "react-router": ["react-router@7.14.1", "https://registry.npmmirror.com/react-router/-/react-router-7.14.1.tgz", { "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-5BCvFskyAAVumqhEKh/iPhLOIkfxcEUz8WqFIARCkMg8hZZzDYX9CtwxXA0e+qT8zAxmMC0x3Ckb9iMONwc5jg=="], - - "react-router-dom": ["react-router-dom@7.14.1", "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.14.1.tgz", { "dependencies": { "react-router": "7.14.1" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-ZkrQuwwhGibjQLqH1eCdyiZyLWglPxzxdl5tgwgKEyCSGC76vmAjleGocRe3J/MLfzMUIKwaFJWpFVJhK3d2xA=="], - - "react-style-singleton": ["react-style-singleton@2.2.3", "https://registry.npmmirror.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], - - "readable-stream": ["readable-stream@2.3.8", "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="], - - "reflect.getprototypeof": ["reflect.getprototypeof@1.0.10", "https://registry.npmmirror.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.1", "which-builtin-type": "^1.2.1" } }, "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw=="], - - "regexp.prototype.flags": ["regexp.prototype.flags@1.5.4", "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" } }, "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA=="], - - "resize-observer-polyfill": ["resize-observer-polyfill@1.5.1", "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", {}, "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="], - - "resolve": ["resolve@1.22.12", "https://registry.npmmirror.com/resolve/-/resolve-1.22.12.tgz", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": "bin/resolve" }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="], - - "resolve-from": ["resolve-from@4.0.0", "https://registry.npmmirror.com/resolve-from/-/resolve-from-4.0.0.tgz", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], - - "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "https://registry.npmmirror.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], - - "reusify": ["reusify@1.1.0", "https://registry.npmmirror.com/reusify/-/reusify-1.1.0.tgz", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], - - "rollup": ["rollup@4.60.1", "https://registry.npmmirror.com/rollup/-/rollup-4.60.1.tgz", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.60.1", "@rollup/rollup-android-arm64": "4.60.1", "@rollup/rollup-darwin-arm64": "4.60.1", "@rollup/rollup-darwin-x64": "4.60.1", "@rollup/rollup-freebsd-arm64": "4.60.1", "@rollup/rollup-freebsd-x64": "4.60.1", "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", "@rollup/rollup-linux-arm-musleabihf": "4.60.1", "@rollup/rollup-linux-arm64-gnu": "4.60.1", "@rollup/rollup-linux-arm64-musl": "4.60.1", "@rollup/rollup-linux-loong64-gnu": "4.60.1", "@rollup/rollup-linux-loong64-musl": "4.60.1", "@rollup/rollup-linux-ppc64-gnu": "4.60.1", "@rollup/rollup-linux-ppc64-musl": "4.60.1", "@rollup/rollup-linux-riscv64-gnu": "4.60.1", "@rollup/rollup-linux-riscv64-musl": "4.60.1", "@rollup/rollup-linux-s390x-gnu": "4.60.1", "@rollup/rollup-linux-x64-gnu": "4.60.1", "@rollup/rollup-linux-x64-musl": "4.60.1", "@rollup/rollup-openbsd-x64": "4.60.1", "@rollup/rollup-openharmony-arm64": "4.60.1", "@rollup/rollup-win32-arm64-msvc": "4.60.1", "@rollup/rollup-win32-ia32-msvc": "4.60.1", "@rollup/rollup-win32-x64-gnu": "4.60.1", "@rollup/rollup-win32-x64-msvc": "4.60.1", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w=="], - - "run-parallel": ["run-parallel@1.2.0", "https://registry.npmmirror.com/run-parallel/-/run-parallel-1.2.0.tgz", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], - - "safe-array-concat": ["safe-array-concat@1.1.3", "https://registry.npmmirror.com/safe-array-concat/-/safe-array-concat-1.1.3.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "has-symbols": "^1.1.0", "isarray": "^2.0.5" } }, "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q=="], - - "safe-buffer": ["safe-buffer@5.1.2", "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="], - - "safe-push-apply": ["safe-push-apply@1.0.0", "https://registry.npmmirror.com/safe-push-apply/-/safe-push-apply-1.0.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" } }, "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA=="], - - "safe-regex-test": ["safe-regex-test@1.1.0", "https://registry.npmmirror.com/safe-regex-test/-/safe-regex-test-1.1.0.tgz", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="], - - "scheduler": ["scheduler@0.27.0", "https://registry.npmmirror.com/scheduler/-/scheduler-0.27.0.tgz", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], - - "scroll-into-view-if-needed": ["scroll-into-view-if-needed@3.1.0", "https://registry.npmmirror.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz", { "dependencies": { "compute-scroll-into-view": "^3.0.2" } }, "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ=="], - - "semver": ["semver@6.3.1", "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", { "bin": "bin/semver.js" }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "set-cookie-parser": ["set-cookie-parser@2.7.2", "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", {}, "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw=="], - - "set-function-length": ["set-function-length@1.2.2", "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="], - - "set-function-name": ["set-function-name@2.0.2", "https://registry.npmmirror.com/set-function-name/-/set-function-name-2.0.2.tgz", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" } }, "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ=="], - - "set-proto": ["set-proto@1.0.0", "https://registry.npmmirror.com/set-proto/-/set-proto-1.0.0.tgz", { "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0" } }, "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw=="], - - "setimmediate": ["setimmediate@1.0.5", "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="], - - "shebang-command": ["shebang-command@2.0.0", "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], - - "shebang-regex": ["shebang-regex@3.0.0", "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], - - "side-channel": ["side-channel@1.1.0", "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="], - - "side-channel-list": ["side-channel-list@1.0.1", "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.1.tgz", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="], - - "side-channel-map": ["side-channel-map@1.0.1", "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="], - - "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="], - - "source-map": ["source-map@0.5.7", "https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], - - "source-map-js": ["source-map-js@1.2.1", "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], - - "stable-hash": ["stable-hash@0.0.5", "https://registry.npmmirror.com/stable-hash/-/stable-hash-0.0.5.tgz", {}, "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA=="], - - "stop-iteration-iterator": ["stop-iteration-iterator@1.1.0", "https://registry.npmmirror.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" } }, "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ=="], - - "string-convert": ["string-convert@0.2.1", "https://registry.npmmirror.com/string-convert/-/string-convert-0.2.1.tgz", {}, "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A=="], - - "string.prototype.includes": ["string.prototype.includes@2.0.1", "https://registry.npmmirror.com/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.3" } }, "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg=="], - - "string.prototype.matchall": ["string.prototype.matchall@4.0.12", "https://registry.npmmirror.com/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "regexp.prototype.flags": "^1.5.3", "set-function-name": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA=="], - - "string.prototype.repeat": ["string.prototype.repeat@1.0.0", "https://registry.npmmirror.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", { "dependencies": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" } }, "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w=="], - - "string.prototype.trim": ["string.prototype.trim@1.2.10", "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-data-property": "^1.1.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-object-atoms": "^1.0.0", "has-property-descriptors": "^1.0.2" } }, "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA=="], - - "string.prototype.trimend": ["string.prototype.trimend@1.0.9", "https://registry.npmmirror.com/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ=="], - - "string.prototype.trimstart": ["string.prototype.trimstart@1.0.8", "https://registry.npmmirror.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg=="], - - "string_decoder": ["string_decoder@1.1.1", "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="], - - "strip-bom": ["strip-bom@3.0.0", "https://registry.npmmirror.com/strip-bom/-/strip-bom-3.0.0.tgz", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="], - - "strip-json-comments": ["strip-json-comments@3.1.1", "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], - - "stylis": ["stylis@4.2.0", "https://registry.npmmirror.com/stylis/-/stylis-4.2.0.tgz", {}, "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="], - - "supports-color": ["supports-color@7.2.0", "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], - - "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], - - "throttle-debounce": ["throttle-debounce@5.0.2", "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-5.0.2.tgz", {}, "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A=="], - - "tinyglobby": ["tinyglobby@0.2.16", "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.16.tgz", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg=="], - - "to-regex-range": ["to-regex-range@5.0.1", "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], - - "toggle-selection": ["toggle-selection@1.0.6", "https://registry.npmmirror.com/toggle-selection/-/toggle-selection-1.0.6.tgz", {}, "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ=="], - - "ts-api-utils": ["ts-api-utils@2.5.0", "https://registry.npmmirror.com/ts-api-utils/-/ts-api-utils-2.5.0.tgz", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA=="], - - "tsconfig-paths": ["tsconfig-paths@3.15.0", "https://registry.npmmirror.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", { "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg=="], - - "tslib": ["tslib@2.8.1", "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "type-check": ["type-check@0.4.0", "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], - - "typed-array-buffer": ["typed-array-buffer@1.0.3", "https://registry.npmmirror.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" } }, "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw=="], - - "typed-array-byte-length": ["typed-array-byte-length@1.0.3", "https://registry.npmmirror.com/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", { "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.14" } }, "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg=="], - - "typed-array-byte-offset": ["typed-array-byte-offset@1.0.4", "https://registry.npmmirror.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.15", "reflect.getprototypeof": "^1.0.9" } }, "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ=="], - - "typed-array-length": ["typed-array-length@1.0.7", "https://registry.npmmirror.com/typed-array-length/-/typed-array-length-1.0.7.tgz", { "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", "is-typed-array": "^1.1.13", "possible-typed-array-names": "^1.0.0", "reflect.getprototypeof": "^1.0.6" } }, "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg=="], - - "typescript": ["typescript@5.9.3", "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - - "unbox-primitive": ["unbox-primitive@1.1.0", "https://registry.npmmirror.com/unbox-primitive/-/unbox-primitive-1.1.0.tgz", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="], - - "undici-types": ["undici-types@6.21.0", "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], - - "unrs-resolver": ["unrs-resolver@1.11.1", "https://registry.npmmirror.com/unrs-resolver/-/unrs-resolver-1.11.1.tgz", { "dependencies": { "napi-postinstall": "^0.3.0" }, "optionalDependencies": { "@unrs/resolver-binding-android-arm-eabi": "1.11.1", "@unrs/resolver-binding-android-arm64": "1.11.1", "@unrs/resolver-binding-darwin-arm64": "1.11.1", "@unrs/resolver-binding-darwin-x64": "1.11.1", "@unrs/resolver-binding-freebsd-x64": "1.11.1", "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", "@unrs/resolver-binding-linux-x64-musl": "1.11.1", "@unrs/resolver-binding-wasm32-wasi": "1.11.1", "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" } }, "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg=="], - - "update-browserslist-db": ["update-browserslist-db@1.2.3", "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": "cli.js" }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], - - "uri-js": ["uri-js@4.4.1", "https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], - - "use-callback-ref": ["use-callback-ref@1.3.3", "https://registry.npmmirror.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="], - - "use-sidecar": ["use-sidecar@1.1.3", "https://registry.npmmirror.com/use-sidecar/-/use-sidecar-1.1.3.tgz", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="], - - "use-sync-external-store": ["use-sync-external-store@1.6.0", "https://registry.npmmirror.com/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="], - - "util-deprecate": ["util-deprecate@1.0.2", "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], - - "vite": ["vite@6.4.2", "https://registry.npmmirror.com/vite/-/vite-6.4.2.tgz", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": "bin/vite.js" }, "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ=="], - - "void-elements": ["void-elements@3.1.0", "https://registry.npmmirror.com/void-elements/-/void-elements-3.1.0.tgz", {}, "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="], - - "which": ["which@2.0.2", "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], - - "which-boxed-primitive": ["which-boxed-primitive@1.1.1", "https://registry.npmmirror.com/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", { "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" } }, "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA=="], - - "which-builtin-type": ["which-builtin-type@1.2.1", "https://registry.npmmirror.com/which-builtin-type/-/which-builtin-type-1.2.1.tgz", { "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.1.0", "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", "is-regex": "^1.2.1", "is-weakref": "^1.0.2", "isarray": "^2.0.5", "which-boxed-primitive": "^1.1.0", "which-collection": "^1.0.2", "which-typed-array": "^1.1.16" } }, "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q=="], - - "which-collection": ["which-collection@1.0.2", "https://registry.npmmirror.com/which-collection/-/which-collection-1.0.2.tgz", { "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", "is-weakmap": "^2.0.2", "is-weakset": "^2.0.3" } }, "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw=="], - - "which-typed-array": ["which-typed-array@1.1.20", "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.20.tgz", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg=="], - - "word-wrap": ["word-wrap@1.2.5", "https://registry.npmmirror.com/word-wrap/-/word-wrap-1.2.5.tgz", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], - - "yallist": ["yallist@3.1.1", "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], - - "yaml": ["yaml@1.10.3", "https://registry.npmmirror.com/yaml/-/yaml-1.10.3.tgz", {}, "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA=="], - - "yocto-queue": ["yocto-queue@0.1.0", "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], - - "zustand": ["zustand@5.0.14", "https://registry.npmmirror.com/zustand/-/zustand-5.0.14.tgz", { "peerDependencies": { "@types/react": ">=18.0.0", "immer": ">=9.0.6", "react": ">=18.0.0", "use-sync-external-store": ">=1.2.0" }, "optionalPeers": ["immer"] }, "sha512-/8tAspM5LMPr28b3fwLYrtdj77ECpfZviaP75CMTnwO8ISyaE4GDIG/9rDDYq/cH9D2Xw2A2RXglLInmVBQB/g=="], - - "@ant-design/cssinjs/@emotion/hash": ["@emotion/hash@0.8.0", "https://registry.npmmirror.com/@emotion/hash/-/hash-0.8.0.tgz", {}, "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow=="], - - "@ant-design/cssinjs/@emotion/unitless": ["@emotion/unitless@0.7.5", "https://registry.npmmirror.com/@emotion/unitless/-/unitless-0.7.5.tgz", {}, "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg=="], - - "@ant-design/cssinjs/stylis": ["stylis@4.4.0", "https://registry.npmmirror.com/stylis/-/stylis-4.4.0.tgz", {}, "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA=="], - - "@babel/core/convert-source-map": ["convert-source-map@2.0.0", "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], - - "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], - - "@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.5", "https://registry.npmmirror.com/ignore/-/ignore-7.0.5.tgz", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="], - - "@typescript-eslint/typescript-estree/minimatch": ["minimatch@10.2.5", "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.5.tgz", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], - - "@typescript-eslint/typescript-estree/semver": ["semver@7.7.4", "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", { "bin": "bin/semver.js" }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], - - "@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="], - - "eslint-import-resolver-node/debug": ["debug@3.2.7", "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], - - "eslint-import-resolver-node/resolve": ["resolve@2.0.0-next.6", "https://registry.npmmirror.com/resolve/-/resolve-2.0.0-next.6.tgz", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "node-exports-info": "^1.6.0", "object-keys": "^1.1.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": "bin/resolve" }, "sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA=="], - - "eslint-module-utils/debug": ["debug@3.2.7", "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], - - "eslint-plugin-import/debug": ["debug@3.2.7", "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], - - "eslint-plugin-react/resolve": ["resolve@2.0.0-next.6", "https://registry.npmmirror.com/resolve/-/resolve-2.0.0-next.6.tgz", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "node-exports-info": "^1.6.0", "object-keys": "^1.1.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": "bin/resolve" }, "sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA=="], - - "fast-glob/glob-parent": ["glob-parent@5.1.2", "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], - - "framesync/tslib": ["tslib@2.4.0", "https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz", {}, "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="], - - "is-bun-module/semver": ["semver@7.7.4", "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", { "bin": "bin/semver.js" }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], - - "micromatch/picomatch": ["picomatch@2.3.2", "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.2.tgz", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - - "rc-util/react-is": ["react-is@18.3.1", "https://registry.npmmirror.com/react-is/-/react-is-18.3.1.tgz", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="], - - "safe-array-concat/isarray": ["isarray@2.0.5", "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], - - "safe-push-apply/isarray": ["isarray@2.0.5", "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], - - "tsconfig-paths/json5": ["json5@1.0.2", "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", { "dependencies": { "minimist": "^1.2.0" }, "bin": "lib/cli.js" }, "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA=="], - - "which-builtin-type/isarray": ["isarray@2.0.5", "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], - - "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@5.0.5", "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.5.tgz", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ=="], - - "@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - } -} diff --git a/参考/NexBox-main/eslint.config.mjs b/参考/NexBox-main/eslint.config.mjs deleted file mode 100644 index 321a885..0000000 --- a/参考/NexBox-main/eslint.config.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { dirname } from "path"; -import { fileURLToPath } from "url"; -import { FlatCompat } from "@eslint/eslintrc"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const compat = new FlatCompat({ - baseDirectory: __dirname, -}); - -const eslintConfig = [ - { - ignores: [ - ".next/**", - "out/**", - "node_modules/**", - "src-tauri/target/**", - "tools/bin/**", - "tools/obj/**", - "next-env.d.ts", - ], - }, - ...compat.extends("next/core-web-vitals", "next/typescript"), -]; - -export default eslintConfig; diff --git a/参考/NexBox-main/index.html b/参考/NexBox-main/index.html deleted file mode 100644 index 91b6e67..0000000 --- a/参考/NexBox-main/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - 新境盒 - NexBox - - - - -
- - - diff --git a/参考/NexBox-main/installer/build-installer.ps1 b/参考/NexBox-main/installer/build-installer.ps1 deleted file mode 100644 index 02d8575..0000000 --- a/参考/NexBox-main/installer/build-installer.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -param() - -$ErrorActionPreference = "Stop" -$InstallerProject = "D:\NexBox\installer" - -# Read version from main project's Cargo.toml -$mainCargo = "D:\NexBox\src-tauri\Cargo.toml" -$version = (Select-String -Path $mainCargo -Pattern '^version\s*=\s*"(.+)"').Matches[0].Groups[1].Value -Write-Host "Main app version: $version" -ForegroundColor Cyan - -# Build installer -Set-Location $InstallerProject -npm run tauri:build -if ($LASTEXITCODE -ne 0) { throw "Installer build failed" } - -# Rename output -$builtExe = "$InstallerProject\src-tauri\target\release\nexbox-installer.exe" -$outputName = "NexBox_${version}_Windows_x86_64.exe" -$outputPath = "$InstallerProject\$outputName" - -if (Test-Path $builtExe) { - Copy-Item $builtExe $outputPath -Force - $size = (Get-ChildItem $outputPath).Length - Write-Host "`n=== SUCCESS ===" -ForegroundColor Green - Write-Host "Output: $outputPath" -ForegroundColor Green - Write-Host "Size: $('{0:N1}' -f ($size / 1MB)) MB" -ForegroundColor Green -} else { - Write-Host "`n=== BUILD FAILED ===" -ForegroundColor Red -} diff --git a/参考/NexBox-main/installer/index.html b/参考/NexBox-main/installer/index.html deleted file mode 100644 index 83dfc96..0000000 --- a/参考/NexBox-main/installer/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - 新境盒 安装程序 - - -
- - - diff --git a/参考/NexBox-main/installer/logo/Chinesew.png b/参考/NexBox-main/installer/logo/Chinesew.png deleted file mode 100644 index f0a7d74..0000000 Binary files a/参考/NexBox-main/installer/logo/Chinesew.png and /dev/null differ diff --git a/参考/NexBox-main/installer/logo/NexBoxW.png b/参考/NexBox-main/installer/logo/NexBoxW.png deleted file mode 100644 index 499d333..0000000 Binary files a/参考/NexBox-main/installer/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/installer/logo/preset.png b/参考/NexBox-main/installer/logo/preset.png deleted file mode 100644 index 070b3a8..0000000 Binary files a/参考/NexBox-main/installer/logo/preset.png and /dev/null differ diff --git a/参考/NexBox-main/installer/pack-payload.ps1 b/参考/NexBox-main/installer/pack-payload.ps1 deleted file mode 100644 index 851c9e4..0000000 --- a/参考/NexBox-main/installer/pack-payload.ps1 +++ /dev/null @@ -1,118 +0,0 @@ -param() - -$ErrorActionPreference = "Stop" -$MainProject = "D:\NexBox" -$InstallerProject = "D:\NexBox\installer" -$UninstallerProject = "D:\NexBox\uninstaller" -$PayloadZip = "$InstallerProject\src-tauri\payload.zip" -$TempDir = "$env:TEMP\nexbox-payload" - -Write-Host "=== Creating payload archive ===" -ForegroundColor Cyan - -# Clean temp directory -if (Test-Path $TempDir) { - Remove-Item "$TempDir\*" -Recurse -Force -ErrorAction SilentlyContinue -} -New-Item -ItemType Directory -Path $TempDir -Force | Out-Null - -# 1. Main exe -$mainExe = "$MainProject\src-tauri\target\release\nexbox.exe" -if (Test-Path $mainExe) { - Copy-Item $mainExe $TempDir\ - Write-Host " [OK] nexbox.exe" -} else { - Write-Warning " [WARN] nexbox.exe not found (build main app first)" -} - -# 2. Tauri runtime resources -$appResources = "$MainProject\src-tauri\resources" -if (Test-Path $appResources) { - New-Item -ItemType Directory -Path "$TempDir\resources" -Force | Out-Null - Copy-Item "$appResources\*" "$TempDir\resources\" -Recurse -Force - Write-Host " [OK] resources/*" -} - -# 3. Power plans -$powerPlans = "$MainProject\power-plans" -if (Test-Path $powerPlans) { - New-Item -ItemType Directory -Path "$TempDir\power-plans" -Force | Out-Null - Copy-Item "$powerPlans\*" "$TempDir\power-plans\" -Recurse -Force - Write-Host " [OK] power-plans/*" -} - -# 4. Monitor files -$monitorDir = "$MainProject\monitor\bin\Release\net48" -if (Test-Path $monitorDir) { - New-Item -ItemType Directory -Path "$TempDir\monitor" -Force | Out-Null - Copy-Item "$monitorDir\*" "$TempDir\monitor\" -Recurse -Force - Write-Host " [OK] monitor/*" -} - -# 5. AQ registry tweak files (apply) -$aqRegistry = "$MainProject\aq_registry" -if (Test-Path $aqRegistry) { - New-Item -ItemType Directory -Path "$TempDir\aq_registry" -Force | Out-Null - Copy-Item "$aqRegistry\*" "$TempDir\aq_registry\" -Recurse -Force - Write-Host " [OK] aq_registry/*" -} - -# 6. AQ registry tweak files (restore) -$aqRegistryRestore = "$MainProject\aq_registry_restore" -if (Test-Path $aqRegistryRestore) { - New-Item -ItemType Directory -Path "$TempDir\aq_registry_restore" -Force | Out-Null - Copy-Item "$aqRegistryRestore\*" "$TempDir\aq_registry_restore\" -Recurse -Force - Write-Host " [OK] aq_registry_restore/*" -} - -# 7. Flat root files -$rootFiles = @( - "nvidiaProfileInspector.exe", - "nvidiaProfileInspector.exe.config", - "Reference.xml", - "PawnIO_setup.exe" -) -foreach ($file in $rootFiles) { - $src = "$MainProject\$file" - if (Test-Path $src) { - Copy-Item $src $TempDir\ - Write-Host " [OK] $file" - } else { - Write-Warning " [WARN] $file not found (skipping)" - } -} - -# 8. NVAPI lib -$nvapiDir = "$TempDir\R560-developer\amd64" -New-Item -ItemType Directory -Path $nvapiDir -Force | Out-Null -$nvapiLib = "$MainProject\R560-developer\amd64\nvapi64.lib" -if (Test-Path $nvapiLib) { - Copy-Item $nvapiLib $nvapiDir\ - Write-Host " [OK] R560-developer/amd64/nvapi64.lib" -} else { - Write-Warning " [WARN] nvapi64.lib not found (skipping)" -} - -# 9. Uninstaller -$uninstExe = "$UninstallerProject\src-tauri\target\release\uninstnexbox.exe" -if (Test-Path $uninstExe) { - Copy-Item $uninstExe $TempDir\ - Write-Host " [OK] Uninstnexbox.exe" -} else { - Write-Warning " [WARN] Uninstnexbox.exe not found (build uninstaller first)" -} - -# 10. Create ZIP -Write-Host "`nCompressing payload..." -ForegroundColor Cyan -if (Test-Path $PayloadZip) { - Remove-Item $PayloadZip -Force -} - -Add-Type -AssemblyName System.IO.Compression.FileSystem -[System.IO.Compression.ZipFile]::CreateFromDirectory($TempDir, $PayloadZip, [System.IO.Compression.CompressionLevel]::Optimal, $false) - -$zipSize = (Get-ChildItem $PayloadZip).Length -$fileCount = (Get-ChildItem $TempDir -Recurse -File | Measure-Object).Count -Write-Host " [DONE] $fileCount files -> payload.zip, $('{0:N1}' -f ($zipSize / 1MB)) MB" -ForegroundColor Green - -# Cleanup temp -Remove-Item $TempDir -Recurse -Force -ErrorAction SilentlyContinue diff --git a/参考/NexBox-main/installer/package-lock.json b/参考/NexBox-main/installer/package-lock.json deleted file mode 100644 index 87834b8..0000000 --- a/参考/NexBox-main/installer/package-lock.json +++ /dev/null @@ -1,2788 +0,0 @@ -{ - "name": "nexbox-installer", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "nexbox-installer", - "version": "1.0.0", - "dependencies": { - "@chakra-ui/react": "^2.10.9", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@tauri-apps/api": "^2.11.1", - "@tauri-apps/plugin-dialog": "^2.2.1", - "@tauri-apps/plugin-shell": "^2.3.5", - "framer-motion": "^11.18.2", - "i18next": "^26.0.5", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-i18next": "^17.0.4", - "react-icons": "^5.7.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^2.11.4", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "typescript": "^5.8.2", - "vite": "^6.0.11" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.29.7", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-compilation-targets": "^7.29.7", - "@babel/helper-module-transforms": "^7.29.7", - "@babel/helpers": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/generator": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.29.7", - "@babel/helper-validator-option": "^7.29.7", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.29.7", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7", - "@babel/traverse": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.29.7", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.29.7", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.7" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.29.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.29.7", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", - "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", - "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.29.7", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.29.7", - "@babel/helper-validator-identifier": "^7.29.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@chakra-ui/anatomy": { - "version": "2.3.6", - "license": "MIT" - }, - "node_modules/@chakra-ui/hooks": { - "version": "2.4.6", - "license": "MIT", - "dependencies": { - "@chakra-ui/utils": "2.2.6", - "@zag-js/element-size": "0.31.1", - "copy-to-clipboard": "3.3.3", - "framesync": "6.1.2" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react": { - "version": "2.10.10", - "license": "MIT", - "dependencies": { - "@chakra-ui/hooks": "2.4.6", - "@chakra-ui/styled-system": "2.12.5", - "@chakra-ui/theme": "3.4.10", - "@chakra-ui/utils": "2.2.6", - "@popperjs/core": "^2.11.8", - "@zag-js/focus-visible": "^0.31.1", - "aria-hidden": "^1.2.3", - "react-fast-compare": "3.2.2", - "react-focus-lock": "^2.9.6", - "react-remove-scroll": "^2.5.7" - }, - "peerDependencies": { - "@emotion/react": ">=11", - "@emotion/styled": ">=11", - "framer-motion": ">=4.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/styled-system": { - "version": "2.12.5", - "license": "MIT", - "dependencies": { - "@chakra-ui/utils": "2.2.6", - "csstype": "^3.1.2" - } - }, - "node_modules/@chakra-ui/theme": { - "version": "3.4.10", - "license": "MIT", - "dependencies": { - "@chakra-ui/anatomy": "2.3.6", - "@chakra-ui/theme-tools": "2.2.10", - "@chakra-ui/utils": "2.2.6" - }, - "peerDependencies": { - "@chakra-ui/styled-system": ">=2.8.0" - } - }, - "node_modules/@chakra-ui/theme-tools": { - "version": "2.2.10", - "license": "MIT", - "dependencies": { - "@chakra-ui/anatomy": "2.3.6", - "@chakra-ui/utils": "2.2.6", - "color2k": "^2.0.2" - }, - "peerDependencies": { - "@chakra-ui/styled-system": ">=2.0.0" - } - }, - "node_modules/@chakra-ui/utils": { - "version": "2.2.6", - "license": "MIT", - "dependencies": { - "@types/lodash.mergewith": "4.6.9", - "lodash.mergewith": "4.6.2" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emotion/babel-plugin": { - "version": "11.13.5", - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/runtime": "^7.18.3", - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/serialize": "^1.3.3", - "babel-plugin-macros": "^3.1.0", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/cache": { - "version": "11.14.0", - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/hash": { - "version": "0.9.2", - "license": "MIT" - }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.4.0", - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.9.0", - "license": "MIT" - }, - "node_modules/@emotion/react": { - "version": "11.14.0", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.14.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "hoist-non-react-statics": "^3.3.1" - }, - "peerDependencies": { - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/serialize": { - "version": "1.3.3", - "license": "MIT", - "dependencies": { - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/unitless": "^0.10.0", - "@emotion/utils": "^1.4.2", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/sheet": { - "version": "1.4.0", - "license": "MIT" - }, - "node_modules/@emotion/styled": { - "version": "11.14.1", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/is-prop-valid": "^1.3.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0-rc.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/unitless": { - "version": "0.10.0", - "license": "MIT" - }, - "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.2.0", - "license": "MIT", - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emotion/utils": { - "version": "1.4.2", - "license": "MIT" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.4.0", - "license": "MIT" - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-beta.27", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", - "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", - "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", - "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", - "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", - "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", - "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", - "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", - "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", - "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", - "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", - "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", - "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", - "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", - "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", - "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", - "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", - "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", - "cpu": [ - "s390x" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", - "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", - "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", - "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", - "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", - "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", - "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.2", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.2", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@tauri-apps/api": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.11.1.tgz", - "integrity": "sha512-M2FPuYND2m+wh5hfW9ZpSdxMPdEJovPBWwoHJmwUpysTYNHaOkVFN419m/K0LIgjb/7KU2vBgsUepJWugQCvAA==", - "license": "Apache-2.0 OR MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/tauri" - } - }, - "node_modules/@tauri-apps/cli": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.11.4.tgz", - "integrity": "sha512-R8xGtMpwyetawSqm9kYOuMmEqkhUbvcUy8n0aNXIxollKBLESUu5f4Fx+64hgASYm1H+jSWq6jCW6zqTnH6hqQ==", - "dev": true, - "license": "Apache-2.0 OR MIT", - "bin": { - "tauri": "tauri.js" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/tauri" - }, - "optionalDependencies": { - "@tauri-apps/cli-darwin-arm64": "2.11.4", - "@tauri-apps/cli-darwin-x64": "2.11.4", - "@tauri-apps/cli-linux-arm-gnueabihf": "2.11.4", - "@tauri-apps/cli-linux-arm64-gnu": "2.11.4", - "@tauri-apps/cli-linux-arm64-musl": "2.11.4", - "@tauri-apps/cli-linux-riscv64-gnu": "2.11.4", - "@tauri-apps/cli-linux-x64-gnu": "2.11.4", - "@tauri-apps/cli-linux-x64-musl": "2.11.4", - "@tauri-apps/cli-win32-arm64-msvc": "2.11.4", - "@tauri-apps/cli-win32-ia32-msvc": "2.11.4", - "@tauri-apps/cli-win32-x64-msvc": "2.11.4" - } - }, - "node_modules/@tauri-apps/cli-darwin-arm64": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.11.4.tgz", - "integrity": "sha512-1ryOF3ZhpZ/nemHV5zVwBQBz9jDGKmKPvWPADOhc83ig0P4bMc2iER4NbC6r9sjeIZ6RVQ4g3RZIYvezhcl4TQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-darwin-x64": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.11.4.tgz", - "integrity": "sha512-uFsGQAAfuyz1k/yGLmkWfkBlgKAqZfxqlHmLWx81QU27RJWfmbNHCIq8T8w1e+VClleIuZUjpHWfoE4E3DLo3A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.11.4.tgz", - "integrity": "sha512-IaHZn5CdBL21oUmjiVOS1ctw6Ip1O0pjp70FwOWmYz1myWe0SY96ZIj2FYf7pT0m8bI2h/hrs5ZbEXXh44/MkQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm64-gnu": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.11.4.tgz", - "integrity": "sha512-N41/ukTRVe6XSuUTESuFdGeOW2i7k62tK+6gHK5Kd5/q5RPvvi19GaWAVPPb9u95HSGmTChSolBfzynUsssFaA==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm64-musl": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.11.4.tgz", - "integrity": "sha512-v277UnT/fB64xAfSroL5N3Km3tLmvATWqJJw/wRI+g6o+HkeD0slyE7gOhNs1MbjE41R7bQOTxMVoL3aomUJmw==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.11.4.tgz", - "integrity": "sha512-qqgNkQ2u1yZHxjhxsZaxUtRDW8dIqIYm33rx/mzwQv0SfY9x1B+iraj8vWeFiXjjSVVhEMepXSOts1TqPzvXNQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-x64-gnu": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.11.4.tgz", - "integrity": "sha512-2VRNWl84FOH0m2giiDkO2h0QXlcMJeX+zJDpI5kDIQAx6s+geF3v48F4DXfJez4GS/FdoDGnPnw1C2iYGbQ7bQ==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-x64-musl": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.11.4.tgz", - "integrity": "sha512-o9GyhYor/nc7xarmwDE3ka2szuW3uuZzXjHWh64Q8YX5AtSgxdQkFWzrY4O8KiGtVNvFBI14H3Q49Qj5TOIP/A==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-arm64-msvc": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.11.4.tgz", - "integrity": "sha512-ld5Ehb598m0VkYyylRPNeCFsBe/km0jxis6KgMpl3IGY6I/i1RwQXO05I1AsXUXO2WC6AvB/Lw4qTf/asiuEiQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-ia32-msvc": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.11.4.tgz", - "integrity": "sha512-12Hxi0XX/H5VFxO/bGgHkFWhml9VMgEOu9CidjeCeTNQ1l6fpUlbiGgSP7CLI3PFtW9/FfbeHieZ+kyWK5H7CA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-x64-msvc": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.11.4.tgz", - "integrity": "sha512-+vDiqBIU5dMISg/wNvX3sF+ZHfgJGJ5T0AcO+EHNXV9GGAG+P5fzodlDXD3QdKCRgZxMoCm5PPvj3BqLNjBthw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/plugin-dialog": { - "version": "2.7.1", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.11.0" - } - }, - "node_modules/@tauri-apps/plugin-shell": { - "version": "2.3.5", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.10.1" - } - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/lodash": { - "version": "4.17.24", - "license": "MIT" - }, - "node_modules/@types/lodash.mergewith": { - "version": "4.6.9", - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/parse-json": { - "version": "4.0.2", - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "19.2.17", - "devOptional": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.2.2" - } - }, - "node_modules/@types/react-dom": { - "version": "19.2.3", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^19.2.0" - } - }, - "node_modules/@vitejs/plugin-react": { - "version": "4.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.28.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-beta.27", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.17.0" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" - } - }, - "node_modules/@zag-js/dom-query": { - "version": "0.31.1", - "license": "MIT" - }, - "node_modules/@zag-js/element-size": { - "version": "0.31.1", - "license": "MIT" - }, - "node_modules/@zag-js/focus-visible": { - "version": "0.31.1", - "license": "MIT", - "dependencies": { - "@zag-js/dom-query": "0.31.1" - } - }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/babel-plugin-macros": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5", - "cosmiconfig": "^7.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">=10", - "npm": ">=6" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.42", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/browserslist": { - "version": "4.28.5", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001800", - "electron-to-chromium": "^1.5.387", - "node-releases": "^2.0.50", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001803", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/color2k": { - "version": "2.0.4", - "license": "MIT" - }, - "node_modules/convert-source-map": { - "version": "1.9.0", - "license": "MIT" - }, - "node_modules/copy-to-clipboard": { - "version": "3.3.3", - "license": "MIT", - "dependencies": { - "toggle-selection": "^1.0.6" - } - }, - "node_modules/cosmiconfig": { - "version": "7.1.0", - "license": "MIT", - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cosmiconfig/node_modules/yaml": { - "version": "1.10.3", - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, - "node_modules/csstype": { - "version": "3.2.3", - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "license": "MIT" - }, - "node_modules/electron-to-chromium": { - "version": "1.5.389", - "dev": true, - "license": "ISC" - }, - "node_modules/error-ex": { - "version": "1.3.4", - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esbuild": { - "version": "0.25.12", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/fdir": { - "version": "6.5.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/find-root": { - "version": "1.1.0", - "license": "MIT" - }, - "node_modules/focus-lock": { - "version": "1.3.6", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/framer-motion": { - "version": "11.18.2", - "license": "MIT", - "dependencies": { - "motion-dom": "^11.18.1", - "motion-utils": "^11.18.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "@emotion/is-prop-valid": "*", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/is-prop-valid": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - } - }, - "node_modules/framesync": { - "version": "6.1.2", - "license": "MIT", - "dependencies": { - "tslib": "2.4.0" - } - }, - "node_modules/framesync/node_modules/tslib": { - "version": "2.4.0", - "license": "0BSD" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-nonce": { - "version": "1.0.1", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/html-parse-stringify": { - "version": "3.0.1", - "license": "MIT", - "dependencies": { - "void-elements": "3.1.0" - } - }, - "node_modules/i18next": { - "version": "26.3.5", - "funding": [ - { - "type": "individual", - "url": "https://www.locize.com/i18next" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - }, - { - "type": "individual", - "url": "https://www.locize.com" - } - ], - "license": "MIT", - "peerDependencies": { - "typescript": "^5 || ^6" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "license": "MIT" - }, - "node_modules/is-core-module": { - "version": "2.16.2", - "license": "MIT", - "dependencies": { - "hasown": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "license": "MIT" - }, - "node_modules/jsesc": { - "version": "3.1.0", - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "license": "MIT" - }, - "node_modules/json5": { - "version": "2.2.3", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "license": "MIT" - }, - "node_modules/lodash.mergewith": { - "version": "4.6.2", - "license": "MIT" - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/motion-dom": { - "version": "11.18.1", - "license": "MIT", - "dependencies": { - "motion-utils": "^11.18.1" - } - }, - "node_modules/motion-utils": { - "version": "11.18.1", - "license": "MIT" - }, - "node_modules/ms": { - "version": "2.1.3", - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.15", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/node-releases": { - "version": "2.0.50", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.16", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.12", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/react": { - "version": "19.2.7", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-clientside-effect": { - "version": "1.2.8", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.13" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - } - }, - "node_modules/react-dom": { - "version": "19.2.7", - "license": "MIT", - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.7" - } - }, - "node_modules/react-fast-compare": { - "version": "3.2.2", - "license": "MIT" - }, - "node_modules/react-focus-lock": { - "version": "2.13.7", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.0.0", - "focus-lock": "^1.3.6", - "prop-types": "^15.6.2", - "react-clientside-effect": "^1.2.7", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-i18next": { - "version": "17.0.8", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.29.2", - "html-parse-stringify": "^3.0.1", - "use-sync-external-store": "^1.6.0" - }, - "peerDependencies": { - "i18next": ">= 26.2.0", - "react": ">= 16.8.0", - "typescript": "^5 || ^6" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/react-icons": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.7.0.tgz", - "integrity": "sha512-LBLy340Rzqy6+/yVhZKT3B/QpP1BZaesGqasf09HPOBzRarcDIFH0WwXlXQfE7q7ipxK4MSiC5DIBWURCny6fw==", - "license": "MIT", - "peerDependencies": { - "react": "*" - } - }, - "node_modules/react-is": { - "version": "16.13.1", - "license": "MIT" - }, - "node_modules/react-refresh": { - "version": "0.17.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-remove-scroll": { - "version": "2.7.2", - "license": "MIT", - "dependencies": { - "react-remove-scroll-bar": "^2.3.7", - "react-style-singleton": "^2.2.3", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-remove-scroll-bar": { - "version": "2.3.8", - "license": "MIT", - "dependencies": { - "react-style-singleton": "^2.2.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-style-singleton": { - "version": "2.2.3", - "license": "MIT", - "dependencies": { - "get-nonce": "^1.0.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/resolve": { - "version": "1.22.12", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/rollup": { - "version": "4.62.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.9" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.62.2", - "@rollup/rollup-android-arm64": "4.62.2", - "@rollup/rollup-darwin-arm64": "4.62.2", - "@rollup/rollup-darwin-x64": "4.62.2", - "@rollup/rollup-freebsd-arm64": "4.62.2", - "@rollup/rollup-freebsd-x64": "4.62.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", - "@rollup/rollup-linux-arm-musleabihf": "4.62.2", - "@rollup/rollup-linux-arm64-gnu": "4.62.2", - "@rollup/rollup-linux-arm64-musl": "4.62.2", - "@rollup/rollup-linux-loong64-gnu": "4.62.2", - "@rollup/rollup-linux-loong64-musl": "4.62.2", - "@rollup/rollup-linux-ppc64-gnu": "4.62.2", - "@rollup/rollup-linux-ppc64-musl": "4.62.2", - "@rollup/rollup-linux-riscv64-gnu": "4.62.2", - "@rollup/rollup-linux-riscv64-musl": "4.62.2", - "@rollup/rollup-linux-s390x-gnu": "4.62.2", - "@rollup/rollup-linux-x64-gnu": "4.62.2", - "@rollup/rollup-linux-x64-musl": "4.62.2", - "@rollup/rollup-openbsd-x64": "4.62.2", - "@rollup/rollup-openharmony-arm64": "4.62.2", - "@rollup/rollup-win32-arm64-msvc": "4.62.2", - "@rollup/rollup-win32-ia32-msvc": "4.62.2", - "@rollup/rollup-win32-x64-gnu": "4.62.2", - "@rollup/rollup-win32-x64-msvc": "4.62.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/scheduler": { - "version": "0.27.0", - "license": "MIT" - }, - "node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stylis": { - "version": "4.2.0", - "license": "MIT" - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/toggle-selection": { - "version": "1.0.6", - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.8.1", - "license": "0BSD" - }, - "node_modules/typescript": { - "version": "5.9.3", - "devOptional": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/use-callback-ref": { - "version": "1.3.3", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sidecar": { - "version": "1.1.3", - "license": "MIT", - "dependencies": { - "detect-node-es": "^1.1.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sync-external-store": { - "version": "1.6.0", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/vite": { - "version": "6.4.3", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.4.4", - "picomatch": "^4.0.2", - "postcss": "^8.5.3", - "rollup": "^4.34.9", - "tinyglobby": "^0.2.13" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "jiti": ">=1.21.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/void-elements": { - "version": "3.1.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "dev": true, - "license": "ISC" - } - } -} diff --git a/参考/NexBox-main/installer/package.json b/参考/NexBox-main/installer/package.json deleted file mode 100644 index 5a0210b..0000000 --- a/参考/NexBox-main/installer/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nexbox-installer", - "version": "5.9.8", - "private": true, - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "tauri": "tauri", - "tauri:build": "tauri build" - }, - "dependencies": { - "@chakra-ui/react": "^2.10.9", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@tauri-apps/api": "^2.11.1", - "@tauri-apps/plugin-dialog": "^2.2.1", - "@tauri-apps/plugin-shell": "^2.3.5", - "framer-motion": "^11.18.2", - "i18next": "^26.0.5", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-i18next": "^17.0.4", - "react-icons": "^5.7.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^2.11.4", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "typescript": "^5.8.2", - "vite": "^6.0.11" - } -} diff --git a/参考/NexBox-main/installer/public/logo/Chinesew.png b/参考/NexBox-main/installer/public/logo/Chinesew.png deleted file mode 100644 index 8bb5af8..0000000 Binary files a/参考/NexBox-main/installer/public/logo/Chinesew.png and /dev/null differ diff --git a/参考/NexBox-main/installer/public/logo/NexBoxW.png b/参考/NexBox-main/installer/public/logo/NexBoxW.png deleted file mode 100644 index 73a8331..0000000 Binary files a/参考/NexBox-main/installer/public/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/installer/public/logo/preset.png b/参考/NexBox-main/installer/public/logo/preset.png deleted file mode 100644 index 7ea693a..0000000 Binary files a/参考/NexBox-main/installer/public/logo/preset.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/Cargo.lock b/参考/NexBox-main/installer/src-tauri/Cargo.lock deleted file mode 100644 index 00a1a50..0000000 --- a/参考/NexBox-main/installer/src-tauri/Cargo.lock +++ /dev/null @@ -1,5054 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" - -[[package]] -name = "arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "atk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" -dependencies = [ - "atk-sys", - "glib", - "libc", -] - -[[package]] -name = "atk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" -dependencies = [ - "serde_core", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" -dependencies = [ - "objc2", -] - -[[package]] -name = "brotli" -version = "8.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "5.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "bumpalo" -version = "3.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" - -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" -dependencies = [ - "serde", -] - -[[package]] -name = "bzip2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" -dependencies = [ - "bzip2-sys", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "cairo-rs" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" -dependencies = [ - "bitflags 2.13.0", - "cairo-sys-rs", - "glib", - "libc", - "once_cell", - "thiserror 1.0.69", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "camino" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2d30e4173c4026932d51d31d6b0613b1fd3014bf3f9f8943d4ba139c437ba0" -dependencies = [ - "serde_core", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror 2.0.18", -] - -[[package]] -name = "cargo_toml" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" -dependencies = [ - "serde", - "toml 0.9.12+spec-1.1.0", -] - -[[package]] -name = "cc" -version = "1.2.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cfb" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" -dependencies = [ - "byteorder", - "fnv", - "uuid", -] - -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "chrono" -version = "0.4.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" -dependencies = [ - "iana-time-zone", - "num-traits", - "serde", - "windows-link 0.2.1", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "constant_time_eq" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" - -[[package]] -name = "cookie" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" -dependencies = [ - "time", - "version_check", -] - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "core-graphics" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" -dependencies = [ - "bitflags 2.13.0", - "core-foundation", - "core-graphics-types", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" -dependencies = [ - "bitflags 2.13.0", - "core-foundation", - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cssparser" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf", - "smallvec", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote", - "syn 2.0.118", -] - -[[package]] -name = "ctor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - -[[package]] -name = "ctor-proc-macro" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.118", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "dbus" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" -dependencies = [ - "libc", - "libdbus-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "deflate64" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2" - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "serde_core", -] - -[[package]] -name = "derive_arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "derive_more" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" -dependencies = [ - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.118", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys 0.4.1", -] - -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys 0.5.0", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.4.6", - "windows-sys 0.48.0", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.5.2", - "windows-sys 0.61.2", -] - -[[package]] -name = "dispatch2" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" -dependencies = [ - "bitflags 2.13.0", - "block2", - "libc", - "objc2", -] - -[[package]] -name = "displaydoc" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "dlopen2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "dom_query" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" -dependencies = [ - "bit-set", - "cssparser", - "foldhash", - "html5ever", - "precomputed-hash", - "selectors", - "tendril", -] - -[[package]] -name = "dpi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" -dependencies = [ - "serde", -] - -[[package]] -name = "dtoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - -[[package]] -name = "dtor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - -[[package]] -name = "embed-resource" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfdaacccebec3b28e4866b8973543c7647797db5ada1bdab552e48fe665fbbd" -dependencies = [ - "cc", - "memchr", - "rustc_version", - "toml 1.1.2+spec-1.1.0", - "vswhom", - "winreg 0.55.0", -] - -[[package]] -name = "embed_plist" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "erased-serde" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" -dependencies = [ - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "fastrand" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "field-offset" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" -dependencies = [ - "memoffset", - "rustc_version", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-executor" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-macro" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "futures-sink" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - -[[package]] -name = "gdk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" -dependencies = [ - "cairo-rs", - "gdk-pixbuf", - "gdk-sys", - "gio", - "glib", - "libc", - "pango", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" -dependencies = [ - "gdk-pixbuf-sys", - "gio", - "glib", - "libc", - "once_cell", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" -dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkwayland-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" -dependencies = [ - "gdk-sys", - "glib-sys", - "gobject-sys", - "libc", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkx11" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" -dependencies = [ - "gdk", - "gdkx11-sys", - "gio", - "glib", - "libc", - "x11", -] - -[[package]] -name = "gdkx11-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" -dependencies = [ - "gdk-sys", - "glib-sys", - "libc", - "system-deps", - "x11", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "r-efi 5.3.0", - "wasip2", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", -] - -[[package]] -name = "gio" -version = "0.18.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "gio-sys", - "glib", - "libc", - "once_cell", - "pin-project-lite", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "gio-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - -[[package]] -name = "glib" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" -dependencies = [ - "bitflags 2.13.0", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "memchr", - "once_cell", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "glib-macros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" -dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "glib-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - -[[package]] -name = "gobject-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" -dependencies = [ - "atk", - "cairo-rs", - "field-offset", - "futures-channel", - "gdk", - "gdk-pixbuf", - "gio", - "glib", - "gtk-sys", - "gtk3-macros", - "libc", - "pango", - "pkg-config", -] - -[[package]] -name = "gtk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - -[[package]] -name = "gtk3-macros" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "html5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" -dependencies = [ - "log", - "markup5ever", -] - -[[package]] -name = "http" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hyper" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "ipnet", - "libc", - "percent-encoding", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core 0.62.2", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ico" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" -dependencies = [ - "byteorder", - "png 0.17.16", -] - -[[package]] -name = "icu_collections" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" -dependencies = [ - "displaydoc", - "potential_utf", - "utf8_iter", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" - -[[package]] -name = "icu_properties" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" - -[[package]] -name = "icu_provider" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.1", - "serde", - "serde_core", -] - -[[package]] -name = "infer" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" -dependencies = [ - "cfb", -] - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "ipnet" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" - -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "javascriptcore-rs" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" -dependencies = [ - "bitflags 1.3.2", - "glib", - "javascriptcore-rs-sys", -] - -[[package]] -name = "javascriptcore-rs-sys" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" -dependencies = [ - "jni-sys 0.4.1", -] - -[[package]] -name = "jni-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" -dependencies = [ - "jni-sys-macros", -] - -[[package]] -name = "jni-sys-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" -dependencies = [ - "quote", - "syn 2.0.118", -] - -[[package]] -name = "jobserver" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" -dependencies = [ - "getrandom 0.4.3", - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" -dependencies = [ - "cfg-if", - "futures-util", - "wasm-bindgen", -] - -[[package]] -name = "json-patch" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" -dependencies = [ - "jsonptr", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "jsonptr" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.13.0", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "libappindicator" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" -dependencies = [ - "glib", - "gtk", - "gtk-sys", - "libappindicator-sys", - "log", -] - -[[package]] -name = "libappindicator-sys" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" -dependencies = [ - "gtk-sys", - "libloading", - "once_cell", -] - -[[package]] -name = "libc" -version = "0.2.186" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" - -[[package]] -name = "libdbus-sys" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" -dependencies = [ - "pkg-config", -] - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libredox" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" -dependencies = [ - "libc", -] - -[[package]] -name = "litemap" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" - -[[package]] -name = "lzma-rs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" -dependencies = [ - "byteorder", - "crc", -] - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "markup5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" -dependencies = [ - "log", - "tendril", - "web_atoms", -] - -[[package]] -name = "memchr" -version = "2.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "mslnk" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c97310150b7f496a93f31690da7822b99d95ff68ca9d30fb09d3ad54375c76" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "log", -] - -[[package]] -name = "muda" -version = "0.19.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd04e60bc0b07438a6771710ee1698f98f6ebbc7f89b61264af1563b8aeb878" -dependencies = [ - "crossbeam-channel", - "dpi", - "gtk", - "keyboard-types", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "ndk" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" -dependencies = [ - "bitflags 2.13.0", - "jni-sys 0.3.1", - "log", - "ndk-sys", - "num_enum", - "raw-window-handle", - "thiserror 1.0.69", -] - -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys 0.3.1", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nexbox-installer" -version = "5.9.8" -dependencies = [ - "dirs 5.0.1", - "mslnk", - "serde", - "serde_json", - "tauri", - "tauri-build", - "tauri-plugin-dialog", - "tauri-plugin-shell", - "winreg 0.52.0", - "zip", -] - -[[package]] -name = "num-conv" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" -dependencies = [ - "num_enum_derive", - "rustversion", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "objc2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" -dependencies = [ - "objc2-encode", - "objc2-exception-helper", -] - -[[package]] -name = "objc2-app-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" -dependencies = [ - "bitflags 2.13.0", - "block2", - "objc2", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" -dependencies = [ - "bitflags 2.13.0", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags 2.13.0", - "dispatch2", - "objc2", -] - -[[package]] -name = "objc2-core-graphics" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" -dependencies = [ - "bitflags 2.13.0", - "dispatch2", - "objc2", - "objc2-core-foundation", - "objc2-io-surface", -] - -[[package]] -name = "objc2-core-image" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-location" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-text" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" -dependencies = [ - "bitflags 2.13.0", - "objc2", - "objc2-core-foundation", - "objc2-core-graphics", -] - -[[package]] -name = "objc2-encode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "objc2-exception-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" -dependencies = [ - "cc", -] - -[[package]] -name = "objc2-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" -dependencies = [ - "bitflags 2.13.0", - "block2", - "libc", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-io-surface" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" -dependencies = [ - "bitflags 2.13.0", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" -dependencies = [ - "bitflags 2.13.0", - "objc2", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "objc2-ui-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" -dependencies = [ - "bitflags 2.13.0", - "block2", - "objc2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image", - "objc2-core-location", - "objc2-core-text", - "objc2-foundation", - "objc2-quartz-core", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-web-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" -dependencies = [ - "bitflags 2.13.0", - "block2", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "open" -version = "5.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d3b65c44123a56e0133d2cd06ce4361bd3ca99d41198b2f25e3c3db9b8b4a" -dependencies = [ - "dunce", - "is-wsl", - "libc", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "os_pipe" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "pango" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" -dependencies = [ - "gio", - "glib", - "libc", - "once_cell", - "pango-sys", -] - -[[package]] -name = "pango-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link 0.2.1", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_codegen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] -name = "plist" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" -dependencies = [ - "base64 0.22.1", - "indexmap 2.14.0", - "quick-xml", - "serde", - "time", -] - -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "png" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" -dependencies = [ - "bitflags 2.13.0", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "potential_utf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" -dependencies = [ - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "proc-macro-crate" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit 0.25.12+spec-1.1.0", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-xml" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.13.0", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 1.0.69", -] - -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 2.0.18", -] - -[[package]] -name = "ref-cast" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "regex" -version = "1.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" - -[[package]] -name = "reqwest" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "js-sys", - "log", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "sync_wrapper", - "tokio", - "tokio-util", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", -] - -[[package]] -name = "rfd" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" -dependencies = [ - "block2", - "dispatch2", - "glib-sys", - "gobject-sys", - "gtk-sys", - "js-sys", - "log", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "raw-window-handle", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-sys 0.60.2", -] - -[[package]] -name = "rustc-hash" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "indexmap 1.9.3", - "schemars_derive", - "serde", - "serde_json", - "url", - "uuid", -] - -[[package]] -name = "schemars" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.118", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "selectors" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" -dependencies = [ - "bitflags 2.13.0", - "cssparser", - "derive_more", - "log", - "new_debug_unreachable", - "phf", - "phf_codegen", - "precomputed-hash", - "rustc-hash", - "servo_arc", - "smallvec", -] - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" -dependencies = [ - "serde", - "serde_core", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde-untagged" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" -dependencies = [ - "erased-serde", - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "serde_json" -version = "1.0.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_spanned" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" -dependencies = [ - "serde_core", -] - -[[package]] -name = "serde_with" -version = "3.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" -dependencies = [ - "base64 0.22.1", - "bs58", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.14.0", - "schemars 0.9.0", - "schemars 1.2.1", - "serde_core", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "serialize-to-javascript" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" -dependencies = [ - "serde", - "serde_json", - "serialize-to-javascript-impl", -] - -[[package]] -name = "serialize-to-javascript-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "servo_arc" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - -[[package]] -name = "shlex" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" - -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "simd-adler32" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" - -[[package]] -name = "siphasher" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" - -[[package]] -name = "socket2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "softbuffer" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" -dependencies = [ - "bytemuck", - "js-sys", - "ndk", - "objc2", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation", - "objc2-quartz-core", - "raw-window-handle", - "redox_syscall", - "tracing", - "wasm-bindgen", - "web-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "soup3" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" -dependencies = [ - "futures-channel", - "gio", - "glib", - "libc", - "soup3-sys", -] - -[[package]] -name = "soup3-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "string_cache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - -[[package]] -name = "string_cache_codegen" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "swift-rs" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" -dependencies = [ - "base64 0.21.7", - "serde", - "serde_json", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml 0.8.2", - "version-compare", -] - -[[package]] -name = "tao" -version = "0.35.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c93047acf68669466a34690ac58cca7010bd1b201e1ec86f1fd0a75d3dd4a9" -dependencies = [ - "bitflags 2.13.0", - "block2", - "core-foundation", - "core-graphics", - "crossbeam-channel", - "dbus", - "dispatch2", - "dlopen2", - "dpi", - "gdkwayland-sys", - "gdkx11-sys", - "gtk", - "jni", - "libc", - "log", - "ndk", - "ndk-sys", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "objc2-ui-kit", - "once_cell", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "tao-macros", - "unicode-segmentation", - "url", - "windows", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "tao-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - -[[package]] -name = "tauri" -version = "2.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "667b20e2726d572dea2de7370da16e188eb06008faf9a92fab7cdc46791190b5" -dependencies = [ - "anyhow", - "bytes", - "cookie", - "dirs 6.0.0", - "dunce", - "embed_plist", - "getrandom 0.3.4", - "glob", - "gtk", - "heck 0.5.0", - "http", - "jni", - "libc", - "log", - "mime", - "muda", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "objc2-ui-kit", - "objc2-web-kit", - "percent-encoding", - "plist", - "raw-window-handle", - "reqwest", - "serde", - "serde_json", - "serde_repr", - "serialize-to-javascript", - "swift-rs", - "tauri-build", - "tauri-macros", - "tauri-runtime", - "tauri-runtime-wry", - "tauri-utils", - "thiserror 2.0.18", - "tokio", - "tray-icon", - "url", - "webkit2gtk", - "webview2-com", - "window-vibrancy", - "windows", -] - -[[package]] -name = "tauri-build" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9ce40b16101cb6ea63d3e221567affd1c3a9205f95d7bc574941a10636b632" -dependencies = [ - "anyhow", - "cargo_toml", - "dirs 6.0.0", - "glob", - "heck 0.5.0", - "json-patch", - "schemars 0.8.22", - "semver", - "serde", - "serde_json", - "tauri-utils", - "tauri-winres", - "walkdir", -] - -[[package]] -name = "tauri-codegen" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08279169ff42f8fc45a1dbc9dcae888893ba95288142e5880c59b93a26d2cfc5" -dependencies = [ - "base64 0.22.1", - "brotli", - "ico", - "json-patch", - "plist", - "png 0.17.16", - "proc-macro2", - "quote", - "semver", - "serde", - "serde_json", - "sha2", - "syn 2.0.118", - "tauri-utils", - "thiserror 2.0.18", - "time", - "url", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-macros" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b394794f399a421811d06966343e7933fcae92d59f5180b9388d1174497a45" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.118", - "tauri-codegen", - "tauri-utils", -] - -[[package]] -name = "tauri-plugin" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74be5dd4bed9afbd145e5716b5fa2ec28cbc29c34ffa61c258c9273d896c8020" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri-utils", - "walkdir", -] - -[[package]] -name = "tauri-plugin-dialog" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65981abb771e74e571a38196c3baa11c459379164791eba0e67abc1a5fac9884" -dependencies = [ - "log", - "raw-window-handle", - "rfd", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-plugin-fs", - "thiserror 2.0.18", - "url", -] - -[[package]] -name = "tauri-plugin-fs" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ecc274121aca0c036a2b42d1cbe83d368d348f54e0bb8a735c2b1548e8f371" -dependencies = [ - "anyhow", - "dunce", - "glob", - "log", - "objc2-foundation", - "percent-encoding", - "schemars 0.8.22", - "serde", - "serde_json", - "serde_repr", - "tauri", - "tauri-plugin", - "tauri-utils", - "thiserror 2.0.18", - "toml 1.1.2+spec-1.1.0", - "url", -] - -[[package]] -name = "tauri-plugin-shell" -version = "2.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8457dbf9e2bab1edd8df22bb2c20857a59a9868e79cb3eac5ed639eec4d0c73b" -dependencies = [ - "encoding_rs", - "log", - "open", - "os_pipe", - "regex", - "schemars 0.8.22", - "serde", - "serde_json", - "shared_child", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "tokio", -] - -[[package]] -name = "tauri-runtime" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b4bc95aed361b0019067d189a1174a603d460d0f6c72606512d59fc9c12ec8" -dependencies = [ - "cookie", - "dpi", - "gtk", - "http", - "jni", - "objc2", - "objc2-ui-kit", - "objc2-web-kit", - "raw-window-handle", - "serde", - "serde_json", - "tauri-utils", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webview2-com", - "windows", -] - -[[package]] -name = "tauri-runtime-wry" -version = "2.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e6fac707727b7a2f48e4ded90976324267371073edbb415ffb73bb0458d203f" -dependencies = [ - "gtk", - "http", - "jni", - "log", - "objc2", - "objc2-app-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "softbuffer", - "tao", - "tauri-runtime", - "tauri-utils", - "url", - "webkit2gtk", - "webview2-com", - "windows", - "wry", -] - -[[package]] -name = "tauri-utils" -version = "2.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e176a18e67764923c4f1ce66f25ae4abe5f688384d5eb1a0fa6c77f3d90f887" -dependencies = [ - "anyhow", - "brotli", - "cargo_metadata", - "ctor", - "dom_query", - "dunce", - "glob", - "http", - "infer", - "json-patch", - "log", - "memchr", - "phf", - "plist", - "proc-macro2", - "quote", - "regex", - "schemars 0.8.22", - "semver", - "serde", - "serde-untagged", - "serde_json", - "serde_with", - "swift-rs", - "thiserror 2.0.18", - "toml 1.1.2+spec-1.1.0", - "url", - "urlpattern", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-winres" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" -dependencies = [ - "dunce", - "embed-resource", - "toml 1.1.2+spec-1.1.0", -] - -[[package]] -name = "tendril" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" -dependencies = [ - "new_debug_unreachable", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl 2.0.18", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "time" -version = "0.3.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" - -[[package]] -name = "time-macros" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" -dependencies = [ - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "toml" -version = "0.9.12+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 0.7.5+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 0.7.15", -] - -[[package]] -name = "toml" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 1.0.3", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_datetime" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.14.0", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.25.12+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "winnow 1.0.3", -] - -[[package]] -name = "toml_parser" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" -dependencies = [ - "winnow 1.0.3", -] - -[[package]] -name = "toml_writer" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-http" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" -dependencies = [ - "bitflags 2.13.0", - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", - "url", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tray-icon" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ba1e5f6b9ef9fd87e21b9c6f351554dbd717960089168fcfdef854686961dc" -dependencies = [ - "crossbeam-channel", - "dirs 6.0.0", - "libappindicator", - "muda", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - -[[package]] -name = "typenum" -version = "1.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" - -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-segmentation" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" - -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", - "serde_derive", -] - -[[package]] -name = "urlpattern" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" -dependencies = [ - "regex", - "serde", - "unic-ucd-ident", - "url", -] - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "uuid" -version = "1.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" -dependencies = [ - "getrandom 0.4.3", - "js-sys", - "serde_core", - "wasm-bindgen", -] - -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "vswhom" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" -dependencies = [ - "libc", - "vswhom-sys", -] - -[[package]] -name = "vswhom-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.4+wasi-0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.118", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-streams" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web_atoms" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297" -dependencies = [ - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", -] - -[[package]] -name = "webkit2gtk" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" -dependencies = [ - "bitflags 1.3.2", - "cairo-rs", - "gdk", - "gdk-sys", - "gio", - "gio-sys", - "glib", - "glib-sys", - "gobject-sys", - "gtk", - "gtk-sys", - "javascriptcore-rs", - "libc", - "once_cell", - "soup3", - "webkit2gtk-sys", -] - -[[package]] -name = "webkit2gtk-sys" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" -dependencies = [ - "bitflags 1.3.2", - "cairo-sys-rs", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "soup3-sys", - "system-deps", -] - -[[package]] -name = "webview2-com" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" -dependencies = [ - "webview2-com-macros", - "webview2-com-sys", - "windows", - "windows-core 0.61.2", - "windows-implement", - "windows-interface", -] - -[[package]] -name = "webview2-com-macros" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "webview2-com-sys" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" -dependencies = [ - "thiserror 2.0.18", - "windows", - "windows-core 0.61.2", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "window-vibrancy" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" -dependencies = [ - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "raw-window-handle", - "windows-sys 0.59.0", - "windows-version", -] - -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections", - "windows-core 0.61.2", - "windows-future", - "windows-link 0.1.3", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", - "windows-threading", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link 0.2.1", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - -[[package]] -name = "winnow" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.55.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" -dependencies = [ - "cfg-if", - "windows-sys 0.59.0", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "writeable" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" - -[[package]] -name = "wry" -version = "0.55.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186f9871daa55fd9c016578b810d149de58367113db7fb72b462d2323ce19514" -dependencies = [ - "base64 0.22.1", - "block2", - "cookie", - "crossbeam-channel", - "dirs 6.0.0", - "dom_query", - "dpi", - "dunce", - "gdkx11", - "gtk", - "http", - "javascriptcore-rs", - "jni", - "libc", - "ndk", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "objc2-ui-kit", - "objc2-web-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "sha2", - "soup3", - "tao-macros", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webkit2gtk-sys", - "webview2-com", - "windows", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "x11" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "yoke" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "zerotrie" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - -[[package]] -name = "zip" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" -dependencies = [ - "aes", - "arbitrary", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "deflate64", - "displaydoc", - "flate2", - "getrandom 0.3.4", - "hmac", - "indexmap 2.14.0", - "lzma-rs", - "memchr", - "pbkdf2", - "sha1", - "thiserror 2.0.18", - "time", - "xz2", - "zeroize", - "zopfli", - "zstd", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" - -[[package]] -name = "zopfli" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] - -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/参考/NexBox-main/installer/src-tauri/Cargo.toml b/参考/NexBox-main/installer/src-tauri/Cargo.toml deleted file mode 100644 index 8a192a4..0000000 --- a/参考/NexBox-main/installer/src-tauri/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "nexbox-installer" -version = "5.9.8" -description = "NexBox Installer" -authors = ["MuLiu"] -edition = "2021" - -[lib] -name = "nexbox_installer_lib" -crate-type = ["staticlib", "cdylib", "rlib"] - -[profile.release] -lto = true -codegen-units = 1 -strip = true -opt-level = "z" -panic = "abort" - -[build-dependencies] -tauri-build = { version = "2", features = [] } - -[dependencies] -tauri = { version = "2", features = [] } -tauri-plugin-dialog = "2" -tauri-plugin-shell = "2" -serde = { version = "1", features = ["derive"] } -serde_json = "1" -winreg = "0.52" -dirs = "5" -zip = "2" -mslnk = "0.1" diff --git a/参考/NexBox-main/installer/src-tauri/build.rs b/参考/NexBox-main/installer/src-tauri/build.rs deleted file mode 100644 index 2bbaf33..0000000 --- a/参考/NexBox-main/installer/src-tauri/build.rs +++ /dev/null @@ -1,51 +0,0 @@ -fn main() { - // Read main app version from project root Cargo.toml - let main_cargo = std::path::Path::new("../../src-tauri/Cargo.toml"); - if main_cargo.exists() { - let content = std::fs::read_to_string(main_cargo).unwrap_or_default(); - for line in content.lines() { - if let Some(ver) = line.strip_prefix("version = \"") { - if let Some(end) = ver.find('\"') { - println!("cargo:rustc-env=NEXBOX_APP_VERSION={}", &ver[..end]); - break; - } - } - } - } - - #[cfg(target_os = "windows")] - { - use tauri_build::WindowsAttributes; - let windows = WindowsAttributes::new() - .app_manifest(r#" - - - - - - - - - - - - - - - "#); - tauri_build::try_build( - tauri_build::Attributes::new().windows_attributes(windows) - ).expect("Failed to run build script"); - } - #[cfg(not(target_os = "windows"))] - { - tauri_build::build(); - } -} diff --git a/参考/NexBox-main/installer/src-tauri/capabilities/default.json b/参考/NexBox-main/installer/src-tauri/capabilities/default.json deleted file mode 100644 index db8775d..0000000 --- a/参考/NexBox-main/installer/src-tauri/capabilities/default.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "identifier": "default", - "description": "Capability for the installer window", - "windows": ["main"], - "permissions": [ - "core:default", - "core:path:default", - "core:window:allow-minimize", - "core:window:allow-close", - "core:window:allow-start-dragging", - "dialog:default", - "shell:default" - ] -} diff --git a/参考/NexBox-main/installer/src-tauri/gen/schemas/acl-manifests.json b/参考/NexBox-main/installer/src-tauri/gen/schemas/acl-manifests.json deleted file mode 100644 index 9a4e12e..0000000 --- a/参考/NexBox-main/installer/src-tauri/gen/schemas/acl-manifests.json +++ /dev/null @@ -1 +0,0 @@ -{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}}} \ No newline at end of file diff --git a/参考/NexBox-main/installer/src-tauri/gen/schemas/capabilities.json b/参考/NexBox-main/installer/src-tauri/gen/schemas/capabilities.json deleted file mode 100644 index 1a0f0d1..0000000 --- a/参考/NexBox-main/installer/src-tauri/gen/schemas/capabilities.json +++ /dev/null @@ -1 +0,0 @@ -{"default":{"identifier":"default","description":"Capability for the installer window","local":true,"windows":["main"],"permissions":["core:default","core:path:default","core:window:allow-minimize","core:window:allow-close","core:window:allow-start-dragging","dialog:default","shell:default"]}} \ No newline at end of file diff --git a/参考/NexBox-main/installer/src-tauri/gen/schemas/desktop-schema.json b/参考/NexBox-main/installer/src-tauri/gen/schemas/desktop-schema.json deleted file mode 100644 index 6eba1dc..0000000 --- a/参考/NexBox-main/installer/src-tauri/gen/schemas/desktop-schema.json +++ /dev/null @@ -1,2678 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", - "type": "object", - "required": [ - "identifier", - "permissions" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", - "type": "string" - }, - "description": { - "description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.", - "default": "", - "type": "string" - }, - "remote": { - "description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```", - "anyOf": [ - { - "$ref": "#/definitions/CapabilityRemote" - }, - { - "type": "null" - } - ] - }, - "local": { - "description": "Whether this capability is enabled for local app URLs or not. Defaults to `true`.", - "default": true, - "type": "boolean" - }, - "windows": { - "description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\n\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that are affected by this capability. Can be a glob pattern.\n\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ] ```", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - }, - "uniqueItems": true - }, - "platforms": { - "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityRemote": { - "description": "Configuration for remote URLs that are associated with the capability.", - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "allOf": [ - { - "if": { - "properties": { - "identifier": { - "anyOf": [ - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - } - } - }, - "then": { - "properties": { - "allow": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - }, - "deny": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - } - } - }, - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - } - } - }, - { - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - "allow": { - "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - }, - "deny": { - "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - } - } - } - ], - "required": [ - "identifier" - ] - } - ] - }, - "Identifier": { - "description": "Permission identifier", - "oneOf": [ - { - "description": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`", - "type": "string", - "const": "core:default", - "markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`" - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`", - "type": "string", - "const": "core:app:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`" - }, - { - "description": "Enables the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-hide", - "markdownDescription": "Enables the app_hide command without any pre-configured scope." - }, - { - "description": "Enables the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-show", - "markdownDescription": "Enables the app_show command without any pre-configured scope." - }, - { - "description": "Enables the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-bundle-type", - "markdownDescription": "Enables the bundle_type command without any pre-configured scope." - }, - { - "description": "Enables the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-default-window-icon", - "markdownDescription": "Enables the default_window_icon command without any pre-configured scope." - }, - { - "description": "Enables the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-fetch-data-store-identifiers", - "markdownDescription": "Enables the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Enables the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-identifier", - "markdownDescription": "Enables the identifier command without any pre-configured scope." - }, - { - "description": "Enables the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-name", - "markdownDescription": "Enables the name command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-data-store", - "markdownDescription": "Enables the remove_data_store command without any pre-configured scope." - }, - { - "description": "Enables the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-listener", - "markdownDescription": "Enables the remove_listener command without any pre-configured scope." - }, - { - "description": "Enables the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-app-theme", - "markdownDescription": "Enables the set_app_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-dock-visibility", - "markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Enables the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-supports-multiple-windows", - "markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-tauri-version", - "markdownDescription": "Enables the tauri_version command without any pre-configured scope." - }, - { - "description": "Enables the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-version", - "markdownDescription": "Enables the version command without any pre-configured scope." - }, - { - "description": "Denies the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-hide", - "markdownDescription": "Denies the app_hide command without any pre-configured scope." - }, - { - "description": "Denies the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-show", - "markdownDescription": "Denies the app_show command without any pre-configured scope." - }, - { - "description": "Denies the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-bundle-type", - "markdownDescription": "Denies the bundle_type command without any pre-configured scope." - }, - { - "description": "Denies the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-default-window-icon", - "markdownDescription": "Denies the default_window_icon command without any pre-configured scope." - }, - { - "description": "Denies the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-fetch-data-store-identifiers", - "markdownDescription": "Denies the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Denies the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-identifier", - "markdownDescription": "Denies the identifier command without any pre-configured scope." - }, - { - "description": "Denies the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-name", - "markdownDescription": "Denies the name command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-data-store", - "markdownDescription": "Denies the remove_data_store command without any pre-configured scope." - }, - { - "description": "Denies the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-listener", - "markdownDescription": "Denies the remove_listener command without any pre-configured scope." - }, - { - "description": "Denies the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-app-theme", - "markdownDescription": "Denies the set_app_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-dock-visibility", - "markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Denies the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-supports-multiple-windows", - "markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-tauri-version", - "markdownDescription": "Denies the tauri_version command without any pre-configured scope." - }, - { - "description": "Denies the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-version", - "markdownDescription": "Denies the version command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`", - "type": "string", - "const": "core:event:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`" - }, - { - "description": "Enables the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit", - "markdownDescription": "Enables the emit command without any pre-configured scope." - }, - { - "description": "Enables the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit-to", - "markdownDescription": "Enables the emit_to command without any pre-configured scope." - }, - { - "description": "Enables the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-listen", - "markdownDescription": "Enables the listen command without any pre-configured scope." - }, - { - "description": "Enables the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-unlisten", - "markdownDescription": "Enables the unlisten command without any pre-configured scope." - }, - { - "description": "Denies the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit", - "markdownDescription": "Denies the emit command without any pre-configured scope." - }, - { - "description": "Denies the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit-to", - "markdownDescription": "Denies the emit_to command without any pre-configured scope." - }, - { - "description": "Denies the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-listen", - "markdownDescription": "Denies the listen command without any pre-configured scope." - }, - { - "description": "Denies the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-unlisten", - "markdownDescription": "Denies the unlisten command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`", - "type": "string", - "const": "core:image:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`" - }, - { - "description": "Enables the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-bytes", - "markdownDescription": "Enables the from_bytes command without any pre-configured scope." - }, - { - "description": "Enables the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-path", - "markdownDescription": "Enables the from_path command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-rgba", - "markdownDescription": "Enables the rgba command without any pre-configured scope." - }, - { - "description": "Enables the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-size", - "markdownDescription": "Enables the size command without any pre-configured scope." - }, - { - "description": "Denies the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-bytes", - "markdownDescription": "Denies the from_bytes command without any pre-configured scope." - }, - { - "description": "Denies the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-path", - "markdownDescription": "Denies the from_path command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-rgba", - "markdownDescription": "Denies the rgba command without any pre-configured scope." - }, - { - "description": "Denies the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-size", - "markdownDescription": "Denies the size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`", - "type": "string", - "const": "core:menu:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`" - }, - { - "description": "Enables the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-append", - "markdownDescription": "Enables the append command without any pre-configured scope." - }, - { - "description": "Enables the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-create-default", - "markdownDescription": "Enables the create_default command without any pre-configured scope." - }, - { - "description": "Enables the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-get", - "markdownDescription": "Enables the get command without any pre-configured scope." - }, - { - "description": "Enables the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-insert", - "markdownDescription": "Enables the insert command without any pre-configured scope." - }, - { - "description": "Enables the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-checked", - "markdownDescription": "Enables the is_checked command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-items", - "markdownDescription": "Enables the items command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-popup", - "markdownDescription": "Enables the popup command without any pre-configured scope." - }, - { - "description": "Enables the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-prepend", - "markdownDescription": "Enables the prepend command without any pre-configured scope." - }, - { - "description": "Enables the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove", - "markdownDescription": "Enables the remove command without any pre-configured scope." - }, - { - "description": "Enables the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove-at", - "markdownDescription": "Enables the remove_at command without any pre-configured scope." - }, - { - "description": "Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-accelerator", - "markdownDescription": "Enables the set_accelerator command without any pre-configured scope." - }, - { - "description": "Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-app-menu", - "markdownDescription": "Enables the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-help-menu-for-nsapp", - "markdownDescription": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-window-menu", - "markdownDescription": "Enables the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-windows-menu-for-nsapp", - "markdownDescription": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-checked", - "markdownDescription": "Enables the set_checked command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-text", - "markdownDescription": "Enables the set_text command without any pre-configured scope." - }, - { - "description": "Enables the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-text", - "markdownDescription": "Enables the text command without any pre-configured scope." - }, - { - "description": "Denies the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-append", - "markdownDescription": "Denies the append command without any pre-configured scope." - }, - { - "description": "Denies the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-create-default", - "markdownDescription": "Denies the create_default command without any pre-configured scope." - }, - { - "description": "Denies the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-get", - "markdownDescription": "Denies the get command without any pre-configured scope." - }, - { - "description": "Denies the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-insert", - "markdownDescription": "Denies the insert command without any pre-configured scope." - }, - { - "description": "Denies the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-checked", - "markdownDescription": "Denies the is_checked command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-items", - "markdownDescription": "Denies the items command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-popup", - "markdownDescription": "Denies the popup command without any pre-configured scope." - }, - { - "description": "Denies the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-prepend", - "markdownDescription": "Denies the prepend command without any pre-configured scope." - }, - { - "description": "Denies the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove", - "markdownDescription": "Denies the remove command without any pre-configured scope." - }, - { - "description": "Denies the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove-at", - "markdownDescription": "Denies the remove_at command without any pre-configured scope." - }, - { - "description": "Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-accelerator", - "markdownDescription": "Denies the set_accelerator command without any pre-configured scope." - }, - { - "description": "Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-app-menu", - "markdownDescription": "Denies the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-help-menu-for-nsapp", - "markdownDescription": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-window-menu", - "markdownDescription": "Denies the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-windows-menu-for-nsapp", - "markdownDescription": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-checked", - "markdownDescription": "Denies the set_checked command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-text", - "markdownDescription": "Denies the set_text command without any pre-configured scope." - }, - { - "description": "Denies the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-text", - "markdownDescription": "Denies the text command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`", - "type": "string", - "const": "core:path:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`" - }, - { - "description": "Enables the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-basename", - "markdownDescription": "Enables the basename command without any pre-configured scope." - }, - { - "description": "Enables the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-dirname", - "markdownDescription": "Enables the dirname command without any pre-configured scope." - }, - { - "description": "Enables the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-extname", - "markdownDescription": "Enables the extname command without any pre-configured scope." - }, - { - "description": "Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-is-absolute", - "markdownDescription": "Enables the is_absolute command without any pre-configured scope." - }, - { - "description": "Enables the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-join", - "markdownDescription": "Enables the join command without any pre-configured scope." - }, - { - "description": "Enables the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-normalize", - "markdownDescription": "Enables the normalize command without any pre-configured scope." - }, - { - "description": "Enables the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve", - "markdownDescription": "Enables the resolve command without any pre-configured scope." - }, - { - "description": "Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve-directory", - "markdownDescription": "Enables the resolve_directory command without any pre-configured scope." - }, - { - "description": "Denies the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-basename", - "markdownDescription": "Denies the basename command without any pre-configured scope." - }, - { - "description": "Denies the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-dirname", - "markdownDescription": "Denies the dirname command without any pre-configured scope." - }, - { - "description": "Denies the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-extname", - "markdownDescription": "Denies the extname command without any pre-configured scope." - }, - { - "description": "Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-is-absolute", - "markdownDescription": "Denies the is_absolute command without any pre-configured scope." - }, - { - "description": "Denies the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-join", - "markdownDescription": "Denies the join command without any pre-configured scope." - }, - { - "description": "Denies the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-normalize", - "markdownDescription": "Denies the normalize command without any pre-configured scope." - }, - { - "description": "Denies the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve", - "markdownDescription": "Denies the resolve command without any pre-configured scope." - }, - { - "description": "Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve-directory", - "markdownDescription": "Denies the resolve_directory command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`", - "type": "string", - "const": "core:resources:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`" - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`", - "type": "string", - "const": "core:tray:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`" - }, - { - "description": "Enables the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-get-by-id", - "markdownDescription": "Enables the get_by_id command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-remove-by-id", - "markdownDescription": "Enables the remove_by_id command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-as-template", - "markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-with-as-template", - "markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-menu", - "markdownDescription": "Enables the set_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-show-menu-on-left-click", - "markdownDescription": "Enables the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-temp-dir-path", - "markdownDescription": "Enables the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-tooltip", - "markdownDescription": "Enables the set_tooltip command without any pre-configured scope." - }, - { - "description": "Enables the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-visible", - "markdownDescription": "Enables the set_visible command without any pre-configured scope." - }, - { - "description": "Denies the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-get-by-id", - "markdownDescription": "Denies the get_by_id command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-remove-by-id", - "markdownDescription": "Denies the remove_by_id command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-as-template", - "markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-with-as-template", - "markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-menu", - "markdownDescription": "Denies the set_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-show-menu-on-left-click", - "markdownDescription": "Denies the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-temp-dir-path", - "markdownDescription": "Denies the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-tooltip", - "markdownDescription": "Denies the set_tooltip command without any pre-configured scope." - }, - { - "description": "Denies the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-visible", - "markdownDescription": "Denies the set_visible command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`", - "type": "string", - "const": "core:webview:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`" - }, - { - "description": "Enables the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-clear-all-browsing-data", - "markdownDescription": "Enables the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Enables the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview", - "markdownDescription": "Enables the create_webview command without any pre-configured scope." - }, - { - "description": "Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview-window", - "markdownDescription": "Enables the create_webview_window command without any pre-configured scope." - }, - { - "description": "Enables the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-get-all-webviews", - "markdownDescription": "Enables the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-internal-toggle-devtools", - "markdownDescription": "Enables the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Enables the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-print", - "markdownDescription": "Enables the print command without any pre-configured scope." - }, - { - "description": "Enables the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-reparent", - "markdownDescription": "Enables the reparent command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-auto-resize", - "markdownDescription": "Enables the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-background-color", - "markdownDescription": "Enables the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-focus", - "markdownDescription": "Enables the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-position", - "markdownDescription": "Enables the set_webview_position command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-size", - "markdownDescription": "Enables the set_webview_size command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-zoom", - "markdownDescription": "Enables the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Enables the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-close", - "markdownDescription": "Enables the webview_close command without any pre-configured scope." - }, - { - "description": "Enables the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-hide", - "markdownDescription": "Enables the webview_hide command without any pre-configured scope." - }, - { - "description": "Enables the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-position", - "markdownDescription": "Enables the webview_position command without any pre-configured scope." - }, - { - "description": "Enables the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-show", - "markdownDescription": "Enables the webview_show command without any pre-configured scope." - }, - { - "description": "Enables the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-size", - "markdownDescription": "Enables the webview_size command without any pre-configured scope." - }, - { - "description": "Denies the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-clear-all-browsing-data", - "markdownDescription": "Denies the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Denies the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview", - "markdownDescription": "Denies the create_webview command without any pre-configured scope." - }, - { - "description": "Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview-window", - "markdownDescription": "Denies the create_webview_window command without any pre-configured scope." - }, - { - "description": "Denies the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-get-all-webviews", - "markdownDescription": "Denies the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-internal-toggle-devtools", - "markdownDescription": "Denies the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Denies the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-print", - "markdownDescription": "Denies the print command without any pre-configured scope." - }, - { - "description": "Denies the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-reparent", - "markdownDescription": "Denies the reparent command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-auto-resize", - "markdownDescription": "Denies the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-background-color", - "markdownDescription": "Denies the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-focus", - "markdownDescription": "Denies the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-position", - "markdownDescription": "Denies the set_webview_position command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-size", - "markdownDescription": "Denies the set_webview_size command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-zoom", - "markdownDescription": "Denies the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Denies the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-close", - "markdownDescription": "Denies the webview_close command without any pre-configured scope." - }, - { - "description": "Denies the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-hide", - "markdownDescription": "Denies the webview_hide command without any pre-configured scope." - }, - { - "description": "Denies the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-position", - "markdownDescription": "Denies the webview_position command without any pre-configured scope." - }, - { - "description": "Denies the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-show", - "markdownDescription": "Denies the webview_show command without any pre-configured scope." - }, - { - "description": "Denies the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-size", - "markdownDescription": "Denies the webview_size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`", - "type": "string", - "const": "core:window:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`" - }, - { - "description": "Enables the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-activity-name", - "markdownDescription": "Enables the activity_name command without any pre-configured scope." - }, - { - "description": "Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-available-monitors", - "markdownDescription": "Enables the available_monitors command without any pre-configured scope." - }, - { - "description": "Enables the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-center", - "markdownDescription": "Enables the center command without any pre-configured scope." - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Enables the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-create", - "markdownDescription": "Enables the create command without any pre-configured scope." - }, - { - "description": "Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-current-monitor", - "markdownDescription": "Enables the current_monitor command without any pre-configured scope." - }, - { - "description": "Enables the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-cursor-position", - "markdownDescription": "Enables the cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-destroy", - "markdownDescription": "Enables the destroy command without any pre-configured scope." - }, - { - "description": "Enables the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-get-all-windows", - "markdownDescription": "Enables the get_all_windows command without any pre-configured scope." - }, - { - "description": "Enables the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-hide", - "markdownDescription": "Enables the hide command without any pre-configured scope." - }, - { - "description": "Enables the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-position", - "markdownDescription": "Enables the inner_position command without any pre-configured scope." - }, - { - "description": "Enables the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-size", - "markdownDescription": "Enables the inner_size command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-internal-toggle-maximize", - "markdownDescription": "Enables the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-always-on-top", - "markdownDescription": "Enables the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-closable", - "markdownDescription": "Enables the is_closable command without any pre-configured scope." - }, - { - "description": "Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-decorated", - "markdownDescription": "Enables the is_decorated command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-focused", - "markdownDescription": "Enables the is_focused command without any pre-configured scope." - }, - { - "description": "Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-fullscreen", - "markdownDescription": "Enables the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximizable", - "markdownDescription": "Enables the is_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximized", - "markdownDescription": "Enables the is_maximized command without any pre-configured scope." - }, - { - "description": "Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimizable", - "markdownDescription": "Enables the is_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimized", - "markdownDescription": "Enables the is_minimized command without any pre-configured scope." - }, - { - "description": "Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-resizable", - "markdownDescription": "Enables the is_resizable command without any pre-configured scope." - }, - { - "description": "Enables the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-visible", - "markdownDescription": "Enables the is_visible command without any pre-configured scope." - }, - { - "description": "Enables the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-maximize", - "markdownDescription": "Enables the maximize command without any pre-configured scope." - }, - { - "description": "Enables the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-minimize", - "markdownDescription": "Enables the minimize command without any pre-configured scope." - }, - { - "description": "Enables the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-monitor-from-point", - "markdownDescription": "Enables the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Enables the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-position", - "markdownDescription": "Enables the outer_position command without any pre-configured scope." - }, - { - "description": "Enables the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-size", - "markdownDescription": "Enables the outer_size command without any pre-configured scope." - }, - { - "description": "Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-primary-monitor", - "markdownDescription": "Enables the primary_monitor command without any pre-configured scope." - }, - { - "description": "Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-request-user-attention", - "markdownDescription": "Enables the request_user_attention command without any pre-configured scope." - }, - { - "description": "Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scale-factor", - "markdownDescription": "Enables the scale_factor command without any pre-configured scope." - }, - { - "description": "Enables the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scene-identifier", - "markdownDescription": "Enables the scene_identifier command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-bottom", - "markdownDescription": "Enables the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-top", - "markdownDescription": "Enables the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-background-color", - "markdownDescription": "Enables the set_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-count", - "markdownDescription": "Enables the set_badge_count command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-label", - "markdownDescription": "Enables the set_badge_label command without any pre-configured scope." - }, - { - "description": "Enables the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-closable", - "markdownDescription": "Enables the set_closable command without any pre-configured scope." - }, - { - "description": "Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-content-protected", - "markdownDescription": "Enables the set_content_protected command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-grab", - "markdownDescription": "Enables the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-icon", - "markdownDescription": "Enables the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-position", - "markdownDescription": "Enables the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-visible", - "markdownDescription": "Enables the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-decorations", - "markdownDescription": "Enables the set_decorations command without any pre-configured scope." - }, - { - "description": "Enables the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-effects", - "markdownDescription": "Enables the set_effects command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focus", - "markdownDescription": "Enables the set_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focusable", - "markdownDescription": "Enables the set_focusable command without any pre-configured scope." - }, - { - "description": "Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-fullscreen", - "markdownDescription": "Enables the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-ignore-cursor-events", - "markdownDescription": "Enables the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-max-size", - "markdownDescription": "Enables the set_max_size command without any pre-configured scope." - }, - { - "description": "Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-maximizable", - "markdownDescription": "Enables the set_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-min-size", - "markdownDescription": "Enables the set_min_size command without any pre-configured scope." - }, - { - "description": "Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-minimizable", - "markdownDescription": "Enables the set_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-overlay-icon", - "markdownDescription": "Enables the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-position", - "markdownDescription": "Enables the set_position command without any pre-configured scope." - }, - { - "description": "Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-progress-bar", - "markdownDescription": "Enables the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-resizable", - "markdownDescription": "Enables the set_resizable command without any pre-configured scope." - }, - { - "description": "Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-shadow", - "markdownDescription": "Enables the set_shadow command without any pre-configured scope." - }, - { - "description": "Enables the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-simple-fullscreen", - "markdownDescription": "Enables the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size", - "markdownDescription": "Enables the set_size command without any pre-configured scope." - }, - { - "description": "Enables the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size-constraints", - "markdownDescription": "Enables the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-skip-taskbar", - "markdownDescription": "Enables the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Enables the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-theme", - "markdownDescription": "Enables the set_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title-bar-style", - "markdownDescription": "Enables the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-visible-on-all-workspaces", - "markdownDescription": "Enables the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-dragging", - "markdownDescription": "Enables the start_dragging command without any pre-configured scope." - }, - { - "description": "Enables the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-resize-dragging", - "markdownDescription": "Enables the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Enables the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-theme", - "markdownDescription": "Enables the theme command without any pre-configured scope." - }, - { - "description": "Enables the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-title", - "markdownDescription": "Enables the title command without any pre-configured scope." - }, - { - "description": "Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-toggle-maximize", - "markdownDescription": "Enables the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unmaximize", - "markdownDescription": "Enables the unmaximize command without any pre-configured scope." - }, - { - "description": "Enables the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unminimize", - "markdownDescription": "Enables the unminimize command without any pre-configured scope." - }, - { - "description": "Denies the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-activity-name", - "markdownDescription": "Denies the activity_name command without any pre-configured scope." - }, - { - "description": "Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-available-monitors", - "markdownDescription": "Denies the available_monitors command without any pre-configured scope." - }, - { - "description": "Denies the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-center", - "markdownDescription": "Denies the center command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Denies the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-create", - "markdownDescription": "Denies the create command without any pre-configured scope." - }, - { - "description": "Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-current-monitor", - "markdownDescription": "Denies the current_monitor command without any pre-configured scope." - }, - { - "description": "Denies the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-cursor-position", - "markdownDescription": "Denies the cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-destroy", - "markdownDescription": "Denies the destroy command without any pre-configured scope." - }, - { - "description": "Denies the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-get-all-windows", - "markdownDescription": "Denies the get_all_windows command without any pre-configured scope." - }, - { - "description": "Denies the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-hide", - "markdownDescription": "Denies the hide command without any pre-configured scope." - }, - { - "description": "Denies the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-position", - "markdownDescription": "Denies the inner_position command without any pre-configured scope." - }, - { - "description": "Denies the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-size", - "markdownDescription": "Denies the inner_size command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-internal-toggle-maximize", - "markdownDescription": "Denies the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-always-on-top", - "markdownDescription": "Denies the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-closable", - "markdownDescription": "Denies the is_closable command without any pre-configured scope." - }, - { - "description": "Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-decorated", - "markdownDescription": "Denies the is_decorated command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-focused", - "markdownDescription": "Denies the is_focused command without any pre-configured scope." - }, - { - "description": "Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-fullscreen", - "markdownDescription": "Denies the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximizable", - "markdownDescription": "Denies the is_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximized", - "markdownDescription": "Denies the is_maximized command without any pre-configured scope." - }, - { - "description": "Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimizable", - "markdownDescription": "Denies the is_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimized", - "markdownDescription": "Denies the is_minimized command without any pre-configured scope." - }, - { - "description": "Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-resizable", - "markdownDescription": "Denies the is_resizable command without any pre-configured scope." - }, - { - "description": "Denies the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-visible", - "markdownDescription": "Denies the is_visible command without any pre-configured scope." - }, - { - "description": "Denies the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-maximize", - "markdownDescription": "Denies the maximize command without any pre-configured scope." - }, - { - "description": "Denies the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-minimize", - "markdownDescription": "Denies the minimize command without any pre-configured scope." - }, - { - "description": "Denies the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-monitor-from-point", - "markdownDescription": "Denies the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Denies the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-position", - "markdownDescription": "Denies the outer_position command without any pre-configured scope." - }, - { - "description": "Denies the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-size", - "markdownDescription": "Denies the outer_size command without any pre-configured scope." - }, - { - "description": "Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-primary-monitor", - "markdownDescription": "Denies the primary_monitor command without any pre-configured scope." - }, - { - "description": "Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-request-user-attention", - "markdownDescription": "Denies the request_user_attention command without any pre-configured scope." - }, - { - "description": "Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scale-factor", - "markdownDescription": "Denies the scale_factor command without any pre-configured scope." - }, - { - "description": "Denies the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scene-identifier", - "markdownDescription": "Denies the scene_identifier command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-bottom", - "markdownDescription": "Denies the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-top", - "markdownDescription": "Denies the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-background-color", - "markdownDescription": "Denies the set_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-count", - "markdownDescription": "Denies the set_badge_count command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-label", - "markdownDescription": "Denies the set_badge_label command without any pre-configured scope." - }, - { - "description": "Denies the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-closable", - "markdownDescription": "Denies the set_closable command without any pre-configured scope." - }, - { - "description": "Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-content-protected", - "markdownDescription": "Denies the set_content_protected command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-grab", - "markdownDescription": "Denies the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-icon", - "markdownDescription": "Denies the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-position", - "markdownDescription": "Denies the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-visible", - "markdownDescription": "Denies the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-decorations", - "markdownDescription": "Denies the set_decorations command without any pre-configured scope." - }, - { - "description": "Denies the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-effects", - "markdownDescription": "Denies the set_effects command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focus", - "markdownDescription": "Denies the set_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focusable", - "markdownDescription": "Denies the set_focusable command without any pre-configured scope." - }, - { - "description": "Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-fullscreen", - "markdownDescription": "Denies the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-ignore-cursor-events", - "markdownDescription": "Denies the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-max-size", - "markdownDescription": "Denies the set_max_size command without any pre-configured scope." - }, - { - "description": "Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-maximizable", - "markdownDescription": "Denies the set_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-min-size", - "markdownDescription": "Denies the set_min_size command without any pre-configured scope." - }, - { - "description": "Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-minimizable", - "markdownDescription": "Denies the set_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-overlay-icon", - "markdownDescription": "Denies the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-position", - "markdownDescription": "Denies the set_position command without any pre-configured scope." - }, - { - "description": "Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-progress-bar", - "markdownDescription": "Denies the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-resizable", - "markdownDescription": "Denies the set_resizable command without any pre-configured scope." - }, - { - "description": "Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-shadow", - "markdownDescription": "Denies the set_shadow command without any pre-configured scope." - }, - { - "description": "Denies the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-simple-fullscreen", - "markdownDescription": "Denies the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size", - "markdownDescription": "Denies the set_size command without any pre-configured scope." - }, - { - "description": "Denies the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size-constraints", - "markdownDescription": "Denies the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-skip-taskbar", - "markdownDescription": "Denies the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Denies the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-theme", - "markdownDescription": "Denies the set_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title-bar-style", - "markdownDescription": "Denies the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-visible-on-all-workspaces", - "markdownDescription": "Denies the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-dragging", - "markdownDescription": "Denies the start_dragging command without any pre-configured scope." - }, - { - "description": "Denies the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-resize-dragging", - "markdownDescription": "Denies the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Denies the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-theme", - "markdownDescription": "Denies the theme command without any pre-configured scope." - }, - { - "description": "Denies the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-title", - "markdownDescription": "Denies the title command without any pre-configured scope." - }, - { - "description": "Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-toggle-maximize", - "markdownDescription": "Denies the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unmaximize", - "markdownDescription": "Denies the unmaximize command without any pre-configured scope." - }, - { - "description": "Denies the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unminimize", - "markdownDescription": "Denies the unminimize command without any pre-configured scope." - }, - { - "description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`", - "type": "string", - "const": "dialog:default", - "markdownDescription": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`" - }, - { - "description": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)", - "type": "string", - "const": "dialog:allow-ask", - "markdownDescription": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)" - }, - { - "description": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)", - "type": "string", - "const": "dialog:allow-confirm", - "markdownDescription": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)" - }, - { - "description": "Enables the message command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-message", - "markdownDescription": "Enables the message command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the save command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-save", - "markdownDescription": "Enables the save command without any pre-configured scope." - }, - { - "description": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)", - "type": "string", - "const": "dialog:deny-ask", - "markdownDescription": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)" - }, - { - "description": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)", - "type": "string", - "const": "dialog:deny-confirm", - "markdownDescription": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)" - }, - { - "description": "Denies the message command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-message", - "markdownDescription": "Denies the message command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the save command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-save", - "markdownDescription": "Denies the save command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellScopeEntryAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "raw": { - "description": "Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.", - "default": false, - "type": "boolean" - }, - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellScopeEntryAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellScopeEntryAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/参考/NexBox-main/installer/src-tauri/gen/schemas/windows-schema.json b/参考/NexBox-main/installer/src-tauri/gen/schemas/windows-schema.json deleted file mode 100644 index 6eba1dc..0000000 --- a/参考/NexBox-main/installer/src-tauri/gen/schemas/windows-schema.json +++ /dev/null @@ -1,2678 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", - "type": "object", - "required": [ - "identifier", - "permissions" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", - "type": "string" - }, - "description": { - "description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.", - "default": "", - "type": "string" - }, - "remote": { - "description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```", - "anyOf": [ - { - "$ref": "#/definitions/CapabilityRemote" - }, - { - "type": "null" - } - ] - }, - "local": { - "description": "Whether this capability is enabled for local app URLs or not. Defaults to `true`.", - "default": true, - "type": "boolean" - }, - "windows": { - "description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\n\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that are affected by this capability. Can be a glob pattern.\n\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ] ```", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - }, - "uniqueItems": true - }, - "platforms": { - "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityRemote": { - "description": "Configuration for remote URLs that are associated with the capability.", - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "allOf": [ - { - "if": { - "properties": { - "identifier": { - "anyOf": [ - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - } - } - }, - "then": { - "properties": { - "allow": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - }, - "deny": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - } - } - }, - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - } - } - }, - { - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - "allow": { - "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - }, - "deny": { - "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - } - } - } - ], - "required": [ - "identifier" - ] - } - ] - }, - "Identifier": { - "description": "Permission identifier", - "oneOf": [ - { - "description": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`", - "type": "string", - "const": "core:default", - "markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`" - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`", - "type": "string", - "const": "core:app:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`" - }, - { - "description": "Enables the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-hide", - "markdownDescription": "Enables the app_hide command without any pre-configured scope." - }, - { - "description": "Enables the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-show", - "markdownDescription": "Enables the app_show command without any pre-configured scope." - }, - { - "description": "Enables the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-bundle-type", - "markdownDescription": "Enables the bundle_type command without any pre-configured scope." - }, - { - "description": "Enables the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-default-window-icon", - "markdownDescription": "Enables the default_window_icon command without any pre-configured scope." - }, - { - "description": "Enables the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-fetch-data-store-identifiers", - "markdownDescription": "Enables the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Enables the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-identifier", - "markdownDescription": "Enables the identifier command without any pre-configured scope." - }, - { - "description": "Enables the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-name", - "markdownDescription": "Enables the name command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-data-store", - "markdownDescription": "Enables the remove_data_store command without any pre-configured scope." - }, - { - "description": "Enables the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-listener", - "markdownDescription": "Enables the remove_listener command without any pre-configured scope." - }, - { - "description": "Enables the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-app-theme", - "markdownDescription": "Enables the set_app_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-dock-visibility", - "markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Enables the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-supports-multiple-windows", - "markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-tauri-version", - "markdownDescription": "Enables the tauri_version command without any pre-configured scope." - }, - { - "description": "Enables the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-version", - "markdownDescription": "Enables the version command without any pre-configured scope." - }, - { - "description": "Denies the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-hide", - "markdownDescription": "Denies the app_hide command without any pre-configured scope." - }, - { - "description": "Denies the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-show", - "markdownDescription": "Denies the app_show command without any pre-configured scope." - }, - { - "description": "Denies the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-bundle-type", - "markdownDescription": "Denies the bundle_type command without any pre-configured scope." - }, - { - "description": "Denies the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-default-window-icon", - "markdownDescription": "Denies the default_window_icon command without any pre-configured scope." - }, - { - "description": "Denies the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-fetch-data-store-identifiers", - "markdownDescription": "Denies the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Denies the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-identifier", - "markdownDescription": "Denies the identifier command without any pre-configured scope." - }, - { - "description": "Denies the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-name", - "markdownDescription": "Denies the name command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-data-store", - "markdownDescription": "Denies the remove_data_store command without any pre-configured scope." - }, - { - "description": "Denies the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-listener", - "markdownDescription": "Denies the remove_listener command without any pre-configured scope." - }, - { - "description": "Denies the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-app-theme", - "markdownDescription": "Denies the set_app_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-dock-visibility", - "markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Denies the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-supports-multiple-windows", - "markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-tauri-version", - "markdownDescription": "Denies the tauri_version command without any pre-configured scope." - }, - { - "description": "Denies the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-version", - "markdownDescription": "Denies the version command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`", - "type": "string", - "const": "core:event:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`" - }, - { - "description": "Enables the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit", - "markdownDescription": "Enables the emit command without any pre-configured scope." - }, - { - "description": "Enables the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit-to", - "markdownDescription": "Enables the emit_to command without any pre-configured scope." - }, - { - "description": "Enables the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-listen", - "markdownDescription": "Enables the listen command without any pre-configured scope." - }, - { - "description": "Enables the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-unlisten", - "markdownDescription": "Enables the unlisten command without any pre-configured scope." - }, - { - "description": "Denies the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit", - "markdownDescription": "Denies the emit command without any pre-configured scope." - }, - { - "description": "Denies the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit-to", - "markdownDescription": "Denies the emit_to command without any pre-configured scope." - }, - { - "description": "Denies the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-listen", - "markdownDescription": "Denies the listen command without any pre-configured scope." - }, - { - "description": "Denies the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-unlisten", - "markdownDescription": "Denies the unlisten command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`", - "type": "string", - "const": "core:image:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`" - }, - { - "description": "Enables the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-bytes", - "markdownDescription": "Enables the from_bytes command without any pre-configured scope." - }, - { - "description": "Enables the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-path", - "markdownDescription": "Enables the from_path command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-rgba", - "markdownDescription": "Enables the rgba command without any pre-configured scope." - }, - { - "description": "Enables the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-size", - "markdownDescription": "Enables the size command without any pre-configured scope." - }, - { - "description": "Denies the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-bytes", - "markdownDescription": "Denies the from_bytes command without any pre-configured scope." - }, - { - "description": "Denies the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-path", - "markdownDescription": "Denies the from_path command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-rgba", - "markdownDescription": "Denies the rgba command without any pre-configured scope." - }, - { - "description": "Denies the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-size", - "markdownDescription": "Denies the size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`", - "type": "string", - "const": "core:menu:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`" - }, - { - "description": "Enables the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-append", - "markdownDescription": "Enables the append command without any pre-configured scope." - }, - { - "description": "Enables the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-create-default", - "markdownDescription": "Enables the create_default command without any pre-configured scope." - }, - { - "description": "Enables the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-get", - "markdownDescription": "Enables the get command without any pre-configured scope." - }, - { - "description": "Enables the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-insert", - "markdownDescription": "Enables the insert command without any pre-configured scope." - }, - { - "description": "Enables the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-checked", - "markdownDescription": "Enables the is_checked command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-items", - "markdownDescription": "Enables the items command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-popup", - "markdownDescription": "Enables the popup command without any pre-configured scope." - }, - { - "description": "Enables the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-prepend", - "markdownDescription": "Enables the prepend command without any pre-configured scope." - }, - { - "description": "Enables the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove", - "markdownDescription": "Enables the remove command without any pre-configured scope." - }, - { - "description": "Enables the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove-at", - "markdownDescription": "Enables the remove_at command without any pre-configured scope." - }, - { - "description": "Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-accelerator", - "markdownDescription": "Enables the set_accelerator command without any pre-configured scope." - }, - { - "description": "Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-app-menu", - "markdownDescription": "Enables the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-help-menu-for-nsapp", - "markdownDescription": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-window-menu", - "markdownDescription": "Enables the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-windows-menu-for-nsapp", - "markdownDescription": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-checked", - "markdownDescription": "Enables the set_checked command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-text", - "markdownDescription": "Enables the set_text command without any pre-configured scope." - }, - { - "description": "Enables the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-text", - "markdownDescription": "Enables the text command without any pre-configured scope." - }, - { - "description": "Denies the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-append", - "markdownDescription": "Denies the append command without any pre-configured scope." - }, - { - "description": "Denies the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-create-default", - "markdownDescription": "Denies the create_default command without any pre-configured scope." - }, - { - "description": "Denies the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-get", - "markdownDescription": "Denies the get command without any pre-configured scope." - }, - { - "description": "Denies the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-insert", - "markdownDescription": "Denies the insert command without any pre-configured scope." - }, - { - "description": "Denies the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-checked", - "markdownDescription": "Denies the is_checked command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-items", - "markdownDescription": "Denies the items command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-popup", - "markdownDescription": "Denies the popup command without any pre-configured scope." - }, - { - "description": "Denies the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-prepend", - "markdownDescription": "Denies the prepend command without any pre-configured scope." - }, - { - "description": "Denies the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove", - "markdownDescription": "Denies the remove command without any pre-configured scope." - }, - { - "description": "Denies the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove-at", - "markdownDescription": "Denies the remove_at command without any pre-configured scope." - }, - { - "description": "Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-accelerator", - "markdownDescription": "Denies the set_accelerator command without any pre-configured scope." - }, - { - "description": "Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-app-menu", - "markdownDescription": "Denies the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-help-menu-for-nsapp", - "markdownDescription": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-window-menu", - "markdownDescription": "Denies the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-windows-menu-for-nsapp", - "markdownDescription": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-checked", - "markdownDescription": "Denies the set_checked command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-text", - "markdownDescription": "Denies the set_text command without any pre-configured scope." - }, - { - "description": "Denies the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-text", - "markdownDescription": "Denies the text command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`", - "type": "string", - "const": "core:path:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`" - }, - { - "description": "Enables the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-basename", - "markdownDescription": "Enables the basename command without any pre-configured scope." - }, - { - "description": "Enables the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-dirname", - "markdownDescription": "Enables the dirname command without any pre-configured scope." - }, - { - "description": "Enables the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-extname", - "markdownDescription": "Enables the extname command without any pre-configured scope." - }, - { - "description": "Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-is-absolute", - "markdownDescription": "Enables the is_absolute command without any pre-configured scope." - }, - { - "description": "Enables the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-join", - "markdownDescription": "Enables the join command without any pre-configured scope." - }, - { - "description": "Enables the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-normalize", - "markdownDescription": "Enables the normalize command without any pre-configured scope." - }, - { - "description": "Enables the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve", - "markdownDescription": "Enables the resolve command without any pre-configured scope." - }, - { - "description": "Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve-directory", - "markdownDescription": "Enables the resolve_directory command without any pre-configured scope." - }, - { - "description": "Denies the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-basename", - "markdownDescription": "Denies the basename command without any pre-configured scope." - }, - { - "description": "Denies the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-dirname", - "markdownDescription": "Denies the dirname command without any pre-configured scope." - }, - { - "description": "Denies the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-extname", - "markdownDescription": "Denies the extname command without any pre-configured scope." - }, - { - "description": "Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-is-absolute", - "markdownDescription": "Denies the is_absolute command without any pre-configured scope." - }, - { - "description": "Denies the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-join", - "markdownDescription": "Denies the join command without any pre-configured scope." - }, - { - "description": "Denies the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-normalize", - "markdownDescription": "Denies the normalize command without any pre-configured scope." - }, - { - "description": "Denies the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve", - "markdownDescription": "Denies the resolve command without any pre-configured scope." - }, - { - "description": "Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve-directory", - "markdownDescription": "Denies the resolve_directory command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`", - "type": "string", - "const": "core:resources:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`" - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`", - "type": "string", - "const": "core:tray:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`" - }, - { - "description": "Enables the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-get-by-id", - "markdownDescription": "Enables the get_by_id command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-remove-by-id", - "markdownDescription": "Enables the remove_by_id command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-as-template", - "markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-with-as-template", - "markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-menu", - "markdownDescription": "Enables the set_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-show-menu-on-left-click", - "markdownDescription": "Enables the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-temp-dir-path", - "markdownDescription": "Enables the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-tooltip", - "markdownDescription": "Enables the set_tooltip command without any pre-configured scope." - }, - { - "description": "Enables the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-visible", - "markdownDescription": "Enables the set_visible command without any pre-configured scope." - }, - { - "description": "Denies the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-get-by-id", - "markdownDescription": "Denies the get_by_id command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-remove-by-id", - "markdownDescription": "Denies the remove_by_id command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-as-template", - "markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-with-as-template", - "markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-menu", - "markdownDescription": "Denies the set_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-show-menu-on-left-click", - "markdownDescription": "Denies the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-temp-dir-path", - "markdownDescription": "Denies the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-tooltip", - "markdownDescription": "Denies the set_tooltip command without any pre-configured scope." - }, - { - "description": "Denies the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-visible", - "markdownDescription": "Denies the set_visible command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`", - "type": "string", - "const": "core:webview:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`" - }, - { - "description": "Enables the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-clear-all-browsing-data", - "markdownDescription": "Enables the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Enables the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview", - "markdownDescription": "Enables the create_webview command without any pre-configured scope." - }, - { - "description": "Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview-window", - "markdownDescription": "Enables the create_webview_window command without any pre-configured scope." - }, - { - "description": "Enables the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-get-all-webviews", - "markdownDescription": "Enables the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-internal-toggle-devtools", - "markdownDescription": "Enables the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Enables the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-print", - "markdownDescription": "Enables the print command without any pre-configured scope." - }, - { - "description": "Enables the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-reparent", - "markdownDescription": "Enables the reparent command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-auto-resize", - "markdownDescription": "Enables the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-background-color", - "markdownDescription": "Enables the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-focus", - "markdownDescription": "Enables the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-position", - "markdownDescription": "Enables the set_webview_position command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-size", - "markdownDescription": "Enables the set_webview_size command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-zoom", - "markdownDescription": "Enables the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Enables the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-close", - "markdownDescription": "Enables the webview_close command without any pre-configured scope." - }, - { - "description": "Enables the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-hide", - "markdownDescription": "Enables the webview_hide command without any pre-configured scope." - }, - { - "description": "Enables the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-position", - "markdownDescription": "Enables the webview_position command without any pre-configured scope." - }, - { - "description": "Enables the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-show", - "markdownDescription": "Enables the webview_show command without any pre-configured scope." - }, - { - "description": "Enables the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-size", - "markdownDescription": "Enables the webview_size command without any pre-configured scope." - }, - { - "description": "Denies the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-clear-all-browsing-data", - "markdownDescription": "Denies the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Denies the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview", - "markdownDescription": "Denies the create_webview command without any pre-configured scope." - }, - { - "description": "Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview-window", - "markdownDescription": "Denies the create_webview_window command without any pre-configured scope." - }, - { - "description": "Denies the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-get-all-webviews", - "markdownDescription": "Denies the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-internal-toggle-devtools", - "markdownDescription": "Denies the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Denies the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-print", - "markdownDescription": "Denies the print command without any pre-configured scope." - }, - { - "description": "Denies the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-reparent", - "markdownDescription": "Denies the reparent command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-auto-resize", - "markdownDescription": "Denies the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-background-color", - "markdownDescription": "Denies the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-focus", - "markdownDescription": "Denies the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-position", - "markdownDescription": "Denies the set_webview_position command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-size", - "markdownDescription": "Denies the set_webview_size command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-zoom", - "markdownDescription": "Denies the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Denies the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-close", - "markdownDescription": "Denies the webview_close command without any pre-configured scope." - }, - { - "description": "Denies the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-hide", - "markdownDescription": "Denies the webview_hide command without any pre-configured scope." - }, - { - "description": "Denies the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-position", - "markdownDescription": "Denies the webview_position command without any pre-configured scope." - }, - { - "description": "Denies the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-show", - "markdownDescription": "Denies the webview_show command without any pre-configured scope." - }, - { - "description": "Denies the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-size", - "markdownDescription": "Denies the webview_size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`", - "type": "string", - "const": "core:window:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`" - }, - { - "description": "Enables the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-activity-name", - "markdownDescription": "Enables the activity_name command without any pre-configured scope." - }, - { - "description": "Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-available-monitors", - "markdownDescription": "Enables the available_monitors command without any pre-configured scope." - }, - { - "description": "Enables the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-center", - "markdownDescription": "Enables the center command without any pre-configured scope." - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Enables the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-create", - "markdownDescription": "Enables the create command without any pre-configured scope." - }, - { - "description": "Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-current-monitor", - "markdownDescription": "Enables the current_monitor command without any pre-configured scope." - }, - { - "description": "Enables the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-cursor-position", - "markdownDescription": "Enables the cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-destroy", - "markdownDescription": "Enables the destroy command without any pre-configured scope." - }, - { - "description": "Enables the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-get-all-windows", - "markdownDescription": "Enables the get_all_windows command without any pre-configured scope." - }, - { - "description": "Enables the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-hide", - "markdownDescription": "Enables the hide command without any pre-configured scope." - }, - { - "description": "Enables the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-position", - "markdownDescription": "Enables the inner_position command without any pre-configured scope." - }, - { - "description": "Enables the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-size", - "markdownDescription": "Enables the inner_size command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-internal-toggle-maximize", - "markdownDescription": "Enables the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-always-on-top", - "markdownDescription": "Enables the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-closable", - "markdownDescription": "Enables the is_closable command without any pre-configured scope." - }, - { - "description": "Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-decorated", - "markdownDescription": "Enables the is_decorated command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-focused", - "markdownDescription": "Enables the is_focused command without any pre-configured scope." - }, - { - "description": "Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-fullscreen", - "markdownDescription": "Enables the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximizable", - "markdownDescription": "Enables the is_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximized", - "markdownDescription": "Enables the is_maximized command without any pre-configured scope." - }, - { - "description": "Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimizable", - "markdownDescription": "Enables the is_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimized", - "markdownDescription": "Enables the is_minimized command without any pre-configured scope." - }, - { - "description": "Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-resizable", - "markdownDescription": "Enables the is_resizable command without any pre-configured scope." - }, - { - "description": "Enables the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-visible", - "markdownDescription": "Enables the is_visible command without any pre-configured scope." - }, - { - "description": "Enables the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-maximize", - "markdownDescription": "Enables the maximize command without any pre-configured scope." - }, - { - "description": "Enables the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-minimize", - "markdownDescription": "Enables the minimize command without any pre-configured scope." - }, - { - "description": "Enables the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-monitor-from-point", - "markdownDescription": "Enables the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Enables the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-position", - "markdownDescription": "Enables the outer_position command without any pre-configured scope." - }, - { - "description": "Enables the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-size", - "markdownDescription": "Enables the outer_size command without any pre-configured scope." - }, - { - "description": "Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-primary-monitor", - "markdownDescription": "Enables the primary_monitor command without any pre-configured scope." - }, - { - "description": "Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-request-user-attention", - "markdownDescription": "Enables the request_user_attention command without any pre-configured scope." - }, - { - "description": "Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scale-factor", - "markdownDescription": "Enables the scale_factor command without any pre-configured scope." - }, - { - "description": "Enables the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scene-identifier", - "markdownDescription": "Enables the scene_identifier command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-bottom", - "markdownDescription": "Enables the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-top", - "markdownDescription": "Enables the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-background-color", - "markdownDescription": "Enables the set_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-count", - "markdownDescription": "Enables the set_badge_count command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-label", - "markdownDescription": "Enables the set_badge_label command without any pre-configured scope." - }, - { - "description": "Enables the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-closable", - "markdownDescription": "Enables the set_closable command without any pre-configured scope." - }, - { - "description": "Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-content-protected", - "markdownDescription": "Enables the set_content_protected command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-grab", - "markdownDescription": "Enables the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-icon", - "markdownDescription": "Enables the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-position", - "markdownDescription": "Enables the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-visible", - "markdownDescription": "Enables the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-decorations", - "markdownDescription": "Enables the set_decorations command without any pre-configured scope." - }, - { - "description": "Enables the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-effects", - "markdownDescription": "Enables the set_effects command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focus", - "markdownDescription": "Enables the set_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focusable", - "markdownDescription": "Enables the set_focusable command without any pre-configured scope." - }, - { - "description": "Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-fullscreen", - "markdownDescription": "Enables the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-ignore-cursor-events", - "markdownDescription": "Enables the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-max-size", - "markdownDescription": "Enables the set_max_size command without any pre-configured scope." - }, - { - "description": "Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-maximizable", - "markdownDescription": "Enables the set_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-min-size", - "markdownDescription": "Enables the set_min_size command without any pre-configured scope." - }, - { - "description": "Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-minimizable", - "markdownDescription": "Enables the set_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-overlay-icon", - "markdownDescription": "Enables the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-position", - "markdownDescription": "Enables the set_position command without any pre-configured scope." - }, - { - "description": "Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-progress-bar", - "markdownDescription": "Enables the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-resizable", - "markdownDescription": "Enables the set_resizable command without any pre-configured scope." - }, - { - "description": "Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-shadow", - "markdownDescription": "Enables the set_shadow command without any pre-configured scope." - }, - { - "description": "Enables the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-simple-fullscreen", - "markdownDescription": "Enables the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size", - "markdownDescription": "Enables the set_size command without any pre-configured scope." - }, - { - "description": "Enables the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size-constraints", - "markdownDescription": "Enables the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-skip-taskbar", - "markdownDescription": "Enables the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Enables the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-theme", - "markdownDescription": "Enables the set_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title-bar-style", - "markdownDescription": "Enables the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-visible-on-all-workspaces", - "markdownDescription": "Enables the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-dragging", - "markdownDescription": "Enables the start_dragging command without any pre-configured scope." - }, - { - "description": "Enables the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-resize-dragging", - "markdownDescription": "Enables the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Enables the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-theme", - "markdownDescription": "Enables the theme command without any pre-configured scope." - }, - { - "description": "Enables the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-title", - "markdownDescription": "Enables the title command without any pre-configured scope." - }, - { - "description": "Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-toggle-maximize", - "markdownDescription": "Enables the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unmaximize", - "markdownDescription": "Enables the unmaximize command without any pre-configured scope." - }, - { - "description": "Enables the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unminimize", - "markdownDescription": "Enables the unminimize command without any pre-configured scope." - }, - { - "description": "Denies the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-activity-name", - "markdownDescription": "Denies the activity_name command without any pre-configured scope." - }, - { - "description": "Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-available-monitors", - "markdownDescription": "Denies the available_monitors command without any pre-configured scope." - }, - { - "description": "Denies the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-center", - "markdownDescription": "Denies the center command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Denies the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-create", - "markdownDescription": "Denies the create command without any pre-configured scope." - }, - { - "description": "Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-current-monitor", - "markdownDescription": "Denies the current_monitor command without any pre-configured scope." - }, - { - "description": "Denies the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-cursor-position", - "markdownDescription": "Denies the cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-destroy", - "markdownDescription": "Denies the destroy command without any pre-configured scope." - }, - { - "description": "Denies the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-get-all-windows", - "markdownDescription": "Denies the get_all_windows command without any pre-configured scope." - }, - { - "description": "Denies the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-hide", - "markdownDescription": "Denies the hide command without any pre-configured scope." - }, - { - "description": "Denies the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-position", - "markdownDescription": "Denies the inner_position command without any pre-configured scope." - }, - { - "description": "Denies the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-size", - "markdownDescription": "Denies the inner_size command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-internal-toggle-maximize", - "markdownDescription": "Denies the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-always-on-top", - "markdownDescription": "Denies the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-closable", - "markdownDescription": "Denies the is_closable command without any pre-configured scope." - }, - { - "description": "Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-decorated", - "markdownDescription": "Denies the is_decorated command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-focused", - "markdownDescription": "Denies the is_focused command without any pre-configured scope." - }, - { - "description": "Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-fullscreen", - "markdownDescription": "Denies the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximizable", - "markdownDescription": "Denies the is_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximized", - "markdownDescription": "Denies the is_maximized command without any pre-configured scope." - }, - { - "description": "Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimizable", - "markdownDescription": "Denies the is_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimized", - "markdownDescription": "Denies the is_minimized command without any pre-configured scope." - }, - { - "description": "Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-resizable", - "markdownDescription": "Denies the is_resizable command without any pre-configured scope." - }, - { - "description": "Denies the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-visible", - "markdownDescription": "Denies the is_visible command without any pre-configured scope." - }, - { - "description": "Denies the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-maximize", - "markdownDescription": "Denies the maximize command without any pre-configured scope." - }, - { - "description": "Denies the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-minimize", - "markdownDescription": "Denies the minimize command without any pre-configured scope." - }, - { - "description": "Denies the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-monitor-from-point", - "markdownDescription": "Denies the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Denies the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-position", - "markdownDescription": "Denies the outer_position command without any pre-configured scope." - }, - { - "description": "Denies the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-size", - "markdownDescription": "Denies the outer_size command without any pre-configured scope." - }, - { - "description": "Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-primary-monitor", - "markdownDescription": "Denies the primary_monitor command without any pre-configured scope." - }, - { - "description": "Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-request-user-attention", - "markdownDescription": "Denies the request_user_attention command without any pre-configured scope." - }, - { - "description": "Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scale-factor", - "markdownDescription": "Denies the scale_factor command without any pre-configured scope." - }, - { - "description": "Denies the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scene-identifier", - "markdownDescription": "Denies the scene_identifier command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-bottom", - "markdownDescription": "Denies the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-top", - "markdownDescription": "Denies the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-background-color", - "markdownDescription": "Denies the set_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-count", - "markdownDescription": "Denies the set_badge_count command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-label", - "markdownDescription": "Denies the set_badge_label command without any pre-configured scope." - }, - { - "description": "Denies the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-closable", - "markdownDescription": "Denies the set_closable command without any pre-configured scope." - }, - { - "description": "Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-content-protected", - "markdownDescription": "Denies the set_content_protected command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-grab", - "markdownDescription": "Denies the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-icon", - "markdownDescription": "Denies the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-position", - "markdownDescription": "Denies the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-visible", - "markdownDescription": "Denies the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-decorations", - "markdownDescription": "Denies the set_decorations command without any pre-configured scope." - }, - { - "description": "Denies the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-effects", - "markdownDescription": "Denies the set_effects command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focus", - "markdownDescription": "Denies the set_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focusable", - "markdownDescription": "Denies the set_focusable command without any pre-configured scope." - }, - { - "description": "Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-fullscreen", - "markdownDescription": "Denies the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-ignore-cursor-events", - "markdownDescription": "Denies the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-max-size", - "markdownDescription": "Denies the set_max_size command without any pre-configured scope." - }, - { - "description": "Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-maximizable", - "markdownDescription": "Denies the set_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-min-size", - "markdownDescription": "Denies the set_min_size command without any pre-configured scope." - }, - { - "description": "Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-minimizable", - "markdownDescription": "Denies the set_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-overlay-icon", - "markdownDescription": "Denies the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-position", - "markdownDescription": "Denies the set_position command without any pre-configured scope." - }, - { - "description": "Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-progress-bar", - "markdownDescription": "Denies the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-resizable", - "markdownDescription": "Denies the set_resizable command without any pre-configured scope." - }, - { - "description": "Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-shadow", - "markdownDescription": "Denies the set_shadow command without any pre-configured scope." - }, - { - "description": "Denies the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-simple-fullscreen", - "markdownDescription": "Denies the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size", - "markdownDescription": "Denies the set_size command without any pre-configured scope." - }, - { - "description": "Denies the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size-constraints", - "markdownDescription": "Denies the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-skip-taskbar", - "markdownDescription": "Denies the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Denies the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-theme", - "markdownDescription": "Denies the set_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title-bar-style", - "markdownDescription": "Denies the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-visible-on-all-workspaces", - "markdownDescription": "Denies the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-dragging", - "markdownDescription": "Denies the start_dragging command without any pre-configured scope." - }, - { - "description": "Denies the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-resize-dragging", - "markdownDescription": "Denies the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Denies the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-theme", - "markdownDescription": "Denies the theme command without any pre-configured scope." - }, - { - "description": "Denies the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-title", - "markdownDescription": "Denies the title command without any pre-configured scope." - }, - { - "description": "Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-toggle-maximize", - "markdownDescription": "Denies the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unmaximize", - "markdownDescription": "Denies the unmaximize command without any pre-configured scope." - }, - { - "description": "Denies the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unminimize", - "markdownDescription": "Denies the unminimize command without any pre-configured scope." - }, - { - "description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`", - "type": "string", - "const": "dialog:default", - "markdownDescription": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`" - }, - { - "description": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)", - "type": "string", - "const": "dialog:allow-ask", - "markdownDescription": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)" - }, - { - "description": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)", - "type": "string", - "const": "dialog:allow-confirm", - "markdownDescription": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)" - }, - { - "description": "Enables the message command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-message", - "markdownDescription": "Enables the message command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the save command without any pre-configured scope.", - "type": "string", - "const": "dialog:allow-save", - "markdownDescription": "Enables the save command without any pre-configured scope." - }, - { - "description": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)", - "type": "string", - "const": "dialog:deny-ask", - "markdownDescription": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)" - }, - { - "description": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)", - "type": "string", - "const": "dialog:deny-confirm", - "markdownDescription": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)" - }, - { - "description": "Denies the message command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-message", - "markdownDescription": "Denies the message command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the save command without any pre-configured scope.", - "type": "string", - "const": "dialog:deny-save", - "markdownDescription": "Denies the save command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellScopeEntryAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "raw": { - "description": "Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.", - "default": false, - "type": "boolean" - }, - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellScopeEntryAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellScopeEntryAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/参考/NexBox-main/installer/src-tauri/icons/128x128.png b/参考/NexBox-main/installer/src-tauri/icons/128x128.png deleted file mode 100644 index 2a7a5e8..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/128x128.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/128x128@2x.png b/参考/NexBox-main/installer/src-tauri/icons/128x128@2x.png deleted file mode 100644 index a8d7e45..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/128x128@2x.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/32x32.png b/参考/NexBox-main/installer/src-tauri/icons/32x32.png deleted file mode 100644 index 62a7309..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/32x32.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/64x64.png b/参考/NexBox-main/installer/src-tauri/icons/64x64.png deleted file mode 100644 index c30f8ff..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/64x64.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square107x107Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square107x107Logo.png deleted file mode 100644 index dba1e57..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square107x107Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square142x142Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square142x142Logo.png deleted file mode 100644 index 0751ebe..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square142x142Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square150x150Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square150x150Logo.png deleted file mode 100644 index efb78ae..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square150x150Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square284x284Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square284x284Logo.png deleted file mode 100644 index c5e4103..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square284x284Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square30x30Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square30x30Logo.png deleted file mode 100644 index e5d6bfe..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square30x30Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square310x310Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square310x310Logo.png deleted file mode 100644 index a4550e2..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square310x310Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square44x44Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square44x44Logo.png deleted file mode 100644 index 47e9e87..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square44x44Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square71x71Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square71x71Logo.png deleted file mode 100644 index 922d934..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square71x71Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/Square89x89Logo.png b/参考/NexBox-main/installer/src-tauri/icons/Square89x89Logo.png deleted file mode 100644 index 5905891..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/Square89x89Logo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/StoreLogo.png b/参考/NexBox-main/installer/src-tauri/icons/StoreLogo.png deleted file mode 100644 index ff64ec2..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/StoreLogo.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/icon.icns b/参考/NexBox-main/installer/src-tauri/icons/icon.icns deleted file mode 100644 index 7b9316b..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/icon.icns and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/icon.ico b/参考/NexBox-main/installer/src-tauri/icons/icon.ico deleted file mode 100644 index 02889a9..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/icon.ico and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/icons/icon.png b/参考/NexBox-main/installer/src-tauri/icons/icon.png deleted file mode 100644 index 3332566..0000000 Binary files a/参考/NexBox-main/installer/src-tauri/icons/icon.png and /dev/null differ diff --git a/参考/NexBox-main/installer/src-tauri/src/installer.rs b/参考/NexBox-main/installer/src-tauri/src/installer.rs deleted file mode 100644 index 17d8e13..0000000 --- a/参考/NexBox-main/installer/src-tauri/src/installer.rs +++ /dev/null @@ -1,493 +0,0 @@ -use mslnk::ShellLink; -use serde::Serialize; -use std::fs; -use std::path::{Path, PathBuf}; -use std::process::Command; -#[cfg(target_os = "windows")] -use std::os::windows::process::CommandExt; -#[cfg(target_os = "windows")] -use std::os::windows::ffi::OsStrExt; -use winreg::enums::*; -use winreg::RegKey; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -#[cfg(target_os = "windows")] -extern "system" { - fn GetDiskFreeSpaceExW( - lpDirectoryName: *const u16, - lpFreeBytesAvailableToCaller: *mut u64, - lpTotalNumberOfBytes: *mut u64, - lpTotalNumberOfFreeBytes: *mut u64, - ) -> i32; -} - -/// UTF-16LE + Base64 编码 PowerShell 脚本 -/// 这是 Windows 上传递含非 ASCII 字符脚本的唯一可靠方式。 -/// `-EncodedCommand` 参数支持 UTF-16LE Base64,完全绕过系统代码页问题。 -fn encode_ps_command(script: &str) -> String { - let utf16: Vec = script - .encode_utf16() - .flat_map(|c| c.to_le_bytes()) - .collect(); - base64_encode(&utf16) -} - -fn base64_encode(data: &[u8]) -> String { - const CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - let mut out = String::with_capacity((data.len() + 2) / 3 * 4); - for chunk in data.chunks(3) { - let b = [chunk[0] as u32, *chunk.get(1).unwrap_or(&0) as u32, *chunk.get(2).unwrap_or(&0) as u32]; - let n = (b[0] << 16) | (b[1] << 8) | b[2]; - out.push(CHARS[((n >> 18) & 0x3F) as usize] as char); - out.push(CHARS[((n >> 12) & 0x3F) as usize] as char); - out.push(if chunk.len() > 1 { CHARS[((n >> 6) & 0x3F) as usize] } else { b'=' } as char); - out.push(if chunk.len() > 2 { CHARS[(n & 0x3F) as usize] } else { b'=' } as char); - } - out -} - -/// 通过 Base64 编码执行 PowerShell 脚本,避免系统代码页导致的乱码。 -/// 脚本以 UTF-8 传入,内部自动转为 UTF-16LE Base64。 -/// stdout 通过 `[Console]::OutputEncoding` 强制为 UTF-8 返回。 -fn run_powershell(script: &str) -> Result { - let full_script = format!( - "[Console]::OutputEncoding = [Text.Encoding]::UTF8; {}", - script - ); - let encoded = encode_ps_command(&full_script); - - let output = Command::new("powershell") - .args(["-NoProfile", "-NonInteractive", "-EncodedCommand", &encoded]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("无法执行 PowerShell: {}", e))?; - - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr); - return Err(format!("PowerShell 执行失败: {}", stderr)); - } - Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()) -} - -#[derive(Serialize)] -pub struct FileEntry { - relative_path: String, - size: u64, -} - -/// Embedded payload ZIP (created by build.ps1 staging step) -const PAYLOAD_ZIP: &[u8] = include_bytes!("../payload.zip"); - -/// 从注册表读取已安装 NexBox 的路径(用于更新场景) -fn get_existing_install_path() -> Option { - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - let uninstall_key_path = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NexBox"; - - // 检查 64 位注册表视图 - if let Ok(key) = hklm.open_subkey_with_flags(uninstall_key_path, KEY_READ) { - if let Ok(install_location) = key.get_value::("InstallLocation") { - let path = Path::new(&install_location); - if path.exists() && path.join("nexbox.exe").exists() { - return Some(install_location); - } - } - } - - // 检查 32 位注册表视图 (WOW6432Node),兼容旧版安装 - let wow64_path = r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NexBox"; - if let Ok(key) = hklm.open_subkey_with_flags(wow64_path, KEY_READ) { - if let Ok(install_location) = key.get_value::("InstallLocation") { - let path = Path::new(&install_location); - if path.exists() && path.join("nexbox.exe").exists() { - return Some(install_location); - } - } - } - - None -} - -#[tauri::command] -pub fn get_default_install_path() -> String { - // 更新场景:优先使用注册表中已记录的安装目录 - if let Some(existing_path) = get_existing_install_path() { - return existing_path; - } - // 全新安装:默认 Program Files\NexBox - let program_files = std::env::var("ProgramFiles") - .unwrap_or_else(|_| "C:\\Program Files".to_string()); - Path::new(&program_files) - .join("NexBox") - .display() - .to_string() -} - -#[tauri::command] -pub fn check_disk_space(path: String) -> Result { - let path = Path::new(&path); - let available = fs2_available_space(path).map_err(|e| format!("无法检查磁盘空间: {}", e))?; - Ok(available) -} - -#[tauri::command] -pub fn get_app_version() -> String { - env!("NEXBOX_APP_VERSION").to_string() -} - -#[tauri::command] -pub fn get_resource_files() -> Result, String> { - let cursor = std::io::Cursor::new(PAYLOAD_ZIP); - let mut archive = - zip::ZipArchive::new(cursor).map_err(|e| format!("无法读取安装包: {}", e))?; - - let mut files = Vec::new(); - for i in 0..archive.len() { - let file = archive.by_index(i).map_err(|e| format!("读取文件失败: {}", e))?; - if !file.name().ends_with('/') { - files.push(FileEntry { - relative_path: file.name().to_string(), - size: file.size(), - }); - } - } - Ok(files) -} - -#[tauri::command] -pub fn install( - target_dir: String, - create_desktop_shortcut: bool, -) -> Result<(), String> { - let target = PathBuf::from(&target_dir); - - // Cleanup old Inno Setup artifacts before installing - cleanup_old_innosetup(&target); - - // Create target directory - fs::create_dir_all(&target) - .map_err(|e| format!("无法创建目标目录: {}", e))?; - - // Extract payload ZIP to target directory - extract_payload(&target)?; - - // Register uninstaller first (before shortcuts, so registry is always written) - register_uninstall(&target_dir, env!("NEXBOX_APP_VERSION")) - .map_err(|e| format!("无法注册卸载信息: {}", e))?; - - // Remove any existing shortcuts to avoid duplicates from old version - delete_existing_shortcuts("新境盒"); - - // Create Start Menu shortcut (non-fatal — installation succeeds regardless) - let exe_path = target.join("nexbox.exe"); - if let Err(e) = create_lnk_shortcut("新境盒", &exe_path, "StartMenu") { - eprintln!("创建开始菜单快捷方式失败 (非致命): {}", e); - } - - // Create Desktop shortcut if requested (non-fatal) - if create_desktop_shortcut { - if let Err(e) = create_lnk_shortcut("新境盒", &exe_path, "Desktop") { - eprintln!("创建桌面快捷方式失败 (非致命): {}", e); - } - } - - Ok(()) -} - -#[tauri::command] -pub fn cancel_install(target_dir: String) -> Result<(), String> { - let path = Path::new(&target_dir); - if path.exists() { - fs::remove_dir_all(path) - .map_err(|e| format!("无法清理安装目录: {}", e))?; - } - Ok(()) -} - -#[tauri::command] -pub fn launch_installed_app(target_dir: String) -> Result<(), String> { - let exe_path = Path::new(&target_dir).join("nexbox.exe"); - if !exe_path.exists() { - return Err("未找到 nexbox.exe".to_string()); - } - - Command::new(&exe_path) - .spawn() - .map_err(|e| format!("无法启动应用: {}", e))?; - - Ok(()) -} - -// === Payload extraction === - -fn extract_payload(target_dir: &Path) -> Result<(), String> { - let cursor = std::io::Cursor::new(PAYLOAD_ZIP); - let mut archive = - zip::ZipArchive::new(cursor).map_err(|e| format!("无法读取安装包: {}", e))?; - - for i in 0..archive.len() { - let mut file = archive - .by_index(i) - .map_err(|e| format!("读取文件失败: {}", e))?; - - let name = file.name().to_string(); - let outpath = target_dir.join(&name); - - if name.ends_with('/') { - fs::create_dir_all(&outpath) - .map_err(|e| format!("无法创建目录 {}: {}", outpath.display(), e))?; - } else { - if let Some(parent) = outpath.parent() { - fs::create_dir_all(parent) - .map_err(|e| format!("无法创建目录 {}: {}", parent.display(), e))?; - } - let mut outfile = fs::File::create(&outpath) - .map_err(|e| format!("无法创建文件 {}: {}", outpath.display(), e))?; - std::io::copy(&mut file, &mut outfile) - .map_err(|e| format!("无法写入文件 {}: {}", outpath.display(), e))?; - } - } - - Ok(()) -} - -// === Shortcut creation via native Windows IShellLink API === - -fn create_lnk_shortcut(name: &str, target_exe: &Path, location: &str) -> Result<(), String> { - let folder = get_special_folder_path(location) - .ok_or_else(|| "无法获取系统目录路径".to_string())?; - - let shortcut_path = Path::new(&folder).join(format!("{}.lnk", name)); - let workdir = target_exe.parent().unwrap_or(Path::new("")); - - let mut sl = ShellLink::new(target_exe) - .map_err(|e| format!("创建快捷方式失败: {}", e))?; - sl.set_working_dir(Some(workdir.to_string_lossy().to_string())); - sl.create_lnk(&shortcut_path) - .map_err(|e| format!("保存快捷方式失败: {}", e))?; - - Ok(()) -} - -/// Get system folder paths without spawning PowerShell. -/// Uses dirs crate for Desktop, SHGetFolderPathW for Common Programs. -fn get_special_folder_path(folder: &str) -> Option { - if folder == "Desktop" { - dirs::desktop_dir().map(|p| p.to_string_lossy().to_string()) - } else { - get_common_programs_path() - } -} - -#[cfg(target_os = "windows")] -fn get_common_programs_path() -> Option { - use std::os::windows::ffi::OsStringExt; - - extern "system" { - fn SHGetFolderPathW( - hwnd: *mut std::ffi::c_void, - csidl: i32, - h_token: *mut std::ffi::c_void, - dw_flags: u32, - psz_path: *mut u16, - ) -> i32; - } - - const CSIDL_COMMON_PROGRAMS: i32 = 0x0017; - let mut buf = vec![0u16; 260]; // MAX_PATH - - unsafe { - let result = SHGetFolderPathW( - std::ptr::null_mut(), - CSIDL_COMMON_PROGRAMS, - std::ptr::null_mut(), - 0, - buf.as_mut_ptr(), - ); - if result == 0 { - let len = buf.iter().position(|&c| c == 0).unwrap_or(buf.len()); - return Some(std::ffi::OsString::from_wide(&buf[..len]).to_string_lossy().to_string()); - } - } - None -} - -// === Registry operations === - -fn register_uninstall(install_dir: &str, version: &str) -> Result<(), String> { - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - let uninstall_path = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NexBox"; - - let (key, _) = hklm - .create_subkey(uninstall_path) - .map_err(|e| format!("无法创建注册表键: {}", e))?; - - let icon_path = format!("{}\\nexbox.exe", install_dir); - let uninstaller_path = format!("{}\\Uninstnexbox.exe", install_dir); - - key.set_value("DisplayName", &"新境盒") - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("DisplayVersion", &version) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("DisplayIcon", &icon_path) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("Publisher", &"MuLiu") - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("InstallLocation", &install_dir) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("UninstallString", &uninstaller_path) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("NoModify", &1u32) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("NoRepair", &1u32) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("EstimatedSize", &250_000u32) - .map_err(|e| format!("写入注册表失败: {}", e))?; - key.set_value("URLInfoAbout", &"https://www.nexbox.top/") - .map_err(|e| format!("写入注册表失败: {}", e))?; - - Ok(()) -} - -// === Disk space check === - -/// Remove old Inno Setup uninstaller files (unins000.exe / unins000.dat) -/// and clean up leftover Inno Setup registry entries from the old installer -fn cleanup_old_innosetup(target: &Path) { - // 1. Delete old Inno uninstaller files - for name in &["unins000.exe", "unins000.dat"] { - let path = target.join(name); - if path.exists() { - let _ = fs::remove_file(&path); - } - } - - // 2. Delete old Inno Setup registry entries - cleanup_old_innosetup_registry(); -} - -/// Scan and remove old Inno Setup uninstall registry entries. -/// Inno Setup convention: {AppId}_is1 under HKLM\...\Uninstall -/// These leftover entries cause "ghost" entries in Apps & Features. -fn cleanup_old_innosetup_registry() { - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - - // Check both 64-bit and 32-bit (WOW6432Node) registry views - let hive_paths = [ - r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", - r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall", - ]; - - for hive in &hive_paths { - if let Ok(uninstall_key) = hklm.open_subkey_with_flags(hive, KEY_ALL_ACCESS) { - // Collect INNO _is1 keys whose DisplayName matches NexBox - let to_delete: Vec = uninstall_key - .enum_keys() - .filter_map(|k| k.ok()) - .filter(|k| k.ends_with("_is1")) - .filter(|key_name| { - if let Ok(subkey) = - uninstall_key.open_subkey_with_flags(key_name, KEY_READ) - { - if let Ok(name) = subkey.get_value::("DisplayName") { - return name.contains("新境盒") - || name.to_lowercase().contains("nexbox"); - } - } - false - }) - .collect(); - - for key_name in &to_delete { - let _ = uninstall_key.delete_subkey_all(key_name); - } - } - } -} - -/// Delete existing shortcuts before creating new ones to avoid duplicates -fn delete_existing_shortcuts(name: &str) { - // Delete from Desktop - if let Some(desktop) = get_special_folder_path("Desktop") { - let path = format!("{}\\{}.lnk", desktop, name); - if Path::new(&path).exists() { - let _ = fs::remove_file(&path); - } - } - // Delete from Start Menu - if let Some(start_menu) = get_special_folder_path("StartMenu") { - let path = format!("{}\\{}.lnk", start_menu, name); - if Path::new(&path).exists() { - let _ = fs::remove_file(&path); - } - } -} - -fn fs2_available_space(path: &Path) -> Result { - let path_str = path.display().to_string(); - // 提取盘符(从路径开头取第一个字符 + ':') - let drive_letter = path_str - .chars() - .next() - .filter(|c| c.is_ascii_alphabetic()) - .ok_or_else(|| std::io::Error::new(std::io::ErrorKind::InvalidInput, "无效的路径"))?; - - // 方案1: Win32 API GetDiskFreeSpaceExW —— 不依赖 PowerShell,不受安全软件/执行策略影响 - #[cfg(target_os = "windows")] - { - let root_path = format!("{}:\\", drive_letter); - let wide_path: Vec = std::ffi::OsStr::new(&root_path) - .encode_wide() - .chain(std::iter::once(0)) - .collect(); - - let mut free_bytes: u64 = 0; - let mut total_bytes: u64 = 0; - let mut total_free_bytes: u64 = 0; - - unsafe { - let result = GetDiskFreeSpaceExW( - wide_path.as_ptr(), - &mut free_bytes as *mut u64, - &mut total_bytes as *mut u64, - &mut total_free_bytes as *mut u64, - ); - if result != 0 { - return Ok(free_bytes); - } - // API 调用失败,记录错误信息供排查 - let api_error = std::io::Error::last_os_error(); - eprintln!( - "GetDiskFreeSpaceExW({}) 失败: {},回退到 PowerShell", - root_path, api_error - ); - } - } - - // 方案2: PowerShell Get-CimInstance Win32_LogicalDisk(降级方案) - let ps_cmd = format!( - "(Get-CimInstance Win32_LogicalDisk -Filter \"DeviceID='{}:'\").FreeSpace", - drive_letter - ); - match run_powershell(&ps_cmd) { - Ok(stdout) => { - // 清理可能的 BOM 字符(U+FEFF) - let cleaned = stdout.trim().trim_start_matches('\u{feff}'); - if let Ok(bytes) = cleaned.parse::() { - return Ok(bytes); - } - Err(std::io::Error::new( - std::io::ErrorKind::Other, - format!( - "无法解析磁盘空间数值 (盘符 {}:): '{}'", - drive_letter, - stdout.trim() - ), - )) - } - Err(e) => Err(std::io::Error::new( - std::io::ErrorKind::Other, - format!("无法获取磁盘空间 (盘符 {}:): {}", drive_letter, e), - )), - } -} diff --git a/参考/NexBox-main/installer/src-tauri/src/lib.rs b/参考/NexBox-main/installer/src-tauri/src/lib.rs deleted file mode 100644 index 01acc00..0000000 --- a/参考/NexBox-main/installer/src-tauri/src/lib.rs +++ /dev/null @@ -1,21 +0,0 @@ -mod installer; - -use installer::*; - -#[cfg_attr(mobile, tauri::mobile_entry_point)] -pub fn run() { - tauri::Builder::default() - .plugin(tauri_plugin_dialog::init()) - .plugin(tauri_plugin_shell::init()) - .invoke_handler(tauri::generate_handler![ - get_default_install_path, - check_disk_space, - get_resource_files, - install, - cancel_install, - launch_installed_app, - get_app_version, - ]) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); -} diff --git a/参考/NexBox-main/installer/src-tauri/src/main.rs b/参考/NexBox-main/installer/src-tauri/src/main.rs deleted file mode 100644 index e3dc080..0000000 --- a/参考/NexBox-main/installer/src-tauri/src/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] - -fn main() { - nexbox_installer_lib::run() -} diff --git a/参考/NexBox-main/installer/src-tauri/tauri.conf.json b/参考/NexBox-main/installer/src-tauri/tauri.conf.json deleted file mode 100644 index 98928ba..0000000 --- a/参考/NexBox-main/installer/src-tauri/tauri.conf.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", - "productName": "NexBox安装程序", - "version": "5.9.8", - "identifier": "com.nexbox.installer", - "build": { - "frontendDist": "../dist", - "devUrl": "http://localhost:1420", - "beforeDevCommand": "npm run dev", - "beforeBuildCommand": "npm run build" - }, - "app": { - "windows": [ - { - "title": "新境盒 安装程序", - "width": 800, - "height": 620, - "minWidth": 800, - "minHeight": 620, - "maxWidth": 800, - "maxHeight": 620, - "resizable": false, - "center": true, - "decorations": false - } - ], - "security": { - "csp": null - } - }, - "bundle": { - "active": false, - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.ico" - ] - } -} diff --git a/参考/NexBox-main/installer/src/App.css b/参考/NexBox-main/installer/src/App.css deleted file mode 100644 index 903c3af..0000000 --- a/参考/NexBox-main/installer/src/App.css +++ /dev/null @@ -1,343 +0,0 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -html, body, #root { - width: 100%; - height: 100%; - overflow: hidden; - user-select: none; -} - -#root { - background: url("/logo/preset.png") center / cover no-repeat; -} - -/* ── Title Bar ── */ -.titlebar { - display: flex; - align-items: center; - height: 44px; - padding: 0 8px; - background: transparent; - flex-shrink: 0; - position: relative; - z-index: 1000; -} - -.titlebar-spacer { - flex: 1; - height: 100%; -} - -.titlebar-controls { - display: flex; - align-items: center; - gap: 6px; -} - -.titlebar-btn { - display: flex; - align-items: center; - justify-content: center; - width: 36px; - height: 36px; - border: none; - background: rgba(255, 255, 255, 0.8); - color: #64748b; - border-radius: 50%; - cursor: pointer; - transition: all 0.15s; -} - -.titlebar-btn:hover { - background: #f1f5f9; - color: #334155; -} - -.titlebar-btn-close:hover { - background: #fee2e2; - color: #dc2626; -} - -/* ── App Layout ── */ -.installer-app { - display: flex; - flex-direction: column; - height: calc(100vh - 44px); - background: transparent; - overflow: hidden; -} - -.installer-body { - display: flex; - flex: 1; - overflow: hidden; - min-height: 0; -} - -.installer-content { - flex: 1; - padding: 24px 28px; - display: flex; - flex-direction: column; - overflow-y: auto; - background: transparent; - position: relative; - min-height: 0; -} - -.installer-footer { - display: flex; - justify-content: center; - align-items: center; - padding: 14px 24px; - gap: 12px; - flex-shrink: 0; - flex-wrap: wrap; - background: transparent; - min-height: 52px; -} - -/* ── Typography ── */ -.page-title { - font-size: 22px; - font-weight: 700; - margin-bottom: 8px; - color: #1a202c; -} - -.page-subtitle { - font-size: 14px; - color: #64748b; - margin-bottom: 24px; -} - -/* ── Cards ── */ -.glass-card { - background: #f8fafc; - border: 1px solid #e2e8f0; - border-radius: 12px; - padding: 20px; -} - -/* ── Progress ── */ -.progress-container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - flex: 1; - gap: 20px; -} - -.progress-bar { - width: 100%; - height: 8px; - background: #e2e8f0; - border-radius: 4px; - overflow: hidden; -} - -.progress-bar-fill { - height: 100%; - background: linear-gradient(90deg, #3b82f6, #60a5fa); - border-radius: 4px; - transition: width 0.4s ease; -} - -/* ── Buttons ── */ -.btn-primary { - background: #1a1a1a; - color: white; - border: none; - padding: 10px 24px; - border-radius: 8px; - font-size: 14px; - font-weight: 500; - cursor: pointer; - transition: all 0.2s; - flex-shrink: 0; - white-space: nowrap; -} - -.btn-primary:hover { - background: #333; -} - -.btn-primary:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -.btn-secondary { - background: #ffffff; - color: #475569; - border: 1px solid #e2e8f0; - padding: 10px 24px; - border-radius: 8px; - font-size: 14px; - font-weight: 500; - cursor: pointer; - transition: all 0.2s; - flex-shrink: 0; - white-space: nowrap; -} - -.btn-secondary:hover { - background: #f1f5f9; - color: #1a202c; -} - -.btn-secondary:disabled { - opacity: 0.4; - cursor: not-allowed; -} - -/* ── Directory Selector ── */ -.dir-selector { - display: flex; - align-items: center; - gap: 8px; - background: #ffffff; - border: 1px solid #e2e8f0; - border-radius: 8px; - padding: 0 12px; - height: 44px; -} - -.dir-selector input { - flex: 1; - background: transparent; - border: none; - outline: none; - color: #1a202c; - font-size: 13px; - height: 100%; -} - -.dir-selector button { - background: #eff6ff; - color: #3b82f6; - border: none; - padding: 6px 14px; - border-radius: 6px; - font-size: 12px; - cursor: pointer; - white-space: nowrap; -} - -.dir-selector button:hover { - background: #dbeafe; -} - -/* ── License Scroll ── */ -.license-scroll { - flex: 1; - overflow-y: auto; - font-size: 13px; - line-height: 1.7; - color: #475569; - padding: 16px; - background: #ffffff; - border-radius: 8px; - border: 1px solid #e2e8f0; - min-height: 200px; -} - -.license-scroll::-webkit-scrollbar { - width: 6px; -} - -.license-scroll::-webkit-scrollbar-track { - background: transparent; -} - -.license-scroll::-webkit-scrollbar-thumb { - background: #cbd5e1; - border-radius: 3px; -} - -/* ── File List ── */ -.file-list { - max-height: 120px; - overflow-y: auto; - font-size: 12px; - color: #64748b; - margin-top: 12px; -} - -.file-list::-webkit-scrollbar { - width: 4px; -} - -.file-list::-webkit-scrollbar-thumb { - background: #cbd5e1; - border-radius: 2px; -} - -/* ── Space Spinner ── */ -.space-spinner { - display: inline-block; - width: 18px; - height: 18px; - border: 2px solid #e2e8f0; - border-top-color: #3b82f6; - border-radius: 50%; - animation: spin 0.6s linear infinite; - vertical-align: middle; -} - -@keyframes spin { - to { transform: rotate(360deg); } -} - -/* ── Checkbox ── */ -.checkbox-label { - display: flex; - align-items: center; - gap: 8px; - font-size: 14px; - color: #475569; - cursor: pointer; - user-select: none; -} - -.checkbox-label input[type="checkbox"] { - display: none; -} - -.checkbox-mark { - width: 18px; - height: 18px; - border: 2px solid #cbd5e1; - border-radius: 4px; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - transition: all 0.2s; - background: #ffffff; -} - -.checkbox-label input:checked + .checkbox-mark { - background: #3b82f6; - border-color: #3b82f6; -} - -.checkbox-mark::after { - content: ""; - width: 5px; - height: 9px; - border: solid white; - border-width: 0 2px 2px 0; - transform: rotate(45deg) translateY(-1px); - opacity: 0; - transition: opacity 0.15s; -} - -.checkbox-label input:checked + .checkbox-mark::after { - opacity: 1; -} diff --git a/参考/NexBox-main/installer/src/App.tsx b/参考/NexBox-main/installer/src/App.tsx deleted file mode 100644 index 8cc5b45..0000000 --- a/参考/NexBox-main/installer/src/App.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import { useState, useCallback } from "react"; -import { AnimatePresence } from "framer-motion"; -import { useTranslation } from "react-i18next"; -import TitleBar from "./components/TitleBar"; -import InstallerLayout from "./components/InstallerLayout"; -import WelcomePage from "./pages/WelcomePage"; -import LicensePage from "./pages/LicensePage"; -import SelectDirPage from "./pages/SelectDirPage"; -import InstallingPage from "./pages/InstallingPage"; -import FinishPage from "./pages/FinishPage"; - -export default function App() { - const { t } = useTranslation(); - const [step, setStep] = useState(1); - const [targetDir, setTargetDir] = useState(""); - const [dirValid, setDirValid] = useState(false); - const [createDesktopShortcut, setCreateDesktopShortcut] = useState(true); - const [error, setError] = useState(""); - - const handleNext = useCallback(() => { - if (step === 3 && !dirValid) return; - if (step < 5) setStep((s) => s + 1); - }, [step, dirValid]); - - const handleBack = useCallback(() => { - if (step > 1) setStep((s) => s - 1); - }, [step]); - - const handleInstallComplete = useCallback(() => { - setStep(5); - }, []); - - const handleInstallError = useCallback((msg: string) => { - setError(msg); - alert(msg); - }, []); - - const canGoNext = useCallback(() => { - if (step === 1) return true; - if (step === 2) return true; - if (step === 3) return dirValid; - return false; - }, [step, dirValid]); - - const nextLabel = step === 1 ? "开始安装" : step === 3 ? t("btn_install") : undefined; - - return ( - <> - - 1 && step < 4} - canGoNext={step < 4 ? canGoNext() : false} - nextLabel={nextLabel} - onBack={step > 1 && step < 4 ? handleBack : undefined} - onNext={step < 4 ? handleNext : undefined} - showCancel={false} - > - - {step === 1 && } - {step === 2 && {}} />} - {step === 3 && ( - - )} - {step === 4 && ( - - )} - {step === 5 && ( - - )} - - - - ); -} diff --git a/参考/NexBox-main/installer/src/components/InstallerLayout.tsx b/参考/NexBox-main/installer/src/components/InstallerLayout.tsx deleted file mode 100644 index 1fdbd4f..0000000 --- a/参考/NexBox-main/installer/src/components/InstallerLayout.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import type { ReactNode } from "react"; -import { useTranslation } from "react-i18next"; - -interface InstallerLayoutProps { - currentStep: number; - children: ReactNode; - canGoBack?: boolean; - canGoNext?: boolean; - nextLabel?: string; - onBack?: () => void; - onNext?: () => void; - showCancel?: boolean; -} - -export default function InstallerLayout({ - children, - canGoBack = true, - canGoNext = true, - nextLabel, - onBack, - onNext, - showCancel = false, -}: InstallerLayoutProps) { - const { t } = useTranslation(); - - const handleCancel = () => { - if (window.confirm(t("安装未完成,确定要退出吗?"))) { - window.close(); - } - }; - - return ( -
-
-
- {children} -
-
- -
- {showCancel && ( - - )} - {onBack && ( - - )} - {onNext && ( - - )} -
-
- ); -} diff --git a/参考/NexBox-main/installer/src/components/StepIndicator.tsx b/参考/NexBox-main/installer/src/components/StepIndicator.tsx deleted file mode 100644 index 6213ff1..0000000 --- a/参考/NexBox-main/installer/src/components/StepIndicator.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useTranslation } from "react-i18next"; - -interface StepIndicatorProps { - currentStep: number; -} - -const steps = [ - "step_welcome", - "step_license", - "step_directory", - "step_install", - "step_finish", -] as const; - -export default function StepIndicator({ currentStep }: StepIndicatorProps) { - const { t } = useTranslation(); - - return ( -
- {steps.map((stepKey, index) => { - const stepNum = index + 1; - const isActive = currentStep === stepNum; - const isDone = currentStep > stepNum; - - return ( -
-
- {isDone ? "✓" : stepNum} -
-
{t(stepKey)}
-
- ); - })} -
- ); -} diff --git a/参考/NexBox-main/installer/src/components/TitleBar.tsx b/参考/NexBox-main/installer/src/components/TitleBar.tsx deleted file mode 100644 index 767c768..0000000 --- a/参考/NexBox-main/installer/src/components/TitleBar.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { getCurrentWindow } from "@tauri-apps/api/window"; -import { LuMinus, LuX } from "react-icons/lu"; -import { useCallback } from "react"; - -export default function TitleBar() { - const handleMouseDown = useCallback(async (e: React.MouseEvent) => { - const target = e.target as HTMLElement; - if (target.closest("button")) return; - try { - const appWindow = getCurrentWindow(); - await appWindow.startDragging(); - } catch { } - }, []); - - const handleMinimize = async () => { - try { - const appWindow = getCurrentWindow(); - await appWindow.minimize(); - } catch { } - }; - - const handleClose = async () => { - try { - const appWindow = getCurrentWindow(); - await appWindow.close(); - } catch { } - }; - - return ( -
-
-
- - -
-
- ); -} diff --git a/参考/NexBox-main/installer/src/i18n.ts b/参考/NexBox-main/installer/src/i18n.ts deleted file mode 100644 index aa29a40..0000000 --- a/参考/NexBox-main/installer/src/i18n.ts +++ /dev/null @@ -1,15 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import zh from "./locales/zh.json"; -import en from "./locales/en.json"; - -const lang = navigator.language.startsWith("zh") ? "zh" : "en"; - -i18n.use(initReactI18next).init({ - resources: { zh: { translation: zh }, en: { translation: en } }, - lng: lang, - fallbackLng: "zh", - interpolation: { escapeValue: false }, -}); - -export default i18n; diff --git a/参考/NexBox-main/installer/src/locales/LICENSE_EULA_zh.md b/参考/NexBox-main/installer/src/locales/LICENSE_EULA_zh.md deleted file mode 100644 index 78a5328..0000000 --- a/参考/NexBox-main/installer/src/locales/LICENSE_EULA_zh.md +++ /dev/null @@ -1,153 +0,0 @@ -# 新境盒(NexBox)最终用户许可协议 - -**版本:5.2.0** -**最后更新日期:2026年7月** - -*** - -## 重要提示 - -请仔细阅读本协议的全部条款和条件。安装或使用本软件即表示您同意受本协议的约束。如果您不同意本协议的任何条款,请不要安装或使用本软件。 - -*** - -## 一、软件许可 - -### 1.1 许可性质 - -本软件采用 **GNU 通用公共许可证第 3 版(GPL-3.0)** 发布,是自由软件。您可以在遵守 GPL-3.0 协议条款的前提下,自由地使用、复制、分发和修改本软件。 - -### 1.2 您的权利 - -根据 GPL-3.0 协议,您享有以下权利: - -- **使用自由**:您可以出于任何目的使用本软件,包括个人、教育、商业等用途 -- **复制自由**:您可以自由复制和分发本软件的副本 -- **修改自由**:您可以修改本软件的源代码,以适应您的需求 -- **分发修改版的自由**:您可以分发修改后的版本,但必须同样采用 GPL-3.0 协议 - -### 1.3 源代码获取 - -本软件的完整源代码可在以下地址获取: - -- GitHub 仓库: - -如果您通过二进制形式获得本软件,您有权根据 GPL-3.0 协议第 6 条的规定,以合理的成本获取完整的对应源代码。 - -*** - -## 二、用户义务 - -### 2.1 版权声明 - -您在分发本软件(无论是否经过修改)时,必须保留原始的版权声明和许可声明。 - -### 2.2 Copyleft 条款 - -如果您修改了本软件并进行分发,您必须: - -- 明确标注您对软件所做的修改 -- 以相同的 GPL-3.0 协议发布您的修改版本 -- 提供修改后版本的完整源代码 - -*** - -## 三、免责声明 - -### 3.1 无担保声明 - -本软件按"**原样**"(AS IS)提供,不提供任何明示或暗示的担保,包括但不限于: - -- 对适销性的暗示担保 -- 对特定用途适用性的暗示担保 -- 对非侵权性的暗示担保 - -### 3.2 责任限制 - -在法律允许的最大范围内,作者及贡献者不对因使用或无法使用本软件而导致的任何损害承担责任,包括但不限于: - -- 直接损害 -- 间接损害 -- 偶然损害 -- 特殊损害 -- 后果性损害 -- 利润损失 -- 数据丢失 -- 业务中断 - -### 3.3 使用风险 - -使用本软件的全部风险由您自行承担。本软件涉及系统级操作(如内存清理、注册表修改、系统优化等),虽然开发者已尽最大努力确保软件的安全性和稳定性,但仍无法完全排除意外情况。建议您在使用系统优化功能前备份重要数据。 - -*** - -## 四、第三方组件 - -本软件包含以下第三方开源组件,各组件受其各自许可证条款的约束: - -| 组件名称 | 许可证 | 说明 | -| ----------------------- | ---------------- | -------------- | -| Tauri | MIT / Apache-2.0 | 桌面应用框架 | -| LibreHardwareMonitorLib | MPL-2.0 | 硬件监控库 | -| WinDivert | LGPL-3.0 | 网络数据包捕获 | -| Wintun | GPL-2.0 / 商业 | 虚拟网络适配器 | -| NVIDIA NVAPI | NVIDIA 专有许可 | NVIDIA GPU API | -| React | MIT | 前端框架 | -| Rust 标准库 | MIT / Apache-2.0 | Rust 编程语言 | - -各第三方组件的完整许可证文本可在软件安装目录或相应开源项目网站中找到。 - -*** - -## 五、隐私声明 - -### 5.1 数据收集 - -本软件核心功能**纯本地运行**,不会主动收集或上传您的个人数据。以下功能可能涉及网络连接: - -- **自动更新检查**:仅检查版本信息,不上传个人数据 -- **公告获取**:从服务器获取软件公告信息 -- **改枪码平台**:用户提交的内容将上传至服务器 - -### 5.2 数据安全 - -我们重视您的隐私。本软件不会记录您的浏览历史、文件内容或其他个人敏感信息。 - -*** - -## 六、协议终止 - -### 6.1 自动终止 - -如果您违反本协议的任何条款,您的许可将自动终止。 - -### 6.2 终止后的义务 - -协议终止后,您必须停止使用本软件,并销毁您所持有的本软件的全部副本(包括安装文件、备份等)。 - -*** - -## 七、其他条款 - -### 7.1 协议修订 - -作者保留随时修订本协议的权利。修订后的协议将在软件更新时生效。 - -### 7.2 可分割性 - -如果本协议的任何条款被有管辖权的法院认定为无效或不可执行,该条款的无效不影响本协议其他条款的效力。 - -### 7.3 完整协议 - -本协议构成您与作者之间关于使用本软件的完整协议,并取代所有先前的口头或书面协议。 - -### 7.4 联系信息 - -如有任何问题或建议,可通过以下方式联系: - -- GitHub: -- 官方网站: - -*** - -**继续安装即表示您已阅读并同意本协议的全部条款。** diff --git a/参考/NexBox-main/installer/src/locales/en.json b/参考/NexBox-main/installer/src/locales/en.json deleted file mode 100644 index cb97f78..0000000 --- a/参考/NexBox-main/installer/src/locales/en.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "app_title": "NexBox Setup", - "app_name": "NexBox", - "app_description": "Game Toolkit for Modern Players", - - "step_welcome": "Welcome", - "step_license": "License", - "step_directory": "Directory", - "step_install": "Installing", - "step_finish": "Finish", - - "welcome_title": "Welcome to NexBox Setup", - "welcome_desc": "This wizard will guide you through installing NexBox, a system optimization toolkit designed for gamers.", - - "license_title": "License Agreement", - "license_desc": "Please read the following license agreement before installing.", - "license_agree": "I accept the agreement", - - "dir_title": "Choose Install Location", - "dir_desc": "Select the directory where NexBox will be installed.", - "dir_browse": "Browse", - "dir_space": "Available Space", - "dir_required": "Required Space", - - "install_title": "Installing", - "install_desc": "Please wait while NexBox is being installed...", - "install_copying": "Copying files...", - "install_shortcuts": "Creating shortcuts...", - "install_register": "Registering system information...", - "install_done": "Installation complete!", - - "finish_title": "Installation Complete", - "finish_desc": "NexBox has been successfully installed.", - "finish_launch": "Run NexBox", - "finish_desktop": "Create desktop shortcut", - "finish_done": "Finish", - - "btn_next": "Next", - "btn_back": "Back", - "btn_install": "Install", - "btn_cancel": "Cancel", - - "error_admin": "Administrator privileges required", - "error_space": "Insufficient disk space", - "error_generic": "An error occurred during installation" -} diff --git a/参考/NexBox-main/installer/src/locales/zh.json b/参考/NexBox-main/installer/src/locales/zh.json deleted file mode 100644 index b3446a5..0000000 --- a/参考/NexBox-main/installer/src/locales/zh.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "app_title": "新境盒 安装程序", - "app_name": "新境盒", - "app_description": "为现代玩家打造的游戏工具箱", - - "step_welcome": "欢迎", - "step_license": "许可协议", - "step_directory": "安装位置", - "step_install": "安装中", - "step_finish": "完成", - - "welcome_title": "欢迎安装 新境盒", - "welcome_desc": "本安装程序将引导您完成新境盒的安装过程。新境盒是一款专为游戏玩家打造的系统优化工具箱。", - - "license_title": "许可协议", - "license_desc": "请在安装前阅读以下许可协议。", - "license_agree": "我接受协议", - "license_required": "请先阅读并接受许可协议", - - "dir_title": "选择安装位置", - "dir_desc": "选择新境盒的安装目录。", - "dir_browse": "浏览", - "dir_space": "可用空间", - "dir_required": "所需空间", - - "install_title": "正在安装", - "install_desc": "正在安装新境盒,请稍候...", - "install_copying": "正在复制文件...", - "install_shortcuts": "正在创建快捷方式...", - "install_register": "正在注册系统信息...", - "install_done": "安装完成!", - - "finish_title": "安装完成", - "finish_desc": "新境盒已成功安装到您的计算机。", - "finish_launch": "运行 新境盒", - "finish_desktop": "创建桌面快捷方式", - "finish_done": "完成", - - "btn_next": "下一步", - "btn_back": "上一步", - "btn_install": "安装", - "btn_cancel": "取消", - - "error_admin": "需要管理员权限才能安装", - "error_space": "磁盘空间不足", - "error_generic": "安装过程中出现错误" -} diff --git a/参考/NexBox-main/installer/src/main.tsx b/参考/NexBox-main/installer/src/main.tsx deleted file mode 100644 index fc13010..0000000 --- a/参考/NexBox-main/installer/src/main.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom/client"; -import { ChakraProvider, extendTheme } from "@chakra-ui/react"; -import App from "./App"; -import "./i18n"; -import "./App.css"; - -const theme = extendTheme({ - styles: { - global: { - body: { - bg: "#ffffff", - color: "#1a202c", - }, - }, - }, - colors: { - brand: { - 50: "#eff6ff", - 100: "#dbeafe", - 200: "#bfdbfe", - 300: "#93c5fd", - 400: "#60a5fa", - 500: "#3b82f6", - 600: "#2563eb", - 700: "#1d4ed8", - 800: "#1e40af", - 900: "#1e3a8a", - }, - }, - config: { - initialColorMode: "light", - useSystemColorMode: false, - }, -}); - -ReactDOM.createRoot(document.getElementById("root")!).render( - - - - - -); diff --git a/参考/NexBox-main/installer/src/pages/FinishPage.tsx b/参考/NexBox-main/installer/src/pages/FinishPage.tsx deleted file mode 100644 index 6b7ff7b..0000000 --- a/参考/NexBox-main/installer/src/pages/FinishPage.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { useState } from "react"; -import { motion } from "framer-motion"; -import { useTranslation } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; -import { getCurrentWindow } from "@tauri-apps/api/window"; - -interface FinishPageProps { - targetDir: string; -} - -export default function FinishPage({ targetDir }: FinishPageProps) { - const { t } = useTranslation(); - const [launch, setLaunch] = useState(true); - - const handleFinish = async () => { - if (launch) { - try { - await invoke("launch_installed_app", { targetDir }); - } catch { } - } - try { - await getCurrentWindow().close(); - } catch { } - }; - - return ( - - - - - - - - - -

- {t("finish_title")} -

- -

- {t("finish_desc")} -

- - - - - {t("finish_done")} - -
- ); -} diff --git a/参考/NexBox-main/installer/src/pages/InstallingPage.tsx b/参考/NexBox-main/installer/src/pages/InstallingPage.tsx deleted file mode 100644 index 99160b2..0000000 --- a/参考/NexBox-main/installer/src/pages/InstallingPage.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { useEffect, useRef, useState } from "react"; -import { motion } from "framer-motion"; -import { useTranslation } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; - -interface InstallingPageProps { - targetDir: string; - createDesktopShortcut: boolean; - onComplete: () => void; - onError: (msg: string) => void; -} - -export default function InstallingPage({ - targetDir, - createDesktopShortcut, - onComplete, - onError, -}: InstallingPageProps) { - const { t } = useTranslation(); - const [progress, setProgress] = useState(0); - const [statusText, setStatusText] = useState(t("install_copying")); - const hasStarted = useRef(false); - - useEffect(() => { - if (hasStarted.current) return; - hasStarted.current = true; - - const doInstall = async () => { - try { - setStatusText(t("install_copying")); - for (let i = 0; i <= 70; i += 5) { - setProgress(i); - await new Promise((r) => setTimeout(r, 30)); - } - - await invoke("install", { - targetDir, - createDesktopShortcut, - }); - - setStatusText(t("install_shortcuts")); - for (let i = 70; i <= 85; i += 3) { - setProgress(i); - await new Promise((r) => setTimeout(r, 20)); - } - - setStatusText(t("install_register")); - for (let i = 85; i < 100; i += 2) { - setProgress(i); - await new Promise((r) => setTimeout(r, 15)); - } - - setProgress(100); - setStatusText(t("install_done")); - await new Promise((r) => setTimeout(r, 500)); - onComplete(); - } catch (err: any) { - onError(String(err)); - } - }; - - doInstall(); - }, []); - - return ( - -
-
-
-
-
- {progress}% -
-
- - - {statusText} - - - ); -} diff --git a/参考/NexBox-main/installer/src/pages/LicensePage.tsx b/参考/NexBox-main/installer/src/pages/LicensePage.tsx deleted file mode 100644 index 2454813..0000000 --- a/参考/NexBox-main/installer/src/pages/LicensePage.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import { useEffect } from "react"; -import { motion } from "framer-motion"; -import { useTranslation } from "react-i18next"; - -export default function LicensePage({ onAgreed }: { onAgreed: (v: boolean) => void }) { - const { t } = useTranslation(); - - useEffect(() => { - onAgreed(true); - }, [onAgreed]); - - return ( - -

{t("license_title")}

-

{t("license_desc")}

- -
-

新境盒(NexBox)最终用户许可协议

-

新境盒最新版本 · 最后更新日期:2026年7月

-
- -

重要提示

-

请仔细阅读本协议的全部条款和条件。安装或使用本软件即表示您同意受本协议的约束。如果您不同意本协议的任何条款,请不要安装或使用本软件。

-
- -

一、软件许可

-

1.1 许可性质

-

本软件采用 GNU 通用公共许可证第 3 版(GPL-3.0) 发布,是自由软件。您可以在遵守 GPL-3.0 协议条款的前提下,自由地使用、复制、分发和修改本软件。

- -

1.2 您的权利

-

根据 GPL-3.0 协议,您享有以下权利:

-

- 使用自由:您可以出于任何目的使用本软件,包括个人、教育、商业等用途

-

- 复制自由:您可以自由复制和分发本软件的副本

-

- 修改自由:您可以修改本软件的源代码,以适应您的需求

-

- 分发修改版的自由:您可以分发修改后的版本,但必须同样采用 GPL-3.0 协议

- -

1.3 源代码获取

-

本软件的完整源代码可在以下地址获取:

-

- GitHub 仓库:github.com/MuLiuSaMa/NexBox

-

如果您通过二进制形式获得本软件,您有权根据 GPL-3.0 协议第 6 条的规定,以合理的成本获取完整的对应源代码。

-
- -

二、用户义务

-

2.1 版权声明

-

您在分发本软件(无论是否经过修改)时,必须保留原始的版权声明和许可声明。

- -

2.2 Copyleft 条款

-

如果您修改了本软件并进行分发,您必须:

-

- 明确标注您对软件所做的修改

-

- 以相同的 GPL-3.0 协议发布您的修改版本

-

- 提供修改后版本的完整源代码

-
- -

三、免责声明

-

3.1 无担保声明

-

本软件按"原样"(AS IS)提供,不提供任何明示或暗示的担保,包括但不限于:

-

- 对适销性的暗示担保

-

- 对特定用途适用性的暗示担保

-

- 对非侵权性的暗示担保

- -

3.2 责任限制

-

在法律允许的最大范围内,作者及贡献者不对因使用或无法使用本软件而导致的任何损害承担责任,包括但不限于:直接损害、间接损害、偶然损害、特殊损害、后果性损害、利润损失、数据丢失、业务中断。

- -

3.3 使用风险

-

使用本软件的全部风险由您自行承担。本软件涉及系统级操作(如内存清理、注册表修改、系统优化等),虽然开发者已尽最大努力确保软件的安全性和稳定性,但仍无法完全排除意外情况。建议您在使用系统优化功能前备份重要数据。

-
- -

四、第三方组件

-

本软件包含以下第三方开源组件,各组件受其各自许可证条款的约束:

- - - - - - - - - - - - - - - - - -
组件名称许可证说明
TauriMIT / Apache-2.0桌面应用框架
LibreHardwareMonitorLibMPL-2.0硬件监控库
WinDivertLGPL-3.0网络数据包捕获
WintunGPL-2.0 / 商业虚拟网络适配器
NVIDIA NVAPINVIDIA 专有许可NVIDIA GPU API
ReactMIT前端框架
Rust 标准库MIT / Apache-2.0Rust 编程语言
-
- -

五、隐私声明

-

5.1 数据收集

-

本软件核心功能纯本地运行,不会主动收集或上传您的个人数据。以下功能可能涉及网络连接:

-

- 自动更新检查:仅检查版本信息,不上传个人数据

-

- 公告获取:从服务器获取软件公告信息

-

- 改枪码平台:用户提交的内容将上传至服务器

- -

5.2 数据安全

-

我们重视您的隐私。本软件不会记录您的浏览历史、文件内容或其他个人敏感信息。

-
- -

六、协议终止

-

6.1 自动终止

-

如果您违反本协议的任何条款,您的许可将自动终止。

- -

6.2 终止后的义务

-

协议终止后,您必须停止使用本软件,并销毁您所持有的本软件的全部副本(包括安装文件、备份等)。

-
- -

七、其他条款

-

7.1 协议修订

-

作者保留随时修订本协议的权利。修订后的协议将在软件更新时生效。

- -

7.2 可分割性

-

如果本协议的任何条款被有管辖权的法院认定为无效或不可执行,该条款的无效不影响本协议其他条款的效力。

- -

7.3 完整协议

-

本协议构成您与作者之间关于使用本软件的完整协议,并取代所有先前的口头或书面协议。

- -

7.4 联系信息

-

如有任何问题或建议,可通过以下方式联系:

-

- GitHub:github.com/MuLiuSaMa/NexBox

-

- 官方网站:www.nexbox.top

-
- -

继续安装即表示您已阅读并同意本协议的全部条款。

-
-
- ); -} diff --git a/参考/NexBox-main/installer/src/pages/SelectDirPage.tsx b/参考/NexBox-main/installer/src/pages/SelectDirPage.tsx deleted file mode 100644 index c53ebea..0000000 --- a/参考/NexBox-main/installer/src/pages/SelectDirPage.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import { useState, useEffect } from "react"; -import { motion } from "framer-motion"; -import { useTranslation } from "react-i18next"; -import { open } from "@tauri-apps/plugin-dialog"; -import { invoke } from "@tauri-apps/api/core"; - -interface SelectDirPageProps { - onDirChange: (dir: string) => void; - onValidChange: (valid: boolean) => void; - onShortcutChange?: (create: boolean) => void; - createDesktopShortcut?: boolean; -} - -const REQUIRED_SPACE = 80_000_000; - -function formatSize(bytes: number): string { - if (bytes >= 1_000_000_000) return (bytes / 1_000_000_000).toFixed(1) + " GB"; - if (bytes >= 1_000_000) return (bytes / 1_000_000).toFixed(0) + " MB"; - if (bytes >= 1_000) return (bytes / 1_000).toFixed(0) + " KB"; - return bytes + " B"; -} - -export default function SelectDirPage({ onDirChange, onValidChange, onShortcutChange, createDesktopShortcut = true }: SelectDirPageProps) { - const { t } = useTranslation(); - const [dir, setDir] = useState(""); - const [available, setAvailable] = useState(-1); - const [checking, setChecking] = useState(true); - - useEffect(() => { - invoke("get_default_install_path").then((path) => { - setDir(path); - onDirChange(path); - checkSpace(path); - }); - }, []); - - useEffect(() => { - const valid = available >= REQUIRED_SPACE; - onValidChange(valid); - }, [available]); - - const checkSpace = async (path: string) => { - try { - setChecking(true); - const space = await invoke("check_disk_space", { path }); - setAvailable(space); - } catch { - setAvailable(0); - } finally { - setChecking(false); - } - }; - - const handleBrowse = async () => { - try { - const selected = await open({ - directory: true, - multiple: false, - title: t("dir_title"), - }); - if (selected) { - const target = `${selected}\\NexBox`; - setDir(target); - onDirChange(target); - setAvailable(-1); - checkSpace(target); - } - } catch { } - }; - - const handleInputChange = (e: React.ChangeEvent) => { - const val = e.target.value; - setDir(val); - onDirChange(val); - setAvailable(-1); - checkSpace(val); - }; - - const enoughSpace = available >= REQUIRED_SPACE; - - return ( - -

{t("dir_title")}

-

{t("dir_desc")}

- -
-
{t("dir_title")}
-
- - -
-
- -
-
-
{t("dir_space")}
-
- {checking ? ( - - ) : ( - formatSize(available) - )} -
-
-
-
{t("dir_required")}
-
- {formatSize(REQUIRED_SPACE)} -
-
-
- - - - {!enoughSpace && !checking && ( -
- {t("error_space")} -
- )} -
- ); -} diff --git a/参考/NexBox-main/installer/src/pages/WelcomePage.tsx b/参考/NexBox-main/installer/src/pages/WelcomePage.tsx deleted file mode 100644 index be5ba43..0000000 --- a/参考/NexBox-main/installer/src/pages/WelcomePage.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { motion } from "framer-motion"; - -export default function WelcomePage() { - return ( - - - NexBox - NexBox - - - ); -} diff --git a/参考/NexBox-main/installer/src/vite-env.d.ts b/参考/NexBox-main/installer/src/vite-env.d.ts deleted file mode 100644 index 11f02fe..0000000 --- a/参考/NexBox-main/installer/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/参考/NexBox-main/installer/tsconfig.json b/参考/NexBox-main/installer/tsconfig.json deleted file mode 100644 index baad4d2..0000000 --- a/参考/NexBox-main/installer/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - "strict": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "noFallthroughCasesInSwitch": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "paths": { - "@/*": ["./src/*"] - } - }, - "include": ["src"] -} diff --git a/参考/NexBox-main/installer/tsconfig.node.json b/参考/NexBox-main/installer/tsconfig.node.json deleted file mode 100644 index 8e5b203..0000000 --- a/参考/NexBox-main/installer/tsconfig.node.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "lib": ["ES2023"], - "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["vite.config.ts"] -} diff --git a/参考/NexBox-main/installer/vite.config.ts b/参考/NexBox-main/installer/vite.config.ts deleted file mode 100644 index 8b4d3da..0000000 --- a/参考/NexBox-main/installer/vite.config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react"; -import path from "path"; - -const host = process.env.TAURI_DEV_HOST; - -export default defineConfig(async () => ({ - plugins: [react()], - resolve: { - alias: { - "@": path.resolve(__dirname, "./src"), - }, - }, - clearScreen: false, - server: { - port: 1420, - strictPort: true, - host: host || false, - hmr: host - ? { - protocol: "ws", - host, - port: 1421, - } - : undefined, - watch: { - ignored: ["**/src-tauri/**"], - }, - }, -})); diff --git a/参考/NexBox-main/monitor/BlackSharp.Core.dll b/参考/NexBox-main/monitor/BlackSharp.Core.dll deleted file mode 100644 index 90d145a..0000000 Binary files a/参考/NexBox-main/monitor/BlackSharp.Core.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/DiskInfoToolkit.dll b/参考/NexBox-main/monitor/DiskInfoToolkit.dll deleted file mode 100644 index b13ca72..0000000 Binary files a/参考/NexBox-main/monitor/DiskInfoToolkit.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/HidSharp.dll b/参考/NexBox-main/monitor/HidSharp.dll deleted file mode 100644 index 1d1d9ef..0000000 Binary files a/参考/NexBox-main/monitor/HidSharp.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/LibreHardwareMonitorLib.dll b/参考/NexBox-main/monitor/LibreHardwareMonitorLib.dll deleted file mode 100644 index d98c84a..0000000 Binary files a/参考/NexBox-main/monitor/LibreHardwareMonitorLib.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/Microsoft.Bcl.AsyncInterfaces.dll b/参考/NexBox-main/monitor/Microsoft.Bcl.AsyncInterfaces.dll deleted file mode 100644 index 6031ba1..0000000 Binary files a/参考/NexBox-main/monitor/Microsoft.Bcl.AsyncInterfaces.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/NexBoxMonitor.csproj b/参考/NexBox-main/monitor/NexBoxMonitor.csproj deleted file mode 100644 index adc5c12..0000000 --- a/参考/NexBox-main/monitor/NexBoxMonitor.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - Exe - net48 - x64 - NexBoxMonitor - NexBoxMonitor - enable - enable - latest - - - - - - - - - diff --git a/参考/NexBox-main/monitor/NexBoxMonitor.exe.config b/参考/NexBox-main/monitor/NexBoxMonitor.exe.config deleted file mode 100644 index f1f6ebd..0000000 --- a/参考/NexBox-main/monitor/NexBoxMonitor.exe.config +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/monitor/NexBoxMonitor.pdb b/参考/NexBox-main/monitor/NexBoxMonitor.pdb deleted file mode 100644 index bd1f8fe..0000000 Binary files a/参考/NexBox-main/monitor/NexBoxMonitor.pdb and /dev/null differ diff --git a/参考/NexBox-main/monitor/Program.cs b/参考/NexBox-main/monitor/Program.cs deleted file mode 100644 index a83cd22..0000000 --- a/参考/NexBox-main/monitor/Program.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.Text.Json; -using LibreHardwareMonitor.Hardware; - -namespace NexBoxMonitor; - -class Program -{ - private static Computer? _computer; - private static readonly SensorVisitor _visitor = new(_ => { }); - - static int Main(string[] args) - { - try - { - _computer = new Computer - { - IsCpuEnabled = true, - IsGpuEnabled = true, - IsMemoryEnabled = true, - IsMotherboardEnabled = true, - IsStorageEnabled = true, - IsNetworkEnabled = false, - IsControllerEnabled = false, - IsPsuEnabled = false, - }; - - _computer.Open(); - _computer.Accept(_visitor); - - var input = Console.In; - var output = Console.Out; - - while (true) - { - var line = input.ReadLine(); - if (line == null) - break; // parent closed stdin - - line = line.Trim(); - if (line.Length == 0) - continue; - - try - { - var cmd = JsonSerializer.Deserialize(line); - if (cmd?.Cmd == "read") - { - UpdateHardware(_computer.Hardware); - _computer.Accept(_visitor); - - var sensors = new List(); - CollectSensors(_computer.Hardware, sensors); - - var response = new SensorsResponse - { - UpdatedAt = DateTime.UtcNow.ToString("o"), - Sensors = sensors - }; - - var json = JsonSerializer.Serialize(response); - output.WriteLine(json); - output.Flush(); - } - else if (cmd?.Cmd == "exit") - { - break; - } - } - catch (JsonException) - { - // ignore malformed input - } - } - } - catch (Exception ex) - { - // Write error as JSON so parent can parse it - var error = JsonSerializer.Serialize(new { error = ex.Message }); - Console.WriteLine(error); - Console.Out.Flush(); - return 1; - } - finally - { - _computer?.Close(); - } - - return 0; - } - - static void CollectSensors(IEnumerable hardwareList, List sensors) - { - foreach (var hw in hardwareList) - { - // Recurse into sub-hardware (e.g. CPU cores, GPU fans) - if (hw.SubHardware.Length > 0) - { - CollectSensors(hw.SubHardware, sensors); - } - - foreach (var sensor in hw.Sensors) - { - if (!sensor.Value.HasValue) - continue; - - var reading = new SensorReading - { - Hardware = hw.Name, - HardwareType = hw.HardwareType.ToString(), - SubHardware = hw.SubHardware.Length > 0 ? hw.Name : null, - Name = sensor.Name, - SensorType = sensor.SensorType.ToString(), - Value = sensor.Value.Value, - Unit = GetUnit(sensor.SensorType) - }; - - sensors.Add(reading); - } - } - } - - static void UpdateHardware(IEnumerable hardwareList) - { - foreach (var hw in hardwareList) - { - hw.Update(); - if (hw.SubHardware.Length > 0) - UpdateHardware(hw.SubHardware); - } - } - - static string? GetUnit(SensorType type) - { - return type switch - { - SensorType.Voltage => "V", - SensorType.Clock => "MHz", - SensorType.Temperature => "°C", - SensorType.Load => "%", - SensorType.Fan => "RPM", - SensorType.Flow => "L/h", - SensorType.Control => "%", - SensorType.Level => "%", - SensorType.Power => "W", - SensorType.Data => "GB", - SensorType.SmallData => "MB", - SensorType.Factor => "", - SensorType.Frequency => "Hz", - SensorType.Throughput => "B/s", - SensorType.Current => "A", - SensorType.Energy => "mWh", - SensorType.Noise => "dBA", - SensorType.Humidity => "%", - SensorType.TimeSpan => "s", - _ => null - }; - } -} \ No newline at end of file diff --git a/参考/NexBox-main/monitor/RAMSPDToolkit-NDD.dll b/参考/NexBox-main/monitor/RAMSPDToolkit-NDD.dll deleted file mode 100644 index 49e7dc0..0000000 Binary files a/参考/NexBox-main/monitor/RAMSPDToolkit-NDD.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/SensorReader.cs b/参考/NexBox-main/monitor/SensorReader.cs deleted file mode 100644 index a1c8eac..0000000 --- a/参考/NexBox-main/monitor/SensorReader.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Text.Json.Serialization; - -namespace NexBoxMonitor; - -public class SensorReading -{ - [JsonPropertyName("hardware")] - public string Hardware { get; set; } = string.Empty; - - [JsonPropertyName("hardwareType")] - public string HardwareType { get; set; } = string.Empty; - - [JsonPropertyName("subHardware")] - public string? SubHardware { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } = string.Empty; - - [JsonPropertyName("sensorType")] - public string SensorType { get; set; } = string.Empty; - - [JsonPropertyName("value")] - public float Value { get; set; } - - [JsonPropertyName("unit")] - public string? Unit { get; set; } -} - -public class SensorsResponse -{ - [JsonPropertyName("updatedAt")] - public string UpdatedAt { get; set; } = string.Empty; - - [JsonPropertyName("sensors")] - public List Sensors { get; set; } = new(); -} - -public class ReadCommand -{ - [JsonPropertyName("cmd")] - public string Cmd { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/参考/NexBox-main/monitor/System.Buffers.dll b/参考/NexBox-main/monitor/System.Buffers.dll deleted file mode 100644 index 67a31fb..0000000 Binary files a/参考/NexBox-main/monitor/System.Buffers.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.CodeDom.dll b/参考/NexBox-main/monitor/System.CodeDom.dll deleted file mode 100644 index 0b78aed..0000000 Binary files a/参考/NexBox-main/monitor/System.CodeDom.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Memory.dll b/参考/NexBox-main/monitor/System.Memory.dll deleted file mode 100644 index 9b4f824..0000000 Binary files a/参考/NexBox-main/monitor/System.Memory.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Numerics.Vectors.dll b/参考/NexBox-main/monitor/System.Numerics.Vectors.dll deleted file mode 100644 index 95a6d99..0000000 Binary files a/参考/NexBox-main/monitor/System.Numerics.Vectors.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Runtime.CompilerServices.Unsafe.dll b/参考/NexBox-main/monitor/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index 7795684..0000000 Binary files a/参考/NexBox-main/monitor/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Security.AccessControl.dll b/参考/NexBox-main/monitor/System.Security.AccessControl.dll deleted file mode 100644 index fa87500..0000000 Binary files a/参考/NexBox-main/monitor/System.Security.AccessControl.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Security.Principal.Windows.dll b/参考/NexBox-main/monitor/System.Security.Principal.Windows.dll deleted file mode 100644 index 54f7829..0000000 Binary files a/参考/NexBox-main/monitor/System.Security.Principal.Windows.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Text.Encodings.Web.dll b/参考/NexBox-main/monitor/System.Text.Encodings.Web.dll deleted file mode 100644 index 3d16c7e..0000000 Binary files a/参考/NexBox-main/monitor/System.Text.Encodings.Web.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Text.Json.dll b/参考/NexBox-main/monitor/System.Text.Json.dll deleted file mode 100644 index 7405d75..0000000 Binary files a/参考/NexBox-main/monitor/System.Text.Json.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Threading.AccessControl.dll b/参考/NexBox-main/monitor/System.Threading.AccessControl.dll deleted file mode 100644 index ca6cd72..0000000 Binary files a/参考/NexBox-main/monitor/System.Threading.AccessControl.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.Threading.Tasks.Extensions.dll b/参考/NexBox-main/monitor/System.Threading.Tasks.Extensions.dll deleted file mode 100644 index eeec928..0000000 Binary files a/参考/NexBox-main/monitor/System.Threading.Tasks.Extensions.dll and /dev/null differ diff --git a/参考/NexBox-main/monitor/System.ValueTuple.dll b/参考/NexBox-main/monitor/System.ValueTuple.dll deleted file mode 100644 index 4ce28fd..0000000 Binary files a/参考/NexBox-main/monitor/System.ValueTuple.dll and /dev/null differ diff --git a/参考/NexBox-main/package-lock.json b/参考/NexBox-main/package-lock.json deleted file mode 100644 index 764a19a..0000000 --- a/参考/NexBox-main/package-lock.json +++ /dev/null @@ -1,7644 +0,0 @@ -{ - "name": "nexbox", - "version": "5.9.8", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "nexbox", - "version": "5.9.8", - "license": "GPL-3.0", - "dependencies": { - "@chakra-ui/react": "^2.10.9", - "@dnd-kit/core": "^6.3.1", - "@dnd-kit/sortable": "^10.0.0", - "@dnd-kit/utilities": "^3.2.2", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@tauri-apps/api": "^2.10.1", - "@tauri-apps/plugin-clipboard-manager": "^2.3.2", - "@tauri-apps/plugin-dialog": "^2.7.1", - "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-process": "^2.3.1", - "@tauri-apps/plugin-shell": "^2.3.5", - "@tauri-apps/plugin-store": "^2.4.3", - "framer-motion": "^11.18.2", - "i18next": "^26.0.5", - "i18next-browser-languagedetector": "^8.2.1", - "lucide-react": "^0.487.0", - "qrcode.react": "^4.2.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-i18next": "^17.0.4", - "react-icons": "^5.6.0", - "react-router-dom": "^7.1.5", - "zustand": "^5.0.2" - }, - "devDependencies": { - "@emotion/babel-plugin": "^11.13.5", - "@eslint/eslintrc": "^3.3.0", - "@tauri-apps/cli": "^2.10.1", - "@types/node": "^22.13.10", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "eslint": "^9.22.0", - "eslint-config-next": "^15.2.4", - "husky": "^9.1.7", - "prettier": "^3.5.3", - "typescript": "^5.8.2", - "vite": "^6.0.11" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", - "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.28.5", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", - "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-compilation-targets": "^7.28.6", - "@babel/helper-module-transforms": "^7.28.6", - "@babel/helpers": "^7.28.6", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/traverse": "^7.29.0", - "@babel/types": "^7.29.0", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/generator": { - "version": "7.29.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", - "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.0", - "@babel/types": "^7.29.0", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", - "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", - "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.28.6", - "@babel/types": "^7.28.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", - "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.28.6", - "@babel/helper-validator-identifier": "^7.28.5", - "@babel/traverse": "^7.28.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", - "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", - "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.0" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", - "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", - "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", - "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", - "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.28.6", - "@babel/parser": "^7.28.6", - "@babel/types": "^7.28.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", - "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@chakra-ui/anatomy": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/anatomy/-/anatomy-2.3.6.tgz", - "integrity": "sha512-TjmjyQouIZzha/l8JxdBZN1pKZTj7sLpJ0YkFnQFyqHcbfWggW9jKWzY1E0VBnhtFz/xF3KC6UAVuZVSJx+y0g==", - "license": "MIT" - }, - "node_modules/@chakra-ui/hooks": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/hooks/-/hooks-2.4.5.tgz", - "integrity": "sha512-601fWfHE2i7UjaxK/9lDLlOni6vk/I+04YDbM0BrelJy+eqxdlOmoN8Z6MZ3PzFh7ofERUASor+vL+/HaCaZ7w==", - "license": "MIT", - "dependencies": { - "@chakra-ui/utils": "2.2.5", - "@zag-js/element-size": "0.31.1", - "copy-to-clipboard": "3.3.3", - "framesync": "6.1.2" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react": { - "version": "2.10.9", - "resolved": "https://registry.npmjs.org/@chakra-ui/react/-/react-2.10.9.tgz", - "integrity": "sha512-lhdcgoocOiURwBNR3L8OioCNIaGCZqRfuKioLyaQLjOanl4jr0PQclsGb+w0cmito252vEWpsz2xRqF7y+Flrw==", - "license": "MIT", - "dependencies": { - "@chakra-ui/hooks": "2.4.5", - "@chakra-ui/styled-system": "2.12.4", - "@chakra-ui/theme": "3.4.9", - "@chakra-ui/utils": "2.2.5", - "@popperjs/core": "^2.11.8", - "@zag-js/focus-visible": "^0.31.1", - "aria-hidden": "^1.2.3", - "react-fast-compare": "3.2.2", - "react-focus-lock": "^2.9.6", - "react-remove-scroll": "^2.5.7" - }, - "peerDependencies": { - "@emotion/react": ">=11", - "@emotion/styled": ">=11", - "framer-motion": ">=4.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/styled-system": { - "version": "2.12.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/styled-system/-/styled-system-2.12.4.tgz", - "integrity": "sha512-oa07UG7Lic5hHSQtGRiMEnYjuhIa8lszyuVhZjZqR2Ap3VMF688y1MVPJ1pK+8OwY5uhXBgVd5c0+rI8aBZlwg==", - "license": "MIT", - "dependencies": { - "@chakra-ui/utils": "2.2.5", - "csstype": "^3.1.2" - } - }, - "node_modules/@chakra-ui/theme": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/@chakra-ui/theme/-/theme-3.4.9.tgz", - "integrity": "sha512-GAom2SjSdRWTcX76/2yJOFJsOWHQeBgaynCUNBsHq62OafzvELrsSHDUw0bBqBb1c2ww0CclIvGilPup8kXBFA==", - "license": "MIT", - "dependencies": { - "@chakra-ui/anatomy": "2.3.6", - "@chakra-ui/theme-tools": "2.2.9", - "@chakra-ui/utils": "2.2.5" - }, - "peerDependencies": { - "@chakra-ui/styled-system": ">=2.8.0" - } - }, - "node_modules/@chakra-ui/theme-tools": { - "version": "2.2.9", - "resolved": "https://registry.npmjs.org/@chakra-ui/theme-tools/-/theme-tools-2.2.9.tgz", - "integrity": "sha512-PcbYL19lrVvEc7Oydy//jsy/MO/rZz1DvLyO6AoI+bI/+Kwz9WfOKsspbulEhRg5COayE0R/IZPsskXZ7Mp4bA==", - "license": "MIT", - "dependencies": { - "@chakra-ui/anatomy": "2.3.6", - "@chakra-ui/utils": "2.2.5", - "color2k": "^2.0.2" - }, - "peerDependencies": { - "@chakra-ui/styled-system": ">=2.0.0" - } - }, - "node_modules/@chakra-ui/utils": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/utils/-/utils-2.2.5.tgz", - "integrity": "sha512-KTBCK+M5KtXH6p54XS39ImQUMVtAx65BoZDoEms3LuObyTo1+civ1sMm4h3nRT320U6H5H7D35WnABVQjqU/4g==", - "license": "MIT", - "dependencies": { - "@types/lodash.mergewith": "4.6.9", - "lodash.mergewith": "4.6.2" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@dnd-kit/accessibility": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", - "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@dnd-kit/core": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", - "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", - "license": "MIT", - "dependencies": { - "@dnd-kit/accessibility": "^3.1.1", - "@dnd-kit/utilities": "^3.2.2", - "tslib": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@dnd-kit/sortable": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@dnd-kit/sortable/-/sortable-10.0.0.tgz", - "integrity": "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg==", - "license": "MIT", - "dependencies": { - "@dnd-kit/utilities": "^3.2.2", - "tslib": "^2.0.0" - }, - "peerDependencies": { - "@dnd-kit/core": "^6.3.0", - "react": ">=16.8.0" - } - }, - "node_modules/@dnd-kit/utilities": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@dnd-kit/utilities/-/utilities-3.2.2.tgz", - "integrity": "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emnapi/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", - "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", - "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emotion/babel-plugin": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", - "integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==", - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/runtime": "^7.18.3", - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/serialize": "^1.3.3", - "babel-plugin-macros": "^3.1.0", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/cache": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", - "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/hash": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", - "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", - "license": "MIT" - }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", - "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.9.0" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "license": "MIT" - }, - "node_modules/@emotion/react": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", - "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.14.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2", - "@emotion/weak-memoize": "^0.4.0", - "hoist-non-react-statics": "^3.3.1" - }, - "peerDependencies": { - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/serialize": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", - "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", - "license": "MIT", - "dependencies": { - "@emotion/hash": "^0.9.2", - "@emotion/memoize": "^0.9.0", - "@emotion/unitless": "^0.10.0", - "@emotion/utils": "^1.4.2", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/sheet": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", - "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", - "license": "MIT" - }, - "node_modules/@emotion/styled": { - "version": "11.14.1", - "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", - "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.13.5", - "@emotion/is-prop-valid": "^1.3.0", - "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", - "@emotion/utils": "^1.4.2" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0-rc.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/unitless": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", - "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", - "license": "MIT" - }, - "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", - "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", - "license": "MIT", - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emotion/utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", - "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", - "license": "MIT" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", - "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", - "license": "MIT" - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", - "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.7", - "debug": "^4.3.1", - "minimatch": "^3.1.5" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", - "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", - "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.14.0", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.1", - "minimatch": "^3.1.5", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "9.39.4", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", - "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", - "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", - "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", - "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/types": "^0.15.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", - "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.2", - "@humanfs/types": "^0.15.0", - "@humanwhocodes/retry": "^0.4.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/types": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", - "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@napi-rs/wasm-runtime": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", - "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "^1.4.3", - "@emnapi/runtime": "^1.4.3", - "@tybys/wasm-util": "^0.10.0" - } - }, - "node_modules/@next/eslint-plugin-next": { - "version": "15.5.15", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.15.tgz", - "integrity": "sha512-ExQoBfyKMjAUQ2nuF39ryQsG26H374ZfH13dlOZqf6TaE9ycRbIm+qUbUFCliU4BtQhiqtS7cnGA1yWfPMQ+jA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-glob": "3.3.1" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.4.0" - } - }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-beta.27", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", - "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", - "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", - "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", - "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", - "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", - "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", - "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", - "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", - "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", - "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", - "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", - "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", - "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", - "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", - "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", - "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", - "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", - "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", - "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", - "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", - "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", - "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", - "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", - "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", - "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", - "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rushstack/eslint-patch": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.16.1.tgz", - "integrity": "sha512-TvZbIpeKqGQQ7X0zSCvPH9riMSFQFSggnfBjFZ1mEoILW+UuXCKwOoPcgjMwiUtRqFZ8jWhPJc4um14vC6I4ag==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tauri-apps/api": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.11.0.tgz", - "integrity": "sha512-7CinYODhky9lmO23xHnUFv0Xt43fbtWMyxZcLcRBlFkcgXKuEirBvHpmtJ89YMhyeGcq20Wuc47Fa4XjyniywA==", - "license": "Apache-2.0 OR MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/tauri" - } - }, - "node_modules/@tauri-apps/cli": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.10.1.tgz", - "integrity": "sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g==", - "dev": true, - "license": "Apache-2.0 OR MIT", - "bin": { - "tauri": "tauri.js" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/tauri" - }, - "optionalDependencies": { - "@tauri-apps/cli-darwin-arm64": "2.10.1", - "@tauri-apps/cli-darwin-x64": "2.10.1", - "@tauri-apps/cli-linux-arm-gnueabihf": "2.10.1", - "@tauri-apps/cli-linux-arm64-gnu": "2.10.1", - "@tauri-apps/cli-linux-arm64-musl": "2.10.1", - "@tauri-apps/cli-linux-riscv64-gnu": "2.10.1", - "@tauri-apps/cli-linux-x64-gnu": "2.10.1", - "@tauri-apps/cli-linux-x64-musl": "2.10.1", - "@tauri-apps/cli-win32-arm64-msvc": "2.10.1", - "@tauri-apps/cli-win32-ia32-msvc": "2.10.1", - "@tauri-apps/cli-win32-x64-msvc": "2.10.1" - } - }, - "node_modules/@tauri-apps/cli-darwin-arm64": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.10.1.tgz", - "integrity": "sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-darwin-x64": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.10.1.tgz", - "integrity": "sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.10.1.tgz", - "integrity": "sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm64-gnu": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.10.1.tgz", - "integrity": "sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-arm64-musl": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.10.1.tgz", - "integrity": "sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.10.1.tgz", - "integrity": "sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-x64-gnu": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.10.1.tgz", - "integrity": "sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-linux-x64-musl": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.10.1.tgz", - "integrity": "sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-arm64-msvc": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.10.1.tgz", - "integrity": "sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-ia32-msvc": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.10.1.tgz", - "integrity": "sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/cli-win32-x64-msvc": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.10.1.tgz", - "integrity": "sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 OR MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tauri-apps/plugin-clipboard-manager": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-clipboard-manager/-/plugin-clipboard-manager-2.3.2.tgz", - "integrity": "sha512-CUlb5Hqi2oZbcZf4VUyUH53XWPPdtpw43EUpCza5HWZJwxEoDowFzNUDt1tRUXA8Uq+XPn17Ysfptip33sG4eQ==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.8.0" - } - }, - "node_modules/@tauri-apps/plugin-dialog": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.7.1.tgz", - "integrity": "sha512-OK1UBXYt+ojcmxMktzzuyonYIFta8CmAASpX+CA+DTGK24KlHjhYI6x2iOJ/TjZF4N7/ACK1oFmEOjIY9IhzOQ==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.11.0" - } - }, - "node_modules/@tauri-apps/plugin-opener": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.5.4.tgz", - "integrity": "sha512-1HnPkb+AmgO29HBazm4uPLKB+r7zzcTBW1d0fyYp1uP+jwtpoiNDGKMMzz58SFp49nOIrxdE3aUJtT57lfO9CQ==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.11.0" - } - }, - "node_modules/@tauri-apps/plugin-process": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-process/-/plugin-process-2.3.1.tgz", - "integrity": "sha512-nCa4fGVaDL/B9ai03VyPOjfAHRHSBz5v6F/ObsB73r/dA3MHHhZtldaDMIc0V/pnUw9ehzr2iEG+XkSEyC0JJA==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.8.0" - } - }, - "node_modules/@tauri-apps/plugin-shell": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-shell/-/plugin-shell-2.3.5.tgz", - "integrity": "sha512-jewtULhiQ7lI7+owCKAjc8tYLJr92U16bPOeAa472LHJdgaibLP83NcfAF2e+wkEcA53FxKQAZ7byDzs2eeizg==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.10.1" - } - }, - "node_modules/@tauri-apps/plugin-store": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-store/-/plugin-store-2.4.3.tgz", - "integrity": "sha512-9LWPj9yMphRi9czEtUv87XHbl1b6xgd9EXpPrUnq6nG7+nbtoF84d4Kwz9xhAv/Hf30sr58pq7EOlyI936y8qw==", - "license": "MIT OR Apache-2.0", - "dependencies": { - "@tauri-apps/api": "^2.11.0" - } - }, - "node_modules/@tybys/wasm-util": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", - "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/lodash": { - "version": "4.17.24", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.24.tgz", - "integrity": "sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==", - "license": "MIT" - }, - "node_modules/@types/lodash.mergewith": { - "version": "4.6.9", - "resolved": "https://registry.npmjs.org/@types/lodash.mergewith/-/lodash.mergewith-4.6.9.tgz", - "integrity": "sha512-fgkoCAOF47K7sxrQ7Mlud2TH023itugZs2bUg8h/KzT+BnZNrR2jAOmaokbLunHNnobXVWOezAeNn/lZqwxkcw==", - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/node": { - "version": "22.19.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", - "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/@types/parse-json": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", - "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "19.2.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", - "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.2.2" - } - }, - "node_modules/@types/react-dom": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", - "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^19.2.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.2.tgz", - "integrity": "sha512-aC2qc5thQahutKjP+cl8cgN9DWe3ZUqVko30CMSZHnFEHyhOYoZSzkGtAI2mcwZ38xeImDucI4dnqsHiOYuuCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.58.2", - "@typescript-eslint/type-utils": "8.58.2", - "@typescript-eslint/utils": "8.58.2", - "@typescript-eslint/visitor-keys": "8.58.2", - "ignore": "^7.0.5", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.58.2", - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.58.2.tgz", - "integrity": "sha512-/Zb/xaIDfxeJnvishjGdcR4jmr7S+bda8PKNhRGdljDM+elXhlvN0FyPSsMnLmJUrVG9aPO6dof80wjMawsASg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.58.2", - "@typescript-eslint/types": "8.58.2", - "@typescript-eslint/typescript-estree": "8.58.2", - "@typescript-eslint/visitor-keys": "8.58.2", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.58.2.tgz", - "integrity": "sha512-Cq6UfpZZk15+r87BkIh5rDpi38W4b+Sjnb8wQCPPDDweS/LRCFjCyViEbzHk5Ck3f2QDfgmlxqSa7S7clDtlfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.58.2", - "@typescript-eslint/types": "^8.58.2", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.58.2.tgz", - "integrity": "sha512-SgmyvDPexWETQek+qzZnrG6844IaO02UVyOLhI4wpo82dpZJY9+6YZCKAMFzXb7qhx37mFK1QcPQ18tud+vo6Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.58.2", - "@typescript-eslint/visitor-keys": "8.58.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.2.tgz", - "integrity": "sha512-3SR+RukipDvkkKp/d0jP0dyzuls3DbGmwDpVEc5wqk5f38KFThakqAAO0XMirWAE+kT00oTauTbzMFGPoAzB0A==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.58.2.tgz", - "integrity": "sha512-Z7EloNR/B389FvabdGeTo2XMs4W9TjtPiO9DAsmT0yom0bwlPyRjkJ1uCdW1DvrrrYP50AJZ9Xc3sByZA9+dcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.58.2", - "@typescript-eslint/typescript-estree": "8.58.2", - "@typescript-eslint/utils": "8.58.2", - "debug": "^4.4.3", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.58.2.tgz", - "integrity": "sha512-9TukXyATBQf/Jq9AMQXfvurk+G5R2MwfqQGDR2GzGz28HvY/lXNKGhkY+6IOubwcquikWk5cjlgPvD2uAA7htQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.58.2.tgz", - "integrity": "sha512-ELGuoofuhhoCvNbQjFFiobFcGgcDCEm0ThWdmO4Z0UzLqPXS3KFvnEZ+SHewwOYHjM09tkzOWXNTv9u6Gqtyuw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.58.2", - "@typescript-eslint/tsconfig-utils": "8.58.2", - "@typescript-eslint/types": "8.58.2", - "@typescript-eslint/visitor-keys": "8.58.2", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.58.2.tgz", - "integrity": "sha512-QZfjHNEzPY8+l0+fIXMvuQ2sJlplB4zgDZvA+NmvZsZv3EQwOcc1DuIU1VJUTWZ/RKouBMhDyNaBMx4sWvrzRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.58.2", - "@typescript-eslint/types": "8.58.2", - "@typescript-eslint/typescript-estree": "8.58.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.58.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.58.2.tgz", - "integrity": "sha512-f1WO2Lx8a9t8DARmcWAUPJbu0G20bJlj8L4z72K00TMeJAoyLr/tHhI/pzYBLrR4dXWkcxO1cWYZEOX8DKHTqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.58.2", - "eslint-visitor-keys": "^5.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", - "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@unrs/resolver-binding-android-arm-eabi": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", - "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@unrs/resolver-binding-android-arm64": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", - "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@unrs/resolver-binding-darwin-arm64": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", - "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@unrs/resolver-binding-darwin-x64": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", - "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@unrs/resolver-binding-freebsd-x64": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", - "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", - "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", - "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", - "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-arm64-musl": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", - "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", - "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", - "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", - "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", - "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==", - "cpu": [ - "s390x" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-x64-gnu": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", - "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-linux-x64-musl": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", - "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@unrs/resolver-binding-wasm32-wasi": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", - "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@napi-rs/wasm-runtime": "^0.2.11" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", - "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", - "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@unrs/resolver-binding-win32-x64-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", - "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@vitejs/plugin-react": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", - "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.28.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-beta.27", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.17.0" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" - } - }, - "node_modules/@zag-js/dom-query": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@zag-js/dom-query/-/dom-query-0.31.1.tgz", - "integrity": "sha512-oiuohEXAXhBxpzzNm9k2VHGEOLC1SXlXSbRPcfBZ9so5NRQUA++zCE7cyQJqGLTZR0t3itFLlZqDbYEXRrefwg==", - "license": "MIT" - }, - "node_modules/@zag-js/element-size": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@zag-js/element-size/-/element-size-0.31.1.tgz", - "integrity": "sha512-4T3yvn5NqqAjhlP326Fv+w9RqMIBbNN9H72g5q2ohwzhSgSfZzrKtjL4rs9axY/cw9UfMfXjRjEE98e5CMq7WQ==", - "license": "MIT" - }, - "node_modules/@zag-js/focus-visible": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@zag-js/focus-visible/-/focus-visible-0.31.1.tgz", - "integrity": "sha512-dbLksz7FEwyFoANbpIlNnd3bVm0clQSUsnP8yUVQucStZPsuWjCrhL2jlAbGNrTrahX96ntUMXHb/sM68TibFg==", - "license": "MIT", - "dependencies": { - "@zag-js/dom-query": "0.31.1" - } - }, - "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", - "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", - "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/aria-query": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", - "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-includes": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", - "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.24.0", - "es-object-atoms": "^1.1.1", - "get-intrinsic": "^1.3.0", - "is-string": "^1.1.1", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlast": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", - "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", - "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.9", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "es-shim-unscopables": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", - "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", - "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.tosorted": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", - "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", - "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ast-types-flow": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", - "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/async-function": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", - "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/axe-core": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.11.3.tgz", - "integrity": "sha512-zBQouZixDTbo3jMGqHKyePxYxr1e5W8UdTmBQ7sNtaA9M2bE32daxxPLS/jojhKOHxQ7LWwPjfiwf/fhaJWzlg==", - "dev": true, - "license": "MPL-2.0", - "engines": { - "node": ">=4" - } - }, - "node_modules/axobject-query": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", - "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/babel-plugin-macros": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", - "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5", - "cosmiconfig": "^7.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">=10", - "npm": ">=6" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.19", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.19.tgz", - "integrity": "sha512-qCkNLi2sfBOn8XhZQ0FXsT1Ki/Yo5P90hrkRamVFRS7/KV9hpfA4HkoWNU152+8w0zPjnxo5psx5NL3PSGgv5g==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", - "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.28.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", - "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.10.12", - "caniuse-lite": "^1.0.30001782", - "electron-to-chromium": "^1.5.328", - "node-releases": "^2.0.36", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/call-bind": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", - "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "get-intrinsic": "^1.3.0", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001788", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001788.tgz", - "integrity": "sha512-6q8HFp+lOQtcf7wBK+uEenxymVWkGKkjFpCvw5W25cmMwEDU45p1xQFBQv8JDlMMry7eNxyBaR+qxgmTUZkIRQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/color2k": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.3.tgz", - "integrity": "sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog==", - "license": "MIT" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "license": "MIT" - }, - "node_modules/cookie": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", - "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/copy-to-clipboard": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", - "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", - "license": "MIT", - "dependencies": { - "toggle-selection": "^1.0.6" - } - }, - "node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "license": "MIT", - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cosmiconfig/node_modules/yaml": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", - "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "license": "MIT" - }, - "node_modules/damerau-levenshtein": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", - "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/data-view-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", - "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", - "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/inspect-js" - } - }, - "node_modules/data-view-byte-offset": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", - "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "license": "MIT" - }, - "node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.340", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.340.tgz", - "integrity": "sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==", - "dev": true, - "license": "ISC" - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/error-ex": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", - "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-abstract": { - "version": "1.24.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz", - "integrity": "sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.2", - "arraybuffer.prototype.slice": "^1.0.4", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "data-view-buffer": "^1.0.2", - "data-view-byte-length": "^1.0.2", - "data-view-byte-offset": "^1.0.1", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "es-set-tostringtag": "^2.1.0", - "es-to-primitive": "^1.3.0", - "function.prototype.name": "^1.1.8", - "get-intrinsic": "^1.3.0", - "get-proto": "^1.0.1", - "get-symbol-description": "^1.1.0", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "internal-slot": "^1.1.0", - "is-array-buffer": "^3.0.5", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.2", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.2.1", - "is-set": "^2.0.3", - "is-shared-array-buffer": "^1.0.4", - "is-string": "^1.1.1", - "is-typed-array": "^1.1.15", - "is-weakref": "^1.1.1", - "math-intrinsics": "^1.1.0", - "object-inspect": "^1.13.4", - "object-keys": "^1.1.1", - "object.assign": "^4.1.7", - "own-keys": "^1.0.1", - "regexp.prototype.flags": "^1.5.4", - "safe-array-concat": "^1.1.3", - "safe-push-apply": "^1.0.0", - "safe-regex-test": "^1.1.0", - "set-proto": "^1.0.0", - "stop-iteration-iterator": "^1.1.0", - "string.prototype.trim": "^1.2.10", - "string.prototype.trimend": "^1.0.9", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.3", - "typed-array-byte-length": "^1.0.3", - "typed-array-byte-offset": "^1.0.4", - "typed-array-length": "^1.0.7", - "unbox-primitive": "^1.1.0", - "which-typed-array": "^1.1.19" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-iterator-helpers": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.3.2.tgz", - "integrity": "sha512-HVLACW1TppGYjJ8H6/jqH/pqOtKRw6wMlrB23xfExmFWxFquAIWCmwoLsOyN96K4a5KbmOf5At9ZUO3GZbetAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.9", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.24.2", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.1.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.3.0", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "iterator.prototype": "^1.1.5", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", - "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-to-primitive": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", - "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7", - "is-date-object": "^1.0.5", - "is-symbol": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "9.39.4", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", - "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.2", - "@eslint/config-helpers": "^0.4.2", - "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.5", - "@eslint/js": "9.39.4", - "@eslint/plugin-kit": "^0.4.1", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.14.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.5", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-config-next": { - "version": "15.5.15", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.5.15.tgz", - "integrity": "sha512-mI5KIONOIosjF3jK2z9a8fY2LePNeW5C4lRJ+XZoJHAKkwx2MQjMPQ2/kL7tsMRPcQPZc/UBtCfqxElluL1CBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@next/eslint-plugin-next": "15.5.15", - "@rushstack/eslint-patch": "^1.10.3", - "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^3.5.2", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-jsx-a11y": "^6.10.0", - "eslint-plugin-react": "^7.37.0", - "eslint-plugin-react-hooks": "^5.0.0" - }, - "peerDependencies": { - "eslint": "^7.23.0 || ^8.0.0 || ^9.0.0", - "typescript": ">=3.3.1" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.10", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.10.tgz", - "integrity": "sha512-tRrKqFyCaKict5hOd244sL6EQFNycnMQnBe+j8uqGNXYzsImGbGUU4ibtoaBmv5FLwJwcFJNeg1GeVjQfbMrDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.16.1", - "resolve": "^2.0.0-next.6" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/resolve": { - "version": "2.0.0-next.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.6.tgz", - "integrity": "sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "node-exports-info": "^1.6.0", - "object-keys": "^1.1.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/eslint-import-resolver-typescript": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.10.1.tgz", - "integrity": "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@nolyfill/is-core-module": "1.0.39", - "debug": "^4.4.0", - "get-tsconfig": "^4.10.0", - "is-bun-module": "^2.0.0", - "stable-hash": "^0.0.5", - "tinyglobby": "^0.2.13", - "unrs-resolver": "^1.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-import-resolver-typescript" - }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*", - "eslint-plugin-import-x": "*" - }, - "peerDependenciesMeta": { - "eslint-plugin-import": { - "optional": true - }, - "eslint-plugin-import-x": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", - "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", - "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.9", - "array.prototype.findlastindex": "^1.2.6", - "array.prototype.flat": "^1.3.3", - "array.prototype.flatmap": "^1.3.3", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.12.1", - "hasown": "^2.0.2", - "is-core-module": "^2.16.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.1", - "semver": "^6.3.1", - "string.prototype.trimend": "^1.0.9", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", - "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "aria-query": "^5.3.2", - "array-includes": "^3.1.8", - "array.prototype.flatmap": "^1.3.2", - "ast-types-flow": "^0.0.8", - "axe-core": "^4.10.0", - "axobject-query": "^4.1.0", - "damerau-levenshtein": "^1.0.8", - "emoji-regex": "^9.2.2", - "hasown": "^2.0.2", - "jsx-ast-utils": "^3.3.5", - "language-tags": "^1.0.9", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "safe-regex-test": "^1.0.3", - "string.prototype.includes": "^2.0.1" - }, - "engines": { - "node": ">=4.0" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" - } - }, - "node_modules/eslint-plugin-react": { - "version": "7.37.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", - "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.8", - "array.prototype.findlast": "^1.2.5", - "array.prototype.flatmap": "^1.3.3", - "array.prototype.tosorted": "^1.1.4", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.2.1", - "estraverse": "^5.3.0", - "hasown": "^2.0.2", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.9", - "object.fromentries": "^2.0.8", - "object.values": "^1.2.1", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.12", - "string.prototype.repeat": "^1.0.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" - } - }, - "node_modules/eslint-plugin-react-hooks": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", - "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" - } - }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.6.tgz", - "integrity": "sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "node-exports-info": "^1.6.0", - "object-keys": "^1.1.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/eslint-scope": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", - "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", - "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "license": "MIT" - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", - "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", - "dev": true, - "license": "ISC" - }, - "node_modules/focus-lock": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/focus-lock/-/focus-lock-1.3.6.tgz", - "integrity": "sha512-Ik/6OCk9RQQ0T5Xw+hKNLWrjSMtv51dD4GRmJjbD5a58TIEpI5a5iXagKVl3Z5UuyslMCA8Xwnu76jQob62Yhg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/framer-motion": { - "version": "11.18.2", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.2.tgz", - "integrity": "sha512-5F5Och7wrvtLVElIpclDT0CBzMVg3dL22B64aZwHtsIY8RB4mXICLrkajK4G9R+ieSAGcgrLeae2SeUTg2pr6w==", - "license": "MIT", - "dependencies": { - "motion-dom": "^11.18.1", - "motion-utils": "^11.18.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "@emotion/is-prop-valid": "*", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@emotion/is-prop-valid": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - } - }, - "node_modules/framesync": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/framesync/-/framesync-6.1.2.tgz", - "integrity": "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g==", - "license": "MIT", - "dependencies": { - "tslib": "2.4.0" - } - }, - "node_modules/framesync/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "license": "0BSD" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/function.prototype.name": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", - "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "functions-have-names": "^1.2.3", - "hasown": "^2.0.2", - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/generator-function": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", - "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-nonce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", - "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-symbol-description": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", - "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-tsconfig": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", - "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", - "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", - "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/html-parse-stringify": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", - "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", - "license": "MIT", - "dependencies": { - "void-elements": "3.1.0" - } - }, - "node_modules/husky": { - "version": "9.1.7", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", - "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", - "dev": true, - "license": "MIT", - "bin": { - "husky": "bin.js" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, - "node_modules/i18next": { - "version": "26.0.5", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.0.5.tgz", - "integrity": "sha512-9uHb4T27TdV36phJXcbpnRPt5yzAfqHXVrdASvmHZyPuZJtrLythd+GyXhiaHV5LlpuuskbAqhwPjmfTbKbi8w==", - "funding": [ - { - "type": "individual", - "url": "https://www.locize.com/i18next" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - }, - { - "type": "individual", - "url": "https://www.locize.com" - } - ], - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.29.2" - }, - "peerDependencies": { - "typescript": "^5 || ^6" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/i18next-browser-languagedetector": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.1.tgz", - "integrity": "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2" - } - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "license": "MIT" - }, - "node_modules/is-async-function": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", - "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "async-function": "^1.0.0", - "call-bound": "^1.0.3", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bun-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", - "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.7.1" - } - }, - "node_modules/is-bun-module/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-view": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", - "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-finalizationregistry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", - "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-generator-function": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", - "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.4", - "generator-function": "^2.0.0", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", - "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", - "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/iterator.prototype": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", - "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "get-proto": "^1.0.0", - "has-symbols": "^1.1.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsx-ast-utils": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", - "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/language-subtag-registry": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", - "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/language-tags": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", - "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", - "dev": true, - "license": "MIT", - "dependencies": { - "language-subtag-registry": "^0.3.20" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "license": "MIT" - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash.mergewith": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", - "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", - "license": "MIT" - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/lucide-react": { - "version": "0.487.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.487.0.tgz", - "integrity": "sha512-aKqhOQ+YmFnwq8dWgGjOuLc8V1R9/c/yOd+zDY4+ohsR2Jo05lSGc3WsstYPIzcTpeosN7LoCkLReUUITvaIvw==", - "license": "ISC", - "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/motion-dom": { - "version": "11.18.1", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.18.1.tgz", - "integrity": "sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw==", - "license": "MIT", - "dependencies": { - "motion-utils": "^11.18.1" - } - }, - "node_modules/motion-utils": { - "version": "11.18.1", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.18.1.tgz", - "integrity": "sha512-49Kt+HKjtbJKLtgO/LKj9Ld+6vw9BjH5d9sc40R/kVyH8GLAXgT42M2NnuPcJNuA3s9ZfZBUcwIgpmZWGEE+hA==", - "license": "MIT" - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/napi-postinstall": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", - "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", - "dev": true, - "license": "MIT", - "bin": { - "napi-postinstall": "lib/cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/napi-postinstall" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-exports-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/node-exports-info/-/node-exports-info-1.6.0.tgz", - "integrity": "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "array.prototype.flatmap": "^1.3.3", - "es-errors": "^1.3.0", - "object.entries": "^1.1.9", - "semver": "^6.3.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/node-releases": { - "version": "2.0.37", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", - "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", - "dev": true, - "license": "MIT" - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.entries": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", - "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", - "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/own-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", - "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.6", - "object-keys": "^1.1.1", - "safe-push-apply": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/postcss": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz", - "integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", - "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode.react": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-4.2.0.tgz", - "integrity": "sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==", - "license": "ISC", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/react": { - "version": "19.2.5", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.5.tgz", - "integrity": "sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-clientside-effect": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/react-clientside-effect/-/react-clientside-effect-1.2.8.tgz", - "integrity": "sha512-ma2FePH0z3px2+WOu6h+YycZcEvFmmxIlAb62cF52bG86eMySciO/EQZeQMXd07kPCYB0a1dWDT5J+KE9mCDUw==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.13" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - } - }, - "node_modules/react-dom": { - "version": "19.2.5", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.5.tgz", - "integrity": "sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag==", - "license": "MIT", - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.5" - } - }, - "node_modules/react-fast-compare": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", - "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==", - "license": "MIT" - }, - "node_modules/react-focus-lock": { - "version": "2.13.7", - "resolved": "https://registry.npmjs.org/react-focus-lock/-/react-focus-lock-2.13.7.tgz", - "integrity": "sha512-20lpZHEQrXPb+pp1tzd4ULL6DyO5D2KnR0G69tTDdydrmNhU7pdFmbQUYVyHUgp+xN29IuFR0PVuhOmvaZL9Og==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.0.0", - "focus-lock": "^1.3.6", - "prop-types": "^15.6.2", - "react-clientside-effect": "^1.2.7", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-i18next": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.4.tgz", - "integrity": "sha512-hQipmK4EF0y6RO6tt6WuqnmWpWYEXmQUUzecmMBuNsIgYd3smXcG4GtYPWhvgxn0pqMOItKlEO8H24HCs5hc3g==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.29.2", - "html-parse-stringify": "^3.0.1", - "use-sync-external-store": "^1.6.0" - }, - "peerDependencies": { - "i18next": ">= 26.0.1", - "react": ">= 16.8.0", - "typescript": "^5 || ^6" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/react-icons": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.6.0.tgz", - "integrity": "sha512-RH93p5ki6LfOiIt0UtDyNg/cee+HLVR6cHHtW3wALfo+eOHTp8RnU2kRkI6E+H19zMIs03DyxUG/GfZMOGvmiA==", - "license": "MIT", - "peerDependencies": { - "react": "*" - } - }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, - "node_modules/react-refresh": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", - "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-remove-scroll": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", - "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", - "license": "MIT", - "dependencies": { - "react-remove-scroll-bar": "^2.3.7", - "react-style-singleton": "^2.2.3", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.3", - "use-sidecar": "^1.1.3" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-remove-scroll-bar": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", - "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", - "license": "MIT", - "dependencies": { - "react-style-singleton": "^2.2.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/react-router": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.14.1.tgz", - "integrity": "sha512-5BCvFskyAAVumqhEKh/iPhLOIkfxcEUz8WqFIARCkMg8hZZzDYX9CtwxXA0e+qT8zAxmMC0x3Ckb9iMONwc5jg==", - "license": "MIT", - "dependencies": { - "cookie": "^1.0.1", - "set-cookie-parser": "^2.6.0" - }, - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "react": ">=18", - "react-dom": ">=18" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - } - } - }, - "node_modules/react-router-dom": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.14.1.tgz", - "integrity": "sha512-ZkrQuwwhGibjQLqH1eCdyiZyLWglPxzxdl5tgwgKEyCSGC76vmAjleGocRe3J/MLfzMUIKwaFJWpFVJhK3d2xA==", - "license": "MIT", - "dependencies": { - "react-router": "7.14.1" - }, - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/react-style-singleton": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", - "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", - "license": "MIT", - "dependencies": { - "get-nonce": "^1.0.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", - "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.9", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.7", - "get-proto": "^1.0.1", - "which-builtin-type": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve": { - "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rollup": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", - "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.60.1", - "@rollup/rollup-android-arm64": "4.60.1", - "@rollup/rollup-darwin-arm64": "4.60.1", - "@rollup/rollup-darwin-x64": "4.60.1", - "@rollup/rollup-freebsd-arm64": "4.60.1", - "@rollup/rollup-freebsd-x64": "4.60.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", - "@rollup/rollup-linux-arm-musleabihf": "4.60.1", - "@rollup/rollup-linux-arm64-gnu": "4.60.1", - "@rollup/rollup-linux-arm64-musl": "4.60.1", - "@rollup/rollup-linux-loong64-gnu": "4.60.1", - "@rollup/rollup-linux-loong64-musl": "4.60.1", - "@rollup/rollup-linux-ppc64-gnu": "4.60.1", - "@rollup/rollup-linux-ppc64-musl": "4.60.1", - "@rollup/rollup-linux-riscv64-gnu": "4.60.1", - "@rollup/rollup-linux-riscv64-musl": "4.60.1", - "@rollup/rollup-linux-s390x-gnu": "4.60.1", - "@rollup/rollup-linux-x64-gnu": "4.60.1", - "@rollup/rollup-linux-x64-musl": "4.60.1", - "@rollup/rollup-openbsd-x64": "4.60.1", - "@rollup/rollup-openharmony-arm64": "4.60.1", - "@rollup/rollup-win32-arm64-msvc": "4.60.1", - "@rollup/rollup-win32-ia32-msvc": "4.60.1", - "@rollup/rollup-win32-x64-gnu": "4.60.1", - "@rollup/rollup-win32-x64-msvc": "4.60.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-array-concat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", - "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-push-apply": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", - "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/set-cookie-parser": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", - "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", - "license": "MIT" - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-proto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", - "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stable-hash": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", - "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", - "dev": true, - "license": "MIT" - }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/string.prototype.includes": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", - "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/string.prototype.matchall": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", - "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "regexp.prototype.flags": "^1.5.3", - "set-function-name": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.repeat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", - "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", - "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-data-property": "^1.1.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-object-atoms": "^1.0.0", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", - "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stylis": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "license": "MIT" - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", - "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toggle-selection": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", - "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==", - "license": "MIT" - }, - "node_modules/ts-api-utils": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", - "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/typed-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", - "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", - "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", - "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.15", - "reflect.getprototypeof": "^1.0.9" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", - "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0", - "reflect.getprototypeof": "^1.0.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "devOptional": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/unbox-primitive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", - "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-bigints": "^1.0.2", - "has-symbols": "^1.1.0", - "which-boxed-primitive": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/unrs-resolver": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", - "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "napi-postinstall": "^0.3.0" - }, - "funding": { - "url": "https://opencollective.com/unrs-resolver" - }, - "optionalDependencies": { - "@unrs/resolver-binding-android-arm-eabi": "1.11.1", - "@unrs/resolver-binding-android-arm64": "1.11.1", - "@unrs/resolver-binding-darwin-arm64": "1.11.1", - "@unrs/resolver-binding-darwin-x64": "1.11.1", - "@unrs/resolver-binding-freebsd-x64": "1.11.1", - "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", - "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", - "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", - "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", - "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", - "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", - "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", - "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", - "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", - "@unrs/resolver-binding-linux-x64-musl": "1.11.1", - "@unrs/resolver-binding-wasm32-wasi": "1.11.1", - "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", - "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", - "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/use-callback-ref": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", - "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sidecar": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", - "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", - "license": "MIT", - "dependencies": { - "detect-node-es": "^1.1.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-sync-external-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/vite": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.2.tgz", - "integrity": "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.4.4", - "picomatch": "^4.0.2", - "postcss": "^8.5.3", - "rollup": "^4.34.9", - "tinyglobby": "^0.2.13" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "jiti": ">=1.21.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vite/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/vite/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/void-elements": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", - "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-builtin-type": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", - "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "function.prototype.name": "^1.1.6", - "has-tostringtag": "^1.0.2", - "is-async-function": "^2.0.0", - "is-date-object": "^1.1.0", - "is-finalizationregistry": "^1.1.0", - "is-generator-function": "^1.0.10", - "is-regex": "^1.2.1", - "is-weakref": "^1.0.2", - "isarray": "^2.0.5", - "which-boxed-primitive": "^1.1.0", - "which-collection": "^1.0.2", - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", - "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.20", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", - "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zustand": { - "version": "5.0.14", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.14.tgz", - "integrity": "sha512-/8tAspM5LMPr28b3fwLYrtdj77ECpfZviaP75CMTnwO8ISyaE4GDIG/9rDDYq/cH9D2Xw2A2RXglLInmVBQB/g==", - "license": "MIT", - "engines": { - "node": ">=12.20.0" - }, - "peerDependencies": { - "@types/react": ">=18.0.0", - "immer": ">=9.0.6", - "react": ">=18.0.0", - "use-sync-external-store": ">=1.2.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "immer": { - "optional": true - }, - "react": { - "optional": true - }, - "use-sync-external-store": { - "optional": true - } - } - } - } -} diff --git a/参考/NexBox-main/package.json b/参考/NexBox-main/package.json deleted file mode 100644 index 1e27443..0000000 --- a/参考/NexBox-main/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "nexbox", - "version": "5.9.8", - "private": true, - "type": "module", - "license": "GPL-3.0", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "lint": "eslint .", - "format": "prettier --write .", - "tauri": "tauri", - "tauri:dev": "tauri dev", - "tauri:build": "tauri build", - "prepare": "husky" - }, - "dependencies": { - "@chakra-ui/react": "^2.10.9", - "@dnd-kit/core": "^6.3.1", - "@dnd-kit/sortable": "^10.0.0", - "@dnd-kit/utilities": "^3.2.2", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@tauri-apps/api": "^2.10.1", - "@tauri-apps/plugin-clipboard-manager": "^2.3.2", - "@tauri-apps/plugin-dialog": "^2.7.1", - "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-process": "^2.3.1", - "@tauri-apps/plugin-shell": "^2.3.5", - "@tauri-apps/plugin-store": "^2.4.3", - "framer-motion": "^11.18.2", - "i18next": "^26.0.5", - "i18next-browser-languagedetector": "^8.2.1", - "lucide-react": "^0.487.0", - "qrcode.react": "^4.2.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-i18next": "^17.0.4", - "react-icons": "^5.6.0", - "react-router-dom": "^7.1.5", - "zustand": "^5.0.2" - }, - "devDependencies": { - "@emotion/babel-plugin": "^11.13.5", - "@eslint/eslintrc": "^3.3.0", - "@tauri-apps/cli": "^2.10.1", - "@types/node": "^22.13.10", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "eslint": "^9.22.0", - "eslint-config-next": "^15.2.4", - "husky": "^9.1.7", - "prettier": "^3.5.3", - "typescript": "^5.8.2", - "vite": "^6.0.11" - } -} diff --git a/参考/NexBox-main/power-plans/ACMEPCAMD.pow b/参考/NexBox-main/power-plans/ACMEPCAMD.pow deleted file mode 100644 index bc8d02e..0000000 Binary files a/参考/NexBox-main/power-plans/ACMEPCAMD.pow and /dev/null differ diff --git a/参考/NexBox-main/power-plans/AMD电源计划.pow b/参考/NexBox-main/power-plans/AMD电源计划.pow deleted file mode 100644 index 67a03d3..0000000 Binary files a/参考/NexBox-main/power-plans/AMD电源计划.pow and /dev/null differ diff --git a/参考/NexBox-main/power-plans/Intel大核心电源计划.pow b/参考/NexBox-main/power-plans/Intel大核心电源计划.pow deleted file mode 100644 index cdc987a..0000000 Binary files a/参考/NexBox-main/power-plans/Intel大核心电源计划.pow and /dev/null differ diff --git a/参考/NexBox-main/power-plans/PowerX-v2.pow b/参考/NexBox-main/power-plans/PowerX-v2.pow deleted file mode 100644 index efc7fea..0000000 Binary files a/参考/NexBox-main/power-plans/PowerX-v2.pow and /dev/null differ diff --git a/参考/NexBox-main/power-plans/ggOS Desktop Gaming.pow b/参考/NexBox-main/power-plans/ggOS Desktop Gaming.pow deleted file mode 100644 index 666e70b..0000000 Binary files a/参考/NexBox-main/power-plans/ggOS Desktop Gaming.pow and /dev/null differ diff --git a/参考/NexBox-main/power-plans/卓越性能.pow b/参考/NexBox-main/power-plans/卓越性能.pow deleted file mode 100644 index 910d105..0000000 Binary files a/参考/NexBox-main/power-plans/卓越性能.pow and /dev/null differ diff --git a/参考/NexBox-main/public/.gitkeep b/参考/NexBox-main/public/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/参考/NexBox-main/public/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/参考/NexBox-main/public/backgrounds/preset1.jpg b/参考/NexBox-main/public/backgrounds/preset1.jpg deleted file mode 100644 index f724081..0000000 Binary files a/参考/NexBox-main/public/backgrounds/preset1.jpg and /dev/null differ diff --git a/参考/NexBox-main/public/backgrounds/preset2.jpg b/参考/NexBox-main/public/backgrounds/preset2.jpg deleted file mode 100644 index 5bb9f1c..0000000 Binary files a/参考/NexBox-main/public/backgrounds/preset2.jpg and /dev/null differ diff --git a/参考/NexBox-main/public/backgrounds/preset3.png b/参考/NexBox-main/public/backgrounds/preset3.png deleted file mode 100644 index 7ea693a..0000000 Binary files a/参考/NexBox-main/public/backgrounds/preset3.png and /dev/null differ diff --git a/参考/NexBox-main/public/backgrounds/preset4.png b/参考/NexBox-main/public/backgrounds/preset4.png deleted file mode 100644 index 070b3a8..0000000 Binary files a/参考/NexBox-main/public/backgrounds/preset4.png and /dev/null differ diff --git a/参考/NexBox-main/public/deltaforce.png b/参考/NexBox-main/public/deltaforce.png deleted file mode 100644 index 138bb7f..0000000 Binary files a/参考/NexBox-main/public/deltaforce.png and /dev/null differ diff --git a/参考/NexBox-main/public/feedback-banner.png b/参考/NexBox-main/public/feedback-banner.png deleted file mode 100644 index 698830e..0000000 Binary files a/参考/NexBox-main/public/feedback-banner.png and /dev/null differ diff --git a/参考/NexBox-main/public/fonts/AiDianFengYaHei.ttf b/参考/NexBox-main/public/fonts/AiDianFengYaHei.ttf deleted file mode 100644 index 3384e87..0000000 Binary files a/参考/NexBox-main/public/fonts/AiDianFengYaHei.ttf and /dev/null differ diff --git a/参考/NexBox-main/public/fonts/Cubic.ttf b/参考/NexBox-main/public/fonts/Cubic.ttf deleted file mode 100644 index 2aec542..0000000 Binary files a/参考/NexBox-main/public/fonts/Cubic.ttf and /dev/null differ diff --git a/参考/NexBox-main/public/fonts/MiSansVF.ttf b/参考/NexBox-main/public/fonts/MiSansVF.ttf deleted file mode 100644 index 07a1ea5..0000000 Binary files a/参考/NexBox-main/public/fonts/MiSansVF.ttf and /dev/null differ diff --git a/参考/NexBox-main/public/fonts/Sinter-Regular.otf b/参考/NexBox-main/public/fonts/Sinter-Regular.otf deleted file mode 100644 index 826c8c5..0000000 Binary files a/参考/NexBox-main/public/fonts/Sinter-Regular.otf and /dev/null differ diff --git a/参考/NexBox-main/public/icc-preview.png b/参考/NexBox-main/public/icc-preview.png deleted file mode 100644 index 4c0e18c..0000000 Binary files a/参考/NexBox-main/public/icc-preview.png and /dev/null differ diff --git a/参考/NexBox-main/public/icons/bilibili.svg b/参考/NexBox-main/public/icons/bilibili.svg deleted file mode 100644 index db008e0..0000000 --- a/参考/NexBox-main/public/icons/bilibili.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/public/icons/browser.svg b/参考/NexBox-main/public/icons/browser.svg deleted file mode 100644 index 9d0d8ea..0000000 --- a/参考/NexBox-main/public/icons/browser.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/public/icons/chat.svg b/参考/NexBox-main/public/icons/chat.svg deleted file mode 100644 index f7800d5..0000000 --- a/参考/NexBox-main/public/icons/chat.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/public/icons/dingtalk.png b/参考/NexBox-main/public/icons/dingtalk.png deleted file mode 100644 index 1600e67..0000000 Binary files a/参考/NexBox-main/public/icons/dingtalk.png and /dev/null differ diff --git a/参考/NexBox-main/public/icons/game.svg b/参考/NexBox-main/public/icons/game.svg deleted file mode 100644 index c5f1567..0000000 --- a/参考/NexBox-main/public/icons/game.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/public/icons/mail.png b/参考/NexBox-main/public/icons/mail.png deleted file mode 100644 index 3f1ca9f..0000000 Binary files a/参考/NexBox-main/public/icons/mail.png and /dev/null differ diff --git a/参考/NexBox-main/public/icons/note.svg b/参考/NexBox-main/public/icons/note.svg deleted file mode 100644 index 8aa3e87..0000000 --- a/参考/NexBox-main/public/icons/note.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/public/icons/qq.png b/参考/NexBox-main/public/icons/qq.png deleted file mode 100644 index c249f0c..0000000 Binary files a/参考/NexBox-main/public/icons/qq.png and /dev/null differ diff --git a/参考/NexBox-main/public/icons/wechat.png b/参考/NexBox-main/public/icons/wechat.png deleted file mode 100644 index 9808f90..0000000 Binary files a/参考/NexBox-main/public/icons/wechat.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/CNBB.png b/参考/NexBox-main/public/logo/CNBB.png deleted file mode 100644 index 7e1d34e..0000000 Binary files a/参考/NexBox-main/public/logo/CNBB.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/CNBW.png b/参考/NexBox-main/public/logo/CNBW.png deleted file mode 100644 index 0aaf025..0000000 Binary files a/参考/NexBox-main/public/logo/CNBW.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/Chinesew.png b/参考/NexBox-main/public/logo/Chinesew.png deleted file mode 100644 index 4b8c6f5..0000000 Binary files a/参考/NexBox-main/public/logo/Chinesew.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/NBB.png b/参考/NexBox-main/public/logo/NBB.png deleted file mode 100644 index e01449f..0000000 Binary files a/参考/NexBox-main/public/logo/NBB.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/NBW.png b/参考/NexBox-main/public/logo/NBW.png deleted file mode 100644 index d7be504..0000000 Binary files a/参考/NexBox-main/public/logo/NBW.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/NexBoxB.png b/参考/NexBox-main/public/logo/NexBoxB.png deleted file mode 100644 index 72e8cbb..0000000 Binary files a/参考/NexBox-main/public/logo/NexBoxB.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/NexBoxW.png b/参考/NexBox-main/public/logo/NexBoxW.png deleted file mode 100644 index 499d333..0000000 Binary files a/参考/NexBox-main/public/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/logo/NexBoxB.png b/参考/NexBox-main/public/logo/logo/NexBoxB.png deleted file mode 100644 index 72e8cbb..0000000 Binary files a/参考/NexBox-main/public/logo/logo/NexBoxB.png and /dev/null differ diff --git a/参考/NexBox-main/public/logo/logo/NexBoxW.png b/参考/NexBox-main/public/logo/logo/NexBoxW.png deleted file mode 100644 index 499d333..0000000 Binary files a/参考/NexBox-main/public/logo/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/public/platform-viewer.html b/参考/NexBox-main/public/platform-viewer.html deleted file mode 100644 index 33cc132..0000000 --- a/参考/NexBox-main/public/platform-viewer.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/参考/NexBox-main/public/public/.gitkeep b/参考/NexBox-main/public/public/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/参考/NexBox-main/public/public/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/参考/NexBox-main/public/public/backgrounds/preset1.jpg b/参考/NexBox-main/public/public/backgrounds/preset1.jpg deleted file mode 100644 index f724081..0000000 Binary files a/参考/NexBox-main/public/public/backgrounds/preset1.jpg and /dev/null differ diff --git a/参考/NexBox-main/public/public/backgrounds/preset2.jpg b/参考/NexBox-main/public/public/backgrounds/preset2.jpg deleted file mode 100644 index 5bb9f1c..0000000 Binary files a/参考/NexBox-main/public/public/backgrounds/preset2.jpg and /dev/null differ diff --git a/参考/NexBox-main/public/public/backgrounds/preset3.png b/参考/NexBox-main/public/public/backgrounds/preset3.png deleted file mode 100644 index 7ea693a..0000000 Binary files a/参考/NexBox-main/public/public/backgrounds/preset3.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/backgrounds/preset4.png b/参考/NexBox-main/public/public/backgrounds/preset4.png deleted file mode 100644 index 070b3a8..0000000 Binary files a/参考/NexBox-main/public/public/backgrounds/preset4.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/deltaforce.png b/参考/NexBox-main/public/public/deltaforce.png deleted file mode 100644 index 138bb7f..0000000 Binary files a/参考/NexBox-main/public/public/deltaforce.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/logo/Chinesew.png b/参考/NexBox-main/public/public/logo/Chinesew.png deleted file mode 100644 index 4b8c6f5..0000000 Binary files a/参考/NexBox-main/public/public/logo/Chinesew.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/logo/NexBoxB.png b/参考/NexBox-main/public/public/logo/NexBoxB.png deleted file mode 100644 index 72e8cbb..0000000 Binary files a/参考/NexBox-main/public/public/logo/NexBoxB.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/logo/NexBoxW.png b/参考/NexBox-main/public/public/logo/NexBoxW.png deleted file mode 100644 index 499d333..0000000 Binary files a/参考/NexBox-main/public/public/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/logo/logo/NexBoxB.png b/参考/NexBox-main/public/public/logo/logo/NexBoxB.png deleted file mode 100644 index 72e8cbb..0000000 Binary files a/参考/NexBox-main/public/public/logo/logo/NexBoxB.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/logo/logo/NexBoxW.png b/参考/NexBox-main/public/public/logo/logo/NexBoxW.png deleted file mode 100644 index 499d333..0000000 Binary files a/参考/NexBox-main/public/public/logo/logo/NexBoxW.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/sponsor/alipay.png b/参考/NexBox-main/public/public/sponsor/alipay.png deleted file mode 100644 index 4c38fbd..0000000 Binary files a/参考/NexBox-main/public/public/sponsor/alipay.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/sponsor/wechat.png b/参考/NexBox-main/public/public/sponsor/wechat.png deleted file mode 100644 index 52fce5c..0000000 Binary files a/参考/NexBox-main/public/public/sponsor/wechat.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/wx.png b/参考/NexBox-main/public/public/wx.png deleted file mode 100644 index 62960de..0000000 Binary files a/参考/NexBox-main/public/public/wx.png and /dev/null differ diff --git a/参考/NexBox-main/public/public/zfb.jpg b/参考/NexBox-main/public/public/zfb.jpg deleted file mode 100644 index d338994..0000000 Binary files a/参考/NexBox-main/public/public/zfb.jpg and /dev/null differ diff --git a/参考/NexBox-main/public/qq.png b/参考/NexBox-main/public/qq.png deleted file mode 100644 index 203e6b3..0000000 Binary files a/参考/NexBox-main/public/qq.png and /dev/null differ diff --git a/参考/NexBox-main/public/sponsor/.gitkeep b/参考/NexBox-main/public/sponsor/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/参考/NexBox-main/public/sponsor/alipay.png b/参考/NexBox-main/public/sponsor/alipay.png deleted file mode 100644 index 4c38fbd..0000000 Binary files a/参考/NexBox-main/public/sponsor/alipay.png and /dev/null differ diff --git a/参考/NexBox-main/public/sponsor/wechat.png b/参考/NexBox-main/public/sponsor/wechat.png deleted file mode 100644 index 52fce5c..0000000 Binary files a/参考/NexBox-main/public/sponsor/wechat.png and /dev/null differ diff --git a/参考/NexBox-main/public/wx.png b/参考/NexBox-main/public/wx.png deleted file mode 100644 index 62960de..0000000 Binary files a/参考/NexBox-main/public/wx.png and /dev/null differ diff --git a/参考/NexBox-main/public/zfb.jpg b/参考/NexBox-main/public/zfb.jpg deleted file mode 100644 index d338994..0000000 Binary files a/参考/NexBox-main/public/zfb.jpg and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/.cargo/config.toml b/参考/NexBox-main/src-tauri/.cargo/config.toml deleted file mode 100644 index dd1ba5a..0000000 --- a/参考/NexBox-main/src-tauri/.cargo/config.toml +++ /dev/null @@ -1,5 +0,0 @@ -[http] -proxy = "" - -[net] -git-fetch-with-cli = false diff --git a/参考/NexBox-main/src-tauri/.gitignore b/参考/NexBox-main/src-tauri/.gitignore deleted file mode 100644 index 502406b..0000000 --- a/参考/NexBox-main/src-tauri/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -/target/ -/gen/schemas diff --git a/参考/NexBox-main/src-tauri/Cargo.lock b/参考/NexBox-main/src-tauri/Cargo.lock deleted file mode 100644 index ba4d86c..0000000 --- a/参考/NexBox-main/src-tauri/Cargo.lock +++ /dev/null @@ -1,8251 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android_log-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" - -[[package]] -name = "android_logger" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb4e440d04be07da1f1bf44fb4495ebd58669372fe0cffa6e48595ac5bd88a3" -dependencies = [ - "android_log-sys", - "env_filter 0.1.4", - "log", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - -[[package]] -name = "anstyle-parse" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - -[[package]] -name = "arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "arboard" -version = "3.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf" -dependencies = [ - "clipboard-win", - "image", - "log", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation 0.3.2", - "parking_lot", - "percent-encoding", - "windows-sys 0.60.2", - "wl-clipboard-rs", - "x11rb", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "ashpd" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f3f79755c74fd155000314eb349864caa787c6592eace6c6882dad873d9c39" -dependencies = [ - "async-fs", - "async-net", - "enumflags2", - "futures-channel", - "futures-util", - "rand 0.9.4", - "raw-window-handle", - "serde", - "serde_repr", - "url", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "zbus", -] - -[[package]] -name = "async-broadcast" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" -dependencies = [ - "event-listener", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-channel" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "pin-project-lite", - "slab", -] - -[[package]] -name = "async-fs" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" -dependencies = [ - "async-lock", - "blocking", - "futures-lite", -] - -[[package]] -name = "async-io" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" -dependencies = [ - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-lock" -version = "3.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" -dependencies = [ - "event-listener", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-net" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io", - "blocking", - "futures-lite", -] - -[[package]] -name = "async-process" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" -dependencies = [ - "async-channel", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if", - "event-listener", - "futures-lite", - "rustix", -] - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "async-signal" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix", - "signal-hook-registry", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "atk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" -dependencies = [ - "atk-sys", - "glib", - "libc", -] - -[[package]] -name = "atk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "axum" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.9.0", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "tokio", - "tower 0.5.3", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 1.0.2", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" -dependencies = [ - "serde_core", -] - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" -dependencies = [ - "objc2 0.5.2", -] - -[[package]] -name = "block2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" -dependencies = [ - "objc2 0.6.4", -] - -[[package]] -name = "blocking" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - -[[package]] -name = "bluez-async" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ae4213cc2a8dc663acecac67bbdad05142be4d8ef372b6903abf878b0c690a" -dependencies = [ - "bitflags 2.11.1", - "bluez-generated", - "dbus", - "dbus-tokio", - "futures", - "itertools", - "log", - "serde", - "serde-xml-rs", - "thiserror 2.0.18", - "tokio", - "uuid", -] - -[[package]] -name = "bluez-generated" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9676783265eadd6f11829982792c6f303f3854d014edfba384685dcf237dd062" -dependencies = [ - "dbus", -] - -[[package]] -name = "borsh" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" -dependencies = [ - "borsh-derive", - "bytes", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" -dependencies = [ - "once_cell", - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "brotli" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "btleplug" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c3264dbe2c8e29381e4e95aa2d2783ad0b9192b511240f3755b7e5e3cee87e" -dependencies = [ - "async-trait", - "bitflags 2.11.1", - "bluez-async", - "dashmap", - "dbus", - "futures", - "jni 0.19.0", - "log", - "objc2 0.5.2", - "objc2-core-bluetooth", - "objc2-foundation 0.2.2", - "once_cell", - "static_assertions", - "thiserror 2.0.18", - "tokio", - "tokio-stream", - "uuid", - "windows 0.62.2", - "windows-future 0.3.2", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "byte-unit" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6d47a4e2961fb8721bcfc54feae6455f2f64e7054f9bc67e875f0e77f4c58d" -dependencies = [ - "rust_decimal", - "schemars 1.2.1", - "serde", - "utf8-width", -] - -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - -[[package]] -name = "bytes" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -dependencies = [ - "serde", -] - -[[package]] -name = "bzip2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" -dependencies = [ - "bzip2-sys", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "cairo-rs" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" -dependencies = [ - "bitflags 2.11.1", - "cairo-sys-rs", - "glib", - "libc", - "once_cell", - "thiserror 1.0.69", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "camino" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" -dependencies = [ - "serde_core", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror 2.0.18", -] - -[[package]] -name = "cargo_toml" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" -dependencies = [ - "serde", - "toml 0.9.12+spec-1.1.0", -] - -[[package]] -name = "cc" -version = "1.2.62" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cfb" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" -dependencies = [ - "byteorder", - "fnv", - "uuid", -] - -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chrono" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-link 0.2.1", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clipboard-win" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" -dependencies = [ - "error-code", -] - -[[package]] -name = "colorchoice" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "constant_time_eq" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" - -[[package]] -name = "cookie" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - -[[package]] -name = "cookie_store" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" -dependencies = [ - "cookie", - "document-features", - "idna", - "log", - "publicsuffix", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "core-graphics" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "core-graphics-types", - "foreign-types 0.5.0", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cssparser" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf", - "smallvec", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "ctor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - -[[package]] -name = "ctor-proc-macro" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core 0.23.0", - "darling_macro 0.23.0", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core 0.23.0", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dashmap" -version = "6.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "data-encoding" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" - -[[package]] -name = "data-url" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" - -[[package]] -name = "dbus" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b942602992bb7acfd1f51c49811c58a610ef9181b6e66f3e519d79b540a3bf73" -dependencies = [ - "futures-channel", - "futures-util", - "libc", - "libdbus-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "dbus-tokio" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007688d459bc677131c063a3a77fb899526e17b7980f390b69644bdbc41fad13" -dependencies = [ - "dbus", - "libc", - "tokio", -] - -[[package]] -name = "deflate64" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2" - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", - "serde_core", -] - -[[package]] -name = "derive_arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "derive_more" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" -dependencies = [ - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.117", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys 0.4.1", -] - -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys 0.5.0", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.4.6", - "windows-sys 0.48.0", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.5.2", - "windows-sys 0.61.2", -] - -[[package]] -name = "dispatch2" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "libc", - "objc2 0.6.4", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dlib" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" -dependencies = [ - "libloading 0.8.9", -] - -[[package]] -name = "dlopen2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - -[[package]] -name = "dom_query" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" -dependencies = [ - "bit-set", - "cssparser", - "foldhash 0.2.0", - "html5ever", - "precomputed-hash", - "selectors", - "tendril", -] - -[[package]] -name = "downcast-rs" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" - -[[package]] -name = "dpi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" -dependencies = [ - "serde", -] - -[[package]] -name = "dtoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - -[[package]] -name = "dtor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "embed-resource" -version = "3.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a88c8d26de40ed18fe748c547845aa39de1db3afd958f8cb91579f3644bcb" -dependencies = [ - "cc", - "memchr", - "rustc_version", - "toml 1.1.2+spec-1.1.0", - "vswhom", - "winreg 0.55.0", -] - -[[package]] -name = "embed_plist" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "endi" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" - -[[package]] -name = "enumflags2" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "env_filter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_filter" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" -dependencies = [ - "anstream", - "anstyle", - "env_filter 1.0.1", - "jiff", - "log", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "erased-serde" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" -dependencies = [ - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "error-code" -version = "3.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" - -[[package]] -name = "fax" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a" - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "fern" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" -dependencies = [ - "log", -] - -[[package]] -name = "field-offset" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" -dependencies = [ - "memoffset", - "rustc_version", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-executor" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-lite" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "futures-sink" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - -[[package]] -name = "gdk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" -dependencies = [ - "cairo-rs", - "gdk-pixbuf", - "gdk-sys", - "gio", - "glib", - "libc", - "pango", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" -dependencies = [ - "gdk-pixbuf-sys", - "gio", - "glib", - "libc", - "once_cell", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" -dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkwayland-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" -dependencies = [ - "gdk-sys", - "glib-sys", - "gobject-sys", - "libc", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkx11" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" -dependencies = [ - "gdk", - "gdkx11-sys", - "gio", - "glib", - "libc", - "x11", -] - -[[package]] -name = "gdkx11-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" -dependencies = [ - "gdk-sys", - "glib-sys", - "libc", - "system-deps", - "x11", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "gethostname" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" -dependencies = [ - "rustix", - "windows-link 0.2.1", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "r-efi 5.3.0", - "wasip2", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", -] - -[[package]] -name = "gio" -version = "0.18.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "gio-sys", - "glib", - "libc", - "once_cell", - "pin-project-lite", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "gio-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - -[[package]] -name = "glib" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" -dependencies = [ - "bitflags 2.11.1", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "memchr", - "once_cell", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "glib-macros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" -dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "glib-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - -[[package]] -name = "global-hotkey" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9247516746aa8e53411a0db9b62b0e24efbcf6a76e0ba73e5a91b512ddabed7" -dependencies = [ - "crossbeam-channel", - "keyboard-types", - "objc2 0.6.4", - "objc2-app-kit", - "once_cell", - "serde", - "thiserror 2.0.18", - "windows-sys 0.59.0", - "x11rb", - "xkeysym", -] - -[[package]] -name = "gobject-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" -dependencies = [ - "atk", - "cairo-rs", - "field-offset", - "futures-channel", - "gdk", - "gdk-pixbuf", - "gio", - "glib", - "gtk-sys", - "gtk3-macros", - "libc", - "pango", - "pkg-config", -] - -[[package]] -name = "gtk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - -[[package]] -name = "gtk3-macros" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "h2" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.14.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "h2" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.4.0", - "indexmap 2.14.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" -dependencies = [ - "cfg-if", - "crunchy", - "zerocopy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash 0.1.5", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "html5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" -dependencies = [ - "log", - "markup5ever", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http 1.4.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http 1.4.0", - "http-body 1.0.1", - "pin-project-lite", -] - -[[package]] -name = "http-range" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" - -[[package]] -name = "http-range-header" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.27", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.10", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "h2 0.4.14", - "http 1.4.0", - "http-body 1.0.1", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" -dependencies = [ - "http 1.4.0", - "hyper 1.9.0", - "hyper-util", - "rustls", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.32", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "hyper 1.9.0", - "ipnet", - "libc", - "percent-encoding", - "pin-project-lite", - "socket2 0.6.3", - "system-configuration 0.7.0", - "tokio", - "tower-service", - "tracing", - "windows-registry", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core 0.62.2", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ico" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" -dependencies = [ - "byteorder", - "png 0.17.16", -] - -[[package]] -name = "icu_collections" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" -dependencies = [ - "displaydoc", - "potential_utf", - "utf8_iter", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" - -[[package]] -name = "icu_properties" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" - -[[package]] -name = "icu_provider" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "image" -version = "0.25.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" -dependencies = [ - "bytemuck", - "byteorder-lite", - "moxcms", - "num-traits", - "png 0.18.1", - "tiff", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.1", - "serde", - "serde_core", -] - -[[package]] -name = "infer" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" -dependencies = [ - "cfb", -] - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "ipnet" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" - -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "javascriptcore-rs" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" -dependencies = [ - "bitflags 1.3.2", - "glib", - "javascriptcore-rs-sys", -] - -[[package]] -name = "javascriptcore-rs-sys" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "jiff" -version = "0.2.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4603d3033e49e2b0e31229fcab20a5d40089c607d975cd9c80551dc69eed9102" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde_core", -] - -[[package]] -name = "jiff-static" -version = "0.2.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782d32378dddf207193ac91cefb848ad41abb58195c95168e1291227a0832b47" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", -] - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" -dependencies = [ - "jni-sys 0.4.1", -] - -[[package]] -name = "jni-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" -dependencies = [ - "jni-sys-macros", -] - -[[package]] -name = "jni-sys-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom 0.3.4", - "libc", -] - -[[package]] -name = "jpeg-encoder" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b454d911ac55068f53495488d8ccd0646eaa540c033a28ee15b07838afafb01f" - -[[package]] -name = "js-sys" -version = "0.3.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" -dependencies = [ - "cfg-if", - "futures-util", - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json-patch" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" -dependencies = [ - "jsonptr", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "jsonptr" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.11.1", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libappindicator" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" -dependencies = [ - "glib", - "gtk", - "gtk-sys", - "libappindicator-sys", - "log", -] - -[[package]] -name = "libappindicator-sys" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" -dependencies = [ - "gtk-sys", - "libloading 0.7.4", - "once_cell", -] - -[[package]] -name = "libc" -version = "0.2.186" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" - -[[package]] -name = "libdbus-sys" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" -dependencies = [ - "pkg-config", -] - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" -dependencies = [ - "cfg-if", - "windows-link 0.2.1", -] - -[[package]] -name = "libredox" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" -dependencies = [ - "libc", -] - -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - -[[package]] -name = "litemap" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" - -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -dependencies = [ - "value-bag", -] - -[[package]] -name = "lru-slab" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" - -[[package]] -name = "lzma-rs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" -dependencies = [ - "byteorder", - "crc", -] - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "markup5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" -dependencies = [ - "log", - "tendril", - "web_atoms", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "moxcms" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" -dependencies = [ - "num-traits", - "pxfm", -] - -[[package]] -name = "muda" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae8844f63b5b118e334e205585b8c5c17b984121dbdb179d44aeb087ffad3cb" -dependencies = [ - "crossbeam-channel", - "dpi", - "gtk", - "keyboard-types", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "ndk" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" -dependencies = [ - "bitflags 2.11.1", - "jni-sys 0.3.1", - "log", - "ndk-sys", - "num_enum", - "raw-window-handle", - "thiserror 1.0.69", -] - -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys 0.3.1", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nexbox" -version = "5.9.8" -dependencies = [ - "aes", - "async-stream", - "axum", - "base64 0.22.1", - "btleplug", - "bytes", - "chrono", - "cipher", - "dashmap", - "dirs 5.0.1", - "env_logger", - "futures-util", - "hex", - "jpeg-encoder", - "libloading 0.8.9", - "log", - "md-5", - "nvml-wrapper", - "parking_lot", - "rand 0.8.6", - "regex", - "reqwest 0.11.27", - "rfd 0.15.4", - "serde", - "serde_json", - "spin_sleep", - "sysinfo", - "tauri", - "tauri-build", - "tauri-plugin-clipboard-manager", - "tauri-plugin-dialog", - "tauri-plugin-fs", - "tauri-plugin-global-shortcut", - "tauri-plugin-http", - "tauri-plugin-log", - "tauri-plugin-opener", - "tauri-plugin-os", - "tauri-plugin-shell", - "tauri-plugin-single-instance", - "tauri-plugin-store", - "thiserror 2.0.18", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tower 0.4.13", - "tower-http 0.5.2", - "url", - "urlencoding", - "uuid", - "winapi", - "windows 0.58.0", - "windows-sys 0.59.0", - "winreg 0.52.0", - "wmi", - "zip", -] - -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.11.1", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[package]] -name = "ntapi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" -dependencies = [ - "winapi", -] - -[[package]] -name = "num-conv" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" -dependencies = [ - "num_enum_derive", - "rustversion", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "nvml-wrapper" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9bff0aa1d48904a1385ea2a8b97576fbdcbc9a3cfccd0d31fe978e1c4038c5" -dependencies = [ - "bitflags 2.11.1", - "libloading 0.8.9", - "nvml-wrapper-sys", - "static_assertions", - "thiserror 1.0.69", - "wrapcenum-derive", -] - -[[package]] -name = "nvml-wrapper-sys" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "698d45156f28781a4e79652b6ebe2eaa0589057d588d3aec1333f6466f13fcb5" -dependencies = [ - "libloading 0.8.9", -] - -[[package]] -name = "objc-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" - -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys", - "objc2-encode", -] - -[[package]] -name = "objc2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" -dependencies = [ - "objc2-encode", - "objc2-exception-helper", -] - -[[package]] -name = "objc2-app-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "objc2 0.6.4", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" -dependencies = [ - "bitflags 2.11.1", - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-core-bluetooth" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a644b62ffb826a5277f536cf0f701493de420b13d40e700c452c36567771111" -dependencies = [ - "bitflags 2.11.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" -dependencies = [ - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags 2.11.1", - "dispatch2", - "objc2 0.6.4", -] - -[[package]] -name = "objc2-core-graphics" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" -dependencies = [ - "bitflags 2.11.1", - "dispatch2", - "objc2 0.6.4", - "objc2-core-foundation", - "objc2-io-surface", -] - -[[package]] -name = "objc2-core-image" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" -dependencies = [ - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-core-location" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" -dependencies = [ - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-core-text" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" -dependencies = [ - "bitflags 2.11.1", - "objc2 0.6.4", - "objc2-core-foundation", - "objc2-core-graphics", -] - -[[package]] -name = "objc2-encode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "objc2-exception-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" -dependencies = [ - "cc", -] - -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.11.1", - "block2 0.5.1", - "libc", - "objc2 0.5.2", -] - -[[package]] -name = "objc2-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "libc", - "objc2 0.6.4", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-io-surface" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" -dependencies = [ - "bitflags 2.11.1", - "objc2 0.6.4", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" -dependencies = [ - "bitflags 2.11.1", - "objc2 0.6.4", - "objc2-core-foundation", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-ui-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "objc2 0.6.4", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image", - "objc2-core-location", - "objc2-core-text", - "objc2-foundation 0.3.2", - "objc2-quartz-core", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" -dependencies = [ - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-web-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - -[[package]] -name = "open" -version = "5.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3bab717c29a857abf75fcef718d441ec7cb2725f937343c734740a985d37fd" -dependencies = [ - "dunce", - "is-wsl", - "libc", - "pathdiff", -] - -[[package]] -name = "openssl" -version = "0.10.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0b434746ee2832f4f0baf10137e1cabb18cbe6912c69e2e33263c45250f542" -dependencies = [ - "bitflags 2.11.1", - "cfg-if", - "foreign-types 0.3.2", - "libc", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - -[[package]] -name = "openssl-sys" -version = "0.9.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158fe5b292746440aa6e7a7e690e55aeb72d41505e2804c23c6973ad0e9c9781" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "os_info" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4022a17595a00d6a369236fdae483f0de7f0a339960a53118b818238e132224" -dependencies = [ - "android_system_properties", - "log", - "nix", - "objc2 0.6.4", - "objc2-foundation 0.3.2", - "objc2-ui-kit", - "serde", - "windows-sys 0.61.2", -] - -[[package]] -name = "os_pipe" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "pango" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" -dependencies = [ - "gio", - "glib", - "libc", - "once_cell", - "pango-sys", -] - -[[package]] -name = "pango-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link 0.2.1", -] - -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "petgraph" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" -dependencies = [ - "fixedbitset", - "hashbrown 0.15.5", - "indexmap 2.14.0", -] - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_codegen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "piper" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - -[[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] -name = "plist" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092791278e026273c1b65bbdcfbba3a300f2994c896bd01ab01da613c29c46f1" -dependencies = [ - "base64 0.22.1", - "indexmap 2.14.0", - "quick-xml", - "serde", - "time", -] - -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "png" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" -dependencies = [ - "bitflags 2.11.1", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "polling" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "pollster" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" - -[[package]] -name = "portable-atomic" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" - -[[package]] -name = "portable-atomic-util" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "potential_utf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" -dependencies = [ - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "proc-macro-crate" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit 0.25.11+spec-1.1.0", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "psl-types" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "publicsuffix" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" -dependencies = [ - "idna", - "psl-types", -] - -[[package]] -name = "pxfm" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c5ccf5294c6ccd63a74f1565028353830a9c2f5eb0c682c355c471726a6e3f" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quick-xml" -version = "0.39.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcc8dd4e2f670d309a5f0e83fe36dfdc05af317008fea29144da1a2ac858e5e" -dependencies = [ - "memchr", -] - -[[package]] -name = "quinn" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" -dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2 0.6.3", - "thiserror 2.0.18", - "tokio", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-proto" -version = "0.11.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" -dependencies = [ - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand 0.9.4", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror 2.0.18", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2 0.6.3", - "tracing", - "windows-sys 0.60.2", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", -] - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] - -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - -[[package]] -name = "rayon" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.11.1", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 1.0.69", -] - -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 2.0.18", -] - -[[package]] -name = "ref-cast" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "regex" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" - -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.27", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", - "tokio", - "tokio-native-tls", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams 0.4.2", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" -dependencies = [ - "base64 0.22.1", - "bytes", - "cookie", - "cookie_store", - "encoding_rs", - "futures-core", - "h2 0.4.14", - "http 1.4.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.9.0", - "hyper-rustls", - "hyper-util", - "js-sys", - "log", - "mime", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "tokio", - "tokio-rustls", - "tower 0.5.3", - "tower-http 0.6.10", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", -] - -[[package]] -name = "reqwest" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e0021ea2c22aed41653bc7e1419abb2c97e038ff2c33d0e1309e49a97deec0" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.9.0", - "hyper-util", - "js-sys", - "log", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "sync_wrapper 1.0.2", - "tokio", - "tokio-util", - "tower 0.5.3", - "tower-http 0.6.10", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams 0.5.0", - "web-sys", -] - -[[package]] -name = "rfd" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" -dependencies = [ - "ashpd", - "block2 0.6.2", - "dispatch2", - "js-sys", - "log", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", - "pollster", - "raw-window-handle", - "urlencoding", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-sys 0.59.0", -] - -[[package]] -name = "rfd" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" -dependencies = [ - "block2 0.6.2", - "dispatch2", - "glib-sys", - "gobject-sys", - "gtk-sys", - "js-sys", - "log", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", - "raw-window-handle", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-sys 0.60.2", -] - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.17", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rkyv" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "rust_decimal" -version = "1.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c5108e3d4d903e21aac27f12ba5377b6b34f9f44b325e4894c7924169d06995" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand 0.8.6", - "rkyv", - "serde", - "serde_json", - "wasm-bindgen", -] - -[[package]] -name = "rustc-hash" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" -dependencies = [ - "bitflags 2.11.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "rustls" -version = "0.23.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" -dependencies = [ - "web-time", - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "indexmap 1.9.3", - "schemars_derive", - "serde", - "serde_json", - "url", - "uuid", -] - -[[package]] -name = "schemars" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.117", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "selectors" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" -dependencies = [ - "bitflags 2.11.1", - "cssparser", - "derive_more", - "log", - "new_debug_unreachable", - "phf", - "phf_codegen", - "precomputed-hash", - "rustc-hash", - "servo_arc", - "smallvec", -] - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" -dependencies = [ - "serde", - "serde_core", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde-untagged" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" -dependencies = [ - "erased-serde", - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "serde-xml-rs" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2215ce3e6a77550b80a1c37251b7d294febaf42e36e21b7b411e0bf54d540d" -dependencies = [ - "log", - "serde", - "thiserror 2.0.18", - "xml", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" -dependencies = [ - "itoa", - "serde", - "serde_core", -] - -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_spanned" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" -dependencies = [ - "serde_core", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05839ce67618e14a09b286535c0d9c94e85ef25469b0e13cb4f844e5593eb19" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.14.0", - "schemars 0.9.0", - "schemars 1.2.1", - "serde_core", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2ebbe86054f9b45bc3881e865683ccfaccce97b9b4cb53f3039d67f355a334" -dependencies = [ - "darling 0.23.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serialize-to-javascript" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" -dependencies = [ - "serde", - "serde_json", - "serialize-to-javascript-impl", -] - -[[package]] -name = "serialize-to-javascript-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "servo_arc" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "simd-adler32" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" - -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - -[[package]] -name = "siphasher" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "softbuffer" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" -dependencies = [ - "bytemuck", - "js-sys", - "ndk", - "objc2 0.6.4", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation 0.3.2", - "objc2-quartz-core", - "raw-window-handle", - "redox_syscall", - "tracing", - "wasm-bindgen", - "web-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "soup3" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" -dependencies = [ - "futures-channel", - "gio", - "glib", - "libc", - "soup3-sys", -] - -[[package]] -name = "soup3-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "spin_sleep" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c07347b7c0301b9adba4350bdcf09c039d0e7160922050db0439b3c6723c8ab" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "string_cache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - -[[package]] -name = "string_cache_codegen" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "swift-rs" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" -dependencies = [ - "base64 0.21.7", - "serde", - "serde_json", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "sys-locale" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" -dependencies = [ - "libc", -] - -[[package]] -name = "sysinfo" -version = "0.30.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" -dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "windows 0.52.0", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "system-configuration-sys 0.5.0", -] - -[[package]] -name = "system-configuration" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.9.4", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml 0.8.2", - "version-compare", -] - -[[package]] -name = "tao" -version = "0.35.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33f7f9e486ade65fcf1e45c440f9236c904f5c1002cdc7fc6ae582777345ce4" -dependencies = [ - "bitflags 2.11.1", - "block2 0.6.2", - "core-foundation 0.10.1", - "core-graphics", - "crossbeam-channel", - "dbus", - "dispatch2", - "dlopen2", - "dpi", - "gdkwayland-sys", - "gdkx11-sys", - "gtk", - "jni 0.21.1", - "libc", - "log", - "ndk", - "ndk-sys", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-foundation 0.3.2", - "objc2-ui-kit", - "once_cell", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "tao-macros", - "unicode-segmentation", - "url", - "windows 0.61.3", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "tao-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - -[[package]] -name = "tauri" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93bd86d231f0a8138f11a02a584769fe4b703dc36ae133d783228dbc4801405" -dependencies = [ - "anyhow", - "bytes", - "cookie", - "dirs 6.0.0", - "dunce", - "embed_plist", - "getrandom 0.3.4", - "glob", - "gtk", - "heck 0.5.0", - "http 1.4.0", - "http-range", - "jni 0.21.1", - "libc", - "log", - "mime", - "muda", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-foundation 0.3.2", - "objc2-ui-kit", - "objc2-web-kit", - "percent-encoding", - "plist", - "raw-window-handle", - "reqwest 0.13.3", - "serde", - "serde_json", - "serde_repr", - "serialize-to-javascript", - "swift-rs", - "tauri-build", - "tauri-macros", - "tauri-runtime", - "tauri-runtime-wry", - "tauri-utils", - "thiserror 2.0.18", - "tokio", - "tray-icon", - "url", - "webkit2gtk", - "webview2-com", - "window-vibrancy", - "windows 0.61.3", -] - -[[package]] -name = "tauri-build" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a318b234cc2dea65f575467bafcfb76286bce228ebc3778e337d61d03213007" -dependencies = [ - "anyhow", - "cargo_toml", - "dirs 6.0.0", - "glob", - "heck 0.5.0", - "json-patch", - "schemars 0.8.22", - "semver", - "serde", - "serde_json", - "tauri-utils", - "tauri-winres", - "walkdir", -] - -[[package]] -name = "tauri-codegen" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd11644962add2549a60b7e7c6800f17d7020156e02f516021d8103e80cc528" -dependencies = [ - "base64 0.22.1", - "brotli", - "ico", - "json-patch", - "plist", - "png 0.17.16", - "proc-macro2", - "quote", - "semver", - "serde", - "serde_json", - "sha2", - "syn 2.0.117", - "tauri-utils", - "thiserror 2.0.18", - "time", - "url", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-macros" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed9d3742a37a355d2e47c9af924e9fbc112abb76f9835d35d4780e318419502" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "tauri-codegen", - "tauri-utils", -] - -[[package]] -name = "tauri-plugin" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eefb2c18e8a605c23edb48fc56bb77381199e1a1e7f6ff0c9b970afe7b3cb8ee" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri-utils", - "walkdir", -] - -[[package]] -name = "tauri-plugin-clipboard-manager" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206dc20af4ed210748ba945c2774e60fd0acd52b9a73a028402caf809e9b6ecf" -dependencies = [ - "arboard", - "log", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", -] - -[[package]] -name = "tauri-plugin-dialog" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65981abb771e74e571a38196c3baa11c459379164791eba0e67abc1a5fac9884" -dependencies = [ - "log", - "raw-window-handle", - "rfd 0.16.0", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-plugin-fs", - "thiserror 2.0.18", - "url", -] - -[[package]] -name = "tauri-plugin-fs" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ecc274121aca0c036a2b42d1cbe83d368d348f54e0bb8a735c2b1548e8f371" -dependencies = [ - "anyhow", - "dunce", - "glob", - "log", - "objc2-foundation 0.3.2", - "percent-encoding", - "schemars 0.8.22", - "serde", - "serde_json", - "serde_repr", - "tauri", - "tauri-plugin", - "tauri-utils", - "thiserror 2.0.18", - "toml 1.1.2+spec-1.1.0", - "url", -] - -[[package]] -name = "tauri-plugin-global-shortcut" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424af23c7e88d05e4a1a6fc2c7be077912f8c76bd7900fd50aa2b7cbf5a2c405" -dependencies = [ - "global-hotkey", - "log", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", -] - -[[package]] -name = "tauri-plugin-http" -version = "2.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bd512048e1985b7ec78f96d99083e2ddaf7e0d906b2b63c44ce5bb8b894067" -dependencies = [ - "bytes", - "cookie_store", - "data-url", - "http 1.4.0", - "regex", - "reqwest 0.12.28", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-plugin-fs", - "thiserror 2.0.18", - "tokio", - "url", - "urlpattern", -] - -[[package]] -name = "tauri-plugin-log" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7545bd67f070a4500432c826e2e0682146a1d6712aee22a2786490156b574d93" -dependencies = [ - "android_logger", - "byte-unit", - "fern", - "log", - "objc2 0.6.4", - "objc2-foundation 0.3.2", - "serde", - "serde_json", - "serde_repr", - "swift-rs", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "time", -] - -[[package]] -name = "tauri-plugin-opener" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e1bea14edce6b793a04e2417e3fd924b9bc4faae83cdee7d714156cceeed29" -dependencies = [ - "dunce", - "glob", - "objc2-app-kit", - "objc2-foundation 0.3.2", - "open", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "url", - "windows 0.61.3", - "zbus", -] - -[[package]] -name = "tauri-plugin-os" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f08346c8deb39e96f86973da0e2d76cbb933d7ac9b750f6dc4daf955a6f997" -dependencies = [ - "gethostname", - "log", - "os_info", - "serde", - "serde_json", - "serialize-to-javascript", - "sys-locale", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", -] - -[[package]] -name = "tauri-plugin-shell" -version = "2.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8457dbf9e2bab1edd8df22bb2c20857a59a9868e79cb3eac5ed639eec4d0c73b" -dependencies = [ - "encoding_rs", - "log", - "open", - "os_pipe", - "regex", - "schemars 0.8.22", - "serde", - "serde_json", - "shared_child", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "tokio", -] - -[[package]] -name = "tauri-plugin-single-instance" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8f29386f5e9fdc699182388a33ee80a56de436d91b67459e86afef426282af" -dependencies = [ - "serde", - "serde_json", - "tauri", - "thiserror 2.0.18", - "tracing", - "windows-sys 0.60.2", - "zbus", -] - -[[package]] -name = "tauri-plugin-store" -version = "2.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c72dda16786eb4a3f903e43a17b64d8d78dc0f00fe2aa4b757c28f617a8630b" -dependencies = [ - "dunce", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "tokio", - "tracing", -] - -[[package]] -name = "tauri-runtime" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fef478ba1d2ac21c2d528740b24d0cb315e1e8b1111aae53fafac34804371fc" -dependencies = [ - "cookie", - "dpi", - "gtk", - "http 1.4.0", - "jni 0.21.1", - "objc2 0.6.4", - "objc2-ui-kit", - "objc2-web-kit", - "raw-window-handle", - "serde", - "serde_json", - "tauri-utils", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webview2-com", - "windows 0.61.3", -] - -[[package]] -name = "tauri-runtime-wry" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3989df2ae1c476404fe0a2e8ffc4cfbde97e51efd613c2bb5355fbc9ab52cf0" -dependencies = [ - "gtk", - "http 1.4.0", - "jni 0.21.1", - "log", - "objc2 0.6.4", - "objc2-app-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "softbuffer", - "tao", - "tauri-runtime", - "tauri-utils", - "url", - "webkit2gtk", - "webview2-com", - "windows 0.61.3", - "wry", -] - -[[package]] -name = "tauri-utils" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d57200389a2f82b4b0a40ae29ca19b6978116e8f4d4e974c3234ce40c0ffbdec" -dependencies = [ - "anyhow", - "brotli", - "cargo_metadata", - "ctor", - "dom_query", - "dunce", - "glob", - "http 1.4.0", - "infer", - "json-patch", - "log", - "memchr", - "phf", - "plist", - "proc-macro2", - "quote", - "regex", - "schemars 0.8.22", - "semver", - "serde", - "serde-untagged", - "serde_json", - "serde_with", - "swift-rs", - "thiserror 2.0.18", - "toml 1.1.2+spec-1.1.0", - "url", - "urlpattern", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-winres" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" -dependencies = [ - "dunce", - "embed-resource", - "toml 1.1.2+spec-1.1.0", -] - -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.2", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "tendril" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24" -dependencies = [ - "new_debug_unreachable", - "utf-8", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl 2.0.18", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tiff" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" -dependencies = [ - "fax", - "flate2", - "half", - "quick-error", - "weezl", - "zune-jpeg", -] - -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" -dependencies = [ - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.6.3", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "toml" -version = "0.9.12+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 0.7.5+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 0.7.15", -] - -[[package]] -name = "toml" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 1.0.2", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_datetime" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.14.0", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.25.11+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "winnow 1.0.2", -] - -[[package]] -name = "toml_parser" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" -dependencies = [ - "winnow 1.0.2", -] - -[[package]] -name = "toml_writer" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 1.0.2", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.11.1", - "bytes", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" -dependencies = [ - "bitflags 2.11.1", - "bytes", - "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "pin-project-lite", - "tower 0.5.3", - "tower-layer", - "tower-service", - "url", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tray-icon" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15edbb0d80583e85ee8df283410038e17314df5cba30da2087a54a85216c0773" -dependencies = [ - "crossbeam-channel", - "dirs 6.0.0", - "libappindicator", - "muda", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation 0.3.2", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "tree_magic_mini" -version = "3.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6" -dependencies = [ - "memchr", - "nom", - "petgraph", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "tungstenite" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.4.0", - "httparse", - "log", - "rand 0.8.6", - "sha1", - "thiserror 1.0.69", - "utf-8", -] - -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - -[[package]] -name = "typenum" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" - -[[package]] -name = "uds_windows" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" -dependencies = [ - "memoffset", - "tempfile", - "windows-sys 0.61.2", -] - -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-segmentation" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", - "serde_derive", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "urlpattern" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" -dependencies = [ - "regex", - "serde", - "unic-ucd-ident", - "url", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "utf8-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "uuid" -version = "1.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" -dependencies = [ - "getrandom 0.4.2", - "js-sys", - "serde_core", - "wasm-bindgen", -] - -[[package]] -name = "value-bag" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "vswhom" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" -dependencies = [ - "libc", - "vswhom-sys", -] - -[[package]] -name = "vswhom-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.3+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" -dependencies = [ - "wit-bindgen 0.57.1", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.117", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap 2.14.0", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasm-streams" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.15.5", - "indexmap 2.14.0", - "semver", -] - -[[package]] -name = "wayland-backend" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2857dd20b54e916ec7253b3d6b4d5c4d7d4ca2c33c2e11c6c76a99bd8744755d" -dependencies = [ - "cc", - "downcast-rs", - "rustix", - "scoped-tls", - "smallvec", - "wayland-sys", -] - -[[package]] -name = "wayland-client" -version = "0.31.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" -dependencies = [ - "bitflags 2.11.1", - "rustix", - "wayland-backend", - "wayland-scanner", -] - -[[package]] -name = "wayland-protocols" -version = "0.32.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563a85523cade2429938e790815fd7319062103b9f4a2dc806e9b53b95982d8f" -dependencies = [ - "bitflags 2.11.1", - "wayland-backend", - "wayland-client", - "wayland-scanner", -] - -[[package]] -name = "wayland-protocols-wlr" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" -dependencies = [ - "bitflags 2.11.1", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.31.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c324a910fd86ebdc364a3e61ec1f11737d3b1d6c273c0239ee8ff4bc0d24b4a" -dependencies = [ - "proc-macro2", - "quick-xml", - "quote", -] - -[[package]] -name = "wayland-sys" -version = "0.31.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" -dependencies = [ - "dlib", - "log", - "pkg-config", -] - -[[package]] -name = "web-sys" -version = "0.3.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web_atoms" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff6eef815df1834fd250e3a2ff436044d82a9f1bc1980ca1dbdf07effc538" -dependencies = [ - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", -] - -[[package]] -name = "webkit2gtk" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" -dependencies = [ - "bitflags 1.3.2", - "cairo-rs", - "gdk", - "gdk-sys", - "gio", - "gio-sys", - "glib", - "glib-sys", - "gobject-sys", - "gtk", - "gtk-sys", - "javascriptcore-rs", - "libc", - "once_cell", - "soup3", - "webkit2gtk-sys", -] - -[[package]] -name = "webkit2gtk-sys" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" -dependencies = [ - "bitflags 1.3.2", - "cairo-sys-rs", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "soup3-sys", - "system-deps", -] - -[[package]] -name = "webpki-roots" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "webview2-com" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" -dependencies = [ - "webview2-com-macros", - "webview2-com-sys", - "windows 0.61.3", - "windows-core 0.61.2", - "windows-implement 0.60.2", - "windows-interface 0.59.3", -] - -[[package]] -name = "webview2-com-macros" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "webview2-com-sys" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" -dependencies = [ - "thiserror 2.0.18", - "windows 0.61.3", - "windows-core 0.61.2", -] - -[[package]] -name = "weezl" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "window-vibrancy" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" -dependencies = [ - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", - "raw-window-handle", - "windows-sys 0.59.0", - "windows-version", -] - -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" -dependencies = [ - "windows-core 0.59.0", - "windows-targets 0.53.5", -] - -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections 0.2.0", - "windows-core 0.61.2", - "windows-future 0.2.1", - "windows-link 0.1.3", - "windows-numerics 0.2.0", -] - -[[package]] -name = "windows" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" -dependencies = [ - "windows-collections 0.3.2", - "windows-core 0.62.2", - "windows-future 0.3.2", - "windows-numerics 0.3.1", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-collections" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" -dependencies = [ - "windows-core 0.62.2", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" -dependencies = [ - "windows-implement 0.59.0", - "windows-interface 0.59.3", - "windows-result 0.3.4", - "windows-strings 0.3.1", - "windows-targets 0.53.5", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", - "windows-threading 0.1.0", -] - -[[package]] -name = "windows-future" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" -dependencies = [ - "windows-core 0.62.2", - "windows-link 0.2.1", - "windows-threading 0.2.1", -] - -[[package]] -name = "windows-implement" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-implement" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-numerics" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" -dependencies = [ - "windows-core 0.62.2", - "windows-link 0.2.1", -] - -[[package]] -name = "windows-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" -dependencies = [ - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link 0.2.1", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-threading" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - -[[package]] -name = "winnow" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.55.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" -dependencies = [ - "cfg-if", - "windows-sys 0.59.0", -] - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck 0.5.0", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck 0.5.0", - "indexmap 2.14.0", - "prettyplease", - "syn 2.0.117", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.117", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "indexmap 2.14.0", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.14.0", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "wl-clipboard-rs" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9651471a32e87d96ef3a127715382b2d11cc7c8bb9822ded8a7cc94072eb0a3" -dependencies = [ - "libc", - "log", - "os_pipe", - "rustix", - "thiserror 2.0.18", - "tree_magic_mini", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-wlr", -] - -[[package]] -name = "wmi" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7787dacdd8e71cbc104658aade4009300777f9b5fda6a75f19145fedb8a18e71" -dependencies = [ - "chrono", - "futures", - "log", - "serde", - "thiserror 2.0.18", - "windows 0.59.0", - "windows-core 0.59.0", -] - -[[package]] -name = "wrapcenum-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76ff259533532054cfbaefb115c613203c73707017459206380f03b3b3f266e" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "writeable" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" - -[[package]] -name = "wry" -version = "0.55.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186f9871daa55fd9c016578b810d149de58367113db7fb72b462d2323ce19514" -dependencies = [ - "base64 0.22.1", - "block2 0.6.2", - "cookie", - "crossbeam-channel", - "dirs 6.0.0", - "dom_query", - "dpi", - "dunce", - "gdkx11", - "gtk", - "http 1.4.0", - "javascriptcore-rs", - "jni 0.21.1", - "libc", - "ndk", - "objc2 0.6.4", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation 0.3.2", - "objc2-ui-kit", - "objc2-web-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "sha2", - "soup3", - "tao-macros", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webkit2gtk-sys", - "webview2-com", - "windows 0.61.3", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "x11" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" -dependencies = [ - "gethostname", - "rustix", - "x11rb-protocol", -] - -[[package]] -name = "x11rb-protocol" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" - -[[package]] -name = "xkeysym" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" - -[[package]] -name = "xml" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636f85e5ca6488e96401b61eb7de54f4e44755c988af0f52cf90230c312a1a89" - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "yoke" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - -[[package]] -name = "zbus" -version = "5.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1" -dependencies = [ - "async-broadcast", - "async-executor", - "async-io", - "async-lock", - "async-process", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "enumflags2", - "event-listener", - "futures-core", - "futures-lite", - "hex", - "libc", - "ordered-stream", - "rustix", - "serde", - "serde_repr", - "tracing", - "uds_windows", - "uuid", - "windows-sys 0.61.2", - "winnow 1.0.2", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "5.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "zbus_names", - "zvariant", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "4.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d" -dependencies = [ - "serde", - "winnow 1.0.2", - "zvariant", -] - -[[package]] -name = "zerocopy" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zerofrom" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zerotrie" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zip" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" -dependencies = [ - "aes", - "arbitrary", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "deflate64", - "displaydoc", - "flate2", - "getrandom 0.3.4", - "hmac", - "indexmap 2.14.0", - "lzma-rs", - "memchr", - "pbkdf2", - "sha1", - "thiserror 2.0.18", - "time", - "xz2", - "zeroize", - "zopfli", - "zstd", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" - -[[package]] -name = "zopfli" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] - -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "zune-core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9" - -[[package]] -name = "zune-jpeg" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" -dependencies = [ - "zune-core", -] - -[[package]] -name = "zvariant" -version = "5.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1567a6ec68df868cbbfde844cfc6d81649fe5109a62b116b19fabd53e618ee" -dependencies = [ - "endi", - "enumflags2", - "serde", - "url", - "winnow 1.0.2", - "zvariant_derive", - "zvariant_utils", -] - -[[package]] -name = "zvariant_derive" -version = "5.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d5b780599bbde114e39d9a0799577fad1ced5105d38515745f7b3099d8ceda" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "syn 2.0.117", - "winnow 1.0.2", -] diff --git a/参考/NexBox-main/src-tauri/Cargo.toml b/参考/NexBox-main/src-tauri/Cargo.toml deleted file mode 100644 index 5caf56d..0000000 --- a/参考/NexBox-main/src-tauri/Cargo.toml +++ /dev/null @@ -1,138 +0,0 @@ -[package] -name = "nexbox" -version = "5.9.8" -description = "NexBox - 为现代玩家打造的游戏工具箱" -authors = ["MuLiu_SaMa"] -license = "GPL-3.0" -repository = "" -edition = "2021" -rust-version = "1.77.2" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -name = "nexbox_lib" -crate-type = ["staticlib", "cdylib", "rlib"] - -[build-dependencies] -tauri-build = { version = "2.5", features = [] } - -[dependencies] -serde_json = "1.0" -serde = { version = "1.0", features = ["derive"] } -log = "0.4" -tauri = { version = "2.10", features = ["protocol-asset", "tray-icon", "devtools"] } -tauri-plugin-log = "2" -tauri-plugin-shell = "2" -tauri-plugin-fs = "2" -tauri-plugin-store = "2" -tauri-plugin-http = "2" -tauri-plugin-os = "2" -tauri-plugin-single-instance = "2" -tauri-plugin-global-shortcut = "2" -wmi = "0.14" -thiserror = "2" -reqwest = { version = "0.11", features = ["stream", "json", "blocking"] } -tokio = { version = "1", features = ["full"] } -tokio-tungstenite = "0.24" -tokio-stream = { version = "0.1", features = ["sync"] } -futures-util = "0.3" -dirs = "5.0" -nvml-wrapper = "0.10" -sysinfo = "0.30" -chrono = "0.4" -env_logger = "0.11" -regex = "1" -uuid = { version = "1", features = ["v4", "serde"] } -rand = "0.8" -rfd = "0.15" -tauri-plugin-dialog = "2" -urlencoding = "2.1" -url = "2" -base64 = "0.22" -bytes = "1" -dashmap = "6" -parking_lot = "0.12" -axum = "0.7" -tower = "0.4" -tower-http = { version = "0.5", features = ["fs", "cors", "trace"] } -async-stream = "0.3" -zip = "2" -tauri-plugin-opener = "2" -jpeg-encoder = { version = "0.6", features = ["simd"] } -tauri-plugin-clipboard-manager = "2" -btleplug = "0.12" -libloading = "0.8" -spin_sleep = "1.3" - -# 网易云 EAPI 加密 -md-5 = "0.10" -aes = "0.8" -cipher = "0.4" -hex = "0.4" - -[target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.59", features = [ - "Win32_Foundation", - "Win32_Globalization", - "Win32_Graphics_Gdi", - "Win32_Graphics_GdiPlus", - "Win32_UI_Accessibility", - "Win32_UI_ColorSystem", - "Win32_UI_Shell", - "Win32_UI_WindowsAndMessaging", - "Win32_System_LibraryLoader", - "Win32_System_ProcessStatus", - "Win32_System_Threading", - "Win32_System_Diagnostics_Etw", - "Win32_System_Time", - "Win32_NetworkManagement_IpHelper", - "Win32_Networking_WinSock", - "Win32_System_Services", - "Win32_Security", - "Win32_Storage_FileSystem", - "Win32_Media_Multimedia", - "Win32_Devices_Display", -] } -winreg = "0.52" -winapi = { version = "0.3", features = ["winuser", "windef", "shellapi"] } -windows = { version = "0.58", features = [ - "Win32_Foundation", - "Win32_Graphics_Dwm", - "Win32_System_Com", - "Win32_UI_WindowsAndMessaging", - "Win32_UI_Accessibility", - "Win32_UI_Shell", - "Win32_UI_Shell_PropertiesSystem", - "Win32_Security", - "Win32_System_Threading", - "Win32_Devices_Properties", - "Devices_Bluetooth", - "Devices_Bluetooth_Advertisement", - "Devices_Bluetooth_GenericAttributeProfile", - "Devices_Enumeration", - "Foundation", - "Foundation_Collections", - "Media_Control", - "Storage_Streams", - "Win32_Media_Audio", - "Win32_Media", - "Win32_Devices_DeviceAndDriverInstallation", - "Win32_Devices_Properties", - "Win32_System_Services", - "Win32_Storage", - "Win32_Storage_FileSystem", - "UI_UIAutomation", - "UI_Notifications", - "UI_Notifications_Management", - "ApplicationModel", - "implement", - "Win32_Graphics_Direct3D", - "Win32_Graphics_Direct3D11", - "Win32_Graphics_Dxgi", - "Win32_Graphics_Dxgi_Common", - "Win32_System_LibraryLoader", - "Win32_Graphics_Gdi", - "Win32_Media_MediaFoundation", - "Win32_Media_Multimedia", -] } diff --git a/参考/NexBox-main/src-tauri/build.rs b/参考/NexBox-main/src-tauri/build.rs deleted file mode 100644 index 85223b8..0000000 --- a/参考/NexBox-main/src-tauri/build.rs +++ /dev/null @@ -1,44 +0,0 @@ -fn main() { - #[cfg(target_os = "windows")] - { - use std::path::PathBuf; - use tauri_build::WindowsAttributes; - let mut windows = WindowsAttributes::new(); - windows = windows.app_manifest( r#" - - - - - - - - - - - - - - - "#); - let manifest_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR")); - let nvapi_lib = manifest_dir.join("..").join("R560-developer").join("amd64").join("nvapi64.lib"); - let nvapi_lib_dir = nvapi_lib.parent().expect("nvapi64.lib parent"); - println!("cargo:rustc-link-search=native={}", nvapi_lib_dir.display()); - println!("cargo:rustc-link-lib=nvapi64"); - println!("cargo:rerun-if-changed={}", nvapi_lib.display()); - tauri_build::try_build( - tauri_build::Attributes::new().windows_attributes(windows) - ).expect("Failed to run build script"); - } - #[cfg(not(target_os = "windows"))] - { - tauri_build::build(); - } -} diff --git a/参考/NexBox-main/src-tauri/capabilities/default.json b/参考/NexBox-main/src-tauri/capabilities/default.json deleted file mode 100644 index 7c26e75..0000000 --- a/参考/NexBox-main/src-tauri/capabilities/default.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "../gen/schemas/desktop-schema.json", - "identifier": "default", - "description": "enables the default permissions", - "windows": [ - "main", - "widget", - "tray-menu", - "netease-login", - "desktop-lyrics", - "vertical-overlay" - ], - "permissions": [ - "core:default", - "core:window:allow-minimize", - "core:window:allow-close", - "core:window:allow-start-dragging", - "core:window:allow-show", - "core:window:allow-hide", - "core:window:allow-set-focus", - "core:window:allow-set-size", - "core:window:allow-set-position", - "core:window:allow-set-always-on-top", - "core:window:allow-center", - "core:window:allow-set-decorations", - "core:window:allow-set-resizable", - "core:window:allow-set-title", - "core:window:allow-maximize", - "core:window:allow-unmaximize", - "core:window:allow-unminimize", - "core:window:allow-destroy", - "core:window:allow-set-ignore-cursor-events", - "core:webview:allow-create-webview-window", - "core:webview:allow-set-webview-focus", - "shell:allow-open", - "store:default", - "fs:default", - "opener:default", - "clipboard-manager:allow-read-text", - "clipboard-manager:allow-write-text", - "dialog:default" - ] -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/cargo_output.txt b/参考/NexBox-main/src-tauri/cargo_output.txt deleted file mode 100644 index a944eab..0000000 --- a/参考/NexBox-main/src-tauri/cargo_output.txt +++ /dev/null @@ -1 +0,0 @@ - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s diff --git a/参考/NexBox-main/src-tauri/check_output.txt b/参考/NexBox-main/src-tauri/check_output.txt deleted file mode 100644 index 2b40370..0000000 --- a/参考/NexBox-main/src-tauri/check_output.txt +++ /dev/null @@ -1,7 +0,0 @@ -cargo : Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s -所在位置 行:1 字符: 229 -+ ... $env:WSL_UTF8 = '1'; cd D:\NexBox\src-tauri; cargo check 2>&1 | Out-F ... -+ ~~~~~~~~~~~~~~~~ - + CategoryInfo : NotSpecified: ( Finished `d...get(s) in 0.72s:String) [], RemoteException - + FullyQualifiedErrorId : NativeCommandError - diff --git a/参考/NexBox-main/src-tauri/check_warnings.txt b/参考/NexBox-main/src-tauri/check_warnings.txt deleted file mode 100644 index df80f83..0000000 --- a/参考/NexBox-main/src-tauri/check_warnings.txt +++ /dev/null @@ -1,928 +0,0 @@ -warning: function `enable_performance_tweaks` is never used - --> src\optimization.rs:2371:14 - | -2371 | pub async fn enable_performance_tweaks() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default - -warning: function `disable_performance_tweaks` is never used - --> src\optimization.rs:2468:14 - | -2468 | pub async fn disable_performance_tweaks() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `remove_menu_delay` is never used - --> src\optimization.rs:2596:14 - | -2596 | pub async fn remove_menu_delay() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `restore_menu_delay` is never used - --> src\optimization.rs:2605:14 - | -2605 | pub async fn restore_menu_delay() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_network_throttling` is never used - --> src\optimization.rs:2614:14 - | -2614 | pub async fn disable_network_throttling() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_network_throttling` is never used - --> src\optimization.rs:2625:14 - | -2625 | pub async fn enable_network_throttling() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_error_reporting` is never used - --> src\optimization.rs:2635:14 - | -2635 | pub async fn disable_error_reporting() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_error_reporting` is never used - --> src\optimization.rs:2650:14 - | -2650 | pub async fn enable_error_reporting() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_compatibility_assistant` is never used - --> src\optimization.rs:2663:14 - | -2663 | pub async fn disable_compatibility_assistant() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_compatibility_assistant` is never used - --> src\optimization.rs:2673:14 - | -2673 | pub async fn enable_compatibility_assistant() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_print_service` is never used - --> src\optimization.rs:2683:14 - | -2683 | pub async fn disable_print_service() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_print_service` is never used - --> src\optimization.rs:2693:14 - | -2693 | pub async fn enable_print_service() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_fax_service` is never used - --> src\optimization.rs:2703:14 - | -2703 | pub async fn disable_fax_service() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_fax_service` is never used - --> src\optimization.rs:2713:14 - | -2713 | pub async fn enable_fax_service() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_sticky_keys` is never used - --> src\optimization.rs:2722:14 - | -2722 | pub async fn disable_sticky_keys() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_sticky_keys` is never used - --> src\optimization.rs:2737:14 - | -2737 | pub async fn enable_sticky_keys() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_smart_screen` is never used - --> src\optimization.rs:2751:14 - | -2751 | pub async fn disable_smart_screen() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_smart_screen` is never used - --> src\optimization.rs:2766:14 - | -2766 | pub async fn enable_smart_screen() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_system_restore` is never used - --> src\optimization.rs:2783:14 - | -2783 | pub async fn disable_system_restore() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_system_restore` is never used - --> src\optimization.rs:2795:14 - | -2795 | pub async fn enable_system_restore() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_superfetch` is never used - --> src\optimization.rs:2806:14 - | -2806 | pub async fn disable_superfetch() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `enable_superfetch` is never used - --> src\optimization.rs:2819:14 - | -2819 | pub async fn enable_superfetch() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `disable_hibernate` is never used - --> src\optimization.rs:2832:14 - | -2832 | pub async fn disable_hibernate() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `enable_hibernate` is never used - --> src\optimization.rs:2842:14 - | -2842 | pub async fn enable_hibernate() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `disable_ntfs_timestamp` is never used - --> src\optimization.rs:2852:14 - | -2852 | pub async fn disable_ntfs_timestamp() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_ntfs_timestamp` is never used - --> src\optimization.rs:2859:14 - | -2859 | pub async fn enable_ntfs_timestamp() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_telemetry_tasks` is never used - --> src\optimization.rs:2866:14 - | -2866 | pub async fn disable_telemetry_tasks() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_telemetry_tasks` is never used - --> src\optimization.rs:2910:14 - | -2910 | pub async fn enable_telemetry_tasks() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_media_player_sharing` is never used - --> src\optimization.rs:2951:14 - | -2951 | pub async fn disable_media_player_sharing() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_media_player_sharing` is never used - --> src\optimization.rs:2961:14 - | -2961 | pub async fn enable_media_player_sharing() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_home_group` is never used - --> src\optimization.rs:2971:14 - | -2971 | pub async fn disable_home_group() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `enable_home_group` is never used - --> src\optimization.rs:2984:14 - | -2984 | pub async fn enable_home_group() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `disable_smb1` is never used - --> src\optimization.rs:2997:14 - | -2997 | pub async fn disable_smb1() -> Result { - | ^^^^^^^^^^^^ - -warning: function `enable_smb1` is never used - --> src\optimization.rs:3006:14 - | -3006 | pub async fn enable_smb1() -> Result { - | ^^^^^^^^^^^ - -warning: function `disable_smb2` is never used - --> src\optimization.rs:3015:14 - | -3015 | pub async fn disable_smb2() -> Result { - | ^^^^^^^^^^^^ - -warning: function `enable_smb2` is never used - --> src\optimization.rs:3024:14 - | -3024 | pub async fn enable_smb2() -> Result { - | ^^^^^^^^^^^ - -warning: function `disable_office_telemetry` is never used - --> src\optimization.rs:3033:14 - | -3033 | pub async fn disable_office_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_office_telemetry` is never used - --> src\optimization.rs:3072:14 - | -3072 | pub async fn enable_office_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_firefox_telemetry` is never used - --> src\optimization.rs:3105:14 - | -3105 | pub async fn disable_firefox_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_firefox_telemetry` is never used - --> src\optimization.rs:3117:14 - | -3117 | pub async fn enable_firefox_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_chrome_telemetry` is never used - --> src\optimization.rs:3129:14 - | -3129 | pub async fn disable_chrome_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_chrome_telemetry` is never used - --> src\optimization.rs:3145:14 - | -3145 | pub async fn enable_chrome_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_nvidia_telemetry` is never used - --> src\optimization.rs:3160:14 - | -3160 | pub async fn disable_nvidia_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_nvidia_telemetry` is never used - --> src\optimization.rs:3175:14 - | -3175 | pub async fn enable_nvidia_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_vs_telemetry` is never used - --> src\optimization.rs:3190:14 - | -3190 | pub async fn disable_vs_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_vs_telemetry` is never used - --> src\optimization.rs:3210:14 - | -3210 | pub async fn enable_vs_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_telemetry_services` is never used - --> src\optimization.rs:3230:14 - | -3230 | pub async fn disable_telemetry_services() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_telemetry_services` is never used - --> src\optimization.rs:3258:14 - | -3258 | pub async fn enable_telemetry_services() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_cortana` is never used - --> src\optimization.rs:3288:14 - | -3288 | pub async fn disable_cortana() -> Result { - | ^^^^^^^^^^^^^^^ - -warning: function `enable_cortana` is never used - --> src\optimization.rs:3307:14 - | -3307 | pub async fn enable_cortana() -> Result { - | ^^^^^^^^^^^^^^ - -warning: function `disable_news_interests` is never used - --> src\optimization.rs:3328:14 - | -3328 | pub async fn disable_news_interests() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_news_interests` is never used - --> src\optimization.rs:3339:14 - | -3339 | pub async fn enable_news_interests() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_start_menu_ads` is never used - --> src\optimization.rs:3352:14 - | -3352 | pub async fn disable_start_menu_ads() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_start_menu_ads` is never used - --> src\optimization.rs:3382:14 - | -3382 | pub async fn enable_start_menu_ads() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_edge_telemetry` is never used - --> src\optimization.rs:3414:14 - | -3414 | pub async fn disable_edge_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_edge_telemetry` is never used - --> src\optimization.rs:3436:14 - | -3436 | pub async fn enable_edge_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_edge_discover_bar` is never used - --> src\optimization.rs:3460:14 - | -3460 | pub async fn disable_edge_discover_bar() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_edge_discover_bar` is never used - --> src\optimization.rs:3471:14 - | -3471 | pub async fn enable_edge_discover_bar() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `optimize_process_count` is never used - --> src\optimization.rs:3484:14 - | -3484 | pub async fn optimize_process_count() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `restore_process_count` is never used - --> src\optimization.rs:3494:14 - | -3494 | pub async fn restore_process_count() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_store_search_app` is never used - --> src\optimization.rs:3505:14 - | -3505 | pub async fn disable_store_search_app() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_store_search_app` is never used - --> src\optimization.rs:3515:14 - | -3515 | pub async fn enable_store_search_app() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_store_promotions` is never used - --> src\optimization.rs:3526:14 - | -3526 | pub async fn disable_store_promotions() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_store_promotions` is never used - --> src\optimization.rs:3544:14 - | -3544 | pub async fn enable_store_promotions() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_store_auto_update` is never used - --> src\optimization.rs:3564:14 - | -3564 | pub async fn disable_store_auto_update() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_store_auto_update` is never used - --> src\optimization.rs:3574:14 - | -3574 | pub async fn enable_store_auto_update() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_spotlight_lock` is never used - --> src\optimization.rs:3585:14 - | -3585 | pub async fn disable_spotlight_lock() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_spotlight_lock` is never used - --> src\optimization.rs:3598:14 - | -3598 | pub async fn enable_spotlight_lock() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_my_people` is never used - --> src\optimization.rs:3612:14 - | -3612 | pub async fn disable_my_people() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `enable_my_people` is never used - --> src\optimization.rs:3621:14 - | -3621 | pub async fn enable_my_people() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `disable_tpm_check` is never used - --> src\optimization.rs:3632:14 - | -3632 | pub async fn disable_tpm_check() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `enable_tpm_check` is never used - --> src\optimization.rs:3649:14 - | -3649 | pub async fn enable_tpm_check() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `disable_sensor_services` is never used - --> src\optimization.rs:3666:14 - | -3666 | pub async fn disable_sensor_services() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_sensor_services` is never used - --> src\optimization.rs:3678:14 - | -3678 | pub async fn enable_sensor_services() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `remove_cast_to_device` is never used - --> src\optimization.rs:3692:14 - | -3692 | pub async fn remove_cast_to_device() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `add_cast_to_device` is never used - --> src\optimization.rs:3702:14 - | -3702 | pub async fn add_cast_to_device() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_vbs` is never used - --> src\optimization.rs:3713:14 - | -3713 | pub async fn disable_vbs() -> Result { - | ^^^^^^^^^^^ - -warning: function `enable_vbs` is never used - --> src\optimization.rs:3722:14 - | -3722 | pub async fn enable_vbs() -> Result { - | ^^^^^^^^^^ - -warning: function `disable_modern_standby` is never used - --> src\optimization.rs:3733:14 - | -3733 | pub async fn disable_modern_standby() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_modern_standby` is never used - --> src\optimization.rs:3742:14 - | -3742 | pub async fn enable_modern_standby() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_gaming_mode` is never used - --> src\optimization.rs:3753:14 - | -3753 | pub async fn enable_gaming_mode() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_gaming_mode` is never used - --> src\optimization.rs:3765:14 - | -3765 | pub async fn disable_gaming_mode() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_xbox_live` is never used - --> src\optimization.rs:3779:14 - | -3779 | pub async fn disable_xbox_live() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `enable_xbox_live` is never used - --> src\optimization.rs:3797:14 - | -3797 | pub async fn enable_xbox_live() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `disable_game_bar` is never used - --> src\optimization.rs:3812:14 - | -3812 | pub async fn disable_game_bar() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `enable_game_bar` is never used - --> src\optimization.rs:3828:14 - | -3828 | pub async fn enable_game_bar() -> Result { - | ^^^^^^^^^^^^^^^ - -warning: function `disable_windows_ink` is never used - --> src\optimization.rs:3845:14 - | -3845 | pub async fn disable_windows_ink() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_windows_ink` is never used - --> src\optimization.rs:3857:14 - | -3857 | pub async fn enable_windows_ink() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `disable_spelling_typing` is never used - --> src\optimization.rs:3870:14 - | -3870 | pub async fn disable_spelling_typing() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_spelling_typing` is never used - --> src\optimization.rs:3884:14 - | -3884 | pub async fn enable_spelling_typing() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_app_launch_tracking` is never used - --> src\optimization.rs:3900:14 - | -3900 | pub async fn disable_app_launch_tracking() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_app_launch_tracking` is never used - --> src\optimization.rs:3910:14 - | -3910 | pub async fn enable_app_launch_tracking() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_advertising_id` is never used - --> src\optimization.rs:3922:14 - | -3922 | pub async fn disable_advertising_id() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_advertising_id` is never used - --> src\optimization.rs:3933:14 - | -3933 | pub async fn enable_advertising_id() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_file_system_access` is never used - --> src\optimization.rs:3945:14 - | -3945 | pub async fn disable_file_system_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_file_system_access` is never used - --> src\optimization.rs:3955:14 - | -3955 | pub async fn enable_file_system_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_documents_access` is never used - --> src\optimization.rs:3966:14 - | -3966 | pub async fn disable_documents_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_documents_access` is never used - --> src\optimization.rs:3976:14 - | -3976 | pub async fn enable_documents_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_calendar_access` is never used - --> src\optimization.rs:3987:14 - | -3987 | pub async fn disable_calendar_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_calendar_access` is never used - --> src\optimization.rs:3997:14 - | -3997 | pub async fn enable_calendar_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_contacts_access` is never used - --> src\optimization.rs:4008:14 - | -4008 | pub async fn disable_contacts_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_contacts_access` is never used - --> src\optimization.rs:4018:14 - | -4018 | pub async fn enable_contacts_access() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_language_tracking` is never used - --> src\optimization.rs:4029:14 - | -4029 | pub async fn disable_language_tracking() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_language_tracking` is never used - --> src\optimization.rs:4040:14 - | -4040 | pub async fn enable_language_tracking() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_welcome_experience` is never used - --> src\optimization.rs:4052:14 - | -4052 | pub async fn disable_welcome_experience() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_welcome_experience` is never used - --> src\optimization.rs:4063:14 - | -4063 | pub async fn enable_welcome_experience() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_feedback_frequency` is never used - --> src\optimization.rs:4075:14 - | -4075 | pub async fn disable_feedback_frequency() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_feedback_frequency` is never used - --> src\optimization.rs:4088:14 - | -4088 | pub async fn enable_feedback_frequency() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_diagnostic_data` is never used - --> src\optimization.rs:4101:14 - | -4101 | pub async fn disable_diagnostic_data() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_diagnostic_data` is never used - --> src\optimization.rs:4117:14 - | -4117 | pub async fn enable_diagnostic_data() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_writing_habits` is never used - --> src\optimization.rs:4132:14 - | -4132 | pub async fn disable_writing_habits() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_writing_habits` is never used - --> src\optimization.rs:4148:14 - | -4148 | pub async fn enable_writing_habits() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_ceip` is never used - --> src\optimization.rs:4164:14 - | -4164 | pub async fn disable_ceip() -> Result { - | ^^^^^^^^^^^^ - -warning: function `enable_ceip` is never used - --> src\optimization.rs:4173:14 - | -4173 | pub async fn enable_ceip() -> Result { - | ^^^^^^^^^^^ - -warning: function `disable_trk_wks` is never used - --> src\optimization.rs:4184:14 - | -4184 | pub async fn disable_trk_wks() -> Result { - | ^^^^^^^^^^^^^^^ - -warning: function `enable_trk_wks` is never used - --> src\optimization.rs:4194:14 - | -4194 | pub async fn enable_trk_wks() -> Result { - | ^^^^^^^^^^^^^^ - -warning: function `disable_auto_maintenance` is never used - --> src\optimization.rs:4205:14 - | -4205 | pub async fn disable_auto_maintenance() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_auto_maintenance` is never used - --> src\optimization.rs:4214:14 - | -4214 | pub async fn enable_auto_maintenance() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_large_sys_cache` is never used - --> src\optimization.rs:4225:14 - | -4225 | pub async fn enable_large_sys_cache() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_large_sys_cache` is never used - --> src\optimization.rs:4234:14 - | -4234 | pub async fn disable_large_sys_cache() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_spectre_patch` is never used - --> src\optimization.rs:4245:14 - | -4245 | pub async fn disable_spectre_patch() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_spectre_patch` is never used - --> src\optimization.rs:4255:14 - | -4255 | pub async fn enable_spectre_patch() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_auto_debug` is never used - --> src\optimization.rs:4267:14 - | -4267 | pub async fn disable_auto_debug() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `enable_auto_debug` is never used - --> src\optimization.rs:4277:14 - | -4277 | pub async fn enable_auto_debug() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `disable_crash_dump` is never used - --> src\optimization.rs:4289:14 - | -4289 | pub async fn disable_crash_dump() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `enable_crash_dump` is never used - --> src\optimization.rs:4298:14 - | -4298 | pub async fn enable_crash_dump() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `disable_audit_log` is never used - --> src\optimization.rs:4309:14 - | -4309 | pub async fn disable_audit_log() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `enable_audit_log` is never used - --> src\optimization.rs:4318:14 - | -4318 | pub async fn enable_audit_log() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `disable_wfp_diag` is never used - --> src\optimization.rs:4329:14 - | -4329 | pub async fn disable_wfp_diag() -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `enable_wfp_diag` is never used - --> src\optimization.rs:4338:14 - | -4338 | pub async fn enable_wfp_diag() -> Result { - | ^^^^^^^^^^^^^^^ - -warning: function `disable_address_book_collect` is never used - --> src\optimization.rs:4349:14 - | -4349 | pub async fn disable_address_book_collect() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_address_book_collect` is never used - --> src\optimization.rs:4358:14 - | -4358 | pub async fn enable_address_book_collect() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_typing_collection` is never used - --> src\optimization.rs:4369:14 - | -4369 | pub async fn disable_typing_collection() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_typing_collection` is never used - --> src\optimization.rs:4379:14 - | -4379 | pub async fn enable_typing_collection() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_silent_app_install` is never used - --> src\optimization.rs:4391:14 - | -4391 | pub async fn disable_silent_app_install() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_silent_app_install` is never used - --> src\optimization.rs:4400:14 - | -4400 | pub async fn enable_silent_app_install() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_wifi_hotspots` is never used - --> src\optimization.rs:4411:14 - | -4411 | pub async fn disable_wifi_hotspots() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_wifi_hotspots` is never used - --> src\optimization.rs:4421:14 - | -4421 | pub async fn enable_wifi_hotspots() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_typing_insights` is never used - --> src\optimization.rs:4432:14 - | -4432 | pub async fn disable_typing_insights() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_typing_insights` is never used - --> src\optimization.rs:4441:14 - | -4441 | pub async fn enable_typing_insights() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_preinstalled_apps` is never used - --> src\optimization.rs:4452:14 - | -4452 | pub async fn disable_preinstalled_apps() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_preinstalled_apps` is never used - --> src\optimization.rs:4461:14 - | -4461 | pub async fn enable_preinstalled_apps() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_dotnet_telemetry` is never used - --> src\optimization.rs:4472:14 - | -4472 | pub async fn disable_dotnet_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_dotnet_telemetry` is never used - --> src\optimization.rs:4481:14 - | -4481 | pub async fn enable_dotnet_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_pwsh_telemetry` is never used - --> src\optimization.rs:4492:14 - | -4492 | pub async fn disable_pwsh_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_pwsh_telemetry` is never used - --> src\optimization.rs:4501:14 - | -4501 | pub async fn enable_pwsh_telemetry() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `check_all_tweak_states` is never used - --> src\optimization.rs:4906:14 - | -4906 | pub async fn check_all_tweak_states() -> Result, String> { - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: function `disable_wifi_sense` is never used - --> src\optimization.rs:5021:14 - | -5021 | pub async fn disable_wifi_sense() -> Result { - | ^^^^^^^^^^^^^^^^^^ - -warning: function `enable_wifi_sense` is never used - --> src\optimization.rs:5032:14 - | -5032 | pub async fn enable_wifi_sense() -> Result { - | ^^^^^^^^^^^^^^^^^ - -warning: function `disable_step_recorder` is never used - --> src\optimization.rs:5044:14 - | -5044 | pub async fn disable_step_recorder() -> Result { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: function `enable_step_recorder` is never used - --> src\optimization.rs:5054:14 - | -5054 | pub async fn enable_step_recorder() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: function `run_batch_script` is never used - --> src\optimization.rs:5064:4 - | -5064 | fn run_batch_script(script: &str, success_msg: &str, admin_msg: &str) -> Result { - | ^^^^^^^^^^^^^^^^ - -warning: function `batch_enable_tweaks` is never used - --> src\optimization.rs:5083:14 - | -5083 | pub async fn batch_enable_tweaks() -> Result { - | ^^^^^^^^^^^^^^^^^^^ - -warning: function `batch_disable_tweaks` is never used - --> src\optimization.rs:5481:14 - | -5481 | pub async fn batch_disable_tweaks() -> Result { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: `nexbox` (lib) generated 154 warnings - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.76s diff --git a/参考/NexBox-main/src-tauri/clippy_output.txt b/参考/NexBox-main/src-tauri/clippy_output.txt deleted file mode 100644 index 0351e67..0000000 --- a/参考/NexBox-main/src-tauri/clippy_output.txt +++ /dev/null @@ -1 +0,0 @@ - Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.94s diff --git a/参考/NexBox-main/src-tauri/icc_debug.pdb b/参考/NexBox-main/src-tauri/icc_debug.pdb deleted file mode 100644 index f01e689..0000000 Binary files a/参考/NexBox-main/src-tauri/icc_debug.pdb and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/128x128.png b/参考/NexBox-main/src-tauri/icons/128x128.png deleted file mode 100644 index 2a7a5e8..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/128x128.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/128x128@2x.png b/参考/NexBox-main/src-tauri/icons/128x128@2x.png deleted file mode 100644 index a8d7e45..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/128x128@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/32x32.png b/参考/NexBox-main/src-tauri/icons/32x32.png deleted file mode 100644 index 62a7309..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/32x32.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/64x64.png b/参考/NexBox-main/src-tauri/icons/64x64.png deleted file mode 100644 index c30f8ff..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/64x64.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square107x107Logo.png b/参考/NexBox-main/src-tauri/icons/Square107x107Logo.png deleted file mode 100644 index dba1e57..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square107x107Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square142x142Logo.png b/参考/NexBox-main/src-tauri/icons/Square142x142Logo.png deleted file mode 100644 index 0751ebe..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square142x142Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square150x150Logo.png b/参考/NexBox-main/src-tauri/icons/Square150x150Logo.png deleted file mode 100644 index efb78ae..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square150x150Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square284x284Logo.png b/参考/NexBox-main/src-tauri/icons/Square284x284Logo.png deleted file mode 100644 index c5e4103..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square284x284Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square30x30Logo.png b/参考/NexBox-main/src-tauri/icons/Square30x30Logo.png deleted file mode 100644 index e5d6bfe..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square30x30Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square310x310Logo.png b/参考/NexBox-main/src-tauri/icons/Square310x310Logo.png deleted file mode 100644 index a4550e2..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square310x310Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square44x44Logo.png b/参考/NexBox-main/src-tauri/icons/Square44x44Logo.png deleted file mode 100644 index 47e9e87..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square44x44Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square71x71Logo.png b/参考/NexBox-main/src-tauri/icons/Square71x71Logo.png deleted file mode 100644 index 922d934..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square71x71Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/Square89x89Logo.png b/参考/NexBox-main/src-tauri/icons/Square89x89Logo.png deleted file mode 100644 index 5905891..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/Square89x89Logo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/StoreLogo.png b/参考/NexBox-main/src-tauri/icons/StoreLogo.png deleted file mode 100644 index ff64ec2..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/StoreLogo.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/参考/NexBox-main/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 2ffbf24..0000000 --- a/参考/NexBox-main/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 6f28035..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 7c9f2d6..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 7153838..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 3f42782..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index cf14e12..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index f066a90..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 783f6e5..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index 5db6bbd..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 2272b2d..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index b5d9c0f..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 7141938..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index bec6da8..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index b1c9145..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 65460de..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 472ff62..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/android/values/ic_launcher_background.xml b/参考/NexBox-main/src-tauri/icons/android/values/ic_launcher_background.xml deleted file mode 100644 index ea9c223..0000000 --- a/参考/NexBox-main/src-tauri/icons/android/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #fff - \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/icons/icon.icns b/参考/NexBox-main/src-tauri/icons/icon.icns deleted file mode 100644 index 7b9316b..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/icon.icns and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/icon.ico b/参考/NexBox-main/src-tauri/icons/icon.ico deleted file mode 100644 index 02889a9..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/icon.ico and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/icon.png b/参考/NexBox-main/src-tauri/icons/icon.png deleted file mode 100644 index 3332566..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/icon.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@1x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@1x.png deleted file mode 100644 index 2b24dc2..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@1x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x-1.png deleted file mode 100644 index f94f905..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x-1.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x.png deleted file mode 100644 index f94f905..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@3x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@3x.png deleted file mode 100644 index ab5d4ca..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-20x20@3x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@1x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@1x.png deleted file mode 100644 index 2d78ac3..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@1x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x-1.png deleted file mode 100644 index 7431b6b..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x-1.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x.png deleted file mode 100644 index 7431b6b..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@3x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@3x.png deleted file mode 100644 index 169825a..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-29x29@3x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@1x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@1x.png deleted file mode 100644 index f94f905..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@1x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x-1.png deleted file mode 100644 index d194f3e..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x-1.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x.png deleted file mode 100644 index d194f3e..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@3x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@3x.png deleted file mode 100644 index 6b02c74..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-40x40@3x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-512@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-512@2x.png deleted file mode 100644 index af3ba86..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-512@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@2x.png deleted file mode 100644 index 6b02c74..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@3x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@3x.png deleted file mode 100644 index 8cfde0a..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-60x60@3x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@1x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@1x.png deleted file mode 100644 index 1475afa..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@1x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@2x.png deleted file mode 100644 index 25ad484..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-76x76@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/参考/NexBox-main/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png deleted file mode 100644 index bc78388..0000000 Binary files a/参考/NexBox-main/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/src/announcement.rs b/参考/NexBox-main/src-tauri/src/announcement.rs deleted file mode 100644 index 41e0e43..0000000 --- a/参考/NexBox-main/src-tauri/src/announcement.rs +++ /dev/null @@ -1,151 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::path::PathBuf; -use std::sync::{Arc, OnceLock}; -use std::time::{Duration, Instant}; -use tokio::sync::RwLock; - -const ANNOUNCEMENT_URL: &str = "https://gitee.com/muliuawa/nexbox/raw/master/notice.json"; -const CACHE_FILE_NAME: &str = "announcement_cache.json"; -const CONNECT_TIMEOUT_SECS: u64 = 3; -const REQUEST_TIMEOUT_SECS: u64 = 5; -const MEMORY_CACHE_TTL_SECS: u64 = 30; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct Announcement { - pub title: String, - pub content: String, - pub important: bool, - pub create_time: String, -} - -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct AnnouncementResponse { - pub version: u32, - pub announce_list: Vec, -} - -struct MemoryCache { - data: Option, - fetched_at: Option, -} - -impl MemoryCache { - fn new() -> Self { - Self { - data: None, - fetched_at: None, - } - } - - fn get(&self) -> Option { - if let (Some(data), Some(fetched_at)) = (&self.data, self.fetched_at) { - if fetched_at.elapsed() < Duration::from_secs(MEMORY_CACHE_TTL_SECS) { - return Some(data.clone()); - } - } - None - } - - fn set(&mut self, data: AnnouncementResponse) { - self.data = Some(data); - self.fetched_at = Some(Instant::now()); - } -} - -static MEMORY_CACHE: OnceLock>> = OnceLock::new(); - -fn get_memory_cache() -> Arc> { - MEMORY_CACHE - .get_or_init(|| Arc::new(RwLock::new(MemoryCache::new()))) - .clone() -} - -fn get_cache_path() -> Option { - dirs::cache_dir().map(|p| p.join("NexBox").join(CACHE_FILE_NAME)) -} - -fn save_to_cache(data: &AnnouncementResponse) { - if let Some(cache_path) = get_cache_path() { - if let Some(parent) = cache_path.parent() { - let _ = fs::create_dir_all(parent); - } - if let Ok(json) = serde_json::to_string_pretty(data) { - let _ = fs::write(&cache_path, json); - } - } -} - -fn load_from_cache() -> Option { - if let Some(cache_path) = get_cache_path() { - if cache_path.exists() { - if let Ok(content) = fs::read_to_string(&cache_path) { - if let Ok(data) = serde_json::from_str::(&content) { - return Some(data); - } - } - } - } - None -} - -pub async fn fetch_announcements() -> Result { - let client = reqwest::Client::builder() - .connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS)) - .timeout(Duration::from_secs(REQUEST_TIMEOUT_SECS)) - .build() - .map_err(|e| format!("Failed to create HTTP client: {}", e))?; - - let response = client - .get(ANNOUNCEMENT_URL) - .send() - .await - .map_err(|e| format!("Network request failed: {}", e))?; - - if !response.status().is_success() { - return Err(format!("HTTP error: {}", response.status())); - } - - let text = response - .text() - .await - .map_err(|e| format!("Failed to read response: {}", e))?; - - let data: AnnouncementResponse = serde_json::from_str(&text) - .map_err(|e| format!("JSON parse error: {}", e))?; - - save_to_cache(&data); - - let cache = get_memory_cache(); - cache.write().await.set(data.clone()); - - Ok(data) -} - -#[tauri::command] -pub async fn get_announcements() -> AnnouncementResponse { - { - let cache = get_memory_cache(); - if let Some(data) = cache.read().await.get() { - return data; - }; - } - - match fetch_announcements().await { - Ok(data) => data, - Err(e) => { - log::warn!("Failed to fetch announcements: {}, trying cache...", e); - load_from_cache().unwrap_or_default() - } - } -} - -#[tauri::command] -pub async fn get_important_announcements() -> Vec { - let announcements = get_announcements().await; - announcements - .announce_list - .into_iter() - .filter(|a| a.important) - .collect() -} diff --git a/参考/NexBox-main/src-tauri/src/audio_engine.rs b/参考/NexBox-main/src-tauri/src/audio_engine.rs deleted file mode 100644 index 160ab7c..0000000 --- a/参考/NexBox-main/src-tauri/src/audio_engine.rs +++ /dev/null @@ -1,1292 +0,0 @@ -//! Native WASAPI audio engine with real-time EQ processing. -//! -//! Replaces wujieq.exe with in-process: -//! WASAPI Loopback capture (FxSound virtual device) -> Biquad EQ -> WASAPI render (physical device) - -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; -use std::sync::{Arc, OnceLock, RwLock}; -use std::thread::{self, JoinHandle}; -use std::time::Duration; -use log::{info, warn, error}; - -use windows::Win32::Media::Audio as wa; -use windows::Win32::System::Com::{ - CoInitializeEx, CoCreateInstance, CoUninitialize, CoTaskMemFree, - COINIT_MULTITHREADED, CLSCTX_ALL, -}; -use windows::Win32::UI::Shell::PropertiesSystem::{IPropertyStore, PROPERTYKEY}; -use windows::core::{GUID, PCWSTR}; - -// ── Constants ────────────────────────────────────────────────────────── - -#[allow(dead_code)] -const WAVE_FORMAT_PCM: u16 = 1; -const WAVE_FORMAT_IEEE_FLOAT: u16 = 3; -const WAVE_FORMAT_EXTENSIBLE: u16 = 0xFFFE; - -/// {00000001-0000-0010-8000-00aa00389b71} = KSDATAFORMAT_SUBTYPE_PCM -#[allow(dead_code)] -const KSDATAFORMAT_SUBTYPE_PCM: GUID = GUID::from_values( - 0x00000001, 0x0000, 0x0010, - [0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71], -); - -/// {00000003-0000-0010-8000-00aa00389b71} = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT -const KSDATAFORMAT_SUBTYPE_IEEE_FLOAT: GUID = GUID::from_values( - 0x00000003, 0x0000, 0x0010, - [0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71], -); - -/// 10-band EQ standard frequencies -const EQ_FREQS: [f64; 10] = [31.0, 62.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0]; - -// ── Public Types ────────────────────────────────────────────────────── - -#[derive(Debug, Clone)] -pub struct EqParams { - pub bands: Vec, - pub enabled: bool, - pub version: u64, - pub preamp: f64, // 总增益 -12..+12 dB -} - -#[derive(Debug, Clone)] -pub struct BandParam { - #[allow(dead_code)] - pub freq: f64, - pub gain: f64, -} - -/// 音效参数:保真/环境/环绕/动态/低音 -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct SoundEffectParams { - pub clarity: f64, // 保真 0.0-1.0 - pub ambience: f64, // 环境 0.0-1.0 - pub width: f64, // 环绕 0.0-1.0 - pub dynamics: f64, // 动态 0.0-1.0 - pub bass: f64, // 低音 0.0-1.0 - pub version: u64, -} - -impl Default for SoundEffectParams { - fn default() -> Self { - Self { clarity: 0.0, ambience: 0.0, width: 0.0, dynamics: 0.0, bass: 0.0, version: 0 } - } -} - -impl Default for EqParams { - fn default() -> Self { - Self { - bands: EQ_FREQS.iter().map(|&f| BandParam { freq: f, gain: 0.0 }).collect(), - enabled: true, - version: 0, - preamp: 0.0, - } - } -} - -// ── Biquad Filter (Direct Form II Transposed) ───────────────────────── - -#[derive(Debug, Clone, Copy)] -struct BiquadCoeffs { - b0: f64, b1: f64, b2: f64, - a1: f64, a2: f64, -} - -struct BiquadFilter { - coeffs: BiquadCoeffs, - z1: f64, - z2: f64, -} - -impl BiquadFilter { - fn new() -> Self { - Self { - coeffs: BiquadCoeffs { b0: 1.0, b1: 0.0, b2: 0.0, a1: 0.0, a2: 0.0 }, - z1: 0.0, z2: 0.0, - } - } - - fn set_peaking(&mut self, sample_rate: f64, freq: f64, gain_db: f64, q: f64) { - let a = 10.0_f64.powf(gain_db / 40.0); - let w0 = 2.0 * std::f64::consts::PI * freq / sample_rate; - let cos_w0 = w0.cos(); - let sin_w0 = w0.sin(); - let alpha = sin_w0 / (2.0 * q); - let b0 = 1.0 + alpha * a; - let b1 = -2.0 * cos_w0; - let b2 = 1.0 - alpha * a; - let a0 = 1.0 + alpha / a; - let a1 = -2.0 * cos_w0; - let a2 = 1.0 - alpha / a; - self.coeffs = BiquadCoeffs { b0: b0/a0, b1: b1/a0, b2: b2/a0, a1: a1/a0, a2: a2/a0 }; - } - - fn set_low_shelf(&mut self, sample_rate: f64, freq: f64, gain_db: f64, q: f64) { - let a = 10.0_f64.powf(gain_db / 40.0); - let w0 = 2.0 * std::f64::consts::PI * freq / sample_rate; - let cos_w0 = w0.cos(); - let sin_w0 = w0.sin(); - let alpha = sin_w0 / (2.0 * q); - let sq_a = a.sqrt(); - let b0 = a * ((a + 1.0) - (a - 1.0) * cos_w0 + 2.0 * alpha * sq_a); - let b1 = 2.0 * a * ((a - 1.0) - (a + 1.0) * cos_w0); - let b2 = a * ((a + 1.0) - (a - 1.0) * cos_w0 - 2.0 * alpha * sq_a); - let a0 = (a + 1.0) + (a - 1.0) * cos_w0 + 2.0 * alpha * sq_a; - let a1 = -2.0 * ((a - 1.0) + (a + 1.0) * cos_w0); - let a2 = (a + 1.0) + (a - 1.0) * cos_w0 - 2.0 * alpha * sq_a; - self.coeffs = BiquadCoeffs { b0: b0/a0, b1: b1/a0, b2: b2/a0, a1: a1/a0, a2: a2/a0 }; - } - - fn set_high_shelf(&mut self, sample_rate: f64, freq: f64, gain_db: f64, q: f64) { - let a = 10.0_f64.powf(gain_db / 40.0); - let w0 = 2.0 * std::f64::consts::PI * freq / sample_rate; - let cos_w0 = w0.cos(); - let sin_w0 = w0.sin(); - let alpha = sin_w0 / (2.0 * q); - let sq_a = a.sqrt(); - let b0 = a * ((a + 1.0) + (a - 1.0) * cos_w0 + 2.0 * alpha * sq_a); - let b1 = -2.0 * a * ((a - 1.0) + (a + 1.0) * cos_w0); - let b2 = a * ((a + 1.0) + (a - 1.0) * cos_w0 - 2.0 * alpha * sq_a); - let a0 = (a + 1.0) - (a - 1.0) * cos_w0 + 2.0 * alpha * sq_a; - let a1 = 2.0 * ((a - 1.0) - (a + 1.0) * cos_w0); - let a2 = (a + 1.0) - (a - 1.0) * cos_w0 - 2.0 * alpha * sq_a; - self.coeffs = BiquadCoeffs { b0: b0/a0, b1: b1/a0, b2: b2/a0, a1: a1/a0, a2: a2/a0 }; - } - - fn set_highpass(&mut self, sample_rate: f64, freq: f64, q: f64) { - let w0 = 2.0 * std::f64::consts::PI * freq / sample_rate; - let cos_w0 = w0.cos(); - let sin_w0 = w0.sin(); - let alpha = sin_w0 / (2.0 * q); - let b0 = (1.0 + cos_w0) / 2.0; - let b1 = -(1.0 + cos_w0); - let b2 = b0; - let a0 = 1.0 + alpha; - let a1 = -2.0 * cos_w0; - let a2 = 1.0 - alpha; - self.coeffs = BiquadCoeffs { b0: b0/a0, b1: b1/a0, b2: b2/a0, a1: a1/a0, a2: a2/a0 }; - } - - #[allow(dead_code)] - fn set_lowpass(&mut self, sample_rate: f64, freq: f64, q: f64) { - let w0 = 2.0 * std::f64::consts::PI * freq / sample_rate; - let cos_w0 = w0.cos(); - let sin_w0 = w0.sin(); - let alpha = sin_w0 / (2.0 * q); - let b0 = (1.0 - cos_w0) / 2.0; - let b1 = 1.0 - cos_w0; - let b2 = b0; - let a0 = 1.0 + alpha; - let a1 = -2.0 * cos_w0; - let a2 = 1.0 - alpha; - self.coeffs = BiquadCoeffs { b0: b0/a0, b1: b1/a0, b2: b2/a0, a1: a1/a0, a2: a2/a0 }; - } - - - #[inline(always)] - fn process(&mut self, x: f64) -> f64 { - let c = &self.coeffs; - let y = c.b0 * x + self.z1; - self.z1 = c.b1 * x - c.a1 * y + self.z2; - self.z2 = c.b2 * x - c.a2 * y; - y - } - - fn reset(&mut self) { self.z1 = 0.0; self.z2 = 0.0; } -} - -// ── EQ Filter Chain ─────────────────────────────────────────────────── - -struct EqChain { - filters: Vec, - sample_rate: f64, -} - -impl EqChain { - fn new(sample_rate: f64, num_channels: usize) -> Self { - // 初始分配 10 段 * 通道数,后续在 update 中动态调整 - let filters = (0..(10 * num_channels)).map(|_| BiquadFilter::new()).collect(); - Self { filters, sample_rate } - } - - fn update(&mut self, bands: &[BandParam], num_channels: usize) { - let num_bands = bands.len(); - if num_bands == 0 { return; } - // 确保滤波器数量足够 - let needed = num_bands * num_channels; - if self.filters.len() < needed { - self.filters.resize_with(needed, BiquadFilter::new); - } - let q = 1.41; - for ch in 0..num_channels { - for i in 0..num_bands { - let idx = ch * num_bands + i; - if idx >= self.filters.len() { break; } - let freq = bands[i].freq; - let gain = bands[i].gain; - if i == 0 { - self.filters[idx].set_low_shelf(self.sample_rate, freq, gain, q); - } else if i == num_bands - 1 { - self.filters[idx].set_high_shelf(self.sample_rate, freq, gain, q); - } else { - self.filters[idx].set_peaking(self.sample_rate, freq, gain, q); - } - } - } - } - - fn process_interleaved(&mut self, samples: &mut [f64], num_channels: usize) { - let num_bands = if num_channels > 0 { self.filters.len() / num_channels } else { 0 }; - if num_bands == 0 { return; } - let num_frames = samples.len() / num_channels; - for frame in 0..num_frames { - for ch in 0..num_channels { - let idx = frame * num_channels + ch; - let mut s = samples[idx]; - for band in 0..num_bands { - let fidx = ch * num_bands + band; - if fidx < self.filters.len() { s = self.filters[fidx].process(s); } - } - samples[idx] = s; - } - } - } - - fn reset(&mut self) { for f in &mut self.filters { f.reset(); } } -} - -// ── Audio Format Handling ───────────────────────────────────────────── - -#[derive(Debug, Clone, Copy, PartialEq)] -enum AudioSampleFormat { Pcm16, Pcm24, Pcm32, Float32 } - -struct FormatInfo { - sample_format: AudioSampleFormat, - sample_rate: u32, - channels: u16, - block_align: u16, -} - -fn parse_format(wfx: &wa::WAVEFORMATEX) -> FormatInfo { - let sample_format = if wfx.wFormatTag == WAVE_FORMAT_EXTENSIBLE { - // WAVEFORMATEXTENSIBLE is packed, read SubFormat via raw pointer - let ext_ptr = wfx as *const wa::WAVEFORMATEX as *const wa::WAVEFORMATEXTENSIBLE; - let sub_format = unsafe { std::ptr::addr_of!((*ext_ptr).SubFormat).read_unaligned() }; - if sub_format == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT { - AudioSampleFormat::Float32 - } else { - match unsafe { (*ext_ptr).Format.wBitsPerSample } { - 16 => AudioSampleFormat::Pcm16, - 24 => AudioSampleFormat::Pcm24, - _ => AudioSampleFormat::Pcm32, - } - } - } else if wfx.wFormatTag == WAVE_FORMAT_IEEE_FLOAT { - AudioSampleFormat::Float32 - } else { - match wfx.wBitsPerSample { - 16 => AudioSampleFormat::Pcm16, - 24 => AudioSampleFormat::Pcm24, - _ => AudioSampleFormat::Pcm32, - } - }; - - FormatInfo { - sample_format, - sample_rate: wfx.nSamplesPerSec, - channels: wfx.nChannels, - block_align: wfx.nBlockAlign, - } -} - -fn bytes_to_f64(data: &[u8], format: AudioSampleFormat, num_samples: usize) -> Vec { - let mut result = Vec::with_capacity(num_samples); - match format { - AudioSampleFormat::Float32 => { - let ptr = data.as_ptr() as *const f32; - for i in 0..num_samples { - result.push(unsafe { *ptr.add(i) } as f64); - } - } - AudioSampleFormat::Pcm16 => { - let ptr = data.as_ptr() as *const i16; - for i in 0..num_samples { - result.push(unsafe { *ptr.add(i) } as f64 / 32768.0); - } - } - AudioSampleFormat::Pcm24 => { - for i in 0..num_samples { - let off = i * 3; - if off + 2 >= data.len() { break; } - let b0 = data[off] as i32; - let b1 = data[off+1] as i32; - let b2 = (data[off+2] as i8) as i32; - result.push(((b2 << 16) | (b1 << 8) | b0) as f64 / 8388608.0); - } - } - AudioSampleFormat::Pcm32 => { - let ptr = data.as_ptr() as *const i32; - for i in 0..num_samples { - result.push(unsafe { *ptr.add(i) } as f64 / 2147483648.0); - } - } - } - result -} - -fn f64_to_bytes(samples: &[f64], format: AudioSampleFormat, output: &mut [u8]) { - match format { - AudioSampleFormat::Float32 => { - let ptr = output.as_mut_ptr() as *mut f32; - for (i, &s) in samples.iter().enumerate() { - unsafe { *ptr.add(i) = s as f32; } - } - } - AudioSampleFormat::Pcm16 => { - let ptr = output.as_mut_ptr() as *mut i16; - for (i, &s) in samples.iter().enumerate() { - unsafe { *ptr.add(i) = (s.clamp(-1.0, 1.0) * 32767.0) as i16; } - } - } - AudioSampleFormat::Pcm24 => { - for (i, &s) in samples.iter().enumerate() { - let val = (s.clamp(-1.0, 1.0) * 8388607.0) as i32; - let off = i * 3; - if off + 2 < output.len() { - output[off] = (val & 0xFF) as u8; - output[off+1] = ((val >> 8) & 0xFF) as u8; - output[off+2] = ((val >> 16) & 0xFF) as u8; - } - } - } - AudioSampleFormat::Pcm32 => { - let ptr = output.as_mut_ptr() as *mut i32; - for (i, &s) in samples.iter().enumerate() { - unsafe { *ptr.add(i) = (s.clamp(-1.0, 1.0) * 2147483647.0) as i32; } - } - } - } -} - -// ── WASAPI Helpers ──────────────────────────────────────────────────── - -/// PKEY_Device_FriendlyName = {A45C254E-DF1C-4EFD-8020-67D146A850E0}, pid=14 -const PKEY_DEVICE_FRIENDLY_NAME: PROPERTYKEY = PROPERTYKEY { - fmtid: GUID::from_values( - 0xA45C254E, 0xDF1C, 0x4EFD, - [0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0], - ), - pid: 14, -}; - -/// Get device ID string -pub(crate) fn get_device_id(device: &wa::IMMDevice) -> Result { - let pwstr = unsafe { device.GetId() }.map_err(|e| format!("GetId failed: {}", e))?; - let id = unsafe { PCWSTR(pwstr.as_ptr()).to_string() }.map_err(|e| format!("to_string failed: {}", e))?; - unsafe { CoTaskMemFree(Some(pwstr.as_ptr() as *const _)) }; - Ok(id) -} - -/// Get device friendly name via IPropertyStore -pub(crate) fn get_device_name(device: &wa::IMMDevice) -> String { - unsafe { - let store: IPropertyStore = match device.OpenPropertyStore(windows::Win32::System::Com::STGM(0)) { - Ok(s) => s, - Err(_) => return "".to_string(), - }; - let prop = match store.GetValue(&PKEY_DEVICE_FRIENDLY_NAME) { - Ok(p) => p, - Err(_) => return "".to_string(), - }; - prop.to_string() - } -} - -/// List all active render endpoints with names (for diagnostics) -fn list_all_devices(enumerator: &wa::IMMDeviceEnumerator) { - let collection = match unsafe { enumerator.EnumAudioEndpoints(wa::eRender, wa::DEVICE_STATE_ACTIVE) } { - Ok(c) => c, - Err(e) => { warn!("[audio_engine] EnumAudioEndpoints failed: {}", e); return; } - }; - let count = match unsafe { collection.GetCount() } { - Ok(c) => c, - Err(_) => return, - }; - let default_id = unsafe { enumerator.GetDefaultAudioEndpoint(wa::eRender, wa::eConsole) } - .map(|d| get_device_id(&d).unwrap_or_default()) - .unwrap_or_default(); - info!("[audio_engine] === All active render devices ({}) ===", count); - for i in 0..count { - if let Ok(device) = unsafe { collection.Item(i) } { - let id = get_device_id(&device).unwrap_or_default(); - let name = get_device_name(&device); - let is_default = id == default_id; - info!("[audio_engine] [{}] name='{}' default={}", i, name, is_default); - } - } -} - -/// Find devices: FxSound = search by name containing "FxSound", physical = matched by name or default -fn find_devices( - enumerator: &wa::IMMDeviceEnumerator, - physical_device_name: &str, -) -> Result<(wa::IMMDevice, wa::IMMDevice), String> { - list_all_devices(enumerator); - - let collection = unsafe { - enumerator.EnumAudioEndpoints(wa::eRender, wa::DEVICE_STATE_ACTIVE) - }.map_err(|e| format!("EnumAudioEndpoints failed: {}", e))?; - - let count = unsafe { collection.GetCount() } - .map_err(|e| format!("GetCount failed: {}", e))?; - - // Get current default device ID (for fallback strategies) - let default_id = unsafe { enumerator.GetDefaultAudioEndpoint(wa::eRender, wa::eConsole) } - .map(|d| get_device_id(&d).unwrap_or_default()) - .unwrap_or_default(); - - // === Find FxSound device === - // Strategy 1: Search by name containing "FxSound" (most reliable) - let mut fxsound_device: Option = None; - let mut fxsound_id = String::new(); - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let name = get_device_name(&device); - if name.to_lowercase().contains("fxsound") { - fxsound_id = get_device_id(&device).unwrap_or_default(); - info!("[audio_engine] FxSound device found by name: '{}'", name); - fxsound_device = Some(device); - break; - } - } - - // Strategy 2: Fall back to default device if FxSound not found by name - // (handles race condition where switch hasn't fully propagated yet, - // or FxSound was already set as default before the switch) - if fxsound_device.is_none() { - let dev = unsafe { enumerator.GetDefaultAudioEndpoint(wa::eRender, wa::eConsole) } - .map_err(|e| format!("GetDefaultAudioEndpoint failed: {}", e))?; - let name = get_device_name(&dev); - fxsound_id = get_device_id(&dev).unwrap_or_default(); - info!("[audio_engine] FxSound (default fallback): name='{}'", name); - fxsound_device = Some(dev); - } - - let fxsound_dev = fxsound_device.ok_or_else(|| "FxSound device not found".to_string())?; - - // === Find physical render device === - let mut physical_device: Option = None; - - // Strategy 1: Match by physical_device_name - if !physical_device_name.is_empty() { - let search = physical_device_name.to_lowercase(); - info!("[audio_engine] Searching physical device by name: '{}'", physical_device_name); - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let id = get_device_id(&device).unwrap_or_default(); - if id == fxsound_id { continue; } - let name = get_device_name(&device); - let nl = name.to_lowercase(); - if nl.contains(&search) || search.contains(&nl) { - physical_device = Some(device); - info!("[audio_engine] Matched physical device: '{}'", name); - break; - } - } - - // If name looks garbled (contains '?'), try matching by ASCII substrings - // e.g. "?????? (K02BS)" -> extract "K02BS" and match - if physical_device.is_none() && search.contains('?') { - let ascii_parts: Vec<&str> = search - .split(|c: char| !c.is_ascii_alphanumeric()) - .filter(|s| s.len() >= 3) - .collect(); - for part in &ascii_parts { - info!("[audio_engine] Trying ASCII fallback match: '{}'", part); - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let id = get_device_id(&device).unwrap_or_default(); - if id == fxsound_id { continue; } - let name = get_device_name(&device); - if name.to_lowercase().contains(part) { - physical_device = Some(device); - info!("[audio_engine] Matched physical device (ASCII fallback): '{}'", name); - break; - } - } - if physical_device.is_some() { break; } - } - } - } - - // Strategy 2: Use current default device if it's not FxSound - // (handles race condition: if switch hasn't taken effect, the default is - // still the physical speaker, which is exactly what we want) - if physical_device.is_none() && !default_id.is_empty() && default_id != fxsound_id { - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let id = get_device_id(&device).unwrap_or_default(); - if id == default_id { - let name = get_device_name(&device); - physical_device = Some(device); - info!("[audio_engine] Using current default as physical device: '{}'", name); - break; - } - } - } - - // Strategy 3: First non-FxSound device, preferring non-HDMI/DisplayPort - if physical_device.is_none() { - info!("[audio_engine] No name match, selecting fallback non-FxSound device"); - // First pass: skip HDMI/DisplayPort audio devices (NVIDIA, AMD, Intel) - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let id = get_device_id(&device).unwrap_or_default(); - if id == fxsound_id { continue; } - let name = get_device_name(&device); - let nl = name.to_lowercase(); - if !nl.contains("nvidia") && !nl.contains("amd") && !nl.contains("intel display") - && !nl.contains("hdmi") && !nl.contains("displayport") { - physical_device = Some(device); - info!("[audio_engine] Fallback physical device (non-HDMI): '{}'", name); - break; - } - } - // Second pass: accept any non-FxSound device - if physical_device.is_none() { - for i in 0..count { - let device = unsafe { collection.Item(i) }.map_err(|e| format!("Item failed: {}", e))?; - let id = get_device_id(&device).unwrap_or_default(); - if id != fxsound_id { - let name = get_device_name(&device); - physical_device = Some(device); - info!("[audio_engine] Fallback physical device: '{}'", name); - break; - } - } - } - } - - let physical = physical_device.ok_or_else(|| "Physical audio device not found".to_string())?; - let phys_name = get_device_name(&physical); - info!("[audio_engine] Selected physical device: '{}'", phys_name); - Ok((fxsound_dev, physical)) -} - -/// Initialize WASAPI loopback capture -fn init_capture( - device: &wa::IMMDevice, -) -> Result<(wa::IAudioClient, wa::IAudioCaptureClient, FormatInfo), String> { - let audio_client: wa::IAudioClient = unsafe { - device.Activate(CLSCTX_ALL, None) - }.map_err(|e| format!("Activate capture failed: {}", e))?; - - let mix_format_ptr = unsafe { audio_client.GetMixFormat() } - .map_err(|e| format!("GetMixFormat failed: {}", e))?; - - let format_info = parse_format(unsafe { &*mix_format_ptr }); - - unsafe { - audio_client.Initialize( - wa::AUDCLNT_SHAREMODE_SHARED, - wa::AUDCLNT_STREAMFLAGS_LOOPBACK, - 0, 0, - mix_format_ptr, - None, - ) - }.map_err(|e| format!("Capture Initialize failed: {}", e))?; - - let capture_client: wa::IAudioCaptureClient = unsafe { audio_client.GetService() } - .map_err(|e| format!("GetService capture failed: {}", e))?; - - unsafe { CoTaskMemFree(Some(mix_format_ptr as *const _)) }; - - info!("[audio_engine] Capture: {:?} {}Hz {}ch", - format_info.sample_format, format_info.sample_rate, format_info.channels); - - Ok((audio_client, capture_client, format_info)) -} - -/// Initialize WASAPI render -fn init_render( - device: &wa::IMMDevice, -) -> Result<(wa::IAudioClient, wa::IAudioRenderClient, FormatInfo, u32), String> { - let audio_client: wa::IAudioClient = unsafe { - device.Activate(CLSCTX_ALL, None) - }.map_err(|e| format!("Activate render failed: {}", e))?; - - let mix_format_ptr = unsafe { audio_client.GetMixFormat() } - .map_err(|e| format!("GetMixFormat render failed: {}", e))?; - - let format_info = parse_format(unsafe { &*mix_format_ptr }); - - unsafe { - audio_client.Initialize( - wa::AUDCLNT_SHAREMODE_SHARED, - 0, 0, 0, - mix_format_ptr, - None, - ) - }.map_err(|e| format!("Render Initialize failed: {}", e))?; - - let render_client: wa::IAudioRenderClient = unsafe { audio_client.GetService() } - .map_err(|e| format!("GetService render failed: {}", e))?; - - // Check and set audio session volume to prevent silent playback - match unsafe { audio_client.GetService::() } { - Ok(vol) => { - if let Ok(current) = unsafe { vol.GetMasterVolume() } { - info!("[audio_engine] Render session volume: {:.3}", current); - if current < 0.01 { - let _ = unsafe { vol.SetMasterVolume(1.0, std::ptr::null()) }; - info!("[audio_engine] Set render session volume to 1.0"); - } - } - let _ = unsafe { vol.SetMute(false, std::ptr::null()) }; - } - Err(e) => warn!("[audio_engine] Could not get ISimpleAudioVolume: {}", e), - } - - let buffer_size = unsafe { audio_client.GetBufferSize() } - .map_err(|e| format!("GetBufferSize failed: {}", e))?; - - unsafe { CoTaskMemFree(Some(mix_format_ptr as *const _)) }; - - info!("[audio_engine] Render: {:?} {}Hz {}ch, buf={}", - format_info.sample_format, format_info.sample_rate, format_info.channels, buffer_size); - - Ok((audio_client, render_client, format_info, buffer_size)) -} - -// ── Audio Processing Thread ─────────────────────────────────────────── - -fn audio_thread( - physical_device_name: String, - params: Arc>, - stop_flag: Arc, - effects: Arc>>, -) { - info!("[audio_engine] Thread starting"); - - let co_init = unsafe { CoInitializeEx(None, COINIT_MULTITHREADED) }; - if co_init.is_err() { - error!("[audio_engine] CoInitializeEx failed: {:?}", co_init); - return; - } - - let enumerator: wa::IMMDeviceEnumerator = match unsafe { - CoCreateInstance(&wa::MMDeviceEnumerator, None, CLSCTX_ALL) - } { - Ok(e) => e, - Err(e) => { - error!("[audio_engine] CoCreateInstance failed: {}", e); - unsafe { CoUninitialize(); } - return; - } - }; - - let (fxsound_dev, physical_dev) = match find_devices(&enumerator, &physical_device_name) { - Ok(d) => d, - Err(e) => { - error!("[audio_engine] {}", e); - unsafe { CoUninitialize(); } - return; - } - }; - - let (capture_client_obj, capture_client, capture_fmt) = match init_capture(&fxsound_dev) { - Ok(c) => c, - Err(e) => { - error!("[audio_engine] {}", e); - unsafe { CoUninitialize(); } - return; - } - }; - - let (render_client_obj, render_client, render_fmt, render_buf_size) = match init_render(&physical_dev) { - Ok(r) => r, - Err(e) => { - error!("[audio_engine] {}", e); - unsafe { CoUninitialize(); } - return; - } - }; - - if capture_fmt.sample_rate != render_fmt.sample_rate { - warn!("[audio_engine] Sample rate mismatch: {} vs {}Hz", - capture_fmt.sample_rate, render_fmt.sample_rate); - } - - let channels = capture_fmt.channels.min(render_fmt.channels) as usize; - if capture_fmt.channels != render_fmt.channels { - warn!("[audio_engine] Channel mismatch: {} vs {}ch, using {}", - capture_fmt.channels, render_fmt.channels, channels); - } - - let mut eq_chain = EqChain::new(capture_fmt.sample_rate as f64, channels); - let mut last_version = u64::MAX; - - // 初始化音效处理器 - { - let mut fx = effects.lock().unwrap(); - *fx = Some(SoundEffects::new(capture_fmt.sample_rate as f64)); - } - - // Pre-fill render buffer with silence before starting to prevent initial underrun - let render_bpf = render_fmt.block_align as usize; - let pre_fill_frames = render_buf_size; - let pre_fill_bytes = pre_fill_frames as usize * render_bpf; - if let Ok(render_ptr) = unsafe { render_client.GetBuffer(pre_fill_frames) } { - unsafe { std::ptr::write_bytes(render_ptr, 0, pre_fill_bytes); } - let _ = unsafe { render_client.ReleaseBuffer(pre_fill_frames, 0) }; - info!("[audio_engine] Pre-filled render buffer with {} frames of silence", pre_fill_frames); - } - - // Start capture first, then render - if let Err(e) = unsafe { capture_client_obj.Start() } { - error!("[audio_engine] Capture Start failed: {}", e); - unsafe { CoUninitialize(); } - return; - } - if let Err(e) = unsafe { render_client_obj.Start() } { - error!("[audio_engine] Render Start failed: {}", e); - unsafe { CoUninitialize(); } - return; - } - - info!("[audio_engine] Pipeline started: Loopback(FxSound) -> EQ -> Render"); - - let mut sample_buffer: Vec = Vec::with_capacity(8192); - - // Stats for diagnostics - let mut total_captured: u64 = 0; - let mut total_rendered: u64 = 0; - let mut silence_packets: u64 = 0; - let mut audio_packets: u64 = 0; - let mut last_stats_time = std::time::Instant::now(); - let mut first_audio_logged = false; - let mut max_capture_amp: f64 = 0.0; - let mut max_render_amp: f64 = 0.0; - - while !stop_flag.load(Ordering::SeqCst) { - // Update EQ if params changed - { - let p = params.read().unwrap(); - if p.version != last_version { - eq_chain.update(&p.bands, channels); - last_version = p.version; - info!("[audio_engine] EQ updated (v{})", last_version); - } - } - - // Read capture data - let packet_size = match unsafe { capture_client.GetNextPacketSize() } { - Ok(s) => s, - Err(e) => { - warn!("[audio_engine] GetNextPacketSize: {}", e); - thread::sleep(Duration::from_millis(2)); - continue; - } - }; - - let mut current_packet = packet_size; - while current_packet > 0 { - let mut data_ptr: *mut u8 = std::ptr::null_mut(); - let mut num_frames: u32 = 0; - let mut flags: u32 = 0; - - match unsafe { - capture_client.GetBuffer( - &mut data_ptr, - &mut num_frames, - &mut flags, - None, - None, - ) - } { - Ok(_) => {} - Err(e) => { warn!("[audio_engine] GetBuffer: {}", e); break; } - } - - let is_silent = flags & (wa::AUDCLNT_BUFFERFLAGS_SILENT.0 as u32) != 0; - let num_samples = num_frames as usize * channels; - - if is_silent { - silence_packets += 1; - // Push silence - for _ in 0..num_samples { sample_buffer.push(0.0); } - } else { - audio_packets += 1; - if !first_audio_logged { - first_audio_logged = true; - info!("[audio_engine] *** First non-silent audio captured: {} frames ***", num_frames); - } - let cap_ch = capture_fmt.channels as usize; - let byte_count = num_frames as usize * capture_fmt.block_align as usize; - let raw = unsafe { std::slice::from_raw_parts(data_ptr, byte_count) }; - let samples = bytes_to_f64(raw, capture_fmt.sample_format, num_frames as usize * cap_ch); - - if cap_ch == channels { - sample_buffer.extend_from_slice(&samples); - } else { - for frame in 0..num_frames as usize { - for ch in 0..channels { - let src = frame * cap_ch + ch; - if src < samples.len() { sample_buffer.push(samples[src]); } - } - } - } - } - - total_captured += num_frames as u64; - let _ = unsafe { capture_client.ReleaseBuffer(num_frames) }; - match unsafe { capture_client.GetNextPacketSize() } { - Ok(s) => current_packet = s, - Err(_) => break, - } - } - - // Prevent unbounded buffer growth (max 2x render buffer) - let max_samples = (render_buf_size as usize * 2) * channels; - if sample_buffer.len() > max_samples { - let drain_count = sample_buffer.len() - max_samples; - sample_buffer.drain(..drain_count); - } - - // Write to render buffer - write PARTIAL data (key fix!) - let padding = match unsafe { render_client_obj.GetCurrentPadding() } { - Ok(p) => p, - Err(_) => { thread::sleep(Duration::from_millis(1)); continue; } - }; - - let available = render_buf_size.saturating_sub(padding); - if available == 0 { - thread::sleep(Duration::from_millis(1)); - continue; - } - - // KEY FIX: Only write as many frames as we actually have data for - let buffered_frames = sample_buffer.len() / channels; - let frames_to_write = buffered_frames.min(available as usize); - - if frames_to_write == 0 { - thread::sleep(Duration::from_millis(1)); - continue; - } - - let needed_samples = frames_to_write * channels; - let mut process_buf: Vec = sample_buffer.drain(..needed_samples).collect(); - - // Log max amplitude of captured audio (before EQ) - let max_pre = process_buf.iter().fold(0.0f64, |m, &s| m.max(s.abs())); - - // Apply EQ - { - let p = params.read().unwrap(); - if p.enabled { - eq_chain.process_interleaved(&mut process_buf, channels); - // 总增益 (-12..+12 dB) - if p.preamp.abs() > 0.01 { - let gain = 10.0_f64.powf(p.preamp / 20.0); - for s in &mut process_buf { *s *= gain; } - } - } - } - - // Apply Sound Effects - let fx = crate::audio_eq::fx_params().lock().unwrap().clone(); - if fx.clarity > 0.001 || fx.ambience > 0.001 || fx.width > 0.001 || fx.dynamics > 0.001 || fx.bass > 0.001 { - let mut fx_guard = effects.lock().unwrap(); - let fx_proc = fx_guard.as_mut().unwrap(); - if channels >= 2 { - // 立体声 - let frame_count = process_buf.len() / channels; - for f in 0..frame_count { - let l = process_buf[f * channels]; - let r = process_buf[f * channels + 1]; - let (pl, pr) = fx_proc.process_stereo(l, r, &fx); - process_buf[f * channels] = pl; - process_buf[f * channels + 1] = pr; - } - } else { - // 单声道 - for s in &mut process_buf { - *s = fx_proc.process(*s, &fx); - } - } - } - - // Compute per-channel peak (for real-time visualizer) - let mut left_peak = 0.0f32; - let mut right_peak = 0.0f32; - if channels >= 2 { - for f in 0..(process_buf.len() / channels) { - left_peak = left_peak.max(process_buf[f * channels].abs() as f32); - right_peak = right_peak.max(process_buf[f * channels + 1].abs() as f32); - } - } else { - right_peak = process_buf.iter().fold(0.0f32, |m, &s| m.max(s.abs() as f32)); - left_peak = right_peak; - } - let lv = output_levels(); - lv.store(pack_levels(left_peak, right_peak), Ordering::Relaxed); - - // Log max amplitude after EQ - let max_post = process_buf.iter().fold(0.0f64, |m, &s| m.max(s.abs())); - max_capture_amp = max_capture_amp.max(max_pre); - max_render_amp = max_render_amp.max(max_post); - - // Convert to render format - let render_ch = render_fmt.channels as usize; - let render_byte_count = frames_to_write * render_bpf; - let mut render_data = vec![0u8; render_byte_count]; - - if render_ch == channels { - f64_to_bytes(&process_buf, render_fmt.sample_format, &mut render_data); - } else { - let mut expanded = Vec::with_capacity(frames_to_write * render_ch); - for frame in 0..frames_to_write { - for ch in 0..render_ch { - let src_ch = ch.min(channels - 1); - expanded.push(process_buf[frame * channels + src_ch]); - } - } - f64_to_bytes(&expanded, render_fmt.sample_format, &mut render_data); - } - - // Write to render buffer (write only frames_to_write, not available) - match unsafe { render_client.GetBuffer(frames_to_write as u32) } { - Ok(render_ptr) => { - unsafe { - std::ptr::copy_nonoverlapping( - render_data.as_ptr(), render_ptr, render_byte_count, - ); - } - let _ = unsafe { render_client.ReleaseBuffer(frames_to_write as u32, 0) }; - total_rendered += frames_to_write as u64; - } - Err(e) => warn!("[audio_engine] Render GetBuffer: {}", e), - } - - // Periodic stats logging (every 5 seconds) - if last_stats_time.elapsed() >= Duration::from_secs(5) { - info!( - "[audio_engine] Stats: captured={} frames, rendered={} frames, silent_pkts={}, audio_pkts={}, buf={} samples, max_capture_amp={:.6}, max_render_amp={:.6}", - total_captured, total_rendered, silence_packets, audio_packets, sample_buffer.len(), max_capture_amp, max_render_amp - ); - total_captured = 0; - total_rendered = 0; - silence_packets = 0; - audio_packets = 0; - max_capture_amp = 0.0; - max_render_amp = 0.0; - last_stats_time = std::time::Instant::now(); - } - } - - // Cleanup - let _ = unsafe { capture_client_obj.Stop() }; - let _ = unsafe { render_client_obj.Stop() }; - eq_chain.reset(); - info!("[audio_engine] Thread stopped"); - unsafe { CoUninitialize(); } -} - -// ── 音效 DSP 处理器(完全适配 FxSound)────────────────────────────── - -pub struct SoundEffects { - sample_rate: f64, - - // ── FxSound Aural Activator(清晰度:Butterworth HP → drive → sin 谐波)── - clarity_hp: BiquadFilter, - last_clarity: f64, - clarity_drive: f64, // 0..3.393 - - // ── FxSound Dattorro LexReverb(环境)───────────────────────────────── - reverb: crate::dattorro::DattorroReverb, - - // ── FxSound Maximizer(动态:look-ahead 峰值限制器)──────────────────── - maxi_buf: Vec, - maxi_pos: usize, - maxi_len: usize, // look-ahead 延迟样本数 - last_dynamics: f64, - maxi_gain: f64, // boost 线性增益(1.0 ~ 10^{21/20} ≈ 11.2) - maxi_env: f64, // 峰值包络 - maxi_ramp: usize, // ramp 计数 - maxi_release_beta: f64, - - // ── FxSound Bass Boost(低音:90Hz peaking EQ, Q=2.5, max 15dB)───── - bass_peq: BiquadFilter, - last_bass: f64, - - // ── FxSound Spectrum Analyzer(10段频谱可视化)─────────────────────── - spectrum: crate::spectrum::SpectrumAnalyzer, - spectrum_tick: u32, -} - -impl SoundEffects { - pub fn new(sample_rate: f64) -> Self { - let mut clarity_hp = BiquadFilter::new(); - clarity_hp.set_highpass(sample_rate, 4000.0, 0.7071); // Butterworth HP - - let mut bass_peq = BiquadFilter::new(); - bass_peq.set_peaking(sample_rate, 90.0, 0.0, 2.5); - - // Look-ahead: 0.75ms - let maxi_len = ((sample_rate * 0.00075) as usize).max(4); - // Release beta: ~10ms time constant - let maxi_release_beta = 1.0 - 1.0 / (sample_rate * 0.010); - - Self { - sample_rate, - clarity_hp, - last_clarity: 0.0, - clarity_drive: 0.0, - reverb: crate::dattorro::DattorroReverb::new(sample_rate), - maxi_buf: vec![0.0; maxi_len], - maxi_pos: 0, - maxi_len, - last_dynamics: 0.0, - maxi_gain: 1.0, - maxi_env: 0.0001, - maxi_ramp: 0, - maxi_release_beta, - bass_peq, - last_bass: 0.0, - spectrum: crate::spectrum::SpectrumAnalyzer::new(sample_rate), - spectrum_tick: 0, - } - } - - // ═══════════════ 清晰度:FxSound Aural Activator ══════════════════════ - /// Butterworth HP → drive → sin() 奇次谐波 → 干湿混合 - fn process_clarity(&mut self, sample: f64, amount: f64) -> f64 { - if amount < 0.001 { return sample; } - if amount != self.last_clarity { - // FxSound: MIDI 0..127 → drive 0..3.393(线性) - self.clarity_drive = amount * 3.393; - self.last_clarity = amount; - } - let high = self.clarity_hp.process(sample); - let driven = high * self.clarity_drive; - let odd = driven.sin(); // FxSound: sin() 产生奇次谐波 - // FxSound: wet_gain=0.378, dry_gain=0.622(max),随 amount 线性缩放 - let wet = amount * 0.378; - let dry = 1.0 - wet; - sample * dry + odd * 1.5 * wet - } - - // ═══════════════ 环绕:FxSound M/S 立体声展宽 ═════════════════════════ - /// M = (L+R)/2, S = L-M; S *= (1+3I), M *= (1-0.3I) - /// FxSound 最大 intensity = 0.7 - fn process_width(&self, l: f64, r: f64, amount: f64) -> (f64, f64) { - if amount < 0.001 { return (l, r); } - let intensity = amount * 0.7; // FxSound max slider - let side_gain = 1.0 + 3.0 * intensity; - let mid_comp = 1.0 - 0.3 * intensity; - let mid = (l + r) * 0.5 * mid_comp; - let side_l = l - (l + r) * 0.5; - let side_r = r - (l + r) * 0.5; - (mid + side_l * side_gain, mid + side_r * side_gain) - } - - // ═══════════════ 动态:FxSound Maximizer(look-ahead 限制器)══════════ - /// 增益 boost 0..21dB(FxSound: QNT_RESPONSE_MAXI_BOOST_DSP × 0.7) - fn process_compressor(&mut self, sample: f64, amount: f64) -> f64 { - if amount < 0.001 { return sample; } - if amount != self.last_dynamics { - // FxSound: 0..30dB → 0.7 缩放 = 0..21dB - let boost_db = amount * 21.0; - self.maxi_gain = 10.0_f64.powf(boost_db / 20.0); - self.last_dynamics = amount; - } - let max_out: f64 = 0.966; // FxSound: -0.3 dB 防止削波 - let buf = &mut self.maxi_buf; - let len = self.maxi_len; - let pos = self.maxi_pos; - let maxi_len = self.maxi_len; - - // 写入增强信号到延迟缓冲区 - buf[pos] = sample * self.maxi_gain; - self.maxi_pos = (pos + 1) % len; - - // 读取 look-ahead 延迟后的信号 - let dly = buf[self.maxi_pos]; // pos 已递增,当前是缓冲区最旧样本 - - // 峰值包络检测(双模式:ramp 瞬态 / release 稳态) - let abs_dly = dly.abs(); - if abs_dly > self.maxi_env { - // Ramp 模式:线性跟随到新峰值(在 look-ahead 窗口内) - let delta = (abs_dly - self.maxi_env) / maxi_len as f64; - self.maxi_env += delta; - self.maxi_ramp = maxi_len; - } else { - // Release 模式 - if self.maxi_ramp > 0 { - self.maxi_ramp -= 1; - } else { - self.maxi_env = self.maxi_env * self.maxi_release_beta + 0.0001; - } - } - - // 峰值限制 - if self.maxi_env > max_out { - dly * max_out / self.maxi_env - } else { - dly - } - } - - // ═══════════════ 低音:FxSound 90Hz peaking EQ ════════════════════════ - /// 90Hz, Q=2.5, 0..15dB boost(线性映射) - fn process_bass(&mut self, sample: f64, amount: f64) -> f64 { - if amount < 0.001 { return sample; } - if amount != self.last_bass { - let boost_db = amount * 15.0; // FxSound: 0..15dB - self.bass_peq.set_peaking(self.sample_rate, 90.0, boost_db, 2.5); - self.last_bass = amount; - } - self.bass_peq.process(sample) - } - - // ═══════════════ 处理入口 ═════════════════════════════════════════════ - /// 单声道处理全部效果 - pub fn process(&mut self, sample: f64, params: &SoundEffectParams) -> f64 { - let mut s = self.process_bass(sample, params.bass); - s = self.process_clarity(s, params.clarity); - s = self.process_compressor(s, params.dynamics); - if params.ambience > 0.001 { - let (rev_l, _) = self.reverb.process(s, params.ambience); - s = s + rev_l * params.ambience * 0.5; - } - s.clamp(-4.0, 4.0) - } - - /// 立体声处理(按 FxSound 顺序:Fidelity → Ambience → Width → Bass → Maximizer) - pub fn process_stereo(&mut self, l: f64, r: f64, params: &SoundEffectParams) -> (f64, f64) { - let mut sl = self.process_bass(l, params.bass); - let mut sr = self.process_bass(r, params.bass); - sl = self.process_clarity(sl, params.clarity); - sr = self.process_clarity(sr, params.clarity); - // 环境混响 - if params.ambience > 0.001 { - let mono_in = (sl + sr) * 0.5; - let (rev_l, rev_r) = self.reverb.process(mono_in, params.ambience); - let wet = params.ambience * 0.5; - sl = sl + rev_l * wet; - sr = sr + rev_r * wet; - } - (sl, sr) = self.process_width(sl, sr, params.width); - sl = self.process_compressor(sl, params.dynamics); - sr = self.process_compressor(sr, params.dynamics); - // 喂入频谱分析器 - self.spectrum_tick = self.spectrum_tick.wrapping_add(1); - if self.spectrum_tick % 4 == 0 { // 降采样,每 4 帧处理一次(48kHz→12kHz 内部速率,匹配 FxSound) - let bands = self.spectrum.process(sl, sr); - if let Ok(mut lv) = spectrum_bands().write() { - *lv = bands; - } - } - (sl.clamp(-4.0, 4.0), sr.clamp(-4.0, 4.0)) - } -} - -// ── AudioEngine (public API) ────────────────────────────────────────── - - -pub struct AudioEngine { - stop_flag: Arc, - thread: Option>, - params: Arc>, -} - -impl AudioEngine { - pub fn start(physical_device_name: String) -> Result { - let params = Arc::new(RwLock::new(EqParams::default())); - let stop_flag = Arc::new(AtomicBool::new(false)); - let p_clone = params.clone(); - let sf_clone = stop_flag.clone(); - let dev_name = physical_device_name; - let fx = Arc::new(std::sync::Mutex::new(None)); - let fx_clone = fx.clone(); - - let thread = thread::Builder::new() - .name("eq-audio-engine".to_string()) - .spawn(move || { audio_thread(dev_name, p_clone, sf_clone, fx_clone); }) - .map_err(|e| format!("Failed to spawn audio thread: {}", e))?; - - thread::sleep(Duration::from_millis(100)); - Ok(Self { stop_flag, thread: Some(thread), params }) - } - - pub fn stop(&mut self) { - self.stop_flag.store(true, Ordering::SeqCst); - if let Some(thread) = self.thread.take() { - let _ = thread.join(); - } - info!("[audio_engine] Engine stopped"); - } - - pub fn is_running(&self) -> bool { - if self.stop_flag.load(Ordering::SeqCst) { return false; } - match &self.thread { - Some(t) => !t.is_finished(), - None => false, - } - } - - pub fn update_bands(&self, bands: Vec) { - if let Ok(mut p) = self.params.write() { - p.bands = bands; - p.version = p.version.wrapping_add(1); - } - } - - pub fn set_preamp(&self, gain: f64) { - if let Ok(mut p) = self.params.write() { - p.preamp = gain; - p.version = p.version.wrapping_add(1); - } - } - - #[allow(dead_code)] - pub fn set_enabled(&self, enabled: bool) { - if let Ok(mut p) = self.params.write() { - p.enabled = enabled; - p.version = p.version.wrapping_add(1); - } - } -} - -impl Drop for AudioEngine { - fn drop(&mut self) { self.stop(); } -} - -// ── Audio Output Level Tracker ────────────────────────────────────────── -/// 打包 L/R 峰值电平到 u64(高 32 位 = left,低 32 位 = right) -static OUTPUT_LEVELS: OnceLock> = OnceLock::new(); - -pub fn output_levels() -> Arc { - OUTPUT_LEVELS.get_or_init(|| Arc::new(AtomicU64::new(0))) - .clone() -} - -#[inline] -fn pack_levels(left: f32, right: f32) -> u64 { - ((left.to_bits() as u64) << 32) | (right.to_bits() as u64) -} - -#[inline] -pub fn unpack_levels(packed: u64) -> (f32, f32) { - let left = f32::from_bits((packed >> 32) as u32); - let right = f32::from_bits(packed as u32); - (left, right) -} - -// ── FxSound 10-band Spectrum Levels ───────────────────────────────────── -static SPECTRUM_BANDS: OnceLock> = OnceLock::new(); - -pub fn spectrum_bands() -> &'static RwLock<[f64; 10]> { - SPECTRUM_BANDS.get_or_init(|| RwLock::new([0.0; 10])) -} diff --git a/参考/NexBox-main/src-tauri/src/audio_eq.rs b/参考/NexBox-main/src-tauri/src/audio_eq.rs deleted file mode 100644 index 3dc3c6a..0000000 --- a/参考/NexBox-main/src-tauri/src/audio_eq.rs +++ /dev/null @@ -1,1250 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; -use std::sync::{Mutex, OnceLock}; -use tauri::{AppHandle, Manager}; - -use crate::audio_engine::{AudioEngine, BandParam, SoundEffectParams, get_device_name, get_device_id}; -use windows::core::{GUID, HRESULT, PCWSTR, HSTRING, IUnknown, Interface}; -use windows::Win32::Media::Audio as wa; -use windows::Win32::System::Com::{ - CoCreateInstance, CoInitializeEx, CoUninitialize, - CLSCTX_ALL, COINIT_MULTITHREADED, -}; - -const CREATE_NO_WINDOW: u32 = 0x08000000; -const FXVAD_SERVICE: &str = "FXVAD"; - -/// 驱动状态 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DriverStatus { - pub installed: bool, - pub service_exists: bool, - pub service_running: bool, - pub device_name: String, - pub needs_reboot: bool, -} - -/// EQ 频段信息 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EqBand { - pub freq: f64, - pub gain: f64, -} - -/// FxSound 音效预设参数(0-1 范围) -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct FxPresetParams { - pub clarity: f64, - pub ambience: f64, - pub width: f64, - pub dynamics: f64, - pub bass: f64, -} - -/// EQ 预设 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EqPreset { - pub id: String, - pub name: String, - pub bands: Vec, - pub enabled: bool, - #[serde(default)] - pub effects: Option, -} - -/// EQ 引擎状态 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EngineStatus { - pub running: bool, - pub pid: Option, -} - -/// 全局 AudioEngine 实例 -static EQ_ENGINE: OnceLock>> = OnceLock::new(); - -fn eq_engine() -> &'static Mutex> { - EQ_ENGINE.get_or_init(|| Mutex::new(None)) -} - -/// 全局音效参数 -static FX_PARAMS: OnceLock> = OnceLock::new(); - -pub fn fx_params() -> &'static Mutex { - FX_PARAMS.get_or_init(|| Mutex::new(SoundEffectParams::default())) -} - -/// 更新音效参数 -#[tauri::command] -pub fn update_eq_effects(clarity: f64, ambience: f64, width: f64, dynamics: f64, bass: f64) -> Result<(), String> { - let mut params = fx_params().lock().map_err(|e| format!("锁错误: {}", e))?; - params.clarity = clarity.max(0.0).min(1.0); - params.ambience = ambience.max(0.0).min(1.0); - params.width = width.max(0.0).min(1.0); - params.dynamics = dynamics.max(0.0).min(1.0); - params.bass = bass.max(0.0).min(1.0); - params.version = params.version.wrapping_add(1); - log::info!("[eq] Effects updated: clarity={:.2} ambience={:.2} width={:.2} dynamics={:.2} bass={:.2}", params.clarity, params.ambience, params.width, params.dynamics, params.bass); - Ok(()) -} - -/// 获取当前音效参数 -#[tauri::command] -pub fn get_eq_effects() -> Result { - let params = fx_params().lock().map_err(|e| format!("锁错误: {}", e))?; - Ok(params.clone()) -} - -/// 获取 fxvad 资源目录 -fn get_fxvad_resource_dir(app: &AppHandle) -> Option { - // 1. 通过 Tauri resource_dir 查找(生产环境 + 部分开发现境) - if let Ok(resource_dir) = app.path().resource_dir() { - let candidates = [ - resource_dir.join("binaries").join("fxvad"), - resource_dir.join("resources").join("binaries").join("fxvad"), - resource_dir.join("_up_").join("resources").join("binaries").join("fxvad"), - resource_dir.join("_up_").join("_up_").join("src-tauri").join("resources").join("binaries").join("fxvad"), - ]; - for path in &candidates { - if path.exists() { - return Some(path.clone()); - } - } - } - - // 2. 通过 exe 路径查找(开发环境:exe 在 src-tauri/target/debug/ 下) - if let Ok(exe_path) = std::env::current_exe() { - if let Some(parent) = exe_path.parent() { - let candidates = [ - parent.join("binaries").join("fxvad"), - parent.join("resources").join("binaries").join("fxvad"), - // dev: target/debug -> src-tauri/resources/binaries/fxvad - parent.join("..").join("..").join("resources").join("binaries").join("fxvad"), - // dev: target/debug -> NexBox/src-tauri/resources/binaries/fxvad - parent.join("..").join("..").join("..").join("src-tauri").join("resources").join("binaries").join("fxvad"), - ]; - for path in &candidates { - if path.exists() { - if let Ok(canon) = path.canonicalize() { - return Some(canon); - } - return Some(path.clone()); - } - } - } - } - - // 3. 编译时路径(开发环境最可靠:CARGO_MANIFEST_DIR = src-tauri 目录) - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let dev_path = manifest_dir.join("resources").join("binaries").join("fxvad"); - if dev_path.exists() { - return Some(dev_path); - } - - None -} - -/// FXVAD 实例 ID 存档路径 -fn fxvad_instance_id_file() -> PathBuf { - let mut p = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - p.push("NexBox"); - p.push("fxvad_instance_id.txt"); - p -} - -/// 获取导入预设存储目录(%LOCALAPPDATA%/NexBox/EQEngine/presets) -fn get_user_presets_dir() -> PathBuf { - let mut path = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - path.push("NexBox"); - path.push("EQEngine"); - path.push("presets"); - if !path.exists() { - let _ = fs::create_dir_all(&path); - } - path -} - -/// 解析 .fac 预设文件(含 FxSound 音效参数) -fn parse_fac_file(content: &str, file_id: &str) -> Option { - let mut name = String::new(); - let mut bands: Vec = Vec::new(); - let mut enabled = true; - let mut in_bands = false; - let mut current_freq: Option = None; - - // FxSound 音效参数(Main 0-5,MIDI 0-127) - let mut main_vals: [f64; 6] = [0.0; 6]; - // 音效开关(Integer[0-4],0=off, 1=on) - let mut effect_on: [bool; 5] = [false; 5]; - // 行索引计数器(用于追踪 Integer[] 的索引) - let mut int_count = 0u32; - - for (line_idx, line) in content.lines().enumerate() { - let trimmed = line.trim(); - - // 第3行是预设名称(索引2) - if line_idx == 2 { - name = trimmed.to_string(); - continue; - } - - // ── FxSound Main 参数(行6-11,索引5-10)── - if (5..=10).contains(&line_idx) { - // 格式 " 50: Main 0" → 提取 50 - if let Some(val_str) = trimmed.split(':').next() { - if let Ok(val) = val_str.trim().parse::() { - let idx = line_idx - 5; - if idx < 6 { - main_vals[idx] = val; - } - } - } - continue; - } - - // ── FxSound Integer[] 开关(行23-29,索引22-28)── - if (22..=28).contains(&line_idx) { - // 格式 " 1: Integer[0]" → 提取 1 - if let Some(val_str) = trimmed.split(':').next() { - let val = val_str.trim().parse::().unwrap_or(0); - if int_count < 5 { - effect_on[int_count as usize] = val != 0; - } - int_count += 1; - } - continue; - } - - // 检测 On/Off Flag - if trimmed.contains("On/Off Flag") { - if let Some(val_str) = trimmed.split(':').next() { - if let Ok(val) = val_str.trim().parse::() { - enabled = val != 0; - } - } - in_bands = true; - continue; - } - - if in_bands { - // 匹配 " 62.5: CF" 格式 - if trimmed.ends_with(": CF") || trimmed.ends_with(":CF") { - let freq_str = trimmed.split(':').next().unwrap_or("").trim(); - if let Ok(freq) = freq_str.parse::() { - current_freq = Some(freq); - } - } - // 匹配 " 0: Boost/Cut" 格式 - else if trimmed.contains("Boost/Cut") { - if let Some(freq) = current_freq { - let gain_str = trimmed.split(':').next().unwrap_or("").trim(); - if let Ok(gain) = gain_str.parse::() { - bands.push(EqBand { freq, gain }); - } - current_freq = None; - } - } - } - } - - if name.is_empty() { - name = format!("Preset {}", file_id); - } - - // 构建音效参数:MIDI 0-127 → 0.0-1.0 - let has_effects = main_vals.iter().any(|&v| v > 0.0); - let effects = if has_effects { - Some(FxPresetParams { - clarity: main_vals[0] / 127.0, - width: main_vals[1] / 127.0, - // main_vals[2] 未使用(Main 2 = 0) - ambience: main_vals[3] / 127.0, - dynamics: main_vals[4] / 127.0, - bass: main_vals[5] / 127.0, - }) - } else { - None - }; - - let _ = effect_on; // 开关状态保留以备后续使用 - - Some(EqPreset { - id: file_id.to_string(), - name, - bands, - enabled, - effects, - }) -} - -/// 检查虚拟声卡驱动状态 -#[tauri::command] -pub fn check_virtual_audio_driver() -> Result { - let mut service_exists = false; - let mut service_running = false; - - // 使用 sc query 检查服务 - if let Ok(output) = Command::new("sc") - .args(["query", FXVAD_SERVICE]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - let combined = format!("{}\n{}", stdout, stderr); - - // sc query 成功 (exit code 0) 才说明服务存在 - // 服务不存在时 exit code 非零,输出包含错误码 1060 - let cmd_success = output.status.success(); - let is_error_1060 = combined.contains("1060") - && (combined.contains("does not exist") - || combined.contains("不存在") - || combined.contains("未安装") - || combined.contains("FAILED") - || combined.contains("失败")); - - if cmd_success || (combined.to_lowercase().contains("fxvad") && !is_error_1060) { - service_exists = true; - if combined.contains("RUNNING") { - service_running = true; - } - } - } - - // 检测是否需要重启:服务存在但启动类型已设为"禁用"(说明之前卸载过) - let mut needs_reboot = false; - if service_exists { - if let Ok(output) = Command::new("sc") - .args(["qc", FXVAD_SERVICE]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let stdout = String::from_utf8_lossy(&output.stdout); - if stdout.contains("DISABLED") || stdout.contains("禁用") { - needs_reboot = true; - service_exists = false; // 已禁用视为不存在 - } - } - } - - // 驱动是否已安装:仅看服务记录是否存在(服务不在 = 已卸载) - // DriverStore 残留不影响判定,不需要额外检查 pnputil - - Ok(DriverStatus { - installed: service_exists, - service_exists, - service_running, - device_name: "FxSound Audio Enhancer".to_string(), - needs_reboot, - }) -} - -/// 安装虚拟声卡驱动(零 PowerShell,原生 SetupAPI) -#[tauri::command] -pub async fn install_virtual_audio_driver(app: AppHandle) -> Result { - if !is_admin() { - return Err("需要管理员权限才能安装驱动。请以管理员身份运行 NexBox".to_string()); - } - - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到驱动资源目录".to_string())?; - - let inf_path = fxvad_dir.join("fxvad.inf"); - if !inf_path.exists() { - return Err("驱动 INF 文件不存在".to_string()); - } - - // 安装前记录当前默认音频设备 - let prev_device = run_com_thread(|| { - unsafe { - let enumerator: wa::IMMDeviceEnumerator = CoCreateInstance( - &wa::MMDeviceEnumerator, - None, - CLSCTX_ALL, - ).map_err(|e| format!("CoCreateInstance MMDeviceEnumerator failed: {}", e))?; - native_get_default_name(&enumerator) - .ok_or_else(|| "无法获取当前默认设备".to_string()) - } - }).unwrap_or_default(); - - // 使用原生 SetupAPI 安装 - let inf_str = inf_path.to_string_lossy().to_string(); - let installed = native_install_root_device(&inf_str, "Root\\FXVAD")?; - - if !installed { - return Err("驱动安装失败,请检查驱动文件是否完整".to_string()); - } - - // 等待驱动注册完成 - std::thread::sleep(std::time::Duration::from_secs(2)); - - // 如果系统自动切换到了 FxSound 虚拟声卡,恢复为之前的物理设备 - if !prev_device.is_empty() && !prev_device.to_lowercase().contains("fxsound") { - log::info!("[install] Restoring default audio device to: {}", prev_device); - restore_default_audio_device(&prev_device); - } - - // 验证 - let status = check_virtual_audio_driver()?; - if status.installed { - Ok("虚拟声卡驱动安装成功".to_string()) - } else { - Err("驱动已安装但服务未启动,可能需要重启电脑".to_string()) - } -} - -/// 原生 SetupAPI 安装 Root 设备并匹配驱动(等价于 devcon install) -fn native_install_root_device(inf_path: &str, hardware_id: &str) -> Result { - use windows::core::{PCWSTR, HSTRING, GUID}; - use windows::Win32::Devices::DeviceAndDriverInstallation::{ - SetupDiGetINFClassW, SetupDiCreateDeviceInfoList, SetupDiCreateDeviceInfoW, - SetupDiSetDeviceRegistryPropertyW, SetupDiCallClassInstaller, - SetupDiDestroyDeviceInfoList, SetupDiGetDeviceInstanceIdW, - UpdateDriverForPlugAndPlayDevicesW, - SP_DEVINFO_DATA, DICD_GENERATE_ID, DIF_REGISTERDEVICE, SPDRP_HARDWAREID, - INSTALLFLAG_FORCE, - }; - - unsafe { - let inf = HSTRING::from(inf_path); - let hwid = HSTRING::from(hardware_id); - - // 1. 从 INF [Version] 节读取 ClassGUID - let mut class_guid = GUID::zeroed(); - let mut class_name = [0u16; 32]; - SetupDiGetINFClassW(&inf, &mut class_guid, &mut class_name, None) - .map_err(|e| format!("读取 INF 类 GUID 失败: {}", e))?; - - // 2. 创建空设备信息集合 - let dev_info_set = SetupDiCreateDeviceInfoList(Some(&class_guid), None) - .map_err(|e| format!("创建设备列表失败: {}", e))?; - - // 3. 创建设备信息元素 - let mut dev_info_data = SP_DEVINFO_DATA { - cbSize: std::mem::size_of::() as u32, - ..Default::default() - }; - SetupDiCreateDeviceInfoW( - dev_info_set, - PCWSTR(class_name.as_ptr()), - &class_guid, - None, - None, - DICD_GENERATE_ID, - Some(&mut dev_info_data), - ).map_err(|e| format!("创建设备信息失败: {}", e))?; - - // 4. 写硬件 ID (REG_MULTI_SZ,双 null 结尾) - let mut hwid_multi: Vec = hwid.as_wide().to_vec(); - hwid_multi.push(0); - hwid_multi.push(0); - let bytes = std::slice::from_raw_parts( - hwid_multi.as_ptr() as *const u8, - hwid_multi.len() * 2, - ); - SetupDiSetDeviceRegistryPropertyW( - dev_info_set, - &mut dev_info_data, - SPDRP_HARDWAREID, - Some(bytes), - ).map_err(|e| format!("设置硬件 ID 失败: {}", e))?; - - // 5. 注册进 PnP 设备树 - SetupDiCallClassInstaller(DIF_REGISTERDEVICE, dev_info_set, Some(&dev_info_data)) - .map_err(|e| format!("注册 PnP 设备失败: {}", e))?; - - // 5b. 读取系统分配的精确实例 ID 并保存(用于卸载时精确定位) - let mut id_buf = [0u16; 512]; - let mut required = 0u32; - if SetupDiGetDeviceInstanceIdW(dev_info_set, &dev_info_data, Some(&mut id_buf), Some(&mut required)).is_ok() { - if required > 1 { - let instance_id = String::from_utf16_lossy(&id_buf[..required as usize - 1]); - log::info!("[install] FXVAD instance id: {}", instance_id); - if let Some(parent) = fxvad_instance_id_file().parent() { - let _ = fs::create_dir_all(parent); - } - let _ = fs::write(fxvad_instance_id_file(), &instance_id); - } - } - - let _ = SetupDiDestroyDeviceInfoList(dev_info_set); - - // 6. 给设备匹配并安装驱动(INF 暂存、文件拷贝等都在这一步内部完成) - let mut reboot_required = windows::Win32::Foundation::BOOL(0); - UpdateDriverForPlugAndPlayDevicesW( - None, - &hwid, - &inf, - INSTALLFLAG_FORCE, - Some(&mut reboot_required), - ).map_err(|e| format!("安装驱动失败: {}", e))?; - - Ok(true) - } -} - -/// 原生移除 FXVAD 设备节点(精确匹配实例 ID,不回退猜测 pattern) -fn native_remove_fxvad_devnode() -> Result { - use windows::core::PCWSTR; - use windows::Win32::Devices::DeviceAndDriverInstallation::{ - CM_Locate_DevNodeW, CM_Uninstall_DevNode, CM_LOCATE_DEVNODE_NORMAL, CONFIGRET, - }; - - let cr_success = CONFIGRET(0); - - // 优先用安装时保存的精确实例 ID - if let Ok(saved) = fs::read_to_string(fxvad_instance_id_file()) { - let id = saved.trim().to_string(); - if !id.is_empty() { - let wide: Vec = id.encode_utf16().chain(std::iter::once(0)).collect(); - unsafe { - let mut devinst = 0u32; - let cr = CM_Locate_DevNodeW( - &mut devinst, - PCWSTR(wide.as_ptr()), - CM_LOCATE_DEVNODE_NORMAL, - ); - if cr == cr_success { - let cr2 = CM_Uninstall_DevNode(devinst, 0); - log::info!("[uninstall] CM_Uninstall_DevNode({}) -> {:?}", id, cr2); - if cr2 == cr_success { - let _ = fs::remove_file(fxvad_instance_id_file()); - return Ok(true); - } - } - log::warn!("[uninstall] Saved instance id '{}' not found (CR={:?}), falling back to enum", id, cr); - } - } - } - - // 回退:枚举 ROOT 下所有设备,按硬件 ID 匹配 FXVAD 后移除 - native_find_and_remove_by_hwid("FXVAD") -} - -/// 回退方案:枚举 ROOT 枚举器下所有设备,按硬件 ID 关键词匹配后 DIF_REMOVE -fn native_find_and_remove_by_hwid(hwid_keyword: &str) -> Result { - use windows::core::w; - use windows::Win32::Devices::DeviceAndDriverInstallation::{ - SetupDiGetClassDevsW, SetupDiEnumDeviceInfo, SetupDiGetDeviceRegistryPropertyW, - SetupDiCallClassInstaller, SetupDiDestroyDeviceInfoList, - SP_DEVINFO_DATA, DIGCF_PRESENT, DIGCF_ALLCLASSES, SPDRP_HARDWAREID, DIF_REMOVE, - }; - - unsafe { - let dev_info_set = SetupDiGetClassDevsW(None, w!("ROOT"), None, DIGCF_PRESENT | DIGCF_ALLCLASSES) - .map_err(|e| format!("SetupDiGetClassDevsW failed: {}", e))?; - - let mut index = 0u32; - loop { - let mut data = SP_DEVINFO_DATA { - cbSize: std::mem::size_of::() as u32, - ..Default::default() - }; - if SetupDiEnumDeviceInfo(dev_info_set, index, &mut data).is_err() { - break; - } - - let mut buf = [0u16; 512]; - let mut required = 0u32; - let bytes = std::slice::from_raw_parts_mut( - buf.as_mut_ptr() as *mut u8, - buf.len() * 2, - ); - let got = SetupDiGetDeviceRegistryPropertyW( - dev_info_set, - &data, - SPDRP_HARDWAREID, - None, - Some(bytes), - Some(&mut required), - ).is_ok(); - - if got && String::from_utf16_lossy(&buf).to_lowercase().contains(&hwid_keyword.to_lowercase()) { - let ok = SetupDiCallClassInstaller(DIF_REMOVE, dev_info_set, Some(&data)).is_ok(); - log::info!("[uninstall] DIF_REMOVE by HWID match -> {}", ok); - let _ = SetupDiDestroyDeviceInfoList(dev_info_set); - let _ = fs::remove_file(fxvad_instance_id_file()); - return Ok(ok); - } - index += 1; - } - let _ = SetupDiDestroyDeviceInfoList(dev_info_set); - } - log::info!("[uninstall] No FXVAD devnode found via HWID enum, may already be gone"); - Ok(false) -} - -/// 检查是否具有管理员权限 -fn is_admin() -> bool { - Command::new("net") - .args(["session"]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map(|o| o.status.success()) - .unwrap_or(false) -} - -/// 卸载虚拟声卡驱动(原生移除设备节点 → 清理驱动包,无 PowerShell/devcon) -#[tauri::command] -pub async fn uninstall_virtual_audio_driver(_app: AppHandle) -> Result { - if !is_admin() { - return Err("需要管理员权限才能卸载驱动。请以管理员身份运行 NexBox".to_string()); - } - - let _ = stop_eq_engine(); - - // 1. 【关键】先原生移除设备节点——原子操作,内部正确停止驱动实例 - // 不需要也不能提前 sc config disabled,否则制造 Code 32 孤儿节点 - match native_remove_fxvad_devnode() { - Ok(true) => log::info!("[uninstall] Devnode removed via native API"), - Ok(false) => log::info!("[uninstall] Devnode not found, may already be gone"), - Err(e) => log::error!("[uninstall] Devnode removal error: {}", e), - } - - // 2. 设备节点已摘除,现在安全删除驱动包 - let pnp_output = run_hidden_output("pnputil", &["/enum-drivers"]); - let oem_list = find_all_oem_infs(&pnp_output, "fxvad"); - log::info!("[uninstall] Found {} FXVAD OEM INF(s): {:?}", oem_list.len(), oem_list); - for oem in &oem_list { - let del_out = run_hidden_output("pnputil", &["/delete-driver", oem, "/uninstall", "/force"]); - log::info!("[uninstall] pnputil /delete-driver {}: {}", oem, del_out.trim()); - } - - // 3. 保险清理:删除服务项、.sys 文件 - run_hidden_command("sc", &["delete", "FXVAD"]); - let sys_path = std::path::Path::new(r"C:\Windows\System32\drivers\fxvad.sys"); - if sys_path.exists() { - if fs::remove_file(sys_path).is_err() { - schedule_reboot_delete(sys_path); - } - } - - // 4. 清理实例 ID 存档 - let _ = fs::remove_file(fxvad_instance_id_file()); - - // 5. 验证 - let sc_check = run_hidden_output("sc", &["query", "FXVAD"]); - let check_pnp = run_hidden_output("pnputil", &["/enum-drivers"]); - log::info!( - "[uninstall] Verify: service_1060={}, pnp_fxvad={}", - sc_check.contains("1060"), - check_pnp.to_lowercase().contains("fxvad") - ); - Ok("虚拟声卡驱动已卸载".to_string()) -} - -/// 运行隐藏窗口命令,忽略结果 -fn run_hidden_command(cmd: &str, args: &[&str]) { - let _ = Command::new(cmd) - .args(args) - .creation_flags(CREATE_NO_WINDOW) - .output(); -} - -/// 运行隐藏窗口命令,返回 stdout 字符串 -fn run_hidden_output(cmd: &str, args: &[&str]) -> String { - match Command::new(cmd) - .args(args) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - Ok(o) => String::from_utf8_lossy(&o.stdout).to_string(), - Err(e) => { - log::warn!("[uninstall] Command failed: {} {}: {}", cmd, args.join(" "), e); - String::new() - } - } -} - -/// 从 pnputil /enum-drivers 输出中找到所有 fxvad/fxsound 对应的 OEM 文件名 -fn find_all_oem_infs(pnp_output: &str, keyword: &str) -> Vec { - let mut results = Vec::new(); - // 方法1: 搜索包含关键词的 OEM INF - let re = match regex::bytes::Regex::new(r"(?m)^(?:Published Name|发布名称):\s+(oem\d+\.inf)\s*$") { - Ok(r) => r, - Err(_) => return results, - }; - for caps in re.captures_iter(pnp_output.as_bytes()) { - let oem = String::from_utf8_lossy(&caps[1]).to_string(); - // 在找到的 oem.inf 行后面搜索关键词 - let start = caps.get(0).unwrap().end(); - let end = (start + 500).min(pnp_output.len()); - let tail = &pnp_output[start..end]; - if tail.to_lowercase().contains(&keyword.to_lowercase()) { - if !results.contains(&oem) { - results.push(oem); - } - } - } - // 方法2(兜底): 直接搜索整个输出中的 oemNN.inf 及其所在区块 - if results.is_empty() { - let re2 = match regex::bytes::Regex::new(r"(?m)^(?:Published Name|发布名称):\s+(oem\d+\.inf)\s*$") { - Ok(r) => r, - Err(_) => return results, - }; - let bytes = pnp_output.as_bytes(); - let mut all_oems: Vec<(usize, String)> = Vec::new(); - for caps in re2.captures_iter(bytes) { - let oem = String::from_utf8_lossy(&caps[1]).to_string(); - let pos = caps.get(0).unwrap().end(); - all_oems.push((pos, oem)); - } - // 为每个 oem 检查其 500 字节范围内是否含有关键词 - for i in 0..all_oems.len() { - let (start, ref oem) = all_oems[i]; - let end_block = if i + 1 < all_oems.len() { - all_oems[i + 1].0 - 50 - } else { - (start + 500).min(pnp_output.len()) - }; - let chunk = &pnp_output[start..end_block.min(pnp_output.len())]; - if chunk.to_lowercase().contains(&keyword.to_lowercase()) && !results.contains(oem) { - results.push(oem.clone()); - } - } - } - results -} - -/// 安排文件在重启后删除 (MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT) -fn schedule_reboot_delete(path: &std::path::Path) { - use windows::core::PCWSTR; - use windows::Win32::Storage::FileSystem::MoveFileExW; - use windows::Win32::Storage::FileSystem::MOVEFILE_DELAY_UNTIL_REBOOT; - - let wide: Vec = path - .to_string_lossy() - .encode_utf16() - .chain(std::iter::once(0)) - .collect(); - unsafe { - let _ = MoveFileExW( - PCWSTR::from_raw(wide.as_ptr()), - None, - MOVEFILE_DELAY_UNTIL_REBOOT, - ); - } -} - -/// 启动 EQ 引擎(原生 WASAPI),并自动切换默认音频设备到 FxSound -#[tauri::command] -pub async fn start_eq_engine(_app: AppHandle) -> Result { - // 检查是否已在运行 - { - let guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(ref engine) = *guard { - if engine.is_running() { - return Err("EQ 引擎已在运行".to_string()); - } - } - } - - // 检查驱动是否已安装 - let driver_status = check_virtual_audio_driver()?; - if !driver_status.installed { - return Err("请先安装虚拟声卡驱动".to_string()); - } - - // 保存当前默认设备,切换到 FxSound 虚拟声卡(原生 COM,无 PowerShell) - let prev_device = switch_default_audio_to_fxsound()?; - let physical_device_name = if prev_device.starts_with("PREV:") { - let name = prev_device[5..].to_string(); - log::info!("[eq] Previous device name: '{}'", name); - name - } else { - String::new() - }; - - // Wait for default device switch to fully propagate before starting audio engine - std::thread::sleep(std::time::Duration::from_millis(200)); - - // 启动原生音频引擎 - let engine = match AudioEngine::start(physical_device_name.clone()) { - Ok(e) => e, - Err(e) => { - // 引擎启动失败,恢复原始默认设备 - log::error!("[eq] Audio engine failed to start: {}", e); - if !physical_device_name.is_empty() { - log::info!("[eq] Restoring audio device to: {}", physical_device_name); - restore_default_audio_device(&physical_device_name); - } - let _ = fs::remove_file(std::env::temp_dir().join("nexbox_eq_prev_device.txt")); - return Err(e); - } - }; - - // Store the engine - { - let mut guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - *guard = Some(engine); - } - - // 等待引擎初始化 - std::thread::sleep(std::time::Duration::from_millis(300)); - - Ok(prev_device) -} - -// ===== 音频设备切换功能(原生 COM,无 PowerShell) ===== -// 直接使用 Windows IPolicyConfig COM 接口切换默认音频设备 -// 这是 SoundVolumeView、EarTrumpet、SoundSwitch 等工具背后的同一接口 - -/// IPolicyConfig COM 接口(Windows 非公开但稳定的 API) -/// CLSID: {870AF99C-171D-4F9E-AF0D-E63DF40C2BC9} -/// IID: {F8679F50-850A-41CF-9C72-430F290290C8} -const CLSID_POLICY_CONFIG: GUID = GUID::from_u128(0x870af99c_171d_4f9e_af0d_e63df40c2bc9); -const IID_IPOLICY_CONFIG: GUID = GUID::from_u128(0xf8679f50_850a_41cf_9c72_430f290290c8); - -/// IUnknown vtable(COM 接口的头 3 个方法) -#[repr(C)] -struct IUnknownVtbl { - query_interface: unsafe extern "system" fn(*mut std::ffi::c_void, *const GUID, *mut *mut std::ffi::c_void) -> HRESULT, - add_ref: unsafe extern "system" fn(*mut std::ffi::c_void) -> u32, - release: unsafe extern "system" fn(*mut std::ffi::c_void) -> u32, -} - -/// IPolicyConfig vtable(IUnknown + 12 个方法) -#[repr(C)] -struct IPolicyConfigVtbl { - // IUnknown - query_interface: unsafe extern "system" fn(*mut std::ffi::c_void, *const GUID, *mut *mut std::ffi::c_void) -> HRESULT, - add_ref: unsafe extern "system" fn(*mut std::ffi::c_void) -> u32, - release: unsafe extern "system" fn(*mut std::ffi::c_void) -> u32, - // IPolicyConfig - get_mix_format: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *mut *mut std::ffi::c_void) -> HRESULT, - get_device_format: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, i32, *mut *mut std::ffi::c_void) -> HRESULT, - reset_device_format: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR) -> HRESULT, - set_device_format: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *mut std::ffi::c_void, *mut std::ffi::c_void) -> HRESULT, - get_processing_period: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, i32, *mut i64, *mut i64) -> HRESULT, - set_processing_period: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *mut i64) -> HRESULT, - get_share_mode: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *mut std::ffi::c_void) -> HRESULT, - set_share_mode: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *mut std::ffi::c_void) -> HRESULT, - get_property_value: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *const std::ffi::c_void, *mut std::ffi::c_void) -> HRESULT, - set_property_value: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, *const std::ffi::c_void, *mut std::ffi::c_void) -> HRESULT, - set_default_endpoint: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, i32) -> HRESULT, - set_endpoint_visibility: unsafe extern "system" fn(*mut std::ffi::c_void, PCWSTR, i32) -> HRESULT, -} - -#[repr(C)] -struct IPolicyConfigCom { - vtbl: *const IPolicyConfigVtbl, -} - -/// 设置默认音频设备(三个 role 全部设置:eConsole / eMultimedia / eCommunications) -fn native_set_default_device(device_id: &str) -> Result<(), String> { - unsafe { - // 1. 创建 IPolicyConfig COM 实例(通过 IUnknown) - let unknown: IUnknown = CoCreateInstance(&CLSID_POLICY_CONFIG, None, CLSCTX_ALL) - .map_err(|e| format!("CoCreateInstance IPolicyConfig failed: {}", e))?; - - // 2. QueryInterface 获取 IPolicyConfig 接口指针 - let raw = unknown.as_raw(); - let unk_vtbl = *(raw as *const *const IUnknownVtbl); - let mut policy_ptr: *mut std::ffi::c_void = std::ptr::null_mut(); - let hr = ((*unk_vtbl).query_interface)(raw, &IID_IPOLICY_CONFIG, &mut policy_ptr); - if hr.is_err() { - return Err(format!("QueryInterface IPolicyConfig failed: {:?}", hr)); - } - - let policy = &*(policy_ptr as *const IPolicyConfigCom); - let id = HSTRING::from(device_id); - let pcwstr = PCWSTR(id.as_ptr()); - - // 3. 三个 role 都要设置 - for role in [0i32, 1, 2] { - let hr = ((*policy.vtbl).set_default_endpoint)(policy_ptr, pcwstr, role); - if hr.is_err() { - ((*policy.vtbl).release)(policy_ptr); - return Err(format!("SetDefaultEndpoint failed (role {}): {:?}", role, hr)); - } - } - - // 4. Release - ((*policy.vtbl).release)(policy_ptr); - } - Ok(()) -} - -/// 查找渲染设备(名称包含匹配,大小写不敏感) -/// 返回 (device_id, device_name) -fn native_find_device(enumerator: &wa::IMMDeviceEnumerator, name_contains: &str) -> Option<(String, String)> { - unsafe { - let collection = enumerator.EnumAudioEndpoints(wa::eRender, wa::DEVICE_STATE_ACTIVE).ok()?; - let count = collection.GetCount().ok()?; - let search = name_contains.to_lowercase(); - for i in 0..count { - if let Ok(device) = collection.Item(i) { - let id = get_device_id(&device).unwrap_or_default(); - let name = get_device_name(&device); - if name.to_lowercase().contains(&search) { - return Some((id, name)); - } - } - } - } - None -} - -/// 获取当前默认渲染设备名称 -fn native_get_default_name(enumerator: &wa::IMMDeviceEnumerator) -> Option { - unsafe { - let device = enumerator.GetDefaultAudioEndpoint(wa::eRender, wa::eConsole).ok()?; - Some(get_device_name(&device)) - } -} - -/// 在独立线程上运行 COM 操作(确保 COM 初始化正确) -fn run_com_thread(f: F) -> Result -where - T: Send + 'static, - F: FnOnce() -> Result + Send + 'static, -{ - let handle = std::thread::spawn(move || -> Result { - unsafe { - let co_hr = CoInitializeEx(None, COINIT_MULTITHREADED); - if co_hr.is_err() { - return Err(format!("CoInitializeEx failed: {:?}", co_hr)); - } - let result = f(); - CoUninitialize(); - result - } - }); - handle.join().map_err(|_| "COM thread panicked".to_string())? -} - -/// 切换 Windows 默认音频播放设备到 FxSound Audio Enhancer -/// 返回格式 "PREV:设备名",包含切换前的默认设备名 -/// 同时将前一个设备名写入临时文件(供 stop_eq_engine 恢复用) -fn switch_default_audio_to_fxsound() -> Result { - run_com_thread(|| { - let enumerator: wa::IMMDeviceEnumerator = unsafe { - CoCreateInstance(&wa::MMDeviceEnumerator, None, CLSCTX_ALL) - }.map_err(|e| format!("CoCreateInstance MMDeviceEnumerator failed: {}", e))?; - - // 获取当前默认设备名(保存供恢复用) - let prev_name = native_get_default_name(&enumerator).unwrap_or_default(); - log::info!("[audio_switch] Previous default device: '{}'", prev_name); - - // 查找 FxSound 设备 - let (fxsound_id, fxsound_name) = native_find_device(&enumerator, "fxsound") - .ok_or_else(|| "找不到 FxSound Audio Enhancer 设备,请确认驱动已安装并在声音设置中可见".to_string())?; - log::info!("[audio_switch] Found FxSound: '{}' (id={})", fxsound_name, fxsound_id); - - // 切换到 FxSound - native_set_default_device(&fxsound_id)?; - log::info!("[audio_switch] Switched default device to FxSound"); - - // 保存前一个设备名到文件(Rust 原生写入,UTF-8 无 BOM) - let prev_file = std::env::temp_dir().join("nexbox_eq_prev_device.txt"); - let _ = fs::write(&prev_file, &prev_name); - - Ok(format!("PREV:{}", prev_name)) - }) -} - -/// 恢复 Windows 默认音频设备 -fn restore_default_audio_device(device_name: &str) { - let name = device_name.to_string(); - let result = run_com_thread(move || { - let enumerator: wa::IMMDeviceEnumerator = unsafe { - CoCreateInstance(&wa::MMDeviceEnumerator, None, CLSCTX_ALL) - }.map_err(|e| format!("CoCreateInstance failed: {}", e))?; - - // 按名称查找设备 - if let Some((device_id, found_name)) = native_find_device(&enumerator, &name) { - log::info!("[audio_restore] Found device '{}' (id={}), switching...", found_name, device_id); - native_set_default_device(&device_id)?; - log::info!("[audio_restore] Restored to: {}", found_name); - } else { - log::warn!("[audio_restore] Device '{}' not found", name); - } - Ok(()) - }); - - if let Err(e) = result { - log::warn!("[audio_restore] Failed: {}", e); - } -} - -/// 获取当前默认音频输出设备名称 -#[tauri::command] -pub fn get_default_audio_device() -> Result { - run_com_thread(|| { - let enumerator: wa::IMMDeviceEnumerator = unsafe { - CoCreateInstance(&wa::MMDeviceEnumerator, None, CLSCTX_ALL) - }.map_err(|e| format!("CoCreateInstance failed: {}", e))?; - - native_get_default_name(&enumerator) - .ok_or_else(|| "No default audio device found".to_string()) - }) -} - -/// 停止 EQ 引擎 -#[tauri::command] -pub fn stop_eq_engine() -> Result<(), String> { - // 停止音频引擎 - { - let mut guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(mut engine) = guard.take() { - engine.stop(); - log::info!("[eq] Audio engine stopped"); - } - } - - // 恢复原始默认音频设备 - let prev_file = std::env::temp_dir().join("nexbox_eq_prev_device.txt"); - match fs::read_to_string(&prev_file) { - Ok(raw) => { - let prev_name = raw.trim_start_matches('\u{FEFF}').trim().to_string(); - if !prev_name.is_empty() && !prev_name.to_lowercase().contains("fxsound") { - log::info!("[eq] Restoring audio device to: {}", prev_name); - restore_default_audio_device(&prev_name); - } else if prev_name.to_lowercase().contains("fxsound") { - log::info!("[eq] Previous device was FxSound, skipping restore"); - } - let _ = fs::remove_file(&prev_file); - } - Err(_) => { - log::info!("[eq] No previous device file found, skipping restore"); - } - } - - Ok(()) -} - -/// 获取 EQ 引擎运行状态 -#[tauri::command] -pub fn get_eq_engine_status() -> Result { - let guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(ref engine) = *guard { - if engine.is_running() { - return Ok(EngineStatus { - running: true, - pid: None, - }); - } - } - - Ok(EngineStatus { - running: false, - pid: None, - }) -} - -/// 实时更新 EQ 频段增益(无需重启引擎) -#[tauri::command] -pub fn update_eq_bands(bands: Vec<(f64, f64)>) -> Result<(), String> { - let guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(ref engine) = *guard { - let band_params: Vec = bands - .iter() - .map(|(freq, gain)| BandParam { freq: *freq, gain: *gain }) - .collect(); - engine.update_bands(band_params); - log::info!("[eq] Updated {} bands", bands.len()); - } - Ok(()) -} - -/// 设置总增益 (-12..+12 dB) -#[tauri::command] -pub fn update_eq_preamp(gain: f64) -> Result<(), String> { - let guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(ref engine) = *guard { - engine.set_preamp(gain); - log::info!("[eq] Preamp set to {} dB", gain); - } - Ok(()) -} - -/// 获取所有 EQ 预设(内置 + 用户导入) -#[tauri::command] -pub fn get_eq_presets(app: AppHandle) -> Result, String> { - let mut presets: Vec = Vec::new(); - - // 1. 加载内置预设 - let mut builtin_count = 0; - if let Some(fxvad_dir) = get_fxvad_resource_dir(&app) { - let builtin_dir = fxvad_dir.join("presets"); - load_presets_from_dir(&builtin_dir, &mut presets); - builtin_count = presets.len(); - } - - // 2. 加载用户导入的预设 - let user_dir = get_user_presets_dir(); - load_presets_from_dir(&user_dir, &mut presets); - - // 内置预设不应保留音效参数(仅导入的 .fac 才生效) - for p in presets.iter_mut().take(builtin_count) { - p.effects = None; - } - - // 按 ID 排序 - presets.sort_by_key(|p| p.id.parse::().unwrap_or(999)); - - Ok(presets) -} - -fn load_presets_from_dir(dir: &PathBuf, presets: &mut Vec) { - if !dir.exists() { - return; - } - let Ok(entries) = fs::read_dir(dir) else { return }; - let mut files: Vec<_> = entries.filter_map(|e| e.ok()).collect(); - files.sort_by_key(|e| { - e.file_name() - .to_string_lossy() - .trim_end_matches(".fac") - .parse::() - .unwrap_or(999) - }); - for entry in files { - let path = entry.path(); - if path.extension().and_then(|e| e.to_str()) != Some("fac") { - continue; - } - let file_id = path - .file_stem() - .and_then(|s| s.to_str()) - .unwrap_or("unknown") - .to_string(); - // 跳过已存在的同名 ID(内置优先) - if presets.iter().any(|p| p.id == file_id) { - continue; - } - if let Ok(content) = fs::read_to_string(&path) { - if let Some(preset) = parse_fac_file(&content, &file_id) { - presets.push(preset); - } - } - } -} - -/// 应用 EQ 预设(更新引擎中的频段参数),搜索内置和用户两个目录 -#[tauri::command] -pub fn apply_eq_preset(app: AppHandle, preset_id: String) -> Result<(), String> { - let mut content: Option = None; - - // 先查内置目录 - if let Some(fxvad_dir) = get_fxvad_resource_dir(&app) { - let f = fxvad_dir.join("presets").join(format!("{}.fac", preset_id)); - if f.exists() { - content = Some(fs::read_to_string(&f).map_err(|e| format!("读取预设失败: {}", e))?); - } - } - - // 再查用户目录 - if content.is_none() { - let f = get_user_presets_dir().join(format!("{}.fac", preset_id)); - if f.exists() { - content = Some(fs::read_to_string(&f).map_err(|e| format!("读取预设失败: {}", e))?); - } - } - - let content = content.ok_or_else(|| format!("预设 {} 不存在", preset_id))?; - let preset = parse_fac_file(&content, &preset_id); - - if let Some(p) = &preset { - let guard = eq_engine().lock().map_err(|e| format!("锁错误: {}", e))?; - if let Some(ref engine) = *guard { - let band_params: Vec = p.bands - .iter() - .map(|b| BandParam { freq: b.freq, gain: b.gain }) - .collect(); - engine.update_bands(band_params); - log::info!("[eq] Applied preset '{}' with {} bands", p.name, p.bands.len()); - } - } - - Ok(()) -} - -/// 导入 FAC 预设文件,返回解析后的预设(保存到 %LOCALAPPDATA%/NexBox/EQEngine/presets/) -#[tauri::command] -pub fn import_eq_preset(app: AppHandle, content: String) -> Result { - let presets_dir = get_user_presets_dir(); - - // 找到最大 ID + 1,同时扫描内置和用户两个目录,确保 ID 不冲突 - let mut max_id = 0; - let mut scan_ids = |dir: &PathBuf| { - if let Ok(entries) = fs::read_dir(dir) { - for entry in entries.flatten() { - if let Some(stem) = entry.path().file_stem() { - if let Some(s) = stem.to_str() { - if let Ok(id) = s.parse::() { - max_id = max_id.max(id); - } - } - } - } - } - }; - scan_ids(&presets_dir); - if let Some(fxvad_dir) = get_fxvad_resource_dir(&app) { - scan_ids(&fxvad_dir.join("presets")); - } - let new_id = (max_id + 1).to_string(); - - // 写入 .fac 文件 - let new_path = presets_dir.join(format!("{}.fac", new_id)); - fs::write(&new_path, &content) - .map_err(|e| format!("写入预设文件失败: {}", e))?; - - // 解析并返回 - parse_fac_file(&content, &new_id) - .ok_or_else(|| "解析预设文件失败".to_string()) -} - -/// 删除导入的 FAC 预设文件(从用户目录) -#[tauri::command] -pub fn delete_eq_preset(preset_id: String) -> Result<(), String> { - let preset_file = get_user_presets_dir().join(format!("{}.fac", preset_id)); - if preset_file.exists() { - fs::remove_file(&preset_file) - .map_err(|e| format!("删除预设失败: {}", e))?; - log::info!("[eq] Deleted user preset file: {:?}", preset_file); - } - Ok(()) -} - -/// 获取 10 段频谱数据(FxSound IIR 滤波器组,每段 0.0-1.0) -#[tauri::command] -pub fn get_spectrum() -> Result<[f64; 10], String> { - let guard = crate::audio_engine::spectrum_bands() - .read().map_err(|e| format!("{}", e))?; - Ok(*guard) -} - -/// 获取当前音频输出电平(L/R 峰值,0.0-1.0) -#[tauri::command] -pub fn get_audio_levels() -> Result<(f32, f32), String> { - let packed = crate::audio_engine::output_levels().load(std::sync::atomic::Ordering::Relaxed); - Ok(crate::audio_engine::unpack_levels(packed)) -} - -/// 保存预设(覆盖写入 .fac 文件,包含 EQ 频段和音效参数) -#[tauri::command] -pub fn save_eq_preset(preset_id: String, content: String) -> Result<(), String> { - let preset_file = get_user_presets_dir().join(format!("{}.fac", preset_id)); - fs::write(&preset_file, &content) - .map_err(|e| format!("保存预设失败: {}", e))?; - log::info!("[eq] Saved preset: {:?}", preset_file); - Ok(()) -} - -/// 导出 .fac 文件到指定路径 -#[tauri::command] -pub fn export_fac_file(path: String, content: String) -> Result<(), String> { - fs::write(&path, &content) - .map_err(|e| format!("写入失败: {}", e))?; - log::info!("[eq] Exported .fac to: {}", path); - Ok(()) -} - -/// 清理 EQ 相关资源(应用退出时调用) -pub fn cleanup() { - let _ = stop_eq_engine(); -} diff --git a/参考/NexBox-main/src-tauri/src/audio_eq_head.txt b/参考/NexBox-main/src-tauri/src/audio_eq_head.txt deleted file mode 100644 index 07e6870..0000000 --- a/参考/NexBox-main/src-tauri/src/audio_eq_head.txt +++ /dev/null @@ -1,993 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; -use tauri::{AppHandle, Manager}; -use sysinfo::System; - -mod audio_device; - -const CREATE_NO_WINDOW: u32 = 0x08000000; -const WUJIEQ_EXE: &str = "wujieq.exe"; -const FXVAD_SERVICE: &str = "FXVAD"; - -/// 驱动状态 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DriverStatus { - pub installed: bool, - pub service_exists: bool, - pub service_running: bool, - pub device_name: String, - pub needs_reboot: bool, -} - -/// EQ 频段信息 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EqBand { - pub freq: f64, - pub gain: f64, -} - -/// EQ 预设 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EqPreset { - pub id: String, - pub name: String, - pub bands: Vec, - pub enabled: bool, -} - -/// EQ 引擎状态 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EngineStatus { - pub running: bool, - pub pid: Option, -} - -/// 获取 fxvad 资源目录 -fn get_fxvad_resource_dir(app: &AppHandle) -> Option { - // 1. 通过 Tauri resource_dir 查找(生产环境 + 部分开发现境) - if let Ok(resource_dir) = app.path().resource_dir() { - let candidates = [ - resource_dir.join("binaries").join("fxvad"), - resource_dir.join("resources").join("binaries").join("fxvad"), - resource_dir.join("_up_").join("resources").join("binaries").join("fxvad"), - resource_dir.join("_up_").join("_up_").join("src-tauri").join("resources").join("binaries").join("fxvad"), - ]; - for path in &candidates { - if path.exists() { - return Some(path.clone()); - } - } - } - - // 2. 通过 exe 路径查找(开发环境:exe 在 src-tauri/target/debug/ 下) - if let Ok(exe_path) = std::env::current_exe() { - if let Some(parent) = exe_path.parent() { - let candidates = [ - parent.join("binaries").join("fxvad"), - parent.join("resources").join("binaries").join("fxvad"), - // dev: target/debug -> src-tauri/resources/binaries/fxvad - parent.join("..").join("..").join("resources").join("binaries").join("fxvad"), - // dev: target/debug -> NexBox/src-tauri/resources/binaries/fxvad - parent.join("..").join("..").join("..").join("src-tauri").join("resources").join("binaries").join("fxvad"), - ]; - for path in &candidates { - if path.exists() { - if let Ok(canon) = path.canonicalize() { - return Some(canon); - } - return Some(path.clone()); - } - } - } - } - - // 3. 编译时路径(开发环境最可靠:CARGO_MANIFEST_DIR = src-tauri 目录) - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let dev_path = manifest_dir.join("resources").join("binaries").join("fxvad"); - if dev_path.exists() { - return Some(dev_path); - } - - None -} - -/// 获取 wujieq 工作目录(%LOCALAPPDATA%/NexBox/EQEngine) -fn get_eq_work_dir() -> PathBuf { - let mut path = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - path.push("NexBox"); - path.push("EQEngine"); - if !path.exists() { - let _ = fs::create_dir_all(&path); - } - path -} - -/// 解析 .fac 预设文件 -fn parse_fac_file(content: &str, file_id: &str) -> Option { - let mut name = String::new(); - let mut bands: Vec = Vec::new(); - let mut enabled = true; - let mut in_bands = false; - let mut current_freq: Option = None; - - for (line_idx, line) in content.lines().enumerate() { - let trimmed = line.trim(); - - // 第3行是预设名称(索引2) - if line_idx == 2 { - name = trimmed.to_string(); - continue; - } - - // 检测 On/Off Flag - if trimmed.contains("On/Off Flag") { - if let Some(val_str) = trimmed.split(':').next() { - if let Ok(val) = val_str.trim().parse::() { - enabled = val != 0; - } - } - in_bands = true; - continue; - } - - if in_bands { - // 匹配 " 62.5: CF" 格式 - if trimmed.ends_with(": CF") || trimmed.ends_with(":CF") { - let freq_str = trimmed.split(':').next().unwrap_or("").trim(); - if let Ok(freq) = freq_str.parse::() { - current_freq = Some(freq); - } - } - // 匹配 " 0: Boost/Cut" 格式 - else if trimmed.contains("Boost/Cut") { - if let Some(freq) = current_freq { - let gain_str = trimmed.split(':').next().unwrap_or("").trim(); - if let Ok(gain) = gain_str.parse::() { - bands.push(EqBand { freq, gain }); - } - current_freq = None; - } - } - } - } - - if name.is_empty() { - name = format!("Preset {}", file_id); - } - - Some(EqPreset { - id: file_id.to_string(), - name, - bands, - enabled, - }) -} - -#[tauri::command] -pub fn check_virtual_audio_driver() -> Result { - let mut service_exists = false; - let mut service_running = false; - - // 使用 sc query 检查服务 - if let Ok(output) = Command::new("sc") - .args(["query", FXVAD_SERVICE]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - let combined = format!("{}\n{}", stdout, stderr); - - // sc query 成功 (exit code 0) 才说明服务存在 - // 服务不存在时 exit code 非零,输出包含错误码 1060 - let cmd_success = output.status.success(); - let is_error_1060 = combined.contains("1060") - && (combined.contains("does not exist") - || combined.contains("不存在") - || combined.contains("未安装") - || combined.contains("FAILED") - || combined.contains("失败")); - - if cmd_success || (combined.to_lowercase().contains("fxvad") && !is_error_1060) { - service_exists = true; - if combined.contains("RUNNING") { - service_running = true; - } - } - } - - let mut needs_reboot = false; - if service_exists { - if let Ok(output) = Command::new("sc") - .args(["qc", FXVAD_SERVICE]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let stdout = String::from_utf8_lossy(&output.stdout); - if stdout.contains("DISABLED") || stdout.contains("禁用") { - needs_reboot = true; - } - } - } - - // 使用 pnputil 检查驱动是否已安装 - let mut driver_installed = service_exists; - if !driver_installed { - if let Ok(output) = Command::new("pnputil") - .args(["/enum-drivers"]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let stdout = String::from_utf8_lossy(&output.stdout); - if stdout.to_lowercase().contains("fxsound") || stdout.to_lowercase().contains("fxvad") { - driver_installed = true; - } - } - } - - Ok(DriverStatus { - installed: driver_installed, - service_exists, - service_running, - device_name: "FxSound Audio Enhancer".to_string(), - needs_reboot, - }) -} - -#[tauri::command] -pub async fn install_virtual_audio_driver(app: AppHandle) -> Result { - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到驱动资源目录".to_string())?; - - let inf_path = fxvad_dir.join("fxvad.inf"); - let devcon_path = fxvad_dir.join("fxdevcon64.exe"); - let sys_path = fxvad_dir.join("fxvad.sys"); - - if !inf_path.exists() { - return Err("驱动 INF 文件不存在".to_string()); - } - if !devcon_path.exists() { - return Err("devcon 工具不存在".to_string()); - } - - let inf_str = inf_path.to_string_lossy().replace('\'', "''"); - let devcon_str = devcon_path.to_string_lossy().replace('\'', "''"); - let sys_str = sys_path.to_string_lossy().replace('\'', "''"); - - // 构建 PowerShell 安装脚本(以管理员权限运行) - let ps_script = format!( - r#" -$ErrorActionPreference = 'SilentlyContinue' -$logFile = Join-Path $env:TEMP 'nexbox_eq_install.log' -"=== Install Start ===" | Out-File $logFile -Encoding UTF8 - -# Step 1: 复制驱动文件到 system32\drivers -"Step 1: Copying fxvad.sys" | Out-File $logFile -Append -Encoding UTF8 -$srcSys = '{sys_str}' -$dstSys = 'C:\Windows\System32\drivers\fxvad.sys' -if (-not (Test-Path $dstSys)) {{ - Copy-Item $srcSys $dstSys -Force 2>&1 | Out-File $logFile -Append -Encoding UTF8 - "Copied fxvad.sys" | Out-File $logFile -Append -Encoding UTF8 -}} else {{ - "fxvad.sys already exists" | Out-File $logFile -Append -Encoding UTF8 -}} - -# Step 2: 使用 pnputil 安装驱动包 -"Step 2: pnputil /add-driver" | Out-File $logFile -Append -Encoding UTF8 -$infPath = '{inf_str}' -$pnputilResult = pnputil /add-driver $infPath /install 2>&1 -"pnputil output: $pnputilResult" | Out-File $logFile -Append -Encoding UTF8 - -# Step 3: 使用 devcon 创建设备实例 -"Step 3: devcon install" | Out-File $logFile -Append -Encoding UTF8 -$devconExe = '{devcon_str}' -$devconResult = & $devconExe install $infPath 'Root\FXVAD' 2>&1 -"devcon output: $devconResult" | Out-File $logFile -Append -Encoding UTF8 - -Start-Sleep -Seconds 3 - -# 验证 -"Step 4: Verification" | Out-File $logFile -Append -Encoding UTF8 -$scQuery = sc.exe query FXVAD 2>&1 -"sc query: $scQuery" | Out-File $logFile -Append -Encoding UTF8 - -if ($scQuery -match 'FXVAD|FxSound') {{ - "RESULT:SUCCESS" | Out-File $logFile -Append -Encoding UTF8 - Write-Output 'SUCCESS' -}} else {{ - # 检查 pnputil 中是否有驱动 - $enumCheck = pnputil /enum-drivers 2>&1 - $found = $enumCheck | Where-Object {{ $_ -match 'fxsound|fxvad' }} - if ($found) {{ - "RESULT:SUCCESS" | Out-File $logFile -Append -Encoding UTF8 - Write-Output 'SUCCESS' - }} else {{ - "RESULT:FAILED" | Out-File $logFile -Append -Encoding UTF8 - Write-Output 'FAILED' - }} -}} -"#, - sys_str = sys_str, - inf_str = inf_str, - devcon_str = devcon_str - ); - - let temp_dir = std::env::temp_dir(); - let script_path = temp_dir.join("nexbox_eq_install.ps1"); - fs::write(&script_path, &ps_script) - .map_err(|e| format!("写入安装脚本失败: {}", e))?; - - let script_str = script_path.to_string_lossy().replace('\'', "''"); - - log::info!("[install] Script written to {:?}", script_path); - - let ps_command = format!( - "Start-Process -FilePath 'powershell' -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"{}\"' -Verb RunAs -Wait -WindowStyle Hidden", - script_str - ); - - let output = Command::new("powershell") - .args(["-WindowStyle", "Hidden", "-NoProfile", "-Command", &ps_command]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行安装脚本失败: {}", e))?; - - // 读取日志 - let log_path = temp_dir.join("nexbox_eq_install.log"); - if let Ok(log_content) = fs::read_to_string(&log_path) { - log::info!("[install] Log:\n{}", log_content); - } - - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - log::info!("[install] PowerShell stdout: {}", stdout); - if !stderr.is_empty() { - log::warn!("[install] PowerShell stderr: {}", stderr); - } - - // 清理临时脚本 - let _ = fs::remove_file(&script_path); - - // 检查用户是否取消了 UAC - if !output.status.success() { - let stderr_lower = stderr.to_lowercase(); - if stderr_lower.contains("cancel") || stderr_lower.contains("denied") || stderr_lower.contains("取消") { - return Err("管理员授权被取消,安装未执行".to_string()); - } - } - - // 验证安装结果 - std::thread::sleep(std::time::Duration::from_secs(1)); - let status = check_virtual_audio_driver()?; - if status.installed { - let _ = fs::remove_file(&log_path); - Ok("虚拟声卡驱动安装成功".to_string()) - } else { - // 读取日志中的详细信息 - let log_detail = fs::read_to_string(&log_path).unwrap_or_default(); - let log_summary = log_detail - .lines() - .filter(|l| l.contains("output:") || l.contains("RESULT:") || l.contains("Failed")) - .collect::>() - .join("\n"); - Err(format!( - log_summary - )) - } -} - -#[tauri::command] -pub async fn uninstall_virtual_audio_driver(app: AppHandle) -> Result { - // 先停止 EQ 引擎 - let _ = stop_eq_engine(); - - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到驱动资源目录".to_string())?; - - let devcon_path = fxvad_dir.join("fxdevcon64.exe"); - let devcon_str = devcon_path.to_string_lossy().replace('\'', "''"); - - // 构建精简 PowerShell 卸载脚本(极简:核心就是一条正则找 oem.inf → pnputil 删除) - let ps_script = format!( - r#" -$ErrorActionPreference = 'Continue' -$log = "$env:TEMP\nexbox_eq_uninstall.log" -'START' | Out-File $log - -# 1. 禁用服务 -sc.exe config FXVAD start= disabled *>> $log -# 2. 尝试停止(NOT_STOPPABLE 会失败,忽略) -sc.exe stop FXVAD *>> $log -# 3. devcon 移除设备 -$d = '{devcon_str}' -if (Test-Path $d) {{ - & $d remove '@ROOT\FXVAD\*' *>> $log - & $d remove '=MEDIA' 'ROOT\FXVAD*' *>> $log -}} -$delOut = sc.exe delete FXVAD 2>&1 -"SC_DELETE: $delOut" | Out-File $log -Append -$isMarked = $delOut -match '1072|marked|标记' -"MARKED: $isMarked" | Out-File $log -Append - -# 5. 删除驱动包 —— 核心:一条正则找 oemXX.inf 的 Published Name -$raw = pnputil /enum-drivers 2>&1 | Out-String -# 匹配 "发布名称: oem6.inf ... 原始名称: fxvad.inf"(中英文均兼容) -$re = '(?:Published Name|发布名称):\s+(oem\d+\.inf).*?\n.*?(?:Original Name|原始名称):\s+fxvad\.inf' -if ($raw -match $re) {{ - $oem = $Matches[1] - "DELETE_DRIVER: $oem" | Out-File $log -Append - pnputil /delete-driver $oem /uninstall /force *>> $log -}} else {{ - "NO_FXVAD_OEM" | Out-File $log -Append -}} - -# 6. 安排重启后删除 fxvad.sys -$sys = 'C:\Windows\System32\drivers\fxvad.sys' -if (Test-Path $sys) {{ - try {{ Remove-Item $sys -Force -ErrorAction Stop; "FILE_DELETED" | Out-File $log -Append }} - catch {{ - "FILE_REBOOT" | Out-File $log -Append - Add-Type -Name MF -Namespace W -EA SilentlyContinue -MemberDef '[DllImport("kernel32.dll")]public static extern bool MoveFileEx(string a,string b,int f);' - [W.MF]::MoveFileEx($sys, $null, 4) | Out-Null - }} -}} - -# 7. 验证 + 报告 -$ck = sc.exe query FXVAD 2>&1 -"CHECK: $ck" | Out-File $log -Append -$gone = $ck -match '1060|不存在|未安装' - -# 再次检查 pnputil 是否还有残留 -$check2 = pnputil /enum-drivers 2>&1 | Out-String -$pnpLeft = $check2 -match 'fxvad|fxsound' -"PNP_LEFT: $pnpLeft" | Out-File $log -Append - -if ($gone -and -not $pnpLeft) {{ Write-Output 'SUCCESS' }} -elseif ($pnpLeft -and ($gone -or $isMarked)) {{ - if ($check2 -match '(?:Published Name|发布名称):\s+(oem\d+\.inf)[\s\S]*?fxvad') {{ - $oem2 = $Matches[1] - pnputil /delete-driver $oem2 /uninstall /force *>> $log - $finalCheck = pnputil /enum-drivers 2>&1 | Out-String - if ($finalCheck -match 'fxvad|fxsound') {{ - Write-Output 'REBOOT_REQUIRED' - }} else {{ - Write-Output 'SUCCESS' - }} - }} else {{ - Write-Output 'REBOOT_REQUIRED' - }} -}} -elseif ($isMarked -and ($ck -match 'FXVAD')) {{ Write-Output 'REBOOT_REQUIRED' }} -else {{ Write-Output 'PARTIAL' }} -"#, - devcon_str = devcon_str - ); - - let temp_dir = std::env::temp_dir(); - let script_path = temp_dir.join("nexbox_eq_uninstall.ps1"); - fs::write(&script_path, &ps_script) - .map_err(|e| format!("写入卸载脚本失败: {}", e))?; - - let script_str = script_path.to_string_lossy().replace('\'', "''"); - log::info!("[uninstall] Script written to {:?}", script_path); - - let ps_command = format!( - "Start-Process -FilePath 'powershell' -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"{}\"' -Verb RunAs -Wait -WindowStyle Hidden", - script_str - ); - - let output = Command::new("powershell") - .args(["-WindowStyle", "Hidden", "-NoProfile", "-Command", &ps_command]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行卸载脚本失败: {}", e))?; - - let log_path = temp_dir.join("nexbox_eq_uninstall.log"); - if let Ok(log_content) = fs::read_to_string(&log_path) { - log::info!("[uninstall] Log:\n{}", log_content); - } - - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - log::info!("[uninstall] stdout: {}", stdout); - if !stderr.is_empty() { - log::warn!("[uninstall] stderr: {}", stderr); - } - - let _ = fs::remove_file(&script_path); - - // UAC 取消检测 - if !output.status.success() { - let se = stderr.to_lowercase(); - if se.contains("cancel") || se.contains("denied") || se.contains("取消") { - return Err("管理员授权被取消,卸载未执行".to_string()); - } - } - - // 解析结果 - let out = stdout.trim(); - std::thread::sleep(std::time::Duration::from_secs(1)); - - if out.contains("SUCCESS") { - log::info!("[uninstall] Fully removed"); - let _ = fs::remove_file(&log_path); - Ok("虚拟声卡驱动已卸载".to_string()) - } else if out.contains("REBOOT_REQUIRED") { - log::info!("[uninstall] Pending reboot"); - let _ = fs::remove_file(&log_path); - Ok("驱动已标记卸载,需要重启电脑完成卸载".to_string()) - } else { - let detail = fs::read_to_string(&log_path).unwrap_or_default(); - let summary: Vec<&str> = detail - .lines() - .filter(|l| l.contains("DELETE_DRIVER:") || l.contains("NO_FXVAD_OEM") || l.contains("SC_DELETE:") || l.contains("MARKED:") || l.contains("FILE_") || l.contains("CHECK:")) - .collect(); - log::error!("[uninstall] Incomplete.\n{}", summary.join("\n")); - Err(format!( - summary.join("\n") - )) - } -} - -/// 切换 Windows 默认音频播放设备到 FxSound Audio Enhancer -fn switch_default_audio_to_fxsound() -> Result { - audio_device::switch_to_fxsound() -} - -// switch function ends above, old body removed - -fn restore_default_audio_device(device_name: &str) { - audio_device::restore_device(device_name); -} - -#[tauri::command] -pub fn get_default_audio_device() -> Result { - audio_device::get_current_device() -} - -/// 启动 EQ 引擎(wujieq.exe),并自动切换默认音频设备到 FxSound -#[tauri::command] -pub async fn start_eq_engine(app: AppHandle) -> Result { - var imm = (IMMDeviceEnumerator)e; - imm.EnumAudioEndpoints(0,1,out IntPtr pC); - var col = (IMMDeviceCollection)Marshal.GetObjectForIUnknown(pC); - col.GetCount(out uint n); - for (uint i=0;i=0) { - dev.GetId(out string did); - var cfg = Activator.CreateInstance(Type.GetTypeFromCLSID(Guid.Parse("{870AF99C-171D-4F9E-AF0D-E63DF40C2BC9}"))); - ((IPolicyConfig)cfg).SetDefaultEndpoint(did,0); - return nm; - } - } - return null; -} -"#; - - // COM 接口定义 - let com_defs = r#" -[ComImport,Guid("870AF99C-171D-4F9E-AF0D-E63DF40C2BC9")] public class _PC {} -[ComImport,Guid("F8679F50-850A-41CF-9C72-430F290290C8"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IPolicyConfig { - [PreserveSig] int a();[PreserveSig] int b();[PreserveSig] int c();[PreserveSig] int d();[PreserveSig] int e();[PreserveSig] int f(); - [PreserveSig] int g();[PreserveSig] int h();[PreserveSig] int i();[PreserveSig] int j(); - [PreserveSig] int SetDefaultEndpoint([MarshalAs(UnmanagedType.LPWStr)] string id, int role); - [PreserveSig] int k(); -} -[ComImport,Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] public class _MMDE {} -[ComImport,Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDeviceEnumerator { - int a();int b();int c();int d(); - int EnumAudioEndpoints(int df, int sm, out IntPtr p); - int GetDefaultAudioEndpoint(int df, int r, out IntPtr p); -} -[ComImport,Guid("D666063F-1587-4E43-81F1-B948E807363F"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDevice { - int a(); int OpenPropertyStore(int s, out IntPtr p); - int GetId([MarshalAs(UnmanagedType.LPWStr)] out string id); -} -[ComImport,Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IPropertyStore { - int a();int b();int c();int d(); int GetValue(ref PROPERTYKEY k, out PROPVARIANT v); -} -[ComImport,Guid("0BD7A1BE-7A1A-44DB-8397-CC5392387B5E"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDeviceCollection { int GetCount(out uint c); int Item(uint i, out IntPtr p); } -[StructLayout(LayoutKind.Sequential)] public struct PROPERTYKEY { public Guid fmtid; public uint pid; } -[StructLayout(LayoutKind.Explicit)] public struct PROPVARIANT { [FieldOffset(0)] public ushort vt; [FieldOffset(8)] public IntPtr ptrVal; } -"#; - - // 构建完整 PowerShell 脚本 - let ps_script = format!( - "$ErrorActionPreference = 'Stop'\r\n\ - $src = @'\r\n\ - using System;\r\n\ - using System.Runtime.InteropServices;\r\n\ - {com_defs}\r\n\ - public static class AudioSwitch {{\r\n\ - {cs_code}\r\n\ - }}\r\n\ - '@\r\n\ - \r\n\ - $type = Add-Type -TypeDefinition $src -PassThru -ErrorAction Stop\r\n\ - $prev = [AudioSwitch]::GetCur()\r\n\ - $ok = [AudioSwitch]::SetDef('FxSound')\r\n\ - if ($ok) {{ Write-Output \"PREV:$prev\" }} else {{ Write-Output \"NOT_FOUND\" }}\r\n", - com_defs = com_defs, - cs_code = cs_code, - ); - - let temp_dir = std::env::temp_dir(); - let script_path = temp_dir.join("nexbox_audio_switch.ps1"); - // 写入 UTF-8 with BOM (PowerShell 需要 BOM 才能正确识别 UTF-8) - let mut bom = vec![0xEF, 0xBB, 0xBF]; - bom.extend_from_slice(ps_script.as_bytes()); - fs::write(&script_path, &bom).map_err(|e| format!("写入脚本失败: {}", e))?; - - let output = Command::new("powershell") - .args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-File"]) - .arg(&script_path) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行失败: {}", e))?; - - let _ = fs::remove_file(&script_path); - let stdout = String::from_utf8_lossy(&output.stdout).trim().to_string(); - let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string(); - log::info!("[audio_switch] stdout: {}", stdout); - if !stderr.is_empty() { - log::warn!("[audio_switch] stderr: {}", stderr); - } - - if stdout.starts_with("PREV:") { - Ok(stdout) - } else { - Err(format!("找不到 FxSound Audio Enhancer 设备,请确认驱动已安装并在声音设置中可见。\nstderr: {}", stderr)) - } -} - -/// 恢复 Windows 默认音频设备 -fn restore_default_audio_device(device_name: &str) { - let escaped = device_name.replace('\'', "''"); - let com_defs = r#"[ComImport,Guid("870AF99C-171D-4F9E-AF0D-E63DF40C2BC9")] public class _PC {} -[ComImport,Guid("F8679F50-850A-41CF-9C72-430F290290C8"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IPolicyConfig { [PreserveSig] int a();[PreserveSig] int b();[PreserveSig] int c();[PreserveSig] int d();[PreserveSig] int e();[PreserveSig] int f();[PreserveSig] int g();[PreserveSig] int h();[PreserveSig] int i();[PreserveSig] int j();[PreserveSig] int SetDefaultEndpoint([MarshalAs(UnmanagedType.LPWStr)] string id, int role);[PreserveSig] int k(); } -[ComImport,Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] public class _MMDE {} -[ComImport,Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDeviceEnumerator { int a();int b();int c();int d();int EnumAudioEndpoints(int df, int sm, out IntPtr p);int GetDefaultAudioEndpoint(int df, int r, out IntPtr p); } -[ComImport,Guid("D666063F-1587-4E43-81F1-B948E807363F"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDevice { int a();int OpenPropertyStore(int s, out IntPtr p);int GetId([MarshalAs(UnmanagedType.LPWStr)] out string id); } -[ComImport,Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IPropertyStore { int a();int b();int c();int d();int GetValue(ref PROPERTYKEY k, out PROPVARIANT v); } -[ComImport,Guid("0BD7A1BE-7A1A-44DB-8397-CC5392387B5E"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDeviceCollection { int GetCount(out uint c); int Item(uint i, out IntPtr p); } -[StructLayout(LayoutKind.Sequential)] public struct PROPERTYKEY { public Guid fmtid; public uint pid; } -[StructLayout(LayoutKind.Explicit)] public struct PROPVARIANT { [FieldOffset(0)] public ushort vt;[FieldOffset(8)] public IntPtr ptrVal; } -"#; - - let cs_code = format!(r#" -public static string Restore(string name) {{ - var e = Activator.CreateInstance(Type.GetTypeFromProgID("MMDeviceEnumerator")); - var imm = (IMMDeviceEnumerator)e; - imm.EnumAudioEndpoints(0,1,out IntPtr pC); - var col = (IMMDeviceCollection)Marshal.GetObjectForIUnknown(pC); - col.GetCount(out uint n); - for (uint i=0;i=0) {{ - dev.GetId(out string did); - var cfg = Activator.CreateInstance(Type.GetTypeFromCLSID(Guid.Parse("{{870AF99C-171D-4F9E-AF0D-E63DF40C2BC9}}"))); - ((IPolicyConfig)cfg).SetDefaultEndpoint(did,0); - return "OK"; - }} - }} - return null; -}} -"#); - - let ps_script = format!( - "$ErrorActionPreference = 'Stop'\r\n\ - $src = @'\r\n\ - using System;\r\n\ - using System.Runtime.InteropServices;\r\n\ - {com_defs}\r\n\ - public static class AudioRestore {{\r\n\ - {cs_code}\r\n\ - }}\r\n\ - '@\r\n\ - Add-Type -TypeDefinition $src -ErrorAction SilentlyContinue | Out-Null\r\n\ - if ([AudioRestore]::Restore('{escaped}')) {{ }} else {{ }}\r\n", - com_defs = com_defs, - cs_code = cs_code, - escaped = escaped, - ); - - let temp_dir = std::env::temp_dir(); - let script_path = temp_dir.join("nexbox_audio_restore.ps1"); - let mut bom = vec![0xEF, 0xBB, 0xBF]; - bom.extend_from_slice(ps_script.as_bytes()); - let _ = fs::write(&script_path, &bom); - - let output = Command::new("powershell") - .args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-File"]) - .arg(&script_path) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - let _ = fs::remove_file(&script_path); - match output { - Ok(o) => { - let s = String::from_utf8_lossy(&o.stdout); - if !s.trim().is_empty() { - log::info!("[audio_restore] stdout: {}", s.trim()); - } - } - Err(e) => log::warn!("[audio_restore] failed: {}", e), - } -} - -#[tauri::command] -pub fn get_default_audio_device() -> Result { - let com_defs = r#"[ComImport,Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] public class _MMDE {} -[ComImport,Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDeviceEnumerator { int a();int b();int c();int d();int e();int GetDefaultAudioEndpoint(int df, int r, out IntPtr p); } -[ComImport,Guid("D666063F-1587-4E43-81F1-B948E807363F"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IMMDevice { int a();int OpenPropertyStore(int s, out IntPtr p);int GetId(out string id); } -[ComImport,Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] -public interface IPropertyStore { int a();int b();int c();int d();int GetValue(ref PROPERTYKEY k, out PROPVARIANT v); } -[StructLayout(LayoutKind.Sequential)] public struct PROPERTYKEY { public Guid fmtid; public uint pid; } -[StructLayout(LayoutKind.Explicit)] public struct PROPVARIANT { [FieldOffset(0)] public ushort vt;[FieldOffset(8)] public IntPtr ptrVal; } -"#; - - let ps_script = format!( - "$ErrorActionPreference = 'Stop'\r\n\ - $src = @'\r\n\ - using System;\r\n\ - using System.Runtime.InteropServices;\r\n\ - {com_defs}\r\n\ - public static class AudioQ {{\r\n\ - public static string Get() {{\r\n\ - var e = Activator.CreateInstance(Type.GetTypeFromProgID(\"MMDeviceEnumerator\"));\r\n\ - var imm = (IMMDeviceEnumerator)e;\r\n\ - imm.GetDefaultAudioEndpoint(0,0,out IntPtr pD);\r\n\ - var dev = (IMMDevice)Marshal.GetObjectForIUnknown(pD);\r\n\ - dev.OpenPropertyStore(0,out IntPtr pS);\r\n\ - var s = (IPropertyStore)Marshal.GetObjectForIUnknown(pS);\r\n\ - var k = new PROPERTYKEY {{ fmtid=Guid.Parse(\"{{A45C254E-DF1C-4EFD-8020-67D146A850E0}}\"), pid=14 }};\r\n\ - s.GetValue(ref k, out PROPVARIANT v);\r\n\ - return Marshal.PtrToStringUni(v.ptrVal) ?? \"\";\r\n\ - }}}}\r\n\ - '@\r\n\ - Add-Type -TypeDefinition $src -ErrorAction Stop | Out-Null\r\n\ - Write-Output ([AudioQ]::Get())\r\n", - com_defs = com_defs - ); - - let temp_dir = std::env::temp_dir(); - let script_path = temp_dir.join("nexbox_audio_query.ps1"); - let mut bom = vec![0xEF, 0xBB, 0xBF]; - bom.extend_from_slice(ps_script.as_bytes()); - fs::write(&script_path, &bom).map_err(|e| format!("{}", e))?; - - let output = Command::new("powershell") - .args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-File"]) - .arg(&script_path) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("{}", e))?; - - let _ = fs::remove_file(&script_path); - Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()) -} - -/// 启动 EQ 引擎(wujieq.exe),并自动切换默认音频设备到 FxSound -#[tauri::command] -pub async fn start_eq_engine(app: AppHandle) -> Result { - let status = get_eq_engine_status()?; - if status.running { - return Err("EQ 引擎已在运行".to_string()); - } - - let driver_status = check_virtual_audio_driver()?; - if !driver_status.installed { - return Err("请先安装虚拟声卡驱动".to_string()); - } - - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到 EQ 引擎资源".to_string())?; - - let wujieq_path = fxvad_dir.join(WUJIEQ_EXE); - if !wujieq_path.exists() { - return Err("EQ 引擎程序不存在".to_string()); - } - - // 将 wujieq.exe 复制到工作目录 - let work_dir = get_eq_work_dir(); - let work_exe = work_dir.join(WUJIEQ_EXE); - if !work_exe.exists() || fs::metadata(&wujieq_path).map(|m| m.len()).unwrap_or(0) - != fs::metadata(&work_exe).map(|m| m.len()).unwrap_or(0) - { - fs::copy(&wujieq_path, &work_exe) - .map_err(|e| format!("复制 EQ 引擎失败: {}", e))?; - } - - let presets_src = fxvad_dir.join("presets"); - let presets_dst = work_dir.join("presets"); - if presets_src.exists() { - let _ = fs::create_dir_all(&presets_dst); - if let Ok(entries) = fs::read_dir(&presets_src) { - for entry in entries.flatten() { - if let Some(name) = entry.file_name().to_str() { - let _ = fs::copy(entry.path(), presets_dst.join(name)); - } - } - } - } - - // 保存当前默认设备,切换到 FxSound - let prev_device = switch_default_audio_to_fxsound() - .unwrap_or_else(|e| { log::warn!("[eq] Audio switch warning: {}", e); String::new() }); - // 保存前一个设备名,stop 时恢复 - if prev_device.starts_with("PREV:") { - let prev_name = &prev_device[5..]; - let _ = fs::write(std::env::temp_dir().join("nexbox_eq_prev_device.txt"), prev_name); - } - - // 启动 wujieq.exe - Command::new(&work_exe) - .current_dir(&work_dir) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("启动 EQ 引擎失败: {}", e))?; - - // 等待启动 - std::thread::sleep(std::time::Duration::from_millis(500)); - - if prev_device.starts_with("PREV:") { - Ok(format!("PREV:{}", &prev_device[5..])) - } else { - Ok("SWITCHED".to_string()) - } -} - -/// 停止 EQ 引擎 -#[tauri::command] -pub fn stop_eq_engine() -> Result<(), String> { - let mut sys = System::new(); - sys.refresh_processes(); - - let mut killed = 0; - for (_pid, process) in sys.processes() { - let name = process.name().to_lowercase(); - if name == "wujieq.exe" { - if process.kill() { - killed += 1; - } - } - } - - if killed > 0 { - log::info!("EQ engine stopped, killed {} process(es)", killed); - } - - let prev_file = std::env::temp_dir().join("nexbox_eq_prev_device.txt"); - if let Ok(prev_name) = fs::read_to_string(&prev_file) { - let prev_name = prev_name.trim().to_string(); - if !prev_name.is_empty() && prev_name.to_lowercase().contains("fxsound") == false { - log::info!("[eq] Restoring audio device to: {}", prev_name); - restore_default_audio_device(&prev_name); - } - let _ = fs::remove_file(&prev_file); - } - - Ok(()) -} - -/// 获取 EQ 引擎运行状态 -#[tauri::command] -pub fn get_eq_engine_status() -> Result { - let mut sys = System::new(); - sys.refresh_processes(); - - for (pid, process) in sys.processes() { - let name = process.name().to_lowercase(); - if name == "wujieq.exe" { - return Ok(EngineStatus { - running: true, - pid: Some(pid.as_u32()), - }); - } - } - - Ok(EngineStatus { - running: false, - pid: None, - }) -} - -/// 获取所有内置 EQ 预设 -#[tauri::command] -pub fn get_eq_presets(app: AppHandle) -> Result, String> { - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到资源目录".to_string())?; - - let presets_dir = fxvad_dir.join("presets"); - if !presets_dir.exists() { - return Ok(Vec::new()); - } - - let mut presets: Vec = Vec::new(); - - let mut entries: Vec<_> = fs::read_dir(&presets_dir) - .map_err(|e| format!("读取预设目录失败: {}", e))? - .filter_map(|e| e.ok()) - .collect(); - - // 按文件名排序 - entries.sort_by_key(|e| { - e.file_name() - .to_string_lossy() - .trim_end_matches(".fac") - .parse::() - .unwrap_or(999) - }); - - for entry in entries { - let path = entry.path(); - if path.extension().and_then(|e| e.to_str()) != Some("fac") { - continue; - } - - let file_id = path - .file_stem() - .and_then(|s| s.to_str()) - .unwrap_or("unknown") - .to_string(); - - if let Ok(content) = fs::read_to_string(&path) { - if let Some(preset) = parse_fac_file(&content, &file_id) { - presets.push(preset); - } - } - } - - Ok(presets) -} - -#[tauri::command] -pub fn apply_eq_preset(app: AppHandle, preset_id: String) -> Result<(), String> { - let fxvad_dir = get_fxvad_resource_dir(&app) - .ok_or_else(|| "无法找到资源目录".to_string())?; - - let preset_file = fxvad_dir.join("presets").join(format!("{}.fac", preset_id)); - if !preset_file.exists() { - return Err(format!("预设 {} 不存在", preset_id)); - } - - let work_dir = get_eq_work_dir(); - let _ = fs::create_dir_all(&work_dir); - - // 复制到工作目录 - let target = work_dir.join(format!("{}.fac", preset_id)); - fs::copy(&preset_file, &target) - .map_err(|e| format!("复制预设文件失败: {}", e))?; - - Ok(()) -} - -pub fn cleanup() { - let _ = stop_eq_engine(); -} diff --git a/参考/NexBox-main/src-tauri/src/auto_start.rs b/参考/NexBox-main/src-tauri/src/auto_start.rs deleted file mode 100644 index 8c3fddb..0000000 --- a/参考/NexBox-main/src-tauri/src/auto_start.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::process::Command; - -const APP_NAME: &str = "NexBox"; -const REG_PATH: &str = r"HKCU\Software\Microsoft\Windows\CurrentVersion\Run"; - -#[cfg(windows)] -fn exec_reg(args: &[&str]) -> Result { - use std::os::windows::process::CommandExt; - Command::new("reg") - .args(args) - .creation_flags(0x08000000) - .output() - .map_err(|e| format!("执行注册表命令失败: {}", e)) -} - -#[tauri::command] -pub async fn set_nexbox_auto_start(enable: bool) -> Result<(), String> { - #[cfg(windows)] - { - if enable { - let app_path = std::env::current_exe() - .map_err(|e| format!("获取程序路径失败: {}", e))? - .to_string_lossy() - .replace("/", "\\"); - - let output = exec_reg(&["add", REG_PATH, "/v", APP_NAME, "/t", "REG_SZ", "/d", &app_path, "/f"])?; - if !output.status.success() { - let error = String::from_utf8_lossy(&output.stderr); - return Err(format!("写入注册表失败: {}", error)); - } - log::info!("开机自启已启用: {}", app_path); - Ok(()) - } else { - exec_reg(&["delete", REG_PATH, "/v", APP_NAME, "/f"])?; - log::info!("开机自启已禁用"); - Ok(()) - } - } - - #[cfg(not(windows))] - { - Err("当前平台不支持开机自启动设置".to_string()) - } -} - -#[tauri::command] -pub async fn check_nexbox_auto_start() -> Result { - #[cfg(windows)] - { - let output = exec_reg(&["query", REG_PATH, "/v", APP_NAME])?; - Ok(output.status.success()) - } - - #[cfg(not(windows))] - { - Ok(false) - } -} diff --git a/参考/NexBox-main/src-tauri/src/crosshair.rs b/参考/NexBox-main/src-tauri/src/crosshair.rs deleted file mode 100644 index 3ea4923..0000000 --- a/参考/NexBox-main/src-tauri/src/crosshair.rs +++ /dev/null @@ -1,986 +0,0 @@ -use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; -use tauri::Emitter; - -static CROSSHAIR_ACTIVE: AtomicBool = AtomicBool::new(false); -static CROSSHAIR_HANDLE: AtomicPtr = AtomicPtr::new(std::ptr::null_mut()); - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct CrosshairSettings { - pub enabled: bool, - pub style: String, - pub size: i32, - pub thickness: i32, - pub color: String, - pub gap: i32, - pub dot_size: i32, - pub opacity: u8, - pub monitor_index: i32, - pub use_custom_image: bool, - pub custom_image_path: Option, -} - -impl Default for CrosshairSettings { - fn default() -> Self { - Self { - enabled: false, - style: "Cross".to_string(), - size: 20, - thickness: 2, - color: "#ff0000".to_string(), - gap: 0, - dot_size: 2, - opacity: 255, - monitor_index: -1, - use_custom_image: false, - custom_image_path: None, - } - } -} - -#[derive(serde::Serialize, Clone)] -pub struct DisplayInfo { - pub index: usize, - pub name: String, - pub device_name: String, - pub is_primary: bool, - pub width: i32, - pub height: i32, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct CrosshairResult { - pub success: bool, - pub message: String, -} - -static CURRENT_SETTINGS: Mutex> = Mutex::new(None); - -fn get_settings() -> CrosshairSettings { - let lock = CURRENT_SETTINGS.lock().unwrap(); - lock.as_ref().cloned().unwrap_or_default() -} - -#[tauri::command] -pub async fn get_crosshair_displays() -> Result, String> { - #[cfg(target_os = "windows")] - { - let result = tauri::async_runtime::spawn_blocking(|| { - use windows_sys::Win32::Graphics::Gdi::{ - EnumDisplayMonitors, GetMonitorInfoW, - HDC, HMONITOR, MONITORINFOEXW, - }; - - struct MonitorData { - displays: Vec, - } - - unsafe extern "system" fn monitor_enum_proc( - hmonitor: HMONITOR, - _hdc: HDC, - _rect: *mut windows_sys::Win32::Foundation::RECT, - lparam: isize, - ) -> i32 { - let data = &mut *(lparam as *mut MonitorData); - let mut info: MONITORINFOEXW = std::mem::zeroed(); - info.monitorInfo.cbSize = std::mem::size_of::() as u32; - - if GetMonitorInfoW(hmonitor, &mut info as *mut _ as *mut _) != 0 { - let device_name = String::from_utf16_lossy( - &info.szDevice[..info.szDevice.iter().position(|&c| c == 0).unwrap_or(info.szDevice.len())], - ); - let is_primary = (info.monitorInfo.dwFlags & 1) != 0; - let width = info.monitorInfo.rcMonitor.right - info.monitorInfo.rcMonitor.left; - let height = info.monitorInfo.rcMonitor.bottom - info.monitorInfo.rcMonitor.top; - - let monitor_model = get_monitor_model_name(&device_name); - let name = if !monitor_model.is_empty() { - format!("{} ({}x{})", monitor_model, width, height) - } else { - format!("{} ({}x{})", device_name, width, height) - }; - - data.displays.push(DisplayInfo { - index: data.displays.len(), - name, - device_name: device_name.clone(), - is_primary, - width, - height, - }); - } - 1 - } - - let mut data = MonitorData { - displays: Vec::new(), - }; - - unsafe { - EnumDisplayMonitors( - std::ptr::null_mut(), - std::ptr::null(), - Some(monitor_enum_proc), - &mut data as *mut _ as isize, - ); - } - - if data.displays.is_empty() { - data.displays.push(DisplayInfo { - index: 0, - name: "DISPLAY1 (Primary)".to_string(), - device_name: "DISPLAY1".to_string(), - is_primary: true, - width: 0, - height: 0, - }); - } - - // EDID 回退:EnumDisplayDevicesW 经常返回通用名称,尝试获取真实型号 - let is_fallback = |n: &str| n.starts_with('\\') || { - let prefix = n.split(" (").next().unwrap_or(n); - is_generic_monitor_name(prefix) - }; - if data.displays.iter().any(|d| is_fallback(&d.name)) { - let edid_names = crate::display_cache::get_edid_monitor_names(); - if !edid_names.is_empty() { - for (i, d) in data.displays.iter_mut().enumerate() { - if is_fallback(&d.name) { - if let Some(n) = edid_names.get(i).filter(|s| !s.is_empty()) { - d.name = format!("{} ({}x{})", n, d.width, d.height); - } else if edid_names.len() == 1 && !edid_names[0].is_empty() { - d.name = format!("{} ({}x{})", edid_names[0], d.width, d.height); - } - } - } - } - } - - Ok(data.displays) - }); - result.await.map_err(|e| format!("枚举显示器失败: {}", e))? - } - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -/// Check if a monitor name is a generic/placeholder (any language variant) -fn is_generic_monitor_name(name: &str) -> bool { - let lower = name.to_lowercase(); - lower.contains("generic") - || lower.contains("即插即用") - || lower.contains("通用") - || lower.contains("pnp") - || lower.contains("standard monitor") - || lower.contains("digital display") - || lower.contains("analog display") -} - -#[cfg(target_os = "windows")] -fn get_monitor_model_name(device_name: &str) -> String { - use windows_sys::Win32::Graphics::Gdi::{EnumDisplayDevicesW, DISPLAY_DEVICEW}; - use std::mem; - - unsafe { - let device_name_wide: Vec = device_name.encode_utf16().chain(std::iter::once(0)).collect(); - - let mut disp_device: DISPLAY_DEVICEW = mem::zeroed(); - disp_device.cb = mem::size_of::() as u32; - - if EnumDisplayDevicesW(device_name_wide.as_ptr(), 0, &mut disp_device, 0) != 0 { - let len = disp_device.DeviceString.iter().position(|&c| c == 0).unwrap_or(disp_device.DeviceString.len()); - if len > 0 { - let model = String::from_utf16_lossy(&disp_device.DeviceString[..len]); - let trimmed = model.trim(); - if !trimmed.is_empty() && !is_generic_monitor_name(trimmed) { - return trimmed.to_string(); - } - return String::new(); - } - } - } - - String::new() -} -#[cfg(target_os = "windows")] -mod win32 { - use windows_sys::Win32::Foundation::*; - use windows_sys::Win32::Graphics::Gdi::*; - use windows_sys::Win32::Graphics::GdiPlus::*; - use windows_sys::Win32::UI::WindowsAndMessaging::*; - use windows_sys::Win32::UI::Accessibility::*; - use windows_sys::Win32::System::LibraryLoader::GetModuleHandleW; - use std::ptr; - use std::sync::atomic::Ordering; - use std::sync::Mutex; - use std::result::Result::Ok; - - static GDIPLUS_TOKEN: Mutex> = Mutex::new(None); - static WIN_EVENT_HOOK: Mutex> = Mutex::new(None); - - pub unsafe fn init_gdiplus() -> bool { - let mut token = GDIPLUS_TOKEN.lock().unwrap(); - if token.is_some() { - return true; - } - - let mut input = GdiplusStartupInput { - GdiplusVersion: 1, - DebugEventCallback: 0, - SuppressBackgroundThread: 0, - SuppressExternalCodecs: 0, - }; - - let mut token_value: usize = 0; - let result = GdiplusStartup(&mut token_value, &mut input, ptr::null_mut()); - - if result == 0 { - *token = Some(token_value); - true - } else { - log::error!("GDI+ init failed: {}", result); - false - } - } - - pub unsafe fn shutdown_gdiplus() { - let mut token = GDIPLUS_TOKEN.lock().unwrap(); - if let Some(t) = token.take() { - GdiplusShutdown(t); - } - } - - unsafe extern "system" fn win_event_proc( - _h_win_event_hook: *mut std::ffi::c_void, - _event: u32, - hwnd: HWND, - id_object: i32, - _id_child: i32, - _dw_event_thread: u32, - _dwms_event_time: u32, - ) { - if id_object != 0 || hwnd.is_null() { - return; - } - let crosshair_hwnd = super::CROSSHAIR_HANDLE.load(Ordering::SeqCst); - if crosshair_hwnd.is_null() { - return; - } - if hwnd != crosshair_hwnd { - SetWindowPos( - crosshair_hwnd, - HWND_TOPMOST, - 0, - 0, - 0, - 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE, - ); - } - } - - pub unsafe fn install_topmost_guard() { - let hook = SetWinEventHook( - EVENT_SYSTEM_FOREGROUND, - EVENT_SYSTEM_FOREGROUND, - ptr::null_mut(), - Some(win_event_proc), - 0, - 0, - WINEVENT_OUTOFCONTEXT, - ); - if !hook.is_null() { - let mut lock = WIN_EVENT_HOOK.lock().unwrap(); - *lock = Some(hook as usize); - } - } - - pub unsafe fn uninstall_topmost_guard() { - let mut lock = WIN_EVENT_HOOK.lock().unwrap(); - if let Some(hook) = lock.take() { - UnhookWinEvent(hook as *mut std::ffi::c_void); - } - } - - fn parse_hex_color(hex: &str) -> (u8, u8, u8) { - let hex = hex.trim_start_matches('#'); - if hex.len() < 6 { - return (255, 0, 0); - } - let r = u8::from_str_radix(&hex[0..2], 16).unwrap_or(255); - let g = u8::from_str_radix(&hex[2..4], 16).unwrap_or(0); - let b = u8::from_str_radix(&hex[4..6], 16).unwrap_or(0); - (r, g, b) - } - - unsafe fn draw_style_cross( - graphics: *mut GpGraphics, - pen: *mut GpPen, - center_x: f32, - center_y: f32, - gap: f32, - size: f32, - ) { - if size <= gap { - return; - } - GdipDrawLine(graphics, pen, center_x, center_y - gap - size, center_x, center_y - gap); - GdipDrawLine(graphics, pen, center_x, center_y + gap, center_x, center_y + gap + size); - GdipDrawLine(graphics, pen, center_x - gap - size, center_y, center_x - gap, center_y); - GdipDrawLine(graphics, pen, center_x + gap, center_y, center_x + gap + size, center_y); - } - - unsafe fn draw_style_circle( - graphics: *mut GpGraphics, - pen: *mut GpPen, - center_x: f32, - center_y: f32, - size: f32, - ) { - GdipDrawEllipse( - graphics, - pen, - center_x - size, - center_y - size, - size * 2.0, - size * 2.0, - ); - } - - unsafe fn draw_style_dot( - graphics: *mut GpGraphics, - brush: *mut GpBrush, - center_x: f32, - center_y: f32, - dot_size: f32, - ) { - let r = dot_size / 2.0; - GdipFillEllipse(graphics, brush, center_x - r, center_y - r, r * 2.0, r * 2.0); - } - - extern "system" { - fn GdipLoadImageFromFile( - filename: *const u16, - image: *mut *mut std::ffi::c_void, - ) -> i32; - fn GdipDrawImageRectI( - graphics: *mut GpGraphics, - image: *mut std::ffi::c_void, - x: i32, - y: i32, - width: i32, - height: i32, - ) -> i32; - fn GdipDisposeImage(image: *mut std::ffi::c_void) -> i32; - } - - unsafe fn draw_custom_image( - graphics: *mut GpGraphics, - image_path: &str, - center_x: f32, - center_y: f32, - size: f32, - ) { - let path_wide: Vec = image_path - .encode_utf16() - .chain(std::iter::once(0)) - .collect(); - - let mut image: *mut std::ffi::c_void = ptr::null_mut(); - let status = GdipLoadImageFromFile(path_wide.as_ptr(), &mut image); - - if status != 0 || image.is_null() { - return; - } - - let half = size / 2.0; - GdipDrawImageRectI( - graphics, - image, - (center_x - half) as i32, - (center_y - half) as i32, - size as i32, - size as i32, - ); - - GdipDisposeImage(image); - } - - unsafe fn draw_crosshair( - graphics: *mut GpGraphics, - settings: &super::CrosshairSettings, - center_x: f32, - center_y: f32, - ) { - if settings.use_custom_image { - if let Some(ref image_path) = settings.custom_image_path { - if !image_path.is_empty() { - draw_custom_image(graphics, image_path, center_x, center_y, settings.size as f32); - } - } - return; - } - - let (r, g, b) = parse_hex_color(&settings.color); - let argb: u32 = - ((settings.opacity as u32) << 24) | ((r as u32) << 16) | ((g as u32) << 8) | (b as u32); - - let mut brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(argb, &mut brush); - - let mut pen: *mut GpPen = ptr::null_mut(); - GdipCreatePen1(argb, settings.thickness as f32, 2, &mut pen); - - GdipSetPenStartCap(pen, 2); - GdipSetPenEndCap(pen, 2); - - let size = settings.size as f32; - let gap = settings.gap as f32; - let dot_size = settings.dot_size as f32; - - match settings.style.as_str() { - "Cross" => { - draw_style_cross(graphics, pen, center_x, center_y, gap, size); - } - "Dot" => { - draw_style_dot(graphics, brush as *mut GpBrush, center_x, center_y, dot_size); - } - "Circle" => { - draw_style_circle(graphics, pen, center_x, center_y, size); - } - "CrossDot" => { - draw_style_cross(graphics, pen, center_x, center_y, gap, size); - draw_style_dot(graphics, brush as *mut GpBrush, center_x, center_y, dot_size); - } - "CircleCross" => { - draw_style_circle(graphics, pen, center_x, center_y, size); - draw_style_cross(graphics, pen, center_x, center_y, gap, size); - } - _ => { - draw_style_cross(graphics, pen, center_x, center_y, gap, size); - } - } - - if !pen.is_null() { - GdipDeletePen(pen); - } - if !brush.is_null() { - GdipDeleteBrush(brush as *mut GpBrush); - } - } - - unsafe fn get_monitor_bounds(monitor_index: i32) -> (i32, i32, i32, i32) { - if monitor_index < 0 { - return ( - 0, - 0, - GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN), - ); - } - - struct BoundsData { - target: i32, - current: i32, - left: i32, - top: i32, - right: i32, - bottom: i32, - found: bool, - } - - let mut data = BoundsData { - target: monitor_index, - current: 0, - left: 0, - top: 0, - right: 0, - bottom: 0, - found: false, - }; - - unsafe extern "system" fn enum_proc( - hmonitor: HMONITOR, - _hdc: HDC, - _rect: *mut windows_sys::Win32::Foundation::RECT, - lparam: isize, - ) -> i32 { - let data = &mut *(lparam as *mut BoundsData); - if data.current == data.target { - let mut info: MONITORINFOEXW = std::mem::zeroed(); - info.monitorInfo.cbSize = std::mem::size_of::() as u32; - if GetMonitorInfoW(hmonitor, &mut info as *mut _ as *mut _) != 0 { - data.left = info.monitorInfo.rcMonitor.left; - data.top = info.monitorInfo.rcMonitor.top; - data.right = info.monitorInfo.rcMonitor.right; - data.bottom = info.monitorInfo.rcMonitor.bottom; - data.found = true; - } - 0 - } else { - data.current += 1; - 1 - } - } - - EnumDisplayMonitors( - ptr::null_mut(), - ptr::null(), - Some(enum_proc), - &mut data as *mut _ as isize, - ); - - if data.found { - (data.left, data.top, data.right, data.bottom) - } else { - ( - 0, - 0, - GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN), - ) - } - } - - unsafe fn render(hwnd: HWND, settings: &super::CrosshairSettings) { - let (mon_left, mon_top, mon_right, mon_bottom) = get_monitor_bounds(settings.monitor_index); - let screen_width = mon_right - mon_left; - let screen_height = mon_bottom - mon_top; - - let dib_size = if settings.use_custom_image { - (settings.size + 16).max(64) - } else { - let extent = settings.size + settings.gap + settings.thickness; - ((extent * 2 + 16) as i32).max(64) - }; - - let screen_dc = GetDC(ptr::null_mut()); - - let mut bmi: BITMAPINFO = std::mem::zeroed(); - bmi.bmiHeader.biSize = std::mem::size_of::() as u32; - bmi.bmiHeader.biWidth = dib_size; - bmi.bmiHeader.biHeight = -dib_size; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = 32; - bmi.bmiHeader.biCompression = BI_RGB; - - let mut bits: *mut std::ffi::c_void = ptr::null_mut(); - let hbitmap = CreateDIBSection( - screen_dc, - &bmi, - DIB_RGB_COLORS, - &mut bits, - ptr::null_mut(), - 0, - ); - ReleaseDC(ptr::null_mut(), screen_dc); - - if hbitmap.is_null() { - return; - } - - let mem_dc = CreateCompatibleDC(ptr::null_mut()); - let old_bmp = SelectObject(mem_dc, hbitmap as HGDIOBJ); - - let mut graphics: *mut GpGraphics = ptr::null_mut(); - if GdipCreateFromHDC(mem_dc, &mut graphics) != 0 { - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - return; - } - - GdipSetSmoothingMode(graphics, SmoothingModeAntiAlias); - - let mut clear_brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(0x00000000, &mut clear_brush); - GdipFillRectangle( - graphics, - clear_brush as *mut GpBrush, - 0.0, - 0.0, - dib_size as f32, - dib_size as f32, - ); - GdipDeleteBrush(clear_brush as *mut GpBrush); - - let center_x = dib_size as f32 / 2.0; - let center_y = dib_size as f32 / 2.0; - draw_crosshair(graphics, settings, center_x, center_y); - - GdipDeleteGraphics(graphics); - - if settings.use_custom_image && settings.opacity < 255 { - let total = (dib_size * dib_size) as usize; - let pixels = std::slice::from_raw_parts_mut(bits as *mut u32, total); - let opacity_factor = settings.opacity as u32; - for pixel in pixels.iter_mut() { - let a = *pixel >> 24; - if a == 0 { - continue; - } - let new_a = a * opacity_factor / 255; - *pixel = (*pixel & 0x00FFFFFF) | (new_a << 24); - } - } - - let win_x = mon_left + (screen_width - dib_size) / 2; - let win_y = mon_top + (screen_height - dib_size) / 2; - - let ppt_dst = POINT { x: win_x, y: win_y }; - let psize = SIZE { - cx: dib_size, - cy: dib_size, - }; - let ppt_src = POINT { x: 0, y: 0 }; - - let blend = BLENDFUNCTION { - BlendOp: AC_SRC_OVER as u8, - BlendFlags: 0, - SourceConstantAlpha: 255, - AlphaFormat: AC_SRC_ALPHA as u8, - }; - - UpdateLayeredWindow( - hwnd, - ptr::null_mut(), - &ppt_dst, - &psize, - mem_dc, - &ppt_src, - 0, - &blend, - ULW_ALPHA, - ); - - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - } - - pub unsafe fn create_window(settings: &super::CrosshairSettings) -> Result { - init_gdiplus(); - - let h_instance = GetModuleHandleW(ptr::null()); - if h_instance.is_null() { - return Err("Failed to get module handle".to_string()); - } - - let class_name = windows_sys::core::w!("NexBoxCrosshairOverlay"); - - let wnd_class = WNDCLASSW { - style: CS_HREDRAW | CS_VREDRAW, - lpfnWndProc: Some(window_proc), - cbClsExtra: 0, - cbWndExtra: 0, - hInstance: h_instance, - hIcon: ptr::null_mut(), - hCursor: ptr::null_mut(), - hbrBackground: ptr::null_mut(), - lpszMenuName: ptr::null(), - lpszClassName: class_name, - }; - - if RegisterClassW(&wnd_class) == 0 { - let error = GetLastError(); - if error != 1410 { - return Err(format!("RegisterClass failed: {}", error)); - } - } - - let dib_size = if settings.use_custom_image { - (settings.size + 16).max(64) - } else { - let extent = settings.size + settings.gap + settings.thickness; - ((extent * 2 + 16) as i32).max(64) - }; - - let hwnd = CreateWindowExW( - WS_EX_TOPMOST - | WS_EX_LAYERED - | WS_EX_TRANSPARENT - | WS_EX_TOOLWINDOW - | WS_EX_NOACTIVATE, - class_name, - windows_sys::core::w!("NexBox Crosshair"), - WS_POPUP, - 0, - 0, - dib_size, - dib_size, - ptr::null_mut(), - ptr::null_mut(), - h_instance, - ptr::null_mut(), - ); - - if hwnd.is_null() { - return Err("Failed to create window".to_string()); - } - - ShowWindow(hwnd, SW_SHOW); - - render(hwnd, settings); - - Ok(hwnd) - } - - pub unsafe fn destroy_window(hwnd: HWND) -> bool { - if hwnd.is_null() { - return false; - } - KillTimer(hwnd, 1); - DestroyWindow(hwnd) != 0 - } - - pub const WM_CROSSHAIR_REFRESH: u32 = 0x8001; - - pub unsafe extern "system" fn window_proc( - hwnd: HWND, - msg: u32, - wparam: WPARAM, - lparam: LPARAM, - ) -> LRESULT { - match msg { - WM_PAINT => { - let mut ps = PAINTSTRUCT { - hdc: ptr::null_mut(), - fErase: 0, - rcPaint: RECT { - left: 0, - top: 0, - right: 0, - bottom: 0, - }, - fRestore: 0, - fIncUpdate: 0, - rgbReserved: [0u8; 32], - }; - BeginPaint(hwnd, &mut ps); - EndPaint(hwnd, &ps); - 0 - } - WM_TIMER => { - SetWindowPos( - hwnd, - HWND_TOPMOST, - 0, - 0, - 0, - 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE, - ); - 0 - } - WM_DISPLAYCHANGE => { - let settings = super::get_settings(); - render(hwnd, &settings); - 0 - } - WM_CROSSHAIR_REFRESH => { - let settings = super::get_settings(); - render(hwnd, &settings); - 0 - } - WM_DESTROY => { - PostQuitMessage(0); - 0 - } - _ => DefWindowProcW(hwnd, msg, wparam, lparam), - } - } -} - -#[cfg(target_os = "windows")] -pub fn start(settings: CrosshairSettings) -> Result { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - - if CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - return Ok(CrosshairResult { - success: true, - message: "准心已处于启用状态".to_string(), - }); - } - - CROSSHAIR_ACTIVE.store(true, Ordering::SeqCst); - - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - *settings_lock = Some(settings.clone()); - } - - thread::spawn(move || unsafe { - match win32::create_window(&settings) { - Ok(hwnd) => { - CROSSHAIR_HANDLE.store(hwnd, Ordering::SeqCst); - - SetTimer(hwnd, 1, 500, None); - win32::install_topmost_guard(); - - let mut msg: MSG = std::mem::zeroed(); - while CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - while PeekMessageW(&mut msg, std::ptr::null_mut(), 0, 0, PM_REMOVE) != 0 { - if msg.message == WM_QUIT { - break; - } - TranslateMessage(&msg); - DispatchMessageW(&msg); - } - - if !CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - break; - } - - thread::sleep(Duration::from_millis(50)); - } - - win32::uninstall_topmost_guard(); - win32::destroy_window(hwnd); - CROSSHAIR_HANDLE.store(std::ptr::null_mut(), Ordering::SeqCst); - } - Err(e) => { - log::error!("Failed to create crosshair window: {}", e); - CROSSHAIR_ACTIVE.store(false, Ordering::SeqCst); - } - } - }); - - Ok(CrosshairResult { - success: true, - message: "准心已启动".to_string(), - }) -} - -#[cfg(not(target_os = "windows"))] -pub fn start(_settings: CrosshairSettings) -> Result { - Err("此功能仅支持 Windows 系统".to_string()) -} - -#[cfg(target_os = "windows")] -pub fn stop() -> Result { - use windows_sys::Win32::UI::WindowsAndMessaging::{PostMessageW, WM_CLOSE}; - - if !CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - return Ok(CrosshairResult { - success: true, - message: "准心已处于关闭状态".to_string(), - }); - } - - CROSSHAIR_ACTIVE.store(false, Ordering::SeqCst); - - unsafe { - let hwnd = CROSSHAIR_HANDLE.load(Ordering::SeqCst); - if !hwnd.is_null() { - PostMessageW(hwnd, WM_CLOSE, 0, 0); - } - } - - Ok(CrosshairResult { - success: true, - message: "准心已关闭".to_string(), - }) -} - -#[cfg(not(target_os = "windows"))] -pub fn stop() -> Result { - Err("此功能仅支持 Windows 系统".to_string()) -} - -/// Toggle crosshair on/off. Used by global hotkey. -pub fn toggle_crosshair_sync(app_handle: &tauri::AppHandle) -> Result { - let result = if CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - stop() - } else { - let settings = get_settings(); - start(settings) - }; - - if result.is_ok() { - let _ = app_handle.emit("crosshair-status-changed", ()); - } - - result -} - -#[tauri::command] -pub async fn get_crosshair_status() -> Result { - let mut settings = get_settings(); - settings.enabled = CROSSHAIR_ACTIVE.load(Ordering::SeqCst); - Ok(settings) -} - -#[tauri::command] -pub async fn toggle_crosshair(app_handle: tauri::AppHandle) -> Result { - toggle_crosshair_sync(&app_handle) -} - -#[tauri::command] -pub async fn update_crosshair_settings( - settings: CrosshairSettings, -) -> Result { - let was_active = CROSSHAIR_ACTIVE.load(Ordering::SeqCst); - - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - *settings_lock = Some(settings.clone()); - } - - if was_active { - #[cfg(target_os = "windows")] - { - let hwnd = CROSSHAIR_HANDLE.load(Ordering::SeqCst); - if !hwnd.is_null() { - unsafe { - windows_sys::Win32::UI::WindowsAndMessaging::PostMessageW( - hwnd, - win32::WM_CROSSHAIR_REFRESH, - 0, - 0, - ); - } - return Ok(CrosshairResult { - success: true, - message: "设置已更新".to_string(), - }); - } - } - } - - if settings.enabled || was_active { - let mut start_settings = settings; - start_settings.enabled = true; - start(start_settings)?; - } - - Ok(CrosshairResult { - success: true, - message: "设置已更新".to_string(), - }) -} - -#[tauri::command] -pub async fn pick_crosshair_image() -> Result, String> { - let file = rfd::FileDialog::new() - .set_title("选择准心图片") - .add_filter( - "Images", - &["png", "jpg", "jpeg", "bmp", "gif", "webp"], - ) - .pick_file(); - Ok(file.map(|f| f.to_string_lossy().to_string())) -} - -pub fn cleanup() { - if CROSSHAIR_ACTIVE.load(Ordering::SeqCst) { - let _ = stop(); - } - #[cfg(target_os = "windows")] - unsafe { - win32::shutdown_gdiplus(); - } -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/src/dattorro.rs b/参考/NexBox-main/src-tauri/src/dattorro.rs deleted file mode 100644 index 32bb9b5..0000000 --- a/参考/NexBox-main/src-tauri/src/dattorro.rs +++ /dev/null @@ -1,424 +0,0 @@ -//! FxSound-compatible Dattorro plate reverb (LexReverb). -//! -//! Based on Jon Dattorro's AES paper (JAES Vol.45 No.9, 1997) -//! and FxSound's LexReverb implementation. -//! -//! Topology: -//! Input(sum L+R) -> PreDelay -> BW_LP -> LAT1..4(allpass diffusers) -//! -> diffuser_out -//! -> Tank1: LAT5(decay diffuser) -> D1 taps -> Damping -> *decay -> LAT6 -> Taps/D2 -> D2_fb -//! -> Tank2: LAT7(decay diffuser) -> D3 taps -> Damping -> *decay -> LAT8 -> Taps/D4 -> D4_fb -//! -> Output matrix -> Wet/Dry mix - -use std::f64::consts::PI; - -// ── FxSound LexReverb constants (all times in seconds) ───────────────── - -const LAT1_DELAY: f64 = 4.77e-3; -const LAT2_DELAY: f64 = 3.595e-3; -const LAT3_DELAY: f64 = 12.73e-3; -const LAT4_DELAY: f64 = 9.31e-3; - -const LAT5_NOMINAL: f64 = 22.6e-3; -const LAT5_MOD_MAX_MS: f64 = 2.0e-3; // max modulation range - -const D1_TAP1_DELAY: f64 = 10.1e-3; -const D1_TAP2_DELAY: f64 = 66.9e-3; -const D1_TAP3_DELAY: f64 = 121.9e-3; -const D1_TAP4_DELAY: f64 = 149.6e-3; - -const LAT6_TAP1_DELAY: f64 = 6.28e-3; -const LAT6_TAP2_DELAY: f64 = 41.26e-3; -const LAT6_DELAY: f64 = 60.5e-3; - -const D2_TAP1_DELAY: f64 = 35.8e-3; -const D2_TAP2_DELAY: f64 = 89.8e-3; -const D2_TAP3_DELAY: f64 = 125.0e-3; - -const LAT7_NOMINAL: f64 = 30.5e-3; - -const D3_TAP1_DELAY: f64 = 10.1e-3; -const D3_TAP2_DELAY: f64 = 70.9e-3; -const D3_TAP3_DELAY: f64 = 99.9e-3; -const D3_TAP4_DELAY: f64 = 141.7e-3; - -const LAT8_TAP1_DELAY: f64 = 11.25e-3; -const LAT8_TAP2_DELAY: f64 = 64.3e-3; -const LAT8_DELAY: f64 = 89.2e-3; - -const D4_TAP1_DELAY: f64 = 4.065e-3; -const D4_TAP2_DELAY: f64 = 67.1e-3; -const D4_TAP3_DELAY: f64 = 106.3e-3; - -// Fixed lattice coefficients -const LAT12_COEFF: f64 = 0.75; -const LAT34_COEFF: f64 = 0.625; -const LAT57_COEFF: f64 = 0.70; - -// 1-pole LP filter constants -const BANDWIDTH: f64 = 0.35011; -const ONE_MINUS_BW: f64 = 1.0 - BANDWIDTH; -const DAMPING: f64 = 0.40829; -const ONE_MINUS_DAMP: f64 = 1.0 - DAMPING; - -// LFO modulation -const OSC_TABLE_SIZE: f64 = 8192.0; -const MOD_FREQ_STEP: f64 = 0.110871f64; // step per sample (table index units) -const MOD_DEPTH_SAMPLES: f64 = 27.7795; // modulation depth in samples - -// Output scaling (internal, before wet/dry mix) -const OUTPUT_SCALE: f64 = 0.3; - -// ── DattorroReverb ────────────────────────────────────────────────────── - -pub struct DattorroReverb { - // Input allpass diffusers (implicit delay from buffer size) - lat1_buf: Vec, - lat1_pos: usize, - lat2_buf: Vec, - lat2_pos: usize, - lat3_buf: Vec, - lat3_pos: usize, - lat4_buf: Vec, - lat4_pos: usize, - - // Pre-delay buffer (1 sample default) - pre_buf: Vec, - pre_pos: usize, - - // Tank 1: LAT5 (modulated decay diffuser) + D1 taps - tank1_buf: Vec, - tank1_pos: usize, - // Tank 1b: LAT6 (standard lattice, explicit delay) + taps + D2 taps - tank1b_buf: Vec, - tank1b_pos: usize, - - // Tank 2: LAT7 (modulated decay diffuser) + D3 taps - tank2_buf: Vec, - tank2_pos: usize, - // Tank 2b: LAT8 (standard lattice, explicit delay) + taps + D4 taps - tank2b_buf: Vec, - tank2b_pos: usize, - - // Tap offsets in samples - d1_t1: usize, d1_t2: usize, d1_t3: usize, d1_t4: usize, - l6_dly: usize, l6_t1: usize, l6_t2: usize, - d2_t1: usize, d2_t2: usize, d2_t3: usize, - d3_t1: usize, d3_t2: usize, d3_t3: usize, d3_t4: usize, - l8_dly: usize, l8_t1: usize, l8_t2: usize, - d4_t1: usize, d4_t2: usize, d4_t3: usize, - - // Modulated delay lengths (nominal, in samples) - lat5_nom: f64, - lat7_nom: f64, - - // 1-pole LP filter states - bw_old: f64, - damp1_old: f64, - damp2_old: f64, - - // LFO state - osc_phase: f64, - osc_step: f64, // radians per sample - mod_depth: f64, // modulation depth in samples - - // Cross-feedback value (D4 output from previous iteration) - d4_fb: f64, -} - -impl DattorroReverb { - pub fn new(sample_rate: f64) -> Self { - let sr = sample_rate; - - // Convert time constants to samples - let to_samps = |t: f64| -> usize { (t * sr).round() as usize }; - - let lat1_len = to_samps(LAT1_DELAY); - let lat2_len = to_samps(LAT2_DELAY); - let lat3_len = to_samps(LAT3_DELAY); - let lat4_len = to_samps(LAT4_DELAY); - - let d1_t1 = to_samps(D1_TAP1_DELAY); - let d1_t2 = to_samps(D1_TAP2_DELAY); - let d1_t3 = to_samps(D1_TAP3_DELAY); - let d1_t4 = to_samps(D1_TAP4_DELAY); - - let l6_t1 = to_samps(LAT6_TAP1_DELAY); - let l6_t2 = to_samps(LAT6_TAP2_DELAY); - let l6_delay = to_samps(LAT6_DELAY); - - let d2_t1 = to_samps(D2_TAP1_DELAY); - let d2_t2 = to_samps(D2_TAP2_DELAY); - let d2_t3 = to_samps(D2_TAP3_DELAY); - - let d3_t1 = to_samps(D3_TAP1_DELAY); - let d3_t2 = to_samps(D3_TAP2_DELAY); - let d3_t3 = to_samps(D3_TAP3_DELAY); - let d3_t4 = to_samps(D3_TAP4_DELAY); - - let l8_t1 = to_samps(LAT8_TAP1_DELAY); - let l8_t2 = to_samps(LAT8_TAP2_DELAY); - let l8_delay = to_samps(LAT8_DELAY); - - let d4_t1 = to_samps(D4_TAP1_DELAY); - let d4_t2 = to_samps(D4_TAP2_DELAY); - let d4_t3 = to_samps(D4_TAP3_DELAY); - - let lat5_nom = LAT5_NOMINAL * sr; - let lat7_nom = LAT7_NOMINAL * sr; - let lat5_mod_max = LAT5_MOD_MAX_MS * sr; - - // Tank buffer sizes: max(allpass max delay, max tap offset) - let tank1_max: f64 = (lat5_nom + lat5_mod_max).max(d1_t4 as f64); - let tank1_size = (tank1_max.ceil() as usize).next_power_of_two(); - - let tank1b_size = l6_delay.max(d2_t3).next_power_of_two(); - - let tank2_max: f64 = (lat7_nom + lat5_mod_max).max(d3_t4 as f64); - let tank2_size = (tank2_max.ceil() as usize).next_power_of_two(); - - let tank2b_size = l8_delay - .max(d4_t3) - .next_power_of_two(); - - // Pre-delay buffer: 1 sample (FxFxSound default) - let pre_size = 2usize; // minimum for 1-sample pre-delay - - // Oscillator step: convert table-index step to radians - let osc_step = MOD_FREQ_STEP * 2.0 * PI / OSC_TABLE_SIZE; - // Scale modulation depth with sample rate to maintain ~0.58ms depth - let mod_depth = MOD_DEPTH_SAMPLES * 48000.0 / sr; - - Self { - lat1_buf: vec![0.0; lat1_len.max(1)], - lat1_pos: 0, - lat2_buf: vec![0.0; lat2_len.max(1)], - lat2_pos: 0, - lat3_buf: vec![0.0; lat3_len.max(1)], - lat3_pos: 0, - lat4_buf: vec![0.0; lat4_len.max(1)], - lat4_pos: 0, - pre_buf: vec![0.0; pre_size], - pre_pos: 0, - tank1_buf: vec![0.0; tank1_size], - tank1_pos: 0, - tank1b_buf: vec![0.0; tank1b_size], - tank1b_pos: 0, - tank2_buf: vec![0.0; tank2_size], - tank2_pos: 0, - tank2b_buf: vec![0.0; tank2b_size], - tank2b_pos: 0, - - d1_t1, d1_t2, d1_t3, d1_t4, - l6_dly: l6_delay, l6_t1, l6_t2, - d2_t1, d2_t2, d2_t3, - d3_t1, d3_t2, d3_t3, d3_t4, - l8_dly: l8_delay, l8_t1, l8_t2, - d4_t1, d4_t2, d4_t3, - - lat5_nom, - lat7_nom, - - bw_old: 0.0, - damp1_old: 0.0, - damp2_old: 0.0, - - osc_phase: 0.0, - osc_step, - mod_depth, - d4_fb: 0.0, - } - } - - /// Process a stereo sample pair through the reverb. - /// Input: mono sum of L+R, Output: (reverb_L, reverb_R) - pub fn process(&mut self, mono_in: f64, amount: f64) -> (f64, f64) { - // FxSound bypass: MIDI <= 12 (~9.4% slider) treated as off - if amount < 0.094 { - return (0.0, 0.0); - } - - // -- FxSound parameter mapping (amount 0..1 -> decay, lat6_coeff) -- - - // Exponential decay curve: 0.095 (min) to 0.95 (max, FxSound) - // Capped at 0.50 for feedback stability — prevents echo runaway - let decay_raw = 0.095f64 * (0.95f64 / 0.095f64).powf(amount); - let decay = decay_raw.min(0.50); - let lat6_coeff = (decay + 0.15).clamp(0.25, 0.5); - - // -- Pre-delay (1 sample) -- - let pre_out = self.pre_buf[self.pre_pos]; - self.pre_buf[self.pre_pos] = mono_in; - self.pre_pos = (self.pre_pos + 1) % self.pre_buf.len(); - - // -- Bandwidth (1-pole lowpass) -- - let bw_out = pre_out * ONE_MINUS_BW + self.bw_old * BANDWIDTH; - self.bw_old = bw_out; - - // -- Input diffusers (LAT1-4) -- - let lat1_out = Self::lattice_allpass( - &mut self.lat1_buf, &mut self.lat1_pos, bw_out, LAT12_COEFF); - let lat2_out = Self::lattice_allpass( - &mut self.lat2_buf, &mut self.lat2_pos, lat1_out, LAT12_COEFF); - let lat3_out = Self::lattice_allpass( - &mut self.lat3_buf, &mut self.lat3_pos, lat2_out, LAT34_COEFF); - let diffuser_out = Self::lattice_allpass( - &mut self.lat4_buf, &mut self.lat4_pos, lat3_out, LAT34_COEFF); - - // -- LFO modulation -- - let osc_val = self.osc_phase.sin(); - self.osc_phase += self.osc_step; - if self.osc_phase >= 2.0 * PI { - self.osc_phase -= 2.0 * PI; - } - - let lat5_delay = self.lat5_nom + osc_val * self.mod_depth; - let lat7_delay = self.lat7_nom - osc_val * self.mod_depth; - - // ═══════ Tank 1 (Left channel) ═══════ - - let lat5_in = diffuser_out + self.d4_fb * decay; // feedback from previous D4 - let _lat5_out = Self::decay_diffuser( - &mut self.tank1_buf, &mut self.tank1_pos, lat5_in, LAT57_COEFF, lat5_delay); - - let d1_tap1 = Self::read_tap(&self.tank1_buf, self.tank1_pos, self.d1_t1); - let d1_tap2 = Self::read_tap(&self.tank1_buf, self.tank1_pos, self.d1_t2); - let d1_tap3 = Self::read_tap(&self.tank1_buf, self.tank1_pos, self.d1_t3); - let d1_tap4 = Self::read_tap(&self.tank1_buf, self.tank1_pos, self.d1_t4); - - // Damping LP - let damp1_out = d1_tap4 * ONE_MINUS_DAMP + self.damp1_old * DAMPING; - self.damp1_old = damp1_out; - - let lat6_in = damp1_out * decay; - let _lat6_out = Self::lattice_allpass_explicit( - &mut self.tank1b_buf, &mut self.tank1b_pos, lat6_in, lat6_coeff, self.l6_dly); - - let l6_tap1 = Self::read_tap(&self.tank1b_buf, self.tank1b_pos, self.l6_t1); - let l6_tap2 = Self::read_tap(&self.tank1b_buf, self.tank1b_pos, self.l6_t2); - let d2_tap1 = Self::read_tap(&self.tank1b_buf, self.tank1b_pos, self.d2_t1); - let d2_tap2 = Self::read_tap(&self.tank1b_buf, self.tank1b_pos, self.d2_t2); - let d2_tap3 = Self::read_tap(&self.tank1b_buf, self.tank1b_pos, self.d2_t3); - - // ═══════ Tank 2 (Right channel) ═══════ - - let lat7_in = diffuser_out + d2_tap3 * decay; // feedback from current D2 - let _lat7_out = Self::decay_diffuser( - &mut self.tank2_buf, &mut self.tank2_pos, lat7_in, LAT57_COEFF, lat7_delay); - - let d3_tap1 = Self::read_tap(&self.tank2_buf, self.tank2_pos, self.d3_t1); - let d3_tap2 = Self::read_tap(&self.tank2_buf, self.tank2_pos, self.d3_t2); - let d3_tap3 = Self::read_tap(&self.tank2_buf, self.tank2_pos, self.d3_t3); - let d3_tap4 = Self::read_tap(&self.tank2_buf, self.tank2_pos, self.d3_t4); - - // Damping LP - let damp2_out = d3_tap4 * ONE_MINUS_DAMP + self.damp2_old * DAMPING; - self.damp2_old = damp2_out; - - let lat8_in = damp2_out * decay; - let _lat8_out = Self::lattice_allpass_explicit( - &mut self.tank2b_buf, &mut self.tank2b_pos, lat8_in, lat6_coeff, self.l8_dly); - - let l8_tap1 = Self::read_tap(&self.tank2b_buf, self.tank2b_pos, self.l8_t1); - let l8_tap2 = Self::read_tap(&self.tank2b_buf, self.tank2b_pos, self.l8_t2); - let d4_tap1 = Self::read_tap(&self.tank2b_buf, self.tank2b_pos, self.d4_t1); - let d4_tap2 = Self::read_tap(&self.tank2b_buf, self.tank2b_pos, self.d4_t2); - let d4_tap3 = Self::read_tap(&self.tank2b_buf, self.tank2b_pos, self.d4_t3); - - // Store D4 feedback for next iteration (clamped for safety) - self.d4_fb = d4_tap3.clamp(-4.0, 4.0); - - // ═══════ Output matrix (FxSound mixing) ═══════ - - let out1 = -d1_tap2 - l6_tap1 - d2_tap1 - + d3_tap1 + d3_tap3 - l8_tap2 + d4_tap2; - let out2 = d1_tap1 + d1_tap3 - l6_tap2 + d2_tap2 - - d3_tap2 - l8_tap1 - d4_tap1; - - // Return pure reverb output (scaled, without dry mix) - let rev_l = (out1 * OUTPUT_SCALE).clamp(-2.0, 2.0); - let rev_r = (out2 * OUTPUT_SCALE).clamp(-2.0, 2.0); - - (rev_l, rev_r) - } - - /// Reset all reverb state - #[allow(dead_code)] - pub fn reset(&mut self) { - for v in &mut self.lat1_buf { *v = 0.0; } - for v in &mut self.lat2_buf { *v = 0.0; } - for v in &mut self.lat3_buf { *v = 0.0; } - for v in &mut self.lat4_buf { *v = 0.0; } - for v in &mut self.pre_buf { *v = 0.0; } - for v in &mut self.tank1_buf { *v = 0.0; } - for v in &mut self.tank1b_buf { *v = 0.0; } - for v in &mut self.tank2_buf { *v = 0.0; } - for v in &mut self.tank2b_buf { *v = 0.0; } - self.lat1_pos = 0; - self.lat2_pos = 0; - self.lat3_pos = 0; - self.lat4_pos = 0; - self.pre_pos = 0; - self.tank1_pos = 0; - self.tank1b_pos = 0; - self.tank2_pos = 0; - self.tank2b_pos = 0; - self.bw_old = 0.0; - self.damp1_old = 0.0; - self.damp2_old = 0.0; - self.osc_phase = 0.0; - self.d4_fb = 0.0; - } - - // ── Internal DSP helpers ───────────────────────────────────────────── - - /// Standard lattice allpass (implicit delay from buffer size). - /// Reads buf[pos], writes buf[pos], advances pos. - #[inline(always)] - fn lattice_allpass(buf: &mut [f64], pos: &mut usize, input: f64, coeff: f64) -> f64 { - let old = buf[*pos]; - let new_input = input - coeff * old; - buf[*pos] = new_input; - *pos = (*pos + 1) % buf.len(); - old + coeff * new_input - } - - /// Standard lattice allpass with EXPLICIT read delay. - /// Reads from buf[(pos + len - delay) % len], writes buf[pos], advances pos. - /// For LAT6/LAT8 in shared buffers where delay != buffer size. - #[inline(always)] - fn lattice_allpass_explicit( - buf: &mut [f64], pos: &mut usize, input: f64, coeff: f64, delay: usize, - ) -> f64 { - let len = buf.len(); - let old = buf[(*pos + len - delay) % len]; - let new_input = input - coeff * old; - buf[*pos] = new_input; - *pos = (*pos + 1) % len; - old + coeff * new_input - } - - /// Modulated decay diffuser (with linear interpolation). - /// Reads from interpolated position, writes buf[pos], advances pos. - #[inline(always)] - fn decay_diffuser( - buf: &mut [f64], pos: &mut usize, input: f64, coeff: f64, delay: f64, - ) -> f64 { - let len = buf.len(); - let idly = delay as usize; - let frac = delay - idly as f64; - let y1 = buf[(*pos + len - idly) % len]; - let y2 = buf[(*pos + len - idly - 1) % len]; - let dl_out = y1 + (y2 - y1) * frac; - let dl_in = input + coeff * dl_out; - buf[*pos] = dl_in; - *pos = (*pos + 1) % len; - dl_out - coeff * dl_in - } - - /// Read a tap at a fixed offset behind the current position. - #[inline(always)] - fn read_tap(buf: &[f64], pos: usize, offset: usize) -> f64 { - buf[(pos + buf.len() - offset) % buf.len()] - } -} diff --git a/参考/NexBox-main/src-tauri/src/delta_force.rs b/参考/NexBox-main/src-tauri/src/delta_force.rs deleted file mode 100644 index aef6fec..0000000 --- a/参考/NexBox-main/src-tauri/src/delta_force.rs +++ /dev/null @@ -1,658 +0,0 @@ -use std::os::windows::process::CommandExt; -use std::process::Command; -use std::fs; -use std::path::PathBuf; -use std::time::Duration; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DeltaPasswordItem { - pub name: String, - pub password: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DeltaPasswordResponse { - pub status: String, - pub data: Vec, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct WeaponCode { - pub id: String, - pub name: String, - pub code: String, - pub category: String, - pub description: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DLSSModelPreset { - pub id: String, - pub name: String, - pub description: String, - pub recommended: bool, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DLSSApplyResult { - pub success: bool, - pub message: String, - pub preset: String, - pub quality: String, - pub texture_quality: String, - pub antialiasing: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DLSSPresetStatus { - pub preset: String, - pub quality: String, - pub texture_quality: String, - pub antialiasing: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct MapInfo { - pub id: String, - pub name: String, - pub url: String, - pub description: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DLSSSettingsStatus { - pub dlss_indicator_enabled: bool, - pub dlss_lock_enabled: bool, -} - -static DELTA_PASSWORD_CACHE: std::sync::Mutex, std::time::Instant)>> = std::sync::Mutex::new(None); - -fn fetch_delta_passwords_from_api() -> Option> { - let url = "https://i.elaina.vin/api/%E4%B8%89%E8%A7%92%E6%B4%B2/%E5%AF%86%E7%A0%81/"; - - let response = reqwest::blocking::Client::new() - .get(url) - .timeout(Duration::from_secs(10)) - .send() - .ok()? - .json::() - .ok()?; - - if response.status == "success" { - Some(response.data) - } else { - None - } -} - -#[tauri::command] -pub async fn get_delta_passwords() -> Result, String> { - { - let cache = DELTA_PASSWORD_CACHE.lock().unwrap(); - if let Some((cached_data, cached_time)) = cache.as_ref() { - if cached_time.elapsed().as_secs() < 60 { - return Ok(cached_data.clone()); - } - } - } - - let passwords = tokio::task::spawn_blocking(|| { - fetch_delta_passwords_from_api() - }) - .await - .map_err(|e| format!("获取密码失败: {}", e))? - .ok_or_else(|| "无法获取三角洲密码数据".to_string())?; - - { - let mut cache = DELTA_PASSWORD_CACHE.lock().unwrap(); - *cache = Some((passwords.clone(), std::time::Instant::now())); - } - - Ok(passwords) -} - -fn get_cached_delta_password_items() -> Option> { - { - let cache = DELTA_PASSWORD_CACHE.lock().unwrap(); - if let Some((data, time)) = cache.as_ref() { - if time.elapsed().as_secs() < 300 { - return if data.is_empty() { None } else { Some(data.clone()) }; - } - } - } - - match fetch_delta_passwords_from_api() { - Some(passwords) => { - if passwords.is_empty() { - return None; - } - let mut cache = DELTA_PASSWORD_CACHE.lock().unwrap(); - *cache = Some((passwords.clone(), std::time::Instant::now())); - Some(passwords) - } - None => None, - } -} - -pub fn get_cached_delta_password_filtered(selected_maps: &[String]) -> Option { - let items = get_cached_delta_password_items()?; - let filtered: Vec<_> = if selected_maps.is_empty() { - items - } else { - items.into_iter().filter(|item| selected_maps.contains(&item.name)).collect() - }; - if filtered.is_empty() { - return None; - } - let joined = filtered - .iter() - .map(|item| format!("{}:{}", item.name, item.password)) - .collect::>() - .join(" "); - Some(joined) -} - -pub fn get_cached_delta_password() -> Option { - get_cached_delta_password_filtered(&[]) -} - -#[tauri::command] -pub async fn get_weapon_codes() -> Result, String> { - Ok(vec![ - WeaponCode { - id: "1".to_string(), - name: "M4A1 竞技配置".to_string(), - code: "DELTA-M4A1-001".to_string(), - category: "突击步枪".to_string(), - description: "高稳定性竞技配置".to_string(), - }, - WeaponCode { - id: "2".to_string(), - name: "AK47 压枪配置".to_string(), - code: "DELTA-AK47-001".to_string(), - category: "突击步枪".to_string(), - description: "低后座力压枪配置".to_string(), - }, - WeaponCode { - id: "3".to_string(), - name: "AWM 狙击配置".to_string(), - code: "DELTA-AWM-001".to_string(), - category: "狙击枪".to_string(), - description: "精准狙击配置".to_string(), - }, - WeaponCode { - id: "4".to_string(), - name: "MP5 冲锋配置".to_string(), - code: "DELTA-MP5-001".to_string(), - category: "冲锋枪".to_string(), - description: "近距离快速射击".to_string(), - }, - ]) -} - -#[tauri::command] -pub async fn get_dlss_model_presets() -> Result, String> { - Ok(vec![ - DLSSModelPreset { id: "A".to_string(), name: "Preset A".to_string(), description: "早期模型".to_string(), recommended: false }, - DLSSModelPreset { id: "B".to_string(), name: "Preset B".to_string(), description: "早期模型".to_string(), recommended: false }, - DLSSModelPreset { id: "C".to_string(), name: "Preset C".to_string(), description: "早期模型".to_string(), recommended: false }, - DLSSModelPreset { id: "D".to_string(), name: "Preset D".to_string(), description: "稳定模型".to_string(), recommended: false }, - DLSSModelPreset { id: "E".to_string(), name: "Preset E".to_string(), description: "实验性模型".to_string(), recommended: false }, - DLSSModelPreset { id: "F".to_string(), name: "Preset F".to_string(), description: "改进模型".to_string(), recommended: false }, - DLSSModelPreset { id: "G".to_string(), name: "Preset G".to_string(), description: "改进模型".to_string(), recommended: false }, - DLSSModelPreset { id: "J".to_string(), name: "Preset J".to_string(), description: "较新模型,画质优先".to_string(), recommended: false }, - DLSSModelPreset { id: "K".to_string(), name: "Preset K".to_string(), description: "推荐模型,大多数DLSS模式".to_string(), recommended: true }, - DLSSModelPreset { id: "L".to_string(), name: "Preset L".to_string(), description: "优化Ultra Performance模式".to_string(), recommended: true }, - DLSSModelPreset { id: "M".to_string(), name: "Preset M".to_string(), description: "优化Performance模式".to_string(), recommended: true }, - ]) -} - -fn get_npi_path() -> Result { - let exe_dir = std::env::current_exe() - .map_err(|e| format!("获取程序路径失败: {}", e))?; - let parent_dir = exe_dir.parent().ok_or("无法获取父目录")?; - - let candidates = [ - parent_dir.join("nvidiaProfileInspector.exe"), - parent_dir.join("_up_").join("nvidiaProfileInspector.exe"), - parent_dir.join("resources").join("nvidiaProfileInspector.exe"), - ]; - - for path in &candidates { - if path.exists() { - return Ok(path.clone()); - } - } - - Err("未找到NVIDIA Profile Inspector,请确保已安装或将其放在程序目录下".to_string()) -} - -fn make_profile_setting(name: &str, setting_id: u32, value: u32) -> String { - format!( - r#" - {name} - {id} - {val} - Dword - "#, - name = name, - id = setting_id, - val = value, - ) -} - -fn generate_nip_config(preset: &str, quality_level: &str, texture_quality: &str, antialiasing: &str) -> Vec { - let preset_value: u32 = match preset.to_uppercase().as_str() { - "A" => 1, "B" => 2, "C" => 3, "D" => 4, "E" => 5, "F" => 6, "G" => 7, - "J" => 10, "K" => 11, "L" => 12, "M" => 13, - _ => 11, - }; - - let mut settings = vec![ - make_profile_setting("Vertical Sync Tear Control", 5912412, 2525368439), - make_profile_setting("DLSS Model Preset Profile", 6505105, 2), - make_profile_setting("Enable DeepDVC Feature", 9963648, 0), - make_profile_setting("Vertical Sync", 11041231, 1620202130), - make_profile_setting("Saturation value for DeepDVC", 11250451, 50), - make_profile_setting("Intensity value for DeepDVC", 11250466, 50), - make_profile_setting("Flag to control smooth AFR behavior", 270198627, 0), - make_profile_setting("Override DLSSG mode", 271614616, 1), - make_profile_setting("Override DLSSG multi-frame count", 273507943, 0), - make_profile_setting("Override maximum DLSSG dynamic multi frame count", 274083087, 0), - make_profile_setting("VRR requested state", 278196727, 0), - ]; - - // DLSS 质量级别覆盖 (非 default 时添加) - if quality_level != "default" { - let (forced_quality, forced_scaling) = match quality_level { - "ultra_performance" => (5u32, 0x21u32), - "performance" => (0u32, 0x32u32), - "balanced" => (1u32, 0x3Au32), - "quality" => (2u32, 0x42u32), - "dlaa" => (4u32, 0x64u32), - _ => (0u32, 0u32), - }; - settings.push(make_profile_setting("DLSS - Forced Quality Level", 279951208, forced_quality)); - settings.push(make_profile_setting("DLSS - Forced Scaling Ratio", 283385333, forced_scaling)); - } - - // 纹理过滤质量 (SettingID: 0x00CE2751 = 13510289) - if texture_quality != "default" { - let val = match texture_quality { - "high_quality" => 0xFFFFFFF6u32, // High Quality - "quality" => 0x00000000u32, // Quality - "performance" => 0x0000000Au32, // Performance - "high_performance" => 0x00000014u32, // High Performance - _ => 0, - }; - if val != 0 || texture_quality == "quality" { - settings.push(make_profile_setting("Texture filtering - Quality", 13510289, val)); - } - } - - // 抗锯齿 - 透明度超采样 (SettingID: 0x10D48A85 = 282364549) - if antialiasing != "default" { - let val = match antialiasing { - "off" => 0x00000000u32, // Off - "2x" => 0x00000014u32, // 2x Supersampling - "4x" => 0x00000024u32, // 4x Supersampling - "8x" => 0x00000034u32, // 8x Supersampling - _ => 0, - }; - if val != 0 || antialiasing == "off" { - settings.push(make_profile_setting("Antialiasing - Transparency Supersampling", 282364549, val)); - } - } - - // DLSS 相关(始终包含) - settings.push(make_profile_setting("Override DLSSG Target Frame Rate", 282018085, 0)); - settings.push(make_profile_setting("Override DLSS-FG preset", 283385329, 0)); - settings.push(make_profile_setting("Override DLSS-SR presets", 283385331, preset_value)); - settings.push(make_profile_setting("Enable DLSS-SR override", 283385345, 1)); - settings.push(make_profile_setting("Enable DLSS-FG override", 283385347, 0)); - - let settings_xml = settings.join("\n"); - - let xml_content = format!( - r#" - - - Delta Force - - deltaforceclient-win64-shipping.exe - - -{} - - -"#, - settings_xml, - ); - - // UTF-16LE BOM - let mut bytes = vec![0xFF, 0xFE]; - for c in xml_content.encode_utf16() { - bytes.extend_from_slice(&c.to_le_bytes()); - } - bytes -} - -#[tauri::command] -pub async fn apply_dlss_model_preset(preset: String, quality: String, texture_quality: String, antialiasing: String) -> Result { - let npi_path = get_npi_path()?; - - let config_content = generate_nip_config(&preset, &quality, &texture_quality, &antialiasing); - - let temp_dir = std::env::temp_dir(); - let temp_path = temp_dir.join("delta_force_dlss.nip"); - fs::write(&temp_path, &config_content) - .map_err(|e| format!("写入配置文件失败: {}", e))?; - - let npi_str = npi_path.to_str().ok_or("路径编码错误")?; - let temp_str = temp_path.to_str().ok_or("临时路径编码错误")?; - - let ps_command = format!( - "Start-Process -FilePath '{}' -ArgumentList '-silentImport','\"{}\"' -Verb RunAs -Wait", - npi_str.replace('\'', "''"), - temp_str.replace('\'', "''") - ); - - let output = Command::new("powershell") - .args(["-WindowStyle", "Hidden", "-NoProfile", "-Command", &ps_command]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行失败: {}", e))?; - - let _ = fs::remove_file(&temp_path); - - if output.status.success() { - // 保存当前应用的预设状态,供前端查询 - let status = DLSSPresetStatus { - preset: preset.clone(), - quality: quality.clone(), - texture_quality: texture_quality.clone(), - antialiasing: antialiasing.clone(), - }; - if let Ok(exe_path) = std::env::current_exe() { - if let Some(parent_dir) = exe_path.parent() { - let status_path = parent_dir.join("delta_force_dlss_status.json"); - let _ = fs::write(&status_path, serde_json::to_string(&status).unwrap_or_default()); - } - } - - let mut parts = vec![format!("DLSS预设: {}", preset)]; - if quality != "default" { parts.push(format!("质量: {}", quality)); } - if texture_quality != "default" { parts.push(format!("纹理: {}", texture_quality)); } - if antialiasing != "default" { parts.push(format!("抗锯齿: {}", antialiasing)); } - - Ok(DLSSApplyResult { - success: true, - message: parts.join(" / "), - preset, - quality, - texture_quality, - antialiasing, - }) - } else { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("应用失败: {}", stderr)) - } -} - -#[tauri::command] -pub async fn get_delta_maps() -> Result, String> { - Ok(vec![ - MapInfo { - id: "1".to_string(), - name: "长弓溪谷".to_string(), - url: "https://df.qq.com/cp/a20241029map/index.html".to_string(), - description: "大型开放地图".to_string(), - }, - MapInfo { - id: "2".to_string(), - name: "零号大坝".to_string(), - url: "https://df.qq.com/cp/a20241029map/index.html".to_string(), - description: "中型战术地图".to_string(), - }, - MapInfo { - id: "3".to_string(), - name: "巴克什".to_string(), - url: "https://df.qq.com/cp/a20241029map/index.html".to_string(), - description: "城市战斗地图".to_string(), - }, - ]) -} - -fn get_dlss_indicator_registry_value() -> bool { - let hklm = winreg::RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE); - let path = r"SOFTWARE\NVIDIA Corporation\Global\NGXCore"; - if let Ok(key) = hklm.open_subkey(path) { - if let Ok(value) = key.get_value::("ShowDlssIndicator") { - return value != 0; - } - } - false -} - -#[tauri::command] -pub async fn toggle_dlss_indicator(enable: bool) -> Result { - let value = if enable { 1024 } else { 0 }; - - let script_content = format!( - "$p='HKLM:\\SOFTWARE\\NVIDIA Corporation\\Global\\NGXCore'; \ - if(-not(Test-Path $p)){{New-Item -Path $p -Force|Out-Null}}; \ - Set-ItemProperty -Path $p -Name 'ShowDlssIndicator' -Value {} -Type DWord", - value - ); - - let temp_dir = std::env::temp_dir(); - let temp_script = temp_dir.join("dlss_indicator.ps1"); - fs::write(&temp_script, &script_content) - .map_err(|e| format!("写入临时脚本失败: {}", e))?; - - let script_path = temp_script.to_str().ok_or("路径编码错误")?; - - let ps_command = format!( - "Start-Process -FilePath 'powershell' -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"{}\"' -Verb RunAs -Wait -WindowStyle Hidden", - script_path.replace('\'', "''") - ); - - let output = Command::new("powershell") - .args(["-WindowStyle", "Hidden", "-NoProfile", "-Command", &ps_command]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行失败: {}", e))?; - - let _ = fs::remove_file(&temp_script); - - // 验证注册表值是否已更新(防止Start-Process返回成功但实际写入失败的情况) - let actual = get_dlss_indicator_registry_value(); - if actual != enable { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - if stderr.to_lowercase().contains("cancel") || stderr.to_lowercase().contains("denied") { - return Err("管理员授权被取消,DLSS指示器设置未生效".to_string()); - } - return Err("设置DLSS指示器失败: 注册表值未能更新,请确认已授予管理员权限".to_string()); - } - - Ok(enable) -} - -#[tauri::command] -pub async fn toggle_dlss_lock(enable: bool) -> Result { - let npi_path = get_npi_path()?; - - let lock_config = generate_dlss_lock_config(enable); - - let temp_dir = std::env::temp_dir(); - let temp_path = temp_dir.join("delta_force_dlss_lock.nip"); - fs::write(&temp_path, &lock_config) - .map_err(|e| format!("写入锁定配置文件失败: {}", e))?; - - let npi_str = npi_path.to_str().ok_or("路径编码错误")?; - let temp_str = temp_path.to_str().ok_or("临时路径编码错误")?; - - let ps_command = format!( - "Start-Process -FilePath '{}' -ArgumentList '-silentImport','\"{}\"' -Verb RunAs -Wait", - npi_str.replace('\'', "''"), - temp_str.replace('\'', "''") - ); - - let output = Command::new("powershell") - .args(["-WindowStyle", "Hidden", "-NoProfile", "-Command", &ps_command]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行失败: {}", e))?; - - let _ = fs::remove_file(&temp_path); - - if output.status.success() { - Ok(enable) - } else { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("DLSS锁定操作失败: {}", stderr)) - } -} - -fn generate_dlss_lock_config(lock_enabled: bool) -> Vec { - let lock_value = if lock_enabled { "1" } else { "0" }; - - let xml_content = format!( - r#" - - - Delta Force DLSS Lock - - deltaforceclient-win64-shipping.exe - - - - - 275602687 - {} - Dword - - - Override DLSS-SR presets - 283385331 - 11 - Dword - - - Enable DLSS-SR override - 283385345 - 1 - Dword - - - -"#, - lock_value - ); - - let mut bytes: Vec = vec![0xFF, 0xFE]; - bytes.extend( - xml_content.encode_utf16().collect::>() - .iter() - .flat_map(|&c| c.to_le_bytes()) - ); - bytes -} - -#[tauri::command] -pub async fn get_dlss_settings_status() -> Result { - let dlss_indicator_enabled = get_dlss_indicator_registry_value(); - - let dlss_lock_enabled = false; - - Ok(DLSSSettingsStatus { - dlss_indicator_enabled, - dlss_lock_enabled, - }) -} - -#[tauri::command] -pub async fn get_dlss_preset_status() -> Result { - let exe_path = std::env::current_exe() - .map_err(|e| format!("获取程序路径失败: {}", e))?; - let parent_dir = exe_path.parent().ok_or("无法获取父目录")?; - let status_path = parent_dir.join("delta_force_dlss_status.json"); - - if status_path.exists() { - let content = fs::read_to_string(&status_path) - .map_err(|e| format!("读取状态文件失败: {}", e))?; - if let Ok(status) = serde_json::from_str::(&content) { - return Ok(status); - } - } - - Ok(DLSSPresetStatus { preset: "K".to_string(), quality: "default".to_string(), texture_quality: "default".to_string(), antialiasing: "default".to_string() }) -} - -/// 在独立 WebView 窗口中打开外部平台链接,iframe 内嵌支持完整跳转 -#[tauri::command] -pub async fn open_platform_window( - app: tauri::AppHandle, - url: String, - title: String, - label: String, -) -> Result<(), String> { - use tauri::WebviewUrl; - use tauri::WebviewWindowBuilder; - use tauri::Manager; - - // 目标 URL 编码后通过 hash fragment 传入 platform-viewer.html - let encoded = urlencoding::encode(&url); - let app_path = format!("platform-viewer.html#{}", encoded); - - let app_clone = app.clone(); - let label_clone = label.clone(); - - WebviewWindowBuilder::new(&app, &label, WebviewUrl::App(app_path.into())) - .title(&title) - .inner_size(1200.0, 800.0) - .resizable(true) - .center() - // 拦截 iframe 内 target="_blank" / window.open() 的跳转 - // 改为在 iframe 内导航,不弹出新窗口 - .on_new_window(move |new_url, _features| { - if let Some(window) = app_clone.get_webview_window(&label_clone) { - let safe = new_url.as_str().replace('\\', "\\\\").replace('\'', "\\'"); - let _ = window.eval(&format!( - "var f=document.getElementById('viewer');if(f)f.src='{safe}';" - )); - } - tauri::webview::NewWindowResponse::Deny - }) - .build() - .map_err(|e| format!("创建窗口失败: {}", e))?; - - Ok(()) -} - -#[cfg(test)] -mod tests { - use super::*; - - fn decode_utf16_le(bytes: &[u8]) -> String { - if bytes.len() >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE { - // skip BOM - let rest = &bytes[2..]; - let mut u16s = Vec::with_capacity(rest.len() / 2); - for chunk in rest.chunks(2) { - if chunk.len() == 2 { - let lo = chunk[0] as u16; - let hi = chunk[1] as u16; - u16s.push(lo | (hi << 8)); - } - } - String::from_utf16(&u16s).unwrap_or_default() - } else { - String::from_utf8(bytes.to_vec()).unwrap_or_default() - } - } - - -} diff --git a/参考/NexBox-main/src-tauri/src/display_cache.rs b/参考/NexBox-main/src-tauri/src/display_cache.rs deleted file mode 100644 index 85763ed..0000000 --- a/参考/NexBox-main/src-tauri/src/display_cache.rs +++ /dev/null @@ -1,224 +0,0 @@ -//! 显示器信息公共缓存 -//! -//! 多个页面(滤镜、准心、分辨率管理)都需要获取显示器型号。 -//! 通过直接读取注册表中的 EDID 数据并解析显示器名称, -//! 速度极快(纯内存/注册表操作,不启动任何进程)。 - -use std::sync::Mutex; -use std::time::{Duration, Instant}; - -/// 缓存有效期。 -/// -/// 显示器配置在一次使用会话中基本不会变化,60 秒足够安全; -/// 同时保证热插拔后一段时间能自动刷新。 -const CACHE_TTL: Duration = Duration::from_secs(60); - -struct EdidCache { - fetched_at: Option, - names: Vec, -} - -static EDID_CACHE: Mutex = Mutex::new(EdidCache { - fetched_at: None, - names: Vec::new(), -}); - -/// 获取 EDID 显示器型号名称(带 TTL 缓存)。 -/// -/// 通过读注册表 HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\...\Device Parameters\EDID -/// 直接解析 EDID 中的 Monitor Name (Descriptor Tag 0xFC),不启动任何外部进程。 -pub fn get_edid_monitor_names() -> Vec { - // 先尝试读缓存 - { - let lock = EDID_CACHE.lock().unwrap(); - if let Some(t) = lock.fetched_at { - if t.elapsed() < CACHE_TTL { - return lock.names.clone(); - } - } - } - - // 缓存过期或不存在,重新查询 - log::info!("display_cache: EDID 缓存未命中,从注册表读取 EDID…"); - let names = query_edid_via_registry(); - log::info!("display_cache: 注册表 EDID 查询完成,获取到 {} 个名称", names.len()); - - let mut lock = EDID_CACHE.lock().unwrap(); - lock.fetched_at = Some(Instant::now()); - lock.names = names.clone(); - names -} - -/// 强制刷新缓存(例如显示器配置变化时调用)。 -#[allow(dead_code)] -pub fn invalidate() { - let mut lock = EDID_CACHE.lock().unwrap(); - lock.fetched_at = None; - lock.names.clear(); -} - -/// 通过注册表枚举所有显示器的 EDID,解析出 Monitor Name。 -/// -/// 路径: HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\\\Device Parameters\EDID -#[cfg(target_os = "windows")] -fn query_edid_via_registry() -> Vec { - use winreg::enums::*; - use winreg::RegKey; - - let enum_key = match RegKey::predef(HKEY_LOCAL_MACHINE) - .open_subkey_with_flags( - r"SYSTEM\CurrentControlSet\Enum\DISPLAY", - KEY_READ, - ) { - Ok(k) => k, - Err(e) => { - log::warn!("display_cache: 无法打开 DISPLAY 注册表项: {}", e); - return Vec::new(); - } - }; - - let mut names = Vec::new(); - - // 遍历每个 PNP ID 子项(如 "DELA409", "SAM0F9E" 等) - for pnp_result in enum_key.enum_keys() { - let pnp_id = match pnp_result { - Ok(id) => id, - Err(_) => continue, - }; - - let instance_key = match enum_key.open_subkey_with_flags(&pnp_id, KEY_READ) { - Ok(k) => k, - Err(_) => continue, - }; - - // 遍历每个实例子项 - for inst_result in instance_key.enum_keys() { - let instance_id = match inst_result { - Ok(id) => id, - Err(_) => continue, - }; - - // 读取 EDID 数据 - let edid_path = format!(r"{}\Device Parameters", instance_id); - let dev_params = match instance_key.open_subkey_with_flags(&edid_path, KEY_READ) { - Ok(k) => k, - Err(_) => continue, - }; - - let edid_bytes = match dev_params.get_raw_value("EDID") { - Ok(raw) => raw.bytes, - Err(_) => continue, - }; - - if let Some(name) = parse_edid_monitor_name(&edid_bytes) { - if !names.contains(&name) { - names.push(name); - } - } - } - } - - log::info!("display_cache: 注册表 EDID 扫描完成,找到 {} 个显示器", names.len()); - names -} - -#[cfg(not(target_os = "windows"))] -fn query_edid_via_registry() -> Vec { - Vec::new() -} - -/// 从 EDID 原始二进制数据中解析 Monitor Name。 -/// -/// EDID 128 字节块中包含 4 个描述符块(每个 18 字节), -/// 起始偏移分别为 0x36, 0x48, 0x5A, 0x6C。 -/// 描述符 Tag 0xFC 表示 Monitor Name。 -/// 名称最多 13 个 ASCII 字符,以换行符 (0x0A) 或空格填充结尾。 -fn parse_edid_monitor_name(edid: &[u8]) -> Option { - if edid.len() < 128 { - return None; - } - - // 检查 EDID 头标识 - if edid[0] != 0x00 || edid[1] != 0xFF || edid[2] != 0xFF || edid[3] != 0xFF - || edid[4] != 0xFF || edid[5] != 0xFF || edid[6] != 0xFF || edid[7] != 0x00 - { - log::warn!("display_cache: EDID 头校验失败,跳过"); - return None; - } - - // 4 个描述符块,每个 18 字节 - for block_idx in 0..4 { - let offset = 0x36 + block_idx * 18; - if offset + 18 > edid.len() { - break; - } - - // 描述符前 2 个字节通常为 0x00, 0x00 - // 第 3 字节是 Tag - let tag = edid[offset + 3]; - - // Tag 0xFC = Monitor Name - if tag != 0xFC { - continue; - } - - // 第 5 字节开始是名称数据(最多 13 字节) - let name_start = offset + 5; - let name_end = (name_start + 13).min(edid.len()); - - let name_bytes = &edid[name_start..name_end]; - - // 提取名称:遇到 0x0A(换行符)或 0x20(空格填充)截断 - let name: String = name_bytes - .iter() - .take_while(|&&b| b != 0x0A && b != 0x00) - .map(|&b| b as char) - .collect(); - - let trimmed = name.trim().to_string(); - if !trimmed.is_empty() { - log::info!( - "display_cache: EDID 解析到 Monitor Name: '{}' (block={})", - trimmed, block_idx - ); - return Some(trimmed); - } - } - - None -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_edid_parse_real_data() { - // 构造一个包含 Monitor Name 描述符的最小 EDID - let mut edid = vec![0u8; 128]; - // EDID 头 - edid[0..8].copy_from_slice(&[0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00]); - // 第一个描述符块 (offset 0x36): Monitor Name (tag 0xFC) - edid[0x36 + 3] = 0xFC; - let name_bytes = b"DELL S2721QS"; - let name_len = name_bytes.len().min(13); - edid[0x39..0x39 + name_len].copy_from_slice(&name_bytes[..name_len]); - - let result = parse_edid_monitor_name(&edid); - assert_eq!(result, Some("DELL S2721QS".to_string())); - } - - #[test] - fn test_edid_parse_no_name() { - let mut edid = vec![0u8; 128]; - edid[0..8].copy_from_slice(&[0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00]); - // 所有描述符都是其他类型 (tag != 0xFC) - edid[0x36 + 3] = 0xFF; - edid[0x48 + 3] = 0xFD; - edid[0x5A + 3] = 0xFC; // Monitor name but empty - edid[0x6C + 3] = 0x10; - - let result = parse_edid_monitor_name(&edid); - assert_eq!(result, None); - } -} diff --git a/参考/NexBox-main/src-tauri/src/display_filter.rs b/参考/NexBox-main/src-tauri/src/display_filter.rs deleted file mode 100644 index 2c17591..0000000 --- a/参考/NexBox-main/src-tauri/src/display_filter.rs +++ /dev/null @@ -1,3169 +0,0 @@ -use std::collections::HashMap; -use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; -use std::path::PathBuf; -use std::fs; -use std::io::Read; -use tauri::Emitter; - -// ─── Display enumeration ─── - -#[derive(serde::Serialize, Clone)] -pub struct DisplayInfo { - pub index: usize, - pub name: String, - pub device_name: String, - pub is_primary: bool, - pub width: i32, - pub height: i32, -} - -static DISPLAY_DEVICES: Mutex>> = Mutex::new(None); - -// ─── CCD (QueryDisplayConfig) based enumeration ─── -// 使用 Windows 现代显示配置 API (Vista+),这是 Windows 显示设置本身使用的 API。 -// 相比 GDI EnumDisplayMonitors 回调方式,CCD 更可靠、更快,且直接返回分辨率。 - -#[cfg(target_os = "windows")] -fn enumerate_displays_via_ccd() -> Option> { - use windows_sys::Win32::Devices::Display::*; - use std::mem; - - unsafe { - // ── Pass 1: 获取路径数和模式数 ── - let mut path_count: u32 = 0; - let mut mode_count: u32 = 0; - let status = QueryDisplayConfig( - QDC_ONLY_ACTIVE_PATHS, - &mut path_count, - std::ptr::null_mut(), - &mut mode_count, - std::ptr::null_mut(), - std::ptr::null_mut(), - ); - if status != 0 || path_count == 0 { - log::warn!("CCD 枚举: Pass1 失败或没有显示器 (status={})", status); - return None; - } - - // ── Pass 2: 分配并获取完整数据 ── - let mut paths: Vec = (0..path_count) - .map(|_| mem::zeroed()) - .collect(); - let mut modes: Vec = (0..mode_count) - .map(|_| mem::zeroed()) - .collect(); - - let status = QueryDisplayConfig( - QDC_ONLY_ACTIVE_PATHS, - &mut path_count, - paths.as_mut_ptr(), - &mut mode_count, - modes.as_mut_ptr(), - std::ptr::null_mut(), - ); - if status != 0 { - log::warn!("CCD 枚举: Pass2 失败 (status={})", status); - return None; - } - - let mut displays = Vec::new(); - - for (path_idx, path) in paths.iter().enumerate() { - let source_info = &path.sourceInfo; - let target_info = &path.targetInfo; - - // 跳过未连接的显示器(QDC_ONLY_ACTIVE_PATHS 已经过滤,额外安全检查) - // 在 windows-sys 中 target_info.Anonymous 是联合体,取其原始 u32 值读取 bit0=targetAvailable - let target_flags: u32 = std::ptr::read_unaligned(&target_info.Anonymous as *const _ as *const u32); - let target_available = target_flags & 0x01; - if target_available == 0 { - continue; - } - - // 通过 source mode 获取分辨率 - let (width, height, pos_x, pos_y) = { - let mode_idx = source_info.Anonymous.modeInfoIdx as usize; - if mode_idx < modes.len() { - let mode = &modes[mode_idx]; - if mode.infoType == DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE { - let src = &mode.Anonymous.sourceMode; - (src.width as i32, src.height as i32, src.position.x, src.position.y) - } else { - continue; - } - } else { - continue; - } - }; - - if width <= 0 || height <= 0 { - log::warn!("CCD: path[{}] 分辨率无效 ({}x{})", path_idx, width, height); - continue; - } - - let is_primary = pos_x == 0 && pos_y == 0; - - // 通过 DisplayConfigGetDeviceInfo 获取 GDI 设备名 - let device_name = { - let mut source_name: DISPLAYCONFIG_SOURCE_DEVICE_NAME = mem::zeroed(); - source_name.header.r#type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; - source_name.header.size = mem::size_of::() as u32; - source_name.header.adapterId = source_info.adapterId; - source_name.header.id = source_info.id; - - if DisplayConfigGetDeviceInfo(&mut source_name.header as *mut _ as *mut _) == 0 { - let len = source_name.viewGdiDeviceName - .iter() - .position(|&c| c == 0) - .unwrap_or(source_name.viewGdiDeviceName.len()); - if len > 0 { - let name = String::from_utf16_lossy(&source_name.viewGdiDeviceName[..len]); - if !name.is_empty() { - name - } else { - format!("\\\\.\\DISPLAY{}", path_idx + 1) - } - } else { - format!("\\\\.\\DISPLAY{}", path_idx + 1) - } - } else { - log::warn!("CCD: DisplayConfigGetDeviceInfo 失败,使用 DISPLAY{}", path_idx + 1); - format!("\\\\.\\DISPLAY{}", path_idx + 1) - } - }; - - // 通过 DisplayConfigGetDeviceInfo(GET_TARGET_NAME) 直接获取显示器型号名 - // 这是最快的获取型号名称的方式,无需 EnumDisplayDevicesW / PowerShell - let monitor_model = { - let mut target_name: DISPLAYCONFIG_TARGET_DEVICE_NAME = mem::zeroed(); - target_name.header.r#type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; - target_name.header.size = mem::size_of::() as u32; - target_name.header.adapterId = target_info.adapterId; - target_name.header.id = target_info.id; - - if DisplayConfigGetDeviceInfo(&mut target_name.header as *mut _ as *mut _) == 0 { - let len = target_name.monitorFriendlyDeviceName - .iter() - .position(|&c| c == 0) - .unwrap_or(target_name.monitorFriendlyDeviceName.len()); - if len > 0 { - let name = String::from_utf16_lossy(&target_name.monitorFriendlyDeviceName[..len]); - let trimmed = name.trim(); - if !trimmed.is_empty() { - trimmed.to_string() - } else { - String::new() - } - } else { - String::new() - } - } else { - // 回退到 EnumDisplayDevicesW - get_monitor_model_name(&device_name) - } - }; - - let name = if !monitor_model.is_empty() { - format!("{} ({}x{})", monitor_model, width, height) - } else { - format!("{} ({}x{})", device_name.trim_start_matches("\\\\.\\"), width, height) - }; - - log::info!( - "CCD 发现显示器[{}]: {} ({}x{}), device={}, primary={}", - displays.len(), name, width, height, device_name, is_primary - ); - - displays.push(DisplayInfo { - index: displays.len(), - name, - device_name, - is_primary, - width, - height, - }); - } - - if displays.is_empty() { - log::warn!("CCD 枚举完成但未发现有效的显示器"); - return None; - } - - Some(displays) - } -} - -/// 通过 EnumDisplaySettingsW(ENUM_CURRENT_SETTINGS) 获取设备当前分辨率 -#[cfg(target_os = "windows")] -fn get_gdi_device_resolution(device_name: &str) -> (i32, i32) { - use windows_sys::Win32::Graphics::Gdi::{EnumDisplaySettingsW, DEVMODEW, ENUM_CURRENT_SETTINGS}; - unsafe { - let tries = [device_name, device_name.trim_start_matches("\\\\.\\")]; - for name in tries { - if name.is_empty() { continue; } - let wide: Vec = name.encode_utf16().chain(std::iter::once(0)).collect(); - let mut dm: DEVMODEW = std::mem::zeroed(); - dm.dmSize = std::mem::size_of::() as u16; - if EnumDisplaySettingsW(wide.as_ptr(), ENUM_CURRENT_SETTINGS, &mut dm) != 0 { - let w = dm.dmPelsWidth as i32; - let h = dm.dmPelsHeight as i32; - if w > 0 && h > 0 { return (w, h); } - } - } - } - (0, 0) -} - -/// 回退方案:使用 GDI EnumDisplayMonitors + GetMonitorInfoW -#[cfg(target_os = "windows")] -fn enumerate_displays_via_gdi() -> Vec { - use windows_sys::Win32::Graphics::Gdi::{ - EnumDisplayMonitors, GetMonitorInfoW, - HDC, HMONITOR, MONITORINFOEXW, - }; - - struct MonitorData { - displays: Vec, - } - - unsafe extern "system" fn monitor_enum_proc( - hmonitor: HMONITOR, - _hdc: HDC, - _rect: *mut windows_sys::Win32::Foundation::RECT, - lparam: isize, - ) -> i32 { - let data = &mut *(lparam as *mut MonitorData); - let mut info: MONITORINFOEXW = std::mem::zeroed(); - info.monitorInfo.cbSize = std::mem::size_of::() as u32; - - if GetMonitorInfoW(hmonitor, &mut info as *mut _ as *mut _) != 0 { - let device_name = String::from_utf16_lossy( - &info.szDevice[..info.szDevice.iter().position(|&c| c == 0).unwrap_or(info.szDevice.len())], - ); - let is_primary = (info.monitorInfo.dwFlags & 1) != 0; - let mut width = info.monitorInfo.rcMonitor.right - info.monitorInfo.rcMonitor.left; - let mut height = info.monitorInfo.rcMonitor.bottom - info.monitorInfo.rcMonitor.top; - - // 分辨率无效时回退到 EnumDisplaySettingsW - if width <= 0 || height <= 0 { - log::warn!( - "GDI: monitor[{}] GetMonitorInfoW 分辨率无效 ({}x{}),EnumDisplaySettingsW 回退", - data.displays.len(), width, height - ); - let (fw, fh) = get_gdi_device_resolution(&device_name); - if fw > 0 && fh > 0 { width = fw; height = fh; } - } - - let index = data.displays.len(); - let monitor_model = get_monitor_model_name(&device_name); - let name = if !monitor_model.is_empty() { - format!("{} ({}x{})", monitor_model, width, height) - } else { - format!("{} ({}x{})", device_name, width, height) - }; - - data.displays.push(DisplayInfo { - index, - name, - device_name: device_name.clone(), - is_primary, - width, - height, - }); - } - 1 - } - - let mut data = MonitorData { - displays: Vec::new(), - }; - - unsafe { - EnumDisplayMonitors( - std::ptr::null_mut(), - std::ptr::null(), - Some(monitor_enum_proc), - &mut data as *mut _ as isize, - ); - } - - data.displays -} - -/// Sync internal: enumerate all displays and populate DISPLAY_DEVICES cache. -/// 优先使用 CCD (QueryDisplayConfig),回退到 GDI (EnumDisplayMonitors)。 -#[cfg(target_os = "windows")] -fn enumerate_displays_inner() -> Vec { - // ── 首选:CCD (QueryDisplayConfig) ── - let mut displays = enumerate_displays_via_ccd().unwrap_or_default(); - - // ── 回退:GDI (EnumDisplayMonitors) ── - if displays.is_empty() { - log::warn!("CCD 枚举失败,回退到 GDI EnumDisplayMonitors"); - displays = enumerate_displays_via_gdi(); - } - - // ── 如果仍然为空,尝试 EnumDisplayDevicesW + EnumDisplaySettingsW 暴力扫描 ── - if displays.is_empty() { - log::warn!("GDI 也失败,最后回退:暴力扫描 DISPLAY1..DISPLAY8"); - for i in 0..8 { - let name = format!("\\\\.\\DISPLAY{}", i + 1); - let (w, h) = get_gdi_device_resolution(&name); - if w > 0 && h > 0 { - let device_name = name; - let is_primary = i == 0; - let mon_name = format!("DISPLAY{} ({}x{})", i + 1, w, h); - displays.push(DisplayInfo { - index: displays.len(), - name: mon_name, - device_name, - is_primary, - width: w, - height: h, - }); - } - } - } - - // 缓存 device names - if let Ok(mut lock) = DISPLAY_DEVICES.lock() { - let names: Vec = displays.iter().map(|d| d.device_name.clone()).collect(); - *lock = Some(names); - } - - // 极端回退:仍然没有显示器 - if displays.is_empty() { - log::error!("所有显示枚举方法都失败!返回 fallback 显示器"); - displays.push(DisplayInfo { - index: 0, - name: "DISPLAY1 (Primary)".to_string(), - device_name: "DISPLAY1".to_string(), - is_primary: true, - width: 0, - height: 0, - }); - if let Ok(mut lock) = DISPLAY_DEVICES.lock() { - *lock = Some(vec!["DISPLAY1".to_string()]); - } - } - - // EDID 回退:EnumDisplayDevicesW 经常返回"通用即插即用显示器", - // 导致 name 退化为 GDI 设备名(如 \\.\DISPLAY1)。 - let is_fallback_name = |name: &str| -> bool { - if name.starts_with('\\') { return true; } - let prefix = name.split(" (").next().unwrap_or(name); - is_generic_monitor_name(prefix) - }; - if displays.iter().any(|d| is_fallback_name(&d.name)) { - log::info!("检测到通用显示器名称,尝试从 EDID 获取真实型号..."); - let edid_names = crate::display_cache::get_edid_monitor_names(); - log::info!("EDID 查询结果: {} 个", edid_names.len()); - if !edid_names.is_empty() { - for (i, d) in displays.iter_mut().enumerate() { - if is_fallback_name(&d.name) { - if let Some(edid_name) = edid_names.get(i) { - if !edid_name.is_empty() { - let new_name = format!("{} ({}x{})", edid_name, d.width, d.height); - log::info!("显示器[{}]: EDID 替换 '{}' -> '{}'", i, d.name, new_name); - d.name = new_name; - } - } else if edid_names.len() == 1 && !edid_names[0].is_empty() { - let new_name = format!("{} ({}x{})", edid_names[0], d.width, d.height); - log::info!("显示器[{}]: EDID 替换(单结果) '{}' -> '{}'", i, d.name, new_name); - d.name = new_name; - } - } - } - } else { - log::warn!("EDID 查询无结果,保持原始名称"); - } - } - - displays -} - -#[tauri::command] -pub async fn get_displays() -> Result, String> { - #[cfg(target_os = "windows")] - { - log::info!("get_displays: 枚举所有显示器…"); - let displays = tauri::async_runtime::spawn_blocking(|| enumerate_displays_inner()) - .await - .map_err(|e| format!("枚举显示器失败: {}", e))?; - - // 重试机制:如果所有显示器分辨率都是 0,等待后重试一次 - if !displays.is_empty() && displays.iter().all(|d| d.width <= 0 || d.height <= 0) { - log::warn!("get_displays: 所有显示器分辨率无效,500ms 后重试…"); - tokio::time::sleep(std::time::Duration::from_millis(500)).await; - let retry = tauri::async_runtime::spawn_blocking(|| enumerate_displays_inner()) - .await - .map_err(|e| format!("枚举显示器重试失败: {}", e))?; - if retry.iter().any(|d| d.width > 0 && d.height > 0) { - log::info!("get_displays: 重试后成功获取到分辨率"); - return Ok(retry); - } - log::warn!("get_displays: 重试后分辨率仍未就绪,返回首次结果"); - } - - Ok(displays) - } - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - - - -/// Check if a monitor name is a generic/placeholder (any language variant) -fn is_generic_monitor_name(name: &str) -> bool { - let lower = name.to_lowercase(); - lower.contains("generic") - || lower.contains("即插即用") - || lower.contains("通用") - || lower.contains("pnp") - || lower.contains("standard monitor") - || lower.contains("digital display") - || lower.contains("analog display") -} - -#[cfg(target_os = "windows")] -fn get_monitor_model_name(device_name: &str) -> String { - use windows_sys::Win32::Graphics::Gdi::{EnumDisplayDevicesW, DISPLAY_DEVICEW}; - use std::mem; - - unsafe { - let device_name_wide: Vec = device_name.encode_utf16().chain(std::iter::once(0)).collect(); - - let mut disp_device: DISPLAY_DEVICEW = mem::zeroed(); - disp_device.cb = mem::size_of::() as u32; - - if EnumDisplayDevicesW(device_name_wide.as_ptr(), 0, &mut disp_device, 0) != 0 { - let len = disp_device.DeviceString.iter().position(|&c| c == 0).unwrap_or(disp_device.DeviceString.len()); - if len > 0 { - let model = String::from_utf16_lossy(&disp_device.DeviceString[..len]); - let trimmed = model.trim(); - if !trimmed.is_empty() && !is_generic_monitor_name(trimmed) { - return trimmed.to_string(); - } - // Don't return generic names; return empty so callers use device_name - return String::new(); - } - } - } - - String::new() -} -// ─── Per-display state ─── - -struct DisplayState { - original_gamma: Option<[[u16; 256]; 3]>, - temperature: i32, - brightness: i32, - contrast: i32, - saturation: i32, - r_gamma: f64, - g_gamma: f64, - b_gamma: f64, - mode: i32, - icc_ramp: Option<[[u16; 256]; 3]>, - icc_active: bool, - filter_active: bool, -} - -impl Default for DisplayState { - fn default() -> Self { - Self { - original_gamma: None, - temperature: 6500, - brightness: 100, - contrast: 100, - saturation: 100, - r_gamma: 1.0, - g_gamma: 1.0, - b_gamma: 1.0, - mode: 0, - icc_ramp: None, - icc_active: false, - filter_active: false, - } - } -} - -static DISPLAY_STATES: Mutex>>> = Mutex::new(None); -static ACTIVE_DISPLAY_INDEX: AtomicUsize = AtomicUsize::new(0); - -// Filter monitor thread flags -static FILTER_THREAD_RUNNING: AtomicBool = AtomicBool::new(false); -static GAMMA_RAMP_MUTEX: Mutex<()> = Mutex::new(()); - -fn ensure_display_states() { - let mut lock = DISPLAY_STATES.lock().unwrap(); - if lock.is_none() { - let count = if let Ok(dev_lock) = DISPLAY_DEVICES.lock() { - dev_lock.as_ref().map(|d| d.len()).unwrap_or(1) - } else { - 1 - }; - let states: Vec> = (0..count) - .map(|_| Mutex::new(DisplayState::default())) - .collect(); - *lock = Some(states); - } -} - -fn with_display_state(idx: usize, f: F) -> R -where - F: FnOnce(&mut DisplayState) -> R, -{ - ensure_display_states(); - let lock = DISPLAY_STATES.lock().unwrap(); - let states = lock.as_ref().unwrap(); - let idx = idx.min(states.len() - 1); - let mut state = states[idx].lock().unwrap(); - f(&mut *state) -} - -fn get_active_index() -> usize { - let idx = ACTIVE_DISPLAY_INDEX.load(Ordering::SeqCst); - ensure_display_states(); - let lock = DISPLAY_STATES.lock().unwrap(); - let states = lock.as_ref().unwrap(); - idx.min(states.len() - 1) -} - -fn resolve_display_index(display_index: Option) -> usize { - display_index.unwrap_or_else(|| get_active_index()) -} - -#[tauri::command] -pub async fn set_active_display(display_index: usize) -> Result<(), String> { - ensure_display_states(); - ACTIVE_DISPLAY_INDEX.store(display_index, Ordering::SeqCst); - Ok(()) -} - -// ─── Filter mode and setting types ─── - -#[derive(serde::Serialize, Clone, Copy, PartialEq)] -pub enum FilterMode { - Normal = 0, - Vivid = 1, - Movie = 2, - Highlight = 3, - Soft = 4, - Gaming = 5, - Reading = 6, - DeExposure = 7, - ShadowBoost = 8, -} - -impl FilterMode { - pub fn from_i32(value: i32) -> Self { - match value { - 1 => FilterMode::Vivid, - 2 => FilterMode::Movie, - 3 => FilterMode::Highlight, - 4 => FilterMode::Soft, - 5 => FilterMode::Gaming, - 6 => FilterMode::Reading, - 7 => FilterMode::DeExposure, - 8 => FilterMode::ShadowBoost, - _ => FilterMode::Normal, - } - } -} - -#[derive(serde::Serialize, Clone)] -pub struct FilterSettings { - pub temperature: i32, - pub brightness: i32, - pub contrast: i32, - pub saturation: i32, - pub r_gamma: f64, - pub g_gamma: f64, - pub b_gamma: f64, - pub mode: i32, - pub is_active: bool, -} - -#[derive(serde::Serialize)] -pub struct FilterResult { - pub success: bool, - pub message: String, - pub settings: Option, - pub preview_filter: Option, - pub preview_tint_color: Option, - pub preview_tint_opacity: Option, -} - -#[derive(serde::Serialize)] -pub struct FilterPreset { - pub id: String, - pub name: String, - pub mode: i32, - pub temperature: i32, - pub brightness: i32, - pub contrast: i32, - pub saturation: i32, - pub description: String, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct CustomFilterSettings { - pub temperature: i32, - pub brightness: i32, - pub contrast: i32, - pub saturation: i32, - #[serde(default = "default_one_f64")] - pub r_gamma: f64, - #[serde(default = "default_one_f64")] - pub g_gamma: f64, - #[serde(default = "default_one_f64")] - pub b_gamma: f64, -} - -fn default_one_f64() -> f64 { 1.0 } - -impl Default for CustomFilterSettings { - fn default() -> Self { - Self { - temperature: 6500, - brightness: 100, - contrast: 100, - saturation: 100, - r_gamma: 1.0, - g_gamma: 1.0, - b_gamma: 1.0, - } - } -} - -static CUSTOM_SETTINGS: Mutex>> = Mutex::new(None); - -fn get_settings_file_path() -> PathBuf { - let config_dir = dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")); - config_dir.join("NexBox").join("filter-settings.json") -} - -fn get_legacy_settings_file_path() -> PathBuf { - let config_dir = dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")); - config_dir.join("NexBox").join("settings.json") -} - -fn load_custom_settings_from_file() -> HashMap { - let path = get_settings_file_path(); - if path.exists() { - return load_from_json_file(&path); - } - - // Fallback: try legacy path (settings.json) for migration from older versions - let legacy_path = get_legacy_settings_file_path(); - if legacy_path.exists() { - if let Ok(content) = fs::read_to_string(&legacy_path) { - if let Ok(json) = serde_json::from_str::(&content) { - if let Some(settings_value) = json.get("custom-filter-settings") { - let result = parse_custom_settings_value(settings_value.clone()); - if !result.is_empty() { - // Migrate to new file - if let Some(parent) = path.parent() { - let _ = fs::create_dir_all(parent); - } - let string_map: HashMap = result - .iter() - .map(|(k, v)| (k.to_string(), v)) - .collect(); - if let Ok(json_str) = serde_json::to_string_pretty(&serde_json::json!({"custom-filter-settings": string_map})) { - let _ = fs::write(&path, json_str); - } - return result; - } - } - } - } - } - - HashMap::new() -} - -fn load_from_json_file(path: &PathBuf) -> HashMap { - match fs::read_to_string(path) { - Ok(content) => match serde_json::from_str::(&content) { - Ok(json) => { - if let Some(settings_value) = json.get("custom-filter-settings") { - let result = parse_custom_settings_value(settings_value.clone()); - if !result.is_empty() { - return result; - } - } - } - Err(e) => log::error!("解析滤镜设置文件JSON失败: {}", e), - }, - Err(e) => log::error!("读取滤镜设置文件失败: {}", e), - } - HashMap::new() -} - -fn parse_custom_settings_value(value: serde_json::Value) -> HashMap { - if let Ok(map) = serde_json::from_value::>(value.clone()) { - let result: HashMap = map - .into_iter() - .filter_map(|(k, v)| k.parse::().ok().map(|idx| (idx, v))) - .collect(); - if !result.is_empty() { - return result; - } - } - // Fallback: old format (single CustomFilterSettings object) - match serde_json::from_value::(value) { - Ok(settings) => { - let mut map = HashMap::new(); - map.insert(0, settings); - map - } - Err(e) => { - log::error!("解析自定义滤镜设置失败: {}", e); - HashMap::new() - } - } -} - -fn save_custom_settings_to_file(settings: &HashMap) -> Result<(), String> { - let path = get_settings_file_path(); - - if let Some(parent) = path.parent() { - if !parent.exists() { - if let Err(e) = fs::create_dir_all(parent) { - log::error!("创建目录失败: {}", e); - return Err(format!("无法创建目录: {}", e)); - } - } - } - - let mut existing_settings: serde_json::Value = if path.exists() { - match fs::read_to_string(&path) { - Ok(content) => match serde_json::from_str(&content) { - Ok(json) => json, - Err(_) => serde_json::json!({}), - }, - Err(_) => serde_json::json!({}), - } - } else { - serde_json::json!({}) - }; - - // Serialize as string-keyed map for JSON compatibility - let string_map: HashMap = settings - .iter() - .map(|(k, v)| (k.to_string(), v)) - .collect(); - existing_settings["custom-filter-settings"] = - serde_json::to_value(&string_map).unwrap(); - - match serde_json::to_string_pretty(&existing_settings) { - Ok(json_str) => { - match fs::write(&path, json_str) { - Ok(_) => Ok(()), - Err(e) => { - log::error!("写入设置文件失败: {}", e); - Err(format!("无法保存设置: {}", e)) - } - } - } - Err(e) => { - log::error!("序列化设置失败: {}", e); - Err(format!("无法序列化设置: {}", e)) - } - } -} - -fn get_or_load_custom_settings() -> HashMap { - let mut settings_lock = CUSTOM_SETTINGS.lock().unwrap(); - if settings_lock.is_none() { - let settings = load_custom_settings_from_file(); - *settings_lock = Some(settings.clone()); - settings - } else { - settings_lock.as_ref().unwrap().clone() - } -} - -// ─── Gamma calculation ─── - -fn kelvin_to_rgb_multipliers(temperature: i32) -> (f64, f64, f64) { - let temp = temperature as f64 / 100.0; - - let red = if temp <= 66.0 { - 1.0 - } else { - let r = temp - 60.0; - let val = 329.698727446 * r.powf(-0.1332047592); - (val / 255.0).clamp(0.0, 1.0) - }; - - let green = if temp <= 66.0 { - let val = 99.4708025861 * temp.ln() - 161.1195681661; - (val / 255.0).clamp(0.0, 1.0) - } else { - let g = temp - 60.0; - let val = 288.1221695283 * g.powf(-0.0755148492); - (val / 255.0).clamp(0.0, 1.0) - }; - - let blue = if temp >= 66.0 { - 1.0 - } else if temp <= 19.0 { - 0.0 - } else { - let b = temp - 10.0; - let val = 138.5177312231 * b.ln() - 305.0447927307; - (val / 255.0).clamp(0.0, 1.0) - }; - - (red, green, blue) -} - -fn apply_gamma_curve(input: f64, gamma: f64) -> f64 { - input.powf(1.0 / gamma) -} - -fn apply_s_curve(input: f64, strength: f64) -> f64 { - let strength = strength.clamp(-0.5, 0.5); - let x = input - 0.5; - let result = 0.5 + x * (1.0 + strength * (1.0 - 4.0 * x * x)); - result.clamp(0.0, 1.0) -} - -fn build_gamma_ramp( - temperature: i32, - brightness: i32, - contrast: i32, - saturation: i32, - mode: FilterMode, - custom_gamma: Option<(f64, f64, f64)>, -) -> [[u16; 256]; 3] { - let (r_temp_mult, g_temp_mult, b_temp_mult) = kelvin_to_rgb_multipliers(temperature); - let brightness_factor = brightness as f64 / 100.0; - let contrast_factor = contrast as f64 / 100.0; - let sat_factor = saturation as f64 / 100.0; - - let (gamma, s_curve_strength, r_boost, g_boost, b_boost): (f64, f64, f64, f64, f64) = match mode { - FilterMode::Normal => (1.0, 0.0, 1.0, 1.0, 1.0), - FilterMode::Vivid => { - (0.95, 0.08, 1.02, 1.0, 1.03) - } - FilterMode::Movie => { - (1.05, -0.05, 1.0, 0.98, 0.96) - } - FilterMode::Highlight => { - (0.92, 0.05, 1.0, 1.0, 1.0) - } - FilterMode::Soft => { - (1.08, -0.08, 0.98, 1.0, 1.02) - } - FilterMode::Gaming => { - (0.96, 0.1, 1.0, 1.0, 1.02) - } - FilterMode::Reading => { - (1.0, 0.0, 1.0, 0.99, 0.97) - } - FilterMode::DeExposure => { - // 去曝光:gamma<1 整体压暗、负 S 曲线压缩高光,恢复高光细节 - (0.96, -0.05, 1.0, 1.0, 1.0) - } - FilterMode::ShadowBoost => { - // 暗部增强:gamma>1 提亮暗部、小幅正 S 曲线保留对比,让暗处显现 - (1.12, 0.03, 1.0, 1.0, 1.0) - } - }; - - // Per-channel gamma: if custom_gamma is Some, use it as (r_gamma, g_gamma, b_gamma) - let use_per_channel = custom_gamma.is_some() - && (custom_gamma.unwrap().0 - 1.0).abs() > 0.001 - || (custom_gamma.unwrap_or((1.0, 1.0, 1.0)).1 - 1.0).abs() > 0.001 - || (custom_gamma.unwrap_or((1.0, 1.0, 1.0)).2 - 1.0).abs() > 0.001; - - let (r_gamma, g_gamma, b_gamma) = custom_gamma.unwrap_or((gamma, gamma, gamma)); - - let mut ramp = [[0u16; 256]; 3]; - - if use_per_channel { - // Per-channel gamma pipeline: each channel gets independent gamma + s_curve - for i in 0..256 { - let input = i as f64 / 255.0; - - let r_adj = apply_gamma_curve(input, r_gamma); - let g_adj = apply_gamma_curve(input, g_gamma); - let b_adj = apply_gamma_curve(input, b_gamma); - - let r_adj = apply_s_curve(r_adj, s_curve_strength); - let g_adj = apply_s_curve(g_adj, s_curve_strength); - let b_adj = apply_s_curve(b_adj, s_curve_strength); - - let r_adj = ((r_adj - 0.5) * contrast_factor + 0.5) * brightness_factor; - let g_adj = ((g_adj - 0.5) * contrast_factor + 0.5) * brightness_factor; - let b_adj = ((b_adj - 0.5) * contrast_factor + 0.5) * brightness_factor; - - let r_base = r_adj.clamp(0.0, 1.0) * 65535.0; - let g_base = g_adj.clamp(0.0, 1.0) * 65535.0; - let b_base = b_adj.clamp(0.0, 1.0) * 65535.0; - - let r_final = (r_base * r_temp_mult * r_boost).min(65535.0); - let g_final = (g_base * g_temp_mult * g_boost).min(65535.0); - let b_final = (b_base * b_temp_mult * b_boost).min(65535.0); - - let r_luma = 0.299 * r_final; - let g_luma = 0.587 * g_final; - let b_luma = 0.114 * b_final; - let luma = r_luma + g_luma + b_luma; - - let r_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (r_final - luma) * sat_factor - } else { - r_final - }; - let g_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (g_final - luma) * sat_factor - } else { - g_final - }; - let b_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (b_final - luma) * sat_factor - } else { - b_final - }; - - ramp[0][i] = r_out.clamp(0.0, 65535.0) as u16; - ramp[1][i] = g_out.clamp(0.0, 65535.0) as u16; - ramp[2][i] = b_out.clamp(0.0, 65535.0) as u16; - } - } else { - // Original unified gamma pipeline (unchanged for preset modes) - for i in 0..256 { - let input = i as f64 / 255.0; - - let mut adjusted = apply_gamma_curve(input, gamma); - - adjusted = apply_s_curve(adjusted, s_curve_strength); - - adjusted = ((adjusted - 0.5) * contrast_factor + 0.5) * brightness_factor; - adjusted = adjusted.clamp(0.0, 1.0); - - let base_output = adjusted * 65535.0; - - let r_final = (base_output * r_temp_mult * r_boost).min(65535.0); - let g_final = (base_output * g_temp_mult * g_boost).min(65535.0); - let b_final = (base_output * b_temp_mult * b_boost).min(65535.0); - - let r_luma = 0.299 * r_final; - let g_luma = 0.587 * g_final; - let b_luma = 0.114 * b_final; - let luma = r_luma + g_luma + b_luma; - - let r_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (r_final - luma) * sat_factor - } else { - r_final - }; - let g_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (g_final - luma) * sat_factor - } else { - g_final - }; - let b_out = if (sat_factor - 1.0).abs() > 0.001 { - luma + (b_final - luma) * sat_factor - } else { - b_final - }; - - ramp[0][i] = r_out.clamp(0.0, 65535.0) as u16; - ramp[1][i] = g_out.clamp(0.0, 65535.0) as u16; - ramp[2][i] = b_out.clamp(0.0, 65535.0) as u16; - } - } - - for channel in 0..3 { - for i in 1..256 { - if ramp[channel][i] < ramp[channel][i - 1] { - ramp[channel][i] = ramp[channel][i - 1]; - } - } - } - - ramp[0][0] = 0; - ramp[1][0] = 0; - ramp[2][0] = 0; - ramp[0][255] = 65535; - ramp[1][255] = 65535; - ramp[2][255] = 65535; - - ramp -} - -// ─── Per-display DC helpers ─── - -/// 轻量级枚举:仅收集显示器 GDI 设备名并填充 DISPLAY_DEVICES 缓存。 -/// 不调用 EnumDisplayDevicesW / EDID / PowerShell,适用于清理路径等不应阻塞的场景。 -#[cfg(target_os = "windows")] -fn enumerate_device_names_only() -> Vec { - use windows_sys::Win32::Graphics::Gdi::{ - EnumDisplayMonitors, GetMonitorInfoW, - HDC, HMONITOR, MONITORINFOEXW, - }; - - struct MonitorData { - device_names: Vec, - } - - unsafe extern "system" fn monitor_enum_proc( - hmonitor: HMONITOR, - _hdc: HDC, - _rect: *mut windows_sys::Win32::Foundation::RECT, - lparam: isize, - ) -> i32 { - let data = &mut *(lparam as *mut MonitorData); - let mut info: MONITORINFOEXW = std::mem::zeroed(); - info.monitorInfo.cbSize = std::mem::size_of::() as u32; - if GetMonitorInfoW(hmonitor, &mut info as *mut _ as *mut _) != 0 { - let device_name = String::from_utf16_lossy( - &info.szDevice[..info.szDevice.iter().position(|&c| c == 0).unwrap_or(info.szDevice.len())], - ); - data.device_names.push(device_name); - } - 1 - } - - let mut data = MonitorData { - device_names: Vec::new(), - }; - unsafe { - EnumDisplayMonitors( - std::ptr::null_mut(), - std::ptr::null(), - Some(monitor_enum_proc), - &mut data as *mut _ as isize, - ); - } - if data.device_names.is_empty() { - data.device_names.push("DISPLAY1".to_string()); - } - if let Ok(mut lock) = DISPLAY_DEVICES.lock() { - *lock = Some(data.device_names.clone()); - } - data.device_names -} - -#[cfg(target_os = "windows")] -fn get_display_dc( - display_index: usize, -) -> Result<(windows_sys::Win32::Graphics::Gdi::HDC, bool), String> { - use windows_sys::Win32::Graphics::Gdi::{CreateDCW, GetDC}; - - // 1. Try to get the device name from cache - let device_names: Vec = { - let lock = DISPLAY_DEVICES - .lock() - .map_err(|_| "无法获取显示器列表锁".to_string())?; - if let Some(ref names) = *lock { - names.clone() - } else { - // 缓存为空 → 轻量枚举(不触发 EnumDisplayDevicesW / EDID / PowerShell) - drop(lock); - log::info!("get_display_dc[{}]: DISPLAY_DEVICES 缓存为空,轻量枚举设备名", display_index); - enumerate_device_names_only() - } - }; - - // Try multiple device name formats for robustness (handles Optimus/dGPU scenarios) - let name: Option = device_names.get(display_index).cloned(); - let name_formats: Vec = if let Some(ref name) = name { - let mut formats: Vec = vec![name.to_string()]; - // Also try without \\.\ prefix (some systems need this) - let stripped = name.trim_start_matches("\\\\.\\"); - if stripped != name.as_str() { - formats.push(stripped.to_string()); - } - formats - } else { - vec![] - }; - - // Attempt per-display CreateDCW with each name format - for fmt in &name_formats { - let device_name_wide: Vec = fmt.encode_utf16().chain(std::iter::once(0)).collect(); - unsafe { - let hdc = CreateDCW( - device_name_wide.as_ptr(), - std::ptr::null(), - std::ptr::null(), - std::ptr::null(), - ); - if !hdc.is_null() { - log::info!("get_display_dc[{}]: CreateDCW 成功 (name={})", display_index, fmt); - return Ok((hdc, false)); - } - } - } - - // ── Fallback 1: Try "DISPLAY1", "DISPLAY2" as plain driver names ── - // On some Optimus laptops, the device name from EnumDisplayMonitors may not - // work directly with CreateDCW, but the plain "DISPLAY1" form does. - if name_formats.is_empty() || name_formats.iter().all(|f| f.starts_with("\\\\.\\")) { - let alt_name = format!("DISPLAY{}", display_index + 1); - let alt_name_wide: Vec = alt_name.encode_utf16().chain(std::iter::once(0)).collect(); - unsafe { - let hdc = CreateDCW( - alt_name_wide.as_ptr(), - std::ptr::null(), - std::ptr::null(), - std::ptr::null(), - ); - if !hdc.is_null() { - log::info!("get_display_dc[{}]: CreateDCW 成功 (alt name={})", display_index, alt_name); - return Ok((hdc, false)); - } - } - } - - // ── Fallback 2: Try plain "DISPLAY" (system-wide desktop DC via CreateDCW) ── - // This may behave differently than GetDC(null) on certain GPU configurations. - let display_wide: Vec = "DISPLAY\0".encode_utf16().collect(); - unsafe { - let hdc = CreateDCW( - display_wide.as_ptr(), - std::ptr::null(), - std::ptr::null(), - std::ptr::null(), - ); - if !hdc.is_null() { - log::warn!( - "get_display_dc[{}]: 逐显示器 CreateDCW 全部失败,使用 CreateDCW(DISPLAY) 回退", - display_index - ); - return Ok((hdc, false)); // false → use DeleteDC - } - } - - // ── Fallback 3: Desktop DC via GetDC(null) ── - // Works on virtually all systems including Optimus laptops. - log::warn!( - "get_display_dc[{}]: 所有 CreateDCW 尝试失败,使用 GetDC(null) 桌面 DC 回退", - display_index - ); - unsafe { - let hdc = GetDC(std::ptr::null_mut()); - if hdc.is_null() { - return Err("无法获取设备上下文".to_string()); - } - Ok((hdc, true)) - } -} - -// ─── Gamma ramp functions ─── - -#[cfg(target_os = "windows")] -fn set_gamma_ramp_for_display(display_index: usize, ramp: &[[u16; 256]; 3]) -> Result<(), String> { - use windows_sys::Win32::Graphics::Gdi::{DeleteDC, ReleaseDC}; - use windows_sys::Win32::UI::ColorSystem::SetDeviceGammaRamp; - - let _guard = GAMMA_RAMP_MUTEX - .lock() - .map_err(|_| "无法获取 Gamma Ramp 锁".to_string())?; - - // Strategy 1: Try per-display DC - let (hdc, use_release) = get_display_dc(display_index)?; - - unsafe { - let result = SetDeviceGammaRamp(hdc, ramp.as_ptr() as *const _); - let dc_is_per_display = !use_release; - - if use_release { - ReleaseDC(std::ptr::null_mut(), hdc); - } else { - DeleteDC(hdc); - } - - if result != 0 { - log::info!( - "set_gamma_ramp_for_display[{}]: Strategy1 逐显示器 SetDeviceGammaRamp 成功 (dc_is_per_display={})", - display_index, dc_is_per_display - ); - return Ok(()); - } - - // If per-display DC failed but we used desktop DC, no more retries - if !dc_is_per_display { - log::error!( - "set_gamma_ramp_for_display[{}]: SetDeviceGammaRamp 失败(桌面DC回退,跳过Strategy2)! display_index={}", - "可能是显卡驱动不支持", - display_index - ); - return Err("您的设置太逆天啦,你的显卡可能不支持喔~".to_string()); - } - - log::warn!( - "set_gamma_ramp_for_display[{}]: 逐显示器 DC 创建成功但 SetDeviceGammaRamp 失败,进入 Strategy2 桌面 DC 回退", - display_index - ); - } - - // Strategy 2: Per-display SetDeviceGammaRamp failed → retry with desktop-wide DC - // This is critical for laptops with NVIDIA Optimus / AMD switchable graphics - // where per-display SetDeviceGammaRamp may fail but desktop-wide works - unsafe { - let hdc = windows_sys::Win32::Graphics::Gdi::GetDC(std::ptr::null_mut()); - if hdc.is_null() { - return Err("无法获取桌面设备上下文".to_string()); - } - - let result = SetDeviceGammaRamp(hdc, ramp.as_ptr() as *const _); - windows_sys::Win32::Graphics::Gdi::ReleaseDC(std::ptr::null_mut(), hdc); - - if result == 0 { - log::error!( - "set_gamma_ramp_for_display[{}]: Strategy2 桌面 DC 回退也失败!显卡/驱动可能不支持 Gamma Ramp", - display_index - ); - return Err("您的设置太逆天啦,你的显卡可能不支持喔~".to_string()); - } - - log::info!( - "set_gamma_ramp_for_display[{}]: Strategy2 桌面 DC 回退成功 (适用于 Optimus/混合模式)", - display_index - ); - Ok(()) - } -} - -#[cfg(target_os = "windows")] -fn get_current_gamma_ramp_for_display( - display_index: usize, -) -> Result<[[u16; 256]; 3], String> { - use windows_sys::Win32::Graphics::Gdi::{DeleteDC, ReleaseDC}; - use windows_sys::Win32::UI::ColorSystem::GetDeviceGammaRamp; - - let mut ramp = [[0u16; 256]; 3]; - - // Strategy 1: Try per-display DC - let (hdc, use_release) = get_display_dc(display_index)?; - - unsafe { - let result = GetDeviceGammaRamp(hdc, ramp.as_mut_ptr() as *mut _); - - if use_release { - ReleaseDC(std::ptr::null_mut(), hdc); - } else { - DeleteDC(hdc); - } - - if result != 0 { - return Ok(ramp); - } - } - - // Strategy 2: Per-display failed → retry with desktop-wide DC - log::warn!( - "get_current_gamma_ramp_for_display[{}]: 逐显示器 GetDeviceGammaRamp 失败,尝试桌面 DC 回退", - display_index - ); - - unsafe { - let hdc = windows_sys::Win32::Graphics::Gdi::GetDC(std::ptr::null_mut()); - if hdc.is_null() { - return Err("无法获取桌面设备上下文".to_string()); - } - - let result = GetDeviceGammaRamp(hdc, ramp.as_mut_ptr() as *mut _); - windows_sys::Win32::Graphics::Gdi::ReleaseDC(std::ptr::null_mut(), hdc); - - if result == 0 { - log::error!( - "get_current_gamma_ramp_for_display[{}]: 桌面 DC 回退也失败", - display_index - ); - return Err("读取 Gamma Ramp 失败".to_string()); - } - - log::info!( - "get_current_gamma_ramp_for_display[{}]: 桌面 DC 回退成功", - display_index - ); - Ok(ramp) - } -} - -#[cfg(not(target_os = "windows"))] -fn set_gamma_ramp_for_display(_display_index: usize, _ramp: &[[u16; 256]; 3]) -> Result<(), String> { - Err("此功能仅支持 Windows 系统".to_string()) -} - -#[cfg(not(target_os = "windows"))] -fn get_current_gamma_ramp_for_display(_display_index: usize) -> Result<[[u16; 256]; 3], String> { - Err("此功能仅支持 Windows 系统".to_string()) -} - -// ─── Filter application ─── - -fn apply_filter_internal_for_display(display_index: usize) -> Result<(), String> { - let (icc_active, temperature, brightness, contrast, saturation, r_gamma, g_gamma, b_gamma, mode, icc_ramp_opt) = - with_display_state(display_index, |state| { - ( - state.icc_active, - state.temperature, - state.brightness, - state.contrast, - state.saturation, - state.r_gamma, - state.g_gamma, - state.b_gamma, - state.mode, - state.icc_ramp, - ) - }); - - if icc_active { - if let Some(ref ramp) = icc_ramp_opt { - log::info!("Monitor[{}]: applying ICC ramp", display_index); - return set_gamma_ramp_for_display(display_index, ramp); - } - } - - let mode_enum = FilterMode::from_i32(mode); - let custom_gamma = Some((r_gamma, g_gamma, b_gamma)); - let ramp = build_gamma_ramp(temperature, brightness, contrast, saturation, mode_enum, custom_gamma); - log::info!("Monitor[{}]: applying regular filter ramp", display_index); - set_gamma_ramp_for_display(display_index, &ramp) -} - -fn restore_original_gamma_for_display(display_index: usize) -> Result<(), String> { - let original = - with_display_state(display_index, |state| state.original_gamma); - - if let Some(ref ramp) = original { - set_gamma_ramp_for_display(display_index, ramp)?; - } else { - let identity_ramp = build_gamma_ramp(6500, 100, 100, 100, FilterMode::Normal, None); - set_gamma_ramp_for_display(display_index, &identity_ramp)?; - } - - Ok(()) -} - -fn start_filter_monitor() { - if FILTER_THREAD_RUNNING.swap(true, Ordering::SeqCst) { - return; - } - - thread::spawn(|| { - // Initialize a Windows message queue for this thread. - // SetDeviceGammaRamp / GDI display operations require the calling - // thread to have a message pump, otherwise they fail silently on - // modern GPU drivers (especially Optimus / switchable graphics). - #[cfg(target_os = "windows")] - { - use windows_sys::Win32::UI::WindowsAndMessaging::PeekMessageW; - unsafe { - let mut msg = std::mem::zeroed(); - PeekMessageW(&mut msg, std::ptr::null_mut(), 0, 0, 0); // PM_NOREMOVE = 0 - } - } - - loop { - // Collect active display indices (release all locks before applying) - let active_indices: Vec = { - ensure_display_states(); - let lock = DISPLAY_STATES.lock().unwrap(); - let states = lock.as_ref().unwrap(); - states - .iter() - .enumerate() - .filter_map(|(i, state_mutex)| { - let state = state_mutex.lock().unwrap(); - if state.filter_active { - Some(i) - } else { - None - } - }) - .collect() - }; - - if active_indices.is_empty() { - break; - } - - for i in &active_indices { - if let Err(e) = apply_filter_internal_for_display(*i) { - log::error!("应用滤镜到显示器 {} 失败: {}", i, e); - } - } - - thread::sleep(Duration::from_millis(1000)); - } - - FILTER_THREAD_RUNNING.store(false, Ordering::SeqCst); - }); -} - -// ─── Tauri commands ─── - -#[tauri::command] -pub async fn get_filter_settings(display_index: Option) -> Result { - let idx = resolve_display_index(display_index); - Ok(with_display_state(idx, |state| FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: state.filter_active, - })) -} - -#[tauri::command] -pub async fn set_filter_settings( - display_index: Option, - temperature: i32, - brightness: i32, - contrast: i32, - saturation: i32, - mode: i32, - is_active: bool, - r_gamma: Option, - g_gamma: Option, - b_gamma: Option, -) -> Result { - #[cfg(target_os = "windows")] - { - let idx = resolve_display_index(display_index); - let temperature = temperature.clamp(1000, 10000); - let brightness = brightness.clamp(50, 150); - let contrast = contrast.clamp(50, 150); - let saturation = saturation.clamp(50, 150); - let mode = mode.clamp(0, 8); - let r_gamma = r_gamma.unwrap_or(1.0).clamp(0.50, 2.00); - let g_gamma = g_gamma.unwrap_or(1.0).clamp(0.50, 2.00); - let b_gamma = b_gamma.unwrap_or(1.0).clamp(0.50, 2.00); - - with_display_state(idx, |state| { - state.temperature = temperature; - state.brightness = brightness; - state.contrast = contrast; - state.saturation = saturation; - state.r_gamma = r_gamma; - state.g_gamma = g_gamma; - state.b_gamma = b_gamma; - state.mode = mode; - state.icc_active = false; - - // Only activate if is_active is true and filter is not already active - if is_active && !state.filter_active { - if state.original_gamma.is_none() { - if let Ok(ramp) = get_current_gamma_ramp_for_display(idx) { - state.original_gamma = Some(ramp); - } - } - state.filter_active = true; - } - }); - - // Only apply filter to hardware if it's actually active - let actually_active = with_display_state(idx, |s| s.filter_active); - if actually_active { - apply_filter_internal_for_display(idx)?; - start_filter_monitor(); - } - - Ok(FilterResult { - success: true, - message: "滤镜设置已更新".to_string(), - settings: Some(FilterSettings { - temperature, - brightness, - contrast, - saturation, - r_gamma, - g_gamma, - b_gamma, - mode, - is_active: actually_active, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - }) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn enable_filter(display_index: Option) -> Result { - #[cfg(target_os = "windows")] - { - let idx = resolve_display_index(display_index); - - let already_active = with_display_state(idx, |state| { - if state.filter_active { - true - } else { - if state.original_gamma.is_none() { - if let Ok(ramp) = get_current_gamma_ramp_for_display(idx) { - state.original_gamma = Some(ramp); - } - } - state.filter_active = true; - false - } - }); - - if already_active { - return Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已处于启用状态".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: true, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })); - } - - apply_filter_internal_for_display(idx)?; - start_filter_monitor(); - - Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已启用".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: true, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn disable_filter(display_index: Option) -> Result { - #[cfg(target_os = "windows")] - { - let idx = resolve_display_index(display_index); - - let was_active = with_display_state(idx, |state| { - if !state.filter_active { - false - } else { - state.filter_active = false; - state.icc_active = false; - true - } - }); - - if !was_active { - return Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已处于禁用状态".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: false, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })); - } - - if let Err(e) = restore_original_gamma_for_display(idx) { - log::error!("恢复原始 Gamma 失败: {}", e); - } - - with_display_state(idx, |state| { - state.original_gamma = None; - }); - - Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已禁用".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: false, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn toggle_filter(display_index: Option) -> Result { - let idx = resolve_display_index(display_index); - let is_active = with_display_state(idx, |state| state.filter_active); - if is_active { - disable_filter(display_index).await - } else { - enable_filter(display_index).await - } -} - -/// Toggle filter on/off. Used by global hotkey. -pub fn toggle_filter_sync(app_handle: &tauri::AppHandle) -> Result { - #[cfg(target_os = "windows")] - { - let idx = get_active_index(); - let is_active = with_display_state(idx, |state| state.filter_active); - let result = if is_active { - disable_filter_sync() - } else { - enable_filter_sync() - }; - - if result.is_ok() { - let _ = app_handle.emit("filter-status-changed", ()); - } - - result - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[cfg(target_os = "windows")] -fn enable_filter_sync() -> Result { - let idx = get_active_index(); - - let already_active = with_display_state(idx, |state| { - if state.filter_active { - true - } else { - if state.original_gamma.is_none() { - if let Ok(ramp) = get_current_gamma_ramp_for_display(idx) { - state.original_gamma = Some(ramp); - } - } - state.filter_active = true; - false - } - }); - - if already_active { - return Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已处于启用状态".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: true, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })); - } - - apply_filter_internal_for_display(idx)?; - start_filter_monitor(); - - Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已启用".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: true, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })) -} - -#[cfg(target_os = "windows")] -fn disable_filter_sync() -> Result { - let idx = get_active_index(); - - let was_active = with_display_state(idx, |state| { - if !state.filter_active { - false - } else { - state.filter_active = false; - state.icc_active = false; - true - } - }); - - if !was_active { - return Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已处于禁用状态".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: false, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })); - } - - if let Err(e) = restore_original_gamma_for_display(idx) { - log::error!("恢复原始 Gamma 失败: {}", e); - } - - Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: "滤镜已禁用".to_string(), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: false, - }), - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - })) -} - -#[tauri::command] -pub async fn get_filter_presets() -> Result, String> { - Ok(vec![ - FilterPreset { - id: "normal".to_string(), - name: "标准".to_string(), - mode: 0, - temperature: 6500, - brightness: 100, - contrast: 100, - saturation: 100, - description: "默认显示效果".to_string(), - }, - FilterPreset { - id: "vivid".to_string(), - name: "鲜艳".to_string(), - mode: 1, - temperature: 6800, - brightness: 102, - contrast: 105, - saturation: 115, - description: "增强色彩饱和度,画面更鲜艳".to_string(), - }, - FilterPreset { - id: "movie".to_string(), - name: "电影".to_string(), - mode: 2, - temperature: 5800, - brightness: 98, - contrast: 95, - saturation: 95, - description: "电影质感,柔和色调".to_string(), - }, - FilterPreset { - id: "highlight".to_string(), - name: "高亮".to_string(), - mode: 3, - temperature: 7200, - brightness: 110, - contrast: 102, - saturation: 100, - description: "提高亮度,适合暗光环境".to_string(), - }, - FilterPreset { - id: "soft".to_string(), - name: "柔和".to_string(), - mode: 4, - temperature: 5200, - brightness: 98, - contrast: 92, - saturation: 95, - description: "柔和画面,减少眼睛疲劳".to_string(), - }, - FilterPreset { - id: "gaming".to_string(), - name: "游戏".to_string(), - mode: 5, - temperature: 6800, - brightness: 103, - contrast: 108, - saturation: 110, - description: "增强对比度和色彩,适合游戏".to_string(), - }, - FilterPreset { - id: "reading".to_string(), - name: "阅读".to_string(), - mode: 6, - temperature: 4800, - brightness: 95, - contrast: 100, - saturation: 92, - description: "暖色调,保护眼睛".to_string(), - }, - FilterPreset { - id: "de-exposure".to_string(), - name: "去曝光".to_string(), - mode: 7, - temperature: 6500, - brightness: 92, - contrast: 103, - saturation: 98, - description: "压暗高光,降低过度曝光,恢复高光细节".to_string(), - }, - FilterPreset { - id: "shadow-boost".to_string(), - name: "暗部增强".to_string(), - mode: 8, - temperature: 6500, - brightness: 106, - contrast: 94, - saturation: 104, - description: "提亮暗部阴影,让黑暗角落的敌人无处遁形".to_string(), - }, - ]) -} - -#[tauri::command] -pub async fn apply_preset( - display_index: Option, - preset_id: String, - is_active: bool, -) -> Result { - let presets = get_filter_presets().await?; - - if let Some(preset) = presets.iter().find(|p| p.id == preset_id) { - set_filter_settings( - display_index, - preset.temperature, - preset.brightness, - preset.contrast, - preset.saturation, - preset.mode, - is_active, - None, - None, - None, - ) - .await - } else { - Err(format!("未找到预设: {}", preset_id)) - } -} - -pub fn cleanup() { - #[cfg(target_os = "windows")] - { - ensure_display_states(); - let num_displays = { - let lock = DISPLAY_STATES.lock().unwrap(); - let states = lock.as_ref().unwrap(); - for state_mutex in states.iter() { - let mut state = state_mutex.lock().unwrap(); - state.filter_active = false; - state.icc_active = false; - } - states.len() - }; - // 在 DISPLAY_STATES 锁释放后逐个恢复 Gamma, - // 避免 restore_original_gamma_for_display → with_display_state - // → ensure_display_states → DISPLAY_STATES.lock() 的重入死锁 - for i in 0..num_displays { - let _ = restore_original_gamma_for_display(i); - } - } -} - -// ─── Custom filter settings commands ─── - -#[tauri::command] -pub async fn get_custom_filter_settings( - display_index: Option, -) -> Result { - let idx = resolve_display_index(display_index); - let all_settings = get_or_load_custom_settings(); - Ok(all_settings.get(&idx).cloned().unwrap_or_default()) -} - -#[tauri::command] -pub async fn save_custom_filter_settings( - display_index: Option, - temperature: i32, - brightness: i32, - contrast: i32, - saturation: i32, - r_gamma: Option, - g_gamma: Option, - b_gamma: Option, -) -> Result { - let idx = resolve_display_index(display_index); - let settings = CustomFilterSettings { - temperature: temperature.clamp(1000, 10000), - brightness: brightness.clamp(50, 150), - contrast: contrast.clamp(50, 150), - saturation: saturation.clamp(50, 150), - r_gamma: r_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - g_gamma: g_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - b_gamma: b_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - }; - - let mut all_settings = get_or_load_custom_settings(); - all_settings.insert(idx, settings.clone()); - - save_custom_settings_to_file(&all_settings)?; - - let mut settings_lock = CUSTOM_SETTINGS.lock().unwrap(); - *settings_lock = Some(all_settings); - - Ok(settings) -} - -#[tauri::command] -pub async fn export_custom_filter(display_index: Option) -> Result, String> { - #[cfg(target_os = "windows")] - { - let idx = resolve_display_index(display_index); - let all_settings = get_or_load_custom_settings(); - let settings = all_settings.get(&idx).cloned().unwrap_or_default(); - - // Build gamma ramp from custom settings (mode = Normal) - let ramp = build_gamma_ramp( - settings.temperature, - settings.brightness, - settings.contrast, - settings.saturation, - FilterMode::Normal, - Some((settings.r_gamma, settings.g_gamma, settings.b_gamma)), - ); - - let default_name = "NexBox_Custom.icc"; - let result = rfd::FileDialog::new() - .set_title("导出自定义滤镜为 ICC") - .add_filter("ICC 文件", &["icc", "icm"]) - .set_file_name(default_name) - .save_file(); - - let path = match result { - Some(p) => p, - None => return Ok(None), - }; - - let icc_data = build_icc_profile(&ramp, "NexBox Custom Filter"); - fs::write(&path, &icc_data).map_err(|e| format!("无法保存文件: {}", e))?; - - log::info!("Custom ICC exported: {} ({} bytes)", path.display(), icc_data.len()); - Ok(Some(path.to_string_lossy().to_string())) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -// ─── User Filter Presets (named, shareable) ─── - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct UserFilterPreset { - pub id: String, - pub name: String, - pub temperature: i32, - pub brightness: i32, - pub contrast: i32, - pub saturation: i32, - #[serde(default = "default_one_f64")] - pub r_gamma: f64, - #[serde(default = "default_one_f64")] - pub g_gamma: f64, - #[serde(default = "default_one_f64")] - pub b_gamma: f64, -} - -#[derive(serde::Serialize, Clone)] -pub struct UserFilterPresetInfo { - pub id: String, - pub name: String, - pub temperature: i32, - pub brightness: i32, - pub contrast: i32, - pub saturation: i32, - pub r_gamma: f64, - pub g_gamma: f64, - pub b_gamma: f64, -} - -static USER_FILTER_PRESETS: Mutex>> = Mutex::new(None); - -fn get_user_filter_presets_file_path() -> PathBuf { - let config_dir = dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")); - config_dir.join("NexBox").join("user-filter-presets.json") -} - -fn load_user_filter_presets_from_file() -> Vec { - let path = get_user_filter_presets_file_path(); - if path.exists() { - match fs::read_to_string(&path) { - Ok(content) => match serde_json::from_str::>(&content) { - Ok(presets) => return presets, - Err(e) => log::error!("解析用户滤镜预设文件失败: {}", e), - }, - Err(e) => log::error!("读取用户滤镜预设文件失败: {}", e), - } - } - Vec::new() -} - -fn save_user_filter_presets_to_file(presets: &[UserFilterPreset]) -> Result<(), String> { - let path = get_user_filter_presets_file_path(); - if let Some(parent) = path.parent() { - if !parent.exists() { - fs::create_dir_all(parent).map_err(|e| format!("无法创建目录: {}", e))?; - } - } - let json_str = - serde_json::to_string_pretty(presets).map_err(|e| format!("序列化失败: {}", e))?; - fs::write(&path, json_str).map_err(|e| format!("无法保存: {}", e))?; - Ok(()) -} - -fn get_or_load_user_filter_presets() -> Vec { - let mut lock = USER_FILTER_PRESETS.lock().unwrap(); - if lock.is_none() { - let presets = load_user_filter_presets_from_file(); - *lock = Some(presets.clone()); - presets - } else { - lock.as_ref().unwrap().clone() - } -} - -#[tauri::command] -pub async fn get_user_filter_presets() -> Result, String> { - let presets = get_or_load_user_filter_presets(); - Ok(presets - .iter() - .map(|p| UserFilterPresetInfo { - id: p.id.clone(), - name: p.name.clone(), - temperature: p.temperature, - brightness: p.brightness, - contrast: p.contrast, - saturation: p.saturation, - r_gamma: p.r_gamma, - g_gamma: p.g_gamma, - b_gamma: p.b_gamma, - }) - .collect()) -} - -#[tauri::command] -pub async fn save_user_filter_preset( - id: Option, - name: String, - temperature: i32, - brightness: i32, - contrast: i32, - saturation: i32, - r_gamma: Option, - g_gamma: Option, - b_gamma: Option, -) -> Result { - let new_preset = UserFilterPreset { - id: id.clone().unwrap_or_else(|| uuid::Uuid::new_v4().to_string()), - name, - temperature: temperature.clamp(1000, 10000), - brightness: brightness.clamp(50, 150), - contrast: contrast.clamp(50, 150), - saturation: saturation.clamp(50, 150), - r_gamma: r_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - g_gamma: g_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - b_gamma: b_gamma.unwrap_or(1.0).clamp(0.50, 2.00), - }; - - let mut lock = USER_FILTER_PRESETS.lock().unwrap(); - let mut presets = if lock.is_some() { - lock.take().unwrap() - } else { - load_user_filter_presets_from_file() - }; - - if id.is_some() { - // Update existing - if let Some(existing) = presets.iter_mut().find(|p| p.id == new_preset.id) { - *existing = new_preset.clone(); - } else { - presets.push(new_preset.clone()); - } - } else { - presets.push(new_preset.clone()); - } - - save_user_filter_presets_to_file(&presets)?; - *lock = Some(presets); - - Ok(UserFilterPresetInfo { - id: new_preset.id, - name: new_preset.name, - temperature: new_preset.temperature, - brightness: new_preset.brightness, - contrast: new_preset.contrast, - saturation: new_preset.saturation, - r_gamma: new_preset.r_gamma, - g_gamma: new_preset.g_gamma, - b_gamma: new_preset.b_gamma, - }) -} - -#[tauri::command] -pub async fn apply_user_filter_preset( - display_index: Option, - id: String, - is_active: bool, -) -> Result { - let presets = get_or_load_user_filter_presets(); - let preset = presets - .iter() - .find(|p| p.id == id) - .ok_or("未找到自定义滤镜预设".to_string())?; - - // Forward to set_filter_settings with gamma values - set_filter_settings( - display_index, - preset.temperature, - preset.brightness, - preset.contrast, - preset.saturation, - 0, // mode = Normal (custom) - is_active, - Some(preset.r_gamma), - Some(preset.g_gamma), - Some(preset.b_gamma), - ) - .await -} - -#[tauri::command] -pub async fn delete_user_filter_preset(id: String) -> Result<(), String> { - let mut lock = USER_FILTER_PRESETS.lock().unwrap(); - let mut presets = if lock.is_some() { - lock.take().unwrap() - } else { - load_user_filter_presets_from_file() - }; - - let len_before = presets.len(); - presets.retain(|p| p.id != id); - - if presets.len() == len_before { - *lock = Some(presets); - return Err("未找到要删除的自定义滤镜预设".to_string()); - } - - save_user_filter_presets_to_file(&presets)?; - *lock = Some(presets); - - Ok(()) -} - -// ─── ICC Profile Support ─── - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct IccPreset { - pub id: String, - pub name: String, - pub ramp: Vec>, - pub description: String, -} - -impl IccPreset { - fn to_ramp_array(&self) -> [[u16; 256]; 3] { - let mut ramp = [[0u16; 256]; 3]; - for c in 0..3 { - for i in 0..256 { - ramp[c][i] = self.ramp[c][i]; - } - } - ramp - } -} - -#[derive(serde::Serialize, Clone)] -pub struct IccPresetInfo { - pub id: String, - pub name: String, - pub description: String, -} - -#[derive(serde::Serialize)] -pub struct IccImportResult { - pub success: bool, - pub message: String, - pub preset: Option, -} - -static ICC_PRESETS: Mutex>> = Mutex::new(None); - -fn get_icc_file_path() -> PathBuf { - let config_dir = dirs::config_dir().unwrap_or_else(|| PathBuf::from(".")); - config_dir.join("NexBox").join("icc_presets.json") -} - -fn load_icc_presets_from_file() -> Vec { - let path = get_icc_file_path(); - if path.exists() { - match fs::read_to_string(&path) { - Ok(content) => match serde_json::from_str::>(&content) { - Ok(presets) => return presets, - Err(e) => log::error!("解析 ICC 预设文件失败: {}", e), - }, - Err(e) => log::error!("读取 ICC 预设文件失败: {}", e), - } - } - Vec::new() -} - -fn save_icc_presets_to_file(presets: &[IccPreset]) -> Result<(), String> { - let path = get_icc_file_path(); - if let Some(parent) = path.parent() { - if !parent.exists() { - fs::create_dir_all(parent).map_err(|e| format!("无法创建目录: {}", e))?; - } - } - let json_str = - serde_json::to_string_pretty(presets).map_err(|e| format!("序列化失败: {}", e))?; - fs::write(&path, json_str).map_err(|e| format!("无法保存: {}", e))?; - Ok(()) -} - -fn get_or_load_icc_presets() -> Vec { - let mut lock = ICC_PRESETS.lock().unwrap(); - if lock.is_none() { - let presets = load_icc_presets_from_file(); - *lock = Some(presets.clone()); - presets - } else { - lock.as_ref().unwrap().clone() - } -} - -fn read_u32_be(data: &[u8], offset: usize) -> u32 { - u32::from_be_bytes([ - data[offset], - data[offset + 1], - data[offset + 2], - data[offset + 3], - ]) -} - -fn read_u16_be(data: &[u8], offset: usize) -> u16 { - u16::from_be_bytes([data[offset], data[offset + 1]]) -} - -/// Parse an ICC profile file and extract TRC curves as a gamma ramp. -fn parse_icc_file(file_path: &str) -> Result { - let mut file = fs::File::open(file_path).map_err(|e| format!("无法打开文件: {}", e))?; - let mut data = Vec::new(); - file.read_to_end(&mut data) - .map_err(|e| format!("无法读取文件: {}", e))?; - - if data.len() < 132 { - return Err("文件太小,不是有效的 ICC 文件".to_string()); - } - - // Verify ICC magic number at offset 36 (acsp) - let magic = &data[36..40]; - if magic != b"acsp" { - return Err("不是有效的 ICC 文件(magic number 不正确)".to_string()); - } - - let profile_size = read_u32_be(&data, 0) as usize; - if data.len() < profile_size { - return Err("ICC 文件大小不匹配".to_string()); - } - - // Tag table starts at offset 128 - let tag_count = read_u32_be(&data, 128) as usize; - if data.len() < 132 + tag_count * 12 { - return Err("ICC 标签表损坏".to_string()); - } - - // Find vcgt, rTRC, gTRC, bTRC tag offsets - let mut vcgt_offset: Option = None; - let mut r_trc_offset: Option = None; - let mut g_trc_offset: Option = None; - let mut b_trc_offset: Option = None; - - for i in 0..tag_count { - let tag_start = 132 + i * 12; - let tag_sig = &data[tag_start..tag_start + 4]; - let tag_offset = read_u32_be(&data, tag_start + 4); - let _tag_size = read_u32_be(&data, tag_start + 8); - - match tag_sig { - b"vcgt" => vcgt_offset = Some(tag_offset), - b"rTRC" => r_trc_offset = Some(tag_offset), - b"gTRC" => g_trc_offset = Some(tag_offset), - b"bTRC" => b_trc_offset = Some(tag_offset), - _ => {} - } - } - - // If we don't have RGB TRCs, try kTRC (grayscale) - if r_trc_offset.is_none() { - for i in 0..tag_count { - let tag_start = 132 + i * 12; - let tag_sig = &data[tag_start..tag_start + 4]; - if tag_sig == b"kTRC" { - let offset = read_u32_be(&data, tag_start + 4); - r_trc_offset = Some(offset); - g_trc_offset = Some(offset); - b_trc_offset = Some(offset); - break; - } - } - } - - fn read_s15fixed16(data: &[u8], offset: usize) -> f64 { - let raw = i32::from_be_bytes([ - data[offset], - data[offset + 1], - data[offset + 2], - data[offset + 3], - ]); - raw as f64 / 65536.0 - } - - let parse_curve = |offset: u32| -> Result<[u16; 256], String> { - let off = offset as usize; - if off + 12 > data.len() { - return Err("曲线数据偏移超出文件范围".to_string()); - } - let curve_type = &data[off..off + 4]; - - let mut ramp = [0u16; 256]; - - if curve_type == b"curv" { - let count = read_u32_be(&data, off + 8) as usize; - if off + 12 + count * 2 > data.len() { - return Err("曲线数据长度超出文件范围".to_string()); - } - if count == 0 { - for i in 0..256 { - ramp[i] = (i * 257) as u16; - } - } else if count == 1 { - let gamma = read_u16_be(&data, off + 12) as f64 / 256.0; - for i in 0..256 { - let input = i as f64 / 255.0; - let output = input.powf(gamma) * 65535.0; - ramp[i] = output.clamp(0.0, 65535.0) as u16; - } - } else { - for i in 0..256 { - let src_idx = (i as f64 / 255.0 * (count - 1) as f64) as usize; - let frac = (i as f64 / 255.0 * (count - 1) as f64) - src_idx as f64; - let v0 = read_u16_be(&data, off + 12 + src_idx * 2); - let v1 = if src_idx + 1 < count { - read_u16_be(&data, off + 12 + (src_idx + 1) * 2) - } else { - v0 - }; - ramp[i] = - ((v0 as f64 + (v1 as f64 - v0 as f64) * frac) as u16).min(65535); - } - } - } else if curve_type == b"para" { - if off + 16 > data.len() { - return Err("参数化曲线数据不完整".to_string()); - } - let func_type = read_u16_be(&data, off + 8); - let params_offset = off + 12; - - for i in 0..256 { - let x = i as f64 / 255.0; - let y = match func_type { - // ICC v4 spec formulas (Annex A, Table 45) - // Type 0: Y = X^g (1 param) - 0 => { - let g = read_s15fixed16(&data, params_offset); - x.powf(g) - } - // Type 1: Y = (aX + b)^g (3 params) - 1 => { - let g = read_s15fixed16(&data, params_offset); - let a = read_s15fixed16(&data, params_offset + 4); - let b = read_s15fixed16(&data, params_offset + 8); - let threshold = if a.abs() > 1e-10 { -b / a } else { 0.0 }; - if x >= threshold { - (a * x + b).max(0.0).powf(g) - } else { - 0.0 - } - } - // Type 2: Y = (aX + b)^g + c (4 params) - 2 => { - let g = read_s15fixed16(&data, params_offset); - let a = read_s15fixed16(&data, params_offset + 4); - let b = read_s15fixed16(&data, params_offset + 8); - let c = read_s15fixed16(&data, params_offset + 12); - let threshold = if a.abs() > 1e-10 { -b / a } else { 0.0 }; - if x >= threshold { - (a * x + b).max(0.0).powf(g) + c - } else { - c - } - } - // Type 3: Y = (aX + b)^g + c, X >= d; Y = cX, X < d (5 params) - // Note: c is used for BOTH the offset and the linear slope! - 3 => { - let g = read_s15fixed16(&data, params_offset); - let a = read_s15fixed16(&data, params_offset + 4); - let b = read_s15fixed16(&data, params_offset + 8); - let c = read_s15fixed16(&data, params_offset + 12); - let d = read_s15fixed16(&data, params_offset + 16); - if x >= d { - (a * x + b).max(0.0).powf(g) + c - } else { - c * x - } - } - // Type 4: Y = (aX + b)^g + e, X >= d; Y = cX + f, X < d (7 params) - 4 => { - let g = read_s15fixed16(&data, params_offset); - let a = read_s15fixed16(&data, params_offset + 4); - let b = read_s15fixed16(&data, params_offset + 8); - let c = read_s15fixed16(&data, params_offset + 12); - let d = read_s15fixed16(&data, params_offset + 16); - let e = read_s15fixed16(&data, params_offset + 20); - let f = read_s15fixed16(&data, params_offset + 24); - if x >= d { - (a * x + b).max(0.0).powf(g) + e - } else { - c * x + f - } - } - _ => { - return Err(format!( - "不支持的参数化曲线函数类型: {}", - func_type - )) - } - }; - let output = y.clamp(0.0, 1.0) * 65535.0; - ramp[i] = output.clamp(0.0, 65535.0) as u16; - } - } else { - return Err(format!( - "不支持的曲线类型: {:?}(仅支持 'curv' 和 'para')", - std::str::from_utf8(curve_type).unwrap_or("?") - )); - } - Ok(ramp) - }; - - // Parse vcgt tag if available (preferred over TRC for SetDeviceGammaRamp) - let parse_vcgt = |offset: u32| -> Result<[[u16; 256]; 3], String> { - let off = offset as usize; - if off + 18 > data.len() { - return Err("vcgt 数据不完整".to_string()); - } - let formula_type = read_u32_be(&data, off + 8); - if formula_type != 0 { - return Err(format!( - "不支持的 vcgt 公式类型: {}(仅支持类型 0 表格)", - formula_type - )); - } - let channels = read_u16_be(&data, off + 12) as usize; - let entries = read_u16_be(&data, off + 14) as usize; - let entry_size = read_u16_be(&data, off + 16) as usize; - - if channels != 3 || entries != 256 || entry_size != 2 { - return Err(format!( - "不支持的 vcgt 格式: channels={}, entries={}, entry_size={}(需要 3x256x2)", - channels, entries, entry_size - )); - } - - let data_start = off + 18; - let data_end = data_start + channels * entries * entry_size; - if data_end > data.len() { - return Err("vcgt 数据超出文件范围".to_string()); - } - - let mut ramp = [[0u16; 256]; 3]; - // Planar format: R channel first, then G, then B - for ch in 0..3 { - let ch_start = data_start + ch * entries * entry_size; - for i in 0..entries { - let val = read_u16_be(&data, ch_start + i * entry_size); - ramp[ch][i] = val; - } - } - Ok(ramp) - }; - - // Use vcgt if available, otherwise fall back to TRC curves - let mut ramp = if let Some(vcgt_off) = vcgt_offset { - match parse_vcgt(vcgt_off) { - Ok(vcgt_ramp) => { - log::info!("Using vcgt tag for gamma ramp"); - vcgt_ramp - } - Err(e) => { - log::warn!("vcgt 解析失败: {},回退到 TRC 曲线", e); - // Fall through to TRC parsing below - let r_trc_off = - r_trc_offset.ok_or("ICC 文件中未找到 rTRC 曲线".to_string())?; - let g_trc_off = - g_trc_offset.ok_or("ICC 文件中未找到 gTRC 曲线".to_string())?; - let b_trc_off = - b_trc_offset.ok_or("ICC 文件中未找到 bTRC 曲线".to_string())?; - let r_ramp = parse_curve(r_trc_off)?; - let g_ramp = parse_curve(g_trc_off)?; - let b_ramp = parse_curve(b_trc_off)?; - [r_ramp, g_ramp, b_ramp] - } - } - } else { - let r_trc_off = r_trc_offset.ok_or("ICC 文件中未找到 rTRC 曲线".to_string())?; - let g_trc_off = g_trc_offset.ok_or("ICC 文件中未找到 gTRC 曲线".to_string())?; - let b_trc_off = b_trc_offset.ok_or("ICC 文件中未找到 bTRC 曲线".to_string())?; - let r_ramp = parse_curve(r_trc_off)?; - let g_ramp = parse_curve(g_trc_off)?; - let b_ramp = parse_curve(b_trc_off)?; - [r_ramp, g_ramp, b_ramp] - }; - - // Extract file name for display - let name = std::path::Path::new(file_path) - .file_stem() - .and_then(|s| s.to_str()) - .unwrap_or("ICC Profile") - .to_string(); - - let id = uuid::Uuid::new_v4().to_string(); - - // Apply EXACTLY the same post-processing as build_gamma_ramp! - // This matches what the working built-in filters do! - for channel in 0..3 { - for i in 1..256 { - if ramp[channel][i] < ramp[channel][i - 1] { - ramp[channel][i] = ramp[channel][i - 1]; - } - } - } - ramp[0][0] = 0; - ramp[1][0] = 0; - ramp[2][0] = 0; - ramp[0][255] = 65535; - ramp[1][255] = 65535; - ramp[2][255] = 65535; - - log::info!( - "ICC ramp ready: R[0]={}, R[64]={}, R[128]={}, R[192]={}, R[255]={}", - ramp[0][0], - ramp[0][64], - ramp[0][128], - ramp[0][192], - ramp[0][255] - ); - - // Verify ramp is properly scaled to 16-bit - if ramp[0][128] < 1000 { - log::error!( - "ICC ramp values appear to be 8-bit instead of 16-bit! R[128]={} should be ~32000", - ramp[0][128] - ); - } - - Ok(IccPreset { - id, - name, - ramp: vec![ramp[0].to_vec(), ramp[1].to_vec(), ramp[2].to_vec()], - description: format!( - "从 {} 导入", - std::path::Path::new(file_path) - .file_name() - .and_then(|s| s.to_str()) - .unwrap_or("未知") - ), - }) -} - -#[tauri::command] -pub async fn select_icc_file() -> Result, String> { - #[cfg(target_os = "windows")] - { - let result = rfd::FileDialog::new() - .set_title("选择 ICC 色彩配置文件") - .add_filter("ICC 文件", &["icc", "icm"]) - .pick_file(); - - Ok(result.and_then(|p| p.to_str().map(|s| s.to_string()))) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn import_icc_profile(path: String) -> Result { - #[cfg(target_os = "windows")] - { - let preset = parse_icc_file(&path)?; - - let info = IccPresetInfo { - id: preset.id.clone(), - name: preset.name.clone(), - description: preset.description.clone(), - }; - - let mut lock = ICC_PRESETS.lock().unwrap(); - let mut presets = if lock.is_some() { - lock.take().unwrap() - } else { - load_icc_presets_from_file() - }; - presets.push(preset); - save_icc_presets_to_file(&presets)?; - *lock = Some(presets); - - Ok(IccImportResult { - success: true, - message: "ICC 文件已导入".to_string(), - preset: Some(info), - }) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn get_icc_presets() -> Result, String> { - #[cfg(target_os = "windows")] - { - let presets = get_or_load_icc_presets(); - Ok(presets - .iter() - .map(|p| IccPresetInfo { - id: p.id.clone(), - name: p.name.clone(), - description: p.description.clone(), - }) - .collect()) - } - - #[cfg(not(target_os = "windows"))] - { - Ok(Vec::new()) - } -} - -/// 从 ICC ramp 计算近似 CSS filter 预览参数 -fn compute_icc_preview(ramp: &[[u16; 256]; 3]) -> (String, Option, Option) { - let mut ch_brightness = [1.0f64; 3]; - - // 计算每个通道在中间调(32..224)的平均乘数 - for c in 0..3 { - let mut sum = 0.0; - let mut count = 0u32; - for i in 32..224 { - let identity = (i as u32 * 256) as u16; - if identity > 0 { - sum += ramp[c][i as usize] as f64 / identity as f64; - count += 1; - } - } - if count > 0 { - ch_brightness[c] = sum / count as f64; - } - } - - let avg_brightness = (ch_brightness[0] + ch_brightness[1] + ch_brightness[2]) / 3.0; - - // 如果所有通道接近 1.0,返回空(无显著变化) - if (avg_brightness - 1.0).abs() < 0.015 - && (ch_brightness[0] - ch_brightness[1]).abs() < 0.015 - && (ch_brightness[1] - ch_brightness[2]).abs() < 0.015 - { - return (String::new(), None, None); - } - - let mut filters: Vec = Vec::new(); - - // Brightness - if (avg_brightness - 1.0).abs() > 0.01 { - filters.push(format!("brightness({:.3})", avg_brightness.clamp(0.3, 2.5))); - } - - let filter_str = filters.join(" "); - - // 检测颜色偏移(通道间差异) - let drift_r = ch_brightness[0] - avg_brightness; - let drift_g = ch_brightness[1] - avg_brightness; - let drift_b = ch_brightness[2] - avg_brightness; - let max_drift = drift_r.abs().max(drift_g.abs()).max(drift_b.abs()); - - if max_drift > 0.02 { - // 用颜色覆盖层近似通道偏移 - let r = ((0.5 + drift_r * 3.0).clamp(0.0, 1.0) * 255.0) as u8; - let g = ((0.5 + drift_g * 3.0).clamp(0.0, 1.0) * 255.0) as u8; - let b = ((0.5 + drift_b * 3.0).clamp(0.0, 1.0) * 255.0) as u8; - let opacity = (max_drift * 1.5).min(0.4); - (filter_str, Some(format!("#{:02X}{:02X}{:02X}", r, g, b)), Some(opacity)) - } else { - (filter_str, None, None) - } -} - -#[tauri::command] -pub async fn apply_icc_preset( - display_index: Option, - id: String, - is_active: bool, -) -> Result { - #[cfg(target_os = "windows")] - { - let idx = resolve_display_index(display_index); - let presets = get_or_load_icc_presets(); - let preset = presets - .iter() - .find(|p| p.id == id) - .ok_or("未找到 ICC 预设".to_string())?; - - let ramp_array = preset.to_ramp_array(); - - log::info!( - "Applying ICC preset '{}' to monitor[{}]: R[0]={}, R[64]={}, R[128]={}, R[192]={}, R[255]={}", - preset.name, idx, - ramp_array[0][0], ramp_array[0][64], ramp_array[0][128], ramp_array[0][192], ramp_array[0][255] - ); - - // Check if saved ramp values are valid 16-bit - if ramp_array[0][128] < 1000 { - log::error!( - "Saved ICC ramp appears corrupted (8-bit values). Please delete and re-import the ICC file." - ); - } - - with_display_state(idx, |state| { - state.icc_ramp = Some(ramp_array); - // 始终标记 ICC 活跃,无论 is_active 是否开启 - // 这样用户后续手动开启滤镜开关时,enable_filter 会读取 icc_active 并应用 ICC ramp - state.icc_active = true; - - if is_active && !state.filter_active { - if state.original_gamma.is_none() { - if let Ok(ramp) = get_current_gamma_ramp_for_display(idx) { - state.original_gamma = Some(ramp); - } - } - state.filter_active = true; - } - }); - - let actually_active = with_display_state(idx, |s| s.filter_active); - if actually_active { - set_gamma_ramp_for_display(idx, &ramp_array)?; - start_filter_monitor(); - } - - let (preview_filter, preview_tint_color, preview_tint_opacity) = compute_icc_preview(&ramp_array); - - Ok(with_display_state(idx, |state| FilterResult { - success: true, - message: format!("ICC 预设 {} 已应用", preset.name), - settings: Some(FilterSettings { - temperature: state.temperature, - brightness: state.brightness, - contrast: state.contrast, - saturation: state.saturation, - r_gamma: state.r_gamma, - g_gamma: state.g_gamma, - b_gamma: state.b_gamma, - mode: state.mode, - is_active: state.filter_active, - }), - preview_filter: if preview_filter.is_empty() { None } else { Some(preview_filter) }, - preview_tint_color, - preview_tint_opacity, - })) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn delete_icc_preset(id: String) -> Result { - #[cfg(target_os = "windows")] - { - let mut lock = ICC_PRESETS.lock().unwrap(); - let mut presets = if lock.is_some() { - lock.take().unwrap() - } else { - load_icc_presets_from_file() - }; - - let len_before = presets.len(); - presets.retain(|p| p.id != id); - - if presets.len() == len_before { - *lock = Some(presets); - return Err("未找到要删除的 ICC 预设".to_string()); - } - - save_icc_presets_to_file(&presets)?; - *lock = Some(presets); - - Ok(FilterResult { - success: true, - message: "ICC 预设已删除".to_string(), - settings: None, - preview_filter: None, - preview_tint_color: None, - preview_tint_opacity: None, - }) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -// ─── ICC Profile Export ─── - -/// Write a big-endian u32 into a byte vector. -fn push_u32_be(buf: &mut Vec, val: u32) { - buf.extend_from_slice(&val.to_be_bytes()); -} - -/// Write a big-endian u16 into a byte vector. -fn push_u16_be(buf: &mut Vec, val: u16) { - buf.extend_from_slice(&val.to_be_bytes()); -} - -/// Write an s15Fixed16Number (signed 16.16 fixed-point) into a byte vector. -fn push_s15fixed16(buf: &mut Vec, val: f64) { - let raw = (val * 65536.0).round() as i32; - buf.extend_from_slice(&raw.to_be_bytes()); -} - -/// Pad a byte vector to a 4-byte boundary with zero bytes. -fn pad_to_4(buf: &mut Vec) { - while buf.len() % 4 != 0 { - buf.push(0); - } -} - -/// Build a minimal valid ICC v2 display profile containing a vcgt -/// (Video Card Gamma Table) tag with the supplied 3×256 gamma ramp. -/// -/// The profile also includes the required v2 tags (desc, cprt, wtpt, -/// rXYZ/gXYZ/bXYZ, rTRC/gTRC/bTRC) so it is accepted by Windows Color -/// Management and other ICC-aware tools. -fn build_icc_profile(ramp: &[[u16; 256]; 3], description: &str) -> Vec { - // Collect tag data blocks as (tag_signature, data_bytes). - // Each block's data already starts with its type signature + reserved. - let mut blocks: Vec<([u8; 4], Vec)> = Vec::new(); - - // ── desc (profileDescriptionTag) ── - { - let mut d = Vec::new(); - d.extend_from_slice(b"desc"); - d.extend_from_slice(&[0u8; 4]); // reserved - let desc_bytes = description.as_bytes(); - push_u32_be(&mut d, desc_bytes.len() as u32 + 1); // length incl. null - d.extend_from_slice(desc_bytes); - d.push(0); // null terminator - pad_to_4(&mut d); - // Unicode section (empty) - push_u32_be(&mut d, 0); // language code - push_u32_be(&mut d, 0); // count - // ScriptCode section - push_u16_be(&mut d, 2); // code - d.push(0); // string length - d.extend_from_slice(&[0u8; 67]); // string (67 bytes fixed) - blocks.push((*b"desc", d)); - } - - // ── cprt (copyrightTag) ── - { - let mut d = Vec::new(); - d.extend_from_slice(b"text"); - d.extend_from_slice(&[0u8; 4]); - let cprt = b"NexBox Exported ICC Profile\0"; - d.extend_from_slice(cprt); - pad_to_4(&mut d); - blocks.push((*b"cprt", d)); - } - - // ── wtpt (mediaWhitePointTag) – D50 ── - { - let mut d = Vec::new(); - d.extend_from_slice(b"XYZ "); - d.extend_from_slice(&[0u8; 4]); - push_s15fixed16(&mut d, 0.9505); // X - push_s15fixed16(&mut d, 1.0000); // Y - push_s15fixed16(&mut d, 1.0890); // Z - blocks.push((*b"wtpt", d)); - } - - // ── rXYZ / gXYZ / bXYZ – sRGB primaries (D50-adapted) ── - { - let colorants: [([u8; 4], f64, f64, f64); 3] = [ - (*b"rXYZ", 0.4360, 0.2225, 0.0139), - (*b"gXYZ", 0.3851, 0.7169, 0.0971), - (*b"bXYZ", 0.1431, 0.0606, 0.7141), - ]; - for (sig, x, y, z) in colorants { - let mut d = Vec::new(); - d.extend_from_slice(b"XYZ "); - d.extend_from_slice(&[0u8; 4]); - push_s15fixed16(&mut d, x); - push_s15fixed16(&mut d, y); - push_s15fixed16(&mut d, z); - blocks.push((sig, d)); - } - } - - // ── rTRC / gTRC / bTRC – identity curves (curv count=0) ── - // All three share the same data block. - { - let mut d = Vec::new(); - d.extend_from_slice(b"curv"); - d.extend_from_slice(&[0u8; 4]); - push_u32_be(&mut d, 0); // count = 0 → identity - blocks.push((*b"rTRC", d.clone())); - blocks.push((*b"gTRC", d.clone())); - blocks.push((*b"bTRC", d)); - } - - // ── vcgt (Video Card Gamma Table) ── - { - let mut d = Vec::new(); - d.extend_from_slice(b"vcgt"); // type signature - d.extend_from_slice(&[0u8; 4]); // reserved - push_u32_be(&mut d, 0); // formula type = 0 (table) - push_u16_be(&mut d, 3); // channels - push_u16_be(&mut d, 256); // entries per channel - push_u16_be(&mut d, 2); // entry size in bytes (16-bit) - // Planar data: all R values, then all G, then all B. - for ch in 0..3 { - for i in 0..256 { - push_u16_be(&mut d, ramp[ch][i]); - } - } - blocks.push((*b"vcgt", d)); - } - - // ── Assemble header + tag table + data ── - let num_tags = blocks.len(); - let header_size: usize = 128; - let tag_table_size: usize = 4 + num_tags * 12; - let data_start = header_size + tag_table_size; - - // Build concatenated tag data and record per-tag offsets/sizes. - let mut all_data: Vec = Vec::new(); - let mut entries: Vec<([u8; 4], usize, usize)> = Vec::new(); - - for (sig, data) in &blocks { - let offset = data_start + all_data.len(); - let size = data.len(); - entries.push((*sig, offset, size)); - all_data.extend_from_slice(data); - pad_to_4(&mut all_data); - } - - let profile_size = data_start + all_data.len(); - - // Header (128 bytes) - let mut profile = Vec::with_capacity(profile_size); - push_u32_be(&mut profile, profile_size as u32); // 0 profile size - push_u32_be(&mut profile, 0); // 4 CMM type - push_u32_be(&mut profile, 0x0210_0000); // 8 version 2.1.0 - profile.extend_from_slice(b"mntr"); // 12 device class (monitor) - profile.extend_from_slice(b"RGB "); // 16 color space - profile.extend_from_slice(b"XYZ "); // 20 PCS - push_u16_be(&mut profile, 2025); // 24 year - push_u16_be(&mut profile, 1); // 26 month - push_u16_be(&mut profile, 1); // 28 day - push_u16_be(&mut profile, 0); // 30 hour - push_u16_be(&mut profile, 0); // 32 minute - push_u16_be(&mut profile, 0); // 34 second - profile.extend_from_slice(b"acsp"); // 36 file signature - push_u32_be(&mut profile, 0); // 40 primary platform - push_u32_be(&mut profile, 0); // 44 flags - push_u32_be(&mut profile, 0); // 48 manufacturer - push_u32_be(&mut profile, 0); // 52 model - profile.extend_from_slice(&[0u8; 8]); // 56 attributes - push_u32_be(&mut profile, 0); // 64 rendering intent - push_s15fixed16(&mut profile, 0.9642); // 68 PCS illuminant X (D50) - push_s15fixed16(&mut profile, 1.0000); // 72 PCS illuminant Y - push_s15fixed16(&mut profile, 0.8249); // 76 PCS illuminant Z - push_u32_be(&mut profile, 0); // 80 creator - profile.extend_from_slice(&[0u8; 16]); // 84 profile ID - profile.extend_from_slice(&[0u8; 28]); // 100 reserved - assert_eq!(profile.len(), header_size); - - // Tag table - push_u32_be(&mut profile, num_tags as u32); - for (sig, offset, size) in &entries { - profile.extend_from_slice(sig); - push_u32_be(&mut profile, *offset as u32); - push_u32_be(&mut profile, *size as u32); - } - assert_eq!(profile.len(), data_start); - - // Tag data - profile.extend_from_slice(&all_data); - - // Fix profile size (it may differ if last block needed no padding) - let final_size = profile.len() as u32; - profile[0..4].copy_from_slice(&final_size.to_be_bytes()); - - profile -} - -#[tauri::command] -pub async fn export_preset_as_icc(preset_id: String) -> Result, String> { - #[cfg(target_os = "windows")] - { - // Look up preset parameters - let presets = get_filter_presets().await?; - let preset = presets - .iter() - .find(|p| p.id == preset_id) - .ok_or(format!("未找到预设: {}", preset_id))?; - - // Build gamma ramp from preset parameters - let mode = FilterMode::from_i32(preset.mode); - let ramp = build_gamma_ramp( - preset.temperature, - preset.brightness, - preset.contrast, - preset.saturation, - mode, - None, - ); - - // Show save file dialog - let default_name = format!("NexBox_{}.icc", preset.name); - let result = rfd::FileDialog::new() - .set_title("保存 ICC 色彩配置文件") - .add_filter("ICC 文件", &["icc", "icm"]) - .set_file_name(&default_name) - .save_file(); - - let path = match result { - Some(p) => p, - None => return Ok(None), - }; - - // Build ICC profile binary - let description = format!("NexBox {} Filter", preset.name); - let icc_data = build_icc_profile(&ramp, &description); - - // Write to file - fs::write(&path, &icc_data).map_err(|e| format!("无法保存文件: {}", e))?; - - log::info!( - "ICC profile exported: {} ({} bytes) from preset '{}'", - path.display(), - icc_data.len(), - preset.name - ); - - Ok(path.to_str().map(|s| s.to_string())) - } - - #[cfg(not(target_os = "windows"))] - { - Err("此功能仅支持 Windows 系统".to_string()) - } -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/src/downloader.rs b/参考/NexBox-main/src-tauri/src/downloader.rs deleted file mode 100644 index e870502..0000000 --- a/参考/NexBox-main/src-tauri/src/downloader.rs +++ /dev/null @@ -1,149 +0,0 @@ -use std::fs; -use std::fs::File; -use std::io::Write; -use std::process::Command; -use std::os::windows::process::CommandExt; - -use futures_util::StreamExt; -use reqwest::Client; -use tauri::{Window, Emitter, AppHandle}; - -#[derive(Clone, serde::Serialize)] -struct DownloadProgress { - progress: u64, - total: u64, -} - -#[tauri::command] -pub async fn download_file( - url: String, - file_name: String, - window: Window, -) -> Result { - let client = Client::new(); - let response = client.get(&url).send().await.map_err(|e| e.to_string())?; - - let total_size = response.content_length().unwrap_or(0); - - let download_path = match dirs::download_dir() { - Some(mut path) => { - path.push(file_name); - path - } - None => { - let mut path = std::env::current_dir().map_err(|e| e.to_string())?; - path.push(file_name); - path - } - }; - - let mut file = File::create(&download_path).map_err(|e| e.to_string())?; - - let mut stream = response.bytes_stream(); - let mut downloaded: u64 = 0; - - while let Some(chunk) = stream.next().await { - let chunk = chunk.map_err(|e| e.to_string())?; - file.write_all(&chunk).map_err(|e| e.to_string())?; - downloaded += chunk.len() as u64; - - let progress = if total_size > 0 { - (downloaded * 100) / total_size - } else { - 0 - }; - - match window.emit( - "download-progress", - DownloadProgress { - progress, - total: total_size, - }, - ) { - Ok(_) => {}, - Err(e) => { - eprintln!("Failed to emit progress: {}", e); - } - } - } - - file.flush().map_err(|e| e.to_string())?; - - Ok(download_path.to_string_lossy().into_owned()) -} - -#[tauri::command] -pub async fn open_installer(file_path: String) -> Result<(), String> { - #[cfg(target_os = "windows")] - { - const CREATE_NO_WINDOW: u32 = 0x08000000; - Command::new("cmd") - .args(["/c", "start", "", &file_path]) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| e.to_string())?; - } - #[cfg(not(target_os = "windows"))] - { - return Err("Only Windows is supported".to_string()); - } - Ok(()) -} - -#[tauri::command] -pub async fn download_update( - url: String, - file_name: String, - window: Window, -) -> Result { - download_file(url, file_name, window).await -} - -#[tauri::command] -pub async fn install_update( - file_path: String, - app_handle: AppHandle, -) -> Result<(), String> { - #[cfg(target_os = "windows")] - { - use windows_sys::Win32::UI::Shell::ShellExecuteW; - use windows_sys::Win32::UI::WindowsAndMessaging::SW_SHOWNORMAL; - - let file_path_wide: Vec = file_path - .encode_utf16() - .chain(std::iter::once(0)) - .collect(); - let verb: Vec = "open\0".encode_utf16().collect(); - - // 使用 ShellExecuteW 直接启动安装包,避免 cmd 中介弹出终端窗口 - let hinst = unsafe { - ShellExecuteW( - std::ptr::null_mut(), - verb.as_ptr(), - file_path_wide.as_ptr(), - std::ptr::null(), - std::ptr::null(), - SW_SHOWNORMAL, - ) - }; - - // ShellExecuteW 返回值 <= 32 表示错误 - if hinst as isize <= 32 { - return Err(format!("Failed to launch installer (error: {})", hinst as isize)); - } - } - - std::thread::sleep(std::time::Duration::from_millis(500)); - - app_handle.exit(0); - - Ok(()) -} - -#[tauri::command] -pub async fn delete_download_file(file_path: String) -> Result<(), String> { - if std::path::Path::new(&file_path).exists() { - fs::remove_file(&file_path).map_err(|e| e.to_string())?; - } - Ok(()) -} diff --git a/参考/NexBox-main/src-tauri/src/game_fps.rs b/参考/NexBox-main/src-tauri/src/game_fps.rs deleted file mode 100644 index 6281f03..0000000 --- a/参考/NexBox-main/src-tauri/src/game_fps.rs +++ /dev/null @@ -1,633 +0,0 @@ -//! FPS 监控模块 — 基于 PresentMon 2.5.1 控制台进程方案 -//! -//! 通过启动 PresentMon.exe 子进程,读取 stdout 管道中的 CSV 帧数据, -//! 动态解析表头获取 `MsBetweenPresents` 列,按前台进程名过滤, -//! 使用 EMA 指数移动平均计算平滑 FPS。 -//! -//! 优势: -//! - 支持 DirectX 9/10/11/12、OpenGL、Vulkan 全部图形 API -//! - 微软官方分析库,数据帧级精确 -//! - 无需手写 ETW,代码简洁易维护 - -use std::collections::HashMap; -use std::io::{BufRead, BufReader}; -use std::path::PathBuf; -#[cfg(windows)] -use std::os::windows::process::CommandExt; -use std::process::{Child, Command, Stdio}; -use std::sync::atomic::{AtomicBool, AtomicU64, AtomicU32, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; - -// ============ 全局状态 ============ - -/// 平滑后的 FPS 值,供 overlay 读取 -static SMOOTHED_FPS: AtomicU32 = AtomicU32::new(0); -/// FPS 监控是否处于活跃状态 -static FPS_ACTIVE: AtomicBool = AtomicBool::new(false); -/// 自身 overlay 窗口句柄(用于排除前台切换到自身 overlay) -static OVERLAY_HWND: AtomicU64 = AtomicU64::new(0); -/// 当前前台目标进程名(小写 exe 文件名,如 "game.exe") -static TARGET_PROCESS_NAME: Mutex = Mutex::new(String::new()); -/// 当前前台窗口 PID(钩子回调中快速存储,后台线程查询进程名) -static CURRENT_FG_PID: AtomicU32 = AtomicU32::new(0); -/// PresentMon 子进程句柄(用于停止时 kill) -static CHILD_HANDLE: Mutex> = Mutex::new(None); -/// 上次匹配到目标帧数据的时间戳(ms),用于检测 FPS 卡住 -static LAST_MATCH_TIMESTAMP: AtomicU64 = AtomicU64::new(0); - -// ============ Windows 前台窗口钩子 ============ - -#[cfg(target_os = "windows")] -mod win32_fg { - use super::*; - use std::ptr; - use windows_sys::Win32::Foundation::*; - use windows_sys::Win32::UI::Accessibility::*; - use windows_sys::Win32::UI::WindowsAndMessaging::*; - - static HOOK_HANDLE: Mutex = Mutex::new(0); - - /// 前台窗口切换回调 — 仅存储 PID,不做耗时操作(此回调运行在 overlay 渲染线程上) - unsafe extern "system" fn on_foreground_changed( - _hook: HWINEVENTHOOK, - _event: u32, - hwnd: HWND, - _id_object: i32, - _id_child: i32, - _id_event_thread: u32, - _dw_event_time: u32, - ) { - if !FPS_ACTIVE.load(Ordering::SeqCst) { - return; - } - // 排除自身 overlay 窗口 - let overlay = OVERLAY_HWND.load(Ordering::Relaxed) as usize; - if overlay != 0 && hwnd as usize == overlay { - return; - } - - let mut pid = 0u32; - GetWindowThreadProcessId(hwnd, &mut pid); - if pid != 0 { - // 仅原子存储 PID,进程名由后台轮询线程查询 - CURRENT_FG_PID.store(pid, Ordering::Relaxed); - } - } - - /// 注册前台窗口切换事件钩子 - pub unsafe fn register_hook() -> bool { - let hook = SetWinEventHook( - EVENT_SYSTEM_FOREGROUND, - EVENT_SYSTEM_FOREGROUND, - ptr::null_mut(), - Some(on_foreground_changed), - 0, - 0, - WINEVENT_OUTOFCONTEXT, - ); - if !hook.is_null() { - *HOOK_HANDLE.lock().unwrap() = hook as usize; - true - } else { - log::warn!("FPS监控: 前台窗口 Hook 注册失败"); - false - } - } - - /// 注销前台窗口切换事件钩子 - pub unsafe fn unregister_hook() { - let mut lock = HOOK_HANDLE.lock().unwrap(); - if *lock != 0 { - UnhookWinEvent(*lock as *mut _); - *lock = 0; - } - } - - /// 初始化时获取当前前台窗口 PID(仅原子存储,进程名由后台线程查询) - pub fn init_foreground_process() { - unsafe { - let hwnd = GetForegroundWindow(); - if hwnd.is_null() { - return; - } - let mut pid = 0u32; - GetWindowThreadProcessId(hwnd, &mut pid); - if pid != 0 { - CURRENT_FG_PID.store(pid, Ordering::Relaxed); - } - } - } -} - -// ============ PresentMon 进程管理 ============ - -/// 查找 PresentMon exe 路径 -/// -/// 按优先级在以下位置查找(兼容开发模式和生产模式): -/// 1. 可执行文件同级目录(生产模式) -/// 2. exe_dir/resources/(生产模式 Tauri 打包后) -/// 3. exe_dir/_up_/resources/binaries/(开发模式,_up_ 从 target/debug 跳到 src-tauri) -/// 4. exe_dir/../../resources/binaries/(开发模式备选) -/// 5. 当前工作目录下 resources/binaries/(开发模式 cwd=src-tauri) -/// 6. 当前工作目录下 PresentMon-main/(仓库根目录) -fn find_presentmon_exe() -> Option { - let exe_dir = std::env::current_exe().ok()?.parent()?.to_path_buf(); - let cwd = std::env::current_dir().ok(); - let candidates: Vec = vec![ - // 生产模式 - exe_dir.join("PresentMon-2.5.1-x64.exe"), - exe_dir.join("resources").join("PresentMon-2.5.1-x64.exe"), - exe_dir.join("bin").join("PresentMon-2.5.1-x64.exe"), - // 开发模式:exe 在 src-tauri/target/debug/ 下 - exe_dir.join("_up_").join("resources").join("binaries").join("PresentMon-2.5.1-x64.exe"), - exe_dir.join("..").join("..").join("resources").join("binaries").join("PresentMon-2.5.1-x64.exe"), - // 开发模式:cwd 通常为 src-tauri/ - cwd.as_ref().map(|c| c.join("resources").join("binaries").join("PresentMon-2.5.1-x64.exe")).unwrap_or_default(), - // 开发模式:仓库根目录 - cwd.as_ref().map(|c| c.join("PresentMon-main").join("PresentMon-2.5.1-x64.exe")).unwrap_or_default(), - // 开发模式:从 cwd 向上一级(如果 cwd 是 src-tauri,向上一级到仓库根) - cwd.as_ref().and_then(|c| c.parent()).map(|p| p.join("PresentMon-main").join("PresentMon-2.5.1-x64.exe")).unwrap_or_default(), - ]; - for candidate in &candidates { - if candidate.exists() { - log::info!("FPS监控: 找到 PresentMon → {}", candidate.display()); - return Some(candidate.clone()); - } - } - log::error!( - "FPS监控: 未找到 PresentMon-2.5.1-x64.exe,已搜索以下路径: {:?}", - candidates - ); - None -} - -/// PresentMon 读取循环:启动子进程,读取 stdout CSV 数据,解析 FPS -fn run_presentmon_session() { - let exe_path = match find_presentmon_exe() { - Some(p) => p, - None => { - log::error!("FPS监控: 未找到 PresentMon-2.5.1-x64.exe,请确保文件已打包"); - FPS_ACTIVE.store(false, Ordering::SeqCst); - return; - } - }; - - // 构建 PresentMon 启动命令 - // 注意:不使用 --no_track_display,因为它会禁用 DWM 追踪, - // 导致 OpenGL/Vulkan 应用(如 Minecraft Java 版)的帧无法被捕获 - let mut cmd = Command::new(&exe_path); - cmd.args([ - "--output_stdout", // CSV 输出到 stdout - "--no_console_stats", // 关闭控制台统计(防止污染 stdout) - "--stop_existing_session", // 停止已有同名 ETW 会话 - ]); - cmd.stdout(Stdio::piped()); - cmd.stderr(Stdio::null()); - cmd.stdin(Stdio::null()); - #[cfg(windows)] - cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW - - let mut child = match cmd.spawn() { - Ok(c) => c, - Err(e) => { - log::error!( - "FPS监控: PresentMon 启动失败: {}(可能需要管理员权限)", - e - ); - FPS_ACTIVE.store(false, Ordering::SeqCst); - return; - } - }; - - // 取出 stdout 管道 - let stdout = child.stdout.take().unwrap(); - - // 存储子进程句柄(用于停止时 kill) - { - let mut lock = CHILD_HANDLE.lock().unwrap(); - *lock = Some(child); - } - - log::info!("FPS监控: PresentMon 子进程已启动,开始读取 CSV 数据"); - - let reader = BufReader::new(stdout); - - // CSV 表头解析状态 - let mut header_parsed = false; - let mut app_idx: usize = 0; - let mut ms_idx: usize = 0; - let mut header_map: HashMap = HashMap::new(); - - // EMA 平滑状态 - let mut smoothed_fps: f64 = 0.0; - let mut first_frame = true; - let mut last_target_name = String::new(); - let mut last_match_time = std::time::Instant::now(); - - // 统计计数(调试用) - let mut line_count: u64 = 0; - let mut matched_count: u64 = 0; - // 诊断:记录见过的所有应用名 - let mut seen_apps: std::collections::HashSet = std::collections::HashSet::new(); - let mut last_diag_time = std::time::Instant::now(); - - for line_result in reader.lines() { - if !FPS_ACTIVE.load(Ordering::SeqCst) { - break; - } - - let line = match line_result { - Ok(l) => l, - Err(_) => continue, - }; - - let trimmed = line.trim(); - if trimmed.is_empty() { - continue; - } - - line_count += 1; - let cols: Vec<&str> = trimmed.split(',').collect(); - - // ===== 第一阶段:解析表头 ===== - if !header_parsed { - for (i, col) in cols.iter().enumerate() { - header_map.insert(col.trim().to_string(), i); - } - - app_idx = match header_map.get("Application") { - Some(&idx) => idx, - None => { - log::error!( - "FPS监控: CSV 表头中找不到 'Application' 列,表头 = {:?}", - cols - ); - break; - } - }; - - ms_idx = match header_map.get("MsBetweenPresents") { - Some(&idx) => idx, - None => { - log::error!( - "FPS监控: CSV 表头中找不到 'MsBetweenPresents' 列,表头 = {:?}", - cols - ); - break; - } - }; - - header_parsed = true; - log::info!( - "FPS监控: CSV 表头解析成功 → Application[{}] MsBetweenPresents[{}] (共{}列)", - app_idx, - ms_idx, - cols.len() - ); - continue; - } - - // ===== 第二阶段:解析数据行 ===== - if app_idx >= cols.len() || ms_idx >= cols.len() { - continue; - } - - let app_name_raw = cols[app_idx].trim(); - let app_name = app_name_raw.to_lowercase(); - - // 诊断:记录所有不重复的应用名 - if !seen_apps.contains(&app_name) { - seen_apps.insert(app_name.clone()); - log::info!("FPS监控: 发现应用 [{}] (第{}行)", app_name, line_count); - } - - let target_name = TARGET_PROCESS_NAME.lock().unwrap().clone(); - - // 检测目标进程切换 → 重置 EMA 状态和 FPS - if target_name != last_target_name { - if !last_target_name.is_empty() { - log::info!( - "FPS监控: 目标切换 '{}' → '{}',重置 FPS", - last_target_name, - target_name - ); - } - last_target_name = target_name.clone(); - smoothed_fps = 0.0; - first_frame = true; - SMOOTHED_FPS.store(0, Ordering::Relaxed); - matched_count = 0; - } - - // 空目标 → 跳过 - if target_name.is_empty() { - continue; - } - - // 进程名匹配:支持带/不带 .exe 后缀,以及 java/javaw 互通 - let target_lower = target_name.to_lowercase(); - let target_no_exe = target_lower.strip_suffix(".exe").unwrap_or(&target_lower); - let app_no_exe = app_name.strip_suffix(".exe").unwrap_or(&app_name); - - // 特殊处理:java ↔ javaw 互通(Minecraft Java 版可能用 javaw.exe) - let target_is_java = target_no_exe == "java" || target_no_exe == "javaw"; - let app_is_java = app_no_exe == "java" || app_no_exe == "javaw"; - - let is_match = app_name == target_lower - || app_no_exe == target_no_exe - || (target_is_java && app_is_java); - - if !is_match { - // 超时归零:如果 3 秒内没有匹配数据,FPS 归零(显示 --) - if matched_count > 0 && last_match_time.elapsed() >= std::time::Duration::from_secs(3) { - if SMOOTHED_FPS.load(Ordering::Relaxed) != 0 { - log::warn!( - "FPS监控: 目标 '{}' 3秒无数据,FPS 归零 (seen_apps={:?})", - target_name, - seen_apps - ); - SMOOTHED_FPS.store(0, Ordering::Relaxed); - } - } - - // 定期诊断:每 5 秒输出一次状态 - if last_diag_time.elapsed() >= std::time::Duration::from_secs(5) { - log::warn!( - "FPS监控: 诊断 line={} matched={} fps={} target='{}' seen_apps={:?}", - line_count, - matched_count, - SMOOTHED_FPS.load(Ordering::Relaxed), - target_name, - seen_apps - ); - last_diag_time = std::time::Instant::now(); - } - continue; - } - - matched_count += 1; - last_match_time = std::time::Instant::now(); - - // 解析 MsBetweenPresents(毫秒) - if let Ok(ms_between_presents) = cols[ms_idx].trim().parse::() { - // 前 5 个匹配行输出原始值用于诊断 - if matched_count <= 5 { - log::info!( - "FPS监控: 匹配行#{} MsBetweenPresents={}ms → raw_fps={:.1}", - matched_count, - ms_between_presents, - if ms_between_presents > 0.0 { 1000.0 / ms_between_presents } else { 0.0 } - ); - } - - // 排除异常值:ms 过小(<1ms, 对应>1000fps)或过大(>1000ms) - if ms_between_presents >= 1.0 && ms_between_presents < 1000.0 { - let raw_fps = 1000.0 / ms_between_presents; - - // EMA 指数移动平均 - if first_frame { - smoothed_fps = raw_fps; - first_frame = false; - } else { - // 平滑系数 0.2:值越小越平滑,越大越灵敏 - smoothed_fps = 0.2 * raw_fps + 0.8 * smoothed_fps; - } - - SMOOTHED_FPS.store(smoothed_fps.round() as u32, Ordering::Relaxed); - - // 更新匹配时间戳(用于外部检测 FPS 是否卡住) - LAST_MATCH_TIMESTAMP.store( - std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_millis() as u64, - Ordering::Relaxed, - ); - } - } - - // 每秒输出一次诊断 - if last_diag_time.elapsed() >= std::time::Duration::from_secs(1) { - log::info!( - "FPS监控: 统计 line={} matched={} fps={} target={}", - line_count, - matched_count, - SMOOTHED_FPS.load(Ordering::Relaxed), - target_name - ); - last_diag_time = std::time::Instant::now(); - } - } - - // 管道结束:清理子进程 - let mut lock = CHILD_HANDLE.lock().unwrap(); - if let Some(mut child) = lock.take() { - let _ = child.kill(); - let _ = child.wait(); - } - - SMOOTHED_FPS.store(0, Ordering::Relaxed); - log::info!( - "FPS监控: PresentMon 会话结束 (line={} matched={})", - line_count, - matched_count - ); -} - -/// FPS 监控主线程:含自动重启逻辑 -fn fps_monitor_main() { - let mut restart_count = 0u32; - const MAX_RESTARTS: u32 = 5; - - while FPS_ACTIVE.load(Ordering::SeqCst) { - run_presentmon_session(); - - if !FPS_ACTIVE.load(Ordering::SeqCst) { - break; - } - - restart_count += 1; - if restart_count > MAX_RESTARTS { - log::error!( - "FPS监控: PresentMon 重启超过 {} 次,放弃", - MAX_RESTARTS - ); - FPS_ACTIVE.store(false, Ordering::SeqCst); - break; - } - - log::warn!( - "FPS监控: PresentMon 管道断开,{}秒后重启 (第{}/{}次)", - 2, - restart_count, - MAX_RESTARTS - ); - thread::sleep(Duration::from_secs(2)); - } -} - -/// 前台窗口轮询线程(后台线程) -/// -/// 负责: -/// 1. 查询 CURRENT_FG_PID 对应的进程名(使用 sysinfo,耗时操作放在此后台线程) -/// 2. 兜底轮询前台窗口(防止 EVENT_SYSTEM_FOREGROUND 漏发) -/// 3. 将进程名写入 TARGET_PROCESS_NAME 供 CSV 过滤使用 -fn foreground_poller_loop() { - use sysinfo::{Pid, System}; - let mut sys = System::new(); - let mut last_pid: u32 = 0; - - while FPS_ACTIVE.load(Ordering::SeqCst) { - thread::sleep(Duration::from_millis(200)); - if !FPS_ACTIVE.load(Ordering::SeqCst) { - break; - } - - // 1. 兜底轮询前台窗口(防止 Hook 漏发) - #[cfg(target_os = "windows")] - unsafe { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - let hwnd = GetForegroundWindow(); - if !hwnd.is_null() { - let overlay = OVERLAY_HWND.load(Ordering::Relaxed) as usize; - if overlay == 0 || hwnd as usize != overlay { - let mut pid = 0u32; - GetWindowThreadProcessId(hwnd, &mut pid); - if pid != 0 { - CURRENT_FG_PID.store(pid, Ordering::Relaxed); - } - } - } - } - - // 2. 检测 FPS 是否过期(无匹配数据超过 3 秒),用于解决窗口切换后帧率卡住不更新的问题 - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_millis() as u64; - let last_match = LAST_MATCH_TIMESTAMP.load(Ordering::Relaxed); - if last_match > 0 && now > last_match + 3000 { - let current_fps = SMOOTHED_FPS.load(Ordering::Relaxed); - if current_fps != 0 { - log::warn!( - "FPS监控: 帧率数据已过期 ({}ms 无匹配),重置 FPS 并重启 PresentMon", - now - last_match - ); - SMOOTHED_FPS.store(0, Ordering::Relaxed); - // 杀掉 PresentMon 子进程以强制重启,解阻塞 reader.lines() - if let Some(mut child) = CHILD_HANDLE.lock().unwrap().take() { - let _ = child.kill(); - let _ = child.wait(); - } - } - } - - // 3. 查询进程名(耗时操作,在后台线程执行) - let pid = CURRENT_FG_PID.load(Ordering::Relaxed); - if pid == 0 { - continue; - } - - // PID 变化时才刷新进程列表 - if pid != last_pid { - sys.refresh_processes(); - last_pid = pid; - } - - if let Some(process) = sys.process(Pid::from_u32(pid)) { - let name = process.name().to_string().to_lowercase(); - let mut target = TARGET_PROCESS_NAME.lock().unwrap(); - if *target != name { - log::info!("FPS监控: 前台进程 → {} (pid={})", name, pid); - *target = name; - } - } - } -} - -// ============ 公共 API(保持与旧方案完全兼容) ============ - -/// 启动 FPS 监控 -pub fn start_fps_monitor() { - if FPS_ACTIVE.load(Ordering::SeqCst) { - return; - } - FPS_ACTIVE.store(true, Ordering::SeqCst); - - #[cfg(target_os = "windows")] - { - win32_fg::init_foreground_process(); - unsafe { - win32_fg::register_hook(); - } - } - - // 启动 PresentMon 读取主线程 - thread::spawn(|| { - fps_monitor_main(); - }); - - // 启动前台窗口轮询线程(兜底) - thread::spawn(|| { - foreground_poller_loop(); - }); - - log::info!("FPS监控: 已启动 (PresentMon 方案)"); -} - -/// 停止 FPS 监控 -pub fn stop_fps_monitor() { - if !FPS_ACTIVE.load(Ordering::SeqCst) { - return; - } - FPS_ACTIVE.store(false, Ordering::SeqCst); - - // kill 子进程(管道断开后 reader 循环自动退出) - let mut lock = CHILD_HANDLE.lock().unwrap(); - if let Some(mut child) = lock.take() { - let _ = child.kill(); - let _ = child.wait(); - } - drop(lock); - - #[cfg(target_os = "windows")] - unsafe { - win32_fg::unregister_hook(); - } - - SMOOTHED_FPS.store(0, Ordering::Relaxed); - LAST_MATCH_TIMESTAMP.store(0, Ordering::Relaxed); - *TARGET_PROCESS_NAME.lock().unwrap() = String::new(); - CURRENT_FG_PID.store(0, Ordering::Relaxed); - - log::info!("FPS监控: 已停止"); -} - -/// 获取缓存的平滑 FPS 值 -pub fn get_cached_fps() -> Option { - let fps = SMOOTHED_FPS.load(Ordering::Relaxed); - if fps == 0 { - None - } else { - Some(fps) - } -} - -/// 设置自身 overlay 窗口句柄(用于排除前台切换到自身 overlay) -pub fn set_overlay_hwnd(hwnd: u64) { - OVERLAY_HWND.store(hwnd, Ordering::SeqCst); - log::info!("FPS监控: Overlay窗口句柄设置为 {:#X}", hwnd); -} - -/// 清除自身 overlay 窗口句柄 -pub fn clear_overlay_hwnd() { - OVERLAY_HWND.store(0, Ordering::SeqCst); - log::info!("FPS监控: Overlay窗口句柄已清除"); -} - -/// 清理资源 -pub fn cleanup() { - stop_fps_monitor(); -} diff --git a/参考/NexBox-main/src-tauri/src/game_launcher.rs b/参考/NexBox-main/src-tauri/src/game_launcher.rs deleted file mode 100644 index 1c73642..0000000 --- a/参考/NexBox-main/src-tauri/src/game_launcher.rs +++ /dev/null @@ -1,193 +0,0 @@ -use base64::Engine; -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -/// 图标缓存目录:%LOCALAPPDATA%/NexBox/game-icons/ -fn icon_cache_dir() -> PathBuf { - let base = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - base.join("NexBox").join("game-icons") -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct GameShortcut { - pub id: String, - pub name: String, - pub path: String, - #[serde(default)] - pub is_default: bool, -} - -#[tauri::command] -pub async fn launch_game(game_path: String) -> Result<(), String> { - let path = PathBuf::from(&game_path); - if !path.exists() { - return Err(format!("游戏路径不存在: {}", game_path)); - } - - let path_lower = game_path.to_lowercase(); - - // .exe: 直接启动,跳过 cmd.exe 中间层,大幅减少等待时间 - if path_lower.ends_with(".exe") { - Command::new(&game_path) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("启动游戏失败: {}", e))?; - } else { - // 非 .exe(如 steam://、文件夹等),通过 cmd /c start 间接启动 - Command::new("cmd") - .args(["/c", "start", "", &game_path]) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("启动失败: {}", e))?; - } - - Ok(()) -} - -#[tauri::command] -pub async fn search_delta_force_launcher() -> Option { - let common_paths = [ - "D:\\Delta Force\\launcher\\delta_force_launcher.exe", - "C:\\Delta Force\\launcher\\delta_force_launcher.exe", - "E:\\Delta Force\\launcher\\delta_force_launcher.exe", - "F:\\Delta Force\\launcher\\delta_force_launcher.exe", - ]; - - for path in &common_paths { - if PathBuf::from(path).exists() { - return Some(path.to_string()); - } - } - - let ps_script = r#" - $drives = Get-PSDrive -PSProvider FileSystem | Where-Object { $_.Root -match "^[C-Z]:" } | ForEach-Object { $_.Root } - foreach ($drive in $drives) { - $path = Join-Path $drive "Delta Force\launcher\delta_force_launcher.exe" - if (Test-Path $path) { - $path - break - } - } - "#; - - if let Ok(output) = Command::new("powershell") - .args(["-NoProfile", "-NonInteractive", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - if output.status.success() { - let result = String::from_utf8_lossy(&output.stdout).trim().to_string(); - if !result.is_empty() { - return Some(result); - } - } - } - - None -} - -#[tauri::command] -pub async fn get_default_delta_force_game() -> Option { - let launcher_path = search_delta_force_launcher().await?; - - Some(GameShortcut { - id: "delta-force".to_string(), - name: "三角洲行动".to_string(), - path: launcher_path, - is_default: true, - }) -} - -#[tauri::command] -pub async fn select_exe_file() -> Option { - let file = rfd::FileDialog::new() - .set_title("选择游戏可执行文件") - .add_filter("可执行文件和快捷方式", &["exe", "lnk"]) - .add_filter("所有文件", &["*"]) - .pick_file(); - - file.map(|f| f.to_string_lossy().to_string()) -} - -/// 获取可执行文件或快捷方式的图标,返回 base64 PNG data URI -#[tauri::command] -pub async fn get_file_icon(file_path: String) -> Result { - let path = PathBuf::from(&file_path); - if !path.exists() { - return Err("文件不存在".to_string()); - } - - // 检查缓存 - let cache_dir = icon_cache_dir(); - let cache_key = format!("icon_{}.png", hash_path(&file_path)); - let cache_path = cache_dir.join(&cache_key); - - if cache_path.exists() { - if let Ok(bytes) = fs::read(&cache_path) { - let b64 = base64::engine::general_purpose::STANDARD.encode(&bytes); - return Ok(format!("data:image/png;base64,{}", b64)); - } - } - - // 用 PowerShell 提取图标 - let ps_script = format!( - r#"Add-Type -AssemblyName System.Drawing; -$path = '{}'; -# 如果是快捷方式,解析到目标 exe 路径 -$src = $path; -if ($path -like '*.lnk') {{ - try {{ - $shell = New-Object -ComObject WScript.Shell; - $sc = $shell.CreateShortcut($path); - $target = $sc.TargetPath; - if ($target -and (Test-Path $target)) {{ $src = $target; }} - }} catch {{}} -}} -$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($src); -if ($icon -ne $null) {{ - $bmp = $icon.ToBitmap(); - $ms = New-Object System.IO.MemoryStream; - $bmp.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png); - [Convert]::ToBase64String($ms.ToArray()); -}} else {{ - Write-Output '' -}} -"#, - file_path.replace('\'', "''") - ); - - let output = Command::new("powershell") - .args(["-NoProfile", "-NonInteractive", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("PowerShell 执行失败: {}", e))?; - - let stdout = String::from_utf8_lossy(&output.stdout); - let b64 = stdout.trim().to_string(); - - if b64.is_empty() { - return Err("无法提取图标".to_string()); - } - - // 解码并存入缓存 - if let Ok(bytes) = base64::engine::general_purpose::STANDARD.decode(&b64) { - let _ = fs::create_dir_all(&cache_dir); - let _ = fs::write(&cache_path, &bytes); - Ok(format!("data:image/png;base64,{}", b64)) - } else { - Ok(format!("data:image/png;base64,{}", b64)) - } -} - -/// 简单的路径哈希,用于缓存文件名(取前8个十六进制字符) -fn hash_path(p: &str) -> String { - use std::hash::{Hash, Hasher}; - let mut hasher = std::collections::hash_map::DefaultHasher::new(); - p.hash(&mut hasher); - format!("{:x}", hasher.finish()) -} diff --git a/参考/NexBox-main/src-tauri/src/game_ping.rs b/参考/NexBox-main/src-tauri/src/game_ping.rs deleted file mode 100644 index 4628cf8..0000000 --- a/参考/NexBox-main/src-tauri/src/game_ping.rs +++ /dev/null @@ -1,138 +0,0 @@ -use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; - -static PING_ACTIVE: AtomicBool = AtomicBool::new(false); -static CURRENT_PING: AtomicU32 = AtomicU32::new(0); -static PING_THREAD_HANDLE: Mutex>> = Mutex::new(None); - -const DEFAULT_SERVER: &str = "game.qq.com"; - -#[cfg(target_os = "windows")] -mod win32_ping { - use windows_sys::Win32::NetworkManagement::IpHelper::*; - use windows_sys::Win32::Foundation::*; - use std::mem; - use std::ptr; - use std::time::Instant; - use std::net::ToSocketAddrs; - - const ICMP_TIMEOUT: u32 = 3000; - - pub fn ping_host(host: &str) -> Option { - let addr = resolve_host(host)?; - let handle = unsafe { IcmpCreateFile() }; - if handle == INVALID_HANDLE_VALUE { - return None; - } - let result = ping_addr(handle, addr); - unsafe { IcmpCloseHandle(handle) }; - result - } - - fn resolve_host(host: &str) -> Option { - let host_with_port = format!("{}:0", host); - let addrs: Vec = host_with_port.to_socket_addrs().ok()?.collect(); - for addr in addrs { - if let std::net::SocketAddr::V4(v4) = addr { - let ip = v4.ip().octets(); - let ip_u32 = ((ip[3] as u32) << 24) | ((ip[2] as u32) << 16) | ((ip[1] as u32) << 8) | (ip[0] as u32); - return Some(ip_u32); - } - } - None - } - - fn ping_addr(handle: HANDLE, dest_addr: u32) -> Option { - let send_data: [u8; 32] = [0; 32]; - let mut reply_buffer: [u8; 256] = [0; 256]; - let reply_size = mem::size_of::() as u32 + send_data.len() as u32; - - let start = Instant::now(); - - let ret = unsafe { - IcmpSendEcho( - handle, - dest_addr, - send_data.as_ptr() as *const _, - send_data.len() as u16, - ptr::null(), - reply_buffer.as_mut_ptr() as *mut _, - reply_size, - ICMP_TIMEOUT, - ) - }; - - if ret == 0 { - return None; - } - - let reply_ptr = reply_buffer.as_ptr() as *const ICMP_ECHO_REPLY; - let reply_ref = unsafe { &*reply_ptr }; - - if reply_ref.Status != IP_SUCCESS { - return None; - } - - Some(start.elapsed().as_millis() as u32) - } -} - -#[cfg(not(target_os = "windows"))] -mod win32_ping { - pub fn ping_host(_host: &str) -> Option { - None - } -} - -pub fn get_cached_ping() -> Option { - let ping = CURRENT_PING.load(Ordering::SeqCst); - if ping == 0 { None } else { Some(ping) } -} - -pub fn start_ping_thread() { - if PING_ACTIVE.load(Ordering::SeqCst) { - return; - } - - PING_ACTIVE.store(true, Ordering::SeqCst); - - let handle = thread::spawn(|| { - while PING_ACTIVE.load(Ordering::SeqCst) { - let ping_result = win32_ping::ping_host(DEFAULT_SERVER); - let ping_value = ping_result.unwrap_or(0); - CURRENT_PING.store(ping_value, Ordering::SeqCst); - - for _ in 0..40 { - if !PING_ACTIVE.load(Ordering::SeqCst) { - return; - } - thread::sleep(Duration::from_millis(50)); - } - } - }); - - let mut handle_lock = PING_THREAD_HANDLE.lock().unwrap(); - *handle_lock = Some(handle); -} - -pub fn stop_ping_thread() { - PING_ACTIVE.store(false, Ordering::SeqCst); - - let mut handle_lock = PING_THREAD_HANDLE.lock().unwrap(); - if let Some(handle) = handle_lock.take() { - let _ = handle.join(); - } - - CURRENT_PING.store(0, Ordering::SeqCst); -} - -#[tauri::command] -pub async fn get_current_ping() -> Result, String> { - Ok(get_cached_ping()) -} - -pub fn cleanup() { - stop_ping_thread(); -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/src/gpu_rename.rs b/参考/NexBox-main/src-tauri/src/gpu_rename.rs deleted file mode 100644 index 1127bbe..0000000 --- a/参考/NexBox-main/src-tauri/src/gpu_rename.rs +++ /dev/null @@ -1,547 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::path::PathBuf; - -#[cfg(target_os = "windows")] -use winreg::enums::*; -#[cfg(target_os = "windows")] -use winreg::RegKey; - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct GpuInfo { - pub original_name: String, - pub current_name: String, - pub is_backed_up: bool, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct GpuRenameResult { - pub success: bool, - pub message: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct GpuOption { - pub id: String, - pub name: String, - pub category: String, -} - -fn get_appdata_backup_path() -> Result { - let appdata_dir = dirs::config_dir() - .ok_or("无法获取 APPDATA 目录")? - .join("NexBox"); - std::fs::create_dir_all(&appdata_dir) - .map_err(|e| format!("创建数据目录失败: {}", e))?; - Ok(appdata_dir.join("gpu_rename_backup.json")) -} - -fn get_install_dir_backup_path() -> Option { - std::env::current_exe().ok()?.parent().map(|p| p.join("gpu_rename_backup.json")) -} - -fn read_backup_from(path: &std::path::Path) -> Option { - if !path.exists() { - return None; - } - let content = std::fs::read_to_string(path).ok()?; - serde_json::from_str(&content).ok() -} - -fn save_backup(info: &GpuInfo) -> Result<(), String> { - let json = serde_json::to_string_pretty(info) - .map_err(|e| format!("序列化备份数据失败: {}", e))?; - - // 写入 %APPDATA%/NexBox/ — 持久保留 - let appdata_path = get_appdata_backup_path()?; - fs::write(&appdata_path, &json) - .map_err(|e| format!("写入备份文件失败: {}", e))?; - - // 同时也写一份到安装目录 — 方便用户直接查看 - if let Some(install_path) = get_install_dir_backup_path() { - let _ = fs::write(&install_path, &json); - } - - Ok(()) -} - -fn load_backup() -> Result, String> { - // 优先从 %APPDATA% 读取 - if let Ok(appdata_path) = get_appdata_backup_path() { - if let Some(info) = read_backup_from(&appdata_path) { - return Ok(Some(info)); - } - } - - // 回退到安装目录(兼容旧版本) - if let Some(install_path) = get_install_dir_backup_path() { - if let Some(info) = read_backup_from(&install_path) { - // 自动迁移到 %APPDATA% - let _ = save_backup(&info); - return Ok(Some(info)); - } - } - - Ok(None) -} - -#[cfg(target_os = "windows")] -fn find_gpu_registry_keys() -> Result, String> { - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - let enum_key = hklm.open_subkey("SYSTEM\\CurrentControlSet\\Enum\\PCI") - .map_err(|e| format!("打开注册表键失败: {}", e))?; - - let mut gpu_keys = Vec::new(); - - for vendor_result in enum_key.enum_keys() { - let vendor_key_name = vendor_result.map_err(|e| format!("枚举厂商键失败: {}", e))?; - let vendor_key = enum_key.open_subkey(&vendor_key_name) - .map_err(|e| format!("打开厂商键失败: {}", e))?; - - for device_result in vendor_key.enum_keys() { - let device_key_name = device_result.map_err(|e| format!("枚举设备键失败: {}", e))?; - let device_key = vendor_key.open_subkey(&device_key_name) - .map_err(|e| format!("打开设备键失败: {}", e))?; - let key_path = vendor_key_name.clone() + "\\" + &device_key_name; - - // 排除 USB 控制器等其他带 NVIDIA 标识的非显卡设备 - // 路径格式:VEN_10DE&DEV_XXXX...,10DE 是 NVIDIA 的 PCI 厂商 ID - if !vendor_key_name.to_uppercase().contains("VEN_10DE") { - continue; - } - - // 排除关键词:USB控制器等非显卡设备即使带 NVIDIA 标识也要跳过 - let exclude_keywords = ["usb", "controller", "控制器", "host", "xhci", "ehci", "uhci"]; - - let mut is_nvidia_gpu = false; - let mut is_excluded = false; - - if let Ok(device_desc) = device_key.get_value::("DeviceDesc") { - let device_desc_lower = device_desc.to_lowercase(); - // 先检查是否命中排除词 - for &kw in &exclude_keywords { - if device_desc_lower.contains(kw) { - is_excluded = true; - break; - } - } - if !is_excluded && (device_desc_lower.contains("nvidia") || - device_desc_lower.contains("geforce") || - device_desc_lower.contains("gtx") || - device_desc_lower.contains("rtx")) { - is_nvidia_gpu = true; - } - } - - if !is_nvidia_gpu && !is_excluded { - if let Ok(friendly_name) = device_key.get_value::("FriendlyName") { - let friendly_name_lower = friendly_name.to_lowercase(); - for &kw in &exclude_keywords { - if friendly_name_lower.contains(kw) { - is_excluded = true; - break; - } - } - if !is_excluded && (friendly_name_lower.contains("nvidia") || - friendly_name_lower.contains("geforce") || - friendly_name_lower.contains("gtx") || - friendly_name_lower.contains("rtx")) { - is_nvidia_gpu = true; - } - } - } - - if is_excluded { - continue; - } - - if is_nvidia_gpu { - gpu_keys.push((device_key, key_path)); - } - } - } - - Ok(gpu_keys) -} - -#[cfg(target_os = "windows")] -fn get_current_gpu_name() -> Result { - let gpu_keys = find_gpu_registry_keys()?; - if gpu_keys.is_empty() { - return Err("未找到显卡注册表信息".to_string()); - } - - let (key, _) = &gpu_keys[0]; - if let Ok(name) = key.get_value::("FriendlyName") { - return Ok(name); - } - if let Ok(name) = key.get_value::("DeviceDesc") { - let parts: Vec<&str> = name.split(';').collect(); - if parts.len() > 1 { - return Ok(parts[1].to_string()); - } - return Ok(name); - } - - Err("无法获取显卡名称".to_string()) -} - -#[cfg(not(target_os = "windows"))] -fn get_current_gpu_name() -> Result { - Err("此功能仅支持 Windows 系统".to_string()) -} - -#[cfg(target_os = "windows")] -fn rename_gpu(new_name: &str) -> Result<(), String> { - use std::os::windows::process::CommandExt; - use std::process::Command; - - const CREATE_NO_WINDOW: u32 = 0x08000000; - - log::info!("开始尝试修改显卡名称为: {}", new_name); - - let escaped_name = new_name.replace('\"', "\"\""); - - // PowerShell 脚本,找到并修改所有相关显卡注册表键 - let ps_script = format!( - r#" -$ErrorActionPreference = 'Stop' -$modified = $false - -# 1. 修改 Enum\PCI 下的键 -try {{ - $pciPath = "HKLM:\SYSTEM\CurrentControlSet\Enum\PCI" - if (Test-Path $pciPath) {{ - $vendors = Get-ChildItem $pciPath - foreach ($vendor in $vendors) {{ - # 只处理 NVIDIA 设备(VEN_10DE),排除 USB 控制器等其他带 NVIDIA 标识的设备 - if ($vendor.PSChildName -notmatch "VEN_10DE") {{ - continue - }} - $devices = Get-ChildItem $vendor.PSPath - foreach ($device in $devices) {{ - $isNvidia = $false - $isExcluded = $false - $keyPath = $device.PSPath - - # 排除关键词:USB控制器等非显卡设备 - $excludeKeywords = @("usb", "controller", "host", "xhci", "ehci", "uhci") - - try {{ - $deviceDesc = (Get-ItemProperty -Path $keyPath -Name "DeviceDesc" -ErrorAction SilentlyContinue).DeviceDesc - # 先检查排除词 - if ($deviceDesc) {{ - foreach ($kw in $excludeKeywords) {{ - if ($deviceDesc -match [regex]::Escape($kw)) {{ - $isExcluded = $true - break - }} - }} - }} - if (-not $isExcluded -and $deviceDesc -and ($deviceDesc -match "NVIDIA|GeForce|GTX|RTX")) {{ - $isNvidia = $true - Write-Host "找到NVIDIA显卡(DeviceDesc): $($device.PSChildName)" - }} - - if (-not $isNvidia -and -not $isExcluded) {{ - $friendlyName = (Get-ItemProperty -Path $keyPath -Name "FriendlyName" -ErrorAction SilentlyContinue).FriendlyName - if ($friendlyName) {{ - foreach ($kw in $excludeKeywords) {{ - if ($friendlyName -match [regex]::Escape($kw)) {{ - $isExcluded = $true - break - }} - }} - }} - if (-not $isExcluded -and $friendlyName -and ($friendlyName -match "NVIDIA|GeForce|GTX|RTX")) {{ - $isNvidia = $true - Write-Host "找到NVIDIA显卡(FriendlyName): $($device.PSChildName)" - }} - }} - - if ($isExcluded) {{ - Write-Host "跳过非显卡设备: $($device.PSChildName)" - continue - }} - - if ($isNvidia) {{ - Write-Host "正在修改: $keyPath" - - # 修改 FriendlyName - try {{ - Set-ItemProperty -Path $keyPath -Name "FriendlyName" -Value "{}" - Write-Host "成功修改 FriendlyName" - $modified = $true - }} catch {{ - Write-Host "修改 FriendlyName 失败: $_" - }} - - # 修改 DeviceDesc - try {{ - $deviceDesc = (Get-ItemProperty -Path $keyPath -Name "DeviceDesc" -ErrorAction SilentlyContinue).DeviceDesc - if ($deviceDesc) {{ - $parts = $deviceDesc -split ';', 2 - if ($parts.Count -gt 1) {{ - $newDesc = "$($parts[0]);{}" - Set-ItemProperty -Path $keyPath -Name "DeviceDesc" -Value $newDesc - Write-Host "成功修改 DeviceDesc" - $modified = $true - }} - }} - }} catch {{ - Write-Host "修改 DeviceDesc 失败: $_" - }} - }} - }} catch {{ - Write-Host "处理设备失败: $_" - }} - }} - }} - }} -}} catch {{ - Write-Host "Enum\PCI 处理失败: $_" -}} - -# 2. 修改 Class 下的显卡键 -try {{ - $classPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{{4d36e968-e325-11ce-bfc1-08002be10318}}" - if (Test-Path $classPath) {{ - $subkeys = Get-ChildItem $classPath - foreach ($subkey in $subkeys) {{ - if ($subkey.PSChildName -match "^00\d+") {{ - $keyPath = $subkey.PSPath - try {{ - $driverDesc = (Get-ItemProperty -Path $keyPath -Name "DriverDesc" -ErrorAction SilentlyContinue).DriverDesc - if ($driverDesc -and ($driverDesc -match "NVIDIA|GeForce|GTX|RTX")) {{ - Write-Host "找到显卡Class键: $($subkey.PSChildName) DriverDesc: $driverDesc" - Set-ItemProperty -Path $keyPath -Name "DriverDesc" -Value "{}" - Write-Host "成功修改 DriverDesc" - $modified = $true - }} - }} catch {{ - Write-Host "处理Class键失败: $_" - }} - }} - }} - }} -}} catch {{ - Write-Host "Class 处理失败: $_" -}} - -# 3. 额外检查其他可能的显卡位置 -try {{ - $displayPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Video" - if (Test-Path $displayPath) {{ - $videoKeys = Get-ChildItem $displayPath - foreach ($videoKey in $videoKeys) {{ - $subkeys = Get-ChildItem $videoKey.PSPath -ErrorAction SilentlyContinue - foreach ($subkey in $subkeys) {{ - try {{ - $keyPath = $subkey.PSPath - $driverDesc = (Get-ItemProperty -Path $keyPath -Name "DriverDesc" -ErrorAction SilentlyContinue).DriverDesc - $deviceDesc = (Get-ItemProperty -Path $keyPath -Name "DeviceDesc" -ErrorAction SilentlyContinue).DeviceDesc - $description = (Get-ItemProperty -Path $keyPath -Name "Description" -ErrorAction SilentlyContinue).Description - - $checkText = @($driverDesc, $deviceDesc, $description) -join " " - if ($checkText -match "NVIDIA|GeForce|GTX|RTX") {{ - Write-Host "找到Video键: $($videoKey.PSChildName)\$($subkey.PSChildName)" - - foreach ($name in @("DriverDesc", "DeviceDesc", "Description", "FriendlyName")) {{ - try {{ - $current = (Get-ItemProperty -Path $keyPath -Name $name -ErrorAction SilentlyContinue).$name - if ($current) {{ - Set-ItemProperty -Path $keyPath -Name $name -Value "{}" - Write-Host "成功修改 $name" - $modified = $true - }} - }} catch {{}} - }} - }} - }} catch {{}} - }} - }} - }} -}} catch {{ - Write-Host "Video 处理失败: $_" -}} - -if ($modified) {{ - Write-Host "SUCCESS: 显卡名称修改完成!" - exit 0 -}} else {{ - Write-Host "FAILED: 未能找到或修改任何显卡注册表键" - exit 1 -}} -"#, - escaped_name, escaped_name, escaped_name, escaped_name - ); - - log::info!("执行PowerShell脚本修改注册表"); - - let output = Command::new("powershell.exe") - .args(&["-ExecutionPolicy", "Bypass", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("无法执行PowerShell: {}", e))?; - - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - - log::info!("PowerShell输出: {}", stdout); - if !stderr.is_empty() { - log::warn!("PowerShell错误: {}", stderr); - } - - if output.status.success() && stdout.contains("SUCCESS") { - log::info!("显卡名称修改成功!"); - Ok(()) - } else { - Err(format!("修改失败: {}", if stderr.is_empty() { stdout } else { stderr })) - } -} - -#[cfg(not(target_os = "windows"))] -fn rename_gpu(_new_name: &str) -> Result<(), String> { - Err("此功能仅支持 Windows 系统".to_string()) -} - -#[tauri::command] -pub async fn get_gpu_info() -> Result { - let backup = load_backup()?; - let current_name = get_current_gpu_name()?; - - match backup { - Some(mut info) => { - info.current_name = current_name; - Ok(info) - } - None => { - Ok(GpuInfo { - original_name: current_name.clone(), - current_name, - is_backed_up: false, - }) - } - } -} - -#[tauri::command] -pub async fn get_gpu_options() -> Result, String> { - Ok(vec![ - // 低端显卡 - GpuOption { - id: "gtx650".to_string(), - name: "NVIDIA GeForce GTX 650".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "gtx750".to_string(), - name: "NVIDIA GeForce GTX 750".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "gtx750ti".to_string(), - name: "NVIDIA GeForce GTX 750 Ti".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "gtx1050".to_string(), - name: "NVIDIA GeForce GTX 1050".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "rx460".to_string(), - name: "AMD Radeon RX 460".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "rx560".to_string(), - name: "AMD Radeon RX 560".to_string(), - category: "low-end".to_string(), - }, - GpuOption { - id: "r7240".to_string(), - name: "AMD Radeon R7 240".to_string(), - category: "low-end".to_string(), - }, - // 高端显卡 - GpuOption { - id: "rtx4080".to_string(), - name: "NVIDIA GeForce RTX 4080".to_string(), - category: "high-end".to_string(), - }, - GpuOption { - id: "rtx4090".to_string(), - name: "NVIDIA GeForce RTX 4090".to_string(), - category: "high-end".to_string(), - }, - GpuOption { - id: "rtx5080".to_string(), - name: "NVIDIA GeForce RTX 5080".to_string(), - category: "high-end".to_string(), - }, - GpuOption { - id: "rtx5090".to_string(), - name: "NVIDIA GeForce RTX 5090".to_string(), - category: "high-end".to_string(), - }, - GpuOption { - id: "rx9060xt".to_string(), - name: "AMD Radeon RX 9060 XT".to_string(), - category: "high-end".to_string(), - }, - ]) -} - -#[tauri::command] -pub async fn apply_gpu_rename(new_name: String) -> Result { - let backup = load_backup()?; - - let current_name = get_current_gpu_name()?; - - if backup.is_none() { - let info = GpuInfo { - original_name: current_name.clone(), - current_name: new_name.clone(), - is_backed_up: true, - }; - save_backup(&info)?; - } - - rename_gpu(&new_name)?; - - Ok(GpuRenameResult { - success: true, - message: format!("显卡名称已更改为: {}", new_name), - }) -} - -#[tauri::command] -pub async fn restore_gpu_name() -> Result { - let backup = load_backup()?; - - match backup { - Some(info) => { - rename_gpu(&info.original_name)?; - - // 删除两处的备份文件 - if let Ok(appdata_path) = get_appdata_backup_path() { - let _ = fs::remove_file(appdata_path); - } - if let Some(install_path) = get_install_dir_backup_path() { - let _ = fs::remove_file(install_path); - } - - Ok(GpuRenameResult { - success: true, - message: format!("显卡名称已恢复为: {}", info.original_name), - }) - } - None => { - Ok(GpuRenameResult { - success: false, - message: "未找到备份文件,无法恢复".to_string(), - }) - } - } -} diff --git a/参考/NexBox-main/src-tauri/src/hardware.rs b/参考/NexBox-main/src-tauri/src/hardware.rs deleted file mode 100644 index d1d75ad..0000000 --- a/参考/NexBox-main/src-tauri/src/hardware.rs +++ /dev/null @@ -1,1772 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::process::Command; -use std::sync::{Arc, Mutex}; -use std::thread; -use thiserror::Error; -use sysinfo::System; - -use crate::wmi_query; - -#[derive(Error, Debug)] -pub enum HardwareError { - #[error("PowerShell执行失败: {0}")] - PowerShellError(String), - #[error("JSON解析失败: {0}")] - JsonError(#[from] serde_json::Error), - #[error("NVML错误: {0}")] - NvmlError(String), -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct CpuInfo { - pub name: String, - pub manufacturer: String, - pub cores: u32, - pub threads: u32, - pub max_clock_speed: u32, - pub l2_cache_size: u32, - pub l3_cache_size: u32, - pub load_percentage: Option, - pub architecture: String, - pub socket: String, - pub l2_cache_speed: Option, - pub l3_cache_speed: Option, - pub current_clock_speed: Option, - pub ext_clock: Option, - pub processor_id: String, - pub family: u32, - pub stepping: String, - pub revision: String, - pub enabled_cores: Option, - pub voltage_caps: Option, -} - -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] -pub enum GpuVendor { - NVIDIA, - AMD, - Intel, - Unknown, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct GpuInfo { - pub name: String, - pub vendor: GpuVendor, - pub memory_gb: f64, - pub driver_version: String, - pub temperature: Option, - pub usage: Option, - pub video_processor: String, - pub adapter_compatibility: String, - pub driver_date: String, - pub installed_drivers: String, - pub video_mode: String, - pub resolution_width: Option, - pub resolution_height: Option, - pub refresh_rate: Option, - pub device_id: String, - pub pnp_device_id: String, - pub status: String, - pub inf_filename: String, - pub video_architecture: Option, - pub video_memory_type: Option, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct MemoryInfo { - pub manufacturer: String, - pub part_number: String, - pub capacity_gb: f64, - pub speed_mhz: u32, - pub bank_label: String, - pub form_factor: String, - pub memory_type: String, - pub configured_clock_speed: Option, - pub configured_voltage: Option, - pub data_width: Option, - pub total_width: Option, - pub serial_number: String, - pub type_detail: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct SoundCardInfo { - pub name: String, - pub manufacturer: String, - pub status: String, - pub device_id: String, - pub pnp_device_id: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct NetworkCardInfo { - pub name: String, - pub manufacturer: String, - pub adapter_type: String, - pub mac_address: String, - pub speed_mbps: u64, - pub connection_name: String, - pub service_name: String, - pub index: u32, - pub max_speed: Option, - pub guid: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct MotherboardInfo { - pub product: String, - pub manufacturer: String, - pub serial_number: String, - pub version: String, - pub bios_vendor: String, - pub bios_version: String, - pub bios_release_date: String, - pub system_manufacturer: String, - pub system_model: String, - pub system_type: String, - pub chassis_type: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct DiskDetailInfo { - pub model: String, - pub size_gb: f64, - pub interface_type: String, - pub serial_number: String, - pub firmware_revision: String, - pub media_type: String, - pub bytes_per_sector: Option, - pub partitions: u32, - pub status: String, - pub is_ssd: bool, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct MonitorInfo { - pub name: String, - pub manufacturer: String, - pub screen_width: Option, - pub screen_height: Option, - pub refresh_rate: Option, - pub pnp_device_id: String, - pub status: String, - pub availability: Option, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct HardwareInfo { - pub cpu: CpuInfo, - pub gpu: Vec, - pub memory: Vec, - pub motherboard: MotherboardInfo, - pub disk: Vec, - pub sound_card: Vec, - pub network_card: Vec, - pub monitor: Vec, -} - - - -/// Check if a monitor name is a generic/placeholder (any language variant) -fn is_generic_monitor_name(name: &str) -> bool { - let lower = name.to_lowercase(); - lower.contains("generic") - || lower.contains("即插即用") - || lower.contains("通用") - || lower.contains("pnp") - || lower.contains("standard monitor") - || lower.contains("digital display") - || lower.contains("analog display") -} - -/// Query real monitor model names from EDID via registry (shared cache, no PowerShell) -fn query_edid_monitor_names() -> Vec { - crate::display_cache::get_edid_monitor_names() -} - -/// 当 WMI 查询不到显示器时,使用 EnumDisplaySettingsW 枚举显示器作为回退。 -/// 注:Win32_DesktopMonitor 在现代 Windows 上已废弃,经常返回空。 -fn fallback_enumerate_monitors() -> Vec { - use windows_sys::Win32::Graphics::Gdi::{EnumDisplaySettingsW, DEVMODEW, ENUM_CURRENT_SETTINGS}; - - let edid_names = crate::display_cache::get_edid_monitor_names(); - let mut monitors = Vec::new(); - - for i in 0..8 { - let name = format!("\\\\.\\DISPLAY{}", i + 1); - let tries = [name.as_str(), &format!("DISPLAY{}", i + 1)]; - let mut found = false; - for dev_name in &tries { - unsafe { - let wide: Vec = dev_name.encode_utf16().chain(std::iter::once(0)).collect(); - let mut dm: DEVMODEW = std::mem::zeroed(); - dm.dmSize = std::mem::size_of::() as u16; - if EnumDisplaySettingsW(wide.as_ptr(), ENUM_CURRENT_SETTINGS, &mut dm) != 0 { - let w = dm.dmPelsWidth; - let h = dm.dmPelsHeight; - if w > 0 && h > 0 { - let mon_name = edid_names.get(i).cloned() - .filter(|n| !n.is_empty()) - .unwrap_or_else(|| format!("DISPLAY{}", i + 1)); - let manufacturer = if edid_names.get(i).map_or(false, |n| !n.is_empty()) { - "".to_string() - } else { - "未知".to_string() - }; - monitors.push(MonitorInfo { - name: mon_name, - manufacturer, - screen_width: Some(w), - screen_height: Some(h), - refresh_rate: Some(dm.dmDisplayFrequency), - pnp_device_id: format!("DISPLAY{}", i + 1), - status: "OK".to_string(), - availability: Some(3), - }); - found = true; - break; - } - } - } - } - if !found { break; } - } - - log::info!("fallback_enumerate_monitors: 通过 EnumDisplaySettingsW 发现 {} 个显示器", monitors.len()); - monitors -} - -// 静态硬件信息缓存(不会变化的部分) -#[derive(Debug, Clone)] -struct StaticHardwareInfo { - cpu: CpuInfo, - gpu_static: Vec, - motherboard: MotherboardInfo, - memory: Vec, - disk: Vec, - sound_card: Vec, - network_card: Vec, - monitor: Vec, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -struct GpuStaticInfo { - name: String, - vendor: GpuVendor, - memory_gb: f64, - driver_version: String, - video_processor: String, - adapter_compatibility: String, - driver_date: String, - installed_drivers: String, - video_mode: String, - resolution_width: Option, - resolution_height: Option, - refresh_rate: Option, - device_id: String, - pnp_device_id: String, - status: String, - inf_filename: String, - video_architecture: Option, - video_memory_type: Option, -} - -static STATIC_HARDWARE_CACHE: Mutex> = Mutex::new(None); -static HARDWARE_INIT_LOCK: Mutex<()> = Mutex::new(()); -static CPU_SYSTEM: Mutex> = Mutex::new(None); - -fn detect_gpu_vendor(name: &str) -> GpuVendor { - let name_lower = name.to_lowercase(); - if name_lower.contains("nvidia") || name_lower.contains("geforce") || - name_lower.contains("gtx") || name_lower.contains("rtx") { - GpuVendor::NVIDIA - } else if name_lower.contains("amd") || name_lower.contains("radeon") || - name_lower.contains("rx ") { - GpuVendor::AMD - } else if name_lower.contains("intel") { - GpuVendor::Intel - } else { - GpuVendor::Unknown - } -} - -fn run_powershell Deserialize<'de>>(command: &str) -> Result, HardwareError> { - // 强制所有 PowerShell 输出使用 UTF-8 编码,防止中文乱码 - let full_cmd = format!( - "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; {}", - command - ); - let mut cmd = Command::new("powershell"); - cmd.args(&["-Command", &full_cmd]); - - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - const CREATE_NO_WINDOW: u32 = 0x08000000; - cmd.creation_flags(CREATE_NO_WINDOW); - } - - let output = cmd.output() - .map_err(|e| HardwareError::PowerShellError(e.to_string()))?; - - if !output.status.success() { - let error = String::from_utf8_lossy(&output.stderr); - return Err(HardwareError::PowerShellError(error.to_string())); - } - - let stdout = String::from_utf8_lossy(&output.stdout); - let stdout_trimmed = stdout.trim(); - - // 尝试解析为数组,如果失败则尝试解析为单个对象并包装到数组中 - match serde_json::from_str::>(&stdout_trimmed) { - Ok(results) => Ok(results), - Err(e_vec) => { - match serde_json::from_str::(&stdout_trimmed) { - Ok(single) => Ok(vec![single]), - Err(e_single) => { - let preview: String = if stdout_trimmed.len() > 300 { - format!("{}...", &stdout_trimmed[..300]) - } else { - stdout_trimmed.to_string() - }; - log::warn!( - "PowerShell JSON 解析失败 (type={}): vec_err={:?} single_err={:?}\n 原始输出: {}", - std::any::type_name::(), - e_vec, - e_single, - preview - ); - Ok(vec![]) - } - } - } - } -} - -fn get_nvidia_gpus_with_nvml() -> Result, HardwareError> { - use nvml_wrapper::Nvml; - - let nvml = Nvml::init().map_err(|e| HardwareError::NvmlError(e.to_string()))?; - let device_count = nvml - .device_count() - .map_err(|e| HardwareError::NvmlError(e.to_string()))?; - - let mut gpus = Vec::new(); - - for i in 0..device_count { - let device = nvml - .device_by_index(i) - .map_err(|e| HardwareError::NvmlError(e.to_string()))?; - - let name = device - .name() - .map_err(|e| HardwareError::NvmlError(e.to_string()))?; - let memory_info = device - .memory_info() - .map_err(|e| HardwareError::NvmlError(e.to_string()))?; - let memory_gb = memory_info.total as f64 / (1024.0 * 1024.0 * 1024.0); - - let temperature = device - .temperature(nvml_wrapper::enum_wrappers::device::TemperatureSensor::Gpu) - .ok() - .map(|t| if t > 200 { t as f64 / 10.0 } else { t as f64 }); - let utilization = device.utilization_rates().ok(); - let usage = utilization.map(|u| u.gpu); - - let driver_version = nvml - .sys_driver_version() - .map_err(|e| HardwareError::NvmlError(e.to_string()))?; - - log::debug!( - "NVIDIA GPU (NVML): {}, 显存: {:.1}GB, 温度: {:?}°C, 占用: {:?}%", - name, - memory_gb, - temperature, - usage - ); - - gpus.push(GpuInfo { - name, - vendor: GpuVendor::NVIDIA, - memory_gb, - driver_version, - temperature, - usage, - video_processor: String::new(), - adapter_compatibility: "NVIDIA".to_string(), - driver_date: String::new(), - installed_drivers: String::new(), - video_mode: String::new(), - resolution_width: None, - resolution_height: None, - refresh_rate: None, - device_id: String::new(), - pnp_device_id: String::new(), - status: String::new(), - inf_filename: String::new(), - video_architecture: None, - video_memory_type: None, - }); - } - - Ok(gpus) -} - -fn get_nvidia_gpus_with_smi() -> Vec { - let mut gpus = Vec::new(); - - let mut cmd = Command::new("nvidia-smi"); - cmd.args(&[ - "--query-gpu=name,memory.total,temperature.gpu,utilization.gpu,driver_version", - "--format=csv,noheader,nounits", - ]); - - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - const CREATE_NO_WINDOW: u32 = 0x08000000; - cmd.creation_flags(CREATE_NO_WINDOW); - } - - if let Ok(output) = cmd.output() - { - if output.status.success() { - let stdout = String::from_utf8_lossy(&output.stdout); - for line in stdout.lines() { - let parts: Vec<&str> = line.split(',').map(|s| s.trim()).collect(); - if parts.len() >= 5 { - let name = parts[0].to_string(); - let memory_mb: f64 = parts[1].parse().unwrap_or(0.0); - let memory_gb = memory_mb / 1024.0; - let temperature: Option = parts[2].parse().ok().map(|v: u32| v as f64); - let usage: Option = parts[3].parse().ok(); - let driver_version = parts[4].to_string(); - - log::info!( - "NVIDIA GPU (nvidia-smi): {}, 显存: {:.1}GB, 温度: {:?}°C, 占用: {:?}%", - name, - memory_gb, - temperature, - usage - ); - gpus.push(GpuInfo { - name, - vendor: GpuVendor::NVIDIA, - memory_gb, - driver_version, - temperature, - usage, - video_processor: String::new(), - adapter_compatibility: "NVIDIA".to_string(), - driver_date: String::new(), - installed_drivers: String::new(), - video_mode: String::new(), - resolution_width: None, - resolution_height: None, - refresh_rate: None, - device_id: String::new(), - pnp_device_id: String::new(), - status: String::new(), - inf_filename: String::new(), - video_architecture: None, - video_memory_type: None, - }); - } - } - } - } - - gpus -} - -/// 从 LHML (NexBoxMonitor) 管道获取 GPU 信息,支持所有厂商 -fn get_gpus_from_lhml() -> Vec { - let response = match crate::sensor::read_lhm_sensors() { - Ok(r) => r, - Err(e) => { - log::warn!("LHML GPU 查询失败: {}", e); - return Vec::new(); - } - }; - - // 按 (hardware_name, hardware_type) 分组,区分不同 GPU - let mut gpu_groups: Vec<(String, String, Vec<&crate::sensor::SensorReading>)> = Vec::new(); - for sensor in &response.sensors { - let hw_type = sensor.hardware_type.clone(); - if !hw_type.to_lowercase().starts_with("gpu") { - continue; - } - let key = sensor.hardware.clone(); - if let Some(group) = gpu_groups.iter_mut().find(|(k, _, _)| k == &key) { - group.2.push(sensor); - } else { - gpu_groups.push((key, hw_type, vec![sensor])); - } - } - - if gpu_groups.is_empty() { - return Vec::new(); - } - - // 判断各 GPU 是否为核显(LHML 无法区分 AMD 核显/独显,仅通过硬件名辅助判断) - let has_nvidia = gpu_groups.iter().any(|(_, t, _)| t.eq_ignore_ascii_case("GpuNvidia")); - - let mut gpus = Vec::new(); - for (name, hw_type, sensors) in &gpu_groups { - // NVIDIA 独显存在时跳过 Intel 核显,但 AMD 核显保留显示 - // (LHML 统一标记为 GpuAmd,无法区分 APU 核显和独显) - if has_nvidia && hw_type.eq_ignore_ascii_case("GpuIntel") { - log::info!("跳过核显(LHML): 存在 NVIDIA 独显,忽略 GpuIntel"); - continue; - } - - let vendor = if hw_type.eq_ignore_ascii_case("GpuNvidia") { - GpuVendor::NVIDIA - } else if hw_type.eq_ignore_ascii_case("GpuAmd") { - GpuVendor::AMD - } else if hw_type.eq_ignore_ascii_case("GpuIntel") { - GpuVendor::Intel - } else { - detect_gpu_vendor(name) - }; - - // 显存总量 (SmallData "GPU Memory Total",单位为 MB → GB) - let memory_gb = sensors - .iter() - .find(|s| s.sensor_type == "SmallData" && s.name == "GPU Memory Total") - .map(|s| s.value / 1024.0) - .unwrap_or(0.0); - - let temperature = sensors - .iter() - .find(|s| s.sensor_type == "Temperature" && s.name == "GPU Core") - .map(|s| s.value); - - let usage = sensors - .iter() - .find(|s| s.sensor_type == "Load" && s.name == "GPU Core") - .map(|s| s.value as u32); - - let is_integrated = matches!(vendor, GpuVendor::Intel); - if is_integrated { - log::info!( - "核显(LHML): {}, 厂商: {:?}, 显存: {:.1}GB", - name, vendor, memory_gb - ); - } else { - log::info!( - "显卡(LHML): {}, 厂商: {:?}, 显存: {:.1}GB, 温度: {:?}°C, 占用: {:?}%", - name, vendor, memory_gb, temperature, usage - ); - } - - gpus.push(GpuInfo { - name: name.clone(), - vendor, - memory_gb, - driver_version: String::new(), - temperature, - usage, - video_processor: String::new(), - adapter_compatibility: String::new(), - driver_date: String::new(), - installed_drivers: String::new(), - video_mode: String::new(), - resolution_width: None, - resolution_height: None, - refresh_rate: None, - device_id: String::new(), - pnp_device_id: String::new(), - status: String::new(), - inf_filename: String::new(), - video_architecture: None, - video_memory_type: None, - }); - } - - gpus -} - -fn get_gpu_info() -> Vec { - // 1. 尝试用 NVML 获取 NVIDIA 显卡(最佳方案:提供完整信息包括驱动版本) - if let Ok(nvml_gpus) = get_nvidia_gpus_with_nvml() { - if !nvml_gpus.is_empty() { - return nvml_gpus; - } - } - - // 2. 尝试用 nvidia-smi(NVML 失败时的 NVIDIA 回退) - let smi_gpus = get_nvidia_gpus_with_smi(); - if !smi_gpus.is_empty() { - return smi_gpus; - } - - // 3. 通用 LHML 兜底(支持所有厂商:AMD / Intel / NVIDIA) - get_gpus_from_lhml() -} - -// 只获取GPU的动态数据(温度、占用) -fn get_gpu_dynamic_info(gpu_static: &[GpuStaticInfo]) -> Vec<(Option, Option)> { - // 1. 尝试用 NVML - if let Ok(nvml_gpus) = get_nvidia_gpus_with_nvml() { - if !nvml_gpus.is_empty() { - return nvml_gpus.iter().map(|g| (g.temperature, g.usage)).collect(); - } - } - - // 2. 尝试用 nvidia-smi - let smi_gpus = get_nvidia_gpus_with_smi(); - if !smi_gpus.is_empty() { - return smi_gpus.iter().map(|g| (g.temperature, g.usage)).collect(); - } - - // 3. LHML 通用兜底 - let lhml_gpus = get_gpus_from_lhml(); - if !lhml_gpus.is_empty() { - return lhml_gpus.iter().map(|g| (g.temperature, g.usage)).collect(); - } - - // 所有方案均失败,填充 None - vec![(None, None); gpu_static.len()] -} - -// 获取CPU的动态数据(占用)- 使用 sysinfo 库 -fn get_cpu_dynamic_info() -> Option { - use sysinfo::CpuRefreshKind; - use std::thread; - use std::time::Duration; - - let mut cpu_system = CPU_SYSTEM.lock().unwrap(); - - if cpu_system.is_none() { - let mut sys = System::new(); - // 第一次刷新:初始化 - sys.refresh_cpu_specifics(CpuRefreshKind::everything()); - // 短暂等待,让 sysinfo 有时间采集第一个样本 - thread::sleep(Duration::from_millis(50)); - // 第二次刷新:获取准确的 CPU 使用率 - sys.refresh_cpu_specifics(CpuRefreshKind::everything()); - *cpu_system = Some(sys); - } else { - // 正常情况下只需要刷新一次 - let sys = cpu_system.as_mut().unwrap(); - sys.refresh_cpu_specifics(CpuRefreshKind::everything()); - } - - let sys = cpu_system.as_ref().unwrap(); - let cpus = sys.cpus(); - if cpus.is_empty() { - return None; - } - - let total_usage: f32 = cpus.iter().map(|cpu| cpu.cpu_usage()).sum::() / cpus.len() as f32; - let usage = total_usage.round() as u16; - - log::debug!("CPU占用 (sysinfo): {}%", usage); - Some(usage) -} - -fn architecture_name(code: Option) -> String { - match code { - Some(0) => "x86".into(), - Some(1) => "MIPS".into(), - Some(2) => "Alpha".into(), - Some(3) => "PowerPC".into(), - Some(5) => "ARM".into(), - Some(6) => "ia64".into(), - Some(7) => "Alpha64".into(), - Some(9) => "x64".into(), - Some(12) => "ARM64".into(), - _ => "未知".into(), - } -} - -fn memory_form_factor_name(code: Option) -> String { - match code { - Some(0) => "未知".into(), - Some(1) => "Other".into(), - Some(2) => "SIP".into(), - Some(3) => "DIP".into(), - Some(4) => "ZIP".into(), - Some(5) => "SOJ".into(), - Some(6) => "Proprietary".into(), - Some(7) => "SIMM".into(), - Some(8) => "DIMM".into(), - Some(9) => "TSOP".into(), - Some(10) => "PGA".into(), - Some(11) => "RIMM".into(), - Some(12) => "SODIMM".into(), - Some(13) => "SRIMM".into(), - Some(14) => "SMD".into(), - Some(15) => "SSMP".into(), - Some(16) => "QFP".into(), - Some(17) => "TQFP".into(), - Some(18) => "SOIC".into(), - Some(19) => "LCC".into(), - Some(20) => "PLCC".into(), - Some(21) => "BGA".into(), - Some(22) => "FPBGA".into(), - Some(23) => "LGA".into(), - Some(24) => "FB-DIMM".into(), - _ => "未知".into(), - } -} - -fn memory_type_name(code: Option) -> String { - match code { - Some(0) => "未知".into(), - Some(1) => "Other".into(), - Some(2) => "DRAM".into(), - Some(3) => "Synchronous DRAM".into(), - Some(4) => "Cache DRAM".into(), - Some(5) => "EDO".into(), - Some(6) => "EDRAM".into(), - Some(7) => "VRAM".into(), - Some(8) => "SRAM".into(), - Some(9) => "RAM".into(), - Some(10) => "ROM".into(), - Some(11) => "Flash".into(), - Some(12) => "EEPROM".into(), - Some(13) => "FEPROM".into(), - Some(14) => "EPROM".into(), - Some(15) => "CDRAM".into(), - Some(16) => "3DRAM".into(), - Some(17) => "SDRAM".into(), - Some(18) => "SGRAM".into(), - Some(19) => "RDRAM".into(), - Some(20) => "DDR".into(), - Some(21) => "DDR2".into(), - Some(22) => "DDR2 FB-DIMM".into(), - Some(24) => "DDR3".into(), - Some(25) => "FBD2".into(), - Some(26) => "DDR4".into(), - Some(27) => "LPDDR".into(), - Some(28) => "LPDDR2".into(), - Some(29) => "LPDDR3".into(), - Some(30) => "LPDDR4".into(), - Some(31) => "Logical non-volatile".into(), - Some(32) => "HBM".into(), - Some(33) => "HBM2".into(), - Some(34) => "DDR5".into(), - Some(35) => "LPDDR5".into(), - Some(36) => "HBM3".into(), - _ => "未知".into(), - } -} - -fn chassis_type_name(codes: &Option>) -> String { - match codes.as_ref().and_then(|v| v.first()).copied() { - Some(1) => "Other".into(), - Some(2) => "Unknown".into(), - Some(3) => "Desktop".into(), - Some(4) => "Low Profile Desktop".into(), - Some(5) => "Pizza Box".into(), - Some(6) => "Mini Tower".into(), - Some(7) => "Tower".into(), - Some(8) => "Portable".into(), - Some(9) => "Laptop".into(), - Some(10) => "Notebook".into(), - Some(11) => "Hand Held".into(), - Some(12) => "Docking Station".into(), - Some(13) => "All in One".into(), - Some(14) => "Sub Notebook".into(), - Some(15) => "Space-Saving".into(), - Some(16) => "Lunch Box".into(), - Some(17) => "Main System Chassis".into(), - Some(18) => "Expansion Chassis".into(), - Some(19) => "Sub Chassis".into(), - Some(20) => "Bus Expansion Chassis".into(), - Some(21) => "Peripheral Chassis".into(), - Some(22) => "Storage Chassis".into(), - Some(23) => "Rack Mount Chassis".into(), - Some(24) => "Sealed-Case PC".into(), - Some(25) => "Multi-System Chassis".into(), - Some(26) => "Compact PCI".into(), - Some(27) => "Advanced TCA".into(), - Some(28) => "Blade".into(), - Some(29) => "Blade Enclosure".into(), - Some(30) => "Tablet".into(), - Some(31) => "Convertible".into(), - Some(32) => "Detachable".into(), - Some(33) => "IoT Gateway".into(), - Some(34) => "Embedded PC".into(), - Some(35) => "Mini PC".into(), - Some(36) => "Stick PC".into(), - _ => "未知".into(), - } -} - -fn get_static_hardware_info() -> Result { - // Fast path: 先检查缓存,不加初始化锁 - { - let cache = STATIC_HARDWARE_CACHE.lock().unwrap(); - if let Some(ref info) = *cache { - log::debug!("从缓存获取静态硬件信息"); - return Ok(info.clone()); - } - } - - // 序列化首次初始化,防止并发重复获取 - let _init_guard = HARDWARE_INIT_LOCK.lock().unwrap(); - - // Double-check: 获取锁后再次检查缓存 - { - let cache = STATIC_HARDWARE_CACHE.lock().unwrap(); - if let Some(ref info) = *cache { - log::debug!("从缓存获取静态硬件信息"); - return Ok(info.clone()); - } - } - - log::info!("开始并行获取静态硬件信息..."); - - let errors: Arc>> = Arc::new(Mutex::new(Vec::new())); - - let errors_cpu = errors.clone(); - let cpu_handle = thread::spawn(move || { - let wql = "SELECT Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed, L2CacheSize, L2CacheSpeed, L3CacheSize, L3CacheSpeed, LoadPercentage, Manufacturer, Architecture, SocketDesignation, CurrentClockSpeed, ExtClock, ProcessorId, Family, Stepping, Revision, NumberOfEnabledCore, VoltageCaps FROM Win32_Processor"; - match wmi_query::wmi_query(wql) { - Ok(results) => { - log::info!("获取到{}个CPU信息", results.len()); - results.into_iter().next().map(|row| { - let name = wmi_query::v_str(row.get("Name").unwrap_or(&wmi::Variant::Null)).unwrap_or_else(|| "未知CPU".to_string()); - log::info!("CPU型号: {}", name); - CpuInfo { - name, - manufacturer: wmi_query::v_str(row.get("Manufacturer").unwrap_or(&wmi::Variant::Null)).unwrap_or_else(|| "未知".to_string()), - cores: wmi_query::v_u32(row.get("NumberOfCores").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - threads: wmi_query::v_u32(row.get("NumberOfLogicalProcessors").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - max_clock_speed: wmi_query::v_u32(row.get("MaxClockSpeed").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - l2_cache_size: wmi_query::v_u32(row.get("L2CacheSize").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - l3_cache_size: wmi_query::v_u32(row.get("L3CacheSize").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - load_percentage: wmi_query::v_u16(row.get("LoadPercentage").unwrap_or(&wmi::Variant::Null)), - architecture: architecture_name(wmi_query::v_u16(row.get("Architecture").unwrap_or(&wmi::Variant::Null))), - socket: wmi_query::v_str(row.get("SocketDesignation").unwrap_or(&wmi::Variant::Null)).unwrap_or_else(|| "未知".to_string()), - l2_cache_speed: wmi_query::v_u32(row.get("L2CacheSpeed").unwrap_or(&wmi::Variant::Null)), - l3_cache_speed: wmi_query::v_u32(row.get("L3CacheSpeed").unwrap_or(&wmi::Variant::Null)), - current_clock_speed: wmi_query::v_u32(row.get("CurrentClockSpeed").unwrap_or(&wmi::Variant::Null)), - ext_clock: wmi_query::v_u32(row.get("ExtClock").unwrap_or(&wmi::Variant::Null)), - processor_id: wmi_query::v_str(row.get("ProcessorId").unwrap_or(&wmi::Variant::Null)).unwrap_or_else(|| "未知".to_string()), - family: wmi_query::v_u32(row.get("Family").unwrap_or(&wmi::Variant::Null)).unwrap_or(0), - stepping: wmi_query::v_str(row.get("Stepping").unwrap_or(&wmi::Variant::Null)).unwrap_or_else(|| "未知".to_string()), - revision: wmi_query::v_u16(row.get("Revision").unwrap_or(&wmi::Variant::Null)).map(|r| r.to_string()).unwrap_or_else(|| "未知".to_string()), - enabled_cores: wmi_query::v_u32(row.get("NumberOfEnabledCore").unwrap_or(&wmi::Variant::Null)), - voltage_caps: wmi_query::v_u16(row.get("VoltageCaps").unwrap_or(&wmi::Variant::Null)).map(|v| format!("{} mV", v)), - } - }) - } - Err(e) => { - if let Ok(mut errs) = errors_cpu.lock() { - errs.push(format!("CPU: {}", e)); - } - None - } - } - }); - - let gpu_handle = thread::spawn(move || { - let gpu = get_gpu_info(); - gpu.into_iter().map(|g| GpuStaticInfo { - name: g.name, - vendor: g.vendor, - memory_gb: g.memory_gb, - driver_version: g.driver_version, - video_processor: g.video_processor, - adapter_compatibility: g.adapter_compatibility, - driver_date: g.driver_date, - installed_drivers: g.installed_drivers, - video_mode: g.video_mode, - resolution_width: g.resolution_width, - resolution_height: g.resolution_height, - refresh_rate: g.refresh_rate, - device_id: g.device_id, - pnp_device_id: g.pnp_device_id, - status: g.status, - inf_filename: g.inf_filename, - video_architecture: g.video_architecture, - video_memory_type: g.video_memory_type, - }).collect::>() - }); - - let errors_mobo = errors.clone(); - let mobo_handle = thread::spawn(move || { - - // 4 个独立的 WMI COM 查询(无需 PowerShell) - let mobo_rows = wmi_query::wmi_query("SELECT Manufacturer, Product, SerialNumber, Version FROM Win32_BaseBoard").unwrap_or_default(); - let sys_rows = wmi_query::wmi_query("SELECT Manufacturer, Model, SystemType FROM Win32_ComputerSystem").unwrap_or_default(); - let bios_rows = wmi_query::wmi_query("SELECT Manufacturer, SMBIOSBIOSVersion, ReleaseDate FROM Win32_BIOS").unwrap_or_default(); - let chassis_rows = wmi_query::wmi_query("SELECT ChassisTypes FROM Win32_SystemEnclosure").unwrap_or_default(); - - let mobo_row = mobo_rows.first(); - let sys_row = sys_rows.first(); - let bios_row = bios_rows.first(); - let chassis_row = chassis_rows.first(); - - // 日志 - if let Some(m) = mobo_row { - let manu = m.get("Manufacturer").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let prod = m.get("Product").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - log::info!("主板: {} {}", manu, prod); - } else if let Some(s) = sys_row { - let manu = s.get("Manufacturer").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let model = s.get("Model").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - log::info!("主板(Win32_BaseBoard 为空,回退 Win32_ComputerSystem): {} {}", manu, model); - } - if let Some(b) = bios_row { - let ver = b.get("SMBIOSBIOSVersion").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - log::info!("BIOS: {}", ver); - } - - // 主板信息为空时上报 warning - if mobo_row.is_none() { - if let Ok(mut errs) = errors_mobo.lock() { - errs.push("主板: WMI查询失败 (Win32_BaseBoard 返回空,已用 Win32_ComputerSystem 回退)".to_string()); - } - } - - // 兜底:BaseBoard 为空时用 ComputerSystem 的 Manufacturer / Model - let product = mobo_row - .and_then(|m| m.get("Product").and_then(|v| wmi_query::v_str(v))) - .or_else(|| sys_row.and_then(|s| s.get("Model").and_then(|v| wmi_query::v_str(v)))) - .unwrap_or_else(|| "未知".to_string()); - let manufacturer = mobo_row - .and_then(|m| m.get("Manufacturer").and_then(|v| wmi_query::v_str(v))) - .or_else(|| sys_row.and_then(|s| s.get("Manufacturer").and_then(|v| wmi_query::v_str(v)))) - .unwrap_or_else(|| "未知".to_string()); - - let chassis_types = chassis_row - .and_then(|c| c.get("ChassisTypes")) - .map(|v| wmi_query::v_u16_arr(v)) - .filter(|a| !a.is_empty()); - - Some(MotherboardInfo { - product, - manufacturer, - serial_number: mobo_row.and_then(|m| m.get("SerialNumber").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - version: mobo_row.and_then(|m| m.get("Version").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - bios_vendor: bios_row.and_then(|b| b.get("Manufacturer").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - bios_version: bios_row.and_then(|b| b.get("SMBIOSBIOSVersion").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - bios_release_date: bios_row.and_then(|b| b.get("ReleaseDate").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - system_manufacturer: sys_row.and_then(|s| s.get("Manufacturer").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - system_model: sys_row.and_then(|s| s.get("Model").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - system_type: sys_row.and_then(|s| s.get("SystemType").and_then(|v| wmi_query::v_str(v))).unwrap_or_else(|| "未知".to_string()), - chassis_type: chassis_type_name(&chassis_types), - }) - }); - - let errors_mem = errors.clone(); - let mem_handle = thread::spawn(move || { - match wmi_query::wmi_query("SELECT Manufacturer, PartNumber, Capacity, Speed, BankLabel, FormFactor, MemoryType, ConfiguredClockSpeed, ConfiguredVoltage, DataWidth, TotalWidth, SerialNumber, TypeDetail FROM Win32_PhysicalMemory") { - Ok(results) => { - log::info!("获取到{}个内存条信息", results.len()); - results.into_iter().map(|row| { - let capacity_bytes = row.get("Capacity").and_then(|v| wmi_query::v_u64(v)).unwrap_or(0) as f64; - MemoryInfo { - manufacturer: row.get("Manufacturer").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - part_number: row.get("PartNumber").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()).trim().to_string(), - capacity_gb: capacity_bytes / (1024.0 * 1024.0 * 1024.0), - // Speed: 优先使用 ConfiguredClockSpeed(实际运行频率), - // 回退到 Speed(模块额定频率),因为 Speed 在某些系统(特别是 DDR5)上可能不准确 - speed_mhz: { - let configured = row.get("ConfiguredClockSpeed").and_then(|v| wmi_query::v_u32(v)).unwrap_or(0); - if configured > 0 { configured } - else { row.get("Speed").and_then(|v| wmi_query::v_u32(v)).unwrap_or(0) } - }, - bank_label: row.get("BankLabel").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - form_factor: memory_form_factor_name(row.get("FormFactor").and_then(|v| wmi_query::v_u16(v))), - memory_type: memory_type_name(row.get("MemoryType").and_then(|v| wmi_query::v_u16(v))), - configured_clock_speed: row.get("ConfiguredClockSpeed").and_then(|v| wmi_query::v_u32(v)), - configured_voltage: row.get("ConfiguredVoltage").and_then(|v| wmi_query::v_u32(v)), - data_width: row.get("DataWidth").and_then(|v| wmi_query::v_u32(v)), - total_width: row.get("TotalWidth").and_then(|v| wmi_query::v_u32(v)), - serial_number: row.get("SerialNumber").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - type_detail: row.get("TypeDetail").and_then(|v| wmi_query::v_u16(v)).map(|d| d.to_string()).unwrap_or_else(|| "未知".to_string()), - } - }).collect::>() - } - Err(e) => { - if let Ok(mut errs) = errors_mem.lock() { - errs.push(format!("内存: {}", e)); - } - Vec::new() - } - } - }); - - let errors_disk = errors.clone(); - let disk_handle = thread::spawn(move || { - match wmi_query::wmi_query("SELECT Model, Size, InterfaceType, SerialNumber, FirmwareRevision, MediaType, BytesPerSector, Partitions, Status, PNPDeviceID FROM Win32_DiskDrive") { - Ok(results) => { - log::info!("获取到{}个硬盘信息", results.len()); - results.into_iter().map(|row| { - let size_gb = row.get("Size").and_then(|v| wmi_query::v_u64(v)).unwrap_or(0) as f64 / (1024.0 * 1024.0 * 1024.0); - let media_type = row.get("MediaType").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let is_ssd = media_type.to_lowercase().contains("ssd") || media_type.to_lowercase().contains("solid state"); - DiskDetailInfo { - model: row.get("Model").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - size_gb, - interface_type: row.get("InterfaceType").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - serial_number: row.get("SerialNumber").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - firmware_revision: row.get("FirmwareRevision").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - media_type: if media_type.is_empty() { "未知".to_string() } else { media_type }, - bytes_per_sector: row.get("BytesPerSector").and_then(|v| wmi_query::v_u32(v)), - partitions: row.get("Partitions").and_then(|v| wmi_query::v_u32(v)).unwrap_or(0), - status: row.get("Status").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - is_ssd, - } - }).collect::>() - } - Err(e) => { - if let Ok(mut errs) = errors_disk.lock() { - errs.push(format!("硬盘: {}", e)); - } - Vec::new() - } - } - }); - - let errors_sound = errors.clone(); - let sound_handle = thread::spawn(move || { - match wmi_query::wmi_query("SELECT Name, Manufacturer, Status, DeviceID, PNPDeviceID FROM Win32_SoundDevice") { - Ok(results) => { - let sound_filter_keywords = [ - "Virtual", "VB-Audio", "Voicemeeter", "CABLE", "Sonic Studio", - "NVIDIA Virtual", "Steam Streaming", "Oculus", "Wave Link", - "Elgato Sound Capture", "Nahimic", "DTS", "Dolby", - "Bluetooth", "Hands-Free", "S/PDIF", - ]; - let filtered: Vec<_> = results.into_iter() - .filter(|row| { - let status = row.get("Status").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let pnp = row.get("PNPDeviceID").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let name = row.get("Name").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - if status != "OK" { return false; } - let pnp_lower = pnp.to_lowercase(); - if pnp_lower.starts_with("usb\\") || pnp_lower.starts_with("hid\\") || pnp_lower.starts_with("swd\\") { - return false; - } - let name_lower = name.to_lowercase(); - !sound_filter_keywords.iter().any(|kw| name_lower.contains(&kw.to_lowercase())) - }) - .collect(); - log::info!("获取到{}个声卡信息", filtered.len()); - filtered.into_iter().map(|row| { - SoundCardInfo { - name: row.get("Name").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - manufacturer: row.get("Manufacturer").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - status: row.get("Status").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - device_id: row.get("DeviceID").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - pnp_device_id: row.get("PNPDeviceID").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - } - }).collect::>() - } - Err(e) => { - if let Ok(mut errs) = errors_sound.lock() { - errs.push(format!("声卡: {}", e)); - } - Vec::new() - } - } - }); - - let errors_network = errors.clone(); - let network_handle = thread::spawn(move || { - use wmi::Variant; - match wmi_query::wmi_query("SELECT Name, Manufacturer, AdapterType, MACAddress, Speed, NetConnectionID, ServiceName, Index, MaxSpeed, GUID, PhysicalAdapter, NetEnabled, PNPDeviceID FROM Win32_NetworkAdapter") { - Ok(results) => { - let net_filter_keywords = [ - "Hyper-V", "vEthernet", "Virtual", "VirtualBox", "VMware", - "Bluetooth", "Tailscale", "ZeroTier", "WSL", "Docker", - "Npcap", "WireGuard", "OpenVPN", "TAP-Windows", "WAN Miniport", - "VPN", "Proton", "Nord", "Cloudflare WARP", - ]; - let filtered: Vec<_> = results.into_iter() - .filter(|row| { - let physical = matches!(row.get("PhysicalAdapter"), Some(Variant::Bool(true))); - let enabled = matches!(row.get("NetEnabled"), Some(Variant::Bool(true))); - if !physical || !enabled { return false; } - let pnp = row.get("PNPDeviceID").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - if pnp.to_lowercase().starts_with("swd\\") { return false; } - let name = row.get("Name").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let adapter = row.get("AdapterType").and_then(|v| wmi_query::v_str(v)).unwrap_or_default(); - let name_lower = name.to_lowercase(); - !net_filter_keywords.iter().any(|kw| name_lower.contains(&kw.to_lowercase())) - && !adapter.to_lowercase().contains("loopback") - }) - .collect(); - log::info!("获取到{}个网卡信息", filtered.len()); - filtered.into_iter().map(|row| { - let speed_bps = row.get("Speed").and_then(|v| wmi_query::v_u64(v)).unwrap_or(0); - let max_bps = row.get("MaxSpeed").and_then(|v| wmi_query::v_u64(v)); - NetworkCardInfo { - name: row.get("Name").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - manufacturer: row.get("Manufacturer").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - adapter_type: row.get("AdapterType").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - mac_address: row.get("MACAddress").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - speed_mbps: speed_bps / 1_000_000, - connection_name: row.get("NetConnectionID").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - service_name: row.get("ServiceName").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - index: row.get("Index").and_then(|v| wmi_query::v_u32(v)).unwrap_or(0), - max_speed: max_bps.map(|s| s / 1_000_000), - guid: row.get("GUID").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - } - }).collect::>() - } - Err(e) => { - if let Ok(mut errs) = errors_network.lock() { - errs.push(format!("网卡: {}", e)); - } - Vec::new() - } - } - }); - - let monitor_handle = thread::spawn(move || { - // Win32_DesktopMonitor 在现代 Windows 上已废弃,经常返回空, - // 所以 WMI 失败或为空时会自动回退到 EnumDisplaySettingsW + 注册表 EDID 方案。 - let wmi_results = wmi_query::wmi_query("SELECT Name, MonitorManufacturerName, ScreenWidth, ScreenHeight, DisplayFrequency, PNPDeviceID, Status, Availability FROM Win32_DesktopMonitor"); - - match wmi_results { - Ok(results) if !results.is_empty() => { - let filtered: Vec<_> = results.into_iter() - .filter(|row| { - let name_ok = row.get("Name").map_or(false, |v| wmi_query::v_nonempty(v)); - let pnp_ok = row.get("PNPDeviceID").map_or(false, |v| wmi_query::v_nonempty(v)); - name_ok && pnp_ok - }) - .collect(); - log::info!("获取到{}个显示器信息", filtered.len()); - - if filtered.is_empty() { - log::debug!("WMI 结果经筛选后为空,回退到 EnumDisplaySettingsW"); - return fallback_enumerate_monitors(); - } - - let mut monitors: Vec = filtered.into_iter().map(|row| { - MonitorInfo { - name: row.get("Name").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - manufacturer: row.get("MonitorManufacturerName").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - screen_width: row.get("ScreenWidth").and_then(|v| wmi_query::v_u32(v)), - screen_height: row.get("ScreenHeight").and_then(|v| wmi_query::v_u32(v)), - refresh_rate: row.get("DisplayFrequency").and_then(|v| wmi_query::v_u32(v)), - pnp_device_id: row.get("PNPDeviceID").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - status: row.get("Status").and_then(|v| wmi_query::v_str(v)).unwrap_or_else(|| "未知".to_string()), - availability: row.get("Availability").and_then(|v| wmi_query::v_u16(v)), - } - }).collect::>(); - - // EDID 回退(通过注册表读取,无 PowerShell):如果名称是通用的,替换为真实型号 - let has_generic = monitors.iter().any(|m| is_generic_monitor_name(&m.name)); - if has_generic { - log::info!("检测到通用显示器名称,从注册表 EDID 获取真实型号..."); - let edid_names = query_edid_monitor_names(); - if !edid_names.is_empty() { - for (i, m) in monitors.iter_mut().enumerate() { - if is_generic_monitor_name(&m.name) { - if let Some(edid_name) = edid_names.get(i) { - if !edid_name.is_empty() { - log::info!("显示器[{}]: EDID 替换 '{}' -> '{}'", i, m.name, edid_name); - m.name = edid_name.clone(); - } - } else if edid_names.len() == 1 && !edid_names[0].is_empty() { - log::info!("显示器[{}]: EDID 替换(单结果) '{}' -> '{}'", i, m.name, edid_names[0]); - m.name = edid_names[0].clone(); - } - } - } - } - } - - monitors - } - _ => { - log::debug!("WMI Win32_DesktopMonitor 不可用或为空,回退到 EnumDisplaySettingsW 枚举显示器"); - fallback_enumerate_monitors() - } - } - }); - - let cpu = cpu_handle.join().unwrap_or_else(|_| None).unwrap_or_else(|| CpuInfo { - name: "未知CPU".to_string(), - manufacturer: "未知".to_string(), - cores: 0, - threads: 0, - max_clock_speed: 0, - l2_cache_size: 0, - l3_cache_size: 0, - load_percentage: None, - architecture: "未知".to_string(), - socket: "未知".to_string(), - l2_cache_speed: None, - l3_cache_speed: None, - current_clock_speed: None, - ext_clock: None, - processor_id: "未知".to_string(), - family: 0, - stepping: "未知".to_string(), - revision: "未知".to_string(), - enabled_cores: None, - voltage_caps: None, - }); - - let gpu_static = gpu_handle.join().unwrap_or_else(|_| Vec::new()); - let motherboard = mobo_handle.join().unwrap_or_else(|_| None).unwrap_or_else(|| MotherboardInfo { - product: "未知".to_string(), - manufacturer: "未知".to_string(), - serial_number: "未知".to_string(), - version: "未知".to_string(), - bios_vendor: "未知".to_string(), - bios_version: "未知".to_string(), - bios_release_date: "未知".to_string(), - system_manufacturer: "未知".to_string(), - system_model: "未知".to_string(), - system_type: "未知".to_string(), - chassis_type: "未知".to_string(), - }); - let memory = mem_handle.join().unwrap_or_else(|_| Vec::new()); - let disk = disk_handle.join().unwrap_or_else(|_| Vec::new()); - let sound_card = sound_handle.join().unwrap_or_else(|_| Vec::new()); - let network_card = network_handle.join().unwrap_or_else(|_| Vec::new()); - let mut monitor = monitor_handle.join().unwrap_or_else(|_| Vec::new()); - // Fallback: fill monitor resolution/refresh from GPU output if WMI didn't provide it - if !gpu_static.is_empty() && !monitor.is_empty() { - let gpu = &gpu_static[0]; - for m in monitor.iter_mut() { - if m.screen_width.is_none() { m.screen_width = gpu.resolution_width; } - if m.screen_height.is_none() { m.screen_height = gpu.resolution_height; } - if m.refresh_rate.is_none() { m.refresh_rate = gpu.refresh_rate; } - } - } - - if let Ok(errs) = errors.lock() { - for e in errs.iter() { - log::warn!("硬件获取警告: {}", e); - } - } - - let static_info = StaticHardwareInfo { - cpu, - gpu_static, - motherboard, - memory, - disk, - sound_card, - network_card, - monitor, - }; - - { - let mut cache = STATIC_HARDWARE_CACHE.lock().unwrap(); - *cache = Some(static_info.clone()); - } - - log::info!("静态硬件信息并行获取完成"); - Ok(static_info) -} - -pub fn get_hardware_info() -> Result { - let static_info = get_static_hardware_info()?; - - // 获取动态数据 - let cpu_load = get_cpu_dynamic_info(); - let gpu_dynamic = get_gpu_dynamic_info(&static_info.gpu_static); - - // 组合完整信息 - let mut cpu = static_info.cpu; - // 仅在成功读取到动态 CPU 占用时覆盖静态值,避免在失败时将已有值清空 - if let Some(load) = cpu_load { - cpu.load_percentage = Some(load); - } - - let gpu: Vec = static_info - .gpu_static - .iter() - .enumerate() - .map(|(i, gs)| { - let (temp, usage) = gpu_dynamic.get(i).copied().unwrap_or((None, None)); - GpuInfo { - name: gs.name.clone(), - vendor: gs.vendor.clone(), - memory_gb: gs.memory_gb, - driver_version: gs.driver_version.clone(), - temperature: temp, - usage, - video_processor: gs.video_processor.clone(), - adapter_compatibility: gs.adapter_compatibility.clone(), - driver_date: gs.driver_date.clone(), - installed_drivers: gs.installed_drivers.clone(), - video_mode: gs.video_mode.clone(), - resolution_width: gs.resolution_width, - resolution_height: gs.resolution_height, - refresh_rate: gs.refresh_rate, - device_id: gs.device_id.clone(), - pnp_device_id: gs.pnp_device_id.clone(), - status: gs.status.clone(), - inf_filename: gs.inf_filename.clone(), - video_architecture: gs.video_architecture.clone(), - video_memory_type: gs.video_memory_type.clone(), - } - }) - .collect(); - - Ok(HardwareInfo { - cpu, - gpu, - motherboard: static_info.motherboard, - memory: static_info.memory, - disk: static_info.disk, - sound_card: static_info.sound_card, - network_card: static_info.network_card, - monitor: static_info.monitor, - }) -} - -#[tauri::command] -pub async fn get_hardware() -> Result { - match tauri::async_runtime::spawn_blocking(|| get_hardware_info()).await { - Ok(Ok(info)) => Ok(info), - Ok(Err(e)) => Err(e.to_string()), - Err(e) => Err(e.to_string()), - } -} - -#[tauri::command] -pub async fn get_cpu_load() -> Result, String> { - match tauri::async_runtime::spawn_blocking(|| get_cpu_dynamic_info()).await { - Ok(load) => Ok(load), - Err(e) => Err(e.to_string()), - } -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct GpuStatus { - pub temperature: Option, - pub usage: Option, -} - -#[tauri::command] -pub async fn get_gpu_status(index: usize) -> Result { - let result = tauri::async_runtime::spawn_blocking(move || { - // 1. NVML(NVIDIA 最佳方案) - if let Ok(nvml_gpus) = get_nvidia_gpus_with_nvml() { - if let Some(gpu) = nvml_gpus.get(index) { - return GpuStatus { - temperature: gpu.temperature, - usage: gpu.usage, - }; - } - } - - // 2. LHML 通用兜底(支持所有厂商),按硬件名分组以支持多 GPU 索引 - if let Ok(response) = crate::sensor::read_lhm_sensors() { - let mut gpu_names: Vec = Vec::new(); - for s in &response.sensors { - let ht = s.hardware_type.to_lowercase(); - if !ht.starts_with("gpu") { - continue; - } - let key = s.hardware.clone(); - if !gpu_names.contains(&key) { - gpu_names.push(key); - } - } - - // 仅 NVIDIA 独显存在时过滤 Intel 核显,AMD 核显保留显示 - let has_nvidia = gpu_names.iter().any(|name| { - response.sensors.iter().any(|s| { - s.hardware == *name - && s.hardware_type.eq_ignore_ascii_case("GpuNvidia") - }) - }); - let visible: Vec<&String> = gpu_names - .iter() - .filter(|name| { - if !has_nvidia { - return true; - } - !response.sensors.iter().any(|s| { - s.hardware == **name - && s.hardware_type.eq_ignore_ascii_case("GpuIntel") - }) - }) - .collect(); - - if let Some(gpu_name) = visible.get(index) { - let temp = response - .sensors - .iter() - .filter(|s| { - s.hardware == **gpu_name - && s.sensor_type == "Temperature" - && s.name == "GPU Core" - }) - .map(|s| s.value) - .next(); - let usage = response - .sensors - .iter() - .filter(|s| { - s.hardware == **gpu_name - && s.sensor_type == "Load" - && s.name == "GPU Core" - }) - .map(|s| s.value as u32) - .next(); - return GpuStatus { temperature: temp, usage }; - } - } - - GpuStatus { - temperature: None, - usage: None, - } - }) - .await; - - match result { - Ok(status) => Ok(status), - Err(e) => Err(e.to_string()), - } -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct DiskInfo { - pub name: String, - pub total_gb: f64, - pub available_gb: f64, - pub used_gb: f64, - pub usage_percent: f64, -} - -#[tauri::command] -pub async fn get_disk_status() -> Result { - let result = tauri::async_runtime::spawn_blocking(|| { - use sysinfo::Disks; - - let disks = Disks::new_with_refreshed_list(); - - let mut total_space: u64 = 0; - let mut available_space: u64 = 0; - - for disk in disks.iter() { - let mount_point = disk.mount_point().to_string_lossy(); - if mount_point.is_empty() { - continue; - } - total_space = total_space.saturating_add(disk.total_space()); - available_space = available_space.saturating_add(disk.available_space()); - } - - let used_space = total_space.saturating_sub(available_space); - let usage_percent = if total_space > 0 { - (used_space as f64 / total_space as f64) * 100.0 - } else { - 0.0 - }; - - let total_gb = total_space as f64 / (1024.0 * 1024.0 * 1024.0); - let available_gb = available_space as f64 / (1024.0 * 1024.0 * 1024.0); - let used_gb = used_space as f64 / (1024.0 * 1024.0 * 1024.0); - - DiskInfo { - name: String::from("All Disks"), - total_gb, - available_gb, - used_gb, - usage_percent, - } - }).await; - - match result { - Ok(info) => Ok(info), - Err(e) => Err(e.to_string()), - } -} - -#[tauri::command] -pub fn is_nvidia_gpu() -> bool { - let cache = STATIC_HARDWARE_CACHE.lock().unwrap(); - cache - .as_ref() - .and_then(|c| c.gpu_static.first()) - .map(|g| g.vendor == GpuVendor::NVIDIA) - .unwrap_or(false) -} - -#[tauri::command] -pub fn get_os_version() -> Result { - sysinfo::System::long_os_version().ok_or_else(|| "无法获取操作系统版本".to_string()) -} - -// ─── Disk Health ─── - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct PartitionInfo { - pub drive_letter: String, - pub total_gb: f64, - pub available_gb: f64, - pub used_gb: f64, - pub usage_percent: f64, - pub filesystem: String, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct DiskHealthInfo { - pub index: u32, - pub model: String, - pub media_type: String, - pub size_gb: f64, - pub interface_type: String, - pub health_status: String, - pub operational_status: String, - pub temperature_c: Option, - pub wear_percentage: Option, - pub power_on_hours: Option, - pub read_errors: Option, - pub write_errors: Option, - pub status: String, - pub partition_count: u32, - pub serial_number: String, - pub partition_style: String, - pub is_boot_disk: bool, - pub partitions: Vec, - pub total_usage_gb: f64, - pub total_capacity_gb: f64, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct DiskHealthResponse { - pub disks: Vec, - pub total_count: u32, - pub healthy_count: u32, - pub warning_count: u32, - pub unhealthy_count: u32, -} - -#[derive(Debug, Deserialize)] -#[allow(non_snake_case, dead_code)] -struct PsDiskHealthRaw { - DeviceId: String, - FriendlyName: String, - Model: String, - MediaType: Option, - Size: Option, - BusType: String, - HealthStatus: String, - OperationalStatus: String, - SerialNumber: Option, - NumberOfPartitions: Option, - Temperature: Option, - WearPercentage: Option, - PowerOnHours: Option, - ReadErrorsTotal: Option, - WriteErrorsTotal: Option, - WmiStatus: Option, - WmiInterfaceType: Option, - PartitionStyle: Option, - IsBoot: Option, - Partitions: Option>, -} - -#[derive(Debug, Deserialize)] -#[allow(non_snake_case)] -struct PsPartitionRaw { - DriveLetter: Option, - SizeRemaining: Option, - Size: Option, - FileSystem: Option, -} - -fn get_disk_health_info_inner() -> Result { - let ps_script = r#" -$disks = Get-PhysicalDisk -ErrorAction SilentlyContinue -$wmiDisks = Get-CimInstance Win32_DiskDrive -ErrorAction SilentlyContinue -$diskLayout = Get-CimInstance -Namespace root\Microsoft\Windows\Storage -Class MSFT_Disk -ErrorAction SilentlyContinue - -# Try multiple methods to get reliability/SMART data -$reliabilityMap = @{} -# Method 1: Standard PowerShell pipeline -try { - $relData = Get-PhysicalDisk -ErrorAction SilentlyContinue | Get-StorageReliabilityCounter -ErrorAction SilentlyContinue - if ($relData) { - foreach ($r in $relData) { - $reliabilityMap[$r.DeviceId] = $r - } - } -} catch {} -# Method 2: WMI MSFT_StorageReliabilityCounter -if ($reliabilityMap.Count -eq 0) { - try { - $relWmi = Get-CimInstance -Namespace root\Microsoft\Windows\Storage -Class MSFT_StorageReliabilityCounter -ErrorAction SilentlyContinue - if ($relWmi) { - foreach ($r in $relWmi) { - $did = if ($r.DeviceId) { $r.DeviceId } else { "PhysicalDrive$($r.PSComputerName)" } - $reliabilityMap[$did] = $r - } - } - } catch {} -} -# Method 3: CIM MSFT_StorageReliabilityCounter -if ($reliabilityMap.Count -eq 0) { - try { - $relCim = Get-CimInstance -Namespace root\Microsoft\Windows\Storage -ClassName MSFT_StorageReliabilityCounter -ErrorAction SilentlyContinue - if ($relCim) { - foreach ($r in $relCim) { - $reliabilityMap[$r.DeviceId] = $r - } - } - } catch {} -} - -$result = $disks | ForEach-Object { - $d = $_ - $rel = $reliabilityMap[$d.DeviceId] - $diskNum = [int]($d.DeviceId -replace '.*?(\d+)$', '$1') - - $wmiMatch = $wmiDisks | Where-Object { $_.Model -eq $d.Model -or $_.Model -eq $d.FriendlyName } | Select-Object -First 1 - - $layout = $diskLayout | Where-Object { $_.Number -eq $diskNum } | Select-Object -First 1 - - $parts = Get-Partition -DiskNumber $diskNum -ErrorAction SilentlyContinue | Where-Object { $_.DriveLetter } | ForEach-Object { - $vol = Get-Volume -DriveLetter $_.DriveLetter -ErrorAction SilentlyContinue - [PSCustomObject]@{ - DriveLetter = if ($vol) { $_.DriveLetter.ToString() } else { $null } - SizeRemaining = if ($vol) { [long]$vol.SizeRemaining } else { $null } - Size = if ($vol) { [long]$vol.Size } else { $null } - FileSystem = if ($vol -and $vol.FileSystemType) { $vol.FileSystemType.ToString() } else { $null } - } - } - - [PSCustomObject]@{ - DeviceId = $d.DeviceId - FriendlyName = $d.FriendlyName - Model = if ($d.Model) { $d.Model } else { $d.FriendlyName } - MediaType = if ($d.MediaType) { $d.MediaType.ToString() } else { $null } - Size = if ($d.Size) { [long]$d.Size } else { $null } - BusType = $d.BusType.ToString() - HealthStatus = $d.HealthStatus.ToString() - OperationalStatus = $d.OperationalStatus.ToString() - SerialNumber = $d.SerialNumber - NumberOfPartitions = if ($d.NumberOfPartitions -ne $null) { [int]$d.NumberOfPartitions } else { $null } - Temperature = if ($rel -and $rel.Temperature -ne $null) { [double]$rel.Temperature } else { $null } - WearPercentage = if ($rel -and $rel.WearPercentage -ne $null) { [double]$rel.WearPercentage } else { $null } - PowerOnHours = if ($rel -and $rel.PowerOnHours -ne $null) { [long]$rel.PowerOnHours } else { $null } - ReadErrorsTotal = if ($rel -and $rel.ReadErrorsTotal -ne $null) { [long]$rel.ReadErrorsTotal } else { $null } - WriteErrorsTotal = if ($rel -and $rel.WriteErrorsTotal -ne $null) { [long]$rel.WriteErrorsTotal } else { $null } - WmiStatus = if ($wmiMatch) { $wmiMatch.Status } else { $null } - WmiInterfaceType = if ($wmiMatch) { $wmiMatch.InterfaceType } else { $null } - PartitionStyle = if ($layout) { if ($layout.PartitionStyle -eq 1) { "MBR" } elseif ($layout.PartitionStyle -eq 2) { "GPT" } elseif ($layout.PartitionStyle -eq 3) { "RAW" } else { "Unknown" } } else { $null } - IsBoot = if ($layout) { [bool]$layout.IsBoot } else { $false } - Partitions = @($parts) - } -} - -if ($result) { $result | ConvertTo-Json -Depth 3 -Compress } else { '[]' } -"#; - - let raw_disks = run_powershell::(ps_script) - .map_err(|e| format!("获取磁盘信息失败: {}", e))?; - - if raw_disks.is_empty() { - return Ok(DiskHealthResponse { - disks: vec![], - total_count: 0, - healthy_count: 0, - warning_count: 0, - unhealthy_count: 0, - }); - } - - let mut disk_infos = Vec::new(); - let mut healthy = 0u32; - let mut warning = 0u32; - let mut unhealthy = 0u32; - - for (i, d) in raw_disks.iter().enumerate() { - let media_type = d.MediaType.as_deref().unwrap_or("Unknown").to_string(); - let size_gb = d.Size.map(|s| s as f64 / 1_000_000_000.0).unwrap_or(0.0); - let health_status = d.HealthStatus.clone(); - let partition_count = d.NumberOfPartitions.unwrap_or(0); - let serial = d.SerialNumber.as_deref().unwrap_or("").to_string(); - let interface_type = d.WmiInterfaceType.as_deref().unwrap_or(&d.BusType).to_string(); - - match health_status.to_lowercase().as_str() { - "healthy" => healthy += 1, - "warning" => warning += 1, - _ => unhealthy += 1, - } - - let partitions: Vec = d.Partitions.as_ref().map(|parts| { - parts.iter().filter_map(|p| { - let letter = p.DriveLetter.as_deref()?; - let total = p.Size.unwrap_or(0) as f64; - let available = p.SizeRemaining.unwrap_or(0) as f64; - let used = total - available; - let usage_pct = if total > 0.0 { (used / total) * 100.0 } else { 0.0 }; - let fs = p.FileSystem.as_deref().unwrap_or("").to_string(); - Some(PartitionInfo { - drive_letter: letter.to_string(), - total_gb: total / 1_000_000_000.0, - available_gb: available / 1_000_000_000.0, - used_gb: used / 1_000_000_000.0, - usage_percent: usage_pct, - filesystem: fs, - }) - }).collect() - }).unwrap_or_default(); - - let total_capacity_gb: f64 = partitions.iter().map(|p| p.total_gb).sum(); - let total_usage_gb: f64 = partitions.iter().map(|p| p.used_gb).sum(); - - disk_infos.push(DiskHealthInfo { - index: i as u32, - model: d.FriendlyName.clone(), - media_type, - size_gb, - interface_type, - health_status, - operational_status: d.OperationalStatus.clone(), - temperature_c: d.Temperature, - wear_percentage: d.WearPercentage, - power_on_hours: d.PowerOnHours, - read_errors: d.ReadErrorsTotal, - write_errors: d.WriteErrorsTotal, - status: d.WmiStatus.as_deref().unwrap_or("").to_string(), - partition_count, - serial_number: serial, - partition_style: d.PartitionStyle.as_deref().unwrap_or("").to_string(), - is_boot_disk: d.IsBoot.unwrap_or(false), - partitions, - total_usage_gb, - total_capacity_gb, - }); - } - - Ok(DiskHealthResponse { - disks: disk_infos, - total_count: raw_disks.len() as u32, - healthy_count: healthy, - warning_count: warning, - unhealthy_count: unhealthy, - }) -} - -#[tauri::command] -pub async fn get_disk_health_info() -> Result { - match tauri::async_runtime::spawn_blocking(|| get_disk_health_info_inner()).await { - Ok(Ok(info)) => Ok(info), - Ok(Err(e)) => Err(e), - Err(e) => Err(format!("异步任务失败: {}", e)), - } -} - -pub fn cleanup_hardware_cache() { - let mut cache = STATIC_HARDWARE_CACHE.lock().unwrap(); - *cache = None; - - let mut cpu_system = CPU_SYSTEM.lock().unwrap(); - *cpu_system = None; - - log::info!("硬件信息缓存已清理"); -} diff --git a/参考/NexBox-main/src-tauri/src/hardware_report.rs b/参考/NexBox-main/src-tauri/src/hardware_report.rs deleted file mode 100644 index 4e00553..0000000 --- a/参考/NexBox-main/src-tauri/src/hardware_report.rs +++ /dev/null @@ -1,1116 +0,0 @@ -use std::collections::VecDeque; -use std::fs::{File, OpenOptions}; -use std::io::{BufRead, BufReader, Write}; -use std::path::PathBuf; -use std::sync::Mutex; - -use serde::{Deserialize, Serialize}; - -// Chart.js 4.x UMD minified — 编译期内联,实现离线可用 -const CHART_JS: &str = include_str!("../resources/chart.umd.min.js"); - -/// 环形缓冲区最大容量(1 条/秒 × 3600 = 1 小时) -const MAX_SAMPLES: usize = 3600; - -/// 每 N 条快照刷一次磁盘 -const DISK_FLUSH_INTERVAL: usize = 10; - -/// 嵌入 HTML 的最大数据点数(30d × 86400s = 2.5M 太多,采样的上限) -const MAX_EMBED_POINTS: usize = 60_000; - -/// 单条硬件快照(时序数据点) -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct HardwareSnapshot { - pub timestamp: String, - pub elapsed_sec: u64, - // CPU - pub cpu_usage: Option, - pub cpu_temp: Option, - pub cpu_clock: Option, - pub cpu_voltage: Option, - pub cpu_power: Option, - pub cpu_fan_speed: Option, - // GPU - pub gpu_usage: Option, - pub gpu_temp: Option, - pub gpu_clock: Option, - pub gpu_voltage: Option, - pub gpu_power: Option, - pub gpu_fan_speed: Option, - pub gpu_vram_used: Option, - pub gpu_vram_total: Option, - pub gpu_memory_clock: Option, - // 其他 - pub memory_usage: Option, - pub ssd_temp: Option, -} - -/// 录制状态(供前端查询) -#[derive(Debug, Serialize)] -pub struct RecordingStatus { - pub is_recording: bool, - pub sample_count: u32, - pub start_time: String, - pub elapsed_sec: u64, -} - -// ─── 持久化路径 ─────────────────────────────────── - -fn data_dir() -> PathBuf { - let base = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - base.join("NexBox") -} - -fn data_file_path() -> PathBuf { - data_dir().join("hardware_data.jsonl") -} - -// ─── 内部录制器 ─────────────────────────────────── - -struct Recorder { - samples: VecDeque, - start_time: std::time::Instant, - start_timestamp: String, - disk_buffer: Vec, // 攒一批再写磁盘 - disk_file: Option, -} - -static RECORDER: Mutex> = Mutex::new(None); - -/// 启动记录器(在 lib.rs setup 中调用) -pub fn start_recording() { - let mut guard = RECORDER.lock().unwrap(); - if guard.is_none() { - // 确保数据目录存在 - let _ = std::fs::create_dir_all(data_dir()); - - // 打开/创建数据文件(追加模式) - let file = OpenOptions::new() - .create(true) - .append(true) - .open(data_file_path()) - .ok(); - - *guard = Some(Recorder { - samples: VecDeque::with_capacity(MAX_SAMPLES), - start_time: std::time::Instant::now(), - start_timestamp: chrono::Local::now().to_rfc3339(), - disk_buffer: Vec::with_capacity(DISK_FLUSH_INTERVAL), - disk_file: file, - }); - log::info!("[HardwareReport] 记录器已启动 (持久化模式)"); - } -} - -/// 停止记录器(在 RunEvent::Exit 中调用) -pub fn stop_recording() { - let mut guard = RECORDER.lock().unwrap(); - if let Some(recorder) = guard.as_mut() { - flush_disk_buffer(recorder); - } - *guard = None; - log::info!("[HardwareReport] 记录器已停止"); -} - -/// 将内存中的磁盘缓冲区刷入文件 -fn flush_disk_buffer(recorder: &mut Recorder) { - if recorder.disk_buffer.is_empty() { - return; - } - if let Some(ref mut file) = recorder.disk_file { - for snap in &recorder.disk_buffer { - if let Ok(line) = serde_json::to_string(snap) { - let _ = writeln!(file, "{}", line); - } - } - let _ = file.flush(); - } - recorder.disk_buffer.clear(); -} - -/// 推送一条快照(从 overlay_panel poller 调用) -pub fn push_snapshot(mut snapshot: HardwareSnapshot) { - let mut guard = RECORDER.lock().unwrap(); - if let Some(recorder) = guard.as_mut() { - snapshot.timestamp = chrono::Local::now().to_rfc3339(); - snapshot.elapsed_sec = recorder.start_time.elapsed().as_secs(); - - // 内存环形缓冲区 - if recorder.samples.len() >= MAX_SAMPLES { - recorder.samples.pop_front(); - } - recorder.samples.push_back(snapshot.clone()); - - // 磁盘缓冲区(攒批写入) - recorder.disk_buffer.push(snapshot); - if recorder.disk_buffer.len() >= DISK_FLUSH_INTERVAL { - flush_disk_buffer(recorder); - } - } -} - -/// 从磁盘文件读取历史数据(最多 30 天) -fn load_disk_data() -> Vec { - let path = data_file_path(); - if !path.exists() { - return Vec::new(); - } - - let thirty_days_ago = chrono::Utc::now() - chrono::Duration::days(30); - let mut all_data = Vec::new(); - - if let Ok(file) = File::open(&path) { - let reader = BufReader::new(file); - for line in reader.lines() { - if let Ok(line) = line { - if line.trim().is_empty() { - continue; - } - if let Ok(snap) = serde_json::from_str::(&line) { - // 只保留 30 天内的数据 - if let Ok(ts) = chrono::DateTime::parse_from_rfc3339(&snap.timestamp) { - if ts < thirty_days_ago { - continue; - } - } - all_data.push(snap); - } - } - } - } - - // 按时间排序 - all_data.sort_by(|a, b| a.elapsed_sec.cmp(&b.elapsed_sec)); - all_data -} - -/// 将磁盘数据与当前会话数据合并、去重、采样 -fn merge_data(mut disk: Vec, session: Vec) -> Vec { - // 合并 - disk.extend(session); - - // 按 timestamp 去重(跨 session 不会冲突) - let mut seen = std::collections::HashSet::new(); - disk.retain(|s| seen.insert(s.timestamp.clone())); - - // 按 timestamp 排序 - disk.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); - - // 基于第一个数据点的 timestamp 重新计算 elapsed_sec, - // 这样即使数据来自多个 session,时间轴也是一致的 - if let Some(first) = disk.first() { - if let Ok(base) = chrono::DateTime::parse_from_rfc3339(&first.timestamp) { - for s in &mut disk { - if let Ok(ts) = chrono::DateTime::parse_from_rfc3339(&s.timestamp) { - let diff = (ts.with_timezone(&chrono::Utc) - base.with_timezone(&chrono::Utc)) - .num_seconds(); - s.elapsed_sec = diff.max(0) as u64; - } - } - } - } - - // 如果超过上限则均匀采样 - if disk.len() > MAX_EMBED_POINTS { - let step = disk.len() as f64 / MAX_EMBED_POINTS as f64; - let mut sampled = Vec::with_capacity(MAX_EMBED_POINTS); - for i in 0..MAX_EMBED_POINTS { - let idx = (i as f64 * step) as usize; - if idx < disk.len() { - sampled.push(disk[idx].clone()); - } - } - sampled - } else { - disk - } -} - -// ─── Tauri 命令 ────────────────────────────────── - -/// 导出 HTML 报告到用户指定路径 -#[tauri::command] -pub async fn export_hardware_report(path: String) -> Result { - tauri::async_runtime::spawn_blocking(move || -> Result { - // 1. 先刷磁盘缓冲区 - { - let mut guard = RECORDER.lock().unwrap(); - if let Some(recorder) = guard.as_mut() { - flush_disk_buffer(recorder); - } - } - - // 2. 加载磁盘历史数据 - let disk_data = load_disk_data(); - - // 3. 获取当前会话数据 - let session_data = { - let guard = RECORDER.lock().unwrap(); - match guard.as_ref() { - Some(recorder) => { - recorder.samples.iter().cloned().collect::>() - } - None => return Err("记录器未启动".to_string()), - } - }; - - // 4. 合并 & 采样 - let all_data = merge_data(disk_data, session_data); - - // 用数据中第一条的时间戳作为报告起始时间 - let start_ts = all_data.first() - .map(|s| s.timestamp.clone()) - .unwrap_or_else(|| chrono::Local::now().to_rfc3339()); - - // 5. 获取静态硬件信息 - let hardware = crate::hardware::get_hardware_info() - .map_err(|e| format!("获取硬件信息失败: {}", e))?; - - // 6. 获取操作系统版本 - let os_version = sysinfo::System::long_os_version() - .unwrap_or_else(|| "Unknown".to_string()); - - // 7. 生成 HTML - let html = generate_html_report(&all_data, &start_ts, &hardware, &os_version); - - // 8. 写入文件 - std::fs::write(&path, html) - .map_err(|e| format!("写入文件失败: {}", e))?; - - log::info!( - "[HardwareReport] 报告已导出: {} ({} 条数据, {:.1} KB)", - path, - all_data.len(), - std::fs::metadata(&path).map(|m| m.len() as f64 / 1024.0).unwrap_or(0.0) - ); - - Ok(format!( - "报告已导出 ({} 条数据)", - all_data.len() - )) - }) - .await - .map_err(|e| format!("导出任务失败: {}", e))? -} - -/// 获取当前录制状态 -#[tauri::command] -pub fn get_hardware_recording_status() -> RecordingStatus { - let guard = RECORDER.lock().unwrap(); - match guard.as_ref() { - Some(recorder) => RecordingStatus { - is_recording: true, - sample_count: recorder.samples.len() as u32, - start_time: recorder.start_timestamp.clone(), - elapsed_sec: recorder.start_time.elapsed().as_secs(), - }, - None => RecordingStatus { - is_recording: false, - sample_count: 0, - start_time: String::new(), - elapsed_sec: 0, - }, - } -} - -/// 清除本地持久化的硬件数据文件 -#[tauri::command] -pub fn clear_hardware_data() -> Result { - let path = data_file_path(); - let deleted = if path.exists() { - std::fs::remove_file(&path).map_err(|e| format!("删除数据文件失败: {}", e))?; - true - } else { - false - }; - - // 重新打开数据文件,让后续数据能继续写入 - let mut guard = RECORDER.lock().unwrap(); - if let Some(recorder) = guard.as_mut() { - // 清空内存 + 磁盘缓冲 + 重置文件句柄 - recorder.samples.clear(); - recorder.disk_buffer.clear(); - recorder.start_time = std::time::Instant::now(); - recorder.start_timestamp = chrono::Utc::now().to_rfc3339(); - recorder.disk_file = OpenOptions::new() - .create(true) - .append(true) - .open(&path) - .ok(); - log::info!("[HardwareReport] 记录器已重置,新数据文件已创建"); - } - - if deleted { - log::info!("[HardwareReport] 持久化数据文件已清除并重建: {:?}", path); - Ok("硬件数据已清除,新数据将继续记录".to_string()) - } else { - Ok("数据文件已重建,将继续记录".to_string()) - } -} - -// ─── HTML 报告生成 ─────────────────────────────── - -fn generate_html_report( - samples: &[HardwareSnapshot], - start_ts: &str, - hardware: &crate::hardware::HardwareInfo, - os_version: &str, -) -> String { - // 序列化数据为 JSON - let data_json = serde_json::to_string(samples).unwrap_or_else(|_| "[]".to_string()); - let hardware_json = serde_json::to_string(hardware).unwrap_or_else(|_| "{}".to_string()); - - // 防止 注入 - let data_json_safe = data_json.replace(" 问题 - let chart_js_safe = CHART_JS.replace("", "<\\/script>"); - - let now = chrono::Local::now().format("%Y-%m-%d %H:%M:%S").to_string(); - let _version = env!("CARGO_PKG_VERSION"); - let _sample_count = samples.len(); - let _duration_sec = samples.last().map(|s| s.elapsed_sec).unwrap_or(0); - - let mut html = String::with_capacity(384 * 1024 + chart_js_safe.len() + data_json_safe.len()); - - // ── HTML head + CSS ── - html.push_str(r#" - - - - -新境盒硬件监控报告 - - - - -
-

NexBox 硬件监控报告

-

Hardware Monitoring Report

-
-
-
-
-
-
硬件信息概览
-
-
-
-
统计摘要
-
-
-
-
实时监控图表
-
-
-
- - - - -"#); - - html -} - -/// HTML 转义 -fn html_escape(s: &str) -> String { - s.replace('&', "&") - .replace('<', "<") - .replace('>', ">") - .replace('"', """) -} diff --git a/参考/NexBox-main/src-tauri/src/hotkey.rs b/参考/NexBox-main/src-tauri/src/hotkey.rs deleted file mode 100644 index 89126ec..0000000 --- a/参考/NexBox-main/src-tauri/src/hotkey.rs +++ /dev/null @@ -1,258 +0,0 @@ -use std::str::FromStr; -use std::sync::atomic::{AtomicU32, Ordering}; -use std::sync::Mutex; - -static OVERLAY_SHORTCUT: Mutex> = Mutex::new(None); -static OVERLAY_SHORTCUT_ID: AtomicU32 = AtomicU32::new(0); - -static CROSSHAIR_SHORTCUT: Mutex> = Mutex::new(None); -static CROSSHAIR_SHORTCUT_ID: AtomicU32 = AtomicU32::new(0); - -static FILTER_SHORTCUT: Mutex> = Mutex::new(None); -static FILTER_SHORTCUT_ID: AtomicU32 = AtomicU32::new(0); - -pub fn init_overlay(app_handle: &tauri::AppHandle, shortcut: &str) -> Result<(), String> { - set_overlay_shortcut(shortcut); - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - app_handle - .global_shortcut() - .register(shortcut) - .map_err(|e| format!("注册悬浮框热键失败: {}", e))?; - } - - log::info!("悬浮框热键已注册: {}", shortcut); - Ok(()) -} - -pub fn update_overlay(app_handle: &tauri::AppHandle, new_shortcut: &str) -> Result<(), String> { - let old_shortcut = get_overlay_shortcut(); - - // 新旧热键相同,无需更新 - if old_shortcut == new_shortcut { - return Ok(()); - } - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - - if !old_shortcut.is_empty() { - let _ = app_handle.global_shortcut().unregister(old_shortcut.as_str()); - } - - if !new_shortcut.is_empty() { - app_handle - .global_shortcut() - .register(new_shortcut) - .map_err(|e| format!("注册悬浮框热键失败: {}", e))?; - } - } - - set_overlay_shortcut(new_shortcut); - log::info!("悬浮框热键已更新: {} -> {}", old_shortcut, new_shortcut); - Ok(()) -} - -pub fn get_overlay_shortcut() -> String { - OVERLAY_SHORTCUT - .lock() - .unwrap() - .clone() - .unwrap_or_default() -} - -pub fn get_overlay_shortcut_id() -> u32 { - OVERLAY_SHORTCUT_ID.load(Ordering::SeqCst) -} - -fn set_overlay_shortcut(shortcut: &str) { - *OVERLAY_SHORTCUT.lock().unwrap() = Some(shortcut.to_string()); - if let Ok(hotkey) = tauri_plugin_global_shortcut::Shortcut::from_str(shortcut) { - OVERLAY_SHORTCUT_ID.store(hotkey.id(), Ordering::SeqCst); - } -} - -pub fn init_crosshair(app_handle: &tauri::AppHandle, shortcut: &str) -> Result<(), String> { - set_crosshair_shortcut(shortcut); - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - app_handle - .global_shortcut() - .register(shortcut) - .map_err(|e| format!("注册准心热键失败: {}", e))?; - } - - log::info!("准心热键已注册: {}", shortcut); - Ok(()) -} - -pub fn update_crosshair(app_handle: &tauri::AppHandle, new_shortcut: &str) -> Result<(), String> { - let old_shortcut = get_crosshair_shortcut(); - - // 新旧热键相同,无需更新 - if old_shortcut == new_shortcut { - return Ok(()); - } - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - - if !old_shortcut.is_empty() { - let _ = app_handle.global_shortcut().unregister(old_shortcut.as_str()); - } - - if !new_shortcut.is_empty() { - app_handle - .global_shortcut() - .register(new_shortcut) - .map_err(|e| format!("注册准心热键失败: {}", e))?; - } - } - - set_crosshair_shortcut(new_shortcut); - log::info!("准心热键已更新: {} -> {}", old_shortcut, new_shortcut); - Ok(()) -} - -pub fn get_crosshair_shortcut() -> String { - CROSSHAIR_SHORTCUT - .lock() - .unwrap() - .clone() - .unwrap_or_default() -} - -pub fn get_crosshair_shortcut_id() -> u32 { - CROSSHAIR_SHORTCUT_ID.load(Ordering::SeqCst) -} - -fn set_crosshair_shortcut(shortcut: &str) { - *CROSSHAIR_SHORTCUT.lock().unwrap() = Some(shortcut.to_string()); - if let Ok(hotkey) = tauri_plugin_global_shortcut::Shortcut::from_str(shortcut) { - CROSSHAIR_SHORTCUT_ID.store(hotkey.id(), Ordering::SeqCst); - } -} - -pub fn init_filter(app_handle: &tauri::AppHandle, shortcut: &str) -> Result<(), String> { - set_filter_shortcut(shortcut); - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - app_handle - .global_shortcut() - .register(shortcut) - .map_err(|e| format!("注册滤镜热键失败: {}", e))?; - } - - log::info!("滤镜热键已注册: {}", shortcut); - Ok(()) -} - -pub fn update_filter(app_handle: &tauri::AppHandle, new_shortcut: &str) -> Result<(), String> { - let old_shortcut = get_filter_shortcut(); - - // 新旧热键相同,无需更新 - if old_shortcut == new_shortcut { - return Ok(()); - } - - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - - if !old_shortcut.is_empty() { - let _ = app_handle.global_shortcut().unregister(old_shortcut.as_str()); - } - - if !new_shortcut.is_empty() { - app_handle - .global_shortcut() - .register(new_shortcut) - .map_err(|e| format!("注册滤镜热键失败: {}", e))?; - } - } - - set_filter_shortcut(new_shortcut); - log::info!("滤镜热键已更新: {} -> {}", old_shortcut, new_shortcut); - Ok(()) -} - -pub fn get_filter_shortcut() -> String { - FILTER_SHORTCUT - .lock() - .unwrap() - .clone() - .unwrap_or_default() -} - -pub fn get_filter_shortcut_id() -> u32 { - FILTER_SHORTCUT_ID.load(Ordering::SeqCst) -} - -fn set_filter_shortcut(shortcut: &str) { - *FILTER_SHORTCUT.lock().unwrap() = Some(shortcut.to_string()); - if let Ok(hotkey) = tauri_plugin_global_shortcut::Shortcut::from_str(shortcut) { - FILTER_SHORTCUT_ID.store(hotkey.id(), Ordering::SeqCst); - } -} - -pub fn cleanup(app_handle: &tauri::AppHandle) { - #[cfg(target_os = "windows")] - { - use tauri_plugin_global_shortcut::GlobalShortcutExt; - - let overlay = get_overlay_shortcut(); - if !overlay.is_empty() { - let _ = app_handle.global_shortcut().unregister(overlay.as_str()); - } - - let crosshair = get_crosshair_shortcut(); - if !crosshair.is_empty() { - let _ = app_handle.global_shortcut().unregister(crosshair.as_str()); - } - - let filter = get_filter_shortcut(); - if !filter.is_empty() { - let _ = app_handle.global_shortcut().unregister(filter.as_str()); - } - } -} - -#[tauri::command] -pub fn get_overlay_hotkey() -> String { - get_overlay_shortcut() -} - -#[tauri::command] -pub fn set_overlay_hotkey(app_handle: tauri::AppHandle, shortcut: String) -> Result<(), String> { - update_overlay(&app_handle, &shortcut) -} - -#[tauri::command] -pub fn get_crosshair_hotkey() -> String { - get_crosshair_shortcut() -} - -#[tauri::command] -pub fn set_crosshair_hotkey(app_handle: tauri::AppHandle, shortcut: String) -> Result<(), String> { - update_crosshair(&app_handle, &shortcut) -} - -#[tauri::command] -pub fn get_filter_hotkey() -> String { - get_filter_shortcut() -} - -#[tauri::command] -pub fn set_filter_hotkey(app_handle: tauri::AppHandle, shortcut: String) -> Result<(), String> { - update_filter(&app_handle, &shortcut) -} - - diff --git a/参考/NexBox-main/src-tauri/src/lib.rs b/参考/NexBox-main/src-tauri/src/lib.rs deleted file mode 100644 index 02b3d91..0000000 --- a/参考/NexBox-main/src-tauri/src/lib.rs +++ /dev/null @@ -1,499 +0,0 @@ -mod announcement; -mod audio_engine; -mod audio_eq; -mod auto_start; -mod music_api; -mod crosshair; -mod dattorro; -mod delta_force; -mod spectrum; -mod display_cache; -mod display_filter; -mod downloader; -mod game_fps; -mod game_launcher; -mod game_ping; -mod gpu_rename; -mod hardware; -mod hardware_report; - -mod hotkey; -mod music; -mod network_optimize; -#[allow(dead_code, unused_imports)] -mod netease_lyrics; -mod nvapi; -mod optimization; -mod overlay_panel; -mod vertical_overlay; - -mod sensor; -mod shader_cache; -mod sponsor; -mod startup_manager; -mod storage_clean; -mod thirdparty_tools; -mod tray; -mod utils; -mod video_bg; -mod wmi_query; -use tauri::Manager; - - -#[cfg_attr(mobile, tauri::mobile_entry_point)] -pub fn run() { - let app = tauri::Builder::default() - .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| { - if let Some(window) = app.get_webview_window("main") { - let _: () = window.show().unwrap_or(()); - let _: () = window.set_focus().unwrap_or(()); - let _: () = window.unminimize().unwrap_or(()); - } - })) - .plugin(tauri_plugin_shell::init()) - .plugin(tauri_plugin_fs::init()) - .plugin(tauri_plugin_store::Builder::default().build()) - .plugin(tauri_plugin_os::init()) - .plugin( - tauri_plugin_global_shortcut::Builder::new() - .with_handler(|app, shortcut, event| { - use tauri_plugin_global_shortcut::ShortcutState; - if event.state == ShortcutState::Pressed { - if shortcut.id() == hotkey::get_overlay_shortcut_id() { - let _ = overlay_panel::toggle_overlay(app); - } else if shortcut.id() == hotkey::get_crosshair_shortcut_id() { - let _ = crosshair::toggle_crosshair_sync(app); - } else if shortcut.id() == hotkey::get_filter_shortcut_id() { - let _ = display_filter::toggle_filter_sync(app); - } - } - }) - .build(), - ) - .plugin(tauri_plugin_opener::init()) - .plugin(tauri_plugin_clipboard_manager::init()) - .plugin(tauri_plugin_dialog::init()) - .setup(|app| { - // 初始化音乐 API 和音频代理 - let app_handle_for_music = app.handle().clone(); - music_api::audio_proxy::set_app_handle(app_handle_for_music.clone()); - tauri::async_runtime::spawn(async move { - music_api::init_cookie_cache(&app_handle_for_music).await; - match music_api::audio_proxy::start_audio_proxy().await { - Ok(port) => log::info!("[MusicAPI] audio proxy started on port {port}"), - Err(e) => log::error!("[MusicAPI] failed to start audio proxy: {e}"), - } - }); - - if cfg!(debug_assertions) { - app.handle().plugin( - tauri_plugin_log::Builder::default() - .level(log::LevelFilter::Info) - .build(), - )?; - } else { - // Release 模式:日志写入文件,便于排查开机自启失败问题 - // 日志路径:%LOCALAPPDATA%/NexBox/nexbox.log - let log_dir = dirs::data_local_dir() - .unwrap_or_else(|| std::path::PathBuf::from(".")) - .join("NexBox"); - let _ = std::fs::create_dir_all(&log_dir); - let log_path = log_dir.join("nexbox.log"); - if let Ok(log_file) = std::fs::OpenOptions::new() - .create(true) - .append(true) - .open(&log_path) - { - let _ = env_logger::Builder::from_env( - env_logger::Env::default().default_filter_or("info"), - ) - .target(env_logger::Target::Pipe(Box::new(log_file))) - .try_init(); - } - log::info!( - "NexBox v{} 启动 | exe: {:?} | cwd: {:?}", - env!("CARGO_PKG_VERSION"), - std::env::current_exe().ok(), - std::env::current_dir().ok(), - ); - } - sensor::start_sensor_process(app); - utils::sys_info::check_and_send_statistics(app); - overlay_panel::start_hardware_poller(); - hardware_report::start_recording(); - - // 初始化 ACE 自动检测(读取持久化配置并启动后台任务) - let app_handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - let _ = optimization::init_ace_auto_detect(app_handle).await; - }); - - // Configure widget window (DWM clipping + close intercept) - if let Some(widget_window) = app.get_webview_window("widget") { - #[cfg(target_os = "windows")] - { - use windows_sys::Win32::Graphics::Dwm::{ - DwmSetWindowAttribute, - DWMWA_WINDOW_CORNER_PREFERENCE, - DWMWA_BORDER_COLOR, - DWMWCP_DONOTROUND, - }; - use windows_sys::Win32::UI::WindowsAndMessaging::{ - SetWindowLongPtrW, - GWL_STYLE, - WS_CAPTION, - }; - use windows_sys::Win32::Foundation::HWND; - - if let Ok(hwnd) = widget_window.hwnd() { - let hwnd_raw = hwnd.0 as HWND; - unsafe { - let current_style = windows_sys::Win32::UI::WindowsAndMessaging::GetWindowLongPtrW(hwnd_raw, GWL_STYLE); - SetWindowLongPtrW(hwnd_raw, GWL_STYLE, current_style & !(WS_CAPTION as isize)); - - let border_color: u32 = 0xFFFFFFFE; - let _ = DwmSetWindowAttribute( - hwnd_raw, - DWMWA_BORDER_COLOR as u32, - &border_color as *const _ as *const _, - std::mem::size_of::() as u32, - ); - - let corner_preference = DWMWCP_DONOTROUND; - let _ = DwmSetWindowAttribute( - hwnd_raw, - DWMWA_WINDOW_CORNER_PREFERENCE as u32, - &corner_preference as *const _ as *const _, - std::mem::size_of::() as u32, - ); - } - } - } - - // Intercept close → hide instead - let w_clone = widget_window.clone(); - widget_window.on_window_event(move |event| { - if let tauri::WindowEvent::CloseRequested { api, .. } = event { - api.prevent_close(); - let _ = w_clone.hide(); - } - }); - } - - // Main window: intercept taskbar Close / Alt+F4 → hide instead of destroy - if let Some(main_window) = app.get_webview_window("main") { - let main_clone = main_window.clone(); - main_window.on_window_event(move |event| { - if let tauri::WindowEvent::CloseRequested { api, .. } = event { - api.prevent_close(); - let _ = main_clone.hide(); - } - }); - } - - // Tray menu: hide when losing focus (click outside), reset always-on-top - if let Some(tray_menu) = app.get_webview_window("tray-menu") { - let menu_clone = tray_menu.clone(); - tray_menu.on_window_event(move |event| { - if let tauri::WindowEvent::Focused(false) = event { - let _ = menu_clone.set_always_on_top(false); - let _ = menu_clone.hide(); - } - }); - } - - // 显示器信息改为前端按需加载 (get_displays 内部已有缓存逻辑), - // 不在启动阶段预填,避免阻塞 WebView 加载导致白屏。 - - match tray::init_tray(app.handle()) { - Ok(_) => log::info!("Tray initialized successfully"), - Err(e) => log::error!("Failed to initialize tray: {}", e), - } - - // Register default hotkeys (will be overridden by frontend if user changed them) - let _ = hotkey::init_overlay(app.handle(), "Shift+F10"); - let _ = hotkey::init_crosshair(app.handle(), "Shift+F9"); - let _ = hotkey::init_filter(app.handle(), "Shift+F8"); - - Ok(()) - }) - .invoke_handler(tauri::generate_handler![ - announcement::get_announcements, - announcement::get_important_announcements, - auto_start::set_nexbox_auto_start, - auto_start::check_nexbox_auto_start, - hardware::get_hardware, - hardware::get_cpu_load, - hardware::get_gpu_status, - hardware::get_disk_status, - hardware::is_nvidia_gpu, - hardware::get_os_version, - hardware::get_disk_health_info, - music::get_music_files, - // === 音乐播放器 API === - music_api::music_search, - music_api::music_song_url, - music_api::music_login_qr_key, - music_api::music_login_qr_create, - music_api::music_login_qr_check, - music_api::music_login_status, - music_api::music_login_cookie, - music_api::music_logout, - music_api::music_user_playlist, - music_api::music_playlist_tracks, - music_api::music_playlist_tracks_range, - music_api::music_playlist_info_with_track_ids, - music_api::music_playlist_detail, - music_api::music_likelist, - music_api::music_like, - music_api::music_playlist_subscribe, - music_api::music_lyric, - music_api::music_personalized, - music_api::music_recommend_songs, - music_api::music_artist_search, - music_api::music_artist_songs, - music_api::music_playlist_search, - music_api::music_open_login_window, - music_api::audio_proxy::cmd_get_proxy_port, - downloader::download_file, - downloader::open_installer, - downloader::download_update, - downloader::install_update, - downloader::delete_download_file, - optimization::optimize_memory, - optimization::get_memory_status, - optimization::kill_wallpaper_engine, - optimization::flush_dns, - optimization::clean_temp_files, - optimization::optimize_privacy_services, - optimization::optimize_ace_processes, - optimization::set_high_performance_power_plan, - optimization::get_memory_limit_options, - optimization::get_memory_limit_status, - optimization::set_memory_limit, - optimization::restore_memory_limit, - optimization::get_detailed_memory_status, - optimization::clean_standby_memory, - optimization::trim_system_working_set, - optimization::start_auto_clean, - optimization::stop_auto_clean, - optimization::get_auto_clean_config, - optimization::boost_delta_force_priority, - optimization::boost_delta_force_affinity, - optimization::boost_delta_force_affinity_with_mask, - optimization::limit_ace_priority, - optimization::restrict_ace_affinity, - optimization::restrict_ace_affinity_with_mask, - optimization::set_ace_efficiency_mode, - optimization::optimize_all_game_processes, - optimization::set_ace_auto_detect, - optimization::get_ace_auto_detect_status, - optimization::init_ace_auto_detect, - optimization::get_builtin_power_plans, - optimization::get_system_power_plans, - optimization::get_active_power_plan, - optimization::import_power_plan, - optimization::activate_power_plan, - optimization::import_and_activate_power_plan, - optimization::apply_registry_tweak, - optimization::restore_registry_tweak, - optimization::batch_apply_registry_tweaks, - optimization::batch_restore_registry_tweaks, - optimization::disable_windows_update, - optimization::enable_windows_update, - optimization::check_windows_update_state, - optimization::check_pause_update_state, - optimization::delete_power_plan, - optimization::get_peripheral_status, - optimization::set_peripheral_settings, - optimization::reset_peripheral_settings, - optimization::restart_graphics_driver, - network_optimize::set_tcp_congestion, - network_optimize::restore_tcp_congestion, - network_optimize::set_tcp_chimney_off, - network_optimize::restore_tcp_chimney, - network_optimize::set_nagle_optimization, - network_optimize::restore_nagle_optimization, - network_optimize::set_adapter_power_saving_off, - network_optimize::restore_adapter_power_saving, - network_optimize::set_dns_servers, - network_optimize::restore_dns_servers, - network_optimize::check_network_tweak_states, - network_optimize::batch_network_enable, - network_optimize::batch_network_disable, - startup_manager::scan_startup_items, - startup_manager::delete_startup_item, - startup_manager::locate_startup_file, - startup_manager::find_startup_key_in_registry, - display_filter::get_displays, - display_filter::set_active_display, - display_filter::get_filter_settings, - display_filter::set_filter_settings, - display_filter::enable_filter, - display_filter::disable_filter, - display_filter::toggle_filter, - display_filter::get_filter_presets, - display_filter::apply_preset, - display_filter::get_custom_filter_settings, - display_filter::save_custom_filter_settings, - display_filter::export_custom_filter, - display_filter::get_user_filter_presets, - display_filter::save_user_filter_preset, - display_filter::apply_user_filter_preset, - display_filter::delete_user_filter_preset, - display_filter::select_icc_file, - display_filter::import_icc_profile, - display_filter::get_icc_presets, - display_filter::apply_icc_preset, - display_filter::delete_icc_preset, - display_filter::export_preset_as_icc, - // === EQ 调音命令 === - audio_eq::check_virtual_audio_driver, - audio_eq::install_virtual_audio_driver, - audio_eq::uninstall_virtual_audio_driver, - audio_eq::start_eq_engine, - audio_eq::stop_eq_engine, - audio_eq::get_eq_engine_status, - audio_eq::get_eq_presets, - audio_eq::apply_eq_preset, - audio_eq::import_eq_preset, - audio_eq::delete_eq_preset, - audio_eq::save_eq_preset, - audio_eq::export_fac_file, - audio_eq::get_audio_levels, - audio_eq::get_spectrum, - audio_eq::get_default_audio_device, - audio_eq::update_eq_bands, - audio_eq::update_eq_preamp, - audio_eq::update_eq_effects, - audio_eq::get_eq_effects, - thirdparty_tools::get_thirdparty_tools, - thirdparty_tools::get_tool_install_path, - thirdparty_tools::get_tool_download_path, - thirdparty_tools::run_tool, - thirdparty_tools::download_tool, - thirdparty_tools::open_tool_installer, - overlay_panel::start_overlay_panel, - overlay_panel::stop_overlay_panel, - overlay_panel::get_overlay_panel_status, - overlay_panel::get_overlay_hardware_data, - overlay_panel::update_overlay_settings, - overlay_panel::toggle_overlay_panel, - overlay_panel::set_overlay_drag_mode, - overlay_panel::get_overlay_current_settings, - overlay_panel::check_drag_mode_status, - overlay_panel::reset_overlay_position, - overlay_panel::run_pawnio_setup, - - vertical_overlay::start_vertical_overlay, - vertical_overlay::stop_vertical_overlay, - vertical_overlay::save_vertical_overlay_position, - vertical_overlay::set_vertical_overlay_click_through, - vertical_overlay::reset_vertical_overlay_position, - vertical_overlay::resize_vertical_overlay, - - hardware_report::export_hardware_report, - hardware_report::get_hardware_recording_status, - hardware_report::clear_hardware_data, - - sensor::get_lhm_cpu_load, - sensor::get_lhm_cpu_status, - sensor::get_lhm_gpu_status, - - game_ping::get_current_ping, - hotkey::get_overlay_hotkey, - hotkey::set_overlay_hotkey, - hotkey::get_crosshair_hotkey, - hotkey::set_crosshair_hotkey, - hotkey::get_filter_hotkey, - hotkey::set_filter_hotkey, - crosshair::toggle_crosshair, - crosshair::get_crosshair_status, - crosshair::update_crosshair_settings, - crosshair::get_crosshair_displays, - crosshair::pick_crosshair_image, - - delta_force::get_delta_passwords, - delta_force::get_weapon_codes, - delta_force::get_dlss_model_presets, - delta_force::apply_dlss_model_preset, - delta_force::get_dlss_preset_status, - delta_force::get_delta_maps, - delta_force::toggle_dlss_indicator, - delta_force::toggle_dlss_lock, - delta_force::get_dlss_settings_status, - delta_force::open_platform_window, - game_launcher::launch_game, - game_launcher::search_delta_force_launcher, - game_launcher::get_default_delta_force_game, - game_launcher::select_exe_file, - game_launcher::get_file_icon, - gpu_rename::get_gpu_info, - gpu_rename::get_gpu_options, - gpu_rename::apply_gpu_rename, - gpu_rename::restore_gpu_name, - video_bg::pick_video_file, - sponsor::get_sponsors, - shader_cache::scan_shader_caches, - shader_cache::clean_shader_cache, - nvapi::get_nvapi_status, - nvapi::diagnose_nvapi, - nvapi::get_nvidia_driver_version, - nvapi::list_nvidia_settings, - nvapi::set_nvidia_setting, - nvapi::reset_nvidia_settings, - nvapi::list_nvidia_displays, - nvapi::get_nvidia_display_modes, - nvapi::set_nvidia_display_resolution, - nvapi::get_injected_resolutions, - nvapi::remove_injected_resolution, - storage_clean::scan_storage_items, - storage_clean::clean_storage_items, - storage_clean::empty_recycle_bin_cmd, - utils::sys_info::get_system_locale, - tray::minimize_to_tray, - tray::show_window, - tray::get_close_behavior, - tray::set_close_behavior, - tray::get_dont_ask_again, - tray::set_dont_ask_again, - tray::exit_app, - tray::check_update_and_show, - // === MCTier 命令 === - utils::cursor::get_cursor_position, - utils::cursor::set_desktop_lyrics_click_through, - utils::lyrics_btn::show_lyrics_unlock_btn, - utils::lyrics_btn::hide_lyrics_unlock_btn, - utils::lyrics_btn::unlock_lyrics, - - ]) - .build(tauri::generate_context!()) - .expect("error while building tauri application"); - - app.run(|app_handle, event| { - match event { - tauri::RunEvent::ExitRequested { .. } => { - // 退出流程开始前隐藏所有窗口,避免 WebView2 销毁后闪现原生标题栏 - for label in &["main", "widget", "tray-menu", "desktop-lyrics", "lyrics-unlock-btn", "vertical-overlay"] { - if let Some(w) = app_handle.get_webview_window(label) { - let _ = w.hide(); - } - } - } - tauri::RunEvent::Exit => { - sensor::stop_sensor_process(app_handle); - hardware::cleanup_hardware_cache(); - overlay_panel::cleanup(); // 先停后台轮询线程(FPS/传感器),再恢复 Gamma - display_filter::cleanup(); - vertical_overlay::cleanup(app_handle); - crosshair::cleanup(); - audio_eq::cleanup(); - tray::cleanup(); - hotkey::cleanup(app_handle); - nvapi::cleanup(); - hardware_report::stop_recording(); - } - _ => {} - } - }); -} diff --git a/参考/NexBox-main/src-tauri/src/main.rs b/参考/NexBox-main/src-tauri/src/main.rs deleted file mode 100644 index e639c43..0000000 --- a/参考/NexBox-main/src-tauri/src/main.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Prevents additional console window on Windows in release, DO NOT REMOVE!! -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] - -fn main() { - // 开机自启修复:Windows 通过注册表 Run 键启动程序时工作目录是 System32, - // 这会导致 Tauri 加载资源和依赖失败。主动切换到 exe 所在目录。 - if let Ok(exe_path) = std::env::current_exe() { - if let Some(exe_dir) = exe_path.parent() { - let _ = std::env::set_current_dir(exe_dir); - } - } - - nexbox_lib::run(); -} diff --git a/参考/NexBox-main/src-tauri/src/music.rs b/参考/NexBox-main/src-tauri/src/music.rs deleted file mode 100644 index 5500adc..0000000 --- a/参考/NexBox-main/src-tauri/src/music.rs +++ /dev/null @@ -1,57 +0,0 @@ -use serde::Serialize; - -#[derive(Debug, Clone, Serialize)] -pub struct MusicFile { - pub name: String, - pub path: String, -} - -#[tauri::command] -pub async fn get_music_files() -> Result, String> { - let cwd = std::env::current_dir().map_err(|error| error.to_string())?; - let music_dir = cwd.join("public").join("music"); - - if !music_dir.exists() { - return Ok(Vec::new()); - } - - let mut files = Vec::new(); - let supported_extensions = ["mp3", "wav", "ogg", "m4a", "flac", "aac"]; - - let entries = std::fs::read_dir(&music_dir).map_err(|error| error.to_string())?; - for entry in entries { - let entry = entry.map_err(|error| error.to_string())?; - let path = entry.path(); - if !path.is_file() { - continue; - } - - let extension = path - .extension() - .and_then(|value| value.to_str()) - .map(|value| value.to_lowercase()) - .unwrap_or_default(); - - if !supported_extensions.iter().any(|item| *item == extension) { - continue; - } - - let name = path - .file_name() - .and_then(|value| value.to_str()) - .map(|value| value.to_string()) - .unwrap_or_default(); - - if name.is_empty() { - continue; - } - - files.push(MusicFile { - name: name.clone(), - path: format!("music/{name}"), - }); - } - - files.sort_by(|left, right| left.name.to_lowercase().cmp(&right.name.to_lowercase())); - Ok(files) -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/audio_proxy.rs b/参考/NexBox-main/src-tauri/src/music_api/audio_proxy.rs deleted file mode 100644 index 3411760..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/audio_proxy.rs +++ /dev/null @@ -1,242 +0,0 @@ -use std::sync::atomic::{AtomicU16, Ordering}; - -use axum::{ - body::Body, - extract::Query, - http::{HeaderMap, HeaderValue, StatusCode}, - response::{IntoResponse, Response}, - routing::get, - Router, -}; -use futures_util::StreamExt; -use serde::Deserialize; -use std::sync::OnceLock; -use tauri::AppHandle; - -static PROXY_PORT: AtomicU16 = AtomicU16::new(0); -static HTTP_CLIENT: OnceLock = OnceLock::new(); -static STREAM_CLIENT: OnceLock = OnceLock::new(); -static APP_HANDLE: OnceLock = OnceLock::new(); - -const UA: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"; - -#[derive(Deserialize)] -struct ProxyQuery { - url: String, -} - -#[derive(Deserialize)] -struct CoverQuery { - url: String, -} - -fn get_client() -> &'static reqwest::Client { - HTTP_CLIENT.get_or_init(|| { - reqwest::Client::builder() - .timeout(std::time::Duration::from_secs(30)) - .build() - .expect("Failed to build proxy client") - }) -} - -/// 流式传输专用 client —— 无整体超时,仅设连接超时 -/// 避免长曲目中途被 timeout 掐断 -fn get_stream_client() -> &'static reqwest::Client { - STREAM_CLIENT.get_or_init(|| { - reqwest::Client::builder() - .connect_timeout(std::time::Duration::from_secs(15)) - .build() - .expect("Failed to build stream proxy client") - }) -} - -fn referer_for(url: &str) -> &'static str { - if url.contains("qq.com") || url.contains("qpic.cn") { - "https://y.qq.com/" - } else { - "https://music.163.com/" - } -} - -fn content_type_for(url: &str) -> &'static str { - let lower = url.to_lowercase(); - if lower.contains(".flac") { - "audio/flac" - } else if lower.contains(".mp3") { - "audio/mpeg" - } else if lower.contains(".m4a") || lower.contains(".mp4") { - "audio/mp4" - } else if lower.contains(".ogg") { - "audio/ogg" - } else if lower.contains(".wav") { - "audio/wav" - } else { - "audio/mpeg" - } -} - -/// 将 reqwest HeaderValue 转换为 axum HeaderValue -fn convert_header_value(val: &reqwest::header::HeaderValue) -> HeaderValue { - HeaderValue::from_bytes(val.as_bytes()).unwrap_or(HeaderValue::from_static("")) -} - -/// 音频代理 - 支持 Range 请求,纯流式透传(零额外开销) -async fn audio_proxy(Query(query): Query, headers: HeaderMap) -> Response { - let audio_url = &query.url; - if !audio_url.starts_with("http") { - return (StatusCode::BAD_REQUEST, "Invalid url").into_response(); - } - - let referer = referer_for(audio_url); - // 流式传输专用 client —— 无整体超时,避免长曲目中途断开 - let client = get_stream_client(); - - let mut req = client - .get(audio_url) - .header("User-Agent", UA) - .header("Referer", referer); - - // 传递 Range 头 (axum -> reqwest 转换) - if let Some(range) = headers.get("range") { - if let Ok(range_str) = range.to_str() { - req = req.header("Range", range_str); - } - } - - let resp = match req.send().await { - Ok(r) => r, - Err(e) => { - log::warn!("[AudioProxy] request failed: {e}"); - return (StatusCode::BAD_GATEWAY, format!("Proxy error: {e}")).into_response(); - } - }; - - let status = StatusCode::from_u16(resp.status().as_u16()).unwrap_or(StatusCode::OK); - let mut out_headers = HeaderMap::new(); - - out_headers.insert("Content-Type", HeaderValue::from_static(content_type_for(audio_url))); - out_headers.insert("Access-Control-Allow-Origin", HeaderValue::from_static("*")); - out_headers.insert("Accept-Ranges", HeaderValue::from_static("bytes")); - - if let Some(cl) = resp.headers().get("content-length") { - out_headers.insert("Content-Length", convert_header_value(cl)); - } - if let Some(cr) = resp.headers().get("content-range") { - out_headers.insert("Content-Range", convert_header_value(cr)); - } - - // 流式传输:边下边播,纯透传,零额外内存开销 - let stream = resp.bytes_stream().map(|result| { - result.map_err(|e| -> Box { Box::new(e) }) - }); - let body = Body::from_stream(stream); - - let mut response = Response::new(body); - *response.status_mut() = status; - response.headers_mut().extend(out_headers); - response -} - -/// 封面代理 - 添加 CORS 头 -async fn cover_proxy(Query(query): Query) -> Response { - let cover_url = &query.url; - if !cover_url.starts_with("http") { - return (StatusCode::BAD_REQUEST, "Invalid url").into_response(); - } - - let referer = referer_for(cover_url); - let client = get_client(); - - let resp = match client - .get(cover_url) - .header("User-Agent", UA) - .header("Referer", referer) - .send() - .await - { - Ok(r) => r, - Err(e) => { - log::warn!("[CoverProxy] request failed: {e}"); - return (StatusCode::BAD_GATEWAY, format!("Proxy error: {e}")).into_response(); - } - }; - - let status = StatusCode::from_u16(resp.status().as_u16()).unwrap_or(StatusCode::OK); - let mut out_headers = HeaderMap::new(); - - let ct = resp - .headers() - .get("content-type") - .map(convert_header_value) - .unwrap_or_else(|| HeaderValue::from_static("image/jpeg")); - out_headers.insert("Content-Type", ct); - out_headers.insert("Access-Control-Allow-Origin", HeaderValue::from_static("*")); - out_headers.insert("Cross-Origin-Resource-Policy", HeaderValue::from_static("cross-origin")); - out_headers.insert("Cache-Control", HeaderValue::from_static("public, max-age=86400")); - - if let Some(cl) = resp.headers().get("content-length") { - out_headers.insert("Content-Length", convert_header_value(cl)); - } - - let body = match resp.bytes().await { - Ok(b) => b, - Err(_) => return (StatusCode::BAD_GATEWAY, "Body read error").into_response(), - }; - - (status, out_headers, body).into_response() -} - -/// 启动音频代理服务器,返回端口号 -pub async fn start_audio_proxy() -> Result { - // 如果已经在运行,直接返回端口 - let existing = PROXY_PORT.load(Ordering::Relaxed); - if existing > 0 { - return Ok(existing); - } - - let app = Router::new() - .route("/audio", get(audio_proxy)) - .route("/cover", get(cover_proxy)); - - // 找一个可用端口 - let listener = tokio::net::TcpListener::bind("127.0.0.1:0") - .await - .map_err(|e| format!("Failed to bind proxy port: {e}"))?; - - let port = listener - .local_addr() - .map_err(|e| format!("Failed to get local addr: {e}"))? - .port(); - - PROXY_PORT.store(port, Ordering::Relaxed); - - tokio::spawn(async move { - log::info!("[AudioProxy] listening on 127.0.0.1:{port}"); - if let Err(e) = axum::serve(listener, app).await { - log::error!("[AudioProxy] server error: {e}"); - } - }); - - Ok(port) -} - -/// 设置 AppHandle 供代理服务器使用 -pub fn set_app_handle(app: AppHandle) { - let _ = APP_HANDLE.set(app); -} - -/// 获取当前代理端口 -pub fn get_proxy_port() -> u16 { - PROXY_PORT.load(Ordering::Relaxed) -} - -/// Tauri command: 获取代理端口 -#[tauri::command] -pub async fn cmd_get_proxy_port() -> Result { - let port = get_proxy_port(); - if port > 0 { - Ok(port) - } else { - start_audio_proxy().await - } -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/cookie.rs b/参考/NexBox-main/src-tauri/src/music_api/cookie.rs deleted file mode 100644 index cecc67d..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/cookie.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::sync::Arc; -use std::collections::HashMap; -use tauri::AppHandle; -use tauri_plugin_store::StoreExt; - -const STORE_FILE: &str = "music-cookies.json"; - -fn get_store(app: &AppHandle) -> Result>, String> { - app.store(STORE_FILE).map_err(|e| format!("Failed to load cookie store: {e}")) -} - -pub fn save_cookie(app: &AppHandle, provider: &str, cookie: &str) -> Result<(), String> { - let store = get_store(app)?; - store.set(format!("cookie_{provider}"), cookie); - store.save().map_err(|e| format!("Failed to save cookie: {e}")) -} - -pub fn load_cookie(app: &AppHandle, provider: &str) -> Result { - let store = get_store(app)?; - Ok(store - .get(format!("cookie_{provider}")) - .map(|v| v.as_str().unwrap_or("").to_string()) - .unwrap_or_default()) -} - -pub fn clear_cookie(app: &AppHandle, provider: &str) -> Result<(), String> { - let store = get_store(app)?; - store.delete(format!("cookie_{provider}")); - store.save().map_err(|e| format!("Failed to clear cookie: {e}")) -} - -pub fn parse_cookie_string(cookie: &str) -> HashMap { - let mut map = HashMap::new(); - for part in cookie.split(';') { - let part = part.trim(); - if let Some(eq) = part.find('=') { - let key = part[..eq].trim().to_string(); - let value = part[eq + 1..].trim().to_string(); - if !key.is_empty() { - map.insert(key, value); - } - } - } - map -} - -pub fn normalize_cookie_header(raw: &str) -> String { - let map = parse_cookie_string(raw); - map.iter() - .map(|(k, v)| format!("{k}={v}")) - .collect::>() - .join("; ") -} - -/// 检查网易云 Cookie 是否包含登录态 (MUSIC_U) -pub fn netease_cookie_has_login(cookie: &str) -> bool { - parse_cookie_string(cookie).contains_key("MUSIC_U") -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/crypto.rs b/参考/NexBox-main/src-tauri/src/music_api/crypto.rs deleted file mode 100644 index 4cef703..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/crypto.rs +++ /dev/null @@ -1,62 +0,0 @@ -use aes::cipher::{generic_array::GenericArray, BlockEncrypt, KeyInit}; -use aes::Aes128; -use md5::{Digest, Md5}; - -/// 网易云 EAPI 加密密钥 -const NETEASE_EAPI_KEY: &[u8; 16] = b"e82ckenh8dichen8"; - -/// 计算 MD5 哈希 -pub fn md5_bytes(input: &[u8]) -> [u8; 16] { - let mut hasher = Md5::new(); - hasher.update(input); - hasher.finalize().into() -} - -/// AES-128-ECB 加密 (PKCS7 填充) -pub fn aes_ecb_encrypt_pkcs7(input: &[u8], key: &[u8; 16]) -> Vec { - let cipher = Aes128::new(GenericArray::from_slice(key)); - let mut buffer = input.to_vec(); - let pad_len = 16 - (buffer.len() % 16); - buffer.extend(std::iter::repeat(pad_len as u8).take(pad_len)); - - for chunk in buffer.chunks_exact_mut(16) { - cipher.encrypt_block(GenericArray::from_mut_slice(chunk)); - } - - buffer -} - -/// 网易云 EAPI 加密 -/// 1. 计算 digest = MD5("nobody{api_path}use{payload}md5forencrypt") -/// 2. 拼接 data = "{api_path}-36cd479b6b5-{payload}-36cd479b6b5-{digest}" -/// 3. AES-128-ECB 加密 data -/// 4. 十六进制大写编码 -pub fn encrypt_eapi_payload(api_path: &str, payload_text: &str) -> Result { - let digest_source = format!("nobody{api_path}use{payload_text}md5forencrypt"); - let digest = hex::encode(md5_bytes(digest_source.as_bytes())); - let data = format!("{api_path}-36cd479b6b5-{payload_text}-36cd479b6b5-{digest}"); - let encrypted = aes_ecb_encrypt_pkcs7(data.as_bytes(), NETEASE_EAPI_KEY); - Ok(hex::encode_upper(encrypted)) -} - -/// 构建 EAPI 请求头 (作为 Cookie 发送) -pub fn build_eapi_header() -> serde_json::Map { - use serde_json::json; - let now_ms = chrono::Utc::now().timestamp_millis(); - let request_id = format!("{now_ms}_{:04}", rand::random::() % 1000); - - let mut map = serde_json::Map::new(); - map.insert("__csrf".into(), json!("")); - map.insert("appver".into(), json!("8.0.0")); - map.insert("buildver".into(), json!(now_ms / 1000)); - map.insert("channel".into(), json!("")); - map.insert("deviceId".into(), json!("")); - map.insert("mobilename".into(), json!("")); - map.insert("resolution".into(), json!("1920x1080")); - map.insert("os".into(), json!("android")); - map.insert("osver".into(), json!("")); - map.insert("requestId".into(), json!(request_id)); - map.insert("versioncode".into(), json!("140")); - map.insert("MUSIC_U".into(), json!("")); - map -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/mod.rs b/参考/NexBox-main/src-tauri/src/music_api/mod.rs deleted file mode 100644 index a297586..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/mod.rs +++ /dev/null @@ -1,357 +0,0 @@ -pub mod audio_proxy; -pub mod cookie; -pub mod crypto; -pub mod models; -pub mod netease; - -use tauri::{AppHandle, Emitter, Manager}; -use url::Url; -use models::*; - -// ============================================================ -// Tauri Commands - 网易云 -// ============================================================ - -#[tauri::command] -pub async fn music_search(keywords: String, limit: Option) -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::search(&keywords, limit.unwrap_or(30), &app_cookie).await -} - -#[tauri::command] -pub async fn music_song_url(id: String, quality: Option) -> Result { - let app_cookie = get_app_cookie().await; - netease::song_url(&id, &quality.unwrap_or_else(|| "hires".into()), &app_cookie).await -} - -#[tauri::command] -pub async fn music_login_qr_key() -> Result { - let app_cookie = get_app_cookie().await; - netease::login_qr_key(&app_cookie).await -} - -#[tauri::command] -pub async fn music_login_qr_create(key: String) -> Result { - let app_cookie = get_app_cookie().await; - netease::login_qr_create(&key, &app_cookie).await -} - -#[tauri::command] -pub async fn music_login_qr_check(app: AppHandle, key: String) -> Result { - let app_cookie = get_app_cookie().await; - let result = netease::login_qr_check(&key, &app_cookie).await?; - - // code 803 = 登录成功,自动保存 cookie - if result.code == 803 { - if let Some(ref cookie) = result.cookie { - let normalized = cookie::normalize_cookie_header(cookie); - if cookie::netease_cookie_has_login(&normalized) { - let _ = cookie::save_cookie(&app, "netease", &normalized); - set_app_cookie(normalized).await; - log::info!("[MusicAPI] QR login successful, cookie saved"); - } - } - } - - Ok(result) -} - -#[tauri::command] -pub async fn music_login_status(app: AppHandle) -> Result { - let app_cookie = load_app_cookie(&app).await; - netease::login_status(&app_cookie).await -} - -#[tauri::command] -pub async fn music_login_cookie(app: AppHandle, cookie: String) -> Result { - let normalized = cookie::normalize_cookie_header(&cookie); - if !cookie::netease_cookie_has_login(&normalized) { - return Ok(LoginInfo { - provider: "netease".into(), - ..Default::default() - }); - } - cookie::save_cookie(&app, "netease", &normalized)?; - set_app_cookie(normalized).await; - netease::login_status(get_app_cookie().await.as_str()).await -} - -#[tauri::command] -pub async fn music_logout(app: AppHandle) -> Result<(), String> { - cookie::clear_cookie(&app, "netease")?; - set_app_cookie(String::new()).await; - Ok(()) -} - -#[tauri::command] -pub async fn music_user_playlist(app: AppHandle) -> Result, String> { - let app_cookie = load_app_cookie(&app).await; - log::info!("[MusicAPI] music_user_playlist: cookie length={}, has MUSIC_U={}", - app_cookie.len(), cookie::netease_cookie_has_login(&app_cookie)); - - let info = netease::login_status(&app_cookie).await?; - log::info!("[MusicAPI] music_user_playlist: logged_in={}, user_id={}", info.logged_in, info.user_id); - - if !info.logged_in || info.user_id.is_empty() { - return Ok(vec![]); - } - let result = netease::user_playlist(&info.user_id, &app_cookie).await; - log::info!("[MusicAPI] music_user_playlist: result count={}", result.as_ref().map(|v| v.len()).unwrap_or(0)); - result -} - -#[tauri::command] -pub async fn music_playlist_tracks(id: String) -> Result<(Playlist, Vec), String> { - let app_cookie = get_app_cookie().await; - netease::playlist_tracks(&id, &app_cookie).await -} - -#[tauri::command] -pub async fn music_playlist_tracks_range(id: String, start: usize, count: usize) -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::playlist_tracks_range(&id, start, count, &app_cookie).await -} - -#[tauri::command] -pub async fn music_playlist_info_with_track_ids(id: String) -> Result<(Playlist, Vec), String> { - let app_cookie = get_app_cookie().await; - netease::playlist_info_with_track_ids(&id, &app_cookie).await -} - -#[tauri::command] -pub async fn music_playlist_detail(id: String) -> Result { - let app_cookie = get_app_cookie().await; - netease::playlist_detail(&id, &app_cookie).await -} - -#[tauri::command] -pub async fn music_likelist(app: AppHandle) -> Result, String> { - let app_cookie = load_app_cookie(&app).await; - let info = netease::login_status(&app_cookie).await?; - netease::likelist(&info.user_id, &app_cookie).await -} - -#[tauri::command] -pub async fn music_like(id: String, like: bool) -> Result<(), String> { - let app_cookie = get_app_cookie().await; - netease::like(&id, like, &app_cookie).await -} - -#[tauri::command] -pub async fn music_playlist_subscribe(id: String, subscribe: bool) -> Result<(), String> { - let app_cookie = get_app_cookie().await; - netease::playlist_subscribe(&id, subscribe, &app_cookie).await -} - -#[tauri::command] -pub async fn music_lyric(id: String) -> Result { - let app_cookie = get_app_cookie().await; - netease::lyric(&id, &app_cookie).await -} - -#[tauri::command] -pub async fn music_personalized() -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::personalized(&app_cookie).await -} - -#[tauri::command] -pub async fn music_recommend_songs() -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::recommend_songs(&app_cookie).await -} - -#[tauri::command] -pub async fn music_artist_search(keywords: String, limit: Option) -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::artist_search(&keywords, limit.unwrap_or(30), &app_cookie).await -} - -#[tauri::command] -pub async fn music_playlist_search(keywords: String, limit: Option) -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::playlist_search(&keywords, limit.unwrap_or(30), &app_cookie).await -} - -#[tauri::command] -pub async fn music_artist_songs(artist_id: String, limit: Option, offset: Option) -> Result, String> { - let app_cookie = get_app_cookie().await; - netease::artist_songs(&artist_id, limit.unwrap_or(50), offset.unwrap_or(0), &app_cookie).await -} - -/// 网易云登录 cookie 优先级 (参考 Mineradio) -const NETEASE_COOKIE_PRIORITY: &[&str] = &[ - "MUSIC_U", - "__csrf", - "NMTID", - "MUSIC_A", - "__remember_me", - "_ntes_nuid", - "_ntes_nnid", - "WEVNSM", - "WNMCID", - "JSESSIONID-WYYY", -]; - -/// 检查域名是否属于网易云 -fn is_netease_domain(domain: &str) -> bool { - let d = domain.trim_start_matches('.').to_lowercase(); - d == "163.com" || d.ends_with(".163.com") || - d == "music.163.com" || d.ends_with(".music.163.com") || - d == "netease.com" || d.ends_with(".netease.com") -} - -/// 打开登录窗口 (网易云) - 使用 Tauri cookies() API 直接读取 HttpOnly cookie -/// 参考 Mineradio 的 Electron session.cookies.get() 方案 -#[tauri::command] -pub async fn music_open_login_window(app: AppHandle) -> Result { - use tauri::WebviewUrl; - - let url = "https://music.163.com/#/login"; - let label = "netease-login"; - - // 如果窗口已存在,清除 cookie 后刷新登录页(切换账号场景) - if let Some(existing) = app.get_webview_window(label) { - let _ = existing.clear_all_browsing_data(); - let login_url = url.parse::().map_err(|e| e.to_string())?; - let _ = existing.navigate(login_url); - let _ = existing.set_focus(); - return Ok("window_refreshed".into()); - } - - // 新窗口:先以 about:blank 创建,清除 cookie 后再导航到登录页 - let login_window = tauri::WebviewWindowBuilder::new( - &app, - label, - WebviewUrl::External("about:blank".parse().map_err(|e: url::ParseError| e.to_string())?), - ) - .title("网易云音乐登录") - .inner_size(940.0, 760.0) - .min_inner_size(780.0, 580.0) - .build() - .map_err(|e| format!("Failed to create login window: {e}"))?; - - // 清除残留 cookie,确保登录页不会自动登录 - let _ = login_window.clear_all_browsing_data(); - // 导航到登录页 - let login_url = url.parse::().map_err(|e| e.to_string())?; - let _ = login_window.navigate(login_url); - - // 轮询读取 webview 的 cookie (包括 HttpOnly 的 MUSIC_U) - // 这是关键: document.cookie 无法读取 HttpOnly cookie, - // 但 Tauri 的 cookies() API 直接从 WebView2/WKWebView 读取, 可以拿到全部 - let win = login_window.clone(); - let app_handle = app.clone(); - tauri::async_runtime::spawn(async move { - // 等待页面加载 - tokio::time::sleep(std::time::Duration::from_secs(3)).await; - - for _ in 0..150 { - // 直接从 webview 读取所有 cookie (包括 HttpOnly) - match win.cookies() { - Ok(cookies) => { - // 内联构建 cookie 字符串 (类型由编译器推断, 无需命名) - use std::collections::HashMap; - let mut picked: HashMap = HashMap::new(); - for c in &cookies { - let domain_opt: Option<&str> = c.domain(); - if let Some(domain) = domain_opt { - if is_netease_domain(domain) { - let name = c.name().to_string(); - let value = c.value().to_string(); - if !name.is_empty() && !value.is_empty() { - picked.insert(name, value); - } - } - } - } - let mut ordered: Vec<(String, String)> = Vec::new(); - for name in NETEASE_COOKIE_PRIORITY { - if let Some(value) = picked.remove(*name) { - ordered.push((name.to_string(), value)); - } - } - for (name, value) in picked { - ordered.push((name, value)); - } - let cookie_str = ordered.iter() - .map(|(k, v)| format!("{k}={v}")) - .collect::>() - .join("; "); - - if cookie::netease_cookie_has_login(&cookie_str) { - log::info!("[MusicAPI] MUSIC_U cookie found via webview cookies() API, cookie length: {}", cookie_str.len()); - let _ = cookie::save_cookie(&app_handle, "netease", &cookie_str); - set_app_cookie(cookie_str).await; - // 强制关闭登录窗口 - let _ = win.close(); - // 直接在后端调用 login_status 验证 cookie 是否有效 - let app_cookie = get_app_cookie().await; - match netease::login_status(&app_cookie).await { - Ok(info) => { - log::info!("[MusicAPI] Login status after cookie capture: logged_in={}, nickname={}", info.logged_in, info.nickname); - if info.logged_in { - let _ = app_handle.emit("netease-login-success", &info); - log::info!("[MusicAPI] Login success event emitted with user info"); - } else { - log::warn!("[MusicAPI] Cookie captured but login_status returned not logged in"); - let _ = app_handle.emit("netease-login-failed", "Cookie 无效或已过期"); - } - } - Err(e) => { - log::error!("[MusicAPI] Login status check failed after cookie capture: {e}"); - let _ = app_handle.emit("netease-login-failed", &e); - } - } - return; - } - } - Err(e) => { - log::warn!("[MusicAPI] Failed to read cookies from webview: {e}"); - } - } - tokio::time::sleep(std::time::Duration::from_secs(2)).await; - } - log::warn!("[MusicAPI] Login window polling timed out after 5 minutes"); - }); - - Ok("window_created".into()) -} - -// ============================================================ -// 全局 Cookie 缓存 (内存中,避免每次都读 store) -// ============================================================ - -static APP_COOKIE: tokio::sync::RwLock = tokio::sync::RwLock::const_new(String::new()); - -async fn get_app_cookie() -> String { - APP_COOKIE.read().await.clone() -} - -pub async fn set_app_cookie(cookie: String) { - let mut guard = APP_COOKIE.write().await; - *guard = cookie; -} - -async fn load_app_cookie(app: &AppHandle) -> String { - // 先检查内存缓存 - let cached = APP_COOKIE.read().await.clone(); - if !cached.is_empty() { - return cached; - } - // 从 store 加载 - match cookie::load_cookie(app, "netease") { - Ok(c) => { - set_app_cookie(c.clone()).await; - c - } - Err(_) => String::new(), - } -} - -/// 初始化时从 store 加载 cookie 到内存 -pub async fn init_cookie_cache(app: &AppHandle) { - if let Ok(c) = cookie::load_cookie(app, "netease") { - set_app_cookie(c).await; - } -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/models.rs b/参考/NexBox-main/src-tauri/src/music_api/models.rs deleted file mode 100644 index 48ee033..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/models.rs +++ /dev/null @@ -1,141 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// 统一歌曲结构 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct Song { - pub provider: String, - pub id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub mid: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub media_mid: Option, - pub name: String, - pub artist: String, - pub artists: Vec, - pub album: String, - pub cover: String, - pub duration: u64, - pub fee: i32, - pub playable: bool, - #[serde(default)] - pub language: i32, -} - -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct Artist { - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub mid: Option, - pub name: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub pic_url: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub music_size: Option, -} - -/// 歌单 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct Playlist { - pub provider: String, - pub id: String, - pub name: String, - pub cover: String, - pub track_count: u32, - pub creator: String, - #[serde(default)] - pub subscribed: bool, -} - -/// 播放地址结果 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct SongUrlResult { - pub url: Option, - pub playable: bool, - pub trial: bool, - pub level: String, - pub quality: String, - pub br: u64, - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub fee: Option, -} - -/// 登录信息 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct LoginInfo { - pub provider: String, - pub logged_in: bool, - pub user_id: String, - pub nickname: String, - pub avatar: String, - pub vip_type: i32, - pub vip_level: String, - pub is_vip: bool, - pub is_svip: bool, -} - -/// 歌词 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct Lyrics { - pub lyric: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub translation: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub roma: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub yrc: Option, -} - -/// 二维码检查结果 -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct QrCheckResult { - /// 801=等待扫码, 802=待确认, 803=成功, 800=过期 - pub code: i32, - pub message: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub cookie: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub avatar: Option, -} - -/// 音质候选 -#[derive(Debug, Clone)] -pub struct QualityCandidate { - pub level: String, - pub label: String, -} - -pub fn netease_quality_candidates() -> Vec { - vec![ - QualityCandidate { level: "jymaster".into(), label: "超清母带".into() }, - QualityCandidate { level: "hires".into(), label: "高清臻音".into() }, - QualityCandidate { level: "lossless".into(), label: "无损".into() }, - QualityCandidate { level: "exhigh".into(), label: "极高".into() }, - QualityCandidate { level: "standard".into(), label: "标准".into() }, - ] -} - -pub fn normalize_quality(value: &str) -> String { - let raw = value.to_lowercase(); - match raw.as_str() { - "jymaster" | "master" | "studio" | "svip" => "jymaster".into(), - "hires" | "hi-res" | "highres" | "zhenyin" | "spatial" => "hires".into(), - "lossless" | "flac" | "sq" => "lossless".into(), - "exhigh" | "high" | "320" | "320k" | "hq" => "exhigh".into(), - "standard" | "normal" | "128" | "128k" | "std" => "standard".into(), - _ => "hires".into(), - } -} - -pub fn quality_candidates_from(target: &str) -> Vec { - let normalized = normalize_quality(target); - let all = netease_quality_candidates(); - let start = all.iter().position(|c| c.level == normalized).unwrap_or(0); - all[start..].to_vec() -} diff --git a/参考/NexBox-main/src-tauri/src/music_api/netease.rs b/参考/NexBox-main/src-tauri/src/music_api/netease.rs deleted file mode 100644 index 2b1cffa..0000000 --- a/参考/NexBox-main/src-tauri/src/music_api/netease.rs +++ /dev/null @@ -1,1090 +0,0 @@ -use std::time::Duration; - -use reqwest::header::{COOKIE, REFERER, USER_AGENT}; -use serde_json::{json, Value}; - -use super::crypto::{build_eapi_header, encrypt_eapi_payload}; -use super::models::*; - -const NETEASE_USER_AGENT: &str = "Mozilla/5.0 (Linux; Android 9; PCT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.311 Mobile Safari/537.36"; -const EAPI_BASE: &str = "https://interface3.music.163.com/eapi"; - -fn build_client() -> reqwest::Client { - reqwest::Client::builder() - .timeout(Duration::from_secs(15)) - .build() - .expect("Failed to build HTTP client") -} - -/// 发送普通 POST 请求 (带 Cookie, 不加密) -/// 参考 NeteaseCloudMusicApi / Mineradio 的请求方式 -async fn post_api( - client: &reqwest::Client, - api_path: &str, - params: &[(&str, &str)], - cookie: &str, -) -> Result { - let url = format!("https://music.163.com/api{}", &api_path[4..]); // /api/xxx -> https://music.163.com/api/xxx - - let resp = client - .post(&url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .form(params) - .send() - .await - .map_err(|e| format!("POST {api_path} failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read response: {e}"))?; - serde_json::from_str(&text).map_err(|e| format!("Failed to parse JSON from {api_path}: {e}")) -} - -/// 发送普通 GET 请求 (带 Cookie, 不加密) -async fn get_api( - client: &reqwest::Client, - api_path: &str, - params: &[(&str, &str)], - cookie: &str, -) -> Result { - let url = format!("https://music.163.com/api{}", &api_path[4..]); - - let resp = client - .get(&url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .query(params) - .send() - .await - .map_err(|e| format!("GET {api_path} failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read response: {e}"))?; - serde_json::from_str(&text).map_err(|e| format!("Failed to parse JSON from {api_path}: {e}")) -} - -/// EAPI 请求结果 (包含 JSON 和 Set-Cookie) -struct EapiResult { - json: Value, - cookies: String, // 从 Set-Cookie 头提取的 cookie 字符串 -} - -/// 发送 EAPI 请求 (捕获 Set-Cookie) -async fn post_eapi_full( - client: &reqwest::Client, - api_path: &str, - payload: serde_json::Map, - user_cookie: &str, -) -> Result { - let url = format!("{EAPI_BASE}{}", &api_path[4..]); // 去掉 /api 前缀拼接 - - let mut full_payload = payload; - let header = build_eapi_header(); - full_payload.insert( - "header".into(), - Value::String(serde_json::to_string(&header).map_err(|e| e.to_string())?), - ); - - let payload_text = serde_json::to_string(&full_payload).map_err(|e| e.to_string())?; - let encrypted = encrypt_eapi_payload(api_path, &payload_text)?; - - // 合并 header cookie 和用户 cookie - let header_cookie = header - .iter() - .map(|(k, v)| format!("{k}={}", v.as_str().unwrap_or(""))) - .collect::>() - .join("; "); - - let full_cookie = if user_cookie.is_empty() { - header_cookie - } else { - format!("{header_cookie}; {user_cookie}") - }; - - let resp = client - .post(&url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, &full_cookie) - .form(&[("params", encrypted.as_str())]) - .send() - .await - .map_err(|e| format!("EAPI request failed: {e}"))?; - - // 提取 Set-Cookie 头中的所有 cookie - let cookies: Vec = resp - .headers() - .get_all("set-cookie") - .iter() - .filter_map(|v| v.to_str().ok()) - .filter_map(|s| { - // 取每条 Set-Cookie 的第一部分 (key=value) - let part = s.split(';').next()?.trim(); - if part.is_empty() { - None - } else { - Some(part.to_string()) - } - }) - .collect(); - let cookie_str = cookies.join("; "); - - let text = resp - .text() - .await - .map_err(|e| format!("Failed to read EAPI response: {e}"))?; - - let json = serde_json::from_str(&text) - .map_err(|e| format!("Failed to parse EAPI response: {e}"))?; - - Ok(EapiResult { json, cookies: cookie_str }) -} - -/// 发送 EAPI 请求 (仅返回 JSON) -async fn post_eapi( - client: &reqwest::Client, - api_path: &str, - payload: serde_json::Map, - user_cookie: &str, -) -> Result { - post_eapi_full(client, api_path, payload, user_cookie) - .await - .map(|r| r.json) -} - -fn map_artists(raw: &[Value]) -> Vec { - raw.iter() - .filter_map(|a| { - let name = a.get("name").and_then(|v| v.as_str()).unwrap_or(""); - if name.is_empty() { - None - } else { - Some(Artist { - id: a - .get("id") - .and_then(|v| v.as_i64()) - .map(|n| n.to_string()), - mid: a.get("mid").and_then(|v| v.as_str()).map(|s| s.to_string()), - name: name.to_string(), - pic_url: a - .get("picUrl") - .or_else(|| a.get("img1v1Url")) - .or_else(|| a.get("cover")) - .and_then(|v| v.as_str()) - .map(|s| s.to_string()), - music_size: a.get("musicSize").and_then(|v| v.as_i64()), - }) - } - }) - .collect() -} - -fn map_song_record(s: &Value) -> Song { - let artists_raw = s - .get("ar") - .or_else(|| s.get("artists")) - .and_then(|v| v.as_array()) - .cloned() - .unwrap_or_default(); - let artists = map_artists(&artists_raw); - - let album = s.get("al").or_else(|| s.get("album")).unwrap_or(&Value::Null); - Song { - provider: "netease".into(), - id: s.get("id") - .and_then(|v| v.as_i64()) - .map(|n| n.to_string()) - .or_else(|| s.get("id").and_then(|v| v.as_str()).map(|s| s.to_string())) - .unwrap_or_default(), - mid: None, - media_mid: None, - name: s.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - artist: artists.iter().map(|a| a.name.clone()).collect::>().join(" / "), - artists, - album: album - .get("name") - .or_else(|| album.get("title")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(), - cover: album - .get("picUrl") - .or_else(|| album.get("coverUrl")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(), - duration: s - .get("dt") - .or_else(|| s.get("duration")) - .and_then(|v| v.as_i64()) - .map(|n| n as u64) - .unwrap_or(0), - fee: s.get("fee").and_then(|v| v.as_i64()).map(|n| n as i32).unwrap_or(0), - playable: true, - language: s.get("language").and_then(|v| v.as_i64()).map(|n| n as i32).unwrap_or(0), - } -} - -/// 搜索歌曲 -pub async fn search(keywords: &str, limit: u32, cookie: &str) -> Result, String> { - let client = build_client(); - - // 参考 NeteaseCloudMusicApi: 用普通 POST 请求 (带 Cookie), 不用 EAPI 加密 - let url = "https://music.163.com/api/cloudsearch/get/web"; - let body = format!( - "s={}&type=1&limit={}&offset=0", - urlencoding::encode(keywords), - limit - ); - - let resp = client - .post(url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .header("Content-Type", "application/x-www-form-urlencoded") - .body(body) - .send() - .await - .map_err(|e| format!("Search request failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read search response: {e}"))?; - let result: Value = serde_json::from_str(&text).map_err(|e| format!("Failed to parse search JSON: {e}"))?; - - log::info!("[NetEase] search response code={}", result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1)); - - let songs = result - .get("result") - .and_then(|r| r.get("songs")) - .and_then(|s| s.as_array()) - .ok_or("No songs in search result")?; - - let mapped: Vec = songs.iter().map(map_song_record).collect(); - - // 补齐缺失封面 - let missing: Vec = mapped - .iter() - .filter(|s| s.cover.is_empty()) - .map(|s| s.id.clone()) - .collect(); - - if !missing.is_empty() { - if let Ok(details) = song_detail(&client, &missing, cookie).await { - let id_to_pic: std::collections::HashMap = details - .iter() - .map(|s| (s.id.clone(), s.cover.clone())) - .collect(); - return Ok(mapped - .iter() - .map(|s| { - if s.cover.is_empty() { - Song { - cover: id_to_pic.get(&s.id).cloned().unwrap_or_default(), - ..s.clone() - } - } else { - s.clone() - } - }) - .collect()); - } - } - - Ok(mapped) -} - -/// 歌曲详情 (批量) -pub async fn song_detail( - client: &reqwest::Client, - ids: &[String], - cookie: &str, -) -> Result, String> { - // 构建 c 参数: [{"id": 123}, {"id": 456}] - let c_value: Value = Value::Array( - ids.iter() - .map(|id| json!({ "id": id.parse::().unwrap_or(0) })) - .collect(), - ); - let c_str = serde_json::to_string(&c_value).unwrap_or_default(); - - let result = post_api(client, "/api/v3/song/detail", &[("c", &c_str), ("csrf_token", "")], cookie).await?; - - let songs = result - .get("songs") - .and_then(|s| s.as_array()) - .ok_or("No songs in detail result")?; - - Ok(songs.iter().map(map_song_record).collect()) -} - -/// 获取播放地址 (带音质降级) -pub async fn song_url(id: &str, preferred_quality: &str, cookie: &str) -> Result { - let client = build_client(); - let candidates = quality_candidates_from(preferred_quality); - let mut trial_fallback: Option = None; - - for q in &candidates { - let level = q.level.as_str(); - // ids 参数需要 JSON 数组格式: ["12345"] - let ids_json = format!("[\"{id}\"]"); - let params: [(&str, &str); 4] = [ - ("ids", &ids_json), - ("level", level), - ("encodeType", "flac"), - ("csrf_token", ""), - ]; - - match post_api(&client, "/api/song/enhance/player/url/v1", ¶ms, cookie).await { - Ok(result) => { - let data = result - .get("data") - .and_then(|d| d.as_array()) - .and_then(|arr| arr.first()) - .cloned() - .unwrap_or(Value::Null); - - let url = data.get("url").and_then(|u| u.as_str()).unwrap_or(""); - let free_trial = data.get("freeTrialInfo").is_some(); - let br = data.get("br").and_then(|b| b.as_u64()).unwrap_or(0); - let fee = data.get("fee").and_then(|f| f.as_i64()).map(|n| n as i32); - - if !url.is_empty() && !free_trial { - return Ok(SongUrlResult { - url: Some(url.to_string()), - playable: true, - trial: false, - level: q.level.clone(), - quality: q.label.clone(), - br, - fee, - ..Default::default() - }); - } - - if !url.is_empty() && free_trial && trial_fallback.is_none() { - trial_fallback = Some(SongUrlResult { - url: Some(url.to_string()), - playable: true, - trial: true, - level: q.level.clone(), - quality: q.label.clone(), - br, - fee, - message: Some("仅试听片段".into()), - ..Default::default() - }); - } - } - Err(_e) => { - // 继续尝试下一个音质 - } - } - } - - if let Some(fallback) = trial_fallback { - return Ok(fallback); - } - - Ok(SongUrlResult { - playable: false, - reason: Some("url_unavailable".into()), - message: Some("无法获取播放地址,可能需要登录或 VIP".into()), - ..Default::default() - }) -} - -/// 二维码登录 - 获取 key -pub async fn login_qr_key(cookie: &str) -> Result { - let client = build_client(); - let mut payload = serde_json::Map::new(); - payload.insert("type".into(), json!(1)); - payload.insert("csrf_token".into(), json!("")); - - let result = post_eapi(&client, "/api/login/qrcode/unikey", payload, cookie).await?; - result - .get("unikey") - .and_then(|v| v.as_str()) - .map(|s| s.to_string()) - .ok_or("Failed to get QR key".into()) -} - -/// 二维码登录 - 生成二维码 URL -/// 网易云 EAPI 不返回 qrimg,需要用 key 拼接 URL 在前端生成 QR 码 -pub async fn login_qr_create(key: &str, _cookie: &str) -> Result { - // 返回扫码登录 URL,前端用 qrcode 库渲染 - Ok(format!("https://music.163.com/login?codekey={key}")) -} - -/// 二维码登录 - 检查状态 (捕获 Set-Cookie) -pub async fn login_qr_check(key: &str, cookie: &str) -> Result { - let client = build_client(); - let mut payload = serde_json::Map::new(); - payload.insert("key".into(), json!(key)); - payload.insert("csrf_token".into(), json!("")); - - let eapi_result = post_eapi_full(&client, "/api/login/qrcode/client/login", payload, cookie).await?; - let result = &eapi_result.json; - - let code = result - .get("code") - .and_then(|v| v.as_i64()) - .map(|n| n as i32) - .unwrap_or(0); - let message = result - .get("message") - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(); - let nickname = result - .get("nickname") - .or_else(|| result.get("profile").and_then(|p| p.get("nickname"))) - .and_then(|v| v.as_str()) - .map(|s| s.to_string()); - let avatar = result - .get("avatarUrl") - .or_else(|| result.get("profile").and_then(|p| p.get("avatarUrl"))) - .and_then(|v| v.as_str()) - .map(|s| s.to_string()); - - // code 803 = 登录成功 - // Cookie 在 Set-Cookie 响应头中,不在 JSON body 中 - let extracted_cookie = if code == 803 { - if !eapi_result.cookies.is_empty() { - Some(eapi_result.cookies.clone()) - } else { - // 尝试从 JSON body 提取 (有些版本会返回) - result - .get("cookie") - .and_then(|v| v.as_str()) - .map(|s| s.to_string()) - } - } else { - None - }; - - Ok(QrCheckResult { - code, - message, - cookie: extracted_cookie, - nickname, - avatar, - }) -} - -/// 获取登录状态和用户信息 -/// 参考 Mineradio: 用普通 GET 请求 (带 Cookie), 不用 EAPI 加密 -pub async fn login_status(cookie: &str) -> Result { - if cookie.is_empty() || !super::cookie::netease_cookie_has_login(cookie) { - return Ok(LoginInfo { - provider: "netease".into(), - ..Default::default() - }); - } - - let client = build_client(); - - // 优先用 /api/w/nuser/account/get (GET, 带 Cookie) - let url = "https://music.163.com/api/w/nuser/account/get"; - let resp = client - .get(url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .send() - .await - .map_err(|e| format!("login_status request failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read response: {e}"))?; - let result: Value = serde_json::from_str(&text).map_err(|e| format!("Failed to parse JSON: {e}"))?; - - let code = result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1); - log::info!("[NetEase] login_status GET response code={code}"); - - // 参考 Mineradio: data.profile || body.profile, data.account || body.account - let data = result.get("data").unwrap_or(&result); - let profile = data - .get("profile") - .or_else(|| result.get("profile")) - .or_else(|| data.get("account").and_then(|a| a.get("profile"))) - .or_else(|| result.get("account").and_then(|a| a.get("profile"))) - .cloned() - .unwrap_or(Value::Null); - - if profile.is_null() { - log::warn!("[NetEase] login_status: profile is null, response: {result}"); - return Ok(LoginInfo { - provider: "netease".into(), - logged_in: false, - ..Default::default() - }); - } - - // 参考 Mineradio normalizeLoginInfo: userId 必须存在才算登录 - let user_id = profile - .get("userId") - .or_else(|| profile.get("user_id")) - .or_else(|| profile.get("id")) - .and_then(|v| v.as_i64()) - .map(|n| n.to_string()) - .unwrap_or_default(); - - if user_id.is_empty() { - log::warn!("[NetEase] login_status: no userId in profile, profile: {profile}"); - return Ok(LoginInfo { - provider: "netease".into(), - logged_in: false, - ..Default::default() - }); - } - - let vip_type = profile - .get("vipType") - .and_then(|v| v.as_i64()) - .map(|n| n as i32) - .unwrap_or(0); - let is_vip = vip_type >= 1; - let is_svip = vip_type >= 10; - - let nickname = profile - .get("nickname") - .or_else(|| profile.get("userName")) - .and_then(|v| v.as_str()) - .unwrap_or("网易云用户") - .to_string(); - - log::info!("[NetEase] login_status success: userId={user_id}, nickname={nickname}"); - - Ok(LoginInfo { - provider: "netease".into(), - logged_in: true, - user_id, - nickname, - avatar: profile - .get("avatarUrl") - .or_else(|| profile.get("avatar")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(), - vip_type, - vip_level: if is_svip { - "svip".into() - } else if is_vip { - "vip".into() - } else { - "none".into() - }, - is_vip, - is_svip, - }) -} - -/// 获取用户歌单 -pub async fn user_playlist(uid: &str, cookie: &str) -> Result, String> { - let client = build_client(); - // 用 GET 请求, uid 作为 query 参数 - let limit_str = "100".to_string(); - let offset_str = "0".to_string(); - let result = get_api(&client, "/api/user/playlist", &[ - ("uid", uid), - ("limit", &limit_str), - ("offset", &offset_str), - ("csrf_token", ""), - ], cookie).await?; - - let code = result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1); - let keys = result.as_object().map(|o| o.keys().cloned().collect::>().join(",")).unwrap_or_default(); - log::info!("[NetEase] user_playlist response code={code}, keys={keys}"); - - // 普通 API 可能返回 playlist 数组, 也可能直接是数组 - let playlists = result - .get("playlist") - .and_then(|p| p.as_array()) - .or_else(|| result.as_array()) - .ok_or_else(|| format!("No playlist in result, code={code}, keys={keys}"))?; - - Ok(playlists - .iter() - .map(|pl| Playlist { - provider: "netease".into(), - id: pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default(), - name: pl.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - cover: pl.get("coverImgUrl").or_else(|| pl.get("picUrl")).and_then(|v| v.as_str()).unwrap_or("").to_string(), - track_count: pl.get("trackCount").and_then(|v| v.as_u64()).map(|n| n as u32).unwrap_or(0), - creator: pl - .get("creator") - .and_then(|c| c.get("nickname")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(), - subscribed: pl.get("subscribed").and_then(|v| v.as_bool()).unwrap_or(false), - }) - .collect()) -} - -/// 获取歌单元信息(仅元数据,不加载曲目) -pub async fn playlist_detail(id: &str, cookie: &str) -> Result { - let client = build_client(); - let n_str = "0".to_string(); - let s_str = "0".to_string(); - let detail = post_api(&client, "/api/v6/playlist/detail", &[ - ("id", id), - ("n", &n_str), - ("s", &s_str), - ("csrf_token", ""), - ], cookie).await?; - - let pl = detail.get("playlist").ok_or("No playlist in result")?; - Ok(Playlist { - provider: "netease".into(), - id: pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default(), - name: pl.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - cover: pl.get("coverImgUrl").and_then(|v| v.as_str()).unwrap_or("").to_string(), - track_count: pl.get("trackCount").and_then(|v| v.as_u64()).map(|n| n as u32).unwrap_or(0), - creator: pl.get("creator").and_then(|c| c.get("nickname")).and_then(|v| v.as_str()).unwrap_or("").to_string(), - ..Default::default() - }) -} - -/// 获取歌单元数据 + 全部 trackIds(不加载曲目详情,用于前端分页) -pub async fn playlist_info_with_track_ids(id: &str, cookie: &str) -> Result<(Playlist, Vec), String> { - let client = build_client(); - let n_str = "1000".to_string(); - let s_str = "0".to_string(); - let detail = post_api(&client, "/api/v6/playlist/detail", &[ - ("id", id), - ("n", &n_str), - ("s", &s_str), - ("csrf_token", ""), - ], cookie).await?; - - let pl = detail.get("playlist").ok_or("No playlist in result")?; - let playlist = Playlist { - provider: "netease".into(), - id: pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default(), - name: pl.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - cover: pl.get("coverImgUrl").and_then(|v| v.as_str()).unwrap_or("").to_string(), - track_count: pl.get("trackCount").and_then(|v| v.as_u64()).map(|n| n as u32).unwrap_or(0), - creator: pl.get("creator").and_then(|c| c.get("nickname")).and_then(|v| v.as_str()).unwrap_or("").to_string(), - ..Default::default() - }; - - let track_ids: Vec = pl - .get("trackIds") - .and_then(|t| t.as_array()) - .cloned() - .unwrap_or_default() - .iter() - .filter_map(|v| v.get("id").and_then(|id| id.as_i64()).map(|n| n.to_string())) - .collect(); - - Ok((playlist, track_ids)) -} - -/// 获取歌单前 50 首曲目 -pub async fn playlist_tracks(id: &str, cookie: &str) -> Result<(Playlist, Vec), String> { - let (pl, track_ids) = playlist_info_with_track_ids(id, cookie).await?; - if track_ids.is_empty() { - return Ok((pl, vec![])); - } - let end = 50.min(track_ids.len()); - let client = build_client(); - let songs = song_detail(&client, &track_ids[..end], cookie).await.unwrap_or_default(); - Ok((pl, songs)) -} - -/// 加载歌单后继续加更多曲目(指定 range) -pub async fn playlist_tracks_range(id: &str, start: usize, count: usize, cookie: &str) -> Result, String> { - let (_, track_ids) = playlist_info_with_track_ids(id, cookie).await?; - if track_ids.is_empty() || start >= track_ids.len() { - return Ok(vec![]); - } - let client = build_client(); - let end = (start + count).min(track_ids.len()); - let range_ids: Vec = track_ids[start..end].to_vec(); - let songs = song_detail(&client, &range_ids, cookie).await.unwrap_or_default(); - Ok(songs) -} - -/// 获取喜欢列表 — 优先从"我喜欢的音乐"歌单取 trackIds -pub async fn likelist(uid: &str, cookie: &str) -> Result, String> { - let client = build_client(); - - // 1. 获取用户歌单,找到"我喜欢的音乐"(特殊歌单,id 格式为 uid) - let limit_str = "200".to_string(); - let offset_str = "0".to_string(); - let pl_result = get_api(&client, "/api/user/playlist", &[ - ("uid", uid), - ("limit", &limit_str), - ("offset", &offset_str), - ("csrf_token", ""), - ], cookie).await?; - - let playlists = pl_result - .get("playlist") - .and_then(|p| p.as_array()) - .ok_or("No playlists in result")?; - - // 找到"我喜欢的音乐"歌单(网易云特殊歌单,specialType=5 或名称匹配) - let liked_pl = playlists.iter().find(|pl| { - let special = pl.get("specialType").and_then(|v| v.as_i64()).unwrap_or(0); - special == 5 - }).or_else(|| { - playlists.iter().find(|pl| { - let name = pl.get("name").and_then(|v| v.as_str()).unwrap_or(""); - name == "我喜欢的音乐" || name.contains("喜欢") - }) - }).or_else(|| { - // 兜底:用 uid 作为歌单 id - playlists.iter().find(|pl| { - pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string() == uid).unwrap_or(false) - }) - }); - - let liked_id = if let Some(pl) = liked_pl { - pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default() - } else { - uid.to_string() - }; - - log::info!("[NetEase] liked playlist id: {liked_id}"); - - // 2. 获取歌单详情取 trackIds(仅元数据,不加载曲目详情) - let detail = post_api(&client, "/api/v6/playlist/detail", &[ - ("id", &liked_id), - ("n", "0"), - ("s", "0"), - ("csrf_token", ""), - ], cookie).await?; - - let pl = detail.get("playlist").ok_or("No playlist in detail")?; - let ids: Vec = pl - .get("trackIds") - .and_then(|t| t.as_array()) - .cloned() - .unwrap_or_default() - .iter() - .filter_map(|v| { - v.get("id").and_then(|id| id.as_i64()).map(|n| n.to_string()) - }) - .collect(); - - log::info!("[NetEase] likelist loaded {} songs from playlist", ids.len()); - Ok(ids) -} - -/// 红心/取消红心 -pub async fn like(id: &str, like: bool, cookie: &str) -> Result<(), String> { - let client = build_client(); - let like_str = if like { "true" } else { "false" }; - let result = post_api(&client, "/api/song/like", &[ - ("trackId", id), - ("like", like_str), - ("csrf_token", ""), - ], cookie).await?; - let code = result.get("code").and_then(|v| v.as_i64()).unwrap_or(0); - if code == 200 { - Ok(()) - } else { - Err(format!("Like failed with code: {code}")) - } -} - -/// 收藏/取消收藏歌单 -pub async fn playlist_subscribe(id: &str, subscribe: bool, cookie: &str) -> Result<(), String> { - let client = build_client(); - let csrf = super::cookie::parse_cookie_string(cookie) - .get("__csrf") - .cloned() - .unwrap_or_default(); - let api = if subscribe { "/api/playlist/subscribe" } else { "/api/playlist/unsubscribe" }; - let result = post_api(&client, api, &[ - ("id", id), - ("csrf_token", &csrf), - ], cookie).await?; - let code = result.get("code").and_then(|v| v.as_i64()).unwrap_or(0); - if code == 200 { - Ok(()) - } else { - Err(format!("Playlist subscribe failed with code: {code}")) - } -} - -/// 获取歌词 -pub async fn lyric(id: &str, cookie: &str) -> Result { - let client = build_client(); - let result = post_api(&client, "/api/song/lyric/v1", &[ - ("id", id), - ("cp", "false"), - ("lv", "0"), - ("kv", "0"), - ("tv", "0"), - ("rv", "0"), - ("yv", "0"), - ("ytv", "0"), - ("yrv", "0"), - ("csrf_token", ""), - ], cookie).await?; - - let lyric = result - .get("lrc") - .and_then(|l| l.get("lyric")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(); - - let translation = result - .get("tlyric") - .and_then(|l| l.get("lyric")) - .and_then(|v| v.as_str()) - .filter(|s| !s.is_empty()) - .map(|s| s.to_string()); - - let roma = result - .get("romalrc") - .and_then(|l| l.get("lyric")) - .and_then(|v| v.as_str()) - .filter(|s| !s.is_empty()) - .map(|s| s.to_string()); - - let yrc = result - .get("yrc") - .and_then(|l| l.get("lyric")) - .and_then(|v| v.as_str()) - .filter(|s| !s.is_empty()) - .map(|s| s.to_string()); - - Ok(Lyrics { - lyric, - translation, - roma, - yrc, - }) -} - -/// 推荐歌单 -pub async fn personalized(cookie: &str) -> Result, String> { - let client = build_client(); - let limit_str = "30".to_string(); - let result = post_api(&client, "/api/personalized/playlist", &[ - ("limit", &limit_str), - ("csrf_token", ""), - ], cookie).await?; - - let playlists = result.get("result").and_then(|v| v.as_array()).cloned().unwrap_or_default(); - Ok(playlists - .iter() - .map(|pl| Playlist { - provider: "netease".into(), - id: pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default(), - name: pl.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - cover: pl.get("picUrl").and_then(|v| v.as_str()).unwrap_or("").to_string(), - track_count: pl.get("trackCount") - .and_then(|v| v.as_u64().or_else(|| v.as_i64().map(|n| n as u64)).or_else(|| v.as_f64().map(|n| n as u64))) - .map(|n| n as u32) - .unwrap_or(0), - creator: pl.get("creator").and_then(|c| c.get("nickname")).and_then(|v| v.as_str()) - .or_else(|| pl.get("copywriter").and_then(|v| v.as_str())) - .unwrap_or("").to_string(), - ..Default::default() - }) - .collect()) -} - -/// 每日推荐歌曲 -pub async fn recommend_songs(cookie: &str) -> Result, String> { - let client = build_client(); - let result = get_api(&client, "/api/v3/discovery/recommend/songs", &[ - ("csrf_token", ""), - ], cookie).await?; - - let songs = result - .get("data") - .and_then(|d| d.get("dailySongs")) - .and_then(|s| s.as_array()) - .cloned() - .unwrap_or_default(); - - Ok(songs.iter().map(map_song_record).collect()) -} - -/// 搜索歌单 (使用 cloudsearch type=1000) -pub async fn playlist_search(keywords: &str, limit: u32, cookie: &str) -> Result, String> { - let client = build_client(); - let url = "https://music.163.com/api/cloudsearch/get/web"; - let body = format!( - "s={}&type=1000&limit={}&offset=0", - urlencoding::encode(keywords), - limit - ); - - let resp = client - .post(url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .header("Content-Type", "application/x-www-form-urlencoded") - .body(body) - .send() - .await - .map_err(|e| format!("Playlist search request failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read playlist search response: {e}"))?; - let result: Value = serde_json::from_str(&text).map_err(|e| format!("Failed to parse playlist search JSON: {e}"))?; - - log::info!("[NetEase] playlist_search response code={}", result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1)); - - let playlists_raw = result - .get("result") - .and_then(|r| r.get("playlists")) - .and_then(|a| a.as_array()) - .ok_or("No playlists in search result")?; - - let playlists: Vec = playlists_raw - .iter() - .map(|pl| Playlist { - provider: "netease".into(), - id: pl.get("id").and_then(|v| v.as_i64()).map(|n| n.to_string()).unwrap_or_default(), - name: pl.get("name").and_then(|v| v.as_str()).unwrap_or("").to_string(), - cover: pl.get("coverImgUrl").or_else(|| pl.get("picUrl")).and_then(|v| v.as_str()).unwrap_or("").to_string(), - track_count: pl.get("trackCount") - .and_then(|v| v.as_u64().or_else(|| v.as_i64().map(|n| n as u64)).or_else(|| v.as_f64().map(|n| n as u64))) - .map(|n| n as u32) - .unwrap_or(0), - creator: pl - .get("creator") - .and_then(|c| c.get("nickname")) - .and_then(|v| v.as_str()) - .unwrap_or("") - .to_string(), - ..Default::default() - }) - .collect(); - - Ok(playlists) -} - -/// 搜索歌手 (使用 cloudsearch type=100) -pub async fn artist_search(keywords: &str, limit: u32, cookie: &str) -> Result, String> { - let client = build_client(); - let url = "https://music.163.com/api/cloudsearch/get/web"; - let body = format!( - "s={}&type=100&limit={}&offset=0", - urlencoding::encode(keywords), - limit - ); - - let resp = client - .post(url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .header("Content-Type", "application/x-www-form-urlencoded") - .body(body) - .send() - .await - .map_err(|e| format!("Artist search request failed: {e}"))?; - - let text = resp.text().await.map_err(|e| format!("Failed to read artist search response: {e}"))?; - let result: Value = serde_json::from_str(&text).map_err(|e| format!("Failed to parse artist search JSON: {e}"))?; - - log::info!("[NetEase] artist_search response code={}", result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1)); - - let artists_raw = result - .get("result") - .and_then(|r| r.get("artists")) - .and_then(|a| a.as_array()) - .ok_or("No artists in search result")?; - - let artists = map_artists(artists_raw); - - Ok(artists) -} - -/// 获取歌手热门歌曲(参考 Mineradio:先用 EAPI artist/songs,失败回退 artist/top/song) -pub async fn artist_songs( - artist_id: &str, - limit: u32, - offset: u32, - cookie: &str, -) -> Result, String> { - let client = build_client(); - - // 主策略:EAPI POST /api/artist/songs - let mut payload = serde_json::Map::new(); - payload.insert("id".into(), json!(artist_id)); - payload.insert("limit".into(), json!(limit)); - payload.insert("offset".into(), json!(offset)); - payload.insert("order".into(), json!("hot")); - - let result = post_eapi(&client, "/api/artist/songs", payload, cookie).await?; - log::info!("[NetEase] artist_songs EAPI response code={}", result.get("code").and_then(|v| v.as_i64()).unwrap_or(-1)); - - let songs_raw = result - .get("songs") - .or_else(|| result.get("data").and_then(|d| d.get("songs"))) - .or_else(|| result.get("hotSongs")) - .and_then(|s| s.as_array()) - .cloned() - .unwrap_or_default(); - - // 回退策略:如果 artist/songs 返回空,尝试 artist/top/song - let songs_raw = if songs_raw.is_empty() { - log::info!("[NetEase] artist_songs empty, trying artist/top/song fallback"); - let mut fallback_payload = serde_json::Map::new(); - fallback_payload.insert("id".into(), json!(artist_id)); - - match post_eapi(&client, "/api/artist/top/song", fallback_payload, cookie).await { - Ok(fb) => { - log::info!("[NetEase] artist/top/song response code={}", fb.get("code").and_then(|v| v.as_i64()).unwrap_or(-1)); - fb.get("songs") - .or_else(|| fb.get("data").and_then(|d| d.get("songs"))) - .and_then(|s| s.as_array()) - .cloned() - .unwrap_or_default() - } - Err(e) => { - log::warn!("[NetEase] artist/top/song fallback failed: {e}"); - vec![] - } - } - } else { - songs_raw - }; - - if songs_raw.is_empty() { - return Err("No songs in artist result".into()); - } - - let mut mapped: Vec = songs_raw.iter().map(map_song_record).collect(); - - // 歌手歌曲 API 返回的歌曲可能缺少封面,用 song_detail 补齐 - let missing: Vec = mapped - .iter() - .filter(|s| s.cover.is_empty()) - .map(|s| s.id.clone()) - .collect(); - - if !missing.is_empty() { - if let Ok(details) = song_detail(&client, &missing, cookie).await { - let id_to_pic: std::collections::HashMap = details - .iter() - .map(|s| (s.id.clone(), s.cover.clone())) - .collect(); - mapped = mapped - .iter() - .map(|s| { - if s.cover.is_empty() { - Song { - cover: id_to_pic.get(&s.id).cloned().unwrap_or_default(), - ..s.clone() - } - } else { - s.clone() - } - }) - .collect(); - } - } - - Ok(mapped) -} diff --git a/参考/NexBox-main/src-tauri/src/netease_lyrics.rs b/参考/NexBox-main/src-tauri/src/netease_lyrics.rs deleted file mode 100644 index c612b68..0000000 --- a/参考/NexBox-main/src-tauri/src/netease_lyrics.rs +++ /dev/null @@ -1,830 +0,0 @@ -#[derive(Default, Clone)] -pub struct Snapshot { - pub current_lyric: Option, - pub song_title: Option, - pub song_artist: Option, -} - -#[cfg(not(target_os = "windows"))] -pub fn collect_snapshot() -> Snapshot { - Snapshot::default() -} - -#[cfg(target_os = "windows")] -mod imp { - use std::cell::RefCell; - use std::collections::HashSet; - use std::time::Duration; - - use aes::cipher::{generic_array::GenericArray, BlockEncrypt, KeyInit}; - use aes::Aes128; - use md5::{Digest, Md5}; - use rand::Rng; - use regex::Regex; - use reqwest::blocking::Client; - use reqwest::header::{COOKIE, REFERER, USER_AGENT}; - use serde_json::{json, Map, Value}; - use sysinfo::System; - use windows::{ - core::{GUID, VARIANT}, - Media::Control::{ - GlobalSystemMediaTransportControlsSession, - GlobalSystemMediaTransportControlsSessionManager, - GlobalSystemMediaTransportControlsSessionPlaybackStatus, - }, - Win32::{ - System::Com::{CoCreateInstance, CLSCTX_ALL}, - UI::Accessibility::{ - IUIAutomation, - TreeScope_Children, - TreeScope_Descendants, - UIA_TextControlTypeId, - UIA_ControlTypePropertyId, - UIA_ProcessIdPropertyId, - }, - }, - }; - - use super::Snapshot; - - const NETEASE_EAPI_KEY: &[u8; 16] = b"e82ckenh8dichen8"; - const NETEASE_USER_AGENT: &str = "Mozilla/5.0 (Linux; Android 9; PCT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.311 Mobile Safari/537.36"; - const SEARCH_API_URL: &str = "https://interface3.music.163.com/eapi/search/get"; - const SEARCH_API_PATH: &str = "/api/search/get"; - const LYRIC_API_URL: &str = "https://interface3.music.163.com/eapi/song/lyric/v1"; - const LYRIC_API_PATH: &str = "/api/song/lyric/v1"; - const MATCH_THRESHOLD: f64 = 0.60; - const WINDOWS_TICK_PER_MILLISECOND: i64 = 10_000; - const WINDOWS_EPOCH_OFFSET_TICKS: i64 = 116_444_736_000_000_000; - - #[derive(Clone)] - struct LyricLine { - time_ms: i64, - text: String, - } - - #[derive(Default)] - struct CachedTrackLyrics { - track_key: String, - lines: Vec, - } - - pub fn collect_snapshot() -> Snapshot { - thread_local! { - static COLLECTOR: RefCell> = const { RefCell::new(None) }; - } - - COLLECTOR.with(|slot| { - let mut slot = slot.borrow_mut(); - if slot.is_none() { - match NeteaseLyricsCollector::new() { - Ok(collector) => { - *slot = Some(collector); - } - Err(error) => { - log::warn!("初始化网易云歌词采集器失败: {error}"); - return Snapshot::default(); - } - } - } - - match slot.as_mut() { - Some(collector) => collector.collect(), - None => Snapshot::default(), - } - }) - } - - struct NeteaseLyricsCollector { - session_manager: GlobalSystemMediaTransportControlsSessionManager, - automation: IUIAutomation, - http_client: Client, - cached_track: Option, - - // Track local timer to avoid calling UIA continuously and for smooth interpolation - last_uia_progress_ms: i64, - last_uia_update_ticks: i64, - } - - impl NeteaseLyricsCollector { - fn new() -> Result { - // Prefer CUIAutomation8 (Windows 8+) for better modern UI support - const CUIAUTOMATION8_CLSID: GUID = GUID::from_u128(0xe22ad333_b25f_460c_83d0_0581107395c9); - const CUIAUTOMATION_CLSID: GUID = GUID::from_u128(0xff48dba4_60ef_4201_aa87_54103eef594e); - - let session_manager = GlobalSystemMediaTransportControlsSessionManager::RequestAsync() - .map_err(|error| error.to_string())? - .get() - .map_err(|error| error.to_string())?; - - let automation: IUIAutomation = unsafe { - CoCreateInstance(&CUIAUTOMATION8_CLSID, None, CLSCTX_ALL) - .or_else(|_| CoCreateInstance(&CUIAUTOMATION_CLSID, None, CLSCTX_ALL)) - .map_err(|error| error.to_string())? - }; - - let http_client = Client::builder() - .timeout(Duration::from_secs(8)) - .build() - .map_err(|error| error.to_string())?; - - Ok(Self { - session_manager, - automation, - http_client, - cached_track: None, - last_uia_progress_ms: -1, - last_uia_update_ticks: 0, - }) - } - - fn collect(&mut self) -> Snapshot { - let session = match self.session_manager.GetCurrentSession() { - Ok(session) => session, - Err(_) => { - self.cached_track = None; - return Snapshot::default(); - } - }; - - if !is_netease_session(&session) { - self.cached_track = None; - return Snapshot::default(); - } - - let media = match session.TryGetMediaPropertiesAsync().and_then(|task| task.get()) { - Ok(media) => media, - Err(error) => { - log::warn!("读取网易云媒体属性失败: {error}"); - return Snapshot::default(); - } - }; - - let song_title = normalize_text(&media.Title().map(|value| value.to_string()).unwrap_or_default()); - let song_artist = normalize_text(&media.Artist().map(|value| value.to_string()).unwrap_or_default()); - - if song_title.is_none() && song_artist.is_none() { - self.cached_track = None; - return Snapshot::default(); - } - - let track_key = build_track_key(song_title.as_deref(), song_artist.as_deref()); - let current_lyric = self.get_current_lyric_for_track( - &track_key, - song_title.as_deref().unwrap_or_default(), - song_artist.as_deref().unwrap_or_default(), - &session, - ); - - Snapshot { - current_lyric, - song_title, - song_artist, - } - } - - fn get_current_lyric_for_track( - &mut self, - track_key: &str, - song_title: &str, - song_artist: &str, - session: &GlobalSystemMediaTransportControlsSession, - ) -> Option { - let needs_refresh = self - .cached_track - .as_ref() - .map(|cache| cache.track_key != track_key) - .unwrap_or(true); - - if needs_refresh { - match self.fetch_track_lyrics(song_title, song_artist) { - Ok(lines) => { - log::info!( - "网易云歌词已加载: {} - {},共 {} 行", - song_title, - song_artist, - lines.len() - ); - self.cached_track = Some(CachedTrackLyrics { - track_key: track_key.to_string(), - lines, - }); - self.last_uia_progress_ms = -1; - self.last_uia_update_ticks = 0; - } - Err(error) => { - log::warn!("获取网易云歌词失败: {error}"); - self.cached_track = Some(CachedTrackLyrics { - track_key: track_key.to_string(), - lines: Vec::new(), - }); - } - } - } - - let position_ms = self.get_accurate_position_ms(session); - - self.cached_track - .as_ref() - .and_then(|cache| lyric_at_position(&cache.lines, position_ms)) - } - - fn get_accurate_position_ms(&mut self, session: &GlobalSystemMediaTransportControlsSession) -> i64 { - let now_ticks = current_windows_ticks(); - let mut result_ms = -1; - - // 为了避免卡顿,每隔 250ms 通过 UIA 抓取一次 UI 进度文本 - if now_ticks - self.last_uia_update_ticks > 250 * WINDOWS_TICK_PER_MILLISECOND { - if let Some(uia_ms) = self.extract_progress_from_window() { - // C# 中是提取出精确的 seconds (例如 01:23 = 83 秒) - // 如果 UIA 读取的秒数变了,更新记录;否则维持平滑递增 - let uia_sec = uia_ms / 1000; - let last_sec = self.last_uia_progress_ms / 1000; - - if self.last_uia_progress_ms == -1 || uia_sec != last_sec { - self.last_uia_progress_ms = uia_ms; - self.last_uia_update_ticks = now_ticks; - } - } else { - // Fallback to GSMTC extraction if UI reading fails - let gsmtc_ms = extract_position_ms(session).unwrap_or(0); - let gsmtc_sec = gsmtc_ms / 1000; - let last_sec = self.last_uia_progress_ms / 1000; - if self.last_uia_progress_ms == -1 || gsmtc_sec != last_sec { - self.last_uia_progress_ms = gsmtc_ms; - self.last_uia_update_ticks = now_ticks; - } - } - } - - // 平滑插值计算当前真实的播放进度 (ms) - if self.last_uia_progress_ms >= 0 { - let playback_status = session.GetPlaybackInfo().ok().and_then(|info| info.PlaybackStatus().ok()); - if playback_status == Some(GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing) { - let elapsed_ms = (now_ticks - self.last_uia_update_ticks) / WINDOWS_TICK_PER_MILLISECOND; - result_ms = self.last_uia_progress_ms + elapsed_ms; - } else { - result_ms = self.last_uia_progress_ms; - } - } - - if result_ms < 0 { - 0 - } else { - result_ms - } - } - - fn extract_progress_from_window(&self) -> Option { - let root = self.find_cloudmusic_window_uia()?; - - // 网易云主窗口内的文本控件 - let condition = unsafe { self.automation.CreatePropertyCondition(UIA_ControlTypePropertyId, &VARIANT::from(UIA_TextControlTypeId.0 as i32)).ok()? }; - let elements = unsafe { root.FindAll(TreeScope_Descendants, &condition).ok()? }; - let count = unsafe { elements.Length().ok()? }; - - for index in 0..count { - let element = match unsafe { elements.GetElement(index) } { - Ok(element) => element, - Err(_) => continue, - }; - - let name = unsafe { element.CurrentName().ok() }; - if let Some(text) = name { - let text_str = text.to_string(); - if text_str.contains('/') || text_str.contains('|') { - if let Some((current_sec, _total_sec)) = parse_progress_text(&text_str) { - return Some(current_sec as i64 * 1000); - } - } - } - } - - None - } - - fn find_cloudmusic_window_uia(&self) -> Option { - let mut system = System::new_all(); - system.refresh_processes(); - - let process_ids = system - .processes() - .values() - .filter_map(|process| { - let name = process.name().to_string().to_lowercase(); - if name.contains("cloudmusic") { - Some(process.pid().as_u32()) - } else { - None - } - }) - .collect::>(); - - if process_ids.is_empty() { - return None; - } - - let desktop = unsafe { self.automation.GetRootElement().ok()? }; - - for pid in process_ids { - let pid_condition = unsafe { self.automation.CreatePropertyCondition(UIA_ProcessIdPropertyId, &VARIANT::from(pid as i32)).ok()? }; - let windows = unsafe { desktop.FindAll(TreeScope_Children, &pid_condition).ok()? }; - let count = unsafe { windows.Length().ok().unwrap_or(0) }; - - for i in 0..count { - if let Ok(win) = unsafe { windows.GetElement(i) } { - if let Ok(name) = unsafe { win.CurrentName() } { - let title = name.to_string(); - if title.contains(" - ") && !title.contains("MediaPlayer") { - return Some(win); - } - } - } - } - } - - None - } - - fn fetch_track_lyrics(&self, song_title: &str, song_artist: &str) -> Result, String> { - let keyword = build_keyword(song_title, song_artist); - let song_id = self.search_best_match(&keyword, song_title, song_artist)?; - let response = self.post_eapi( - LYRIC_API_URL, - LYRIC_API_PATH, - map_from_pairs([ - ("id", json!(song_id)), - ("cp", json!("false")), - ("lv", json!("0")), - ("kv", json!("0")), - ("tv", json!("0")), - ("rv", json!("0")), - ("yv", json!("0")), - ("ytv", json!("0")), - ("yrv", json!("0")), - ("csrf_token", json!("")), - ]), - )?; - - if response.get("code").and_then(Value::as_i64) != Some(200) { - return Err("网易云歌词接口返回失败".to_string()); - } - - let lrc = response - .get("lrc") - .and_then(Value::as_object) - .and_then(|value| value.get("lyric")) - .and_then(Value::as_str) - .unwrap_or_default(); - - if lrc.is_empty() || lrc.contains("纯音乐,请欣赏") { - return Ok(Vec::new()); - } - - Ok(parse_lrc(lrc)) - } - - fn search_best_match(&self, keyword: &str, song_title: &str, song_artist: &str) -> Result { - let response = self.post_eapi( - SEARCH_API_URL, - SEARCH_API_PATH, - map_from_pairs([ - ("s", json!(keyword)), - ("limit", json!("5")), - ("offset", json!("0")), - ("type", json!("1")), - ("csrf_token", json!("")), - ]), - )?; - - if response.get("code").and_then(Value::as_i64) != Some(200) { - return Err("网易云搜索接口返回失败".to_string()); - } - - let songs = response - .get("result") - .and_then(Value::as_object) - .and_then(|value| value.get("songs")) - .and_then(Value::as_array) - .ok_or_else(|| "网易云搜索结果为空".to_string())?; - - let mut best_song_id: Option = None; - let mut best_score = 0.0f64; - - for song in songs { - let cloud_title = song - .get("name") - .and_then(Value::as_str) - .map(normalize_owned) - .unwrap_or_default(); - let cloud_artist = song - .get("artists") - .and_then(Value::as_array) - .map(|artists| join_artist_names(artists)) - .unwrap_or_default(); - - let score = score_track_match(song_title, song_artist, &cloud_title, &cloud_artist); - if score > best_score { - best_score = score; - best_song_id = extract_song_id(song); - } - } - - if best_score < MATCH_THRESHOLD { - return Err(format!("未找到足够匹配的网易云歌曲,最高匹配度为 {:.0}%", best_score * 100.0)); - } - - best_song_id.ok_or_else(|| "网易云搜索结果缺少歌曲 ID".to_string()) - } - - fn post_eapi(&self, url: &str, api_path: &str, mut payload: Map) -> Result { - let header_payload = build_eapi_header(); - payload.insert( - "header".to_string(), - Value::String( - serde_json::to_string(&header_payload).map_err(|error| error.to_string())?, - ), - ); - - let payload_text = serde_json::to_string(&payload).map_err(|error| error.to_string())?; - let encrypted = encrypt_eapi_payload(api_path, &payload_text)?; - let cookie = header_payload - .iter() - .map(|(key, value)| format!("{key}={value}")) - .collect::>() - .join("; "); - - let response_text = self - .http_client - .post(url) - .header(USER_AGENT, NETEASE_USER_AGENT) - .header(REFERER, "https://music.163.com/") - .header(COOKIE, cookie) - .form(&[("params", encrypted)]) - .send() - .and_then(|response| response.error_for_status()) - .map_err(|error| error.to_string())? - .text() - .map_err(|error| error.to_string())?; - - serde_json::from_str(&response_text).map_err(|error| error.to_string()) - } - } - - - - /// 解析进度字符串,如 "01:23 / 04:56" - fn parse_progress_text(text: &str) -> Option<(i32, i32)> { - let cleaned = text.replace(" ", ""); - let parts: Vec<&str> = if cleaned.contains('/') { - cleaned.split('/').collect() - } else { - cleaned.split('|').collect() - }; - - if parts.len() != 2 { - return None; - } - - let current = parse_time_string(parts[0])?; - let total = parse_time_string(parts[1])?; - - if total <= 0 || current < 0 || current > total + 2 { - return None; - } - - Some((current, total)) - } - - fn parse_time_string(time_str: &str) -> Option { - let parts: Vec<&str> = time_str.split(':').collect(); - if parts.len() != 2 { - return None; - } - - let minutes = parts[0].parse::().ok()?; - let seconds = parts[1].parse::().ok()?; - - if minutes < 0 || seconds < 0 || seconds >= 60 { - return None; - } - - Some(minutes * 60 + seconds) - } - - fn extract_position_ms(session: &GlobalSystemMediaTransportControlsSession) -> Option { - let timeline = session.GetTimelineProperties().ok()?; - let mut position_ticks = timeline.Position().ok()?.Duration.max(0); - let last_updated_ticks = timeline.LastUpdatedTime().ok()?.UniversalTime; - - let playback_status = session - .GetPlaybackInfo() - .ok() - .and_then(|info| info.PlaybackStatus().ok()); - - if playback_status == Some(GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing) { - let now_ticks = current_windows_ticks(); - if now_ticks > last_updated_ticks { - position_ticks += now_ticks - last_updated_ticks; - } - } - - Some((position_ticks / WINDOWS_TICK_PER_MILLISECOND).max(0)) - } - - fn current_windows_ticks() -> i64 { - chrono::Utc::now().timestamp_millis() * WINDOWS_TICK_PER_MILLISECOND + WINDOWS_EPOCH_OFFSET_TICKS - } - - fn build_track_key(song_title: Option<&str>, song_artist: Option<&str>) -> String { - match (song_title, song_artist) { - (Some(title), Some(artist)) if !artist.is_empty() => format!("{title} - {artist}"), - (Some(title), _) => title.to_string(), - (None, Some(artist)) => artist.to_string(), - (None, None) => String::new(), - } - } - - fn build_keyword(song_title: &str, song_artist: &str) -> String { - if song_artist.is_empty() { - song_title.to_string() - } else { - format!("{song_title} - {song_artist}") - } - } - - fn normalize_text(value: &str) -> Option { - let normalized = normalize_owned(value); - if normalized.is_empty() { - None - } else { - Some(normalized) - } - } - - fn normalize_owned(value: &str) -> String { - value.split_whitespace().collect::>().join(" ").trim().to_string() - } - - fn is_netease_session(session: &GlobalSystemMediaTransportControlsSession) -> bool { - let source = session - .SourceAppUserModelId() - .map(|value| value.to_string().to_lowercase()) - .unwrap_or_default(); - - source.contains("cloudmusic") - || source.contains("netease") - || source.contains("music.163") - || source.contains("163music") - } - - fn build_eapi_header() -> Map { - let now_ms = chrono::Utc::now().timestamp_millis(); - let mut rng = rand::thread_rng(); - let request_id = format!("{now_ms}_{:04}", rng.gen_range(0..1000)); - - map_from_pairs([ - ("__csrf", json!("")), - ("appver", json!("8.0.0")), - ("buildver", json!(now_ms / 1000)), - ("channel", json!("")), - ("deviceId", json!("")), - ("mobilename", json!("")), - ("resolution", json!("1920x1080")), - ("os", json!("android")), - ("osver", json!("")), - ("requestId", json!(request_id)), - ("versioncode", json!("140")), - ("MUSIC_U", json!("")), - ]) - } - - fn encrypt_eapi_payload(api_path: &str, payload_text: &str) -> Result { - let digest_source = format!("nobody{api_path}use{payload_text}md5forencrypt"); - let digest = hex::encode(md5_bytes(digest_source.as_bytes())); - let data = format!("{api_path}-36cd479b6b5-{payload_text}-36cd479b6b5-{digest}"); - let encrypted = aes_ecb_encrypt_pkcs7(data.as_bytes(), NETEASE_EAPI_KEY); - Ok(hex::encode_upper(encrypted)) - } - - fn md5_bytes(input: &[u8]) -> [u8; 16] { - let mut hasher = Md5::new(); - hasher.update(input); - hasher.finalize().into() - } - - fn aes_ecb_encrypt_pkcs7(input: &[u8], key: &[u8; 16]) -> Vec { - let cipher = Aes128::new(GenericArray::from_slice(key)); - let mut buffer = input.to_vec(); - let pad_len = 16 - (buffer.len() % 16); - buffer.extend(std::iter::repeat(pad_len as u8).take(pad_len)); - - for chunk in buffer.chunks_exact_mut(16) { - cipher.encrypt_block(GenericArray::from_mut_slice(chunk)); - } - - buffer - } - - fn join_artist_names(artists: &[Value]) -> String { - artists - .iter() - .filter_map(|artist| artist.get("name").and_then(Value::as_str)) - .map(normalize_owned) - .filter(|name| !name.is_empty()) - .collect::>() - .join(" / ") - } - - fn extract_song_id(song: &Value) -> Option { - if let Some(id) = song.get("id").and_then(Value::as_i64) { - return Some(id.to_string()); - } - - song.get("id") - .and_then(Value::as_str) - .map(|value| value.to_string()) - } - - fn score_track_match(local_title: &str, local_artist: &str, cloud_title: &str, cloud_artist: &str) -> f64 { - let local_title = normalize_compare_text(local_title); - let local_artist = normalize_compare_text(local_artist); - let cloud_title = normalize_compare_text(cloud_title); - let cloud_artist = normalize_compare_text(cloud_artist); - - let title_score = similarity_score(&extract_base_title(&local_title), &extract_base_title(&cloud_title)); - if title_score < 0.45 { - return title_score * 0.5; - } - - let artist_score = if local_artist.is_empty() || cloud_artist.is_empty() { - 0.6 - } else { - similarity_score(&local_artist, &cloud_artist) - }; - - title_score * 0.72 + artist_score * 0.28 - } - - fn normalize_compare_text(value: &str) -> String { - let lower = value.to_lowercase(); - let unified = lower - .replace('(', "(") - .replace(')', ")") - .replace('【', "(") - .replace('】', ")") - .replace('[', "(") - .replace(']', ")") - .replace('「', "(") - .replace('」', ")"); - - unified.split_whitespace().collect::>().join(" ") - } - - fn extract_base_title(value: &str) -> String { - let mut depth = 0u32; - let mut output = String::new(); - - for ch in value.chars() { - match ch { - '(' => depth += 1, - ')' => depth = depth.saturating_sub(1), - _ if depth == 0 => output.push(ch), - _ => {} - } - } - - output.split_whitespace().collect::>().join(" ").trim().to_string() - } - - fn similarity_score(left: &str, right: &str) -> f64 { - if left.is_empty() || right.is_empty() { - return 0.0; - } - if left == right { - return 1.0; - } - if left.contains(right) || right.contains(left) { - let short = left.len().min(right.len()) as f64; - let long = left.len().max(right.len()) as f64; - return 0.75 + (short / long) * 0.25; - } - - let distance = levenshtein(left, right) as f64; - let max_len = left.chars().count().max(right.chars().count()) as f64; - (1.0 - distance / max_len).max(0.0) - } - - fn levenshtein(left: &str, right: &str) -> usize { - let left_chars = left.chars().collect::>(); - let right_chars = right.chars().collect::>(); - let mut prev = (0..=right_chars.len()).collect::>(); - let mut curr = vec![0; right_chars.len() + 1]; - - for (i, left_char) in left_chars.iter().enumerate() { - curr[0] = i + 1; - for (j, right_char) in right_chars.iter().enumerate() { - let cost = usize::from(left_char != right_char); - curr[j + 1] = (prev[j + 1] + 1) - .min(curr[j] + 1) - .min(prev[j] + cost); - } - prev.clone_from(&curr); - } - - prev[right_chars.len()] - } - - fn parse_lrc(lrc: &str) -> Vec { - let tag_regex = Regex::new(r"\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?]").unwrap(); - let mut lines = Vec::new(); - - for raw_line in lrc.lines() { - let text = normalize_owned(tag_regex.replace_all(raw_line, "").trim()); - if text.is_empty() { - continue; - } - - for capture in tag_regex.captures_iter(raw_line) { - let minutes = capture - .get(1) - .and_then(|value| value.as_str().parse::().ok()) - .unwrap_or(0); - let seconds = capture - .get(2) - .and_then(|value| value.as_str().parse::().ok()) - .unwrap_or(0); - let fraction = capture.get(3).map(|value| value.as_str()).unwrap_or("0"); - let millis = parse_fraction_to_millis(fraction); - let time_ms = minutes * 60_000 + seconds * 1000 + millis; - lines.push(LyricLine { - time_ms, - text: text.clone(), - }); - } - } - - lines.sort_by_key(|line| line.time_ms); - lines.dedup_by(|left, right| left.time_ms == right.time_ms && left.text == right.text); - lines - } - - fn parse_fraction_to_millis(fraction: &str) -> i64 { - match fraction.len() { - 0 => 0, - 1 => fraction.parse::().unwrap_or(0) * 100, - 2 => fraction.parse::().unwrap_or(0) * 10, - _ => fraction[..3].parse::().unwrap_or(0), - } - } - - fn lyric_at_position(lines: &[LyricLine], position_ms: i64) -> Option { - if lines.is_empty() { - return None; - } - - let index = lines.partition_point(|line| line.time_ms <= position_ms); - if index == 0 { - return None; - } - - Some(lines[index - 1].text.clone()) - } - - fn map_from_pairs(pairs: [(&str, Value); N]) -> Map { - let mut map = Map::new(); - for (key, value) in pairs { - map.insert(key.to_string(), value); - } - map - } - - mod hex { - pub fn encode(bytes: [u8; 16]) -> String { - encode_lower(&bytes) - } - - pub fn encode_upper(bytes: Vec) -> String { - encode_upper_slice(&bytes) - } - - fn encode_lower(bytes: &[u8]) -> String { - let mut output = String::with_capacity(bytes.len() * 2); - for byte in bytes { - output.push_str(&format!("{byte:02x}")); - } - output - } - - fn encode_upper_slice(bytes: &[u8]) -> String { - let mut output = String::with_capacity(bytes.len() * 2); - for byte in bytes { - output.push_str(&format!("{byte:02X}")); - } - output - } - } -} - -#[cfg(target_os = "windows")] -pub use imp::collect_snapshot; diff --git a/参考/NexBox-main/src-tauri/src/netease_lyrics.rs.bak b/参考/NexBox-main/src-tauri/src/netease_lyrics.rs.bak deleted file mode 100644 index 06f87e7..0000000 Binary files a/参考/NexBox-main/src-tauri/src/netease_lyrics.rs.bak and /dev/null differ diff --git a/参考/NexBox-main/src-tauri/src/network_optimize.rs b/参考/NexBox-main/src-tauri/src/network_optimize.rs deleted file mode 100644 index 711ddd7..0000000 --- a/参考/NexBox-main/src-tauri/src/network_optimize.rs +++ /dev/null @@ -1,403 +0,0 @@ -use std::collections::HashMap; -use std::os::windows::process::CommandExt; -use std::process::Command; -use std::{env, path::Path}; -use crate::optimization::{run_simple_feature, PerfTweakResult, CREATE_NO_WINDOW}; - -fn get_powershell_path() -> String { - if let Ok(sysroot) = env::var("SystemRoot") { - let ps_path = format!(r"{}\System32\WindowsPowerShell\v1.0\powershell.exe", sysroot); - if Path::new(&ps_path).exists() { - return ps_path; - } - } - "powershell.exe".to_string() -} - -// === 1. TCP 拥塞控制优化 === - -#[tauri::command] -pub async fn set_tcp_congestion() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' -$current = netsh int tcp show supplemental 2>&1 | Select-String "拥塞控制提供程序|Congestion Control Provider" -$hasCtcp = $current -match "CTCP|CUBIC" -if (-not $hasCtcp) { - $output = netsh int tcp set supplemental Internet congestionprovider=ctcp 2>&1 - if ($LASTEXITCODE -ne 0) { - Write-Error "TCP 拥塞控制设置失败: $output" - exit 1 - } -} -Write-Output 'OK' -"#) -} - -#[tauri::command] -pub async fn restore_tcp_congestion() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' -$output = netsh int tcp set supplemental Internet congestionprovider=newreno 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP 拥塞控制恢复失败: $output" - exit 1 -} -Write-Output 'OK' -"#) -} - -// === 2. TCP Chimney Offload === - -#[tauri::command] -pub async fn set_tcp_chimney_off() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' -$output = netsh int tcp set global chimney=disabled 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP Chimney Offload 设置失败: $output" - exit 1 -} -Write-Output 'OK' -"#) -} - -#[tauri::command] -pub async fn restore_tcp_chimney() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' -$output = netsh int tcp set global chimney=enabled 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP Chimney Offload 恢复失败: $output" - exit 1 -} -Write-Output 'OK' -"#) -} - -// === 3. Nagle 算法低延迟策略 === - -#[tauri::command] -pub async fn set_nagle_optimization() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -$interfaces = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" -foreach ($iface in $interfaces) { - $guid = $iface.PSChildName - $path = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\$guid" - $ipEnabled = (Get-ItemProperty -Path $path -Name "IPAddress" -ErrorAction SilentlyContinue).IPAddress - if ($ipEnabled) { - Set-ItemProperty -Path $path -Name "TCPNoDelay" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path $path -Name "TcpAckFrequency" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path $path -Name "TcpDelAckTicks" -Value 0 -Type DWord -Force -ErrorAction SilentlyContinue - } -} -Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "TcpAckFrequency" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue -Write-Output 'OK' -"#) -} - -#[tauri::command] -pub async fn restore_nagle_optimization() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -$interfaces = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" -foreach ($iface in $interfaces) { - $guid = $iface.PSChildName - $path = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\$guid" - $ipEnabled = (Get-ItemProperty -Path $path -Name "IPAddress" -ErrorAction SilentlyContinue).IPAddress - if ($ipEnabled) { - Remove-ItemProperty -Path $path -Name "TCPNoDelay" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path $path -Name "TcpAckFrequency" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path $path -Name "TcpDelAckTicks" -ErrorAction SilentlyContinue - } -} -Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "TcpAckFrequency" -ErrorAction SilentlyContinue -Write-Output 'OK' -"#) -} - -// === 4. 禁用网卡省电模式 === - -#[tauri::command] -pub async fn set_adapter_power_saving_off() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue -foreach ($adapter in $adapters) { - Disable-NetAdapterPowerManagement -Name $adapter.Name -ErrorAction SilentlyContinue | Out-Null -} -Write-Output 'OK' -"#) -} - -#[tauri::command] -pub async fn restore_adapter_power_saving() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue -foreach ($adapter in $adapters) { - Enable-NetAdapterPowerManagement -Name $adapter.Name -ErrorAction SilentlyContinue | Out-Null -} -Write-Output 'OK' -"#) -} - -// === 5. DNS 优化 === - -#[tauri::command] -pub async fn set_dns_servers(dns_primary: String, dns_secondary: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let script = format!( - r#" -$ErrorActionPreference = 'SilentlyContinue' -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue | Where-Object {{ $_.Status -eq "Up" }} -foreach ($adapter in $adapters) {{ - Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses ("{0}", "{1}") -ErrorAction SilentlyContinue | Out-Null -}} -Write-Output 'OK' -"#, - dns_primary, dns_secondary - ); - - let ps_path = get_powershell_path(); - let result = Command::new(&ps_path) - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行命令失败: {}", e))?; - - if result.status.success() { - Ok(PerfTweakResult { success: true, message: format!("DNS 已切换到 {} / {}", dns_primary, dns_secondary) }) - } else { - let stderr = String::from_utf8_lossy(&result.stderr).to_string(); - let stdout = String::from_utf8_lossy(&result.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else { stdout.trim().to_string() }; - let lower = err_msg.to_lowercase(); - if lower.contains("access denied") || lower.contains("denied") || lower.contains("拒绝访问") || lower.contains("权限不足") { - Err("需要管理员权限,请以管理员身份运行 NexBox".to_string()) - } else { - Err(format!("DNS 设置失败: {}", err_msg)) - } - } -} - -#[tauri::command] -pub async fn restore_dns_servers() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue | Where-Object { $_.Status -eq "Up" } -foreach ($adapter in $adapters) { - Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ResetServerAddresses -ErrorAction SilentlyContinue | Out-Null -} -Write-Output 'OK' -"#) -} - -// === 6. 状态检测 === - -#[derive(serde::Serialize)] -pub struct NetworkTweakState { - pub tcp_congestion_optimized: bool, - pub chimney_offload: bool, - pub nagle_optimized: bool, - pub adapter_power_saving_off: bool, - pub dns_primary: String, - pub dns_secondary: String, -} - -#[tauri::command] -pub async fn check_network_tweak_states() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let script = r#" -$ErrorActionPreference = 'SilentlyContinue' -$r = @{} - -# TCP Congestion -try { - $supp = netsh int tcp show supplemental 2>$null | Out-String - $r['tcp_congestion'] = ($supp -match "CTCP" -or $supp -match "CUBIC") -} catch { $r['tcp_congestion'] = $false } - -# Chimney Offload -try { - $global = netsh int tcp show global 2>$null | Out-String - $r['chimney'] = ($global -match "Chimney Offload State.*disabled" -or $global -match "Chimney 卸载状态.*禁用") -} catch { $r['chimney'] = $false } - -# Nagle (check registry) -try { - $firstIface = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" -ErrorAction SilentlyContinue | - Where-Object { (Get-ItemProperty $_.PSPath -Name "IPAddress" -EA 0).IPAddress } | - Select-Object -First 1 - if ($firstIface) { - $tcpNoDelay = (Get-ItemProperty $firstIface.PSPath -Name "TCPNoDelay" -EA 0).TCPNoDelay - $r['nagle'] = ($tcpNoDelay -eq 1) - } else { - $r['nagle'] = $false - } -} catch { $r['nagle'] = $false } - -# Adapter Power Saving -try { - $powerMgmtDisabled = Get-NetAdapter -Physical -EA 0 | Where-Object { $_.PowerManagementEnabled -eq $false } - $r['powerSaving'] = ($powerMgmtDisabled.Count -gt 0) -} catch { $r['powerSaving'] = $false } - -# DNS -try { - $dnsAdapter = Get-DnsClientServerAddress -AddressFamily IPv4 -EA 0 | Where-Object { $_.ServerAddresses -ne $null } | Select-Object -First 1 - if ($dnsAdapter -and $dnsAdapter.ServerAddresses) { - $addrs = $dnsAdapter.ServerAddresses - $r['dns_primary'] = $addrs[0] - $r['dns_secondary'] = if ($addrs.Count -gt 1) { $addrs[1] } else { "" } - } else { - $r['dns_primary'] = "" - $r['dns_secondary'] = "" - } -} catch { - $r['dns_primary'] = "" - $r['dns_secondary'] = "" -} - -# 始终输出所有 key,确保前端能解析到 -@("tcp_congestion","chimney","nagle","powerSaving","dns_primary","dns_secondary") | ForEach-Object { - Write-Host "$($_):$($r[$_])" -} -"#; - - let ps_path = get_powershell_path(); - let result = Command::new(&ps_path) - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行检测命令失败: {}", e))?; - - if !result.status.success() { - return Err("检测状态失败".to_string()); - } - - let stdout = String::from_utf8_lossy(&result.stdout); - let mut state = HashMap::new(); - - for line in stdout.lines() { - if let Some(pos) = line.find(':') { - let key = line[..pos].trim().to_string(); - let value = line[pos + 1..].trim().to_string(); - state.insert(key, value); - } - } - - let tcp_congestion = state.get("tcp_congestion").map(|v| v == "True").unwrap_or(false); - let chimney = state.get("chimney").map(|v| v == "True").unwrap_or(false); - let nagle = state.get("nagle").map(|v| v == "True").unwrap_or(false); - let power_saving = state.get("powerSaving").map(|v| v == "True").unwrap_or(false); - let dns_primary = state.get("dns_primary").cloned().unwrap_or_default(); - let dns_secondary = state.get("dns_secondary").cloned().unwrap_or_default(); - - Ok(NetworkTweakState { - tcp_congestion_optimized: tcp_congestion, - chimney_offload: chimney, - nagle_optimized: nagle, - adapter_power_saving_off: power_saving, - dns_primary, - dns_secondary, - }) -} - -// === 7. 批量优化 / 恢复(单次 PowerShell 调用) === - -#[tauri::command] -pub async fn batch_network_enable() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' - -# TCP Congestion -$current = netsh int tcp show supplemental 2>&1 | Select-String "拥塞控制提供程序|Congestion Control Provider" -$hasCtcp = $current -match "CTCP|CUBIC" -if (-not $hasCtcp) { - $output = netsh int tcp set supplemental Internet congestionprovider=ctcp 2>&1 - if ($LASTEXITCODE -ne 0) { - Write-Error "TCP 拥塞控制设置失败: $output" - exit 1 - } -} - -# Chimney Offload -$output = netsh int tcp set global chimney=disabled 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP Chimney Offload 设置失败: $output" - exit 1 -} - -# Nagle Optimization -$interfaces = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" -foreach ($iface in $interfaces) { - $guid = $iface.PSChildName - $path = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\$guid" - $ipEnabled = (Get-ItemProperty -Path $path -Name "IPAddress" -ErrorAction SilentlyContinue).IPAddress - if ($ipEnabled) { - Set-ItemProperty -Path $path -Name "TCPNoDelay" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path $path -Name "TcpAckFrequency" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue - Set-ItemProperty -Path $path -Name "TcpDelAckTicks" -Value 0 -Type DWord -Force -ErrorAction SilentlyContinue - } -} -Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "TcpAckFrequency" -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue - -# Adapter Power Saving -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue -foreach ($adapter in $adapters) { - Disable-NetAdapterPowerManagement -Name $adapter.Name -ErrorAction SilentlyContinue | Out-Null -} - -Write-Output 'OK' -"#) -} - -#[tauri::command] -pub async fn batch_network_disable() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'Stop' - -# TCP Congestion - restore -$output = netsh int tcp set supplemental Internet congestionprovider=newreno 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP 拥塞控制恢复失败: $output" - exit 1 -} - -# Chimney Offload - restore -$output = netsh int tcp set global chimney=enabled 2>&1 -if ($LASTEXITCODE -ne 0) { - Write-Error "TCP Chimney Offload 恢复失败: $output" - exit 1 -} - -# Nagle - restore -$interfaces = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" -foreach ($iface in $interfaces) { - $guid = $iface.PSChildName - $path = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\$guid" - $ipEnabled = (Get-ItemProperty -Path $path -Name "IPAddress" -ErrorAction SilentlyContinue).IPAddress - if ($ipEnabled) { - Remove-ItemProperty -Path $path -Name "TCPNoDelay" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path $path -Name "TcpAckFrequency" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path $path -Name "TcpDelAckTicks" -ErrorAction SilentlyContinue - } -} -Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "TcpAckFrequency" -ErrorAction SilentlyContinue - -# Adapter Power Saving - restore -$adapters = Get-NetAdapter -Physical -ErrorAction SilentlyContinue -foreach ($adapter in $adapters) { - Enable-NetAdapterPowerManagement -Name $adapter.Name -ErrorAction SilentlyContinue | Out-Null -} - -Write-Output 'OK' -"#) -} diff --git a/参考/NexBox-main/src-tauri/src/nvapi.rs b/参考/NexBox-main/src-tauri/src/nvapi.rs deleted file mode 100644 index 118b6a7..0000000 --- a/参考/NexBox-main/src-tauri/src/nvapi.rs +++ /dev/null @@ -1,2389 +0,0 @@ -//! NVAPI backend for NVIDIA GPU driver settings (DRS API). -//! -//! Links against the official NVAPI SDK library and provides Tauri commands -//! to read/write global 3D settings (VSync, texture quality, AA, FPS limit, etc.). - -use serde::Serialize; -use std::sync::Mutex; -use libloading::Library; - -// --------------------------------------------------------------------------- -// NVAPI C type aliases -// --------------------------------------------------------------------------- -type NvU32 = u32; -type NvU16 = u16; - -#[allow(non_camel_case_types)] -type NvAPI_Status = i32; - -const NVAPI_OK: NvAPI_Status = 0; - -/// Opaque handle types (NV_DECLARE_HANDLE => opaque pointer) -type NvDRSSessionHandle = *mut std::ffi::c_void; -type NvDRSProfileHandle = *mut std::ffi::c_void; -type NvDisplayHandle = *mut std::ffi::c_void; - -const NVAPI_UNICODE_STRING_MAX: usize = 2048; -const NVAPI_SHORT_STRING_MAX: usize = 64; - -// --------------------------------------------------------------------------- -// NVIDIA DRS structures (replicated from nvapi.h) -// --------------------------------------------------------------------------- - -#[repr(C)] -struct NvdrsSettingV1 { - version: NvU32, - setting_name: [NvU16; NVAPI_UNICODE_STRING_MAX], - setting_id: NvU32, - setting_type: NvU32, - setting_location: NvU32, - is_current_predefined: NvU32, - is_predefined_valid: NvU32, - // Anonymous union: max(NvU32, NVDRS_BINARY_SETTING=4+4096, NvAPI_UnicodeString=4096) = 4100 - predefined_union: [u8; 4100], - // Anonymous union: same layout - current_union: [u8; 4100], -} - -impl NvdrsSettingV1 { - fn version_const() -> NvU32 { - (std::mem::size_of::() as NvU32) | (1u32 << 16) - } - - fn new() -> Self { - let mut s: Self = unsafe { std::mem::zeroed() }; - s.version = Self::version_const(); - s - } - - fn predefined_u32(&self) -> NvU32 { - unsafe { std::ptr::read_unaligned(self.predefined_union.as_ptr() as *const NvU32) } - } - - fn current_u32(&self) -> NvU32 { - unsafe { std::ptr::read_unaligned(self.current_union.as_ptr() as *const NvU32) } - } - - fn set_current_u32(&mut self, val: NvU32) { - unsafe { - std::ptr::write_unaligned(self.current_union.as_mut_ptr() as *mut NvU32, val); - } - } -} - -// Compile-time verification: sizeof(NVDRS_SETTING_V1) with pack(8) -// = 4 + 4096 + 4 + 4 + 4 + 4 + 4 + 4100 + 4100 = 12320 -const _: () = assert!(std::mem::size_of::() == 12320); - -#[repr(C)] -struct NvDisplayDriverVersion { - version: NvU32, - drv_version: NvU32, - bld_change_list_num: NvU32, - sz_build_branch_string: [u8; NVAPI_SHORT_STRING_MAX], - sz_adapter_string: [u8; NVAPI_SHORT_STRING_MAX], -} - -// Compile-time verification: sizeof(NV_DISPLAY_DRIVER_VERSION) -// = 4 + 4 + 4 + 64 + 64 = 140 -const _: () = assert!(std::mem::size_of::() == 140); - -// --------------------------------------------------------------------------- -// NVAPI DISP (Display Control) structures -// nvapi.h uses #pragma pack(push, 8) — #[repr(C)] on x64 matches this layout. -// Field names match the C SDK header names deliberately. -// --------------------------------------------------------------------------- - -#[allow(non_snake_case)] -#[repr(C)] -struct NvResolution { - width: NvU32, - height: NvU32, - colorDepth: NvU32, -} - -const _: () = assert!(std::mem::size_of::() == 12); - -#[repr(C)] -struct NvPosition { - x: NvU32, - y: NvU32, -} - -const _: () = assert!(std::mem::size_of::() == 8); - -#[allow(non_snake_case)] -#[repr(C)] -struct NvDisplayConfigSourceModeInfo { - resolution: NvResolution, // NV_RESOLUTION - colorFormat: NvU32, // NV_FORMAT (ignored, must be NV_FORMAT_UNKNOWN=0) - position: NvPosition, // NV_POSITION - spanningOrientation: NvU32, // NV_DISPLAYCONFIG_SPANNING_ORIENTATION (0=none) - flags: NvU32, // bGDIPrimary:1, bSLIFocus:1, reserved:30 -} - -// sizeof(NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1) = 12 + 4 + 8 + 4 + 4 = 32 -const _: () = assert!(std::mem::size_of::() == 32); - -#[allow(non_snake_case)] -#[repr(C)] -struct NvDisplayConfigPathTargetInfo { - displayId: NvU32, - details: *mut std::ffi::c_void, // NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* (NULL if not needed) - targetId: NvU32, // Windows CCD target ID (non-NVIDIA adapter only, 0 for NVIDIA) -} - -// sizeof(NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2) = 4 + pad4 + 8 + 4 = 24 (x64 pack 8) -const _: () = assert!(std::mem::size_of::() == 24); - -#[allow(non_snake_case)] -#[repr(C)] -struct NvDisplayConfigPathInfo { - version: NvU32, // MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2, 2) - sourceId: NvU32, // union { sourceId, reserved_sourceId } - targetInfoCount: NvU32, // number of elements in targetInfo array - targetInfo: *mut NvDisplayConfigPathTargetInfo, - sourceModeInfo: *mut NvDisplayConfigSourceModeInfo, // may be NULL - flags: NvU32, // IsNonNVIDIAAdapter:1, reserved:31 - pOSAdapterID: *mut std::ffi::c_void, // LUID pointer for non-NVIDIA adapter -} - -// sizeof(NV_DISPLAYCONFIG_PATH_INFO_V2) = 4+4+4+pad4+8+8+4+pad4+8 = 48 (x64 pack 8) -const _: () = assert!(std::mem::size_of::() == 48); - -/// Version constant for NV_DISPLAYCONFIG_PATH_INFO_V2 (MAKE_NVAPI_VERSION(type, 2)) -const NV_DISPLAYCONFIG_PATH_INFO_VER: NvU32 = - (std::mem::size_of::() as NvU32) | (2u32 << 16); - - - -/// Flags for NvAPI_DISP_SetDisplayConfig -#[allow(dead_code)] -const NV_DISPLAYCONFIG_VALIDATE_ONLY: NvU32 = 0x00000001; -const NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE: NvU32 = 0x00000002; -#[allow(dead_code)] -const NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED: NvU32 = 0x00000004; -#[allow(dead_code)] -const NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION: NvU32 = 0x00000008; -const NV_FORCE_COMMIT_VIDPN: NvU32 = 0x00000010; - -#[cfg(target_os = "windows")] -#[link(name = "nvapi64", kind = "static")] -extern "C" { - fn NvAPI_Initialize() -> NvAPI_Status; - fn NvAPI_Unload() -> NvAPI_Status; - fn NvAPI_GetErrorMessage(status: NvAPI_Status, desc: *mut u8) -> NvAPI_Status; - fn NvAPI_DRS_CreateSession(session: *mut NvDRSSessionHandle) -> NvAPI_Status; - fn NvAPI_DRS_DestroySession(session: NvDRSSessionHandle) -> NvAPI_Status; - fn NvAPI_DRS_LoadSettings(session: NvDRSSessionHandle) -> NvAPI_Status; - fn NvAPI_DRS_SaveSettings(session: NvDRSSessionHandle) -> NvAPI_Status; - fn NvAPI_DRS_GetCurrentGlobalProfile( - session: NvDRSSessionHandle, - profile: *mut NvDRSProfileHandle, - ) -> NvAPI_Status; - fn NvAPI_DRS_GetBaseProfile( - session: NvDRSSessionHandle, - profile: *mut NvDRSProfileHandle, - ) -> NvAPI_Status; - fn NvAPI_DRS_GetSetting( - session: NvDRSSessionHandle, - profile: NvDRSProfileHandle, - setting_id: NvU32, - setting: *mut NvdrsSettingV1, - ) -> NvAPI_Status; - fn NvAPI_DRS_SetSetting( - session: NvDRSSessionHandle, - profile: NvDRSProfileHandle, - setting: *mut NvdrsSettingV1, - ) -> NvAPI_Status; - fn NvAPI_DRS_RestoreProfileDefault( - session: NvDRSSessionHandle, - profile: NvDRSProfileHandle, - ) -> NvAPI_Status; - fn NvAPI_EnumNvidiaDisplayHandle(index: NvU32, display: *mut NvDisplayHandle) -> NvAPI_Status; - fn NvAPI_GetDisplayDriverVersion( - display: NvDisplayHandle, - version: *mut NvDisplayDriverVersion, - ) -> NvAPI_Status; - - // ── DISP (Display Control) API ── - /// Retrieve current global display configuration. - /// Two-pass: first call with pathInfo=NULL to get pathInfoCount, - /// then allocate pathInfo array and call again. - fn NvAPI_DISP_GetDisplayConfig( - pathInfoCount: *mut NvU32, - pathInfo: *mut NvDisplayConfigPathInfo, - ) -> NvAPI_Status; - - /// Apply a new global display configuration (resolution, position, etc.). - fn NvAPI_DISP_SetDisplayConfig( - pathInfoCount: NvU32, - pathInfo: *const NvDisplayConfigPathInfo, - flags: NvU32, - ) -> NvAPI_Status; - - /// Get displayId from a display name string (ANSI). - #[allow(dead_code)] - fn NvAPI_DISP_GetDisplayIdByDisplayName( - displayName: *const u8, - displayId: *mut NvU32, - ) -> NvAPI_Status; - - /// Get the output ID from a display handle. - #[allow(dead_code)] - fn NvAPI_GetAssociatedDisplayOutputId( - hDisplay: NvDisplayHandle, - pOutputId: *mut NvU32, - ) -> NvAPI_Status; -} - -// --------------------------------------------------------------------------- -// Global state — Library kept alive, function pointers cached -// --------------------------------------------------------------------------- -struct NvapiState { - session: NvDRSSessionHandle, -} - -unsafe impl Send for NvapiState {} -unsafe impl Sync for NvapiState {} - -static NVAPI: Mutex> = Mutex::new(None); - -// --------------------------------------------------------------------------- -// Helpers -// --------------------------------------------------------------------------- - -fn utf16_to_string(data: &[u16]) -> String { - let end = data.iter().position(|&c| c == 0).unwrap_or(data.len()); - String::from_utf16_lossy(&data[..end]) -} - -fn cstr_to_string(data: &[u8]) -> String { - let end = data.iter().position(|&c| c == 0).unwrap_or(data.len()); - String::from_utf8_lossy(&data[..end]).to_string() -} - -fn nvapi_error_string(status: NvAPI_Status) -> String { - let mut buf: [u8; NVAPI_SHORT_STRING_MAX] = [0u8; NVAPI_SHORT_STRING_MAX]; - unsafe { - NvAPI_GetErrorMessage(status, buf.as_mut_ptr()); - } - cstr_to_string(&buf) -} - -fn nvapi_system_dir() -> String { - std::env::var("SystemRoot").unwrap_or_else(|_| "C:\\Windows".into()) -} - -// --------------------------------------------------------------------------- -// DLL loading & session init (using libloading) -// --------------------------------------------------------------------------- - -/// Find all nvapi64.dll candidates across the system, sorted by filesize (largest first). -/// The real NVIDIA nvapi64.dll is 2-4+ MB; stubs are <1 MB. -fn find_nvapi64_candidates() -> Vec<(String, u64)> { - let mut files: Vec<(String, u64)> = Vec::new(); - - // Helper: add file if it exists - let mut add_file = |path: &str| { - if let Ok(meta) = std::fs::metadata(path) { - if meta.is_file() && meta.len() > 0 { - files.push((path.to_string(), meta.len())); - } - } - }; - - let sys_dir = nvapi_system_dir(); - let is_64bit = std::mem::size_of::() == 8; - - // Primary: System32 - add_file(&format!("{sys_dir}\\System32\\nvapi64.dll")); - // Sysnative (bypasses WOW64 redirection for 32-bit processes) - if !is_64bit { - add_file(&format!("{sys_dir}\\Sysnative\\nvapi64.dll")); - } - - // Common NVIDIA program dirs - let prog_files = std::env::var("ProgramFiles").unwrap_or_else(|_| "C:\\Program Files".into()); - let nv_dir = format!("{prog_files}\\NVIDIA Corporation"); - let common_subdirs = ["NvStreamSrv", "Nvapi64", "Display.NvContainer", "FrameViewSDK"]; - for sub in &common_subdirs { - add_file(&format!("{nv_dir}\\{sub}\\nvapi64.dll")); - } - - // Scan NVIDIA Corporation dir one level deep - if let Ok(entries) = std::fs::read_dir(&nv_dir) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - let candidate = p.join("nvapi64.dll"); - if let Some(s) = candidate.to_str() { - add_file(s); - } - } - } - } - - // Search DriverStore for nvapi64.dll - let driver_store = format!("{sys_dir}\\System32\\DriverStore\\FileRepository"); - if let Ok(entries) = std::fs::read_dir(&driver_store) { - for entry in entries.flatten() { - let name = entry.file_name(); - let name_str = name.to_string_lossy(); - // NVIDIA driver packages: nv_disp*, nv_dispi*, etc. - if name_str.starts_with("nv_") || name_str.starts_with("nvd") || name_str.starts_with("nvdisps") { - let candidate = entry.path().join("nvapi64.dll"); - if let Some(s) = candidate.to_str() { - add_file(s); - } - } - } - } - - // Sort by file size descending (biggest = most likely real NVIDIA DLL) - files.sort_by(|a, b| b.1.cmp(&a.1)); - files -} - -fn try_init_nvapi() -> Result<(), String> { - let mut guard = NVAPI.lock().map_err(|e| format!("Lock error: {e}"))?; - if guard.is_some() { - return Ok(()); - } - - let init_status = unsafe { NvAPI_Initialize() }; - if init_status != NVAPI_OK { - return Err(format!( - "NvAPI_Initialize 失败: {} (代码 {init_status})", - nvapi_error_string(init_status) - )); - } - - let mut session: NvDRSSessionHandle = std::ptr::null_mut(); - let create_status = unsafe { NvAPI_DRS_CreateSession(&mut session) }; - if create_status != NVAPI_OK { - unsafe { - let _ = NvAPI_Unload(); - } - return Err(format!( - "NvAPI_DRS_CreateSession 失败: {} (代码 {create_status})", - nvapi_error_string(create_status) - )); - } - - let load_status = unsafe { NvAPI_DRS_LoadSettings(session) }; - if load_status != NVAPI_OK { - unsafe { - let _ = NvAPI_DRS_DestroySession(session); - let _ = NvAPI_Unload(); - } - return Err(format!( - "NvAPI_DRS_LoadSettings 失败: {} (代码 {load_status})", - nvapi_error_string(load_status) - )); - } - - let candidates = find_nvapi64_candidates(); - if let Some((path, size)) = candidates.first() { - log::info!("NVAPI initialized via SDK library; detected runtime candidate: {path} ({size} bytes)"); - } else { - log::info!("NVAPI initialized via SDK library"); - } - *guard = Some(NvapiState { session }); - Ok(()) -} - -fn with_state Result>(f: F) -> Result { - let guard = NVAPI.lock().map_err(|e| format!("Lock error: {e}"))?; - match guard.as_ref() { - Some(state) => f(state), - None => Err("NVAPI 未初始化".into()), - } -} - -fn get_global_profile(state: &NvapiState) -> Result { - let mut profile: NvDRSProfileHandle = std::ptr::null_mut(); - let current_status = unsafe { NvAPI_DRS_GetCurrentGlobalProfile(state.session, &mut profile) }; - if current_status == NVAPI_OK { - return Ok(profile); - } - - let base_status = unsafe { NvAPI_DRS_GetBaseProfile(state.session, &mut profile) }; - if base_status == NVAPI_OK { - return Ok(profile); - } - - Err(format!( - "获取全局配置文件失败: 当前全局配置={} (代码 {current_status}),基础配置={} (代码 {base_status})", - nvapi_error_string(current_status), - nvapi_error_string(base_status) - )) -} - -// --------------------------------------------------------------------------- -// Setting options — hardcoded from NvApiDriverSettings.h -// --------------------------------------------------------------------------- - -#[derive(Clone, Serialize)] -pub struct SettingOption { - pub value: NvU32, - pub label: String, -} - -#[derive(Clone, Serialize)] -pub struct NvidiaSetting { - pub id: NvU32, - pub name: String, - pub description: String, - pub current_value: NvU32, - pub default_value: NvU32, - pub options: Vec, -} - -// === 同步与显示 === -const SETTING_VSYNCMODE: NvU32 = 0x00A879CF; -const SETTING_FRL_FPS: NvU32 = 0x10835002; -const SETTING_VRR_APP_OVERRIDE: NvU32 = 0x10A879CF; -const SETTING_VRR_MODE: NvU32 = 0x1194F158; -const SETTING_REFRESH_RATE_OVERRIDE: NvU32 = 0x0064B541; -const SETTING_VSYNCTEARCONTROL: NvU32 = 0x005A375C; -const SETTING_OGL_TRIPLE_BUFFER: NvU32 = 0x20FDD1F9; - -// === 画质与纹理 === -const SETTING_QUALITY_ENHANCEMENTS: NvU32 = 0x00CE2691; -const SETTING_ANISO_MODE_LEVEL: NvU32 = 0x101E61A9; -const SETTING_AA_MODE_METHOD: NvU32 = 0x10D773D2; -const SETTING_FXAA_ENABLE: NvU32 = 0x1074C972; -const SETTING_AO_MODE: NvU32 = 0x00667329; -const SETTING_MAXWELL_B_SAMPLE_INTERLEAVE: NvU32 = 0x0098C1AC; -const SETTING_PS_SHADERDISKCACHE: NvU32 = 0x00198FFF; -const SETTING_AA_MODE_SELECTOR: NvU32 = 0x107EFC5B; -const SETTING_AA_MODE_ALPHATOCOVERAGE: NvU32 = 0x10FC2D9C; -const SETTING_PS_TEXFILTER_ANISO_OPTS2: NvU32 = 0x00E73211; -const SETTING_PS_TEXFILTER_NO_NEG_LODBIAS: NvU32 = 0x0019BB68; -const SETTING_AUTO_LODBIASADJUST: NvU32 = 0x00638E8F; -const SETTING_PS_TEXFILTER_BILINEAR_IN_ANISO: NvU32 = 0x0084CD70; -const SETTING_PS_TEXFILTER_DISABLE_TRILIN_SLOPE: NvU32 = 0x002ECAF2; - -// === 电源与性能 === -const SETTING_PREFERRED_PSTATE: NvU32 = 0x1057EB71; -const SETTING_PRERENDERLIMIT: NvU32 = 0x007BA09E; -const SETTING_OGL_THREAD_CONTROL: NvU32 = 0x20C1221E; -const SETTING_VRPRERENDERLIMIT: NvU32 = 0x10111133; -const SETTING_BATTERY_BOOST_APP_FPS: NvU32 = 0x10115C8C; - -// === 同步与显示 (追加) === -const SETTING_VSYNC_BEHAVIOR_FLAGS: NvU32 = 0x10FDEC23; -const SETTING_VSYNCVRRCONTROL: NvU32 = 0x10A879CE; - -// === 画质与纹理 (追加) === -const SETTING_AA_BEHAVIOR_FLAGS: NvU32 = 0x10ECDB82; -const SETTING_AA_MODE_REPLAY: NvU32 = 0x10D48A85; -const SETTING_ANISO_MODE_SELECTOR: NvU32 = 0x10D2BB16; -const SETTING_PREVENT_UI_AF_OVERRIDE: NvU32 = 0x103BCCB5; - -// === 指示器与覆盖 === -const SETTING_VRRFEATUREINDICATOR: NvU32 = 0x1094F157; -const SETTING_VRROVERLAYINDICATOR: NvU32 = 0x1095F16F; -const SETTING_VRRREQUESTSTATE: NvU32 = 0x1094F1F7; -const SETTING_FXAA_INDICATOR_ENABLE: NvU32 = 0x1068FB9C; -const SETTING_PHYSXINDICATOR: NvU32 = 0x1094F16F; -const SETTING_EXPORT_PERF_COUNTERS: NvU32 = 0x108F0841; - -// === 电源与性能 (追加) === -const SETTING_EXTERNAL_QUIET_MODE: NvU32 = 0x10115C8D; - -// === 新增常用设置 === -const SETTING_FXAA_ALLOW: NvU32 = 0x1034CB89; -const SETTING_QUALITY_ENHANCEMENT_SUBSTITUTION: NvU32 = 0x00CE2692; -const SETTING_AO_MODE_ACTIVE: NvU32 = 0x00664339; -const SETTING_VSYNCSMOOTHAFR: NvU32 = 0x101AE763; -const SETTING_LATENCY_INDICATOR_AUTOALIGN: NvU32 = 0x1095F170; -const SETTING_PS_SHADERDISKCACHE_MAX_SIZE: NvU32 = 0x00AC8497; - -const TARGET_SETTINGS: &[NvU32] = &[ - // 同步与显示 - SETTING_VSYNCMODE, - SETTING_FRL_FPS, - SETTING_VRR_APP_OVERRIDE, - SETTING_VRR_MODE, - SETTING_REFRESH_RATE_OVERRIDE, - SETTING_VSYNCTEARCONTROL, - SETTING_OGL_TRIPLE_BUFFER, - // 画质与纹理 - SETTING_QUALITY_ENHANCEMENTS, - SETTING_ANISO_MODE_LEVEL, - SETTING_AA_MODE_METHOD, - SETTING_FXAA_ENABLE, - SETTING_AO_MODE, - SETTING_MAXWELL_B_SAMPLE_INTERLEAVE, - SETTING_PS_SHADERDISKCACHE, - SETTING_AA_MODE_SELECTOR, - SETTING_AA_MODE_ALPHATOCOVERAGE, - SETTING_PS_TEXFILTER_ANISO_OPTS2, - SETTING_PS_TEXFILTER_NO_NEG_LODBIAS, - SETTING_AUTO_LODBIASADJUST, - SETTING_PS_TEXFILTER_BILINEAR_IN_ANISO, - SETTING_PS_TEXFILTER_DISABLE_TRILIN_SLOPE, - // 电源与性能 - SETTING_PREFERRED_PSTATE, - SETTING_PRERENDERLIMIT, - SETTING_OGL_THREAD_CONTROL, - SETTING_VRPRERENDERLIMIT, - SETTING_BATTERY_BOOST_APP_FPS, - SETTING_EXTERNAL_QUIET_MODE, - // 同步与显示 (追加) - SETTING_VSYNC_BEHAVIOR_FLAGS, - SETTING_VSYNCVRRCONTROL, - // 画质与纹理 (追加) - SETTING_AA_BEHAVIOR_FLAGS, - SETTING_AA_MODE_REPLAY, - SETTING_ANISO_MODE_SELECTOR, - SETTING_PREVENT_UI_AF_OVERRIDE, - // 指示器与覆盖 - SETTING_VRRFEATUREINDICATOR, - SETTING_VRROVERLAYINDICATOR, - SETTING_VRRREQUESTSTATE, - SETTING_FXAA_INDICATOR_ENABLE, - SETTING_PHYSXINDICATOR, - SETTING_EXPORT_PERF_COUNTERS, - // 新增常用 - SETTING_FXAA_ALLOW, - SETTING_QUALITY_ENHANCEMENT_SUBSTITUTION, - SETTING_AO_MODE_ACTIVE, - SETTING_VSYNCSMOOTHAFR, - SETTING_LATENCY_INDICATOR_AUTOALIGN, - SETTING_PS_SHADERDISKCACHE_MAX_SIZE, -]; - -type OptsEntry = (NvU32, &'static str, Vec); - -fn settings_options() -> &'static [OptsEntry] { - use std::sync::OnceLock; - static OPTS: OnceLock> = OnceLock::new(); - OPTS.get_or_init(|| { - vec![ - ( - SETTING_VSYNCMODE, - "垂直同步", - vec![ - SettingOption { value: 0x60925292, label: "使用 3D 应用程序设置".into() }, - SettingOption { value: 0x08416747, label: "关".into() }, - SettingOption { value: 0x47814940, label: "开".into() }, - SettingOption { value: 0x32610244, label: "半刷新率".into() }, - SettingOption { value: 0x71271021, label: "1/3 刷新率".into() }, - SettingOption { value: 0x13245256, label: "1/4 刷新率".into() }, - ], - ), - ( - SETTING_QUALITY_ENHANCEMENTS, - "纹理过滤 - 质量", - vec![ - SettingOption { value: 0xFFFFFFF6, label: "高质量".into() }, - SettingOption { value: 0x00000000, label: "质量".into() }, - SettingOption { value: 0x0000000A, label: "性能".into() }, - SettingOption { value: 0x00000014, label: "高性能".into() }, - ], - ), - ( - SETTING_ANISO_MODE_LEVEL, - "各向异性过滤", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "应用程序控制".into() }, - SettingOption { value: 0x00000002, label: "2x".into() }, - SettingOption { value: 0x00000004, label: "4x".into() }, - SettingOption { value: 0x00000008, label: "8x".into() }, - SettingOption { value: 0x00000010, label: "16x".into() }, - ], - ), - ( - SETTING_AA_MODE_METHOD, - "抗锯齿 - 模式", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "2x (超级采样)".into() }, - SettingOption { value: 0x0000000E, label: "2x (多重采样)".into() }, - SettingOption { value: 0x00000010, label: "4x (多重采样)".into() }, - SettingOption { value: 0x00000012, label: "4x (多重采样 高斯)".into() }, - SettingOption { value: 0x0000001B, label: "4x (多重采样 Gamma)".into() }, - SettingOption { value: 0x00000025, label: "8x (多重采样)".into() }, - SettingOption { value: 0x00000020, label: "2x (SSGSSAA)".into() }, - SettingOption { value: 0x00000022, label: "4x (SSGSSAA)".into() }, - ], - ), - ( - SETTING_FRL_FPS, - "最大帧速率", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 30, label: "30 FPS".into() }, - SettingOption { value: 60, label: "60 FPS".into() }, - SettingOption { value: 120, label: "120 FPS".into() }, - SettingOption { value: 144, label: "144 FPS".into() }, - SettingOption { value: 165, label: "165 FPS".into() }, - SettingOption { value: 240, label: "240 FPS".into() }, - ], - ), - ( - SETTING_PREFERRED_PSTATE, - "电源管理模式", - vec![ - SettingOption { value: 0x00000000, label: "自适应".into() }, - SettingOption { value: 0x00000001, label: "最高性能优先".into() }, - SettingOption { value: 0x00000002, label: "由驱动程序控制".into() }, - SettingOption { value: 0x00000003, label: "一致性能".into() }, - SettingOption { value: 0x00000004, label: "最低功耗".into() }, - SettingOption { value: 0x00000005, label: "最佳功率".into() }, - ], - ), - ( - SETTING_FXAA_ENABLE, - "FXAA 快速近似抗锯齿", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - // ---- 同步与显示 ---- - ( - SETTING_VRR_APP_OVERRIDE, - "G-Sync", - vec![ - SettingOption { value: 0, label: "允许".into() }, - SettingOption { value: 1, label: "强制关闭".into() }, - SettingOption { value: 2, label: "禁止".into() }, - SettingOption { value: 3, label: "ULMB".into() }, - SettingOption { value: 4, label: "固定刷新".into() }, - ], - ), - ( - SETTING_VRR_MODE, - "G-Sync 全局启用", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "仅全屏".into() }, - SettingOption { value: 2, label: "全屏和窗口".into() }, - ], - ), - ( - SETTING_REFRESH_RATE_OVERRIDE, - "首选刷新率", - vec![ - SettingOption { value: 0, label: "应用程序控制".into() }, - SettingOption { value: 1, label: "最高可用".into() }, - ], - ), - ( - SETTING_VSYNCTEARCONTROL, - "垂直同步撕裂控制", - vec![ - SettingOption { value: 0x96861077, label: "禁用".into() }, - SettingOption { value: 0x99941284, label: "启用".into() }, - ], - ), - ( - SETTING_OGL_TRIPLE_BUFFER, - "OpenGL 三重缓冲", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - // ---- 画质与纹理 ---- - ( - SETTING_AO_MODE, - "环境光遮蔽", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "低".into() }, - SettingOption { value: 2, label: "中".into() }, - SettingOption { value: 3, label: "高".into() }, - ], - ), - ( - SETTING_MAXWELL_B_SAMPLE_INTERLEAVE, - "MFAA 多帧采样", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_PS_SHADERDISKCACHE, - "着色器缓存", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_AA_MODE_SELECTOR, - "抗锯齿 - 模式选择", - vec![ - SettingOption { value: 0, label: "应用程序控制".into() }, - SettingOption { value: 1, label: "覆盖应用设置".into() }, - SettingOption { value: 2, label: "增强应用设置".into() }, - ], - ), - ( - SETTING_AA_MODE_ALPHATOCOVERAGE, - "抗锯齿 - 透明度多重采样", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 4, label: "开启".into() }, - ], - ), - ( - SETTING_PS_TEXFILTER_ANISO_OPTS2, - "纹理过滤 - 各向异性采样优化", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_PS_TEXFILTER_NO_NEG_LODBIAS, - "纹理过滤 - 负 LOD 偏移", - vec![ - SettingOption { value: 0, label: "允许".into() }, - SettingOption { value: 1, label: "拒绝".into() }, - ], - ), - ( - SETTING_AUTO_LODBIASADJUST, - "纹理过滤 - 驱动控制 LOD 偏移", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_PS_TEXFILTER_BILINEAR_IN_ANISO, - "纹理过滤 - 各向异性过滤优化", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_PS_TEXFILTER_DISABLE_TRILIN_SLOPE, - "纹理过滤 - 三线性优化", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - // ---- 电源与性能 ---- - ( - SETTING_PRERENDERLIMIT, - "最大预渲染帧数", - vec![ - SettingOption { value: 0, label: "应用程序控制".into() }, - SettingOption { value: 1, label: "1".into() }, - SettingOption { value: 2, label: "2".into() }, - SettingOption { value: 3, label: "3".into() }, - SettingOption { value: 4, label: "4".into() }, - ], - ), - ( - SETTING_OGL_THREAD_CONTROL, - "OpenGL 线程优化", - vec![ - SettingOption { value: 0, label: "自动".into() }, - SettingOption { value: 1, label: "启用".into() }, - SettingOption { value: 2, label: "禁用".into() }, - ], - ), - ( - SETTING_VRPRERENDERLIMIT, - "VR 预渲染帧数", - vec![ - SettingOption { value: 0, label: "应用程序控制".into() }, - SettingOption { value: 1, label: "1".into() }, - ], - ), - ( - SETTING_BATTERY_BOOST_APP_FPS, - "电池加速帧率限制", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 30, label: "30 FPS".into() }, - SettingOption { value: 60, label: "60 FPS".into() }, - ], - ), - // ---- 同步与显示 (追加) ---- - ( - SETTING_VSYNC_BEHAVIOR_FLAGS, - "垂直同步 - 行为标志", - vec![ - SettingOption { value: 0x00000000, label: "默认".into() }, - SettingOption { value: 0x00000001, label: "忽略交换间隔倍数".into() }, - ], - ), - ( - SETTING_VSYNCVRRCONTROL, - "可变刷新率 (VRR)", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "开启".into() }, - SettingOption { value: 0x9f95128e, label: "不支持".into() }, - ], - ), - // ---- 画质与纹理 (追加) ---- - ( - SETTING_AA_BEHAVIOR_FLAGS, - "抗锯齿 - 行为标志", - vec![ - SettingOption { value: 0x00000000, label: "无".into() }, - SettingOption { value: 0x00000001, label: "覆盖视为应用控制".into() }, - SettingOption { value: 0x00000002, label: "覆盖视为增强".into() }, - SettingOption { value: 0x00000003, label: "禁用覆盖".into() }, - SettingOption { value: 0x00000004, label: "增强视为应用控制".into() }, - SettingOption { value: 0x00000008, label: "增强视为覆盖".into() }, - SettingOption { value: 0x0000000c, label: "禁用增强".into() }, - ], - ), - ( - SETTING_AA_MODE_REPLAY, - "抗锯齿 - 透明度超级采样", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000010, label: "2x 采样".into() }, - SettingOption { value: 0x00000020, label: "4x 采样".into() }, - SettingOption { value: 0x00000030, label: "8x 采样".into() }, - ], - ), - ( - SETTING_ANISO_MODE_SELECTOR, - "各向异性过滤模式", - vec![ - SettingOption { value: 0x00000000, label: "应用程序控制".into() }, - SettingOption { value: 0x00000001, label: "用户自定义".into() }, - SettingOption { value: 0x00000002, label: "条件".into() }, - ], - ), - ( - SETTING_PREVENT_UI_AF_OVERRIDE, - "禁止覆盖各向异性过滤", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - - // ---- 指示器与覆盖 ---- - ( - SETTING_VRRFEATUREINDICATOR, - "G-Sync 功能指示器", - vec![ - SettingOption { value: 0x0, label: "关闭".into() }, - SettingOption { value: 0x1, label: "开启".into() }, - ], - ), - ( - SETTING_VRROVERLAYINDICATOR, - "G-Sync 叠加指示器", - vec![ - SettingOption { value: 0x0, label: "关闭".into() }, - SettingOption { value: 0x1, label: "开启".into() }, - ], - ), - ( - SETTING_VRRREQUESTSTATE, - "G-Sync 请求状态", - vec![ - SettingOption { value: 0x0, label: "关闭".into() }, - SettingOption { value: 0x1, label: "仅全屏".into() }, - SettingOption { value: 0x2, label: "全屏和窗口".into() }, - ], - ), - ( - SETTING_FXAA_INDICATOR_ENABLE, - "FXAA 指示器", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_PHYSXINDICATOR, - "PhysX 指示器", - vec![ - SettingOption { value: 0x34534064, label: "关闭".into() }, - SettingOption { value: 0x24545582, label: "开启".into() }, - ], - ), - ( - SETTING_EXPORT_PERF_COUNTERS, - "性能计数器导出", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "开启".into() }, - ], - ), - ( - SETTING_EXTERNAL_QUIET_MODE, - "外部静音模式 (XQM)", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "开启".into() }, - ], - ), - // ---- 新增常用设置 ---- - ( - SETTING_FXAA_ALLOW, - "FXAA 允许", - vec![ - SettingOption { value: 0, label: "不允许".into() }, - SettingOption { value: 1, label: "允许".into() }, - ], - ), - ( - SETTING_QUALITY_ENHANCEMENT_SUBSTITUTION, - "纹理过滤 - 质量替换", - vec![ - SettingOption { value: 0x00000000, label: "无替换".into() }, - SettingOption { value: 0x00000001, label: "高质量→质量".into() }, - ], - ), - ( - SETTING_AO_MODE_ACTIVE, - "环境光遮蔽激活", - vec![ - SettingOption { value: 0, label: "关闭".into() }, - SettingOption { value: 1, label: "开启".into() }, - ], - ), - ( - SETTING_VSYNCSMOOTHAFR, - "平滑 AFR 行为", - vec![ - SettingOption { value: 0x00000000, label: "关闭".into() }, - SettingOption { value: 0x00000001, label: "开启".into() }, - ], - ), - ( - SETTING_LATENCY_INDICATOR_AUTOALIGN, - "Reflex 指示器自动对齐", - vec![ - SettingOption { value: 0x0, label: "关闭".into() }, - SettingOption { value: 0x1, label: "开启".into() }, - ], - ), - ( - SETTING_PS_SHADERDISKCACHE_MAX_SIZE, - "着色器缓存最大尺寸", - vec![ - SettingOption { value: 0x0, label: "无限制".into() }, - SettingOption { value: 0x1000, label: "4 GB (默认)".into() }, - SettingOption { value: 0x2000, label: "8 GB".into() }, - SettingOption { value: 0x4000, label: "16 GB".into() }, - SettingOption { value: 0x8000, label: "32 GB".into() }, - ], - ), - ] - }) -} - -// --------------------------------------------------------------------------- -// Tauri commands -// --------------------------------------------------------------------------- - -#[derive(Serialize)] -pub struct NvapiStatus { - pub available: bool, - pub error: Option, -} - -#[tauri::command] -pub fn get_nvapi_status() -> NvapiStatus { - match try_init_nvapi() { - Ok(()) => NvapiStatus { - available: true, - error: None, - }, - Err(e) => NvapiStatus { - available: false, - error: Some(e), - }, - } -} - -#[derive(Serialize)] -pub struct NvapiDiagnostic { - pub nvapi64_exists: bool, - pub nvapi64_size: u64, - pub nvapi64_path: String, - pub tried_paths: Vec, - pub dll_loaded: bool, - pub dll_load_error: Option, - pub loaded_module_path: Option, - pub has_initialize: bool, - pub has_drs_create: bool, - pub initialize_status: i32, - pub initialize_error: Option, - pub conclusion: String, - pub suggestion: String, - pub exports: Vec, - pub is_64bit_process: bool, -} - -/// Check a candidate nvapi64.dll. -/// Since static linking is used, this simply checks if the file exists, -/// reports its size, and attempts a static-link NVAPI call to verify. -fn try_load_and_check(path: &str) -> Result<(String, u64, Vec, bool, bool, i32, Option), String> { - let meta = std::fs::metadata(path).map_err(|_| "文件不存在".to_string())?; - let size = meta.len(); - - let mut exports = Vec::new(); - - // Try to load with libloading to see if it's a valid DLL at all - let _library = match unsafe { Library::new(path) } { - Ok(lib) => { - exports.push("DLL 可加载".into()); - lib - } - Err(e) => { - return Err(format!("DLL 加载失败: {e}")); - } - }; - - // DRS availability: check file size — real nvapi64.dll >= ~2 MB - let has_drs = size >= 2_000_000; - - // We can't easily test NvAPI_Initialize from here since it's statically linked - // (the import would resolve to whatever DLL the linker found). - // Report the file info for diagnostic purposes. - exports.push(format!("文件大小: {} KB ({} bytes)", size / 1024, size)); - exports.push(if has_drs { - "大小 >= 2MB,包含 DRS 接口可能性高".into() - } else { - "大小 < 2MB,可能为精简存根".into() - }); - - Ok((path.to_string(), size, exports, true, has_drs, 0, None)) -} - -#[tauri::command] -pub fn diagnose_nvapi() -> NvapiDiagnostic { - let is_64bit = std::mem::size_of::() == 8; - let bitness = if is_64bit { "64位" } else { "32位" }; - - let all_candidates = find_nvapi64_candidates(); - - let mut diag = NvapiDiagnostic { - nvapi64_exists: !all_candidates.is_empty(), - nvapi64_size: all_candidates.first().map(|(_, s)| *s).unwrap_or(0), - nvapi64_path: all_candidates.first().map(|(p, _)| p.clone()).unwrap_or_default(), - tried_paths: Vec::new(), - dll_loaded: false, - dll_load_error: None, - loaded_module_path: None, - has_initialize: false, - has_drs_create: false, - initialize_status: 0, - initialize_error: None, - conclusion: String::new(), - suggestion: String::new(), - exports: Vec::new(), - is_64bit_process: is_64bit, - }; - - // Build summary of all found files - let mut file_summary = String::new(); - for (path, size) in &all_candidates { - file_summary.push_str(&format!("• {} ({} KB)\n", path, size / 1024)); - } - - // Try each candidate (already sorted largest first) - for (path, _size) in &all_candidates { - diag.tried_paths.push(path.clone()); - - match try_load_and_check(path) { - Ok((loaded_path, file_size, exports, has_init, has_drs, init_status, init_error)) => { - diag.dll_loaded = true; - diag.loaded_module_path = Some(loaded_path.clone()); - diag.nvapi64_size = file_size; - diag.nvapi64_exists = true; - diag.has_initialize = has_init; - diag.has_drs_create = has_drs; - diag.initialize_status = init_status; - diag.initialize_error = init_error; - diag.exports = exports; - - if has_init && init_status == NVAPI_OK { - break; - } - } - Err(e) => { - diag.dll_load_error = Some(format!("{path}: {e}")); - } - } - } - - // Build conclusion - if diag.has_initialize && diag.has_drs_create && diag.initialize_status == NVAPI_OK { - diag.conclusion = format!( - "NVAPI 完整可用,从 {} 加载(Init+DRS均就绪)", - diag.loaded_module_path.as_deref().unwrap_or("N/A") - ); - diag.suggestion = "无需额外操作。".into(); - } else if diag.has_initialize && diag.initialize_status == NVAPI_OK && !diag.has_drs_create { - diag.conclusion = format!( - "初始化成功但缺少 DRS 设置功能!\nDLL: {} ({}KB)\n此 nvapi64.dll 为精简存根,仅含 Init/Unload 序号导出,缺少 DRS 设置接口。\n无法调节纹理质量、垂直同步等 3D 设置。", - diag.loaded_module_path.as_deref().unwrap_or("N/A"), - diag.nvapi64_size / 1024, - ); - diag.suggestion = "请使用 DDU 完全卸载当前驱动,从 nvidia.com 下载最新驱动后选择「自定义安装 → 清洁安装」。".into(); - } else if diag.has_initialize && diag.initialize_status != NVAPI_OK { - let err_msg = diag.initialize_error.as_deref().unwrap_or("(未知)"); - diag.conclusion = format!( - "NvAPI_Initialize 返回错误: {} (代码 {})", - err_msg, diag.initialize_status - ); - diag.suggestion = "请确认当前显示器连接到 NVIDIA GPU。".into(); - } else if all_candidates.is_empty() { - diag.conclusion = "系统中未找到任何 nvapi64.dll。可能未安装 NVIDIA 显卡驱动。".into(); - diag.suggestion = "请访问 nvidia.com/drivers 下载安装驱动。".into(); - } else if !diag.dll_loaded { - let load_err = diag.dll_load_error.as_deref().unwrap_or("(未知)"); - diag.conclusion = format!( - "找到 {} 个 nvapi64.dll 但全部加载失败: {load_err}\n文件列表:\n{file_summary}", - all_candidates.len() - ); - diag.suggestion = "请从 NVIDIA 官网安装最新驱动,选择「清洁安装」。".into(); - } else { - diag.conclusion = format!( - "未找到有效 NVAPI! 进程:{bitness} | 找到{}个文件 | 当前加载: {} ({}KB, {}导出)\n文件列表:\n{file_summary}", - all_candidates.len(), - diag.loaded_module_path.as_deref().unwrap_or("N/A"), - diag.nvapi64_size / 1024, - diag.exports.len(), - ); - if diag.nvapi64_size < 1_000_000 { - diag.suggestion = "⚠ 所有 nvapi64.dll 均小于 1 MB,不是 NVIDIA 官方版本!请从 nvidia.com 下载最新驱动,安装时选择「自定义安装 → 清洁安装」。".into(); - } else { - diag.suggestion = "文件存在但无 NVAPI 导出。尝试 DDU 完全卸载后重装 NVIDIA 驱动。".into(); - } - } - - diag -} - -#[derive(Serialize)] -pub struct NvidiaDriverInfo { - pub version: u32, - pub branch: String, - pub gpu_name: String, -} - -#[tauri::command] -pub fn get_nvidia_driver_version() -> Result { - try_init_nvapi()?; - let mut display: NvDisplayHandle = std::ptr::null_mut(); - let status = unsafe { NvAPI_EnumNvidiaDisplayHandle(0, &mut display) }; - if status != NVAPI_OK { - return Ok(NvidiaDriverInfo { version: 0, branch: "Unknown".into(), gpu_name: "NVIDIA GPU".into() }); - } - - let mut ver_info: NvDisplayDriverVersion = unsafe { std::mem::zeroed() }; - ver_info.version = (std::mem::size_of::() as NvU32) | (1u32 << 16); - let status = unsafe { NvAPI_GetDisplayDriverVersion(display, &mut ver_info) }; - if status != NVAPI_OK { - return Ok(NvidiaDriverInfo { version: 0, branch: "Unknown".into(), gpu_name: "NVIDIA GPU".into() }); - } - - let branch = cstr_to_string(&ver_info.sz_build_branch_string); - let gpu_name = cstr_to_string(&ver_info.sz_adapter_string).trim().to_string(); - Ok(NvidiaDriverInfo { version: ver_info.drv_version, branch, gpu_name }) -} - -#[tauri::command] -pub fn list_nvidia_settings() -> Result, String> { - try_init_nvapi()?; - with_state(|state| { - let profile = get_global_profile(state)?; - let opts_list = settings_options(); - - let mut results = Vec::new(); - - for &target_id in TARGET_SETTINGS { - let mut setting = NvdrsSettingV1::new(); - setting.setting_id = target_id; - - let status = - unsafe { NvAPI_DRS_GetSetting(state.session, profile, target_id, &mut setting) }; - if status != NVAPI_OK { - log::warn!( - "NvAPI_DRS_GetSetting for 0x{target_id:08X} failed: {}", - nvapi_error_string(status) - ); - continue; - } - - let name = utf16_to_string(&setting.setting_name); - let current = setting.current_u32(); - let default = setting.predefined_u32(); - - let options = opts_list - .iter() - .find(|(id, _, _)| *id == target_id) - .map(|(_, _, opts)| opts.clone()) - .unwrap_or_else(|| { - vec![SettingOption { - value: current, - label: format!("{current}"), - }] - }); - - let description = match target_id { - SETTING_VSYNCMODE => "控制画面撕裂与帧同步", - SETTING_FRL_FPS => "限制游戏最大帧率,降低功耗", - SETTING_VRR_APP_OVERRIDE => "G-Sync 应用级覆盖控制", - SETTING_VRR_MODE => "G-Sync 全局启用范围", - SETTING_REFRESH_RATE_OVERRIDE => "选择首选刷新率策略", - SETTING_VSYNCTEARCONTROL => "控制垂直同步撕裂补偿", - SETTING_OGL_TRIPLE_BUFFER => "OpenGL 三重缓冲开关", - SETTING_QUALITY_ENHANCEMENTS => "纹理过滤的全局画质等级", - SETTING_ANISO_MODE_LEVEL => "增强斜角纹理的清晰度", - SETTING_AA_MODE_METHOD => "平滑物体边缘锯齿", - SETTING_FXAA_ENABLE => "快速且低开销的抗锯齿技术", - SETTING_AO_MODE => "模拟物体间环境光遮蔽阴影", - SETTING_MAXWELL_B_SAMPLE_INTERLEAVE => "MFAA 多帧抗锯齿技术", - SETTING_PS_SHADERDISKCACHE => "着色器缓存减少卡顿", - SETTING_AA_MODE_SELECTOR => "抗锯齿覆盖/增强模式", - SETTING_AA_MODE_ALPHATOCOVERAGE => "透明纹理的抗锯齿处理", - SETTING_PS_TEXFILTER_ANISO_OPTS2 => "各向异性过滤采样优化", - SETTING_PS_TEXFILTER_NO_NEG_LODBIAS => "控制负 LOD 偏移行为", - SETTING_AUTO_LODBIASADJUST => "驱动自动调节 LOD 偏移", - SETTING_PS_TEXFILTER_BILINEAR_IN_ANISO => "各向异性过滤时使用双线性", - SETTING_PS_TEXFILTER_DISABLE_TRILIN_SLOPE => "禁用三线性过滤优化", - SETTING_PREFERRED_PSTATE => "控制 GPU 性能和功耗策略", - SETTING_PRERENDERLIMIT => "CPU 提前渲染的帧数", - SETTING_OGL_THREAD_CONTROL => "OpenGL 多线程优化", - SETTING_VRPRERENDERLIMIT => "VR 头显预渲染帧数", - SETTING_BATTERY_BOOST_APP_FPS => "电池供电时帧率限制", - SETTING_VSYNC_BEHAVIOR_FLAGS => "控制垂直同步行为标志", - SETTING_VSYNCVRRCONTROL => "可变刷新率开关", - SETTING_AA_BEHAVIOR_FLAGS => "抗锯齿覆盖/增强行为控制", - SETTING_AA_MODE_REPLAY => "透明纹理超级采样模式", - SETTING_ANISO_MODE_SELECTOR => "各向异性过滤控制模式", - SETTING_PREVENT_UI_AF_OVERRIDE => "禁止程序覆盖各向异性过滤", - - SETTING_VRRFEATUREINDICATOR => "G-Sync 功能状态指示图标", - SETTING_VRROVERLAYINDICATOR => "G-Sync 刷新率叠加层", - SETTING_VRRREQUESTSTATE => "G-Sync 请求启用模式", - SETTING_FXAA_INDICATOR_ENABLE => "FXAA 激活状态指示图标", - SETTING_PHYSXINDICATOR => "PhysX 状态指示图标", - SETTING_EXPORT_PERF_COUNTERS => "导出性能计数器数据", - SETTING_EXTERNAL_QUIET_MODE => "外部静音模式功耗控制", - SETTING_FXAA_ALLOW => "控制应用是否可使用 FXAA 抗锯齿", - SETTING_QUALITY_ENHANCEMENT_SUBSTITUTION => "纹理过滤质量降级策略", - SETTING_AO_MODE_ACTIVE => "环境光遮蔽全局启用开关", - SETTING_VSYNCSMOOTHAFR => "多 GPU 交替帧渲染优化", - SETTING_LATENCY_INDICATOR_AUTOALIGN => "NVIDIA Reflex 延迟标记自动对齐", - SETTING_PS_SHADERDISKCACHE_MAX_SIZE => "着色器缓存磁盘使用上限", - _ => "", - }; - - results.push(NvidiaSetting { - id: target_id, - name: opts_list - .iter() - .find(|(id, _, _)| *id == target_id) - .map(|(_, n, _)| n.to_string()) - .unwrap_or(name), - description: description.to_string(), - current_value: current, - default_value: default, - options, - }); - } - - Ok(results) - }) -} - -#[tauri::command] -pub fn set_nvidia_setting(setting_id: NvU32, value: NvU32) -> Result<(), String> { - try_init_nvapi()?; - with_state(|state| { - let profile = get_global_profile(state)?; - - let mut setting = NvdrsSettingV1::new(); - setting.setting_id = setting_id; - setting.set_current_u32(value); - - let status = - unsafe { NvAPI_DRS_SetSetting(state.session, profile, &mut setting) }; - if status != NVAPI_OK { - return Err(format!( - "设置 0x{setting_id:08X} 失败: {}", - nvapi_error_string(status) - )); - } - - let status = unsafe { NvAPI_DRS_SaveSettings(state.session) }; - if status != NVAPI_OK { - return Err(format!( - "保存设置失败: {}", - nvapi_error_string(status) - )); - } - - log::info!("NVIDIA 设置 0x{setting_id:08X} 已更新为 {value}"); - Ok(()) - }) -} - -#[tauri::command] -pub fn reset_nvidia_settings() -> Result<(), String> { - try_init_nvapi()?; - with_state(|state| { - let profile = get_global_profile(state)?; - - let status = unsafe { NvAPI_DRS_RestoreProfileDefault(state.session, profile) }; - // -151 = NVAPI_PROFILE_REMOVED (success case) - if status != NVAPI_OK && status != -151 { - return Err(format!( - "恢复默认设置失败: {}", - nvapi_error_string(status) - )); - } - - // Profile might be invalidated; get a fresh handle and save - let _new_profile = get_global_profile(state)?; - let status = unsafe { NvAPI_DRS_SaveSettings(state.session) }; - if status != NVAPI_OK { - return Err(format!( - "保存恢复后的设置失败: {}", - nvapi_error_string(status) - )); - } - - log::info!("NVIDIA 全局设置已恢复默认值"); - Ok(()) - }) -} - -// --------------------------------------------------------------------------- -// NVAPI DISP Display Control Commands -// --------------------------------------------------------------------------- - -#[derive(serde::Serialize, Clone)] -pub struct NvidiaDisplay { - pub display_id: NvU32, - pub device_name: String, - pub monitor_name: String, - pub is_primary: bool, - pub current_width: i32, - pub current_height: i32, -} - -#[derive(serde::Serialize, Clone)] -pub struct DisplayMode { - pub width: u32, - pub height: u32, - pub refresh_rate: f64, - pub is_current: bool, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] -pub struct InjectedResolution { - pub width: u32, - pub height: u32, -} - -#[derive(serde::Serialize)] -pub struct SetResolutionResult { - pub applied: bool, - pub injected: bool, -} - -fn injected_resolutions_path() -> std::path::PathBuf { - let config_dir = dirs::config_dir().unwrap_or_else(|| std::path::PathBuf::from(".")); - config_dir.join("NexBox").join("injected_resolutions.json") -} - -fn load_injected_resolutions() -> Vec { - let path = injected_resolutions_path(); - if !path.exists() { - return Vec::new(); - } - std::fs::read_to_string(&path) - .ok() - .and_then(|s| serde_json::from_str(&s).ok()) - .unwrap_or_default() -} - -fn save_injected_resolution(width: u32, height: u32) -> Result<(), String> { - let path = injected_resolutions_path(); - let mut list = load_injected_resolutions(); - let entry = InjectedResolution { width, height }; - if !list.contains(&entry) { - list.push(entry); - } - if let Some(parent) = path.parent() { - std::fs::create_dir_all(parent).map_err(|e| format!("创建目录失败: {}", e))?; - } - std::fs::write( - &path, - serde_json::to_string(&list).map_err(|e| format!("序列化失败: {}", e))?, - ) - .map_err(|e| format!("写入失败: {}", e))?; - Ok(()) -} - -/// Check if a monitor name is a generic/placeholder (any language variant) -fn is_generic_monitor_name(name: &str) -> bool { - let lower = name.to_lowercase(); - lower.contains("generic") - || lower.contains("即插即用") - || lower.contains("通用") - || lower.contains("pnp") - || lower.contains("standard monitor") - || lower.contains("digital display") - || lower.contains("analog display") -} -/// Enumerate NVIDIA displays with real NVAPI displayId from GetDisplayConfig. -#[tauri::command] -pub async fn list_nvidia_displays() -> Result, String> { - #[cfg(not(target_os = "windows"))] - { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - #[cfg(target_os = "windows")] - { - let result = tauri::async_runtime::spawn_blocking(list_nvidia_displays_inner) - .await - .map_err(|e| format!("枚举显示器失败: {}", e))?; - - // 重试机制:如果所有显示器分辨率都是 0,等待后重试一次 - if let Ok(ref displays) = result { - if !displays.is_empty() && displays.iter().all(|d| d.current_width <= 0 || d.current_height <= 0) { - log::warn!("list_nvidia_displays: 所有显示器分辨率无效,500ms 后重试…"); - tokio::time::sleep(std::time::Duration::from_millis(500)).await; - let retry = tauri::async_runtime::spawn_blocking(list_nvidia_displays_inner) - .await - .map_err(|e| format!("枚举显示器重试失败: {}", e))?; - if let Ok(ref retry_displays) = retry { - if retry_displays.iter().any(|d| d.current_width > 0 && d.current_height > 0) { - log::info!("list_nvidia_displays: 重试后成功获取到分辨率"); - return retry; - } - } - log::warn!("list_nvidia_displays: 重试后分辨率仍未就绪,返回首次结果"); - } - } - - result - } -} - -#[cfg(target_os = "windows")] -fn list_nvidia_displays_inner() -> Result, String> { - use std::mem; - use windows_sys::Win32::Graphics::Gdi::{ - EnumDisplayMonitors, GetMonitorInfoW, HDC, HMONITOR, MONITORINFOEXW, - EnumDisplayDevicesW, DISPLAY_DEVICEW, - }; - - try_init_nvapi()?; - - // ── Step 1: Collect GDI monitor info ── - struct GdiMonitor { - device_name: String, - monitor_name: String, - is_primary: bool, - width: i32, - height: i32, - } - - struct MonitorData { - monitors: Vec, - } - - unsafe extern "system" fn monitor_enum_proc( - hmonitor: HMONITOR, - _hdc: HDC, - _rect: *mut windows_sys::Win32::Foundation::RECT, - lparam: isize, - ) -> i32 { - let data = &mut *(lparam as *mut MonitorData); - let mut info: MONITORINFOEXW = mem::zeroed(); - info.monitorInfo.cbSize = mem::size_of::() as u32; - - if GetMonitorInfoW(hmonitor, &mut info as *mut _ as *mut _) != 0 { - let device_name = String::from_utf16_lossy( - &info.szDevice[..info - .szDevice - .iter() - .position(|&c| c == 0) - .unwrap_or(info.szDevice.len())], - ); - let is_primary = (info.monitorInfo.dwFlags & 1) != 0; - let mut width = info.monitorInfo.rcMonitor.right - - info.monitorInfo.rcMonitor.left; - let mut height = info.monitorInfo.rcMonitor.bottom - - info.monitorInfo.rcMonitor.top; - - // 分辨率无效时回退到 EnumDisplaySettingsW - if width <= 0 || height <= 0 { - log::warn!( - "nvapi::list_nvidia_displays: monitor[{}] GetMonitorInfoW 分辨率无效 ({}x{}), 尝试 EnumDisplaySettingsW 回退", - data.monitors.len(), width, height - ); - use windows_sys::Win32::Graphics::Gdi::{EnumDisplaySettingsW, DEVMODEW, ENUM_CURRENT_SETTINGS}; - // 尝试原设备名和去掉 \\?\ 前缀的格式 - let name_attempts = [ - device_name.clone(), - device_name.trim_start_matches("\\\\.\\").to_string(), - ]; - for attempt in &name_attempts { - if attempt.is_empty() { continue; } - let wide: Vec = attempt.encode_utf16().chain(std::iter::once(0)).collect(); - let mut dm: DEVMODEW = std::mem::zeroed(); - dm.dmSize = std::mem::size_of::() as u16; - if EnumDisplaySettingsW(wide.as_ptr(), ENUM_CURRENT_SETTINGS, &mut dm) != 0 { - let fw = dm.dmPelsWidth as i32; - let fh = dm.dmPelsHeight as i32; - if fw > 0 && fh > 0 { - width = fw; - height = fh; - log::info!("nvapi::list_nvidia_displays: EnumDisplaySettingsW 回退成功 device={} ({}x{})", attempt, fw, fh); - break; - } - } - } - } - - let monitor_name = { - let wide: Vec = - device_name.encode_utf16().chain(std::iter::once(0)).collect(); - let mut dd: DISPLAY_DEVICEW = mem::zeroed(); - dd.cb = mem::size_of::() as u32; - if EnumDisplayDevicesW(wide.as_ptr(), 0, &mut dd, 0) != 0 { - let len = dd.DeviceString - .iter() - .position(|&c| c == 0) - .unwrap_or(dd.DeviceString.len()); - if len > 0 { - let model = String::from_utf16_lossy(&dd.DeviceString[..len]); - let t = model.trim(); - if !t.is_empty() && !is_generic_monitor_name(t) { - t.to_string() - } else { - device_name.trim_start_matches("\\\\.\\").to_string() - } - } else { - device_name.trim_start_matches("\\\\.\\").to_string() - } - } else { - device_name.trim_start_matches("\\\\.\\").to_string() - } - }; - - data.monitors.push(GdiMonitor { - device_name, - monitor_name, - is_primary, - width, - height, - }); - } - 1 - } - - let mut data = MonitorData { - monitors: Vec::new(), - }; - unsafe { - EnumDisplayMonitors( - std::ptr::null_mut(), - std::ptr::null(), - Some(monitor_enum_proc), - &mut data as *mut _ as isize, - ); - } - - if data.monitors.is_empty() { - return Err("未检测到任何显示器".to_string()); - } - - // ── Step 2: Get real NVAPI displayIds from GetDisplayConfig ── - let nvapi_display_ids: Vec = unsafe { - let mut path_info_count: NvU32 = 0; - let mut status = - NvAPI_DISP_GetDisplayConfig(&mut path_info_count, std::ptr::null_mut()); - if status != NVAPI_OK || path_info_count == 0 { - log::warn!("GetDisplayConfig pass1 failed: status={}", status); - return Ok(data - .monitors - .into_iter() - .enumerate() - .map(|(i, m)| NvidiaDisplay { - display_id: i as NvU32, - device_name: m.device_name, - monitor_name: m.monitor_name, - is_primary: m.is_primary, - current_width: m.width, - current_height: m.height, - }) - .collect()); - } - - // Pass 2: allocate sourceModeInfo - let mut source_mode_infos: Vec = - (0..path_info_count as usize) - .map(|_| { - let mut sm: NvDisplayConfigSourceModeInfo = mem::zeroed(); - sm.colorFormat = 0; - sm - }) - .collect(); - - let mut path_infos: Vec = (0..path_info_count as usize) - .map(|i| { - let mut p: NvDisplayConfigPathInfo = mem::zeroed(); - p.version = NV_DISPLAYCONFIG_PATH_INFO_VER; - p.sourceModeInfo = &mut source_mode_infos[i]; - p - }) - .collect(); - - status = NvAPI_DISP_GetDisplayConfig(&mut path_info_count, path_infos.as_mut_ptr()); - if status != NVAPI_OK { - log::warn!("GetDisplayConfig pass2 failed: status={}", status); - return Ok(data - .monitors - .into_iter() - .enumerate() - .map(|(i, m)| NvidiaDisplay { - display_id: i as NvU32, - device_name: m.device_name, - monitor_name: m.monitor_name, - is_primary: m.is_primary, - current_width: m.width, - current_height: m.height, - }) - .collect()); - } - - // Pass 3: allocate targetInfo - let mut target_allocations: Vec> = Vec::new(); - for path in &mut path_infos { - let count = path.targetInfoCount as usize; - if count > 0 { - let targets: Vec = - (0..count).map(|_| mem::zeroed()).collect(); - path.targetInfo = targets.as_ptr() as *mut NvDisplayConfigPathTargetInfo; - target_allocations.push(targets); - } else { - path.targetInfo = std::ptr::null_mut(); - } - } - - status = NvAPI_DISP_GetDisplayConfig(&mut path_info_count, path_infos.as_mut_ptr()); - if status != NVAPI_OK { - log::warn!("GetDisplayConfig pass3 failed: status={}", status); - return Ok(data - .monitors - .into_iter() - .enumerate() - .map(|(i, m)| NvidiaDisplay { - display_id: i as NvU32, - device_name: m.device_name, - monitor_name: m.monitor_name, - is_primary: m.is_primary, - current_width: m.width, - current_height: m.height, - }) - .collect()); - } - - // Extract displayIds from paths (first targetInfo per path) - path_infos - .iter() - .map(|p| { - if p.targetInfoCount > 0 && !p.targetInfo.is_null() { - (*p.targetInfo).displayId - } else { - 0 - } - }) - .collect() - }; - - log::info!( - "list_nvidia_displays: {} GDI monitors, {} NVAPI paths, display_ids={:?}", - data.monitors.len(), - nvapi_display_ids.len(), - nvapi_display_ids - ); - - // ── Step 3: Combine GDI info with real NVAPI displayIds ── - // Match by order: GDI monitor N → NVAPI path N (typically correct for NVIDIA) - let mut displays: Vec = data - .monitors - .into_iter() - .enumerate() - .map(|(i, m)| { - let display_id = nvapi_display_ids.get(i).copied().unwrap_or(i as NvU32); - NvidiaDisplay { - display_id, - device_name: m.device_name, - monitor_name: m.monitor_name, - is_primary: m.is_primary, - current_width: m.width, - current_height: m.height, - } - }) - .collect(); - - // EDID 回退:如果 EnumDisplayDevicesW 返回通用名称, - // monitor_name 会退化为 GDI 设备名(如 DISPLAY1)。 - let has_fallback = displays.iter().any(|d| { - let stripped = d.device_name.trim_start_matches("\\\\.\\"); - d.monitor_name == stripped - }); - if has_fallback { - let edid_names = crate::display_cache::get_edid_monitor_names(); - if !edid_names.is_empty() { - for (i, d) in displays.iter_mut().enumerate() { - let stripped = d.device_name.trim_start_matches("\\\\.\\"); - if d.monitor_name == stripped { - if let Some(name) = edid_names.get(i) { - if !name.is_empty() { - d.monitor_name = name.clone(); - } - } else if edid_names.len() == 1 && !edid_names[0].is_empty() { - d.monitor_name = edid_names[0].clone(); - } - } - } - } - } - - Ok(displays) -} - -/// Enumerate all available display modes (resolution + refresh rate) for a given GDI device name. -#[tauri::command] -pub fn get_nvidia_display_modes(device_name: String) -> Result, String> { - #[cfg(not(target_os = "windows"))] - { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - #[cfg(target_os = "windows")] - { - use std::mem; - use windows_sys::Win32::Graphics::Gdi::{EnumDisplaySettingsW, DEVMODEW}; - - let wide_name: Vec = - device_name.encode_utf16().chain(std::iter::once(0)).collect(); - let mut modes: Vec = Vec::new(); - let mut mode_num: u32 = 0; - - loop { - let mut dev_mode: DEVMODEW = unsafe { mem::zeroed() }; - dev_mode.dmSize = mem::size_of::() as u16; - - let result = - unsafe { EnumDisplaySettingsW(wide_name.as_ptr(), mode_num, &mut dev_mode) }; - - if result == 0 { - break; - } - - // Calculate effective refresh rate - // dmDisplayFrequency may be exact (e.g. 60, 144) or fractional (e.g. 5995 → 59.95) - let freq_raw = dev_mode.dmDisplayFrequency as f64; - let refresh_rate = if freq_raw > 200.0 { - // Assume it's 100x encoded (e.g., 5995 = 59.95 Hz) - freq_raw / 100.0 - } else { - freq_raw - }; - - modes.push(DisplayMode { - width: dev_mode.dmPelsWidth, - height: dev_mode.dmPelsHeight, - refresh_rate, - is_current: false, - }); - - mode_num += 1; - if mode_num > 300 { - break; - } - } - - if modes.is_empty() { - return Err(format!("无法枚举显示器 {} 的模式", device_name)); - } - - // Sort: resolution (W*H) desc, then refresh rate desc - modes.sort_by(|a, b| { - let area_a = a.width * a.height; - let area_b = b.width * b.height; - area_b - .cmp(&area_a) - .then( - b.refresh_rate - .partial_cmp(&a.refresh_rate) - .unwrap_or(std::cmp::Ordering::Equal), - ) - }); - - // Dedup: same (width, height, approx refresh rate) - modes.dedup_by(|a, b| { - a.width == b.width - && a.height == b.height - && (a.refresh_rate - b.refresh_rate).abs() < 0.5 - }); - - Ok(modes) - } -} - -// --------------------------------------------------------------------------- -// NV_Modes registry injection helpers -// --------------------------------------------------------------------------- - -/// Inject a custom resolution into all NVIDIA NV_Modes registry keys -/// under HKLM\SYSTEM\CurrentControlSet\Control\Video\. -/// -/// Format: "{width}x{height}x{bpp}-{RRx1000}" -fn inject_nv_modes_registry(device_name: &str, width: u32, height: u32) -> Result, String> { - use std::mem; - use winreg::enums::*; - use winreg::RegKey; - - // Get current refresh rate via GDI for the NV_Modes entry format - let refresh_rrx1k: u32 = unsafe { - let wide: Vec = device_name.encode_utf16().chain(std::iter::once(0)).collect(); - let mut dm: windows_sys::Win32::Graphics::Gdi::DEVMODEW = mem::zeroed(); - dm.dmSize = mem::size_of_val(&dm) as u16; - if windows_sys::Win32::Graphics::Gdi::EnumDisplaySettingsW( - wide.as_ptr(), 0xFFFFFFFF, &mut dm, - ) != 0 - { - let freq = dm.dmDisplayFrequency as u32; - if freq > 200 { freq } else { freq * 1000 } - } else { - 144000 - } - }; - - let entry = format!("{}x{}x32-{}", width, height, refresh_rrx1k); - let video_path = r"SYSTEM\CurrentControlSet\Control\Video"; - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - - let video_key = hklm.open_subkey_with_flags(video_path, KEY_READ) - .map_err(|e| format!("无法打开注册表路径 {}: {}", video_path, e))?; - - let mut injected: Vec = Vec::new(); - - for adapter in video_key.enum_keys().filter_map(|r| r.ok()) { - let adapter_key = match hklm.open_subkey_with_flags( - &format!(r"{}\{}", video_path, adapter), KEY_READ, - ) { - Ok(k) => k, - Err(_) => continue, - }; - - for target in adapter_key.enum_keys().filter_map(|r| r.ok()) { - let target_path = format!(r"{}\{}\{}", video_path, adapter, target); - let target_key = match hklm.open_subkey_with_flags( - &target_path, KEY_READ | KEY_WRITE, - ) { - Ok(k) => k, - Err(_) => continue, - }; - - // Check if NV_Modes exists (REG_MULTI_SZ) - let has_modes = target_key.get_value::, _>("NV_Modes").is_ok(); - if !has_modes { - // Try REG_SZ format - let has_sz = target_key.get_value::("NV_Modes").is_ok(); - if !has_sz { - continue; - } - } - - let mut modes: Vec = target_key.get_value("NV_Modes").unwrap_or_default(); - // Remove stale entry for the same base resolution - modes.retain(|m| { - let prefix = format!("{}x{}", width, height); - !m.starts_with(&prefix) - }); - // Add our entry if not already present - if !modes.contains(&entry) { - modes.push(entry.clone()); - } - - target_key.set_value("NV_Modes", &modes) - .map_err(|e| format!("写入 NV_Modes 到 {} 失败: {}", target_path, e))?; - - log::info!("已注入分辨率到 NV_Modes: {} (target={})", entry, target); - injected.push(target_path); - } - } - - if injected.is_empty() { - // NV_Modes doesn't exist yet — create it under the first suitable NVIDIA target - for adapter in video_key.enum_keys().filter_map(|r| r.ok()) { - let adapter_key = match hklm.open_subkey_with_flags( - &format!(r"{}\{}", video_path, adapter), KEY_READ, - ) { - Ok(k) => k, - Err(_) => continue, - }; - - for target in adapter_key.enum_keys().filter_map(|r| r.ok()) { - let target_path = format!(r"{}\{}\{}", video_path, adapter, target); - // Skip known non-target subkeys - if target == "0000" || target == "Connectivity" || target == "DAL" { - continue; - } - let target_key = match hklm.create_subkey(&target_path) { - Ok((k, _)) => k, - Err(_) => continue, - }; - let modes: Vec = vec![entry.clone()]; - target_key.set_value("NV_Modes", &modes) - .map_err(|e| format!("创建 NV_Modes 到 {} 失败: {}", target_path, e))?; - log::info!("已创建并注入 NV_Modes: {} (target={})", entry, target); - injected.push(target_path); - break; - } - if !injected.is_empty() { - break; - } - } - } - - if injected.is_empty() { - Err("未找到 NV_Modes 注册表项,且无法创建".to_string()) - } else { - Ok(injected) - } -} - -/// Re-run NvAPI_DISP_SetDisplayConfig (after NV_Modes injection) -unsafe fn retry_set_display_config( - display_id: NvU32, - width: NvU32, - height: NvU32, -) -> Result<(), String> { - use std::mem; - - let mut path_info_count: NvU32 = 0; - let mut s = NvAPI_DISP_GetDisplayConfig(&mut path_info_count, std::ptr::null_mut()); - if s != NVAPI_OK || path_info_count == 0 { - return Err("retry: GetDisplayConfig 失败".to_string()); - } - - let mut source_mode_infos: Vec = (0..path_info_count as usize) - .map(|_| { - let mut sm: NvDisplayConfigSourceModeInfo = mem::zeroed(); - sm.colorFormat = 0; - sm - }) - .collect(); - - let mut path_infos: Vec = (0..path_info_count as usize) - .map(|i| { - let mut p: NvDisplayConfigPathInfo = mem::zeroed(); - p.version = NV_DISPLAYCONFIG_PATH_INFO_VER; - p.sourceModeInfo = &mut source_mode_infos[i]; - p - }) - .collect(); - - s = NvAPI_DISP_GetDisplayConfig(&mut path_info_count, path_infos.as_mut_ptr()); - if s != NVAPI_OK { - return Err("retry: GetDisplayConfig pass2 失败".to_string()); - } - - // Allocate targetInfo - let mut target_allocations: Vec> = Vec::new(); - for path in &mut path_infos { - let count = path.targetInfoCount as usize; - if count > 0 { - let targets: Vec = - (0..count).map(|_| mem::zeroed()).collect(); - path.targetInfo = targets.as_ptr() as *mut NvDisplayConfigPathTargetInfo; - target_allocations.push(targets); - } else { - path.targetInfo = std::ptr::null_mut(); - } - } - - s = NvAPI_DISP_GetDisplayConfig(&mut path_info_count, path_infos.as_mut_ptr()); - if s != NVAPI_OK { - return Err("retry: GetDisplayConfig pass3 失败".to_string()); - } - - // Find path for our display_id - let target_idx = match path_infos.iter().position(|path| { - if path.targetInfoCount > 0 && !path.targetInfo.is_null() { - let targets = std::slice::from_raw_parts(path.targetInfo, path.targetInfoCount as usize); - targets.iter().any(|t| t.displayId == display_id) - } else { - false - } - }) { - Some(i) => i, - None => return Err("retry: 未找到 displayId".to_string()), - }; - - let path = &mut path_infos[target_idx]; - let mode_info = match path.sourceModeInfo.as_mut() { - Some(m) => m, - None => return Err("retry: 无 source mode info".to_string()), - }; - mode_info.resolution.width = width; - mode_info.resolution.height = height; - - let flags = NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE | NV_FORCE_COMMIT_VIDPN; - s = NvAPI_DISP_SetDisplayConfig(path_info_count, path_infos.as_ptr(), flags); - if s == NVAPI_OK { - log::info!("retry: SetDisplayConfig 成功设置 {}x{}", width, height); - Ok(()) - } else { - Err(format!("retry: SetDisplayConfig 失败: {} (code {})", nvapi_error_string(s), s)) - } -} - -/// Get the list of resolutions that have been injected into NV_Modes registry. -#[tauri::command] -pub fn get_injected_resolutions() -> Vec { - load_injected_resolutions() -} - -/// Remove a resolution from the injected resolutions list. -#[tauri::command] -pub fn remove_injected_resolution(width: u32, height: u32) -> Result<(), String> { - let path = injected_resolutions_path(); - let mut list = load_injected_resolutions(); - let before = list.len(); - list.retain(|r| r.width != width || r.height != height); - if list.len() == before { - return Ok(()); // nothing to remove - } - std::fs::write( - &path, - serde_json::to_string(&list).map_err(|e| format!("序列化失败: {}", e))?, - ) - .map_err(|e| format!("写入失败: {}", e))?; - Ok(()) -} - -/// Set display resolution using NVAPI DISP API. -/// -/// Steps (3-tier fallback): -/// 1. Try NvAPI_DISP_SetDisplayConfig (works for EDID-listed modes) -/// 2. Inject into NVIDIA NV_Modes registry + ChangeDisplaySettingsExW (custom/non-EDID modes) -/// 3. Retry SetDisplayConfig after injection -#[tauri::command] -pub fn set_nvidia_display_resolution( - display_id: NvU32, - width: NvU32, - height: NvU32, - device_name: String, -) -> Result { - try_init_nvapi()?; - - if width == 0 || height == 0 { - return Err("分辨率宽高不能为 0".to_string()); - } - - #[cfg(not(target_os = "windows"))] - { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - #[cfg(target_os = "windows")] - { - use std::mem; - use windows_sys::Win32::Graphics::Gdi::{ - ChangeDisplaySettingsExW, EnumDisplaySettingsW, DEVMODEW, - }; - - // ── Strategy 1: Try NVAPI SetDisplayConfig (works for EDID-listed modes) ── - let nvapi_err = 's1: { - let mut path_info_count: NvU32 = 0; - let status; - unsafe { - // ── Pass 1: Get pathInfoCount ── - status = - NvAPI_DISP_GetDisplayConfig(&mut path_info_count, std::ptr::null_mut()); - } - if status != NVAPI_OK { - break 's1 format!( - "获取显示配置失败: {} (code {})", - nvapi_error_string(status), - status - ); - } - if path_info_count == 0 { - break 's1 "没有活动的显示路径".to_string(); - } - - // ── Pass 2: Allocate pathInfo + sourceModeInfo arrays ── - let mut source_mode_infos: Vec = (0..path_info_count - as usize) - .map(|_| { - let mut sm: NvDisplayConfigSourceModeInfo; - unsafe { sm = mem::zeroed(); } - sm.colorFormat = 0; // NV_FORMAT_UNKNOWN - sm - }) - .collect(); - - let mut path_infos: Vec = (0..path_info_count as usize) - .map(|i| { - let mut p: NvDisplayConfigPathInfo; - unsafe { p = mem::zeroed(); } - p.version = NV_DISPLAYCONFIG_PATH_INFO_VER; - p.sourceModeInfo = &mut source_mode_infos[i]; - p - }) - .collect(); - - unsafe { - let s = NvAPI_DISP_GetDisplayConfig( - &mut path_info_count, - path_infos.as_mut_ptr(), - ); - if s != NVAPI_OK { - break 's1 format!( - "获取显示配置失败(Pass 2): {} (code {})", - nvapi_error_string(s), - s - ); - } - } - - // ── Pass 3: Allocate targetInfo arrays (required to get displayId) ── - let mut target_allocations: Vec> = Vec::new(); - for path in &mut path_infos { - let count = path.targetInfoCount as usize; - if count > 0 { - let targets: Vec = (0..count) - .map(|_| unsafe { mem::zeroed() }) - .collect(); - path.targetInfo = targets.as_ptr() as *mut NvDisplayConfigPathTargetInfo; - target_allocations.push(targets); - } else { - path.targetInfo = std::ptr::null_mut(); - } - } - - unsafe { - let s = NvAPI_DISP_GetDisplayConfig( - &mut path_info_count, - path_infos.as_mut_ptr(), - ); - if s != NVAPI_OK { - break 's1 format!( - "获取显示配置失败(Pass 3): {} (code {})", - nvapi_error_string(s), - s - ); - } - } - - // ── Find the path containing our display_id ── - let available_ids: Vec = path_infos - .iter() - .filter(|p| p.targetInfoCount > 0 && !p.targetInfo.is_null()) - .flat_map(|p| { - let targets = unsafe { - std::slice::from_raw_parts(p.targetInfo, p.targetInfoCount as usize) - }; - targets.iter().map(|t| t.displayId).collect::>() - }) - .collect(); - log::info!( - "NVIDIA display config: path_count={}, available_display_ids={:?}, searching for {}", - path_info_count, - available_ids, - display_id - ); - let target_path_idx = match path_infos.iter().position(|path| { - if path.targetInfoCount > 0 && !path.targetInfo.is_null() { - let targets = unsafe { - std::slice::from_raw_parts(path.targetInfo, path.targetInfoCount as usize) - }; - targets.iter().any(|t| t.displayId == display_id) - } else { - false - } - }) { - Some(idx) => idx, - None => { - break 's1 format!("未找到 displayId {} 的显示路径", display_id); - } - }; - - // ── Modify sourceModeInfo resolution ── - let path = &mut path_infos[target_path_idx]; - let mode_info = match unsafe { path.sourceModeInfo.as_mut() } { - Some(m) => m, - None => { - break 's1 "目标路径没有 source mode info".to_string(); - } - }; - let old_w = mode_info.resolution.width; - let old_h = mode_info.resolution.height; - - log::info!( - "NVIDIA 分辨率变更: displayId={}, {}x{} → {}x{}", - display_id, - old_w, - old_h, - width, - height - ); - - mode_info.resolution.width = width; - mode_info.resolution.height = height; - - // ── Apply via NVAPI ── - let flags = NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE | NV_FORCE_COMMIT_VIDPN; - let s = unsafe { - NvAPI_DISP_SetDisplayConfig( - path_info_count, - path_infos.as_ptr(), - flags, - ) - }; - if s == NVAPI_OK { - log::info!("NVIDIA 分辨率已成功设为 {}x{} (NVAPI)", width, height); - return Ok(SetResolutionResult { applied: true, injected: false }); - } - - // NVAPI SetDisplayConfig failed — save error for fallback - format!( - "{} (code {})", - nvapi_error_string(s), - s - ) - }; - - // ── Strategy 2: Inject into NVIDIA NV_Modes registry + ChangeDisplaySettingsExW ── - log::warn!( - "NVAPI SetDisplayConfig 失败 ({}), 尝试注入 NV_Modes 注册表", - nvapi_err - ); - - let reg_inject_err = match inject_nv_modes_registry(&device_name, width, height) { - Ok(keys) => { - log::info!("NV_Modes 注册表注入成功: {} 个注册表项", keys.len()); - None - } - Err(e) => { - log::error!("NV_Modes 注册表注入失败: {}", e); - Some(e) - } - }; - - unsafe { - let wide_name: Vec = - device_name.encode_utf16().chain(std::iter::once(0)).collect(); - - // Get current display mode for dm struct - const ENUM_CURRENT_SETTINGS: u32 = 0xFFFFFFFF; - let mut dm: DEVMODEW = mem::zeroed(); - dm.dmSize = mem::size_of::() as u16; - let _enum_ok = - EnumDisplaySettingsW(wide_name.as_ptr(), ENUM_CURRENT_SETTINGS, &mut dm); - - // Set target resolution - const DM_PELSWIDTH: u32 = 0x00080000; - const DM_PELSHEIGHT: u32 = 0x00100000; - dm.dmPelsWidth = width; - dm.dmPelsHeight = height; - dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; - - let mut cds_result: i32 = -999; - - // Try ChangeDisplaySettingsExW with multiple flag combinations - const CDS_UPDATEREGISTRY: u32 = 0x00000001; - const CDS_ENABLE_UNSAFE_MODES: u32 = 0x00000100; - // Skip CDS_GLOBAL — it requires CDS_SET_PRIMARY and causes BADFLAGS - - let flag_sets: &[u32] = &[ - CDS_UPDATEREGISTRY | CDS_ENABLE_UNSAFE_MODES, - CDS_UPDATEREGISTRY, - 0, - ]; - - for &flags in flag_sets { - cds_result = ChangeDisplaySettingsExW( - wide_name.as_ptr(), - &dm, - std::ptr::null_mut(), - flags, - std::ptr::null_mut(), - ); - if cds_result == 0 { - log::info!( - "通过 NV_Modes 注入 + ChangeDisplaySettingsExW(flags={}) 成功设置分辨率 {}x{}", - flags, width, height - ); - return Ok(SetResolutionResult { applied: true, injected: false }); - } - log::warn!("ChangeDisplaySettingsExW(flags={}) 返回 DISP_CHANGE={}", flags, cds_result); - } - - // ── Strategy 3: Try SetDisplayConfig again (mode might now be in NV_Modes) ── - log::warn!( - "ChangeDisplaySettingsExW 失败 (DISP_CHANGE={}),重试 NVAPI SetDisplayConfig", - cds_result - ); - - // Re-read display config and try SetDisplayConfig again - let retry_result = retry_set_display_config(display_id, width, height); - if let Ok(()) = retry_result { - return Ok(SetResolutionResult { applied: true, injected: false }); - } - - // NV_Modes injection succeeded but mode can't be applied without restart - if reg_inject_err.is_none() { - log::info!("NV_Modes 注入成功,需要重启后应用新分辨率"); - if let Err(e) = save_injected_resolution(width, height) { - log::warn!("保存注入记录失败: {}", e); - } - return Ok(SetResolutionResult { applied: false, injected: true }); - } - - let reg_err_msg = reg_inject_err.unwrap_or_else(|| "注入成功但模式切换失败".to_string()); - Err(format!( - "所有方案均失败 — NVAPI SetDisplayConfig: {}; NV_Modes注入: {}; ChangeDisplaySettingsExW: DISP_CHANGE={}", - nvapi_err, reg_err_msg, cds_result - )) - } - } -} - -// --------------------------------------------------------------------------- -// Cleanup -// --------------------------------------------------------------------------- - -pub fn cleanup() { - if let Ok(mut guard) = NVAPI.lock() { - if let Some(state) = guard.take() { - unsafe { - NvAPI_DRS_DestroySession(state.session); - NvAPI_Unload(); - } - log::info!("NVAPI session cleaned up"); - } - } -} diff --git a/参考/NexBox-main/src-tauri/src/optimization.rs b/参考/NexBox-main/src-tauri/src/optimization.rs deleted file mode 100644 index a017a66..0000000 --- a/参考/NexBox-main/src-tauri/src/optimization.rs +++ /dev/null @@ -1,3185 +0,0 @@ -use std::os::windows::process::CommandExt; -use std::panic; -use std::process::Command; -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; -use std::{env, fs, path::Path, path::PathBuf}; -use sysinfo::System; -use tauri::Manager; -use winreg::enums::*; -use winreg::RegKey; -use windows_sys::Win32::Foundation::{CloseHandle, GetLastError, HANDLE}; -use windows_sys::Win32::System::Threading::{OpenProcess, SetPriorityClass}; - -pub(crate) const CREATE_NO_WINDOW: u32 = 0x08000000; - -fn get_powershell_path() -> String { - if let Ok(sysroot) = env::var("SystemRoot") { - let ps_path = format!(r"{}\System32\WindowsPowerShell\v1.0\powershell.exe", sysroot); - if Path::new(&ps_path).exists() { - return ps_path; - } - } - "powershell.exe".to_string() -} - -const PROCESS_SET_INFORMATION: u32 = 0x0200; -const PROCESS_QUERY_LIMITED_INFORMATION: u32 = 0x1000; -const IDLE_PRIORITY_CLASS: u32 = 0x00000040; -const BELOW_NORMAL_PRIORITY_CLASS: u32 = 0x00004000; -const PROCESS_MODE_BACKGROUND_BEGIN: u32 = 0x00100000; -const IO_PRIORITY_VERY_LOW: u32 = 0; -const PROCESS_MEMORY_PRIORITY_NEW: u32 = 0; -const PROCESS_MEMORY_PRIORITY_OLD: u32 = 11; -const MEMORY_PRIORITY_VERY_LOW: u32 = 1; - -#[link(name = "ntdll")] -extern "system" { - fn NtSetInformationProcess( - ProcessHandle: HANDLE, - ProcessInformationClass: u32, - ProcessInformation: *const std::ffi::c_void, - ProcessInformationSize: u32, - ) -> i32; -} - -extern "system" { - fn SetProcessInformation( - hProcess: HANDLE, - ProcessInformationClass: u32, - ProcessInformation: *const std::ffi::c_void, - ProcessInformationSize: u32, - ) -> i32; -} - -fn enable_process_efficiency_mode(pid: u32) -> bool { - unsafe { - let handle = OpenProcess( - PROCESS_SET_INFORMATION | PROCESS_QUERY_LIMITED_INFORMATION, - 0, - pid, - ); - if handle.is_null() { - return false; - } - - let mut applied = false; - - // 1) CPU: BELOW_NORMAL 优先级 - if SetPriorityClass(handle, BELOW_NORMAL_PRIORITY_CLASS) != 0 { - applied = true; - } - - // 2) 后台 I/O + 内存:先尝试 PROCESS_MODE_BACKGROUND_BEGIN(旧版 Win11) - if SetPriorityClass(handle, PROCESS_MODE_BACKGROUND_BEGIN) != 0 { - SetPriorityClass(handle, BELOW_NORMAL_PRIORITY_CLASS); - } else { - // Build 26200+:独立 API 逐项设置 - // I/O 优先级 → VeryLow - let io: u32 = IO_PRIORITY_VERY_LOW; - let nt = NtSetInformationProcess( - handle, - 33, - &io as *const _ as *const std::ffi::c_void, - std::mem::size_of::() as u32, - ); - if nt != 0 { - log::warn!("I/O priority failed (pid={}, nt={})", pid, nt); - } - - // 内存优先级 → VeryLow:新 SDK class=0,回退旧 SDK class=11 - let mem: u32 = MEMORY_PRIORITY_VERY_LOW; - let mut mem_ok = false; - for cls in &[PROCESS_MEMORY_PRIORITY_NEW, PROCESS_MEMORY_PRIORITY_OLD] { - if SetProcessInformation( - handle, - *cls, - &mem as *const _ as *const std::ffi::c_void, - std::mem::size_of::() as u32, - ) != 0 - { - mem_ok = true; - break; - } - } - if !mem_ok { - let err = GetLastError(); - log::warn!("Memory priority failed (pid={}, err={})", pid, err); - } - } - - CloseHandle(handle); - applied - } -} - -fn set_process_low_priority(pid: u32) -> bool { - unsafe { - let handle = OpenProcess(PROCESS_SET_INFORMATION, 0, pid); - if handle.is_null() { - return false; - } - - let ok = if SetPriorityClass(handle, IDLE_PRIORITY_CLASS) == 0 { - false - } else { - true - }; - - CloseHandle(handle); - ok - } -} - -fn run_bcdedit_admin(args: &str) -> Result { - let ps_script = format!( - "Start-Process bcdedit -ArgumentList '{}' -Verb RunAs -Wait -WindowStyle Hidden", - args - ); - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if output.status.success() { - Ok("命令执行成功".to_string()) - } else { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("执行失败: {}", stderr)) - } - } - Err(e) => Err(format!("执行命令失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct MemoryInfo { - total: u64, - available: u64, - used: u64, - usage_percent: f32, -} - -#[derive(serde::Serialize)] -pub struct OptimizationResult { - success: bool, - message: String, - before: MemoryInfo, - after: MemoryInfo, - freed_mb: u64, -} - -fn get_memory_info() -> MemoryInfo { - let mut sys = System::new_all(); - sys.refresh_all(); - - let total = sys.total_memory() / 1024 / 1024; - let available = sys.available_memory() / 1024 / 1024; - let used = total - available; - let usage_percent = if total > 0 { - (used as f32 / total as f32) * 100.0 - } else { - 0.0 - }; - - MemoryInfo { - total, - available, - used, - usage_percent, - } -} - -#[tauri::command] -pub async fn optimize_memory() -> Result { - let before = get_memory_info(); - - if cfg!(target_os = "windows") { - let result = Command::new("powershell") - .args(&[ - "-NoProfile", - "-ExecutionPolicy", "Bypass", - "-Command", - r#" - Add-Type -TypeDefinition @" - using System; - using System.Runtime.InteropServices; - public class Memory { - [DllImport("psapi.dll")] - public static extern bool EmptyWorkingSet(IntPtr hProcess); - [DllImport("kernel32.dll")] - public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId); - [DllImport("kernel32.dll")] - public static extern bool CloseHandle(IntPtr hObject); - } -"@ - $PROCESS_QUERY_INFORMATION = 0x0400 - $PROCESS_SET_QUOTA = 0x0100 - $access = $PROCESS_QUERY_INFORMATION -bor $PROCESS_SET_QUOTA - $freed = 0 - $processes = Get-Process -ErrorAction SilentlyContinue - foreach ($proc in $processes) { - try { - $handle = [Memory]::OpenProcess($access, $false, $proc.Id) - if ($handle -ne [IntPtr]::Zero) { - $wsBefore = $proc.WorkingSet64 - [Memory]::EmptyWorkingSet($handle) - [Memory]::CloseHandle($handle) | Out-Null - $proc.Refresh() - $wsAfter = $proc.WorkingSet64 - if ($wsBefore -gt $wsAfter) { - $freed += [math]::Round(($wsBefore - $wsAfter) / 1MB, 2) - } - } - } catch {} - } - Write-Host "Freed: $freed MB" - "# - ]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if output.status.success() { - std::thread::sleep(std::time::Duration::from_secs(1)); - let after = get_memory_info(); - let freed = if after.available > before.available { - after.available - before.available - } else { - 0 - }; - - Ok(OptimizationResult { - success: true, - message: format!("内存优化完成,释放约 {} MB", freed), - before, - after, - freed_mb: freed, - }) - } else { - let error_msg = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("内存优化失败: {}", error_msg)) - } - } - Err(e) => Err(format!("执行内存优化命令失败: {}", e)), - } - } else { - Err("内存优化仅支持 Windows 系统".to_string()) - } -} - -#[tauri::command] -pub async fn get_memory_status() -> Result { - Ok(get_memory_info()) -} - -#[derive(serde::Serialize)] -pub struct ProcessKillResult { - success: bool, - message: String, - process_name: String, - was_running: bool, -} - -#[tauri::command] -pub async fn kill_wallpaper_engine() -> Result { - let process_names = ["wallpaper64", "wallpaper32", "wallpaper_engine"]; - - if cfg!(target_os = "windows") { - let mut killed_any = false; - let mut killed_name = String::new(); - - for name in process_names { - let result = Command::new("powershell") - .args(&[ - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-Command", - &format!( - r#" - $process = Get-Process -Name "{}" -ErrorAction SilentlyContinue - if ($process) {{ - Stop-Process -Name "{}" -Force -ErrorAction SilentlyContinue - Write-Host "Killed: {}" - exit 0 - }} else {{ - Write-Host "Not running: {}" - exit 1 - }} - "#, - name, name, name, name - ), - ]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if output.status.success() { - killed_any = true; - killed_name = name.to_string(); - break; - } - } - Err(_) => continue, - } - } - - if killed_any { - Ok(ProcessKillResult { - success: true, - message: "Wallpaper Engine 进程已关闭".to_string(), - process_name: killed_name, - was_running: true, - }) - } else { - Ok(ProcessKillResult { - success: true, - message: "Wallpaper Engine 未在运行".to_string(), - process_name: String::new(), - was_running: false, - }) - } - } else { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[derive(serde::Serialize)] -pub struct PowerPlanResult { - success: bool, - message: String, - previous_plan: Option, - current_plan: String, -} - -/// 已知的高性能/Normal GUID(系统内置计划)。 -const KNOWN_HIGH_PERF_GUID: &str = "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"; - -/// 通过名称关键词匹配,在系统电源计划中查找高性能方案。 -fn find_high_performance_guid(plans: &[(String, String, bool)]) -> Option { - // 优先级:卓越性能 > 高性能/Ultimate - let candidates: &[&[&str]] = &[ - &["卓越性能", "Ultimate Performance"], - &["高性能", "High performance", "Ultimate"], - ]; - for keywords in candidates { - for (guid, name, _) in plans { - let lower = name.to_lowercase(); - if keywords.iter().any(|kw| lower.contains(&kw.to_lowercase())) { - return Some(guid.clone()); - } - } - } - None -} - -#[tauri::command] -pub async fn set_high_performance_power_plan() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - // 1. 记录当前计划(直接调 powercfg,不经过 PowerShell) - let previous_plan = get_active_plan_internal() - .map(|(guid, name)| format!("{} ({})", name, guid)); - - // 2. 枚举所有系统计划,尝试按名称匹配高性能方案 - let system_plans = get_system_plans_internal(); - let target_guid = find_high_performance_guid(&system_plans) - .unwrap_or_else(|| KNOWN_HIGH_PERF_GUID.to_string()); - - // 3. 直接调用 powercfg /setactive - let result = run_powercfg(&["/setactive", &target_guid]); - - match result { - Ok(output) if output.status.success() => { - // 4. 验证切换结果(直接调 powercfg) - let current_plan = match get_active_plan_internal() { - Some((guid, name)) => format!("{} ({})", name, guid), - None => "高性能".to_string(), - }; - - Ok(PowerPlanResult { - success: true, - message: "已切换到高性能电源计划".to_string(), - previous_plan, - current_plan, - }) - } - Ok(output) => { - let error_msg = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("切换电源计划失败: {}", error_msg)) - } - Err(e) => Err(format!("执行电源计划切换命令失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct AceOptimizeResult { - success: bool, - message: String, - optimized_processes: Vec, -} - -#[tauri::command] -pub async fn optimize_ace_processes() -> Result { - let process_names = ["ACE-Tray.exe", "SGuard64.exe", "SGuardSvc64.exe"]; - - if cfg!(target_os = "windows") { - let mut optimized_processes = Vec::new(); - - let ps_script = r#" - $processNames = @("ACE-Tray", "SGuard64", "SGuardSvc64") - $optimized = @() - - foreach ($name in $processNames) { - $processes = Get-Process -Name $name -ErrorAction SilentlyContinue - if ($processes) { - foreach ($proc in $processes) { - try { - # 设置优先级为最低 (Low = 64) - $proc.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::Low - - # 设置核心相关性为只使用 CPU0 (affinity = 1) - $proc.ProcessorAffinity = 1 - - $optimized += $proc.ProcessName - Write-Host "Optimized: $($proc.ProcessName)" - } catch { - Write-Host "Failed to optimize: $name - $_" - } - } - } - } - - if ($optimized.Count -gt 0) { - Write-Host "Optimized processes: $($optimized -join ', ')" - exit 0 - } else { - Write-Host "No ACE processes found" - exit 1 - } - "#; - - let result = Command::new("powershell") - .args(&[ - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-Command", - ps_script, - ]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - - for name in process_names { - let process_name = name.trim_end_matches(".exe"); - if stdout.contains(&format!("Optimized: {}", process_name)) { - optimized_processes.push(process_name.to_string()); - } - } - - if !optimized_processes.is_empty() { - Ok(AceOptimizeResult { - success: true, - message: format!("已优化 {} 个ACE进程", optimized_processes.len()), - optimized_processes, - }) - } else { - Ok(AceOptimizeResult { - success: true, - message: "未找到运行中的ACE进程".to_string(), - optimized_processes: vec![], - }) - } - } - Err(e) => Err(format!("执行ACE进程优化命令失败: {}", e)), - } - } else { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[derive(serde::Serialize)] -pub struct AceEfficiencyResult { - pub success: bool, - pub message: String, - pub count: u32, -} - -#[tauri::command] -pub async fn set_ace_efficiency_mode() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let process_names = ["ACE-Tray.exe", "SGuard64.exe", "SGuardSvc64.exe"]; - let mut count = 0u32; - - let mut system = System::new(); - system.refresh_processes(); - - for (_, process) in system.processes() { - let name = process.name().to_string(); - let name_lower = name.to_lowercase(); - if process_names.iter().any(|n| n.to_lowercase() == name_lower) { - if enable_process_efficiency_mode(process.pid().as_u32()) { - count += 1; - } - } - } - - Ok(AceEfficiencyResult { - success: count > 0, - message: if count > 0 { - format!("已为 {} 个 ACE 进程开启效能模式", count) - } else { - "未找到运行中的 ACE 进程".to_string() - }, - count, - }) -} - -#[derive(serde::Serialize)] -pub struct DnsFlushResult { - success: bool, - message: String, -} - -#[derive(serde::Serialize)] -pub struct TempCleanupResult { - success: bool, - message: String, - scanned_files: u64, - deleted_files: u64, - deleted_dirs: u64, - failed_items: u64, -} - -#[derive(serde::Serialize)] -pub struct PrivacyServiceOptimizeResult { - success: bool, - message: String, - stopped_services: Vec, -} - -fn clean_temp_dir(path: &Path) -> (u64, u64, u64, u64) { - let mut scanned_files = 0; - let mut deleted_files = 0; - let mut deleted_dirs = 0; - let mut failed_items = 0; - - let Ok(entries) = fs::read_dir(path) else { - return (0, 0, 0, 1); - }; - - for entry in entries.flatten() { - let entry_path = entry.path(); - if entry_path.is_dir() { - let (s, df, dd, f) = clean_temp_dir(&entry_path); - scanned_files += s; - deleted_files += df; - deleted_dirs += dd; - failed_items += f; - - match fs::remove_dir(&entry_path) { - Ok(_) => deleted_dirs += 1, - Err(_) => failed_items += 1, - } - } else { - scanned_files += 1; - match fs::remove_file(&entry_path) { - Ok(_) => deleted_files += 1, - Err(_) => failed_items += 1, - } - } - } - - (scanned_files, deleted_files, deleted_dirs, failed_items) -} - -#[tauri::command] -pub async fn clean_temp_files() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let mut temp_paths = Vec::new(); - if let Ok(user_temp) = env::var("TEMP") { - temp_paths.push(user_temp); - } - if let Ok(system_root) = env::var("SystemRoot") { - temp_paths.push(format!("{system_root}\\Temp")); - } - temp_paths.sort(); - temp_paths.dedup(); - - if temp_paths.is_empty() { - return Err("未找到可清理的临时目录".to_string()); - } - - let mut scanned_files = 0; - let mut deleted_files = 0; - let mut deleted_dirs = 0; - let mut failed_items = 0; - - for path in temp_paths { - let dir = Path::new(&path); - if !dir.exists() { - continue; - } - let (s, df, dd, f) = clean_temp_dir(dir); - scanned_files += s; - deleted_files += df; - deleted_dirs += dd; - failed_items += f; - } - - Ok(TempCleanupResult { - success: true, - message: format!("临时文件清理完成:删除 {} 个文件,{} 个目录", deleted_files, deleted_dirs), - scanned_files, - deleted_files, - deleted_dirs, - failed_items, - }) -} - -#[tauri::command] -pub async fn optimize_privacy_services() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let target_services = ["DiagTrack", "dmwappushservice", "diagnosticshub.standardcollector.service"]; - let mut stopped_services = Vec::new(); - - for service in target_services { - let result = Command::new("powershell") - .args(&[ - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-Command", - &format!( - r#" - $svc = Get-Service -Name "{}" -ErrorAction SilentlyContinue - if ($svc) {{ - if ($svc.Status -ne 'Stopped') {{ - Stop-Service -Name "{}" -Force -ErrorAction SilentlyContinue - Write-Host "Stopped: {}" - }} else {{ - Write-Host "AlreadyStopped: {}" - }} - }} else {{ - Write-Host "NotFound: {}" - }} - "#, - service, service, service, service, service - ), - ]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - if let Ok(output) = result { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - if stdout.contains(&format!("Stopped: {}", service)) - || stdout.contains(&format!("AlreadyStopped: {}", service)) - { - stopped_services.push(service.to_string()); - } - } - } - - Ok(PrivacyServiceOptimizeResult { - success: true, - message: format!("服务优化完成:已处理 {} 个服务", stopped_services.len()), - stopped_services, - }) -} - -#[tauri::command] -pub async fn flush_dns() -> Result { - if cfg!(target_os = "windows") { - let result = Command::new("ipconfig") - .args(&["/flushdns"]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if output.status.success() { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - if stdout.contains("successfully") || stdout.contains("成功") { - Ok(DnsFlushResult { - success: true, - message: "DNS 缓存已成功清理".to_string(), - }) - } else { - Ok(DnsFlushResult { - success: true, - message: "DNS 缓存清理完成".to_string(), - }) - } - } else { - let error_msg = String::from_utf8_lossy(&output.stderr).to_string(); - Err(format!("DNS 清理失败: {}", error_msg)) - } - } - Err(e) => Err(format!("执行 DNS 清理命令失败: {}", e)), - } - } else { - Err("此功能仅支持 Windows 系统".to_string()) - } -} - -#[derive(serde::Serialize, serde::Deserialize, Clone)] -pub struct MemoryLimitOption { - pub id: String, - pub label: String, - pub limit_gb: f64, - pub min_physical_gb: f64, -} - -#[derive(serde::Serialize)] -pub struct MemoryLimitStatus { - pub physical_memory_gb: f64, - pub physical_memory_mb: u64, - pub current_limit_mb: Option, - pub available_options: Vec, -} - -#[derive(serde::Serialize)] -pub struct MemoryLimitResult { - pub success: bool, - pub message: String, - pub limit_mb: Option, - pub requires_restart: bool, -} - -fn get_physical_memory_mb() -> u64 { - let mut sys = System::new_all(); - sys.refresh_all(); - sys.total_memory() / 1024 / 1024 -} - -fn get_memory_limit_options_internal() -> Vec { - vec![ - MemoryLimitOption { - id: "7.9gb".to_string(), - label: "7.9 GB".to_string(), - limit_gb: 7.9, - min_physical_gb: 0.0, - }, - MemoryLimitOption { - id: "11.9gb".to_string(), - label: "11.9 GB".to_string(), - limit_gb: 11.9, - min_physical_gb: 0.0, - }, - MemoryLimitOption { - id: "13.9gb".to_string(), - label: "13.9 GB".to_string(), - limit_gb: 13.9, - min_physical_gb: 0.0, - }, - MemoryLimitOption { - id: "15.9gb".to_string(), - label: "15.9 GB".to_string(), - limit_gb: 15.9, - min_physical_gb: 0.0, - }, - ] -} - -fn get_current_memory_limit() -> Option { - if !cfg!(target_os = "windows") { - return None; - } - - let result = Command::new("bcdedit") - .args(&["/enum", "{current}"]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - for line in stdout.lines() { - let lower_line = line.to_lowercase(); - if lower_line.contains("removememory") { - let parts: Vec<&str> = line.split_whitespace().collect(); - for part in parts.iter().rev() { - if let Ok(value) = part.parse::() { - return Some(value); - } - } - } - } - None - } - Err(_) => None, - } -} - -#[tauri::command] -pub async fn get_memory_limit_options() -> Vec { - get_memory_limit_options_internal() -} - -#[tauri::command] -pub async fn get_memory_limit_status() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let physical_memory_mb = get_physical_memory_mb(); - let physical_memory_gb = physical_memory_mb as f64 / 1024.0; - let current_limit_mb = get_current_memory_limit(); - let all_options = get_memory_limit_options_internal(); - - let available_options: Vec = all_options - .into_iter() - .filter(|opt| opt.min_physical_gb <= physical_memory_gb) - .collect(); - - Ok(MemoryLimitStatus { - physical_memory_gb, - physical_memory_mb, - current_limit_mb, - available_options, - }) -} - -#[tauri::command] -pub async fn set_memory_limit(limit_gb: f64) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let physical_memory_mb = get_physical_memory_mb(); - let physical_memory_gb = physical_memory_mb as f64 / 1024.0; - let limit_mb = (limit_gb * 1024.0) as u64; - - if limit_gb >= physical_memory_gb { - return Err(format!( - "限制值 ({:.1} GB) 不能大于或等于物理内存 ({:.1} GB)", - limit_gb, physical_memory_gb - )); - } - - let remove_mb = physical_memory_mb.saturating_sub(limit_mb); - let args = format!("/set \"{{current}}\" removememory {}", remove_mb); - - match run_bcdedit_admin(&args) { - Ok(_) => Ok(MemoryLimitResult { - success: true, - message: format!("内存限制已设置为 {:.1} GB,需要重启生效", limit_gb), - limit_mb: Some(limit_mb), - requires_restart: true, - }), - Err(e) => Err(format!("设置内存限制失败: {}。请以管理员身份运行应用。", e)), - } -} - -#[tauri::command] -pub async fn restore_memory_limit() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let args = "/deletevalue \"{current}\" removememory"; - - match run_bcdedit_admin(args) { - Ok(_) => Ok(MemoryLimitResult { - success: true, - message: "内存限制已恢复默认,需要重启生效".to_string(), - limit_mb: None, - requires_restart: true, - }), - Err(e) => Err(format!("恢复内存限制失败: {}。请以管理员身份运行应用。", e)), - } -} - -#[derive(serde::Serialize)] -pub struct DetailedMemoryInfo { - pub physical_total: u64, - pub physical_used: u64, - pub physical_available: u64, - pub virtual_total: u64, - pub virtual_used: u64, - pub virtual_available: u64, - pub working_set_total: u64, - pub working_set_used: u64, - pub working_set_available: u64, -} - -#[derive(serde::Serialize)] -pub struct MemoryCleanupResult { - pub success: bool, - pub message: String, - pub freed_mb: u64, -} - -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct AutoCleanConfig { - pub enabled: bool, - pub interval_seconds: u64, - pub threshold_mb: u64, - pub clean_type: String, -} - -use tauri_plugin_store::StoreExt; - -static AUTO_CLEAN_CONFIG: Mutex> = Mutex::new(None); -static AUTO_CLEAN_GENERATION: AtomicU64 = AtomicU64::new(0); - -#[tauri::command] -pub async fn get_detailed_memory_status() -> Result { - let mut sys = System::new_all(); - sys.refresh_all(); - - let physical_total = sys.total_memory() / 1024 / 1024; - let physical_available = sys.available_memory() / 1024 / 1024; - let physical_used = physical_total - physical_available; - - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = r#" - $os = Get-CimInstance Win32_OperatingSystem - $virtualTotal = [math]::Round($os.TotalVirtualMemorySize / 1024) - $virtualFree = [math]::Round($os.FreeVirtualMemory / 1024) - $virtualUsed = $virtualTotal - $virtualFree - $workingSet = [math]::Round(((Get-Process | Measure-Object WorkingSet64 -Sum -ErrorAction SilentlyContinue).Sum) / 1MB) - Write-Host "VTOTAL:$virtualTotal" - Write-Host "VFREE:$virtualFree" - Write-Host "VUSED:$virtualUsed" - Write-Host "WS:$workingSet" - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let mut virtual_total: u64 = 0; - let mut virtual_used: u64 = 0; - let mut virtual_available: u64 = 0; - let mut working_set_used: u64 = 0; - - for line in stdout.lines() { - if line.starts_with("VTOTAL:") { - virtual_total = line.trim_start_matches("VTOTAL:").trim().parse().unwrap_or(0); - } else if line.starts_with("VFREE:") { - virtual_available = line.trim_start_matches("VFREE:").trim().parse().unwrap_or(0); - } else if line.starts_with("VUSED:") { - virtual_used = line.trim_start_matches("VUSED:").trim().parse().unwrap_or(0); - } else if line.starts_with("WS:") { - working_set_used = line.trim_start_matches("WS:").trim().parse().unwrap_or(0); - } - } - - if virtual_available == 0 && virtual_total > 0 { - virtual_available = virtual_total - virtual_used; - } - - let working_set_total = sys.total_memory() / 1024 / 1024; - let working_set_available = if working_set_total > working_set_used { - working_set_total - working_set_used - } else { - 0 - }; - - Ok(DetailedMemoryInfo { - physical_total, - physical_used, - physical_available, - virtual_total, - virtual_used, - virtual_available, - working_set_total, - working_set_used, - working_set_available, - }) - } - Err(e) => Err(format!("获取内存状态失败: {}", e)), - } -} - -fn clean_standby_memory_inner() -> u64 { - let before = get_memory_info(); - - let ps_script = r#" - Add-Type -TypeDefinition @" - using System; - using System.Runtime.InteropServices; - public class Win32Mem { - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool SetProcessWorkingSetSize(IntPtr hProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize); - [DllImport("kernel32.dll")] - public static extern IntPtr GetCurrentProcess(); - } -"@ - $handle = [Win32Mem]::GetCurrentProcess() - [Win32Mem]::SetProcessWorkingSetSize($handle, -1, -1) | Out-Null - Start-Sleep -Milliseconds 500 - Write-Host "Done" - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(_) => { - std::thread::sleep(std::time::Duration::from_secs(1)); - let after = get_memory_info(); - if after.available > before.available { - after.available - before.available - } else { - 0 - } - } - Err(_) => 0, - } -} - -fn trim_working_set_inner() -> u64 { - let before = get_memory_info(); - - let ps_script = r#" - Add-Type -TypeDefinition @" - using System; - using System.Runtime.InteropServices; - public class Mem { - [DllImport("psapi.dll", SetLastError = true)] - public static extern bool EmptyWorkingSet(IntPtr hProcess); - [DllImport("kernel32.dll")] - public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId); - [DllImport("kernel32.dll")] - public static extern bool CloseHandle(IntPtr hObject); - } -"@ - $PROCESS_QUERY_INFORMATION = 0x0400 - $PROCESS_SET_QUOTA = 0x0100 - $access = $PROCESS_QUERY_INFORMATION -bor $PROCESS_SET_QUOTA - $freed = 0 - $processes = Get-Process -ErrorAction SilentlyContinue - foreach ($proc in $processes) { - try { - $handle = [Mem]::OpenProcess($access, $false, $proc.Id) - if ($handle -ne [IntPtr]::Zero) { - $wsBefore = $proc.WorkingSet64 - [Mem]::EmptyWorkingSet($handle) - [Mem]::CloseHandle($handle) | Out-Null - $proc.Refresh() - $wsAfter = $proc.WorkingSet64 - if ($wsBefore -gt $wsAfter) { - $freed += [math]::Round(($wsBefore - $wsAfter) / 1MB, 2) - } - } - } catch {} - } - Write-Host "Freed: $freed MB" - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(_) => { - std::thread::sleep(std::time::Duration::from_secs(2)); - let after = get_memory_info(); - if after.available > before.available { - after.available - before.available - } else { - 0 - } - } - Err(_) => 0, - } -} - -#[tauri::command] -pub async fn clean_standby_memory() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let freed = clean_standby_memory_inner(); - - Ok(MemoryCleanupResult { - success: true, - message: if freed > 0 { - format!("待机内存清理完成,释放 {} MB", freed) - } else { - "待机内存已清理".to_string() - }, - freed_mb: freed, - }) -} - -#[tauri::command] -pub async fn trim_system_working_set() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let freed = trim_working_set_inner(); - - Ok(MemoryCleanupResult { - success: true, - message: if freed > 0 { - format!("系统工作集已收紧,释放 {} MB", freed) - } else { - "系统工作集已收紧".to_string() - }, - freed_mb: freed, - }) -} - -fn auto_clean_loop(config: AutoCleanConfig, generation: u64) { - use std::time::Instant; - - const CHECK_INTERVAL_SECS: u64 = 5; - let mut last_clean_time = Instant::now(); - - loop { - if AUTO_CLEAN_GENERATION.load(Ordering::Relaxed) != generation { - break; - } - - thread::sleep(Duration::from_secs(CHECK_INTERVAL_SECS)); - - if AUTO_CLEAN_GENERATION.load(Ordering::Relaxed) != generation { - break; - } - - let mem_info = get_memory_info(); - let elapsed = last_clean_time.elapsed().as_secs(); - let interval_reached = elapsed >= config.interval_seconds; - let threshold_reached = mem_info.used >= config.threshold_mb; - - if interval_reached || threshold_reached { - match config.clean_type.as_str() { - "all" => { - clean_standby_memory_inner(); - trim_working_set_inner(); - } - "standby" => { - clean_standby_memory_inner(); - } - "working_set" => { - trim_working_set_inner(); - } - _ => {} - } - last_clean_time = Instant::now(); - } - } -} - -#[tauri::command] -pub async fn start_auto_clean(config: AutoCleanConfig) -> Result<(), String> { - let gen = AUTO_CLEAN_GENERATION.fetch_add(1, Ordering::Relaxed) + 1; - - let mut cfg = AUTO_CLEAN_CONFIG.lock().map_err(|e| e.to_string())?; - *cfg = Some(config.clone()); - drop(cfg); - - thread::spawn(move || { - auto_clean_loop(config, gen); - }); - - Ok(()) -} - -#[tauri::command] -pub async fn stop_auto_clean() -> Result<(), String> { - AUTO_CLEAN_GENERATION.fetch_add(1, Ordering::Relaxed); - let mut cfg = AUTO_CLEAN_CONFIG.lock().map_err(|e| e.to_string())?; - *cfg = None; - Ok(()) -} - -#[tauri::command] -pub async fn get_auto_clean_config() -> Result, String> { - let cfg = AUTO_CLEAN_CONFIG.lock().map_err(|e| e.to_string())?; - Ok(cfg.clone()) -} - -// ===== ACE 自动检测与优化 ===== - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default)] -pub struct AceAutoDetectConfig { - pub enabled: bool, -} - -#[derive(serde::Serialize, Clone, Debug, Default)] -pub struct AceAutoDetectStats { - pub is_running: bool, - pub last_check: Option, - pub total_optimized: u32, - pub currently_optimized: Vec, -} - -#[derive(serde::Serialize, Clone, Debug)] -pub struct AceAutoDetectStatus { - pub enabled: bool, - pub is_running: bool, - pub last_check: Option, - pub total_optimized: u32, - pub currently_optimized: Vec, -} - -static AUTO_DETECT_CONFIG: Mutex> = Mutex::new(None); -static AUTO_DETECT_GENERATION: AtomicU64 = AtomicU64::new(0); -static AUTO_DETECT_STATS: Mutex> = Mutex::new(None); - -// 内存中的 enabled 状态,避免 store 读取竞争 -static AUTO_DETECT_ENABLED: AtomicBool = AtomicBool::new(false); - -const ACE_PROCESS_NAMES: &[&str] = &["ACE-Tray.exe", "SGuard64.exe", "SGuardSvc64.exe"]; -const ACE_DETECT_INTERVAL_SECS: u64 = 5; - -fn update_auto_detect_stats(optimized: Vec) { - let mut stats = AUTO_DETECT_STATS.lock().unwrap(); - if stats.is_none() { - *stats = Some(AceAutoDetectStats::default()); - } - if let Some(ref mut s) = *stats { - s.is_running = true; - s.last_check = Some( - chrono::Local::now() - .to_rfc3339() - ); - s.total_optimized = s.total_optimized.saturating_add(optimized.len() as u32); - s.currently_optimized = optimized; - } -} - -fn set_auto_detect_running(running: bool) { - let mut stats = AUTO_DETECT_STATS.lock().unwrap(); - if let Some(ref mut s) = *stats { - s.is_running = running; - } -} - -fn detect_and_optimize_ace_processes() -> Vec { - let mut optimized = Vec::new(); - - let mut system = System::new(); - system.refresh_processes(); - - for (_, process) in system.processes() { - let name = process.name().to_string(); - let name_lower = name.to_lowercase(); - - if ACE_PROCESS_NAMES.iter().any(|n| n.to_lowercase() == name_lower) { - let mut this_optimized = false; - - // 1. 启用调度优化(BELOW_NORMAL 优先级 + I/O VeryLow + 低内存优先级) - if enable_process_efficiency_mode(process.pid().as_u32()) || set_process_low_priority(process.pid().as_u32()) { - this_optimized = true; - } - - // 2. 限制亲和性为 CPU0 (affinity = 1) - if restrict_process_affinity_powershell(&name) { - this_optimized = true; - } - - if this_optimized { - optimized.push(name); - } - } - } - - optimized -} - -fn restrict_process_affinity_powershell(process_name: &str) -> bool { - let name_without_ext = process_name.trim_end_matches(".exe"); - let ps_script = format!( - r#" - $proc = Get-Process -Name "{}" -ErrorAction SilentlyContinue - if ($proc) {{ - foreach ($p in $proc) {{ - try {{ - $p.ProcessorAffinity = 1 - Write-Host "AFFINITY_SET:{}" - }} catch {{ - Write-Host "AFFINITY_FAILED:{}" - }} - }} - exit 0 - }} else {{ - Write-Host "NOT_FOUND" - exit 1 - }} - "#, - name_without_ext, name_without_ext, name_without_ext - ); - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - stdout.contains("AFFINITY_SET") - } - Err(_) => false, - } -} - -fn ace_auto_detect_loop(config: AceAutoDetectConfig, generation: u64) { - // 启动时立即标记为运行中 - set_auto_detect_running(true); - - loop { - if AUTO_DETECT_GENERATION.load(Ordering::Relaxed) != generation { - break; - } - - thread::sleep(Duration::from_secs(ACE_DETECT_INTERVAL_SECS)); - - if AUTO_DETECT_GENERATION.load(Ordering::Relaxed) != generation { - break; - } - - if !config.enabled { - continue; - } - - let optimized = detect_and_optimize_ace_processes(); - update_auto_detect_stats(optimized); - } - set_auto_detect_running(false); -} - -async fn load_persisted_config(app: &tauri::AppHandle) -> AceAutoDetectConfig { - match app.store("ace_auto_detect.json") { - Ok(store) => { - if let Some(value) = store.get("config") { - if let Ok(config) = serde_json::from_value::(value) { - return config; - } - } - } - Err(e) => { - log::warn!("Failed to open ace_auto_detect store: {}", e); - } - } - AceAutoDetectConfig::default() -} - -async fn save_persisted_config(app: &tauri::AppHandle, config: &AceAutoDetectConfig) { - match app.store("ace_auto_detect.json") { - Ok(store) => { - store.set("config", serde_json::to_value(config).unwrap()); - if let Err(e) = store.save() { - log::error!("Failed to save ace_auto_detect config: {}", e); - } - } - Err(e) => { - log::error!("Failed to open ace_auto_detect store for saving: {}", e); - } - } -} - -#[tauri::command] -pub async fn set_ace_auto_detect(app: tauri::AppHandle, enabled: bool) -> Result<(), String> { - // 读取当前内存状态,避免重复操作 - let current = AUTO_DETECT_ENABLED.load(Ordering::Relaxed); - if current == enabled { - return Ok(()); // 状态未变,无需处理 - } - - let gen = AUTO_DETECT_GENERATION.fetch_add(1, Ordering::Relaxed) + 1; - - let config = AceAutoDetectConfig { enabled }; - - { - let mut cfg = AUTO_DETECT_CONFIG.lock().map_err(|e| e.to_string())?; - *cfg = Some(config.clone()); - } - - // 更新内存状态(立即生效,供 status 读取) - AUTO_DETECT_ENABLED.store(enabled, Ordering::Relaxed); - - // 持久化保存(异步,不阻塞) - save_persisted_config(&app, &config).await; - - if enabled { - thread::spawn(move || { - // 捕获 panic,防止线程意外退出 - let _ = panic::catch_unwind(|| { - ace_auto_detect_loop(config, gen); - }); - set_auto_detect_running(false); - }); - } else { - set_auto_detect_running(false); - } - - Ok(()) -} - -#[tauri::command] -pub async fn get_ace_auto_detect_status(_app: tauri::AppHandle) -> Result { - // 直接读取内存状态,避免 store 读取竞争 - let enabled = AUTO_DETECT_ENABLED.load(Ordering::Relaxed); - - let stats = AUTO_DETECT_STATS.lock().map_err(|e| e.to_string())?; - let stats = stats.clone().unwrap_or_default(); - - Ok(AceAutoDetectStatus { - enabled, - is_running: stats.is_running && enabled, - last_check: stats.last_check, - total_optimized: stats.total_optimized, - currently_optimized: stats.currently_optimized, - }) -} - -#[tauri::command] -pub async fn init_ace_auto_detect(app: tauri::AppHandle) -> Result<(), String> { - let config = load_persisted_config(&app).await; - - // 初始化内存状态 - AUTO_DETECT_ENABLED.store(config.enabled, Ordering::Relaxed); - - if config.enabled { - let gen = AUTO_DETECT_GENERATION.fetch_add(1, Ordering::Relaxed) + 1; - - { - let mut cfg = AUTO_DETECT_CONFIG.lock().map_err(|e| e.to_string())?; - *cfg = Some(config.clone()); - } - - thread::spawn(move || { - let _ = panic::catch_unwind(|| { - ace_auto_detect_loop(config, gen); - }); - set_auto_detect_running(false); - }); - } - - Ok(()) -} - -#[derive(serde::Serialize)] -pub struct ProcessOptimizeResult { - pub success: bool, - pub message: String, - pub process_name: String, - pub was_running: bool, -} - -#[tauri::command] -pub async fn boost_delta_force_priority() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = r#" - $proc = Get-Process -Name "DeltaForceClient-Win64-Shipping" -ErrorAction SilentlyContinue - if ($proc) { - $proc.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::RealTime - Write-Host "BOOSTED" - exit 0 - } else { - Write-Host "NOT_FOUND" - exit 1 - } - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - if stdout.contains("BOOSTED") { - Ok(ProcessOptimizeResult { - success: true, - message: "三角洲进程优先级已提升为「超高」(实时)".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: true, - }) - } else { - Ok(ProcessOptimizeResult { - success: false, - message: "三角洲游戏未运行,请先启动游戏".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: false, - }) - } - } - Err(e) => Err(format!("优化三角洲进程失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct PriorityResult { - pub success: bool, - pub message: String, - pub process_name: String, - pub was_running: bool, -} - -#[tauri::command] -pub async fn boost_delta_force_affinity() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = r#" - $proc = Get-Process -Name "DeltaForceClient-Win64-Shipping" -ErrorAction SilentlyContinue - if ($proc) { - $numCores = [Environment]::ProcessorCount - $allCores = [Math]::Pow(2, $numCores) - 1 - $affinity = $allCores -bxor 1 - $proc.ProcessorAffinity = $affinity - Write-Host "AFFINITY_SET" - exit 0 - } else { - Write-Host "NOT_FOUND" - exit 1 - } - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - if stdout.contains("AFFINITY_SET") { - Ok(PriorityResult { - success: true, - message: "三角洲进程已设置为使用所有处理器核心".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: true, - }) - } else { - Ok(PriorityResult { - success: false, - message: "三角洲游戏未运行,请先启动游戏".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: false, - }) - } - } - Err(e) => Err(format!("设置三角洲进程核心分配失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct AcePartialResult { - pub success: bool, - pub message: String, - pub count: u32, -} - -#[tauri::command] -pub async fn limit_ace_priority() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let process_names = ["ACE-Tray.exe", "SGuard64.exe", "SGuardSvc64.exe"]; - let mut count = 0u32; - - let mut system = System::new(); - system.refresh_processes(); - - for (_, process) in system.processes() { - let name = process.name().to_string(); - let name_lower = name.to_lowercase(); - if process_names.iter().any(|n| n.to_lowercase() == name_lower) { - if set_process_low_priority(process.pid().as_u32()) { - count += 1; - } - } - } - - Ok(AcePartialResult { - success: count > 0, - message: if count > 0 { - format!("已限制 {} 个 ACE 进程优先级", count) - } else { - "未找到运行中的 ACE 进程".to_string() - }, - count, - }) -} - -#[tauri::command] -pub async fn restrict_ace_affinity() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = r#" - $count = 0 - $processNames = @("ACE-Tray", "SGuard64", "SGuardSvc64") - foreach ($name in $processNames) { - $processes = Get-Process -Name $name -ErrorAction SilentlyContinue - if ($processes) { - foreach ($proc in $processes) { - try { - $proc.ProcessorAffinity = 1 - $count++ - } catch {} - } - } - } - Write-Host "RESTRICTED:$count" - if ($count -gt 0) { exit 0 } else { exit 1 } - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let count: u32 = stdout.lines() - .find_map(|l| l.strip_prefix("RESTRICTED:")) - .and_then(|s| s.trim().parse().ok()) - .unwrap_or(0); - Ok(AcePartialResult { - success: count > 0, - message: if count > 0 { format!("已限制 {} 个 ACE 进程使用单核心", count) } else { "未找到运行中的 ACE 进程".to_string() }, - count, - }) - } - Err(e) => Err(format!("限制 ACE 进程核心分配失败: {}", e)), - } -} - -#[tauri::command] -pub async fn boost_delta_force_affinity_with_mask(mask: u64) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = format!( - r#" - $proc = Get-Process -Name "DeltaForceClient-Win64-Shipping" -ErrorAction SilentlyContinue - if ($proc) {{ - $proc.ProcessorAffinity = {} - Write-Host "AFFINITY_SET" - exit 0 - }} else {{ - Write-Host "NOT_FOUND" - exit 1 - }} - "#, - mask - ); - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - if stdout.contains("AFFINITY_SET") { - Ok(PriorityResult { - success: true, - message: "三角洲进程已设置为使用指定处理器核心".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: true, - }) - } else { - Ok(PriorityResult { - success: false, - message: "三角洲游戏未运行,请先启动游戏".to_string(), - process_name: "DeltaForceClient-Win64-Shipping.exe".to_string(), - was_running: false, - }) - } - } - Err(e) => Err(format!("设置三角洲进程核心分配失败: {}", e)), - } -} - -#[tauri::command] -pub async fn restrict_ace_affinity_with_mask(mask: u64) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let ps_script = format!( - r#" - $count = 0 - $processNames = @("ACE-Tray", "SGuard64", "SGuardSvc64") - foreach ($name in $processNames) {{ - $processes = Get-Process -Name $name -ErrorAction SilentlyContinue - if ($processes) {{ - foreach ($proc in $processes) {{ - try {{ - $proc.ProcessorAffinity = {} - $count++ - }} catch {{}} - }} - }} - }} - Write-Host "RESTRICTED:$count" - if ($count -gt 0) {{ exit 0 }} else {{ exit 1 }} - "#, - mask - ); - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let count: u32 = stdout.lines() - .find_map(|l| l.strip_prefix("RESTRICTED:")) - .and_then(|s| s.trim().parse().ok()) - .unwrap_or(0); - Ok(AcePartialResult { - success: count > 0, - message: if count > 0 { format!("已限制 {} 个 ACE 进程使用指定核心", count) } else { "未找到运行中的 ACE 进程".to_string() }, - count, - }) - } - Err(e) => Err(format!("限制 ACE 进程核心分配失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct AllGameOptimizeResult { - pub success: bool, - pub message: String, - pub delta_boosted: bool, - pub ace_limited: bool, - pub ace_count: u32, -} - -#[tauri::command] -pub async fn optimize_all_game_processes() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let mut delta_boosted = false; - let mut ace_limited = false; - let mut ace_count: u32 = 0; - - let ps_script = r#" - $results = @{} - - $delta = Get-Process -Name "DeltaForceClient-Win64-Shipping" -ErrorAction SilentlyContinue - if ($delta) { - $delta.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::RealTime - $results["Delta"] = "BOOSTED" - } else { - $results["Delta"] = "NOT_FOUND" - } - - $aceProcesses = @("ACE-Tray", "SGuard64", "SGuardSvc64") - $aceDone = 0 - foreach ($name in $aceProcesses) { - $proc = Get-Process -Name $name -ErrorAction SilentlyContinue - if ($proc) { - $proc.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::Idle - $proc.ProcessorAffinity = [IntPtr]1 - $aceDone++ - } - } - $results["Ace"] = $aceDone - - $results.GetEnumerator() | ForEach-Object { Write-Host "$($_.Key):$($_.Value)" } - "#; - - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - for line in stdout.lines() { - if line.starts_with("Delta:BOOSTED") { - delta_boosted = true; - } - if line.starts_with("Ace:") { - ace_count = line.trim_start_matches("Ace:").trim().parse().unwrap_or(0); - ace_limited = ace_count > 0; - } - } - - let mut msgs: Vec = Vec::new(); - if delta_boosted { - msgs.push("三角洲: 已优化".to_string()); - } else { - msgs.push("三角洲: 未运行".to_string()); - } - if ace_limited { - msgs.push(format!("ACE: 已限制 {} 个进程", ace_count)); - } else { - msgs.push("ACE: 未运行".to_string()); - } - - Ok(AllGameOptimizeResult { - success: delta_boosted || ace_limited, - message: msgs.join(" | "), - delta_boosted, - ace_limited, - ace_count, - }) - } - Err(e) => Err(format!("全部游戏优化失败: {}", e)), - } -} - -#[derive(serde::Serialize, Clone)] -pub struct BuiltinPowerPlan { - pub id: String, - pub filename: String, - pub name: String, - pub description: String, - pub is_imported: bool, - pub guid: Option, - pub is_active: bool, -} - -#[derive(serde::Serialize)] -pub struct SystemPowerPlan { - pub guid: String, - pub name: String, - pub is_active: bool, -} - -#[derive(serde::Serialize)] -pub struct ActivePowerPlan { - pub guid: String, - pub name: String, -} - -#[derive(serde::Serialize)] -pub struct PowerPlanOperationResult { - pub success: bool, - pub message: String, - pub guid: Option, -} - -fn get_builtin_plan_filename(id: &str) -> String { - match id { - "ggOSDesktopGaming" => "ggOS Desktop Gaming.pow".to_string(), - _ => format!("{}.pow", id), - } -} - -fn get_builtin_plan_metadata(id: &str) -> (String, String) { - match id { - "ACMEPCAMD" => ("ACMEPCAMD".to_string(), "AMD平台极致性能优化,最大化CPU/GPU频率与响应".to_string()), - "AMD电源计划" => ("AMD电源计划".to_string(), "AMD官方推荐高性能电源方案,适合Ryzen平台".to_string()), - "ggOSDesktopGaming" => ("ggOS Desktop Gaming".to_string(), "桌面游戏场景深度优化,降低延迟提升帧率".to_string()), - "Intel大核心电源计划" => ("Intel大核心电源计划".to_string(), "Intel大小核调度优化,优先使用大核心运行游戏".to_string()), - "PowerX-v2" => ("PowerX v2".to_string(), "极致性能电源方案,最大化系统响应与游戏帧率".to_string()), - "卓越性能" => ("卓越性能".to_string(), "Windows 卓越性能电源计划,解锁最高性能模式".to_string()), - _ => (id.to_string(), String::new()), - } -} - -fn extract_guid_from_line(line: &str) -> Option { - let parts: Vec<&str> = line.split_whitespace().collect(); - for part in parts { - let segs: Vec<&str> = part.split('-').collect(); - if segs.len() == 5 - && segs[0].len() == 8 - && segs[1].len() == 4 - && segs[2].len() == 4 - && segs[3].len() == 4 - && segs[4].len() == 12 - && segs.iter().all(|s| s.chars().all(|c| c.is_ascii_hexdigit())) - { - return Some(part.to_string()); - } - } - None -} - -fn parse_powercfg_list(output: &str) -> Vec<(String, String, bool)> { - let mut plans = Vec::new(); - for line in output.lines() { - let trimmed = line.trim(); - if trimmed.is_empty() { - continue; - } - if let Some(guid) = extract_guid_from_line(trimmed) { - let is_active = trimmed.contains('*'); - let after_guid = trimmed.find(&guid).map(|pos| &trimmed[pos + guid.len()..]).unwrap_or(""); - let name = after_guid - .trim() - .trim_start_matches('(') - .trim_end_matches(')') - .trim() - .trim_end_matches('*') - .trim() - .to_string(); - plans.push((guid, name, is_active)); - } - } - plans -} - -/// 直接调用 powercfg.exe(通过 cmd 设置 UTF-8 代码页),避免 PowerShell 启动开销。 -/// `chcp 65001` 确保中文输出不乱码。 -fn run_powercfg(args: &[&str]) -> std::io::Result { - let powercfg_args = args.join(" "); - let full_cmd = format!("chcp 65001 >nul && powercfg {}", powercfg_args); - Command::new("cmd") - .args(&["/C", &full_cmd]) - .creation_flags(CREATE_NO_WINDOW) - .output() -} - -fn get_system_plans_internal() -> Vec<(String, String, bool)> { - let result = run_powercfg(&["/list"]); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - parse_powercfg_list(&stdout) - } - Err(_) => Vec::new(), - } -} - -fn get_active_plan_internal() -> Option<(String, String)> { - let result = run_powercfg(&["/getactivescheme"]); - - match result { - Ok(output) => { - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let trimmed = stdout.trim(); - if let Some(guid) = extract_guid_from_line(trimmed) { - let after_guid = trimmed.find(&guid).map(|pos| &trimmed[pos + guid.len()..]).unwrap_or(""); - let name = after_guid - .trim() - .trim_start_matches('(') - .trim_end_matches(')') - .trim() - .to_string(); - Some((guid, name)) - } else { - None - } - } - Err(_) => None, - } -} - -fn find_plan_guid_by_name(system_plans: &[(String, String, bool)], plan_name: &str) -> Option { - for (guid, name, _) in system_plans { - if name.contains(plan_name) { - return Some(guid.clone()); - } - // 去掉末尾括号内的作者/后缀信息再匹配 - // 例如 "英特尔-KF系列提升平均帧计划(毒药制作" -> "英特尔-KF系列提升平均帧计划" - if let Some(pos) = name.rfind('(') { - let base_name = name[..pos].trim(); - if base_name.contains(plan_name) || plan_name.contains(base_name) { - return Some(guid.clone()); - } - } - } - None -} - -fn resolve_power_plans_dir(app: &tauri::AppHandle) -> Option { - if let Ok(resource_dir) = app.path().resource_dir() { - let candidates = [ - resource_dir.join("power-plans"), - resource_dir.join("_up_").join("power-plans"), - ]; - for path in &candidates { - if path.exists() { - return Some(path.clone()); - } - } - } - - if let Ok(exe_path) = std::env::current_exe() { - if let Some(parent) = exe_path.parent() { - let candidates = [ - parent.join("power-plans"), - parent.join("_up_").join("power-plans"), - ]; - for path in &candidates { - if path.exists() { - return Some(path.clone()); - } - } - } - } - - None -} - -#[tauri::command] -pub async fn get_builtin_power_plans(app: tauri::AppHandle) -> Result, String> { - let power_plans_dir = resolve_power_plans_dir(&app) - .ok_or("未找到电源计划文件目录,请确保 power-plans 文件夹存在")?; - - let system_plans = get_system_plans_internal(); - let active_plan = get_active_plan_internal(); - let active_guid = active_plan.as_ref().map(|(g, _)| g.as_str()).unwrap_or(""); - - let builtin_ids = ["ACMEPCAMD", "AMD电源计划", "ggOSDesktopGaming", "Intel大核心电源计划", "PowerX-v2", "卓越性能"]; - - let mut plans = Vec::new(); - - for id in builtin_ids { - let (display_name, description) = get_builtin_plan_metadata(id); - let filename = get_builtin_plan_filename(id); - let file_path = power_plans_dir.join(&filename); - let file_exists = file_path.exists(); - - let (is_imported, guid, is_active) = if file_exists { - let matched_guid = find_plan_guid_by_name(&system_plans, &display_name); - let active = matched_guid.as_ref().map(|g| g == active_guid).unwrap_or(false); - (matched_guid.is_some(), matched_guid, active) - } else { - (false, None, false) - }; - - plans.push(BuiltinPowerPlan { - id: id.to_string(), - filename, - name: display_name.to_string(), - description: description.to_string(), - is_imported, - guid, - is_active, - }); - } - - Ok(plans) -} - -#[tauri::command] -pub async fn get_system_power_plans() -> Result, String> { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let plans = get_system_plans_internal(); - Ok(plans.into_iter().map(|(guid, name, is_active)| SystemPowerPlan { guid, name, is_active }).collect()) -} - -#[tauri::command] -pub async fn get_active_power_plan() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - match get_active_plan_internal() { - Some((guid, name)) => Ok(ActivePowerPlan { guid, name }), - None => Err("获取当前电源计划失败".to_string()), - } -} - -#[tauri::command] -pub async fn import_power_plan(app: tauri::AppHandle, plan_id: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let (display_name, _) = get_builtin_plan_metadata(&plan_id); - - let system_plans_before = get_system_plans_internal(); - let guids_before: Vec = system_plans_before.iter().map(|(g, _, _)| g.clone()).collect(); - - if let Some(existing_guid) = find_plan_guid_by_name(&system_plans_before, &display_name) { - return Ok(PowerPlanOperationResult { - success: true, - message: format!("电源计划 '{}' 已存在于系统中", display_name), - guid: Some(existing_guid), - }); - } - - let power_plans_dir = resolve_power_plans_dir(&app) - .ok_or("未找到电源计划文件目录")?; - let file_path = power_plans_dir.join(get_builtin_plan_filename(&plan_id)); - - if !file_path.exists() { - return Err(format!("电源计划文件不存在: {}", plan_id)); - } - - let file_path_str = file_path.to_string_lossy().to_string(); - let result = Command::new("powercfg") - .args(["/import", &file_path_str]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else if !stdout.trim().is_empty() { stdout.trim().to_string() } else { "未知错误".to_string() }; - return Err(format!("导入电源计划失败: {}", err_msg)); - } - - std::thread::sleep(std::time::Duration::from_millis(800)); - - let system_plans_after = get_system_plans_internal(); - - let mut new_guid: Option = None; - for (guid, _, _) in &system_plans_after { - if !guids_before.contains(guid) { - new_guid = Some(guid.clone()); - break; - } - } - - if let Some(guid) = new_guid { - Ok(PowerPlanOperationResult { - success: true, - message: format!("电源计划 '{}' 导入成功", display_name), - guid: Some(guid), - }) - } else if let Some(guid) = find_plan_guid_by_name(&system_plans_after, &display_name) { - Ok(PowerPlanOperationResult { - success: true, - message: format!("电源计划 '{}' 导入成功", display_name), - guid: Some(guid), - }) - } else { - Err(format!("电源计划 '{}' 导入后未在系统中找到,可能导入失败", display_name)) - } - } - Err(e) => Err(format!("执行导入命令失败: {}", e)), - } -} - -#[tauri::command] -pub async fn activate_power_plan(guid: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let result = Command::new("powercfg") - .args(["/setactive", &guid]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if output.status.success() { - std::thread::sleep(std::time::Duration::from_millis(500)); - let verify = get_active_plan_internal(); - match verify { - Some((active_guid, active_name)) => { - if active_guid == guid { - Ok(PowerPlanOperationResult { - success: true, - message: format!("电源计划 '{}' 已激活", active_name), - guid: Some(guid), - }) - } else { - Ok(PowerPlanOperationResult { - success: true, - message: "激活命令已执行,请确认是否生效".to_string(), - guid: Some(guid), - }) - } - } - None => Ok(PowerPlanOperationResult { - success: true, - message: "激活命令已执行".to_string(), - guid: Some(guid), - }), - } - } else { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else if !stdout.trim().is_empty() { stdout.trim().to_string() } else { "未知错误".to_string() }; - Err(format!("激活电源计划失败: {}", err_msg)) - } - } - Err(e) => Err(format!("执行激活命令失败: {}", e)), - } -} - -#[tauri::command] -pub async fn import_and_activate_power_plan(app: tauri::AppHandle, plan_id: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let (display_name, _) = get_builtin_plan_metadata(&plan_id); - - let system_plans_before = get_system_plans_internal(); - let guids_before: Vec = system_plans_before.iter().map(|(g, _, _)| g.clone()).collect(); - let existing_guid = find_plan_guid_by_name(&system_plans_before, &display_name); - - let (guid, was_existing) = match existing_guid { - Some(g) => (g, true), - None => { - let power_plans_dir = resolve_power_plans_dir(&app) - .ok_or("未找到电源计划文件目录")?; - let file_path = power_plans_dir.join(get_builtin_plan_filename(&plan_id)); - - if !file_path.exists() { - return Err(format!("电源计划文件不存在: {}", plan_id)); - } - - let file_path_str = file_path.to_string_lossy().to_string(); - let import_result = Command::new("powercfg") - .args(["/import", &file_path_str]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - let g = match import_result { - Ok(output) => { - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else if !stdout.trim().is_empty() { stdout.trim().to_string() } else { "未知错误".to_string() }; - return Err(format!("导入失败: {}", err_msg)); - } - std::thread::sleep(std::time::Duration::from_millis(800)); - let system_plans_after = get_system_plans_internal(); - - let mut new_guid: Option = None; - for (guid, _, _) in &system_plans_after { - if !guids_before.contains(guid) { - new_guid = Some(guid.clone()); - break; - } - } - - if let Some(g) = new_guid { - g - } else if let Some(g) = find_plan_guid_by_name(&system_plans_after, &display_name) { - g - } else { - return Err(format!("电源计划 '{}' 导入后未在系统中找到,可能导入失败", display_name)); - } - } - Err(e) => return Err(format!("导入失败: {}", e)), - }; - (g, false) - } - }; - - let activate_result = activate_power_plan(guid.clone()).await?; - Ok(PowerPlanOperationResult { - success: true, - message: if was_existing { - format!("电源计划 '{}' 已存在,{}", display_name, activate_result.message) - } else { - format!("电源计划 '{}' 导入并激活成功", display_name) - }, - guid: Some(guid), - }) -} - -#[derive(serde::Serialize)] -pub struct PerfTweakResult { - pub success: bool, - pub message: String, -} - -/// 通用 PowerShell 脚本执行工具:将脚本写入临时 .ps1 文件并通过 -File 参数执行, -/// 避免 Windows 命令行长度限制(错误 206)。 -fn run_ps_script(script: &str) -> Result { - let ps_path = get_powershell_path(); - let tmp_dir = std::env::temp_dir(); - let script_path = tmp_dir.join(format!("nexbox_{}.ps1", std::process::id())); - fs::write(&script_path, script).map_err(|e| format!("写入临时脚本失败: {}", e))?; - let result = Command::new(&ps_path) - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", &script_path.to_string_lossy()]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行命令失败: {}", e)); - let _ = fs::remove_file(&script_path); - result -} - -/// 执行 PowerShell 脚本并返回统一结果,自动处理权限错误 -pub(crate) fn run_simple_feature(script: &str) -> Result { - let result = run_ps_script(script)?; - if result.status.success() { - Ok(PerfTweakResult { success: true, message: "操作成功".to_string() }) - } else { - let stderr = String::from_utf8_lossy(&result.stderr).to_string(); - let stdout = String::from_utf8_lossy(&result.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else { stdout.trim().to_string() }; - let lower = err_msg.to_lowercase(); - if lower.contains("access denied") || lower.contains("denied") || lower.contains("拒绝访问") || lower.contains("权限不足") { - Err("需要管理员权限,请以管理员身份运行 NexBox".to_string()) - } else { - Err(format!("操作失败: {}", err_msg)) - } - } -} - -// === Windows Update Disable/Enable (Pure Rust, no PowerShell) === - -/// Convert a Rust string to a null-terminated wide string for Windows API calls. -fn to_wide(s: &str) -> Vec { - s.encode_utf16().chain(std::iter::once(0)).collect() -} - -/// Helper: clear failure actions for a service (prevents auto-restart/reboot). -/// Uses sc.exe to reset failure actions. -fn clear_service_failure_actions(service_name: &str) -> Result<(), String> { - // sc.exe failure reset=0 actions="" - let result = std::process::Command::new("sc.exe") - .args(&["failure", service_name, "reset=", "0", "actions=", ""]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行 sc.exe 失败: {}", e))?; - - if !result.status.success() { - let err = String::from_utf8_lossy(&result.stderr); - if !err.trim().is_empty() && !err.contains("FAIL") { - // Non-fatal for some services - log::info!("sc.exe failure {} 输出: {}", service_name, err.trim()); - } - } - Ok(()) -} - -/// Helper: grant Administrators write access to a protected service registry key. -/// Uses PowerShell .NET API to take ownership and grant access (the only reliable way -/// for ACL-protected keys like wuauserv). -fn grant_service_key_access(service_name: &str) -> Result<(), String> { - let ps_script = format!( - r#" - $key = [Microsoft.Win32.Registry]::LocalMachine.OpenSubkey('SYSTEM\CurrentControlSet\Services\{}', [Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree, [System.Security.AccessControl.RegistryRights]::TakeOwnership) - $acl = $key.GetAccessControl() - $me = [System.Security.Principal.NTAccount]'Administrators' - $acl.SetOwner($me) - $key.SetAccessControl($acl) - $acl = $key.GetAccessControl() - $rule = New-Object System.Security.AccessControl.RegistryAccessRule($me, 'FullControl', 'ContainerInherit', 'None', 'Allow') - $acl.SetAccessRule($rule) - $key.SetAccessControl($acl) - $key.Close() - "#, - service_name - ); - - let output = std::process::Command::new("powershell.exe") - .args(&["-NoProfile", "-NonInteractive", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行 PowerShell 权限获取失败: {}", e))?; - - if !output.status.success() { - let err = String::from_utf8_lossy(&output.stderr); - let out = String::from_utf8_lossy(&output.stdout); - let msg = if err.trim().is_empty() { out.trim() } else { err.trim() }; - log::warn!("grant_service_key_access {} 输出: {}", service_name, msg); - // Don't fail — try reg add anyway - } - Ok(()) -} - -/// Helper: set a service start type via reg.exe with PowerShell ownership fallback. -/// start_type: 2=auto, 3=demand, 4=disabled -fn set_service_start_reg(service_name: &str, start_type: u32) -> Result<(), String> { - // First try: direct reg add - let cmd = format!( - "reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\{}\" /v Start /t REG_DWORD /d {} /f", - service_name, start_type - ); - let output = std::process::Command::new("cmd.exe") - .args(&["/c", &cmd]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行 cmd/reg 失败: {}", e))?; - - if output.status.success() { - return Ok(()); - } - - // First try failed — take ownership via PowerShell .NET API and retry - log::info!("reg add 直接写入失败,尝试获取注册表键所有权..."); - let _ = grant_service_key_access(service_name); - - // Retry reg add after taking ownership - let output2 = std::process::Command::new("cmd.exe") - .args(&["/c", &cmd]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行 cmd/reg (retry) 失败: {}", e))?; - - if !output2.status.success() { - let err = String::from_utf8_lossy(&output2.stderr); - let out = String::from_utf8_lossy(&output2.stdout); - let msg = if err.trim().is_empty() { out.trim() } else { err.trim() }; - log::error!("设置服务 {} Start={} 最终失败: {}", service_name, start_type, msg); - // Return Ok anyway — non-fatal, the policy + schtasks still apply - return Ok(()); - } - log::info!("服务 {} Start={} 设置成功 (retry)", service_name, start_type); - Ok(()) -} - -/// Helper: control a service (stop/start). -unsafe fn control_service(service_name: &str, control: u32) -> Result<(), String> { - use windows_sys::Win32::System::Services::{ - OpenSCManagerW, OpenServiceW, ControlService, CloseServiceHandle, StartServiceW, - QueryServiceStatus, - SC_MANAGER_CONNECT, SERVICE_STOP, SERVICE_START, - SERVICE_QUERY_STATUS, SERVICE_STOPPED, - SERVICE_CONTROL_STOP, - }; - - let scm = OpenSCManagerW(std::ptr::null(), std::ptr::null(), SC_MANAGER_CONNECT); - if scm.is_null() { - return Err(format!("无法打开 SCM (服务控制)")); - } - - let svc_name = to_wide(service_name); - let access = if control == SERVICE_CONTROL_STOP { SERVICE_STOP | SERVICE_QUERY_STATUS } - else { SERVICE_START | SERVICE_QUERY_STATUS }; - let svc = OpenServiceW(scm, svc_name.as_ptr(), access); - if svc.is_null() { - CloseServiceHandle(scm); - // Service not found or not accessible – not fatal for disable - return Ok(()); - } - - if control == SERVICE_CONTROL_STOP { - // Query status first to see if it's running - let mut status: windows_sys::Win32::System::Services::SERVICE_STATUS = std::mem::zeroed(); - let qs_ret = QueryServiceStatus(svc, &mut status); - if qs_ret != 0 && status.dwCurrentState != SERVICE_STOPPED { - let mut s = std::mem::zeroed(); - ControlService(svc, SERVICE_CONTROL_STOP, &mut s); - } - } else { - // Start - StartServiceW(svc, 0, std::ptr::null_mut()); - } - - CloseServiceHandle(svc); - CloseServiceHandle(scm); - Ok(()) -} - -/// Helper: kill a process by name. -fn kill_process(name: &str) { - let _ = std::process::Command::new("taskkill") - .args(&["/f", "/im", name]) - .creation_flags(CREATE_NO_WINDOW) - .output(); -} - -/// Helper: run schtasks to disable or enable Windows Update scheduled tasks. -fn schtasks_wu_tasks(enable: bool) -> Result<(), String> { - let action = if enable { "/enable" } else { "/disable" }; - - // Dynamically enumerate all tasks under \Microsoft\Windows\WindowsUpdate - let output = std::process::Command::new("cmd.exe") - .args(&["/c", "schtasks /query /fo csv /nh"]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .map_err(|e| format!("执行 schtasks /query 失败: {}", e))?; - - let out = String::from_utf8_lossy(&output.stdout); - let mut task_names: Vec = Vec::new(); - - for line in out.lines() { - // CSV format: "TaskName","Next Run Time","Status" - if line.to_lowercase().contains("windowsupdate") { - // Extract task name from CSV (first field) - if let Some(name) = line.split(',').next() { - let name = name.trim().trim_matches('"'); - if !name.is_empty() { - task_names.push(name.to_string()); - } - } - } - } - - log::info!("找到 {} 个 WindowsUpdate 计划任务: {:?}", task_names.len(), task_names); - - if task_names.is_empty() { - log::warn!("未找到任何 WindowsUpdate 计划任务,跳过"); - return Ok(()); - } - - for task_path in &task_names { - let result = std::process::Command::new("schtasks") - .args(&["/change", "/tn", task_path, action]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - let out_str = String::from_utf8_lossy(&output.stdout); - let err_str = String::from_utf8_lossy(&output.stderr); - if output.status.success() { - log::info!("schtasks {} {} -> 成功", action, task_path); - } else { - log::warn!("schtasks {} {} -> {} {}", action, task_path, out_str.trim(), err_str.trim()); - } - } - Err(e) => { - log::error!("schtasks 调用失败: {}", e); - } - } - } - - Ok(()) -} - -/// Check if any WU scheduled task is disabled. -fn check_schtasks_wu_disabled() -> bool { - // Use PowerShell Get-ScheduledTask — State enum values are always English - let ps_script = r#" - $tasks = Get-ScheduledTask -TaskPath '\Microsoft\Windows\WindowsUpdate\*' -ErrorAction SilentlyContinue - $disabled = $tasks | Where-Object { $_.State -eq 'Disabled' } - if ($disabled) { Write-Output 'YES' } else { Write-Output 'NO' } - "#; - let output = std::process::Command::new("powershell.exe") - .args(&["-NoProfile", "-NonInteractive", "-Command", ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - if let Ok(out) = output { - let text = String::from_utf8_lossy(&out.stdout); - return text.trim().eq_ignore_ascii_case("YES"); - } - false -} - -#[tauri::command] -pub async fn disable_windows_update() -> Result { - log::info!("开始关闭 Windows Update..."); - - // 1. Stop services - let services = ["wuauserv", "UsoSvc", "WaaSMedicSvc"]; - for svc in &services { - log::info!("停止服务: {}", svc); - unsafe { - control_service(svc, windows_sys::Win32::System::Services::SERVICE_CONTROL_STOP) - .unwrap_or_else(|e| log::error!("停止服务 {} 失败: {}", svc, e)); - } - } - - // 2. Kill UsoClient.exe - log::info!("终止 UsoClient.exe 进程"); - kill_process("UsoClient.exe"); - - // 3. Set service start types to disabled (4) via registry (bypass SCM protection) - for svc in &services { - log::info!("禁用服务启动: {}", svc); - set_service_start_reg(svc, 4) - .unwrap_or_else(|e| log::error!("禁用 {} 服务启动失败: {}", svc, e)); - // Verify the write - let after = get_service_start(svc); - log::info!("服务 {} 写入后 Start = {:?}", svc, after); - clear_service_failure_actions(svc) - .unwrap_or_else(|e| log::error!("清空失败恢复 {} 失败: {}", svc, e)); - } - - // 4. Registry: Set NoAutoUpdate=1, AUOptions=1 - log::info!("设置注册表策略: NoAutoUpdate, AUOptions"); - let hklm = winreg::RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE); - let (wu_key, _) = hklm.create_subkey( - r"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" - ).map_err(|e| format!("创建/打开注册表键失败: {}", e))?; - wu_key.set_value("NoAutoUpdate", &1u32).map_err(|e| format!("设置 NoAutoUpdate 失败: {}", e))?; - wu_key.set_value("AUOptions", &1u32).map_err(|e| format!("设置 AUOptions 失败: {}", e))?; - - // Optional: DisableWindowsUpdateAccess for Pro/Enterprise - let (wu_policy_key, _) = hklm.create_subkey( - r"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" - ).map_err(|e| format!("创建 WindowsUpdate 策略键失败: {}", e))?; - wu_policy_key.set_value("DisableWindowsUpdateAccess", &1u32) - .unwrap_or_else(|e| log::info!("DisableWindowsUpdateAccess 设置跳过(非 Pro/Enterprise 系统): {}", e)); - - // 5. Disable scheduled tasks - log::info!("禁用 Windows Update 计划任务"); - schtasks_wu_tasks(false)?; - - log::info!("Windows Update 关闭完成"); - Ok("ok".to_string()) -} - -#[tauri::command] -pub async fn enable_windows_update() -> Result { - log::info!("开始恢复 Windows Update..."); - - // 1. Restore service start types via registry: wuauserv=3 (demand), UsoSvc=2 (auto), WaaSMedicSvc=2 (auto) - let services_config = [ - ("wuauserv", 3u32), - ("UsoSvc", 2u32), - ("WaaSMedicSvc", 2u32), - ]; - - for (svc, start_type) in &services_config { - log::info!("恢复服务启动类型: {} -> {}", svc, start_type); - set_service_start_reg(svc, *start_type) - .unwrap_or_else(|e| log::error!("恢复 {} 服务启动类型失败: {}", svc, e)); - } - - // 2. Registry: Delete policy keys - log::info!("删除注册表策略键值"); - let hklm = winreg::RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE); - - // Delete NoAutoUpdate and AUOptions - if let Ok(wu_key) = hklm.open_subkey_with_flags( - r"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", - winreg::enums::KEY_SET_VALUE - ) { - let _ = wu_key.delete_value("NoAutoUpdate"); - let _ = wu_key.delete_value("AUOptions"); - } - - // Delete DisableWindowsUpdateAccess - if let Ok(wu_policy_key) = hklm.open_subkey_with_flags( - r"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", - winreg::enums::KEY_SET_VALUE - ) { - let _ = wu_policy_key.delete_value("DisableWindowsUpdateAccess"); - } - - // 3. Enable scheduled tasks - log::info!("启用 Windows Update 计划任务"); - schtasks_wu_tasks(true)?; - - log::info!("Windows Update 恢复完成"); - Ok("ok".to_string()) -} - -/// Check service Start value via registry (simpler and more reliable than SCM query). -fn get_service_start(service_name: &str) -> Option { - // Use reg query via cmd.exe for reliable reading of ACL-protected keys - let output = std::process::Command::new("cmd.exe") - .args(&[ - "/c", - &format!( - "reg query \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\{}\" /v Start", - service_name - ), - ]) - .creation_flags(CREATE_NO_WINDOW) - .output() - .ok()?; - - let out = String::from_utf8_lossy(&output.stdout); - // Parse: " Start REG_DWORD 0x4" - for line in out.lines() { - let line = line.trim(); - if line.contains("Start") && line.contains("REG_DWORD") { - let parts: Vec<&str> = line.split_whitespace().collect(); - if let Some(last) = parts.last() { - if let Ok(v) = u32::from_str_radix(last.trim_start_matches("0x"), 16) { - return Some(v); - } - } - } - } - None -} - -#[tauri::command] -pub async fn check_windows_update_state() -> Result { - let services_to_check = ["wuauserv", "UsoSvc", "WaaSMedicSvc"]; - let services_disabled = services_to_check.iter().all(|svc| { - get_service_start(svc).map_or(false, |st| st == 4) - }); - - // Check registry: NoAutoUpdate == 1? - let hklm = winreg::RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE); - let policy_set = hklm.open_subkey( - r"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" - ).and_then(|key| { - key.get_value::("NoAutoUpdate") - }).map_or(false, |v| v == 1); - - let scheduler_disabled = check_schtasks_wu_disabled(); - let all_disabled = services_disabled && policy_set && scheduler_disabled; - - let result = serde_json::json!({ - "services_disabled": services_disabled, - "policy_set": policy_set, - "scheduler_disabled": scheduler_disabled, - "all_disabled": all_disabled, - }); - - Ok(result) -} - -#[tauri::command] -pub async fn delete_power_plan(guid: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let active_plan = get_active_plan_internal(); - if let Some((active_guid, _)) = active_plan { - if active_guid == guid { - return Err("无法删除当前激活的电源计划,请先切换到其他计划".to_string()); - } - } - - let result = Command::new("powercfg") - .args(["/delete", &guid]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => { - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let err_msg = if !stderr.trim().is_empty() { stderr.trim().to_string() } else if !stdout.trim().is_empty() { stdout.trim().to_string() } else { "未知错误".to_string() }; - return Err(format!("删除电源计划失败: {}", err_msg)); - } - - std::thread::sleep(std::time::Duration::from_millis(500)); - - let system_plans = get_system_plans_internal(); - let still_exists = system_plans.iter().any(|(g, _, _)| g == &guid); - - if still_exists { - Err("电源计划删除可能未生效,请确认是否具有管理员权限".to_string()) - } else { - Ok(PowerPlanOperationResult { - success: true, - message: "电源计划已删除".to_string(), - guid: None, - }) - } - } - Err(e) => Err(format!("执行删除命令失败: {}", e)), - } -} - -#[derive(serde::Serialize)] -pub struct PeripheralStatus { - pub mouse_value: Option, - pub keyboard_value: Option, -} - -#[tauri::command] -pub async fn get_peripheral_status() -> Result { - let script = r#" -$ErrorActionPreference = 'SilentlyContinue' -$mouse = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl' -Name 'Win32PrioritySeparation' -ErrorAction SilentlyContinue -$keyboard = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters' -Name 'KeyboardDataQueueSize' -ErrorAction SilentlyContinue -if ($mouse -ne $null) { Write-Output "MOUSE:$($mouse.Win32PrioritySeparation)" } else { Write-Output "MOUSE:null" } -if ($keyboard -ne $null) { Write-Output "KEYBOARD:$($keyboard.KeyboardDataQueueSize)" } else { Write-Output "KEYBOARD:null" } -"#; - let result = run_ps_script(script)?; - let stdout = String::from_utf8_lossy(&result.stdout).to_string(); - let mut mouse_value: Option = None; - let mut keyboard_value: Option = None; - for line in stdout.lines() { - let line = line.trim(); - if let Some(val) = line.strip_prefix("MOUSE:") { - mouse_value = if val == "null" { None } else { val.trim().parse().ok() }; - } else if let Some(val) = line.strip_prefix("KEYBOARD:") { - keyboard_value = if val == "null" { None } else { val.trim().parse().ok() }; - } - } - Ok(PeripheralStatus { mouse_value, keyboard_value }) -} - -#[tauri::command] -pub async fn set_peripheral_settings(mouse_value: u32, keyboard_value: u32) -> Result { - let script = format!(r#" -$ErrorActionPreference = 'SilentlyContinue' -Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl' -Name 'Win32PrioritySeparation' -Value {mouse} -Type DWord -Force -ErrorAction SilentlyContinue -Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters' -Name 'KeyboardDataQueueSize' -Value {keyboard} -Type DWord -Force -ErrorAction SilentlyContinue -Write-Output 'OK' -"#, mouse = mouse_value, keyboard = keyboard_value); - run_simple_feature(&script) -} - -#[tauri::command] -pub async fn reset_peripheral_settings() -> Result { - run_simple_feature(r#" -$ErrorActionPreference = 'SilentlyContinue' -Remove-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl' -Name 'Win32PrioritySeparation' -ErrorAction SilentlyContinue -Remove-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters' -Name 'KeyboardDataQueueSize' -ErrorAction SilentlyContinue -Write-Output 'OK' -"#) -} - -// ========== AQ_REGISTRY 模块 - 纯 Rust 注册表操作(零外部进程) ========== -// 感谢 1U 工具箱提供系统优化支持 - -/// 读取 .reg 文件内容(自动处理 UTF-8 和 UTF-16LE 编码) -fn read_reg_file(name: &str, is_restore: bool) -> Result { - let path = resolve_reg_path(name, is_restore)?; - let bytes = fs::read(&path) - .map_err(|e| format!("读取注册表文件失败: {}", e))?; - - // 检测编码:UTF-16LE BOM (FF FE) 或 UTF-8 BOM (EF BB BF) - if bytes.len() >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE { - // UTF-16LE 编码(部分 .reg 文件使用此编码) - let u16s: Vec = bytes[2..] - .chunks_exact(2) - .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])) - .collect(); - Ok(String::from_utf16_lossy(&u16s)) - } else if bytes.len() >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF { - // UTF-8 BOM - Ok(String::from_utf8_lossy(&bytes[3..]).to_string()) - } else { - // 纯 UTF-8 - Ok(String::from_utf8_lossy(&bytes).to_string()) - } -} - -/// 解析 .reg 文件路径(适配开发模式和打包模式) -fn resolve_reg_path(name: &str, is_restore: bool) -> Result { - let (dir, suffix) = if is_restore { - ("aq_registry_restore", ".restore.reg") - } else { - ("aq_registry", ".reg") - }; - - // 开发模式下从项目根目录查找 - if let Ok(cwd) = std::env::current_dir() { - let dev_candidates = [ - cwd.join(dir).join(format!("{}{}", name, suffix)), - cwd.join("..").join(dir).join(format!("{}{}", name, suffix)), - cwd.join("..").join("..").join(dir).join(format!("{}{}", name, suffix)), - ]; - for path in &dev_candidates { - if path.exists() { - return Ok(path.clone()); - } - } - } - - // 开发模式后备:通过编译时 CARGO_MANIFEST_DIR 定位项目根目录 - let manifest_dir = env!("CARGO_MANIFEST_DIR"); - let manifest_candidates = [ - Path::new(manifest_dir).join(dir).join(format!("{}{}", name, suffix)), - Path::new(manifest_dir).join("..").join(dir).join(format!("{}{}", name, suffix)), - ]; - for path in &manifest_candidates { - if path.exists() { - return Ok(path.clone()); - } - } - - // 打包模式下从 exe 同级目录查找 - if let Ok(exe_path) = std::env::current_exe() { - if let Some(parent) = exe_path.parent() { - let candidates = [ - parent.join(dir).join(format!("{}{}", name, suffix)), - parent.join("_up_").join(dir).join(format!("{}{}", name, suffix)), - parent.join("resources").join(dir).join(format!("{}{}", name, suffix)), - ]; - for path in &candidates { - if path.exists() { - return Ok(path.clone()); - } - } - } - } - - Err(format!("未找到注册表文件: {}{}", name, suffix)) -} - -/// 解析 .reg 文件内容并直接通过 winreg 写入注册表 -/// 支持:[HKEY_...] 键路径 / "Name"=dword:XXX / "Name"="string" / "Name"=- 删除值 -fn apply_reg_content(content: &str) -> Result<(), String> { - let mut current_key: Option = None; - - for line in content.lines() { - let line = line.trim(); - - // 跳过空行和注释 - if line.is_empty() || line.starts_with(';') || line.starts_with("Windows Registry Editor") { - continue; - } - - // [HKEY_LOCAL_MACHINE\SYSTEM\...] — 注册表键路径 - if line.starts_with('[') && line.ends_with(']') { - let path = &line[1..line.len() - 1]; - current_key = Some(open_or_create_reg_key(path)?); - continue; - } - - // "ValueName"=dword:00000001 — DWORD 值 - // "ValueName"="string" — 字符串值 - // "ValueName"=- — 删除值 - if let Some(ref key) = current_key { - if let Some(rest) = line.strip_prefix('"') { - if let Some(eq_pos) = rest.find("\"=") { - let name = &rest[..eq_pos]; - // 反转义 .reg 中的双引号 \" - let name = name.replace("\\\"", "\""); - let value = &rest[eq_pos + 2..]; - - if value.starts_with("dword:") { - // DWORD 值 - let hex_str = &value[6..]; - let val = u32::from_str_radix(hex_str, 16) - .map_err(|e| format!("解析 dword 值失败: {}", e))?; - key.set_value(&name, &val) - .map_err(|e| format!("写入注册表值失败: {}", e))?; - } else if value.starts_with('"') { - // 字符串值(去掉首尾引号,反转义) - let val = &value[1..value.len() - 1]; - let val = val.replace("\\\"", "\""); - key.set_value(&name, &val) - .map_err(|e| format!("写入注册表值失败: {}", e))?; - } else if value == "-" { - // 删除值 - let _ = key.delete_value(&name); - } - // hex: 格式(二进制值)暂不支持,aq_registry 中未使用 - } - } - } - } - - Ok(()) -} - -/// 根据 .reg 文件中的路径打开或创建注册表键 -fn open_or_create_reg_key(path: &str) -> Result { - let (root, subpath) = if let Some(sub) = path.strip_prefix("HKEY_LOCAL_MACHINE\\") { - (RegKey::predef(HKEY_LOCAL_MACHINE), sub) - } else if let Some(sub) = path.strip_prefix("HKEY_CURRENT_USER\\") { - (RegKey::predef(HKEY_CURRENT_USER), sub) - } else if let Some(sub) = path.strip_prefix("HKEY_CLASSES_ROOT\\") { - (RegKey::predef(HKEY_CLASSES_ROOT), sub) - } else if let Some(sub) = path.strip_prefix("HKEY_USERS\\") { - (RegKey::predef(HKEY_USERS), sub) - } else { - return Err(format!("不支持的注册表根键: {}", path)); - }; - - let (key, _) = root - .create_subkey(subpath) - .map_err(|e| format!("创建注册表键失败: {} - {}", path, e))?; - - Ok(key) -} - -/// 应用单个注册表优化(读取 aq_registry/.reg 并通过 winreg 写入) -#[tauri::command] -pub async fn apply_registry_tweak(name: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let content = read_reg_file(&name, false)?; - apply_reg_content(&content)?; - - Ok(PerfTweakResult { - success: true, - message: "优化已应用".to_string(), - }) -} - -/// 恢复单个注册表优化(读取 aq_registry_restore/.restore.reg 并通过 winreg 写入) -#[tauri::command] -pub async fn restore_registry_tweak(name: String) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let content = read_reg_file(&name, true)?; - apply_reg_content(&content)?; - - Ok(PerfTweakResult { - success: true, - message: "优化已恢复".to_string(), - }) -} - -/// 批量应用注册表优化 -#[tauri::command] -pub async fn batch_apply_registry_tweaks(names: Vec) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let mut success_count = 0; - let mut failed = Vec::new(); - - for name in &names { - match read_reg_file(name, false) { - Ok(content) => { - if let Err(e) = apply_reg_content(&content) { - failed.push((name.clone(), e)); - } else { - success_count += 1; - } - } - Err(e) => { - failed.push((name.clone(), e)); - } - } - } - - if failed.is_empty() { - Ok(PerfTweakResult { - success: true, - message: format!("成功应用 {} 项优化", success_count), - }) - } else { - let failed_names: Vec = failed.iter().map(|(n, _)| n.clone()).collect(); - Ok(PerfTweakResult { - success: failed.len() < names.len(), - message: format!( - "成功 {} 项,失败 {} 项: {}", - success_count, - failed.len(), - failed_names.join(", ") - ), - }) - } -} - -/// 批量恢复注册表优化 -#[tauri::command] -pub async fn batch_restore_registry_tweaks(names: Vec) -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let mut success_count = 0; - let mut failed = Vec::new(); - - for name in &names { - match read_reg_file(name, true) { - Ok(content) => { - if let Err(e) = apply_reg_content(&content) { - failed.push((name.clone(), e)); - } else { - success_count += 1; - } - } - Err(e) => { - failed.push((name.clone(), e)); - } - } - } - - if failed.is_empty() { - Ok(PerfTweakResult { - success: true, - message: format!("成功恢复 {} 项优化", success_count), - }) - } else { - let failed_names: Vec = failed.iter().map(|(n, _)| n.clone()).collect(); - Ok(PerfTweakResult { - success: failed.len() < names.len(), - message: format!( - "成功 {} 项,失败 {} 项: {}", - success_count, - failed.len(), - failed_names.join(", ") - ), - }) - } -} - -/// 重启显卡驱动(模拟 Win+Ctrl+Shift+B) -/// 该快捷键会触发 Windows 图形栈重置,适用于网吧用户需要快速恢复显示异常的场景 -#[tauri::command] -pub fn restart_graphics_driver() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - unsafe { - use winapi::um::winuser::{ - keybd_event, KEYEVENTF_KEYUP, - VK_LCONTROL, VK_LSHIFT, VK_LWIN, - }; - - const VK_B: u8 = 0x42; - - // 按下组合键:Win + Ctrl + Shift + B - keybd_event(VK_LWIN as u8, 0, 0, 0); - keybd_event(VK_LCONTROL as u8, 0, 0, 0); - keybd_event(VK_LSHIFT as u8, 0, 0, 0); - keybd_event(VK_B, 0, 0, 0); - - // 短暂延迟确保系统注册该组合键 - std::thread::sleep(std::time::Duration::from_millis(100)); - - // 释放按键(逆序):B, Shift, Ctrl, Win - keybd_event(VK_B, 0, KEYEVENTF_KEYUP, 0); - keybd_event(VK_LSHIFT as u8, 0, KEYEVENTF_KEYUP, 0); - keybd_event(VK_LCONTROL as u8, 0, KEYEVENTF_KEYUP, 0); - keybd_event(VK_LWIN as u8, 0, KEYEVENTF_KEYUP, 0); - } - - Ok(PerfTweakResult { - success: true, - message: "已发送重启显卡驱动指令,屏幕可能会短暂闪烁".to_string(), - }) -} - -/// 检查 Windows 更新暂停状态 -#[tauri::command] -pub fn check_pause_update_state() -> Result { - if !cfg!(target_os = "windows") { - return Err("此功能仅支持 Windows 系统".to_string()); - } - - let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - let key = hklm - .open_subkey(r"SOFTWARE\Microsoft\WindowsUpdate\UX\Settings") - .map_err(|e| format!("无法打开注册表键: {}", e))?; - - // 检查 PauseUpdatesExpiryTime 值是否存在 - let paused: bool = key - .get_value::("PauseUpdatesExpiryTime") - .map(|_| true) - .unwrap_or(false); - - Ok(paused) -} diff --git a/参考/NexBox-main/src-tauri/src/optimization.txt b/参考/NexBox-main/src-tauri/src/optimization.txt deleted file mode 100644 index 86a99ed..0000000 --- a/参考/NexBox-main/src-tauri/src/optimization.txt +++ /dev/null @@ -1,64 +0,0 @@ -use std::collections::HashMap; -use std::os::windows::process::CommandExt; -use std::panic; -use std::process::Command; -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; -use std::{env, fs, path::Path}; -use sysinfo::System; -use tauri::Manager; -use windows_sys::Win32::Foundation::CloseHandle; -use windows_sys::Win32::System::Threading::{OpenProcess, SetPriorityClass}; - -pub(crate) const CREATE_NO_WINDOW: u32 = 0x08000000; - -fn get_powershell_path() -> String { - if let Ok(sysroot) = env::var("SystemRoot") { - let ps_path = format!(r"{}\System32\WindowsPowerShell\v1.0\powershell.exe", sysroot); - if Path::new(&ps_path).exists() { - return ps_path; - } - } - "powershell.exe".to_string() -} - -const PROCESS_SET_INFORMATION: u32 = 0x0200; -const IDLE_PRIORITY_CLASS: u32 = 0x00000040; -const BELOW_NORMAL_PRIORITY_CLASS: u32 = 0x00004000; -const PROCESS_MODE_BACKGROUND_BEGIN: u32 = 0x00100000; - -fn enable_process_efficiency_mode(pid: u32) -> bool { - unsafe { - let handle = OpenProcess(PROCESS_SET_INFORMATION, 0, pid); - if handle.is_null() { - return false; - } - - // Step 1: Background mode ??I/O VeryLow + Memory Low (CPU temporarily IDLE) - let bg_ok = SetPriorityClass(handle, PROCESS_MODE_BACKGROUND_BEGIN) != 0; - - // Step 2: CPU ??BELOW_NORMAL, keeping low I/O and memory from background mode - if SetPriorityClass(handle, BELOW_NORMAL_PRIORITY_CLASS) == 0 { - // ??? CPU ???????????????????????? I/O ???????? } - - CloseHandle(handle); - bg_ok - } -} - -fn set_process_low_priority(pid: u32) -> bool { - unsafe { - let handle = OpenProcess(PROCESS_SET_INFORMATION, 0, pid); - if handle.is_null() { - return false; - } - - let ok = if SetPriorityClass(handle, IDLE_PRIORITY_CLASS) == 0 { - false - } else { - true - }; - - CloseHandle(han diff --git a/参考/NexBox-main/src-tauri/src/overlay_panel.rs b/参考/NexBox-main/src-tauri/src/overlay_panel.rs deleted file mode 100644 index 9e9e1d7..0000000 --- a/参考/NexBox-main/src-tauri/src/overlay_panel.rs +++ /dev/null @@ -1,2136 +0,0 @@ -use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; -use std::sync::Mutex; -use std::thread; -use std::time::Duration; -use tauri::Emitter; - -static OVERLAY_ACTIVE: AtomicBool = AtomicBool::new(false); -static OVERLAY_HANDLE: AtomicPtr = AtomicPtr::new(std::ptr::null_mut()); -static DRAG_MODE: AtomicBool = AtomicBool::new(false); -static POSITION_CHANGED: AtomicBool = AtomicBool::new(false); -static BACKGROUND_POLLER_ACTIVE: AtomicBool = AtomicBool::new(false); - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct DisplayItem { - pub id: String, - pub label: String, - pub enabled: bool, -} - -pub type DisplayItems = Vec; - -fn default_style() -> String { - "default".to_string() -} - -fn default_font() -> String { - "Microsoft YaHei".to_string() -} - -fn default_font_color() -> String { - "#ffffff".to_string() -} - -fn default_display_items() -> DisplayItems { - vec![ - DisplayItem { id: "fps".to_string(), label: "FPS".to_string(), enabled: false }, - DisplayItem { id: "cpu_temp".to_string(), label: "CPU温度".to_string(), enabled: false }, - DisplayItem { id: "cpu_usage".to_string(), label: "CPU占用".to_string(), enabled: true }, - DisplayItem { id: "cpu_fan_speed".to_string(), label: "CPU风扇转速".to_string(), enabled: false }, - DisplayItem { id: "cpu_clock".to_string(), label: "CPU频率".to_string(), enabled: false }, - DisplayItem { id: "cpu_voltage".to_string(), label: "CPU电压".to_string(), enabled: false }, - DisplayItem { id: "cpu_power".to_string(), label: "CPU功耗".to_string(), enabled: false }, - DisplayItem { id: "gpu_temp".to_string(), label: "GPU温度".to_string(), enabled: true }, - DisplayItem { id: "gpu_usage".to_string(), label: "GPU占用".to_string(), enabled: true }, - DisplayItem { id: "gpu_fan_speed".to_string(), label: "GPU风扇转速".to_string(), enabled: false }, - DisplayItem { id: "gpu_power".to_string(), label: "GPU功耗".to_string(), enabled: false }, - DisplayItem { id: "gpu_clock".to_string(), label: "GPU频率".to_string(), enabled: false }, - DisplayItem { id: "gpu_voltage".to_string(), label: "GPU电压".to_string(), enabled: false }, - DisplayItem { id: "gpu_vram".to_string(), label: "GPU显存占用".to_string(), enabled: false }, - DisplayItem { id: "gpu_memory_clock".to_string(), label: "GPU显存频率".to_string(), enabled: false }, - DisplayItem { id: "memory_usage".to_string(), label: "内存占用".to_string(), enabled: true }, - DisplayItem { id: "ssd_temp".to_string(), label: "硬盘温度".to_string(), enabled: false }, - DisplayItem { id: "game_ping".to_string(), label: "游戏延迟".to_string(), enabled: true }, - DisplayItem { id: "delta_password".to_string(), label: "三角洲密码".to_string(), enabled: true }, - ] -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct CustomOverlayItem { - pub id: String, - pub text: String, - pub color: String, - #[serde(default)] - pub enabled: bool, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct OverlaySettings { - #[serde(default = "default_display_items")] - pub display_items: DisplayItems, - #[serde(default)] - pub custom_items: Vec, - pub opacity: u8, - #[serde(default = "default_style")] - pub style: String, - #[serde(default = "default_font")] - pub font: String, - #[serde(default = "default_font_color")] - pub font_color: String, - #[serde(default)] - pub position_x: Option, - #[serde(default)] - pub position_y: Option, - /// 三角洲密码选中的地图名称列表(空 = 显示全部) - #[serde(default)] - pub delta_password_maps: Vec, -} - -impl Default for OverlaySettings { - fn default() -> Self { - Self { - display_items: default_display_items(), - custom_items: Vec::new(), - opacity: 255, - style: "default".to_string(), - font: "Microsoft YaHei".to_string(), - font_color: "#ffffff".to_string(), - position_x: None, - position_y: None, - delta_password_maps: Vec::new(), - } - } -} - -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] -pub struct OverlayResult { - pub success: bool, - pub message: String, -} - -#[derive(Clone, serde::Serialize, serde::Deserialize)] -pub struct OverlayHardwareData { - fps: Option, - cpu_usage: Option, - cpu_temp: Option, - cpu_clock: Option, - gpu_temp: Option, - gpu_usage: Option, - memory_usage: Option, - delta_password: Option, - game_ping: Option, - cpu_fan_speed: Option, - gpu_fan_speed: Option, - gpu_power: Option, - gpu_clock: Option, - gpu_vram_used: Option, - gpu_vram_total: Option, - gpu_memory_clock: Option, - cpu_voltage: Option, - gpu_voltage: Option, - cpu_power: Option, - ssd_temp: Option, -} - -impl Default for OverlayHardwareData { - fn default() -> Self { - Self { - fps: None, - cpu_usage: None, - cpu_temp: None, - cpu_clock: None, - gpu_temp: None, - gpu_usage: None, - memory_usage: None, - delta_password: None, - game_ping: None, - cpu_fan_speed: None, - gpu_fan_speed: None, - gpu_power: None, - gpu_clock: None, - gpu_vram_used: None, - gpu_vram_total: None, - gpu_memory_clock: None, - cpu_voltage: None, - gpu_voltage: None, - cpu_power: None, - ssd_temp: None, - } - } -} - -pub static CURRENT_SETTINGS: Mutex> = Mutex::new(None); -pub static CURRENT_HARDWARE_DATA: Mutex> = Mutex::new(None); - -pub fn get_or_init_settings() -> OverlaySettings { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if settings_lock.is_none() { - *settings_lock = Some(OverlaySettings::default()); - } - settings_lock.as_ref().unwrap().clone() -} - -/// 从 LHML 传感器列表中提取指定类型的传感器值(多模式匹配) -fn extract_sensor( - sensors: &[crate::sensor::SensorReading], - sensor_type: &str, - hardware_type: &str, - names: &[&str], - skip_zero: bool, -) -> Option<(f64, String)> { - for name in names { - if let Some(s) = sensors.iter().find(|s| { - s.sensor_type == sensor_type - && s.hardware_type.eq_ignore_ascii_case(hardware_type) - && s.name.contains(name) - && (!skip_zero || s.value > 0.0) - }) { - return Some((s.value, s.name.clone())); - } - } - None -} - -/// 从 LHML 传感器列表中提取所有匹配传感器值的平均值(用于风扇转速等) -fn extract_all_avg( - sensors: &[crate::sensor::SensorReading], - sensor_type: &str, - hardware_type: &str, - name_prefixes: &[&str], -) -> Option { - let values: Vec = sensors - .iter() - .filter(|s| { - s.sensor_type == sensor_type - && s.hardware_type.eq_ignore_ascii_case(hardware_type) - && name_prefixes.iter().any(|p| s.name.starts_with(p)) - }) - .map(|s| s.value) - .collect(); - if values.is_empty() { - None - } else { - Some(values.iter().sum::() / values.len() as f64) - } -} - -static LAST_LHML_UPDATE: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); - -pub fn collect_hardware_data() -> OverlayHardwareData { - let fps = crate::game_fps::get_cached_fps(); - - let selected_maps = { - let settings = get_or_init_settings(); - settings.delta_password_maps.clone() - }; - let delta_password = if selected_maps.is_empty() { - crate::delta_force::get_cached_delta_password() - } else { - crate::delta_force::get_cached_delta_password_filtered(&selected_maps) - }; - - let game_ping = crate::game_ping::get_cached_ping(); - - let current_time = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis() as u64; - let last_time = LAST_LHML_UPDATE.load(std::sync::atomic::Ordering::Relaxed); - - let use_cached_lhml = if current_time - last_time < 1000 { - true - } else { - LAST_LHML_UPDATE.store(current_time, std::sync::atomic::Ordering::Relaxed); - false - }; - - // 从 LHML (NexBoxMonitor) 获取硬件传感器数据 - let (cpu_usage, cpu_temp, cpu_clock, cpu_voltage, cpu_power, cpu_fan_speed, ssd_temp, memory_usage, gpu_temp, gpu_usage, gpu_fan_speed, gpu_power, gpu_clock, gpu_vram_used, gpu_vram_total, gpu_memory_clock, gpu_voltage) = - if use_cached_lhml { - let prev = CURRENT_HARDWARE_DATA.lock().unwrap().clone().unwrap_or_default(); - ( - prev.cpu_usage, prev.cpu_temp, prev.cpu_clock, prev.cpu_voltage, prev.cpu_power, prev.cpu_fan_speed, prev.ssd_temp, prev.memory_usage, prev.gpu_temp, prev.gpu_usage, prev.gpu_fan_speed, prev.gpu_power, prev.gpu_clock, prev.gpu_vram_used, prev.gpu_vram_total, prev.gpu_memory_clock, prev.gpu_voltage - ) - } else { - match crate::sensor::read_lhm_sensors() { - Ok(response) => { - // CPU 占用 (Load 类型) - let (cpu_usage, cpu_usage_name) = extract_sensor( - &response.sensors, - "Load", - "CPU", - &["CPU Total", "Total"], - false, - ).unzip(); - let cpu_usage = cpu_usage.map(|v| v as u16); - // CPU 温度 (AMD: Core (Tctl/Tdie), Intel: CPU Package) - let (cpu_temp, cpu_name) = extract_sensor( - &response.sensors, - "Temperature", - "CPU", - &["Core (Tctl/Tdie)", "CPU Package", "Tctl", "Core"], - false, - ).unzip(); - // CPU 频率 - let (cpu_clock, cpu_clock_name) = extract_sensor( - &response.sensors, - "Clock", - "CPU", - &["Cores (Average)", "Core #1", "Bus Speed"], - true, - ).unzip(); - let cpu_clock = cpu_clock.map(|v| v as u32); - // CPU 电压 - let cpu_voltage_result = extract_sensor( - &response.sensors, - "Voltage", - "CPU", - &["CPU Core", "Vcore", "Core", "CPU VCore"], - false, - ); - let cpu_voltage = cpu_voltage_result.as_ref().map(|(v, _)| *v); - // CPU 功耗 - let cpu_power_result = extract_sensor( - &response.sensors, - "Power", - "CPU", - &["Package", "CPU Package", "CPU Cores", "CPU Core"], - false, - ); - let cpu_power = cpu_power_result.as_ref().map(|(v, _)| *v); - // SSD 温度 (跳过 0 值) - let (ssd_temp, ssd_name) = extract_sensor( - &response.sensors, - "Temperature", - "Storage", - &["Composite Temperature", "Temperature #1", "Temperature"], - true, - ).unzip(); - - // 内存占用 (从 LHML Memory 硬件获取) - let memory_usage = extract_sensor( - &response.sensors, - "Load", - "Memory", - &["Memory"], - false, - ).map(|(v, _)| v); - - // 调试:打印所有 RAM 传感器 - let memory_sensors: Vec<_> = response.sensors.iter() - .filter(|s| s.hardware_type.eq_ignore_ascii_case("Memory")) - .map(|s| format!("{}|{}|{}={}", s.hardware_type, s.sensor_type, s.name, s.value)) - .collect(); - log::debug!("LHML Memory sensors: {:?}", memory_sensors); - - // 调试:打印所有 CPU 和主板传感器 - let cpu_sensors: Vec<_> = response.sensors.iter() - .filter(|s| s.hardware_type.eq_ignore_ascii_case("CPU")) - .map(|s| format!("{}|{}|{}={}", s.hardware_type, s.sensor_type, s.name, s.value)) - .collect(); - log::debug!("LHML CPU sensors: {:?}", cpu_sensors); - // 打印所有非 GPU/CPU/HDD 的硬件类型(用于排查主板传感器) - let other_types: std::collections::BTreeSet<_> = response.sensors.iter() - .filter(|s| !s.hardware_type.to_lowercase().starts_with("gpu") - && !s.hardware_type.eq_ignore_ascii_case("CPU") - && !s.hardware_type.eq_ignore_ascii_case("Storage") - && !s.hardware_type.eq_ignore_ascii_case("RAM")) - .map(|s| format!("{}|{}|{}={}", s.hardware_type, s.sensor_type, s.name, s.value)) - .collect(); - log::debug!("LHML other sensors: {:?}", other_types); - - // 调试:打印所有 GPU 传感器 - let gpu_sensors: Vec<_> = response.sensors.iter() - .filter(|s| s.hardware_type.to_lowercase().starts_with("gpu")) - .map(|s| format!("{}|{}|{}={}", s.hardware_type, s.sensor_type, s.name, s.value)) - .collect(); - log::debug!("LHML GPU sensors: {:?}", gpu_sensors); - - // GPU 温度 - let gpu_temp_result = extract_sensor( - &response.sensors, - "Temperature", - "GpuNvidia", - &["GPU Core"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "Temperature", "GpuAmd", &["GPU Core"], false)) - .or_else(|| extract_sensor(&response.sensors, "Temperature", "GpuIntel", &["GPU Core"], false)); - let gpu_temp = gpu_temp_result.as_ref().map(|(v, _)| *v); - let gpu_temp_name = gpu_temp_result.as_ref().map(|(_, n)| n.clone()); - - // GPU 占用 - let gpu_usage_result = extract_sensor( - &response.sensors, - "Load", - "GpuNvidia", - &["GPU Core"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "Load", "GpuAmd", &["GPU Core"], false)) - .or_else(|| extract_sensor(&response.sensors, "Load", "GpuIntel", &["GPU Core"], false)); - let gpu_usage = gpu_usage_result.as_ref().map(|(v, _)| *v as u32); - let gpu_usage_name = gpu_usage_result.as_ref().map(|(_, n)| n.clone()); - - // CPU 风扇 - // LHML 中 CPU 风扇传感器出现在 SuperIO(Nuvoton 等)或 Motherboard 硬件类型下 - // 名称通常为 "Fan #1"、"CPU Fan"、"CPU1 Fan" 等,优先取第一个非零值风扇作为 CPU 风扇 - let cpu_fan_speed = { - let fan = extract_sensor(&response.sensors, "Fan", "SuperIO", &["Fan #1", "Fan #2", "CPU Fan", "CPU1 Fan", "CPUFAN"], false) - .or_else(|| { - // 取 SuperIO 下第一个非零 RPM 的风扇 - response.sensors.iter() - .filter(|s| s.sensor_type == "Fan" - && s.hardware_type.eq_ignore_ascii_case("SuperIO") - && s.value > 0.0) - .next() - .map(|s| (s.value, s.name.clone())) - }) - .or_else(|| { - // 兜底:任意 SuperIO 风扇 - response.sensors.iter() - .filter(|s| s.sensor_type == "Fan" - && s.hardware_type.eq_ignore_ascii_case("SuperIO")) - .next() - .map(|s| (s.value, s.name.clone())) - }) - .or_else(|| { - // 再兜底:Motherboard 下的风扇 - response.sensors.iter() - .filter(|s| s.sensor_type == "Fan" - && s.hardware_type.eq_ignore_ascii_case("Motherboard")) - .next() - .map(|s| (s.value, s.name.clone())) - }); - fan.map(|(v, _)| v as u32) - }; - - // GPU 风扇(所有风扇平均,RPM) - // 尝试多种前缀:NVIDIA 常见 "GPU Fan #0", "GPU",AMD 常见 "Fans" - let gpu_fan_speed = extract_all_avg(&response.sensors, "Fan", "GpuNvidia", &["GPU Fan", "GPU"]) - .or_else(|| extract_all_avg(&response.sensors, "Fan", "GpuAmd", &["GPU Fan", "GPU", "Fans"])) - .map(|v| v as u32); - - // GPU 功耗 - let gpu_power_result = extract_sensor( - &response.sensors, - "Power", - "GpuNvidia", - &["GPU Power", "GPU Package", "GPU Chip Power", "Power"], - false, - ) - .or_else(|| { - extract_sensor( - &response.sensors, - "Power", - "GpuAmd", - &["GPU Power", "GPU Package", "Power"], - false, - ) - }) - .or_else(|| { - extract_sensor( - &response.sensors, - "Power", - "GpuIntel", - &["GPU Power", "GPU Package", "Power"], - false, - ) - }); - let gpu_power = gpu_power_result.as_ref().map(|(v, _)| *v as u32); - let gpu_power_name = gpu_power_result.as_ref().map(|(_, n)| n.clone()); - - // GPU 频率 - let gpu_clock_result = extract_sensor( - &response.sensors, - "Clock", - "GpuNvidia", - &["GPU Core"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "Clock", "GpuAmd", &["GPU Core"], false)) - .or_else(|| extract_sensor(&response.sensors, "Clock", "GpuIntel", &["GPU Core"], false)); - let gpu_clock = gpu_clock_result.as_ref().map(|(v, _)| *v as u32); - let gpu_clock_name = gpu_clock_result.as_ref().map(|(_, n)| n.clone()); - - // 显存占用 (MB) - let gpu_vram_used_result = extract_sensor( - &response.sensors, - "SmallData", - "GpuNvidia", - &["GPU Memory Used", "D3D Shared Memory Used"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "SmallData", "GpuAmd", &["GPU Memory Used"], false)) - .or_else(|| extract_sensor(&response.sensors, "SmallData", "GpuIntel", &["GPU Memory Used"], false)); - let gpu_vram_used = gpu_vram_used_result.as_ref().map(|(v, _)| *v as u32); - - // 显存总量 (MB) - let gpu_vram_total_result = extract_sensor( - &response.sensors, - "SmallData", - "GpuNvidia", - &["GPU Memory Total"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "SmallData", "GpuAmd", &["GPU Memory Total"], false)) - .or_else(|| extract_sensor(&response.sensors, "SmallData", "GpuIntel", &["GPU Memory Total"], false)); - let gpu_vram_total = gpu_vram_total_result.as_ref().map(|(v, _)| *v as u32); - - // 显存频率 - let gpu_memory_clock_result = extract_sensor( - &response.sensors, - "Clock", - "GpuNvidia", - &["GPU Memory"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "Clock", "GpuAmd", &["GPU Memory"], false)) - .or_else(|| extract_sensor(&response.sensors, "Clock", "GpuIntel", &["GPU Memory"], false)); - let gpu_memory_clock = gpu_memory_clock_result.as_ref().map(|(v, _)| *v as u32); - - // GPU 电压 - let gpu_voltage_result = extract_sensor( - &response.sensors, "Voltage", "GpuNvidia", - &["GPU Core Voltage", "GPU Core"], - false, - ) - .or_else(|| extract_sensor(&response.sensors, "Voltage", "GpuAmd", &["GPU Core Voltage", "GPU Core"], false)) - .or_else(|| extract_sensor(&response.sensors, "Voltage", "GpuIntel", &["GPU Core Voltage", "GPU Core"], false)); - let gpu_voltage = gpu_voltage_result.as_ref().map(|(v, _)| *v); - - log::debug!( - "LHML: CPU占用={:?}({}) CPU温度={:?}({}) CPU频率={:?}({}) CPU电压={:?}V CPU功耗={:?}W SSD温度={:?}({}) 内存占用={:?}% GPU温度={:?}({}) GPU占用={:?}({}) GPU风扇={:?}RPM GPU功耗={:?}({}) GPU频率={:?}({}) 显存={:?}/{:?}MB 显存频率={:?}MHz GPU电压={:?}V", - cpu_usage, - cpu_usage_name.as_deref().unwrap_or("N/A"), - cpu_temp, - cpu_name.as_deref().unwrap_or("N/A"), - cpu_clock, - cpu_clock_name.as_deref().unwrap_or("N/A"), - cpu_voltage, - cpu_power, - ssd_temp, - ssd_name.as_deref().unwrap_or("N/A"), - memory_usage, - gpu_temp, - gpu_temp_name.as_deref().unwrap_or("N/A"), - gpu_usage, - gpu_usage_name.as_deref().unwrap_or("N/A"), - gpu_fan_speed, - gpu_power, - gpu_power_name.as_deref().unwrap_or("N/A"), - gpu_clock, - gpu_clock_name.as_deref().unwrap_or("N/A"), - gpu_vram_used, - gpu_vram_total, - gpu_memory_clock, - gpu_voltage, - ); - - (cpu_usage, cpu_temp, cpu_clock, cpu_voltage, cpu_power, cpu_fan_speed, ssd_temp, memory_usage, gpu_temp, gpu_usage, gpu_fan_speed, gpu_power, gpu_clock, gpu_vram_used, gpu_vram_total, gpu_memory_clock, gpu_voltage) - } - Err(e) => { - log::warn!("LHML 传感器读取失败: {e}"); - (None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None) - } - } - }; - - let new_data = OverlayHardwareData { - fps, - cpu_usage, - cpu_temp, - cpu_clock, - gpu_temp, - gpu_usage, - memory_usage, - delta_password, - game_ping, - cpu_fan_speed, - gpu_fan_speed, - gpu_power, - gpu_clock, - gpu_vram_used, - gpu_vram_total, - gpu_memory_clock, - cpu_voltage, - gpu_voltage, - cpu_power, - ssd_temp, - }; - - let prev_data = CURRENT_HARDWARE_DATA.lock().unwrap().clone(); - let result = if let Some(prev) = prev_data { - OverlayHardwareData { - fps: new_data.fps.or(prev.fps), - cpu_usage: new_data.cpu_usage.or(prev.cpu_usage), - cpu_temp: new_data.cpu_temp.or(prev.cpu_temp), - cpu_clock: new_data.cpu_clock.or(prev.cpu_clock), - gpu_temp: new_data.gpu_temp.or(prev.gpu_temp), - gpu_usage: new_data.gpu_usage.or(prev.gpu_usage), - memory_usage: new_data.memory_usage.or(prev.memory_usage), - delta_password: new_data.delta_password.or_else(|| prev.delta_password.clone()), - game_ping: new_data.game_ping.or(prev.game_ping), - cpu_fan_speed: new_data.cpu_fan_speed.or(prev.cpu_fan_speed), - gpu_fan_speed: new_data.gpu_fan_speed.or(prev.gpu_fan_speed), - gpu_power: new_data.gpu_power.or(prev.gpu_power), - gpu_clock: new_data.gpu_clock.or(prev.gpu_clock), - gpu_vram_used: new_data.gpu_vram_used.or(prev.gpu_vram_used), - gpu_vram_total: new_data.gpu_vram_total.or(prev.gpu_vram_total), - gpu_memory_clock: new_data.gpu_memory_clock.or(prev.gpu_memory_clock), - cpu_voltage: new_data.cpu_voltage.or(prev.cpu_voltage), - gpu_voltage: new_data.gpu_voltage.or(prev.gpu_voltage), - cpu_power: new_data.cpu_power.or(prev.cpu_power), - ssd_temp: new_data.ssd_temp.or(prev.ssd_temp), - } - } else { - new_data - }; - - result -} - -#[cfg(target_os = "windows")] -mod win32 { - use windows_sys::Win32::Foundation::*; - use windows_sys::Win32::Graphics::Gdi::*; - use windows_sys::Win32::Graphics::GdiPlus::*; - use windows_sys::Win32::UI::WindowsAndMessaging::*; - use windows_sys::Win32::UI::Accessibility::*; - use windows_sys::Win32::System::LibraryLoader::GetModuleHandleW; - use std::ptr; - use std::sync::Mutex; - use std::result::Result::Ok; - - static GDIPLUS_TOKEN: Mutex> = Mutex::new(None); - static WIN_EVENT_HOOK: Mutex> = Mutex::new(None); - - unsafe extern "system" fn win_event_proc( - _h_win_event_hook: *mut std::ffi::c_void, - _event: u32, - hwnd: HWND, - id_object: i32, - _id_child: i32, - _dw_event_thread: u32, - _dwms_event_time: u32, - ) { - if id_object != 0 || hwnd.is_null() { - return; - } - let overlay_hwnd = super::OVERLAY_HANDLE.load(std::sync::atomic::Ordering::SeqCst); - if overlay_hwnd.is_null() { - return; - } - if hwnd != overlay_hwnd { - SetWindowPos( - overlay_hwnd, - HWND_TOPMOST, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE, - ); - } - } - - pub unsafe fn install_topmost_guard() { - let hook = SetWinEventHook( - EVENT_SYSTEM_FOREGROUND, - EVENT_SYSTEM_FOREGROUND, - std::ptr::null_mut(), - Some(win_event_proc), - 0, - 0, - WINEVENT_OUTOFCONTEXT, - ); - if !hook.is_null() { - let mut lock = WIN_EVENT_HOOK.lock().unwrap(); - *lock = Some(hook as usize); - } - } - - pub unsafe fn uninstall_topmost_guard() { - let mut lock = WIN_EVENT_HOOK.lock().unwrap(); - if let Some(hook) = lock.take() { - UnhookWinEvent(hook as *mut std::ffi::c_void); - } - } - - pub unsafe fn init_gdiplus() -> bool { - let mut token = GDIPLUS_TOKEN.lock().unwrap(); - if token.is_some() { - return true; - } - - let mut input = GdiplusStartupInput { - GdiplusVersion: 1, - DebugEventCallback: 0, - SuppressBackgroundThread: 0, - SuppressExternalCodecs: 0, - }; - - let mut token_value: usize = 0; - let result = GdiplusStartup(&mut token_value, &mut input, ptr::null_mut()); - - if result == 0 { - *token = Some(token_value); - true - } else { - log::error!("GDI+ 初始化失败: {}", result); - false - } - } - - pub unsafe fn shutdown_gdiplus() { - let mut token = GDIPLUS_TOKEN.lock().unwrap(); - if let Some(t) = token.take() { - GdiplusShutdown(t); - } - } - - fn calculate_window_width(settings: &super::OverlaySettings) -> i32 { - // 使用较小的单项宽度以缩小悬浮框 - let normal_item_width = 130; - // 默认密码项宽度(逻辑像素) - let mut password_item_width = 220; - if settings.display_items.iter().any(|item| item.id == "delta_password" && item.enabled) { - if let Ok(lock) = super::CURRENT_HARDWARE_DATA.lock() { - if let Some(ref data) = *lock { - if let Some(ref pwd) = data.delta_password { - unsafe { - // 使用屏幕 DC 和字体测量文本宽度,按 DPI 缩放 - let screen_dc = GetDC(ptr::null_mut()); - if !screen_dc.is_null() { - let dpi_x = GetDeviceCaps(screen_dc, 88); - let dpi_scale = dpi_x as f32 / 96.0; - let hfont = create_compatible_font(dpi_scale, &settings.font); - if !hfont.is_null() { - let val_w = measure_text_width(screen_dc, hfont, pwd); - let est = val_w + (12.0 * dpi_scale) as i32 + 20; - if est > password_item_width { - password_item_width = est; - } - DeleteObject(hfont as _); - } - ReleaseDC(ptr::null_mut(), screen_dc); - } - } - } - } - } - } - - let mut width = 0i32; - let mut enabled_count = 0i32; - for item in &settings.display_items { - if item.enabled { - enabled_count += 1; - match item.id.as_str() { - "delta_password" => { width += password_item_width; } - _ => { width += normal_item_width; } - } - } - } - - // 自定义项宽度(各 150px 基础宽度) - let custom_item_width = 150; - let mut custom_count = 0i32; - for custom in &settings.custom_items { - if custom.enabled && !custom.text.is_empty() { - width += custom_item_width; - custom_count += 1; - } - } - - if width == 0 { return 200; } - enabled_count += custom_count; - let sep_count = if enabled_count > 1 { enabled_count - 1 } else { 0 }; - width + 32 + sep_count * 16 - } - - pub unsafe fn create_overlay_window( - settings: &super::OverlaySettings, - ) -> Result { - init_gdiplus(); - - let h_instance = GetModuleHandleW(ptr::null()); - if h_instance.is_null() { - return Err("无法获取模块句柄".to_string()); - } - - let class_name = windows_sys::core::w!("NexBoxOverlayPanel"); - - let wnd_class = WNDCLASSW { - style: CS_HREDRAW | CS_VREDRAW, - lpfnWndProc: Some(window_proc), - cbClsExtra: 0, - cbWndExtra: 0, - hInstance: h_instance, - hIcon: LoadIconW(h_instance, IDI_APPLICATION), - hCursor: LoadCursorW(h_instance, IDC_ARROW), - hbrBackground: CreateSolidBrush(0), - lpszMenuName: ptr::null(), - lpszClassName: class_name, - }; - - if RegisterClassW(&wnd_class) == 0 { - let error = GetLastError(); - if error != 1410 { - return Err(format!("注册窗口类失败: {}", error)); - } - } - - let screen_dc = GetDC(ptr::null_mut()); - let dpi_x = if screen_dc.is_null() { 96 } else { GetDeviceCaps(screen_dc, 88) }; - if !screen_dc.is_null() { - ReleaseDC(ptr::null_mut(), screen_dc); - } - let dpi_scale = dpi_x as f32 / 96.0; - - let logical_width = calculate_window_width(settings); - let logical_height = if settings.style == "dynamic_island" { 36 } else { 28 }; - let physical_width = (logical_width as f32 * dpi_scale) as i32; - let physical_height = (logical_height as f32 * dpi_scale) as i32; - - // 使用保存的位置,或使用默认位置 - let (x, y) = if let (Some(px), Some(py)) = (settings.position_x, settings.position_y) { - (px, py) - } else { - let screen_width = GetSystemMetrics(SM_CXSCREEN); - let default_x = (screen_width - physical_width) / 2; - let default_y = if settings.style == "dynamic_island" { 4 } else { 0 }; - (default_x, default_y) - }; - - let hwnd = CreateWindowExW( - WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT, - class_name, - windows_sys::core::w!("NexBox Overlay Panel"), - WS_POPUP, - x, - y, - physical_width, - physical_height, - ptr::null_mut(), - ptr::null_mut(), - h_instance, - ptr::null_mut(), - ); - - if hwnd.is_null() { - return Err("创建窗口失败".to_string()); - } - - ShowWindow(hwnd, SW_SHOW); - UpdateWindow(hwnd); - - Ok(hwnd) - } - - pub unsafe fn destroy_overlay_window(hwnd: HWND) -> bool { - if hwnd.is_null() { - return false; - } - KillTimer(hwnd, 1); - DestroyWindow(hwnd) != 0 - } - - unsafe fn create_compatible_font(dpi_scale: f32, font_name: &str) -> HFONT { - let font_height = -(13.0 * dpi_scale).round() as i32; - let wide_name: Vec = font_name.encode_utf16().chain(std::iter::once(0)).collect(); - CreateFontW( - font_height, - 0, - 0, - 0, - FW_NORMAL as i32, - 0, - 0, - 0, - DEFAULT_CHARSET as u32, - OUT_DEFAULT_PRECIS as u32, - CLIP_DEFAULT_PRECIS as u32, - CLEARTYPE_QUALITY as u32, - (DEFAULT_PITCH | FF_DONTCARE) as u32, - wide_name.as_ptr(), - ) - } - - unsafe fn measure_text_width(hdc: HDC, hfont: HFONT, text: &str) -> i32 { - let old_font = SelectObject(hdc, hfont as _); - let wide: Vec = text.encode_utf16().chain(std::iter::once(0)).collect(); - let mut size = SIZE { cx: 0, cy: 0 }; - GetTextExtentPoint32W(hdc, wide.as_ptr(), (wide.len() - 1) as i32, &mut size); - SelectObject(hdc, old_font); - size.cx - } - - struct DisplayItem { - label: String, - value: String, - label_width: i32, - value_width: i32, - total_width: i32, - custom_color: Option, - } - - fn parse_hex_color(hex: &str) -> u32 { - let hex = hex.trim_start_matches('#'); - if let Ok(val) = u32::from_str_radix(hex, 16) { - // 前端使用 #RRGGBB 格式,GDI+ 颜色格式为 0x00BBGGRR - let r = (val >> 16) & 0xFF; - let g = (val >> 8) & 0xFF; - let b = val & 0xFF; - (b << 16) | (g << 8) | r - } else { - 0x00FFFFFF - } - } - - fn build_display_items( - settings: &super::OverlaySettings, - data: &super::OverlayHardwareData, - ) -> Vec { - let mut items = Vec::new(); - for display_item in &settings.display_items { - if !display_item.enabled { - continue; - } - match display_item.id.as_str() { - "cpu_usage" => { - let val = data.cpu_usage.map(|v| format!("{}%", v)).unwrap_or_else(|| "--%".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_temp" => { - let val = data.gpu_temp.map(|v| format!("{:.0}°C", v)).unwrap_or_else(|| "--°C".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_usage" => { - let val = data.gpu_usage.map(|v| format!("{}%", v)).unwrap_or_else(|| "--%".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "memory_usage" => { - let val = data.memory_usage.map(|v| format!("{}%", v.round() as i32)).unwrap_or_else(|| "--%".to_string()); - items.push(DisplayItem { label: "RAM".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "delta_password" => { - let val = data.delta_password.as_deref().unwrap_or("--").to_string(); - items.push(DisplayItem { label: "".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "game_ping" => { - let val = data.game_ping.map(|v| format!("{}ms", v)).unwrap_or_else(|| "--ms".to_string()); - items.push(DisplayItem { label: "PING".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "fps" => { - let (val, color) = match data.fps { - Some(v) => { - let c = if v < 30 { - 0x000000FFu32 - } else if v < 60 { - 0x0000FFFFu32 - } else { - 0x0000FF00u32 - }; - (format!("{}", v), Some(c)) - } - None => ("--".to_string(), None), - }; - items.push(DisplayItem { label: "FPS".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: color }); - } - "cpu_fan_speed" => { - let val = data.cpu_fan_speed.map(|v| format!("{}RPM", v)).unwrap_or_else(|| "--RPM".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_fan_speed" => { - let val = data.gpu_fan_speed.map(|v| format!("{}RPM", v)).unwrap_or_else(|| "--RPM".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_power" => { - let val = data.gpu_power.map(|v| format!("{}W", v)).unwrap_or_else(|| "--W".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_clock" => { - let val = data.gpu_clock.map(|v| format!("{}MHz", v)).unwrap_or_else(|| "--MHz".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_vram" => { - let val = match (data.gpu_vram_used, data.gpu_vram_total) { - (Some(used), Some(total)) => { - let used_gb = used as f64 / 1024.0; - let total_gb = total as f64 / 1024.0; - format!("{:.1}G/{:.1}G", used_gb, total_gb) - } - _ => "--G/--G".to_string(), - }; - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_memory_clock" => { - let val = data.gpu_memory_clock.map(|v| format!("{}MHz", v)).unwrap_or_else(|| "--MHz".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "gpu_voltage" => { - let val = data.gpu_voltage.map(|v| format!("{:.3}V", v)).unwrap_or_else(|| "--V".to_string()); - items.push(DisplayItem { label: "GPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "cpu_temp" => { - let val = data.cpu_temp.map(|v| format!("{:.0}°C", v)).unwrap_or_else(|| "--°C".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "cpu_clock" => { - let val = data.cpu_clock.map(|v| format!("{}MHz", v)).unwrap_or_else(|| "--MHz".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "cpu_voltage" => { - let val = data.cpu_voltage.map(|v| format!("{:.3}V", v)).unwrap_or_else(|| "--V".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "cpu_power" => { - let val = data.cpu_power.map(|v| format!("{:.1}W", v)).unwrap_or_else(|| "--W".to_string()); - items.push(DisplayItem { label: "CPU".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - "ssd_temp" => { - let val = data.ssd_temp.map(|v| format!("{:.0}°C", v)).unwrap_or_else(|| "--°C".to_string()); - items.push(DisplayItem { label: "硬盘".to_string(), value: val, label_width: 0, value_width: 0, total_width: 0, custom_color: None }); - } - _ => {} - } - } - for custom in &settings.custom_items { - if custom.enabled && !custom.text.is_empty() { - let color = parse_hex_color(&custom.color); - items.push(DisplayItem { - label: String::new(), - value: custom.text.clone(), - label_width: 0, - value_width: 0, - total_width: 0, - custom_color: Some(color), - }); - } - } - items - } - - unsafe fn measure_and_layout_items( - hdc: HDC, - hfont: HFONT, - items: &mut [DisplayItem], - dpi_scale: f32, - ) -> i32 { - let gap = (10.0 * dpi_scale) as i32; - let mut total = 0i32; - for item in items.iter_mut() { - item.label_width = measure_text_width(hdc, hfont, &item.label); - item.value_width = measure_text_width(hdc, hfont, &item.value); - if item.label.is_empty() { - item.total_width = item.value_width; - } else { - item.total_width = item.label_width + gap + item.value_width; - } - total += item.total_width; - } - total - } - - pub unsafe fn draw_overlay_content( - hwnd: HWND, - settings: &super::OverlaySettings, - data: &super::OverlayHardwareData, - ) { - let dpi_scale = { - let dc = GetDC(hwnd); - let dpi = if dc.is_null() { 96 } else { GetDeviceCaps(dc, 88) }; - if !dc.is_null() { - ReleaseDC(hwnd, dc); - } - dpi as f32 / 96.0 - }; - - let hfont = create_compatible_font(dpi_scale, &settings.font); - if hfont.is_null() { - return; - } - - let font_color = parse_hex_color(&settings.font_color); - let temp_dc = GetDC(ptr::null_mut()); - let mut items = build_display_items(settings, data); - let padding = (16.0 * dpi_scale) as i32; - let item_gap = (16.0 * dpi_scale) as i32; - let content_width = measure_and_layout_items(temp_dc, hfont, &mut items, dpi_scale); - ReleaseDC(ptr::null_mut(), temp_dc); - let sep_count = if items.len() > 1 { items.len() as i32 - 1 } else { 0 }; - let total_content_width = content_width + sep_count * item_gap + padding * 2; - let logical_height = 28; - let physical_height = (logical_height as f32 * dpi_scale) as i32; - - let dib_width = total_content_width; - let dib_height = physical_height; - - let screen_dc = GetDC(ptr::null_mut()); - let mut bmi: BITMAPINFO = std::mem::zeroed(); - bmi.bmiHeader.biSize = std::mem::size_of::() as u32; - bmi.bmiHeader.biWidth = dib_width; - bmi.bmiHeader.biHeight = -dib_height; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = 32; - bmi.bmiHeader.biCompression = BI_RGB; - - let mut bits: *mut std::ffi::c_void = ptr::null_mut(); - let hbitmap = CreateDIBSection(screen_dc, &bmi, DIB_RGB_COLORS, &mut bits, ptr::null_mut(), 0); - ReleaseDC(ptr::null_mut(), screen_dc); - - if hbitmap.is_null() { - DeleteObject(hfont as _); - return; - } - - let mem_dc = CreateCompatibleDC(ptr::null_mut()); - let old_bmp = SelectObject(mem_dc, hbitmap as HGDIOBJ); - - let mut graphics: *mut GpGraphics = ptr::null_mut(); - if GdipCreateFromHDC(mem_dc, &mut graphics) != 0 { - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - DeleteObject(hfont as _); - return; - } - - GdipSetSmoothingMode(graphics, SmoothingModeAntiAlias); - - let mut clear_brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(0x00000000, &mut clear_brush); - GdipFillRectangle(graphics, clear_brush as *mut GpBrush, 0.0, 0.0, dib_width as f32, dib_height as f32); - GdipDeleteBrush(clear_brush as *mut GpBrush); - - let bg_argb: u32 = ((settings.opacity as u32) << 24) | 0x00111111; - let mut bg_brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(bg_argb, &mut bg_brush); - GdipFillRectangle(graphics, bg_brush as *mut GpBrush, 0.0, 0.0, dib_width as f32, dib_height as f32); - GdipDeleteBrush(bg_brush as *mut GpBrush); - GdipDeleteGraphics(graphics); - - let old_font = SelectObject(mem_dc, hfont as _); - SetBkMode(mem_dc, TRANSPARENT as i32); - - let gap = (10.0 * dpi_scale) as i32; - let mut current_x: i32 = padding; - let win_height_i32 = dib_height; - - for (i, item) in items.iter().enumerate() { - if i > 0 { - current_x += item_gap; - } - - if !item.label.is_empty() { - let wide_label: Vec = item.label.encode_utf16().chain(std::iter::once(0)).collect(); - let mut label_rect = RECT { - left: current_x, - top: 0, - right: current_x + item.label_width, - bottom: win_height_i32, - }; - SetTextColor(mem_dc, font_color); - DrawTextW( - mem_dc, - wide_label.as_ptr(), - (wide_label.len() - 1) as i32, - &mut label_rect, - DT_RIGHT | DT_VCENTER | DT_SINGLELINE, - ); - } - - let value_x = if item.label.is_empty() { - current_x - } else { - current_x + item.label_width + gap - }; - let wide_value: Vec = item.value.encode_utf16().chain(std::iter::once(0)).collect(); - let mut value_rect = RECT { - left: value_x, - top: 0, - right: value_x + item.value_width, - bottom: win_height_i32, - }; - - let mut color: u32 = font_color; - if let Some(custom_color) = item.custom_color { - color = custom_color; - } else if !item.label.is_empty() && !item.value.contains("--") - && (item.value.contains("°C") || item.value.contains('%') || item.value.bytes().all(|b| b.is_ascii_digit())) - { - let mut num_str = String::new(); - for ch in item.value.chars() { - if ch.is_ascii_digit() || ch == '.' { - num_str.push(ch); - } else if !num_str.is_empty() { - break; - } - } - if !num_str.is_empty() { - if let Ok(nf) = num_str.parse::() { - let nv = nf as i32; - if nv < 50 { - color = 0x0000FF00; - } else if nv < 80 { - color = 0x0000FFFF; - } else { - color = 0x000000FF; - } - } - } - } - - SetTextColor(mem_dc, color); - DrawTextW( - mem_dc, - wide_value.as_ptr(), - (wide_value.len() - 1) as i32, - &mut value_rect, - DT_LEFT | DT_VCENTER | DT_SINGLELINE, - ); - - current_x += item.total_width; - } - - SelectObject(mem_dc, old_font); - - if !bits.is_null() { - let pixels = std::slice::from_raw_parts_mut( - bits as *mut u32, - (dib_width * dib_height) as usize, - ); - for pixel in pixels.iter_mut() { - let alpha = (*pixel >> 24) & 0xFF; - let rgb = *pixel & 0x00FFFFFF; - if alpha == 0 && rgb != 0 { - *pixel = 0xFF000000 | rgb; - } - } - } - - let screen_width = GetSystemMetrics(SM_CXSCREEN); - let default_x = (screen_width - dib_width) / 2; - let use_x = settings.position_x.unwrap_or(default_x); - let use_y = settings.position_y.unwrap_or(0); - - let ppt_dst = POINT { x: use_x, y: use_y }; - let psize = SIZE { cx: dib_width, cy: dib_height }; - let ppt_src = POINT { x: 0, y: 0 }; - let blend = BLENDFUNCTION { - BlendOp: AC_SRC_OVER as u8, - BlendFlags: 0, - SourceConstantAlpha: 255, - AlphaFormat: AC_SRC_ALPHA as u8, - }; - - UpdateLayeredWindow( - hwnd, - ptr::null_mut(), - &ppt_dst, - &psize, - mem_dc, - &ppt_src, - 0, - &blend, - ULW_ALPHA, - ); - - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - DeleteObject(hfont as _); - } - - pub unsafe fn draw_overlay_content_dynamic_island( - hwnd: HWND, - settings: &super::OverlaySettings, - data: &super::OverlayHardwareData, - ) { - let dpi_scale = { - let dc = GetDC(hwnd); - let dpi = if dc.is_null() { 96 } else { GetDeviceCaps(dc, 88) }; - if !dc.is_null() { - ReleaseDC(hwnd, dc); - } - dpi as f32 / 96.0 - }; - - let hfont = create_compatible_font(dpi_scale, &settings.font); - if hfont.is_null() { - return; - } - - let font_color = parse_hex_color(&settings.font_color); - // Build a temp DC just for measurement - let temp_dc = GetDC(ptr::null_mut()); - let mut items = build_display_items(settings, data); - let padding = (16.0 * dpi_scale) as i32; - let item_gap = (16.0 * dpi_scale) as i32; - let content_width = measure_and_layout_items(temp_dc, hfont, &mut items, dpi_scale); - ReleaseDC(ptr::null_mut(), temp_dc); - let sep_count = if items.len() > 1 { items.len() as i32 - 1 } else { 0 }; - let total_content_width = content_width + sep_count * item_gap + padding * 2; - let logical_height = 36; - let physical_height = (logical_height as f32 * dpi_scale) as i32; - - let dib_width = total_content_width; - let dib_height = physical_height; - - // --- Create 32-bit ARGB DIB section (like crosshair) --- - let screen_dc = GetDC(ptr::null_mut()); - let mut bmi: BITMAPINFO = std::mem::zeroed(); - bmi.bmiHeader.biSize = std::mem::size_of::() as u32; - bmi.bmiHeader.biWidth = dib_width; - bmi.bmiHeader.biHeight = -dib_height; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = 32; - bmi.bmiHeader.biCompression = BI_RGB; - - let mut bits: *mut std::ffi::c_void = ptr::null_mut(); - let hbitmap = CreateDIBSection(screen_dc, &bmi, DIB_RGB_COLORS, &mut bits, ptr::null_mut(), 0); - ReleaseDC(ptr::null_mut(), screen_dc); - - if hbitmap.is_null() { - DeleteObject(hfont as _); - return; - } - - let mem_dc = CreateCompatibleDC(ptr::null_mut()); - let old_bmp = SelectObject(mem_dc, hbitmap as HGDIOBJ); - - // --- GDI+ anti-aliased rounded rect background --- - let mut graphics: *mut GpGraphics = ptr::null_mut(); - if GdipCreateFromHDC(mem_dc, &mut graphics) != 0 { - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - DeleteObject(hfont as _); - return; - } - - GdipSetSmoothingMode(graphics, SmoothingModeAntiAlias); - - // Clear to fully transparent - let mut clear_brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(0x00000000, &mut clear_brush); - GdipFillRectangle(graphics, clear_brush as *mut GpBrush, 0.0, 0.0, dib_width as f32, dib_height as f32); - GdipDeleteBrush(clear_brush as *mut GpBrush); - - // Draw rounded rect with GDI+ (proper per-pixel alpha anti-aliasing) - let bg_argb: u32 = ((settings.opacity as u32) << 24) | 0x00111111; - let corner_r = dib_height as f32 * 0.5; - let mut bg_brush: *mut GpSolidFill = ptr::null_mut(); - GdipCreateSolidFill(bg_argb, &mut bg_brush); - - let mut path: *mut GpPath = ptr::null_mut(); - GdipCreatePath(FillModeAlternate, &mut path); - if !path.is_null() { - let w = dib_width as f32; - let h = dib_height as f32; - let r = corner_r; - GdipAddPathArc(path, 0.0, 0.0, r * 2.0, r * 2.0, 180.0, 90.0); - GdipAddPathLine(path, r, 0.0, w - r, 0.0); - GdipAddPathArc(path, w - r * 2.0, 0.0, r * 2.0, r * 2.0, 270.0, 90.0); - GdipAddPathLine(path, w, r, w, h - r); - GdipAddPathArc(path, w - r * 2.0, h - r * 2.0, r * 2.0, r * 2.0, 0.0, 90.0); - GdipAddPathLine(path, w - r, h, r, h); - GdipAddPathArc(path, 0.0, h - r * 2.0, r * 2.0, r * 2.0, 90.0, 90.0); - GdipAddPathLine(path, 0.0, h - r, 0.0, r); - GdipClosePathFigure(path); - GdipFillPath(graphics, bg_brush as *mut GpBrush, path); - GdipDeletePath(path); - } - GdipDeleteBrush(bg_brush as *mut GpBrush); - GdipDeleteGraphics(graphics); - - // --- Draw text using GDI --- - let old_font = SelectObject(mem_dc, hfont as _); - SetBkMode(mem_dc, TRANSPARENT as i32); - - let gap = (10.0 * dpi_scale) as i32; - let mut current_x: i32 = padding; - let win_height_i32 = dib_height; - - for (i, item) in items.iter().enumerate() { - if i > 0 { - current_x += item_gap; - } - - if !item.label.is_empty() { - let wide_label: Vec = item.label.encode_utf16().chain(std::iter::once(0)).collect(); - let mut label_rect = RECT { - left: current_x, - top: 0, - right: current_x + item.label_width, - bottom: win_height_i32, - }; - SetTextColor(mem_dc, font_color); - DrawTextW( - mem_dc, - wide_label.as_ptr(), - (wide_label.len() - 1) as i32, - &mut label_rect, - DT_RIGHT | DT_VCENTER | DT_SINGLELINE, - ); - } - - let value_x = if item.label.is_empty() { - current_x - } else { - current_x + item.label_width + gap - }; - let wide_value: Vec = item.value.encode_utf16().chain(std::iter::once(0)).collect(); - let mut value_rect = RECT { - left: value_x, - top: 0, - right: value_x + item.value_width, - bottom: win_height_i32, - }; - - let mut color: u32 = font_color; - if let Some(custom_color) = item.custom_color { - color = custom_color; - } else if !item.label.is_empty() && !item.value.contains("--") - && (item.value.contains("°C") || item.value.contains('%') || item.value.bytes().all(|b| b.is_ascii_digit())) - { - let mut num_str = String::new(); - for ch in item.value.chars() { - if ch.is_ascii_digit() || ch == '.' { - num_str.push(ch); - } else if !num_str.is_empty() { - break; - } - } - if !num_str.is_empty() { - if let Ok(nf) = num_str.parse::() { - let nv = nf as i32; - if nv < 50 { - color = 0x0000FF00; - } else if nv < 80 { - color = 0x0000FFFF; - } else { - color = 0x000000FF; - } - } - } - } - - SetTextColor(mem_dc, color); - DrawTextW( - mem_dc, - wide_value.as_ptr(), - (wide_value.len() - 1) as i32, - &mut value_rect, - DT_LEFT | DT_VCENTER | DT_SINGLELINE, - ); - - current_x += item.total_width; - } - - SelectObject(mem_dc, old_font); - - // Fix alpha for text pixels: GDI sets RGB but alpha stays 0 - if !bits.is_null() { - let pixels = std::slice::from_raw_parts_mut( - bits as *mut u32, - (dib_width * dib_height) as usize, - ); - for pixel in pixels.iter_mut() { - let alpha = (*pixel >> 24) & 0xFF; - let rgb = *pixel & 0x00FFFFFF; - if alpha == 0 && rgb != 0 { - *pixel = 0xFF000000 | rgb; - } - } - } - - // --- Position and composite via UpdateLayeredWindow --- - let screen_width = GetSystemMetrics(SM_CXSCREEN); - let default_x = (screen_width - dib_width) / 2; - let use_x = settings.position_x.unwrap_or(default_x); - let use_y = settings.position_y.unwrap_or(4); - - let ppt_dst = POINT { x: use_x, y: use_y }; - let psize = SIZE { cx: dib_width, cy: dib_height }; - let ppt_src = POINT { x: 0, y: 0 }; - let blend = BLENDFUNCTION { - BlendOp: AC_SRC_OVER as u8, - BlendFlags: 0, - SourceConstantAlpha: 255, - AlphaFormat: AC_SRC_ALPHA as u8, - }; - - UpdateLayeredWindow( - hwnd, - ptr::null_mut(), - &ppt_dst, - &psize, - mem_dc, - &ppt_src, - 0, - &blend, - ULW_ALPHA, - ); - - SelectObject(mem_dc, old_bmp); - DeleteObject(hbitmap as HGDIOBJ); - DeleteDC(mem_dc); - DeleteObject(hfont as _); - } - - pub unsafe extern "system" fn window_proc( - hwnd: HWND, - msg: u32, - wparam: WPARAM, - lparam: LPARAM, - ) -> LRESULT { - match msg { - WM_PAINT => { - let mut ps = PAINTSTRUCT { - hdc: ptr::null_mut(), - fErase: 0, - rcPaint: RECT { - left: 0, - top: 0, - right: 0, - bottom: 0, - }, - fRestore: 0, - fIncUpdate: 0, - rgbReserved: [0u8; 32], - }; - BeginPaint(hwnd, &mut ps); - EndPaint(hwnd, &ps); - 0 - } - WM_TIMER => { - // 定时器 0.5s 刷新 - SetTimer(hwnd, 1, 500, None); - let data = super::collect_hardware_data(); - *super::CURRENT_HARDWARE_DATA.lock().unwrap() = Some(data.clone()); - let settings = super::get_or_init_settings(); - if settings.style == "dynamic_island" { - draw_overlay_content_dynamic_island(hwnd, &settings, &data); - } else { - draw_overlay_content(hwnd, &settings, &data); - } - 0 - } - WM_NCHITTEST => { - // 拖动模式下返回 HTCAPTION 允许拖动 - if super::DRAG_MODE.load(std::sync::atomic::Ordering::SeqCst) { - HTCAPTION as LRESULT - } else { - DefWindowProcW(hwnd, msg, wparam, lparam) - } - } - WM_EXITSIZEMOVE => { - // 拖动结束后只保存位置,不退出拖动模式 - // 退出由前端按钮控制,避免样式切换导致位置重置 - if super::DRAG_MODE.load(std::sync::atomic::Ordering::SeqCst) { - // 获取当前窗口位置 - let mut rect = RECT { left: 0, top: 0, right: 0, bottom: 0 }; - GetWindowRect(hwnd, &mut rect); - - // 保存位置到设置 - { - let mut settings_lock = super::CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref mut settings) = *settings_lock { - settings.position_x = Some(rect.left); - settings.position_y = Some(rect.top); - } - } - - // 标记位置已变更 - super::POSITION_CHANGED.store(true, std::sync::atomic::Ordering::SeqCst); - } - 0 - } - WM_DESTROY => { - PostQuitMessage(0); - 0 - } - _ => DefWindowProcW(hwnd, msg, wparam, lparam), - } - } -} - -// 设置拖动模式 -pub fn set_drag_mode(enabled: bool) { - DRAG_MODE.store(enabled, Ordering::SeqCst); - - #[cfg(target_os = "windows")] - unsafe { - let hwnd = OVERLAY_HANDLE.load(Ordering::SeqCst); - if !hwnd.is_null() { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - - // 获取当前窗口样式 - let ex_style = GetWindowLongW(hwnd, GWL_EXSTYLE) as u32; - - if enabled { - // 进入拖动模式:移除 WS_EX_TRANSPARENT - let new_style = ex_style & !WS_EX_TRANSPARENT; - SetWindowLongW(hwnd, GWL_EXSTYLE, new_style as i32); - } else { - // 退出拖动模式:恢复 WS_EX_TRANSPARENT - let new_style = ex_style | WS_EX_TRANSPARENT; - SetWindowLongW(hwnd, GWL_EXSTYLE, new_style as i32); - } - - // 刷新窗口样式 - SetWindowPos( - hwnd, - HWND_TOPMOST, - 0, - 0, - 0, - 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED, - ); - } - } -} - -#[cfg(target_os = "windows")] -pub fn start_overlay(settings: OverlaySettings) -> Result { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - - if OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Ok(OverlayResult { - success: true, - message: "悬浮框已处于启用状态".to_string(), - }); - } - - OVERLAY_ACTIVE.store(true, Ordering::SeqCst); - - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - *settings_lock = Some(settings.clone()); - } - - thread::spawn(move || { - use windows::Win32::System::Com::{CoInitializeEx, CoUninitialize, COINIT_MULTITHREADED}; - - crate::game_ping::start_ping_thread(); - crate::game_fps::start_fps_monitor(); - - let com_initialized = unsafe { CoInitializeEx(None, COINIT_MULTITHREADED).is_ok() }; - if !com_initialized { - log::warn!("悬浮框线程初始化 COM 失败,网易云歌词功能可能不可用"); - } - - unsafe { - match win32::create_overlay_window(&settings) { - std::result::Result::Ok(hwnd) => { - OVERLAY_HANDLE.store(hwnd, Ordering::SeqCst); - crate::game_fps::set_overlay_hwnd(hwnd as u64); - - if settings.style == "dynamic_island" { - win32::draw_overlay_content_dynamic_island(hwnd, &settings, &CURRENT_HARDWARE_DATA.lock().unwrap().clone().unwrap_or_default()); - } else { - win32::draw_overlay_content(hwnd, &settings, &CURRENT_HARDWARE_DATA.lock().unwrap().clone().unwrap_or_default()); - } - - SetTimer(hwnd, 1, 500, None); - win32::install_topmost_guard(); - - let mut msg: MSG = std::mem::zeroed(); - while OVERLAY_ACTIVE.load(Ordering::SeqCst) { - while PeekMessageW(&mut msg, std::ptr::null_mut(), 0, 0, PM_REMOVE) != 0 { - if msg.message == WM_QUIT { - break; - } - TranslateMessage(&msg); - DispatchMessageW(&msg); - } - - if !OVERLAY_ACTIVE.load(Ordering::SeqCst) { - break; - } - - thread::sleep(Duration::from_millis(50)); - } - - win32::uninstall_topmost_guard(); - win32::destroy_overlay_window(hwnd); - crate::game_fps::clear_overlay_hwnd(); - OVERLAY_HANDLE.store(std::ptr::null_mut(), Ordering::SeqCst); - } - std::result::Result::Err(e) => { - log::error!("创建悬浮框窗口失败: {}", e); - OVERLAY_ACTIVE.store(false, Ordering::SeqCst); - } - } - } - - if com_initialized { - unsafe { - CoUninitialize(); - } - } - }); - - Ok(OverlayResult { - success: true, - message: "悬浮框已启动".to_string(), - }) -} - -#[cfg(target_os = "windows")] -pub fn stop_overlay() -> Result { - use windows_sys::Win32::UI::WindowsAndMessaging::PostMessageW; - use windows_sys::Win32::UI::WindowsAndMessaging::WM_CLOSE; - - if !OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Ok(OverlayResult { - success: true, - message: "悬浮框已处于关闭状态".to_string(), - }); - } - - OVERLAY_ACTIVE.store(false, Ordering::SeqCst); - - crate::game_ping::stop_ping_thread(); - crate::game_fps::stop_fps_monitor(); - - unsafe { - let hwnd = OVERLAY_HANDLE.load(Ordering::SeqCst); - if !hwnd.is_null() { - PostMessageW(hwnd, WM_CLOSE, 0, 0); - } - } - - Ok(OverlayResult { - success: true, - message: "悬浮框已关闭".to_string(), - }) -} - -#[cfg(not(target_os = "windows"))] -pub fn start_overlay(_settings: OverlaySettings) -> Result { - Err("此功能仅支持 Windows 系统".to_string()) -} - -#[cfg(not(target_os = "windows"))] -pub fn stop_overlay() -> Result { - Err("此功能仅支持 Windows 系统".to_string()) -} - -/// Check if Win32 overlay is active. -pub fn is_overlay_active() -> bool { - OVERLAY_ACTIVE.load(Ordering::SeqCst) -} - -/// Toggle overlay on/off. Used by global hotkey. -pub fn toggle_overlay(app_handle: &tauri::AppHandle) -> Result { - // 如果当前样式是竖排面板,使用 Tauri 窗口方案 - let settings = get_or_init_settings(); - if settings.style == "vertical_panel" { - return crate::vertical_overlay::toggle_vertical_overlay(app_handle); - } - - // 如果竖排悬浮框正在运行,先停止它 - if crate::vertical_overlay::is_vertical_overlay_active() { - let handle = app_handle.clone(); - let _ = tauri::async_runtime::block_on(async { - crate::vertical_overlay::stop_vertical_overlay(handle).await - }); - } - - let result = if OVERLAY_ACTIVE.load(Ordering::SeqCst) { - stop_overlay() - } else { - let settings = get_or_init_settings(); - start_overlay(settings) - }; - - if result.is_ok() { - let _ = app_handle.emit("overlay-status-changed", ()); - } - - result -} - -#[tauri::command] -pub async fn start_overlay_panel( - app_handle: tauri::AppHandle, - settings: Option, -) -> Result { - let settings = settings.unwrap_or_else(get_or_init_settings); - - if settings.style == "vertical_panel" { - return crate::vertical_overlay::start_vertical_overlay(app_handle, Some(settings)).await; - } - - // 如果竖排悬浮框正在运行,先停止它 - if crate::vertical_overlay::is_vertical_overlay_active() { - let handle = app_handle.clone(); - let _ = crate::vertical_overlay::stop_vertical_overlay(handle).await; - std::thread::sleep(Duration::from_millis(200)); - } - - start_overlay(settings) -} - -#[tauri::command] -pub async fn stop_overlay_panel(app_handle: tauri::AppHandle) -> Result { - // 停止 Win32 overlay - let win32_result = if OVERLAY_ACTIVE.load(Ordering::SeqCst) { - stop_overlay() - } else { - Ok(OverlayResult { - success: true, - message: "Win32 悬浮框未运行".to_string(), - }) - }; - - // 停止竖排悬浮框 - let vertical_result = crate::vertical_overlay::stop_vertical_overlay(app_handle).await; - - // 任一成功即视为成功 - if win32_result.is_ok() || vertical_result.is_ok() { - Ok(OverlayResult { - success: true, - message: "悬浮框已关闭".to_string(), - }) - } else { - Err("悬浮框关闭失败".to_string()) - } -} - -#[tauri::command] -pub async fn toggle_overlay_panel(app_handle: tauri::AppHandle) -> Result { - toggle_overlay(&app_handle) -} - -#[tauri::command] -pub async fn get_overlay_panel_status() -> Result { - Ok(OVERLAY_ACTIVE.load(Ordering::SeqCst) || crate::vertical_overlay::is_vertical_overlay_active()) -} - -#[tauri::command] -pub async fn get_overlay_hardware_data() -> Result { - let data = CURRENT_HARDWARE_DATA - .lock() - .unwrap() - .clone() - .unwrap_or_default(); - Ok(data) -} - -#[tauri::command] -pub async fn update_overlay_settings(app_handle: tauri::AppHandle, settings: OverlaySettings) -> Result { - let (old_style, old_font) = { - let lock = CURRENT_SETTINGS.lock().unwrap(); - let s = lock.as_ref(); - (s.map(|s| s.style.clone()), s.map(|s| s.font.clone())) - }; - let new_style = settings.style.clone(); - let new_font = settings.font.clone(); - - let _old_was_vertical = old_style.as_deref() == Some("vertical_panel"); - let new_is_vertical = new_style == "vertical_panel"; - - // 保存新设置 - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - *settings_lock = Some(settings.clone()); - } - - // 检查是否有 overlay 处于活跃状态 - let win32_active = OVERLAY_ACTIVE.load(Ordering::SeqCst); - let vertical_active = crate::vertical_overlay::is_vertical_overlay_active(); - let any_active = win32_active || vertical_active; - - // 如果有任何悬浮框处于活跃状态 - if any_active { - let style_changed = old_style.as_deref() != Some(&new_style); - let font_changed = old_font.as_deref() != Some(&new_font); - - if style_changed || font_changed { - // 停止当前的 overlay - if win32_active { - stop_overlay()?; - std::thread::sleep(Duration::from_millis(200)); - } - if vertical_active { - let _ = crate::vertical_overlay::stop_vertical_overlay(app_handle.clone()).await; - std::thread::sleep(Duration::from_millis(200)); - } - - // 如果有活跃的 overlay,启动新样式的 overlay - if any_active { - if new_is_vertical { - let _ = crate::vertical_overlay::start_vertical_overlay(app_handle, Some(settings)).await; - } else { - start_overlay(settings)?; - let _ = app_handle.emit("overlay-status-changed", ()); - } - } - } else if new_is_vertical { - // 竖排面板且样式未变,仅推送设置更新 - let _ = app_handle.emit("vertical-overlay-settings", &settings); - } else { - // Win32 overlay 且样式未变,直接重绘 - #[cfg(target_os = "windows")] - unsafe { - let hwnd = OVERLAY_HANDLE.load(Ordering::SeqCst); - if !hwnd.is_null() { - let data = CURRENT_HARDWARE_DATA.lock().unwrap().clone().unwrap_or_default(); - let current_settings = CURRENT_SETTINGS.lock().unwrap().clone().unwrap_or_default(); - if new_style == "dynamic_island" { - win32::draw_overlay_content_dynamic_island(hwnd, ¤t_settings, &data); - } else { - win32::draw_overlay_content(hwnd, ¤t_settings, &data); - } - } - } - } - } - - Ok(OverlayResult { - success: true, - message: "设置已更新".to_string(), - }) -} - -#[tauri::command] -pub async fn set_overlay_drag_mode(enabled: bool) -> Result { - if !OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Err("悬浮框未启用".to_string()); - } - - #[cfg(target_os = "windows")] - unsafe { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - use windows_sys::Win32::Foundation::RECT; - - let hwnd = OVERLAY_HANDLE.load(Ordering::SeqCst); - if hwnd.is_null() { - return Err("悬浮框窗口不存在".to_string()); - } - - if !enabled { - // 退出拖动模式时,先保存当前位置 - let mut rect = RECT { left: 0, top: 0, right: 0, bottom: 0 }; - GetWindowRect(hwnd, &mut rect); - - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref mut settings) = *settings_lock { - settings.position_x = Some(rect.left); - settings.position_y = Some(rect.top); - } - } - } - - // 切换拖动模式 - set_drag_mode(enabled); - - if !enabled { - // 退出拖动模式后,恢复窗口到保存的位置 - let (saved_x, saved_y) = { - let settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref settings) = *settings_lock { - (settings.position_x, settings.position_y) - } else { - (None, None) - } - }; - - // 获取当前位置 - let mut rect = RECT { left: 0, top: 0, right: 0, bottom: 0 }; - GetWindowRect(hwnd, &mut rect); - - // 如果位置发生变化,恢复到保存的位置 - if let (Some(sx), Some(sy)) = (saved_x, saved_y) { - if rect.left != sx || rect.top != sy { - SetWindowPos( - hwnd, - HWND_TOPMOST, - sx, - sy, - 0, - 0, - SWP_NOSIZE | SWP_NOACTIVATE, - ); - } - } - - POSITION_CHANGED.store(false, Ordering::SeqCst); - } - } - - let message = if enabled { - "已进入拖动模式".to_string() - } else { - "已退出拖动模式".to_string() - }; - - Ok(OverlayResult { - success: true, - message, - }) -} - -#[tauri::command] -pub async fn get_overlay_current_settings() -> Result { - let mut settings = CURRENT_SETTINGS.lock().unwrap().clone().unwrap_or_default(); - // 合并默认项:新增的显示项自动追加到已有设置中 - let defaults = default_display_items(); - let mut merged = false; - for default_item in &defaults { - if !settings.display_items.iter().any(|i| i.id == default_item.id) { - settings.display_items.push(default_item.clone()); - merged = true; - } - } - drop(defaults); // 释放借用 - if merged { - let mut lock = CURRENT_SETTINGS.lock().unwrap(); - *lock = Some(settings.clone()); - } - Ok(settings) -} - -#[tauri::command] -pub async fn check_drag_mode_status() -> Result { - // 返回当前拖动模式状态 - Ok(DRAG_MODE.load(Ordering::SeqCst)) -} - -#[tauri::command] -pub async fn reset_overlay_position() -> Result { - if !OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Err("悬浮框未启用".to_string()); - } - - #[cfg(target_os = "windows")] - unsafe { - use windows_sys::Win32::UI::WindowsAndMessaging::*; - - let hwnd = OVERLAY_HANDLE.load(Ordering::SeqCst); - if hwnd.is_null() { - return Err("悬浮框窗口不存在".to_string()); - } - - // 清除已保存的位置,恢复默认居中 - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref mut settings) = *settings_lock { - settings.position_x = None; - settings.position_y = None; - } - } - - // 获取当前窗口大小 - let mut rect = std::mem::zeroed(); - GetWindowRect(hwnd, &mut rect); - let win_w = rect.right - rect.left; - let win_h = rect.bottom - rect.top; - - // 计算居中位置 - let screen_width = GetSystemMetrics(SM_CXSCREEN); - let screen_height = GetSystemMetrics(SM_CYSCREEN); - let new_x = (screen_width - win_w) / 2; - let new_y = (screen_height - win_h) / 2; - - // 移动窗口到居中位置 - SetWindowPos( - hwnd, - HWND_TOPMOST, - new_x, - new_y, - 0, - 0, - SWP_NOSIZE | SWP_NOACTIVATE, - ); - } - - Ok(OverlayResult { - success: true, - message: "位置已重置为默认".to_string(), - }) -} - -pub fn stop_hardware_poller() { - BACKGROUND_POLLER_ACTIVE.store(false, Ordering::SeqCst); -} - -pub fn start_hardware_poller() { - if BACKGROUND_POLLER_ACTIVE.load(Ordering::SeqCst) { - return; - } - BACKGROUND_POLLER_ACTIVE.store(true, Ordering::SeqCst); - thread::spawn(|| { - while BACKGROUND_POLLER_ACTIVE.load(Ordering::SeqCst) { - let data = collect_hardware_data(); - *CURRENT_HARDWARE_DATA.lock().unwrap() = Some(data.clone()); - - // 推送到硬件报告记录器(timestamp / elapsed_sec 由 push_snapshot 内部填充) - crate::hardware_report::push_snapshot(crate::hardware_report::HardwareSnapshot { - timestamp: String::new(), - elapsed_sec: 0, - cpu_usage: data.cpu_usage.map(|v| v as f64), - cpu_temp: data.cpu_temp, - cpu_clock: data.cpu_clock.map(|v| v as f64), - cpu_voltage: data.cpu_voltage, - cpu_power: data.cpu_power, - cpu_fan_speed: data.cpu_fan_speed.map(|v| v as f64), - gpu_usage: data.gpu_usage.map(|v| v as f64), - gpu_temp: data.gpu_temp, - gpu_clock: data.gpu_clock.map(|v| v as f64), - gpu_voltage: data.gpu_voltage, - gpu_power: data.gpu_power.map(|v| v as f64), - gpu_fan_speed: data.gpu_fan_speed.map(|v| v as f64), - gpu_vram_used: data.gpu_vram_used.map(|v| v as f64), - gpu_vram_total: data.gpu_vram_total.map(|v| v as f64), - gpu_memory_clock: data.gpu_memory_clock.map(|v| v as f64), - memory_usage: data.memory_usage, - ssd_temp: data.ssd_temp, - }); - - thread::sleep(Duration::from_millis(1000)); - } - }); -} - -pub fn cleanup() { - stop_hardware_poller(); - if OVERLAY_ACTIVE.load(Ordering::SeqCst) { - let _ = stop_overlay(); - } - crate::game_ping::cleanup(); - crate::game_fps::cleanup(); - #[cfg(target_os = "windows")] - unsafe { - win32::shutdown_gdiplus(); - } -} - -#[tauri::command] -pub async fn run_pawnio_setup() -> Result { - let exe_dir = std::env::current_exe() - .map_err(|e| format!("获取程序路径失败: {}", e))?; - let parent_dir = exe_dir.parent().ok_or("无法获取父目录")?; - - let candidates = [ - parent_dir.join("PawnIO_setup.exe"), - parent_dir.join("_up_").join("PawnIO_setup.exe"), - parent_dir.join("resources").join("PawnIO_setup.exe"), - ]; - - for path in &candidates { - if path.exists() { - match std::process::Command::new(path).spawn() { - Ok(_) => return Ok("安装程序已启动".to_string()), - Err(e) => return Err(format!("启动安装程序失败: {}", e)), - } - } - } - - Err("未找到 PawnIO_setup.exe,请确保已将其放在程序目录下".to_string()) -} - - - - - diff --git a/参考/NexBox-main/src-tauri/src/sensor.rs b/参考/NexBox-main/src-tauri/src/sensor.rs deleted file mode 100644 index 192f343..0000000 --- a/参考/NexBox-main/src-tauri/src/sensor.rs +++ /dev/null @@ -1,404 +0,0 @@ -use std::io::{BufRead, BufReader, Write}; -use std::process::{Child, Command, Stdio}; -use std::sync::Mutex; - -use serde::{Deserialize, Serialize}; -use tauri::{App, AppHandle, Manager}; - -pub struct SensorChild(pub Mutex>); - -/// LHML 传感器单条数据(与 C# SensorReading 对齐) -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SensorReading { - pub hardware: String, - #[serde(rename = "hardwareType")] - pub hardware_type: String, - #[serde(rename = "subHardware")] - pub sub_hardware: Option, - pub name: String, - #[serde(rename = "sensorType")] - pub sensor_type: String, - pub value: f64, - pub unit: Option, -} - -/// LHML 传感器响应(与 C# SensorsResponse 对齐) -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SensorsResponse { - #[serde(rename = "updatedAt")] - pub updated_at: String, - pub sensors: Vec, -} - -/// 管道桥接:管理 NexBoxMonitor 子进程的 stdin/stdout -pub struct SensorBridge { - child: Child, - reader: BufReader, - writer: std::process::ChildStdin, -} - -impl SensorBridge { - /// 发送读取命令,返回传感器数据 - pub fn read_sensors(&mut self) -> Result { - // 发送命令 - writeln!(self.writer, r#"{{"cmd":"read"}}"#) - .map_err(|e| format!("写入管道失败: {}", e))?; - self.writer - .flush() - .map_err(|e| format!("刷新管道失败: {}", e))?; - - // 读取响应 - let mut line = String::new(); - self.reader - .read_line(&mut line) - .map_err(|e| format!("读取管道失败: {}", e))?; - - if line.trim().is_empty() { - return Err("子进程返回空响应".to_string()); - } - - serde_json::from_str::(&line) - .map_err(|e| format!("解析传感器JSON失败: {}", e)) - } - - /// 检查子进程是否仍然存活 - pub fn is_alive(&mut self) -> bool { - match self.child.try_wait() { - Ok(None) => true, - _ => false, - } - } - - /// 优雅关闭子进程(最多等待 3 秒,超时则强制终止) - pub fn shutdown(&mut self) { - let _ = writeln!(self.writer, r#"{{"cmd":"exit"}}"#); - let _ = self.writer.flush(); - let start = std::time::Instant::now(); - loop { - match self.child.try_wait() { - Ok(Some(_)) => break, - Ok(None) => { - if start.elapsed() > std::time::Duration::from_secs(3) { - log::warn!("NexBoxMonitor 子进程未在 3s 内退出,强制终止"); - let _ = self.child.kill(); - let _ = self.child.wait(); - break; - } - std::thread::sleep(std::time::Duration::from_millis(100)); - } - Err(e) => { - log::warn!("等待 NexBoxMonitor 退出出错: {}", e); - let _ = self.child.kill(); - break; - } - } - } - } -} - -/// 全局传感器桥接 -static SENSOR_BRIDGE: Mutex> = Mutex::new(None); - -/// 启动传感器子进程 -pub fn start_sensor_process(app: &App) { - match spawn_sensor() { - Ok(Some(bridge)) => { - log::info!("已启动 NexBoxMonitor 子进程 (pid={})", bridge.child.id()); - *SENSOR_BRIDGE.lock().unwrap() = Some(bridge); - app.manage(SensorChild(Mutex::new(None))); // 保持兼容 - } - Ok(None) => { - log::info!("NexBoxMonitor 未找到,跳过启动"); - app.manage(SensorChild(Mutex::new(None))); - } - Err(e) => { - log::warn!("启动 NexBoxMonitor 失败: {e}"); - app.manage(SensorChild(Mutex::new(None))); - } - } -} - -/// 停止传感器子进程 -pub fn stop_sensor_process(app: &AppHandle) { - // 先处理旧的 SensorChild(兼容) - if let Some(state) = app.try_state::() { - let child = { - let mut guard = state - .0 - .lock() - .unwrap_or_else(|poisoned| poisoned.into_inner()); - guard.take() - }; - if let Some(mut child) = child { - log::info!("正在停止传感器子进程 (pid={})", child.id()); - let _ = child.kill(); - let _ = child.wait(); - } - } - - // 关闭新的 SensorBridge - if let Some(mut bridge) = SENSOR_BRIDGE.lock().unwrap().take() { - log::info!("正在关闭 NexBoxMonitor 子进程 (pid={})", bridge.child.id()); - bridge.shutdown(); - } -} - -#[tauri::command] -pub async fn get_lhm_cpu_load() -> Result, String> { - match read_lhm_sensors() { - Ok(response) => { - for s in &response.sensors { - if s.hardware_type.eq_ignore_ascii_case("CPU") - && s.sensor_type == "Load" - && (s.name == "CPU Total" || s.name == "Total") - { - return Ok(Some(s.value as u16)); - } - } - Ok(None) - } - Err(e) => { - log::warn!("LHML CPU load 读取失败: {e}"); - Ok(None) - } - } -} - -#[tauri::command] -pub async fn get_lhm_cpu_status() -> Result<(Option, Option), String> { - match read_lhm_sensors() { - Ok(response) => { - let mut load = None; - let mut temp = None; - for s in &response.sensors { - if s.hardware_type.eq_ignore_ascii_case("CPU") { - if s.sensor_type == "Load" && (s.name == "CPU Total" || s.name == "Total") { - load = Some(s.value as u16); - } - if s.sensor_type == "Temperature" - && (s.name == "Core (Tctl/Tdie)" || s.name == "CPU Package" || s.name == "Tctl" || s.name == "Core") - { - temp = Some(s.value); - } - } - } - Ok((load, temp)) - } - Err(e) => { - log::warn!("LHML CPU status 读取失败: {e}"); - Ok((None, None)) - } - } -} - -#[tauri::command] -pub async fn get_lhm_gpu_status() -> Result, Option)>, String> { - match read_lhm_sensors() { - Ok(response) => { - let gpu_hardware_types: Vec<_> = { - let mut types: Vec<_> = response.sensors.iter() - .filter(|s| s.hardware_type.to_lowercase().starts_with("gpu")) - .map(|s| s.hardware_type.clone()) - .collect(); - types.dedup(); - types - }; - - // 判断是否存在 NVIDIA 独显(仅 NVIDIA 明确是独显,AMD 可能是 APU 核显) - let has_nvidia = gpu_hardware_types.iter().any(|t| { - t.eq_ignore_ascii_case("GpuNvidia") - }); - - let mut results = Vec::new(); - for hw_type in &gpu_hardware_types { - // NVIDIA 独显存在时跳过 Intel 核显,AMD 核显保留显示 - if has_nvidia && hw_type.eq_ignore_ascii_case("GpuIntel") { - log::info!("跳过核显(LHML): 存在 NVIDIA 独显,忽略 GpuIntel"); - continue; - } - let temp = response.sensors.iter() - .filter(|s| s.hardware_type == *hw_type && s.sensor_type == "Temperature" && s.name == "GPU Core") - .map(|s| s.value) - .next(); - let usage = response.sensors.iter() - .filter(|s| s.hardware_type == *hw_type && s.sensor_type == "Load" && s.name == "GPU Core") - .map(|s| s.value as u32) - .next(); - results.push((temp, usage)); - } - Ok(results) - } - Err(e) => { - log::warn!("LHML GPU status 读取失败: {e}"); - Ok(Vec::new()) - } - } -} - -/// 从 LHML 读取传感器数据(供 overlay_panel.rs 调用) -pub fn read_lhm_sensors() -> Result { - let mut guard = SENSOR_BRIDGE - .lock() - .map_err(|e| format!("锁获取失败: {}", e))?; - - match guard.as_mut() { - Some(bridge) => { - if !bridge.is_alive() { - log::warn!("NexBoxMonitor 子进程已退出,尝试重启..."); - *guard = None; - drop(guard); - match spawn_sensor() { - Ok(Some(new_bridge)) => { - log::info!("NexBoxMonitor 重启成功 (pid={})", new_bridge.child.id()); - *SENSOR_BRIDGE.lock().unwrap() = Some(new_bridge); - return Err("子进程已重启,请重试".to_string()); - } - _ => return Err("NexBoxMonitor 不可用".to_string()), - } - } - bridge.read_sensors() - } - None => { - // 尝试启动 - drop(guard); - match spawn_sensor() { - Ok(Some(bridge)) => { - log::info!("延迟启动 NexBoxMonitor (pid={})", bridge.child.id()); - *SENSOR_BRIDGE.lock().unwrap() = Some(bridge); - Err("子进程已启动,请重试".to_string()) - } - _ => Err("NexBoxMonitor 不可用".to_string()), - } - } - } -} - -/// 查找 NexBoxMonitor.exe 路径 -fn find_monitor_exe() -> Option { - // 获取 exe 所在目录作为基准 - let exe_dir = std::env::current_exe() - .ok()? - .parent() - .map(|p| p.to_path_buf()) - .unwrap_or(std::path::PathBuf::from(".")); - - let exe_name = "NexBoxMonitor.exe"; - - // 定义所有要探测的候选路径生成器 - // 参数 base: 基准目录, sub: 子路径后缀 - let candidates: Vec = { - let mut list = Vec::new(); - let suffixes = [ - // 方案A: 安装版 — {app}/monitor/NexBoxMonitor.exe - // Inno Setup 把 publish/* 复制到 {app}/monitor/ - "monitor", - // 方案B: 用户描述的路径 — {app}/NexBox/monitor/NexBoxMonitor.exe - "NexBox/monitor", - // 方案C: Tauri 资源目录 - "resources/monitor", - // 方案D: 旧版开发者构建路径 - "monitor/bin/Release/net48", - // 方案E: publish 输出 - "monitor/bin/Release/net48", - ]; - for suffix in &suffixes { - let p = exe_dir.join(suffix).join(exe_name); - list.push(p); - } - list - }; - - // 一次性检查所有候选路径 - for path in &candidates { - if path.exists() { - log::info!("找到 NexBoxMonitor: {}", path.display()); - return Some(path.clone()); - } - } - - // 方案F: 从 exe 目录向上回溯,查找项目根目录下的 monitor 构建产物 - // 开发环境下 exe 位于 src-tauri/target/{debug,release}/nexbox.exe - let mut probe = exe_dir.clone(); - for _ in 0..5 { - // 每层尝试: monitor/bin/Release/net48 - let p1 = probe - .join("monitor") - .join("bin") - .join("Release") - .join("net48") - .join(exe_name); - if p1.exists() { - log::info!("找到 NexBoxMonitor (probe): {}", p1.display()); - return Some(p1); - } - if !probe.pop() { - break; - } - } - - // 方案G: 通过 CARGO_MANIFEST_DIR 编译期路径(仅 debug 构建,纯备用) - #[cfg(debug_assertions)] - { - let base = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap().to_path_buf(); - let dev_path = base - .join("monitor") - .join("bin") - .join("Release") - .join("net48") - .join(exe_name); - if dev_path.exists() { - log::info!("找到 NexBoxMonitor (dev): {}", dev_path.display()); - return Some(dev_path); - } - let pub_path = base - .join("monitor") - .join("bin") - .join("Release") - .join("net48") - .join(exe_name); - if pub_path.exists() { - log::info!("找到 NexBoxMonitor (publish): {}", pub_path.display()); - return Some(pub_path); - } - } - - log::warn!( - "未找到 NexBoxMonitor.exe (exe_dir: {}), 已尝试路径: {:?}", - exe_dir.display(), - candidates.iter().map(|p| p.display().to_string()).collect::>() - ); - None -} - -fn spawn_sensor() -> std::io::Result> { - let exe_path = match find_monitor_exe() { - Some(p) => p, - None => return Ok(None), - }; - - let mut cmd = Command::new(&exe_path); - cmd.stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::null()); - - // Windows 下隐藏控制台窗口 - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - const CREATE_NO_WINDOW: u32 = 0x08000000; - cmd.creation_flags(CREATE_NO_WINDOW); - } - - let mut child = cmd.spawn()?; - - let stdin = child.stdin.take().expect("无法获取子进程 stdin"); - let stdout = child.stdout.take().expect("无法获取子进程 stdout"); - - let bridge = SensorBridge { - child, - reader: BufReader::new(stdout), - writer: stdin, - }; - - Ok(Some(bridge)) -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/src/shader_cache.rs b/参考/NexBox-main/src-tauri/src/shader_cache.rs deleted file mode 100644 index d2cdea3..0000000 --- a/参考/NexBox-main/src-tauri/src/shader_cache.rs +++ /dev/null @@ -1,293 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::path::{Path, PathBuf}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ShaderCacheDir { - pub name: String, - pub path: String, - pub exists: bool, - pub size_bytes: u64, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct VendorScanResult { - pub vendor: String, - pub dirs: Vec, - pub total_dirs: u64, - pub total_size: u64, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ScanResult { - pub nvidia: VendorScanResult, - pub amd: VendorScanResult, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CleanResult { - pub success: bool, - pub message: String, - pub freed_bytes: u64, - pub reboot_pending_count: u64, -} - -// ── Windows 宽字符转换 ── -fn to_wide(s: &str) -> Vec { - use std::os::windows::ffi::OsStrExt; - std::ffi::OsStr::new(s).encode_wide().chain(Some(0)).collect() -} - -// ── 目录大小扫描 ── -fn get_dir_size(path: &std::path::Path) -> u64 { - let mut total = 0; - if let Ok(entries) = fs::read_dir(path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - total += get_dir_size(&p); - } else if let Ok(metadata) = fs::metadata(&p) { - total += metadata.len(); - } - } - } - total -} - -fn scan_cache_dir(name: &str, path: PathBuf) -> ShaderCacheDir { - let exists = path.exists() && path.is_dir(); - let size_bytes = if exists { get_dir_size(&path) } else { 0 }; - ShaderCacheDir { - name: name.to_string(), - path: path.to_string_lossy().to_string(), - exists, - size_bytes, - } -} - -fn get_local_app_data() -> Option { - dirs::data_local_dir() -} - -fn get_local_low_dir() -> Option { - dirs::home_dir().map(|h| h.join("AppData").join("LocalLow")) -} - -fn get_nvidia_dirs(base: &PathBuf) -> Vec { - vec![ - scan_cache_dir("NVIDIA DXCache", base.join("NVIDIA").join("DXCache")), - scan_cache_dir("NVIDIA GLCache", base.join("NVIDIA").join("GLCache")), - scan_cache_dir( - "NVIDIA Corporation NV_Cache", - base.join("NVIDIA Corporation").join("NV_Cache"), - ), - ] -} - -fn get_amd_dirs(local: &PathBuf, local_low: &PathBuf) -> Vec { - vec![ - scan_cache_dir("AMD DxCache", local.join("AMD").join("DxCache")), - scan_cache_dir("AMD GLCache", local.join("AMD").join("GLCache")), - scan_cache_dir("AMD VkCache", local.join("AMD").join("VkCache")), - scan_cache_dir("AMD DxcCache", local.join("AMD").join("DxcCache")), - scan_cache_dir("AMD LocalLow DxCache", local_low.join("AMD").join("DxCache")), - scan_cache_dir("AMD LocalLow GLCache", local_low.join("AMD").join("GLCache")), - scan_cache_dir("AMD LocalLow VkCache", local_low.join("AMD").join("VkCache")), - ] -} - -fn build_vendor_result(vendor: &str, dirs: Vec) -> VendorScanResult { - let total_dirs = dirs.iter().filter(|d| d.exists).count() as u64; - let total_size = dirs.iter().map(|d| d.size_bytes).sum(); - VendorScanResult { - vendor: vendor.to_string(), - dirs, - total_dirs, - total_size, - } -} - -// ── 强制删除 Windows API 封装 ── -/// 尝试删除单个文件,失败返回 false -fn force_delete_file(path: &Path) -> bool { - use windows_sys::Win32::Storage::FileSystem::DeleteFileW; - let wide = to_wide(&path.to_string_lossy()); - unsafe { DeleteFileW(wide.as_ptr()) != 0 } -} - -/// 尝试删除空目录 -fn force_remove_dir(path: &Path) -> bool { - use windows_sys::Win32::Storage::FileSystem::RemoveDirectoryW; - let wide = to_wide(&path.to_string_lossy()); - unsafe { RemoveDirectoryW(wide.as_ptr()) != 0 } -} - -/// 将文件/目录标记为重启后删除(MoveFileEx + MOVEFILE_DELAY_UNTIL_REBOOT) -fn schedule_reboot_delete(path: &Path) -> bool { - use windows_sys::Win32::Storage::FileSystem::{MoveFileExW, MOVEFILE_DELAY_UNTIL_REBOOT}; - let wide = to_wide(&path.to_string_lossy()); - unsafe { MoveFileExW(wide.as_ptr(), std::ptr::null(), MOVEFILE_DELAY_UNTIL_REBOOT) != 0 } -} - -/// 强制删除目录内容: -/// - 文件:先尝试 DeleteFileW,失败则 MoveFileExW 调度重启删除 -/// - 目录:递归处理后 RemoveDirectoryW,仍存在则调度重启删除 -/// 返回 (已删除字节数, 调度重启删除的文件数) -fn force_delete_contents(path: &Path, deleted_bytes: &mut u64, reboot_count: &mut u64) { - if let Ok(entries) = fs::read_dir(path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - force_delete_contents(&p, deleted_bytes, reboot_count); - // 尝试删除空子目录 - if p.exists() { - force_remove_dir(&p); - } - // 如果目录仍然存在,标记重启删除 - if p.exists() { - schedule_reboot_delete(&p); - *reboot_count += 1; - } - } else { - let file_size = fs::metadata(&p).map(|m| m.len()).unwrap_or(0); - if force_delete_file(&p) { - *deleted_bytes += file_size; - } else { - // 文件被锁定,调度重启后删除 - if schedule_reboot_delete(&p) { - *deleted_bytes += file_size; - *reboot_count += 1; - } - } - } - } - } -} - -/// 强制清理单个缓存目录: -/// 1. 先尝试常规 remove_dir_all(最快) -/// 2. 失败则逐文件强制删除 + MoveFileEx 调度重启删除 -/// 返回 (已删除字节数, 重启删除项数) -fn force_clean_one_dir(dir_path: &Path) -> (u64, u64) { - if !dir_path.exists() { - return (0, 0); - } - - let before_size = get_dir_size(dir_path); - - // 第一步:尝试常规删除 - if fs::remove_dir_all(dir_path).is_ok() { - return (before_size, 0); - } - - // 第二步:逐文件强制删除 + 调度重启删除 - let mut deleted_bytes: u64 = 0; - let mut reboot_count: u64 = 0; - force_delete_contents(dir_path, &mut deleted_bytes, &mut reboot_count); - - // 第三步:尝试删除根目录本身 - if dir_path.exists() { - force_remove_dir(dir_path); - } - if dir_path.exists() { - schedule_reboot_delete(dir_path); - reboot_count += 1; - } - - (deleted_bytes, reboot_count) -} - -fn format_size(bytes: u64) -> String { - if bytes < 1024 { - format!("{} B", bytes) - } else if bytes < 1024 * 1024 { - format!("{:.1} KB", bytes as f64 / 1024.0) - } else if bytes < 1024 * 1024 * 1024 { - format!("{:.1} MB", bytes as f64 / (1024.0 * 1024.0)) - } else { - format!("{:.2} GB", bytes as f64 / (1024.0 * 1024.0 * 1024.0)) - } -} - -// ── Tauri 命令 ── - -#[tauri::command] -pub async fn scan_shader_caches() -> Result { - let local_app_data = get_local_app_data().ok_or("无法获取 LocalAppData 目录")?; - let local_low = get_local_low_dir().ok_or("无法获取 LocalLow 目录")?; - - let nvidia_dirs = get_nvidia_dirs(&local_app_data); - let amd_dirs = get_amd_dirs(&local_app_data, &local_low); - - Ok(ScanResult { - nvidia: build_vendor_result("nvidia", nvidia_dirs), - amd: build_vendor_result("amd", amd_dirs), - }) -} - -#[tauri::command] -pub async fn clean_shader_cache(vendor: String) -> Result { - let local_app_data = get_local_app_data().ok_or("无法获取 LocalAppData 目录")?; - let local_low = get_local_low_dir().ok_or("无法获取 LocalLow 目录")?; - - let target_dirs: Vec = match vendor.as_str() { - "nvidia" => vec![ - local_app_data.join("NVIDIA").join("DXCache"), - local_app_data.join("NVIDIA").join("GLCache"), - local_app_data.join("NVIDIA Corporation").join("NV_Cache"), - ], - "amd" => vec![ - local_app_data.join("AMD").join("DxCache"), - local_app_data.join("AMD").join("GLCache"), - local_app_data.join("AMD").join("VkCache"), - local_app_data.join("AMD").join("DxcCache"), - local_low.join("AMD").join("DxCache"), - local_low.join("AMD").join("GLCache"), - local_low.join("AMD").join("VkCache"), - ], - _ => return Err(format!("不支持的显卡厂商: {}", vendor)), - }; - - let mut total_freed: u64 = 0; - let mut total_reboot: u64 = 0; - let mut cleaned_count = 0; - - for dir_path in target_dirs { - if !dir_path.exists() { - continue; - } - - let (freed, reboot) = force_clean_one_dir(&dir_path); - total_freed += freed; - total_reboot += reboot; - cleaned_count += 1; - } - - if cleaned_count == 0 && total_freed == 0 { - Ok(CleanResult { - success: true, - message: "没有找到需要清理的缓存目录".to_string(), - freed_bytes: 0, - reboot_pending_count: 0, - }) - } else { - let mut msg = format!( - "强制清理完成,已处理 {} 个目录,释放 {}", - cleaned_count, - format_size(total_freed) - ); - if total_reboot > 0 { - msg.push_str(&format!( - ",{} 个被占用的文件将在重启后删除", - total_reboot - )); - } - - Ok(CleanResult { - success: true, - message: msg, - freed_bytes: total_freed, - reboot_pending_count: total_reboot, - }) - } -} diff --git a/参考/NexBox-main/src-tauri/src/spectrum.rs b/参考/NexBox-main/src-tauri/src/spectrum.rs deleted file mode 100644 index 2f48d27..0000000 --- a/参考/NexBox-main/src-tauri/src/spectrum.rs +++ /dev/null @@ -1,174 +0,0 @@ -//! FxSound-compatible 10-band IIR filter bank spectrum analyzer. -//! -//! Uses the exact coefficients from FxSound's spectrumReset.cpp: -//! 10 Butterworth 2-pole resonant bandpass filters (56Hz - 10kHz, log-spaced). -//! Each filter output is squared, smoothed (100ms 1-pole LP), then sqrt. -//! No FFT — pure IIR, sample-by-sample, zero latency (ignoring delay buffer). - -#[derive(Clone)] -struct SpectrumBand { - a1: f64, - a2: f64, - gain: f64, - y1: f64, - y2: f64, - squared_filtered: f64, - level: f64, -} - -pub struct SpectrumAnalyzer { - bands: Vec, - in_1: f64, - in_2: f64, - // Smoothing coefficient - alpha: f64, - one_minus_alpha: f64, -} - -impl SpectrumAnalyzer { - /// Create a new spectrum analyzer with FxSound-compatible coefficients. - /// `sample_rate` is used to compute the smoothing time constant. - pub fn new(sample_rate: f64) -> Self { - // FxSound: alpha = exp(-time_constant / samp_freq), time_constant = 10 (100ms smooth) - let alpha = (-10.0_f64 / sample_rate).exp(); - let one_minus_alpha = 1.0 - alpha; - - // Sensitivity and warp (from FxSound spectrumReset.cpp) - let sensitivity: f64 = 4.5; - let num_channels: f64 = 2.0; // stereo - - // Band centers: 56.23, 100, 177.83, 316.23, 562.34, 1000, 1778.28, 3162.28, 5623.4, 10000 Hz - // Warp factors: [0.6, 0.6, 1.0, 1.0, 1.3, 1.3, 1.3, 1.3, 1.5, 1.5] - - Self { - bands: vec![ - // Band 1: 56.23 Hz - SpectrumBand { - a1: 1.9952707978, - a2: -0.9953348411, - gain: (sensitivity * 0.6) / (num_channels * 424.5657595), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 2: 100 Hz - SpectrumBand { - a1: 1.9915173377, - a2: -0.9917194870, - gain: (sensitivity * 0.6) / (num_channels * 239.1965397), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 3: 177.83 Hz - SpectrumBand { - a1: 1.9846835136, - a2: -0.9853206989, - gain: (sensitivity * 1.0) / (num_channels * 134.9296378), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 4: 316.23 Hz - SpectrumBand { - a1: 1.9720410075, - a2: -0.9740444157, - gain: (sensitivity * 1.0) / (num_channels * 76.31087758), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 5: 562.34 Hz - SpectrumBand { - a1: 1.9480305935, - a2: -0.9543009461, - gain: (sensitivity * 1.3) / (num_channels * 43.34342216), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 6: 1000 Hz - SpectrumBand { - a1: 1.9006550741, - a2: -0.9201218454, - gain: (sensitivity * 1.3) / (num_channels * 24.79951362), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 7: 1778.28 Hz - SpectrumBand { - a1: 1.8025225345, - a2: -0.8620772515, - gain: (sensitivity * 1.3) / (num_channels * 14.36694455), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 8: 3162.28 Hz - SpectrumBand { - a1: 1.5891186613, - a2: -0.7664106181, - gain: (sensitivity * 1.3) / (num_channels * 8.490790030), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 9: 5623.4 Hz - SpectrumBand { - a1: 1.1149497494, - a2: -0.6153052550, - gain: (sensitivity * 1.5) / (num_channels * 5.169741233), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - // Band 10: 10000 Hz - SpectrumBand { - a1: 0.1311997923, - a2: -0.3874425954, - gain: (sensitivity * 1.5) / (num_channels * 3.264452631), - y1: 0.0, y2: 0.0, squared_filtered: 0.0, level: 0.0, - }, - ], - in_1: 0.0, - in_2: 0.0, - alpha, - one_minus_alpha, - } - } - - /// Process a single stereo sample pair through the filter bank. - /// Returns the 10 band levels in range [0, 1]. - pub fn process(&mut self, left: f64, right: f64) -> [f64; 10] { - let mono_in = left + right; - - // FxSound: input_sum = in - in_2 (difference from 2 samples ago) - let input_sum = mono_in - self.in_2; - - // Process through all 10 bandpass filters - for b in &mut self.bands { - let mut out = input_sum + b.a1 * b.y1 + b.a2 * b.y2 + 1e-5; - b.y2 = b.y1; - b.y1 = out; - out *= b.gain; - - // Square, smooth, sqrt - let squared = out * out; - b.squared_filtered = - self.one_minus_alpha * squared + self.alpha * b.squared_filtered; - - // Fast sqrt approximation? No — f64::sqrt() is fast enough on modern CPUs - if b.squared_filtered > 1.0 { - b.level = 1.0; - } else { - b.level = b.squared_filtered.sqrt(); - } - } - - // Shift input buffer - self.in_2 = self.in_1; - self.in_1 = mono_in; - - let mut levels = [0.0_f64; 10]; - for (i, b) in self.bands.iter().enumerate() { - levels[i] = b.level.min(1.0); - } - levels - } - - /// Reset all filter states to zero. - #[allow(dead_code)] - pub fn reset(&mut self) { - self.in_1 = 0.0; - self.in_2 = 0.0; - for b in &mut self.bands { - b.y1 = 0.0; - b.y2 = 0.0; - b.squared_filtered = 0.0; - b.level = 0.0; - } - } -} diff --git a/参考/NexBox-main/src-tauri/src/sponsor.rs b/参考/NexBox-main/src-tauri/src/sponsor.rs deleted file mode 100644 index ed24471..0000000 --- a/参考/NexBox-main/src-tauri/src/sponsor.rs +++ /dev/null @@ -1,31 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::time::Duration; - -#[derive(Debug, Deserialize, Serialize)] -pub struct SponsorRoot { - pub update_time: String, - pub list: Vec, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct SponsorItem { - pub name: String, - pub amount: String, -} - -async fn fetch_sponsors() -> Result { - let url = "https://gitee.com/muliuawa/nexbox/raw/master/sponsors.json"; - - let client = reqwest::Client::builder() - .timeout(Duration::from_secs(5)) - .build()?; - - let resp = client.get(url).send().await?; - let data = resp.json::().await?; - Ok(data) -} - -#[tauri::command] -pub async fn get_sponsors() -> Result { - fetch_sponsors().await.map_err(|e| e.to_string()) -} diff --git a/参考/NexBox-main/src-tauri/src/startup_manager.rs b/参考/NexBox-main/src-tauri/src/startup_manager.rs deleted file mode 100644 index 535752f..0000000 --- a/参考/NexBox-main/src-tauri/src/startup_manager.rs +++ /dev/null @@ -1,327 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; -use winreg::enums::*; -use winreg::RegKey; -use winreg::types::FromRegValue; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct StartupItem { - pub name: String, - pub file_location: String, - pub location_type: String, - pub item_type: String, - pub reg_key_path: Option, - pub reg_value_name: Option, - pub folder_path: Option, - pub raw_registry_value: Option, -} - -fn expand_env_vars(s: &str) -> String { - let mut result = String::new(); - let mut chars = s.chars().peekable(); - while let Some(c) = chars.next() { - if c == '%' { - let mut var_name = String::new(); - loop { - match chars.next() { - Some('%') => break, - Some(ch) => var_name.push(ch), - None => { - result.push('%'); - result.push_str(&var_name); - return result; - } - } - } - if var_name.is_empty() { - result.push('%'); - } else if let Ok(val) = std::env::var(&var_name) { - result.push_str(&val); - } else { - result.push('%'); - result.push_str(&var_name); - result.push('%'); - } - } else { - result.push(c); - } - } - result -} - -fn sanitize_path(s: &str) -> String { - let mut s = s.to_string(); - s = s.replace('\"', ""); - let mut i; - - while s.contains('/') { - i = s.rfind('/').unwrap(); - s = s[..i].to_string(); - } - - i = s.find(".exe").unwrap_or(s.len().wrapping_sub(4)); - if i < s.len() { - s = s[..=i + 3].to_string(); - } - - s.trim().to_string() -} - -fn resolve_shortcut_target(lnk_path: &str) -> Option { - let escaped = lnk_path.replace('\'', "''"); - let ps_script = format!( - "try {{ $ws = New-Object -ComObject WScript.Shell; $sc = $ws.CreateShortcut('{}'); Write-Output $sc.TargetPath }} catch {{ exit 1 }}", - escaped - ); - let result = Command::new("powershell") - .args(&[ - "-NoProfile", - "-ExecutionPolicy", - "Bypass", - "-Command", - &ps_script, - ]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - match result { - Ok(output) if output.status.success() => { - let target = String::from_utf8_lossy(&output.stdout).trim().to_string(); - if target.is_empty() { None } else { Some(target) } - } - _ => None, - } -} - -fn scan_registry_key( - root: RegKey, - subkey_path: &str, - location_type: &str, - items: &mut Vec, -) { - if let Ok(key) = root.open_subkey_with_flags(subkey_path, KEY_READ) { - for value_result in key.enum_values() { - if let Ok((name, value)) = value_result { - if name.is_empty() || name == "(默认)" || name == "(Default)" { - continue; - } - let raw_path = match String::from_reg_value(&value) { - Ok(s) => s, - Err(_) => continue, - }; - if raw_path.trim().is_empty() { - continue; - } - let item_name = name; - let expanded = expand_env_vars(&raw_path); - let display_path = sanitize_path(&expanded); - items.push(StartupItem { - name: item_name.clone(), - file_location: display_path, - location_type: location_type.to_string(), - item_type: "Registry".to_string(), - reg_key_path: Some(format!("{}", subkey_path)), - reg_value_name: Some(item_name), - folder_path: None, - raw_registry_value: Some(raw_path), - }); - } - } - } -} - -fn scan_startup_folder( - folder: PathBuf, - location_type: &str, - items: &mut Vec, -) { - if !folder.exists() { - return; - } - if let Ok(entries) = fs::read_dir(&folder) { - for entry in entries.flatten() { - let path = entry.path(); - let file_name = match path.file_name() { - Some(n) => n.to_string_lossy().to_string(), - None => continue, - }; - let ext = path.extension().map(|e| e.to_string_lossy().to_lowercase()); - let is_exe = ext.as_deref() == Some("exe"); - let is_bat = ext.as_deref() == Some("bat") || ext.as_deref() == Some("cmd"); - let is_lnk = ext.as_deref() == Some("lnk"); - if !is_exe && !is_bat && !is_lnk { - continue; - } - let name = if let Some(stem) = path.file_stem() { - stem.to_string_lossy().to_string() - } else { - file_name.clone() - }; - let target_path = if is_lnk { - resolve_shortcut_target(&path.to_string_lossy()) - .unwrap_or_else(|| path.to_string_lossy().to_string()) - } else { - path.to_string_lossy().to_string() - }; - items.push(StartupItem { - name, - file_location: target_path, - location_type: location_type.to_string(), - item_type: "Folder".to_string(), - reg_key_path: None, - reg_value_name: None, - folder_path: Some(path.to_string_lossy().to_string()), - raw_registry_value: None, - }); - } - } -} - -fn get_user_startup_folder() -> Option { - dirs::config_dir().map(|p| { - p.join("Microsoft") - .join("Windows") - .join("Start Menu") - .join("Programs") - .join("Startup") - }) -} - -fn get_common_startup_folder() -> Option { - dirs::data_dir().map(|p| { - p.join("Microsoft") - .join("Windows") - .join("Start Menu") - .join("Programs") - .join("Startup") - }) -} - -#[tauri::command] -pub async fn scan_startup_items() -> Result, String> { - let mut items: Vec = Vec::new(); - - let hklm = || RegKey::predef(HKEY_LOCAL_MACHINE); - let hkcu = || RegKey::predef(HKEY_CURRENT_USER); - - scan_registry_key(hklm(), r"Software\Microsoft\Windows\CurrentVersion\Run", "HKLM:Run", &mut items); - scan_registry_key(hklm(), r"Software\Microsoft\Windows\CurrentVersion\RunOnce", "HKLM:RunOnce", &mut items); - - #[cfg(target_pointer_width = "64")] - { - scan_registry_key(hklm(), r"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run", "HKLM:Run (WOW64)", &mut items); - scan_registry_key(hklm(), r"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce", "HKLM:RunOnce (WOW64)", &mut items); - } - - scan_registry_key(hkcu(), r"Software\Microsoft\Windows\CurrentVersion\Run", "HKCU:Run", &mut items); - scan_registry_key(hkcu(), r"Software\Microsoft\Windows\CurrentVersion\RunOnce", "HKCU:RunOnce", &mut items); - - if let Some(user_folder) = get_user_startup_folder() { - scan_startup_folder(user_folder, "CUStartupFolder", &mut items); - } - if let Some(common_folder) = get_common_startup_folder() { - scan_startup_folder(common_folder, "LMStartupFolder", &mut items); - } - - Ok(items) -} - -#[tauri::command] -pub async fn delete_startup_item(item: StartupItem) -> Result { - if item.item_type == "Registry" { - let value_name = item.reg_value_name.as_ref().ok_or("Missing registry value name")?; - let reg_key_path = item.reg_key_path.as_ref().ok_or("Missing registry key path")?; - - let is_hklm = item.location_type.starts_with("HKLM"); - let root = if is_hklm { - RegKey::predef(HKEY_LOCAL_MACHINE) - } else { - RegKey::predef(HKEY_CURRENT_USER) - }; - - let key = root.open_subkey_with_flags(reg_key_path, KEY_SET_VALUE) - .map_err(|e| format!("Failed to open registry key: {}", e))?; - key.delete_value(value_name) - .map_err(|e| format!("Failed to delete registry value: {}", e))?; - Ok(true) - } else if item.item_type == "Folder" { - let folder_path = item.folder_path.as_ref().ok_or("Missing folder path")?; - fs::remove_file(folder_path) - .map_err(|e| format!("Failed to delete file: {}", e))?; - Ok(true) - } else { - Err("Unknown item type".to_string()) - } -} - -#[tauri::command] -pub async fn locate_startup_file(file_location: String, item_type: String, raw_registry_value: Option) -> Result<(), String> { - let path = if item_type == "Registry" { - let raw = raw_registry_value.as_deref().unwrap_or(&file_location); - sanitize_path(&expand_env_vars(raw)) - } else { - file_location.trim().trim_matches('"').to_string() - }; - - if path.is_empty() { - return Err("Empty file path".to_string()); - } - - let path_buf = PathBuf::from(&path); - let parent = path_buf.parent().map(|p| p.to_string_lossy().to_string()); - - if !path_buf.exists() || path_buf.is_dir() { - if let Some(parent_path) = parent { - Command::new("explorer") - .arg(&parent_path) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("Failed to open Explorer: {}", e))?; - } else { - return Err("Cannot determine parent directory".to_string()); - } - } else { - Command::new("explorer") - .arg("/select,") - .arg(&path) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("Failed to open Explorer: {}", e))?; - } - Ok(()) -} - -#[tauri::command] -pub async fn find_startup_key_in_registry(reg_key_path: String, location_type: String) -> Result<(), String> { - let hive_prefix = if location_type.starts_with("HKLM") { - r"HKEY_LOCAL_MACHINE" - } else { - r"HKEY_CURRENT_USER" - }; - let full_path = format!("{}\\{}", hive_prefix, reg_key_path); - - let hkcu = RegKey::predef(HKEY_CURRENT_USER); - let regedit_key_path = r"Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"; - match hkcu.open_subkey_with_flags(regedit_key_path, KEY_SET_VALUE | KEY_READ) { - Ok(key) => { - let _ = key.set_value("LastKey", &full_path); - } - Err(_) => { - let _ = hkcu.create_subkey(regedit_key_path); - if let Ok(key) = hkcu.open_subkey_with_flags(regedit_key_path, KEY_SET_VALUE) { - let _ = key.set_value("LastKey", &full_path); - } - } - } - - Command::new("regedit") - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| format!("Failed to open regedit: {}", e))?; - - Ok(()) -} diff --git a/参考/NexBox-main/src-tauri/src/storage_clean.rs b/参考/NexBox-main/src-tauri/src/storage_clean.rs deleted file mode 100644 index 6228d35..0000000 --- a/参考/NexBox-main/src-tauri/src/storage_clean.rs +++ /dev/null @@ -1,546 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CleanItem { - pub id: String, - pub name: String, - pub path: String, - pub exists: bool, - pub size_bytes: u64, - pub requires_admin: bool, - pub description: String, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ScanResult { - pub items: Vec, - pub total_size: u64, - pub total_items: u64, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CleanResult { - pub success: bool, - pub message: String, - pub freed_bytes: u64, - pub skipped_files: Vec, -} - -fn get_dir_size(path: &std::path::Path) -> u64 { - let mut total = 0; - if let Ok(entries) = fs::read_dir(path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - total += get_dir_size(&p); - } else if let Ok(metadata) = fs::metadata(&p) { - total += metadata.len(); - } - } - } - total -} - -fn get_file_size(path: &std::path::Path) -> u64 { - if path.exists() && path.is_file() { - fs::metadata(path).map(|m| m.len()).unwrap_or(0) - } else { - 0 - } -} - -fn scan_clean_item(id: &str, name: &str, path: PathBuf, requires_admin: bool, description: &str) -> CleanItem { - let exists = path.exists(); - let size_bytes = if exists { - if path.is_dir() { - get_dir_size(&path) - } else { - get_file_size(&path) - } - } else { - 0 - }; - CleanItem { - id: id.to_string(), - name: name.to_string(), - path: path.to_string_lossy().to_string(), - exists, - size_bytes, - requires_admin, - description: description.to_string(), - } -} - -fn get_temp_path() -> Option { - std::env::var("TEMP").ok().map(PathBuf::from) -} - -fn get_windows_temp() -> PathBuf { - PathBuf::from("C:\\Windows\\Temp") -} - -fn get_local_app_data() -> Option { - dirs::data_local_dir() -} - -fn get_windows_dir() -> PathBuf { - PathBuf::from("C:\\Windows") -} - -fn get_recycle_bin_size() -> u64 { - let drives = ["C:", "D:", "E:", "F:"]; - let mut total = 0u64; - - for drive in &drives { - let recycle_path = PathBuf::from(drive).join("$Recycle.Bin"); - total += get_dir_size(&recycle_path); - } - - if total == 0 { - let c_recycle = PathBuf::from("C:\\$Recycle.Bin"); - total += get_dir_size(&c_recycle); - } - - total -} - -#[allow(dead_code)] -fn get_thumbs_db_size(drive: &str) -> u64 { - let mut total = 0; - let drive_path = PathBuf::from(drive); - if drive_path.exists() { - if let Ok(entries) = fs::read_dir(&drive_path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - total += scan_thumbs_db_in_dir(&p); - } - } - } - } - total -} - -#[allow(dead_code)] -fn scan_thumbs_db_in_dir(dir: &PathBuf) -> u64 { - let mut total = 0; - if let Ok(entries) = fs::read_dir(dir) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - total += scan_thumbs_db_in_dir(&p); - } else if p.file_name().map(|n| n.to_string_lossy().to_lowercase() == "thumbs.db").unwrap_or(false) { - total += get_file_size(&p); - } - } - } - total -} - -#[tauri::command] -pub async fn scan_storage_items() -> Result { - let temp_path = get_temp_path(); - let local_app_data = get_local_app_data(); - let windows_dir = get_windows_dir(); - - let mut items: Vec = Vec::new(); - - if let Some(temp) = temp_path { - items.push(scan_clean_item( - "temp_user", - "用户临时文件", - temp, - false, - "程序运行时产生的中间文件,可安全删除" - )); - } - - items.push(scan_clean_item( - "temp_system", - "系统临时文件", - get_windows_temp(), - true, - "系统级临时文件,需要管理员权限" - )); - - items.push(CleanItem { - id: "recycle_bin".to_string(), - name: "回收站".to_string(), - path: "各磁盘 $Recycle.Bin".to_string(), - exists: true, - size_bytes: get_recycle_bin_size(), - requires_admin: false, - description: "已删除文件的暂存区,清空后释放磁盘空间".to_string(), - }); - - if let Some(local) = &local_app_data { - items.push(scan_clean_item( - "thumbnail_cache", - "缩略图缓存", - local.join("Microsoft").join("Windows").join("Explorer"), - false, - "图片、视频预览图缓存,删除后自动重建" - )); - - items.push(scan_clean_item( - "wer_archive", - "错误报告存档", - local.join("Microsoft").join("Windows").join("WER").join("ReportArchive"), - false, - "程序崩溃错误报告存档" - )); - - items.push(scan_clean_item( - "wer_queue", - "错误报告队列", - local.join("Microsoft").join("Windows").join("WER").join("ReportQueue"), - false, - "待上报的错误报告" - )); - - items.push(scan_clean_item( - "crash_dumps", - "崩溃转储", - local.join("CrashDumps"), - false, - "应用程序崩溃转储文件" - )); - - items.push(scan_clean_item( - "d3dscache", - "DirectX着色器缓存", - local.join("D3DSCache"), - false, - "显卡着色器编译缓存" - )); - } - - items.push(scan_clean_item( - "prefetch", - "预读文件", - windows_dir.join("Prefetch"), - true, - "程序启动预读数据,删除后首次启动略慢" - )); - - items.push(scan_clean_item( - "memory_dmp", - "完整内存转储", - windows_dir.join("MEMORY.DMP"), - true, - "蓝屏完整内存转储文件" - )); - - items.push(scan_clean_item( - "minidump", - "蓝屏精简转储", - windows_dir.join("Minidump"), - true, - "蓝屏精简转储文件,排查问题后可删除" - )); - - items.push(scan_clean_item( - "windows_logs", - "系统日志", - windows_dir.join("Logs"), - true, - "Windows各组件运行日志" - )); - - if let Some(_local) = &local_app_data { - items.push(CleanItem { - id: "thumbs_db".to_string(), - name: "thumbs.db残留文件".to_string(), - path: "各磁盘分布".to_string(), - exists: false, - size_bytes: 0, - requires_admin: false, - description: "早期Windows遗留的缩略图缓存文件(扫描较慢,暂不支持)".to_string(), - }); - } - - let total_size = items.iter().map(|i| i.size_bytes).sum(); - let total_items = items.iter().filter(|i| i.exists && i.size_bytes > 0).count() as u64; - - Ok(ScanResult { - items, - total_size, - total_items, - }) -} - -fn clean_dir_contents(path: &PathBuf) -> (u64, Vec) { - let mut freed = 0u64; - let mut skipped = Vec::new(); - - if !path.exists() || !path.is_dir() { - return (freed, skipped); - } - - if let Ok(entries) = fs::read_dir(path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - let (sub_freed, sub_skipped) = clean_dir_contents(&p); - freed += sub_freed; - skipped.extend(sub_skipped); - if fs::remove_dir(&p).is_ok() { - } else { - skipped.push(p.to_string_lossy().to_string()); - } - } else { - let size = get_file_size(&p); - match fs::remove_file(&p) { - Ok(_) => freed += size, - Err(_) => skipped.push(p.to_string_lossy().to_string()), - } - } - } - } - - (freed, skipped) -} - -fn clean_single_file(path: &PathBuf) -> (u64, Vec) { - if !path.exists() { - return (0, Vec::new()); - } - - let size = get_file_size(path); - match fs::remove_file(path) { - Ok(_) => (size, Vec::new()), - Err(_) => (0, vec![path.to_string_lossy().to_string()]), - } -} - -fn empty_recycle_bin_via_powershell() -> bool { - let result = Command::new("powershell") - .args(&["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", "Clear-RecycleBin -Force -ErrorAction SilentlyContinue"]) - .creation_flags(CREATE_NO_WINDOW) - .output(); - - match result { - Ok(output) => output.status.success(), - Err(_) => false, - } -} - -fn clean_thumbs_db_files(drive: &str) -> (u64, Vec) { - let mut freed = 0u64; - let mut skipped = Vec::new(); - let drive_path = PathBuf::from(drive); - - if drive_path.exists() { - if let Ok(entries) = fs::read_dir(&drive_path) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - let (sub_freed, sub_skipped) = clean_thumbs_db_in_dir(&p); - freed += sub_freed; - skipped.extend(sub_skipped); - } - } - } - } - - (freed, skipped) -} - -fn clean_thumbs_db_in_dir(dir: &PathBuf) -> (u64, Vec) { - let mut freed = 0u64; - let mut skipped = Vec::new(); - - if let Ok(entries) = fs::read_dir(dir) { - for entry in entries.flatten() { - let p = entry.path(); - if p.is_dir() { - let (sub_freed, sub_skipped) = clean_thumbs_db_in_dir(&p); - freed += sub_freed; - skipped.extend(sub_skipped); - } else if p.file_name().map(|n| n.to_string_lossy().to_lowercase() == "thumbs.db").unwrap_or(false) { - let size = get_file_size(&p); - match fs::remove_file(&p) { - Ok(_) => freed += size, - Err(_) => skipped.push(p.to_string_lossy().to_string()), - } - } - } - } - - (freed, skipped) -} - -#[tauri::command] -pub async fn clean_storage_items(item_ids: Vec) -> Result { - let temp_path = get_temp_path(); - let local_app_data = get_local_app_data(); - let windows_dir = get_windows_dir(); - - let mut total_freed = 0u64; - let mut all_skipped: Vec = Vec::new(); - - for id in item_ids { - let (freed, skipped) = match id.as_str() { - "temp_user" => { - if let Some(temp) = &temp_path { - clean_dir_contents(temp) - } else { - (0, Vec::new()) - } - } - "temp_system" => { - clean_dir_contents(&get_windows_temp()) - } - "recycle_bin" => { - if empty_recycle_bin_via_powershell() { - (0, Vec::new()) - } else { - (0, vec!["回收站清理失败".to_string()]) - } - } - "thumbnail_cache" => { - if let Some(local) = &local_app_data { - let cache_dir = local.join("Microsoft").join("Windows").join("Explorer"); - let mut freed = 0u64; - let mut skipped = Vec::new(); - - if let Ok(entries) = fs::read_dir(&cache_dir) { - for entry in entries.flatten() { - let p = entry.path(); - if p.file_name().map(|n| n.to_string_lossy().starts_with("thumbcache")).unwrap_or(false) { - let size = get_file_size(&p); - match fs::remove_file(&p) { - Ok(_) => freed += size, - Err(_) => skipped.push(p.to_string_lossy().to_string()), - } - } - } - } - (freed, skipped) - } else { - (0, Vec::new()) - } - } - "prefetch" => { - let prefetch_dir = windows_dir.join("Prefetch"); - let mut freed = 0u64; - let mut skipped = Vec::new(); - - if let Ok(entries) = fs::read_dir(&prefetch_dir) { - for entry in entries.flatten() { - let p = entry.path(); - if p.extension().map(|e| e.to_string_lossy() == "pf").unwrap_or(false) { - let size = get_file_size(&p); - match fs::remove_file(&p) { - Ok(_) => freed += size, - Err(_) => skipped.push(p.to_string_lossy().to_string()), - } - } - } - } - (freed, skipped) - } - "wer_archive" => { - if let Some(local) = &local_app_data { - clean_dir_contents(&local.join("Microsoft").join("Windows").join("WER").join("ReportArchive")) - } else { - (0, Vec::new()) - } - } - "wer_queue" => { - if let Some(local) = &local_app_data { - clean_dir_contents(&local.join("Microsoft").join("Windows").join("WER").join("ReportQueue")) - } else { - (0, Vec::new()) - } - } - "crash_dumps" => { - if let Some(local) = &local_app_data { - clean_dir_contents(&local.join("CrashDumps")) - } else { - (0, Vec::new()) - } - } - "memory_dmp" => { - clean_single_file(&windows_dir.join("MEMORY.DMP")) - } - "minidump" => { - clean_dir_contents(&windows_dir.join("Minidump")) - } - "windows_logs" => { - clean_dir_contents(&windows_dir.join("Logs")) - } - "d3dscache" => { - if let Some(local) = &local_app_data { - clean_dir_contents(&local.join("D3DSCache")) - } else { - (0, Vec::new()) - } - } - "thumbs_db" => { - clean_thumbs_db_files("C:") - } - _ => (0, Vec::new()), - }; - - total_freed += freed; - all_skipped.extend(skipped); - } - - let message = if all_skipped.is_empty() { - format_size_message(total_freed) - } else { - format!( - "清理完成,释放 {}。跳过 {} 个被占用文件", - format_size(total_freed), - all_skipped.len() - ) - }; - - Ok(CleanResult { - success: true, - message, - freed_bytes: total_freed, - skipped_files: all_skipped, - }) -} - -#[tauri::command] -pub async fn empty_recycle_bin_cmd() -> Result { - if empty_recycle_bin_via_powershell() { - Ok(CleanResult { - success: true, - message: "回收站已清空".to_string(), - freed_bytes: 0, - skipped_files: Vec::new(), - }) - } else { - Err("清空回收站失败".to_string()) - } -} - -fn format_size(bytes: u64) -> String { - if bytes < 1024 { - format!("{} B", bytes) - } else if bytes < 1024 * 1024 { - format!("{:.1} KB", bytes as f64 / 1024.0) - } else if bytes < 1024 * 1024 * 1024 { - format!("{:.1} MB", bytes as f64 / (1024.0 * 1024.0)) - } else { - format!("{:.2} GB", bytes as f64 / (1024.0 * 1024.0 * 1024.0)) - } -} - -fn format_size_message(bytes: u64) -> String { - if bytes == 0 { - "没有需要清理的文件".to_string() - } else { - format!("清理完成,释放 {}", format_size(bytes)) - } -} \ No newline at end of file diff --git a/参考/NexBox-main/src-tauri/src/thirdparty_tools.rs b/参考/NexBox-main/src-tauri/src/thirdparty_tools.rs deleted file mode 100644 index 6b3559b..0000000 --- a/参考/NexBox-main/src-tauri/src/thirdparty_tools.rs +++ /dev/null @@ -1,328 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::fs; -use std::os::windows::process::CommandExt; -use std::path::PathBuf; -use std::process::Command; -use tauri::Emitter; - -const CREATE_NO_WINDOW: u32 = 0x08000000; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ThirdPartyTool { - pub id: String, - pub name: String, - pub description: String, - pub category: String, - pub tool_type: String, - pub download_url: String, - pub file_name: String, - pub website_url: Option, - pub check_executable: Option, -} - -fn get_tools_directory() -> PathBuf { - let mut path = dirs::data_local_dir().unwrap_or_else(|| PathBuf::from(".")); - path.push("NexBox"); - path.push("Tools"); - if !path.exists() { - let _ = fs::create_dir_all(&path); - } - path -} - -fn get_tools_list() -> Vec { - vec![ - ThirdPartyTool { - id: "memreduct".to_string(), - name: "Memreduct".to_string(), - description: "内存清理工具".to_string(), - category: "optimization".to_string(), - tool_type: "install".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://memreduct.org".to_string()), - check_executable: Some("memreduct.exe".to_string()), - }, - ThirdPartyTool { - id: "optimizer".to_string(), - name: "Optimizer".to_string(), - description: "Windows系统优化工具".to_string(), - category: "optimization".to_string(), - tool_type: "portable".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://github.com/hellzerg/optimizer/".to_string()), - check_executable: None, - }, - ThirdPartyTool { - id: "cpu-z".to_string(), - name: "CPU-Z".to_string(), - description: "CPU信息检测工具".to_string(), - category: "hardware".to_string(), - tool_type: "install".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://www.cpuid.com/softwares/cpu-z.html".to_string()), - check_executable: Some("cpuz.exe".to_string()), - }, - ThirdPartyTool { - id: "gpu-z".to_string(), - name: "GPU-Z".to_string(), - description: "显卡信息检测工具".to_string(), - category: "hardware".to_string(), - tool_type: "portable".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://www.techpowerup.com/gpuz/".to_string()), - check_executable: None, - }, - - ThirdPartyTool { - id: "process-lasso".to_string(), - name: "Process Lasso".to_string(), - description: "系统进程优化工具".to_string(), - category: "optimization".to_string(), - tool_type: "install".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://bitsum.com/download-process-lasso/".to_string()), - check_executable: Some("ProcessLassoLauncher.exe".to_string()), - }, - ThirdPartyTool { - id: "fxsound".to_string(), - name: "FxSound".to_string(), - description: "音频增强工具".to_string(), - category: "assistant".to_string(), - tool_type: "install".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://www.fxsound.com/download".to_string()), - check_executable: Some("FxSound.exe".to_string()), - }, - ThirdPartyTool { - id: "msi-afterburner".to_string(), - name: "MSI Afterburner".to_string(), - description: "显卡超频监控工具".to_string(), - category: "hardware".to_string(), - tool_type: "install".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://www.msi.cn/Landing/afterburner/graphics-cards".to_string()), - check_executable: Some("MSIAfterburner.exe".to_string()), - }, - ThirdPartyTool { - id: "geek".to_string(), - name: "Geek".to_string(), - description: "软件卸载清理工具".to_string(), - category: "assistant".to_string(), - tool_type: "portable".to_string(), - download_url: String::new(), - file_name: String::new(), - website_url: Some("https://geekuninstaller.com/".to_string()), - check_executable: None, - }, - ] -} - -#[tauri::command] -pub fn get_thirdparty_tools() -> Vec { - get_tools_list() -} - -#[tauri::command] -pub fn get_tool_install_path(tool_id: String) -> Option { - let tools = get_tools_list(); - if let Some(tool) = tools.iter().find(|t| t.id == tool_id) { - if tool.tool_type == "install" { - if let Some(check_exe) = &tool.check_executable { - return find_via_desktop_shortcut(check_exe) - .map(|p| p.to_string_lossy().into_owned()); - } - } - } - None -} - -fn find_via_desktop_shortcut(exe_name: &str) -> Option { - let desktop_paths = get_desktop_paths(); - let mut lnk_files: Vec = Vec::new(); - - for desktop_path in desktop_paths { - if !desktop_path.exists() { - continue; - } - if let Ok(entries) = fs::read_dir(&desktop_path) { - for entry in entries.flatten() { - let path = entry.path(); - if let Some(ext) = path.extension() { - if ext.eq_ignore_ascii_case("lnk") { - lnk_files.push(path); - } - } - } - } - } - - if lnk_files.is_empty() { - return None; - } - - let lnk_paths: Vec = lnk_files - .iter() - .map(|p| format!("'{}'", p.to_string_lossy().escape_default())) - .collect(); - - let ps_script = format!( - r#"$shell = New-Object -ComObject WScript.Shell; @({}) | ForEach-Object {{ $shell.CreateShortcut($_).TargetPath }}"#, - lnk_paths.join(",") - ); - - if let Ok(output) = Command::new("powershell") - .args(["-NoProfile", "-NonInteractive", "-Command", &ps_script]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - if output.status.success() { - let output_str = String::from_utf8_lossy(&output.stdout); - for line in output_str.lines() { - let target = line.trim(); - if !target.is_empty() { - let target_path = PathBuf::from(target); - if let Some(file_name) = target_path.file_name() { - if file_name.to_string_lossy().eq_ignore_ascii_case(exe_name) { - return Some(target_path); - } - } - } - } - } - } - - None -} - -fn get_desktop_paths() -> Vec { - let mut paths = Vec::new(); - - if let Some(user_profile) = dirs::home_dir() { - paths.push(user_profile.join("Desktop")); - } - - paths.push(PathBuf::from("C:\\Users\\Public\\Desktop")); - - paths -} - -#[tauri::command] -pub fn get_tool_download_path(tool_id: String) -> String { - let tools = get_tools_list(); - if let Some(tool) = tools.iter().find(|t| t.id == tool_id) { - let tools_dir = get_tools_directory(); - tools_dir - .join(&tool.file_name) - .to_string_lossy() - .into_owned() - } else { - String::new() - } -} - -#[tauri::command] -pub fn run_tool(tool_id: String) -> Result<(), String> { - let tools = get_tools_list(); - if let Some(tool) = tools.iter().find(|t| t.id == tool_id) { - match tool.tool_type.as_str() { - "install" => { - if let Some(check_exe) = &tool.check_executable { - if let Some(exe_path) = find_via_desktop_shortcut(check_exe) { - Command::new("cmd") - .args(["/c", "start", "", exe_path.to_str().unwrap()]) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| e.to_string())?; - return Ok(()); - } - return Err("Executable not found".to_string()); - } - } - "portable" => { - let tools_dir = get_tools_directory(); - let tool_path = tools_dir.join(&tool.file_name); - if tool_path.exists() { - Command::new("cmd") - .args(["/c", "start", "", tool_path.to_str().unwrap()]) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| e.to_string())?; - } else { - return Err("Tool not found".to_string()); - } - } - _ => {} - } - Ok(()) - } else { - Err("Tool not found".to_string()) - } -} - -#[tauri::command] -pub async fn download_tool(tool_id: String, window: tauri::Window) -> Result { - let tools = get_tools_list(); - if let Some(tool) = tools.iter().find(|t| t.id == tool_id) { - let tools_dir = get_tools_directory(); - let file_path = tools_dir.join(&tool.file_name); - - let client = reqwest::Client::builder() - .redirect(reqwest::redirect::Policy::limited(10)) - .build() - .map_err(|e| e.to_string())?; - let response = client - .get(&tool.download_url) - .send() - .await - .map_err(|e| e.to_string())?; - - let total_size = response.content_length().unwrap_or(0); - - let mut file = std::fs::File::create(&file_path).map_err(|e| e.to_string())?; - - use futures_util::StreamExt; - let mut stream = response.bytes_stream(); - let mut downloaded: u64 = 0; - - while let Some(chunk) = stream.next().await { - let chunk = chunk.map_err(|e| e.to_string())?; - std::io::Write::write_all(&mut file, &chunk).map_err(|e| e.to_string())?; - downloaded += chunk.len() as u64; - - let progress = if total_size > 0 { - ((downloaded * 100) / total_size) as u32 - } else { - 0 - }; - - let _ = window.emit( - "tool-download-progress", - serde_json::json!({ - "tool_id": tool_id, - "progress": progress, - }), - ); - } - - Ok(file_path.to_string_lossy().into_owned()) - } else { - Err("Tool not found".to_string()) - } -} - -#[tauri::command] -pub async fn open_tool_installer(file_path: String) -> Result<(), String> { - Command::new("cmd") - .args(["/c", "start", "", &file_path]) - .creation_flags(CREATE_NO_WINDOW) - .spawn() - .map_err(|e| e.to_string())?; - Ok(()) -} diff --git a/参考/NexBox-main/src-tauri/src/tray.rs b/参考/NexBox-main/src-tauri/src/tray.rs deleted file mode 100644 index c0cff1e..0000000 --- a/参考/NexBox-main/src-tauri/src/tray.rs +++ /dev/null @@ -1,143 +0,0 @@ -use std::sync::LazyLock; -use std::sync::atomic::{AtomicBool, Ordering}; -use std::sync::Mutex; -use tauri::{ - tray::{TrayIcon, TrayIconBuilder}, - AppHandle, Emitter, Manager, Runtime, Window, -}; - -static TRAY_INITIALIZED: AtomicBool = AtomicBool::new(false); -static CLOSE_BEHAVIOR: LazyLock> = LazyLock::new(|| Mutex::new(String::from("ask"))); -static DONT_ASK_AGAIN: AtomicBool = AtomicBool::new(false); - -pub fn init_tray(app: &AppHandle) -> Result, Box> { - if TRAY_INITIALIZED.load(Ordering::SeqCst) { - return Err("Tray already initialized".into()); - } - - let tray = TrayIconBuilder::new() - .icon(app.default_window_icon().unwrap().clone()) - .on_tray_icon_event(|tray, event| { - let app = tray.app_handle(); - match event { - tauri::tray::TrayIconEvent::Click { - button: tauri::tray::MouseButton::Left, - .. - } => { - if let Some(window) = app.get_webview_window("main") { - let _ = window.show(); - let _ = window.unminimize(); - let _ = window.set_focus(); - - if let Some(widget) = app.get_webview_window("widget") { - let _ = widget.set_always_on_top(false); - let _ = widget.set_focus(); - } - let _ = window.set_focus(); - } - } - tauri::tray::TrayIconEvent::Click { - button: tauri::tray::MouseButton::Right, - rect, - .. - } => { - if let Some(menu_window) = app.get_webview_window("tray-menu") { - let (px, py) = match rect.position { - tauri::Position::Physical(p) => (p.x, p.y), - tauri::Position::Logical(p) => (p.x as i32, p.y as i32), - }; - let (sw, _sh) = match rect.size { - tauri::Size::Physical(s) => (s.width as i32, s.height as i32), - tauri::Size::Logical(s) => (s.width as i32, s.height as i32), - }; - let x = (px + sw / 2 - 95).max(0); - let y = (py - 140).max(0); - let _ = menu_window.set_position(tauri::Position::Physical(tauri::PhysicalPosition { - x, - y, - })); - let _ = menu_window.set_always_on_top(true); - let _ = menu_window.show(); - let _ = menu_window.set_focus(); - } - } - _ => {} - } - }) - .build(app)?; - - TRAY_INITIALIZED.store(true, Ordering::SeqCst); - - Ok(tray) -} - -#[tauri::command] -pub async fn minimize_to_tray(window: Window) -> Result<(), String> { - window.hide().map_err(|e| e.to_string())?; - Ok(()) -} - -#[tauri::command] -pub async fn show_window(window: Window) -> Result<(), String> { - let app = window.app_handle(); - window.show().map_err(|e| e.to_string())?; - window.unminimize().map_err(|e| e.to_string())?; - window.set_focus().map_err(|e| e.to_string())?; - - if let Some(widget) = app.get_webview_window("widget") { - let _ = widget.set_always_on_top(false); - let _ = widget.set_focus(); - } - let _ = window.set_focus(); - - Ok(()) -} - -#[tauri::command] -pub fn get_close_behavior() -> String { - CLOSE_BEHAVIOR.lock().unwrap().clone() -} - -#[tauri::command] -pub fn set_close_behavior(behavior: String) { - if let Ok(mut b) = CLOSE_BEHAVIOR.lock() { - *b = behavior; - } -} - -#[tauri::command] -pub fn get_dont_ask_again() -> bool { - DONT_ASK_AGAIN.load(Ordering::SeqCst) -} - -#[tauri::command] -pub fn set_dont_ask_again(value: bool) { - DONT_ASK_AGAIN.store(value, Ordering::SeqCst); -} - -#[tauri::command] -pub fn exit_app(app: tauri::AppHandle) { - // 先隐藏所有窗口,避免退出时 WebView2 销毁后短暂露出原生标题栏 - for label in &["main", "widget", "tray-menu", "desktop-lyrics", "lyrics-unlock-btn", "vertical-overlay"] { - if let Some(w) = app.get_webview_window(label) { - let _ = w.hide(); - } - } - // 给 Windows 消息队列一点时间处理隐藏操作 - std::thread::sleep(std::time::Duration::from_millis(50)); - app.exit(0); -} - -#[tauri::command] -pub fn check_update_and_show(app: AppHandle) { - if let Some(window) = app.get_webview_window("main") { - let _ = window.show(); - let _ = window.unminimize(); - let _ = window.set_focus(); - } - let _ = app.emit("check-update", ()); -} - -pub fn cleanup() { - TRAY_INITIALIZED.store(false, Ordering::SeqCst); -} diff --git a/参考/NexBox-main/src-tauri/src/utils/cursor.rs b/参考/NexBox-main/src-tauri/src/utils/cursor.rs deleted file mode 100644 index 3e34764..0000000 --- a/参考/NexBox-main/src-tauri/src/utils/cursor.rs +++ /dev/null @@ -1,188 +0,0 @@ -#[cfg(windows)] -use serde::Serialize; - -#[cfg(windows)] -#[derive(Serialize)] -pub struct CursorPosition { - pub x: i32, - pub y: i32, -} - -/// 获取全局鼠标光标位置 (物理屏幕坐标) -#[cfg(windows)] -#[tauri::command] -pub fn get_cursor_position() -> Result { - use winapi::um::winuser::GetCursorPos; - use winapi::shared::windef::POINT; - - let mut point = POINT { x: 0, y: 0 }; - let result = unsafe { GetCursorPos(&mut point) }; - if result == 0 { - return Err("GetCursorPos failed".to_string()); - } - Ok(CursorPosition { - x: point.x, - y: point.y, - }) -} - -#[cfg(not(windows))] -#[tauri::command] -pub fn get_cursor_position() -> Result { - Err("get_cursor_position is only supported on Windows".to_string()) -} - -// ═══════════════════════════════════════════════════════════════ -// 桌面歌词窗口鼠标穿透 -// ═══════════════════════════════════════════════════════════════ -// -// 问题: -// Tauri v2 的 setIgnoreCursorEvents(true) 只在父 Win32 窗口上设置 -// WS_EX_TRANSPARENT,但 WebView2 是子窗口,不继承该标志,导致鼠标 -// 事件仍被子窗口捕获,穿透无效。 -// -// 直接对子窗口设置 WS_EX_TRANSPARENT 会干扰 WebView2 的 DirectComposition -// 渲染,导致内容变透明。 -// -// Hook WM_NCHITTEST 返回 HTTRANSPARENT 对 WebView2 也无效,因为 -// WebView2 使用 DirectComposition 处理输入,绕过传统 Win32 消息路由。 -// -// 方案(EnableWindow + WS_EX_TRANSPARENT 组合): -// 1. 父窗口:设置 WS_EX_TRANSPARENT(使父窗口对鼠标透明) -// 2. 子窗口:EnableWindow(FALSE) 禁用输入 -// - MSDN: "If a child window is disabled, the system skips it -// when determining which window should receive mouse messages." -// - 系统在鼠标命中测试时跳过禁用的子窗口 -// - 鼠标事件传递到父窗口,父窗口的 WS_EX_TRANSPARENT 使事件 -// 继续传递到下方的应用窗口 -// - EnableWindow 不影响 WebView2 渲染 - -#[cfg(windows)] -use std::sync::atomic::{AtomicBool, Ordering}; - -#[cfg(windows)] -/// 全局穿透开关 -static CLICK_THROUGH: AtomicBool = AtomicBool::new(false); - -#[cfg(windows)] -/// 属性名,用于在子窗口上存储原始窗口过程指针 -const PROP_ORIG_PROC: &[u16] = &[ - b'n' as u16, b'x' as u16, b'_' as u16, b'o' as u16, b'r' as u16, b'i' as u16, - b'g' as u16, b'_' as u16, b'p' as u16, b'r' as u16, b'o' as u16, b'c' as u16, 0, -]; - -/// 子窗口的 hook 窗口过程(备用方案,与 EnableWindow 双保险) -#[cfg(windows)] -unsafe extern "system" fn hook_wndproc( - hwnd: windows_sys::Win32::Foundation::HWND, - msg: u32, - wparam: usize, - lparam: isize, -) -> isize { - use windows_sys::Win32::UI::WindowsAndMessaging::{ - CallWindowProcW, DefWindowProcW, GetPropW, HTTRANSPARENT, WM_NCHITTEST, WNDPROC, - }; - - // 穿透模式下,WM_NCHITTEST 返回 HTTRANSPARENT - if msg == WM_NCHITTEST && CLICK_THROUGH.load(Ordering::Relaxed) { - return HTTRANSPARENT as isize; - } - - // 其他消息:调用原始窗口过程 - let original = GetPropW(hwnd, PROP_ORIG_PROC.as_ptr()); - if !original.is_null() { - let proc_fn: WNDPROC = std::mem::transmute(original as isize); - return CallWindowProcW(proc_fn, hwnd, msg, wparam, lparam); - } - - DefWindowProcW(hwnd, msg, wparam, lparam) -} - -/// EnumChildWindows 回调:为每个子窗口安装 hook + 禁用输入 -#[cfg(windows)] -unsafe extern "system" fn enum_child_proc( - hwnd: windows_sys::Win32::Foundation::HWND, - lparam: isize, -) -> i32 { - use windows_sys::Win32::UI::WindowsAndMessaging::{ - GetPropW, GetWindowLongPtrW, SetPropW, SetWindowLongPtrW, GWLP_WNDPROC, - }; - use windows_sys::Win32::Foundation::HANDLE; - // EnableWindow 在 winapi crate 中 - use winapi::um::winuser::EnableWindow; - - let enable = lparam != 0; // lparam=1 → 启用, lparam=0 → 禁用 - - // 安装 hook(幂等,仅首次安装) - if !enable { - let existing = GetPropW(hwnd, PROP_ORIG_PROC.as_ptr()); - if existing.is_null() { - let current = GetWindowLongPtrW(hwnd, GWLP_WNDPROC); - if current != 0 { - SetPropW(hwnd, PROP_ORIG_PROC.as_ptr(), current as HANDLE); - SetWindowLongPtrW( - hwnd, - GWLP_WNDPROC, - hook_wndproc as *const () as usize as isize, - ); - } - } - } - - // 禁用/启用子窗口输入 - // 禁用的子窗口在鼠标命中测试时被系统跳过,事件传递到父窗口 - // 父窗口的 WS_EX_TRANSPARENT 使事件继续传递到下方的应用窗口 - EnableWindow(hwnd as winapi::shared::windef::HWND, if enable { 1 } else { 0 }); - 1 // 继续枚举 -} - -#[cfg(windows)] -#[tauri::command] -pub fn set_desktop_lyrics_click_through( - app_handle: tauri::AppHandle, - ignore: bool, -) -> Result { - use tauri::Manager; - use windows_sys::Win32::UI::WindowsAndMessaging::{ - EnumChildWindows, GetWindowLongPtrW, SetWindowLongPtrW, GWL_EXSTYLE, - WS_EX_TRANSPARENT, - }; - use windows_sys::Win32::Foundation::HWND; - - let window = app_handle - .get_webview_window("desktop-lyrics") - .ok_or_else(|| "desktop-lyrics window not found".to_string())?; - - let hwnd = window - .hwnd() - .map_err(|e| format!("Failed to get HWND: {}", e))?; - let hwnd_raw = hwnd.0 as HWND; - - // 更新全局穿透标志 - CLICK_THROUGH.store(ignore, Ordering::Relaxed); - - unsafe { - // 1. 父窗口:设置/取消 WS_EX_TRANSPARENT - let style = GetWindowLongPtrW(hwnd_raw, GWL_EXSTYLE); - if ignore { - SetWindowLongPtrW(hwnd_raw, GWL_EXSTYLE, style | WS_EX_TRANSPARENT as isize); - } else { - SetWindowLongPtrW(hwnd_raw, GWL_EXSTYLE, style & !(WS_EX_TRANSPARENT as isize)); - } - - // 2. 子窗口:禁用/启用输入 + 安装 hook(双保险) - // lparam=0 → 禁用(穿透), lparam=1 → 启用(正常) - EnumChildWindows(hwnd_raw, Some(enum_child_proc), if ignore { 0 } else { 1 }); - } - - Ok(true) -} - -#[cfg(not(windows))] -#[tauri::command] -pub fn set_desktop_lyrics_click_through( - _app_handle: tauri::AppHandle, - _ignore: bool, -) -> Result { - Err("set_desktop_lyrics_click_through is only supported on Windows".to_string()) -} diff --git a/参考/NexBox-main/src-tauri/src/utils/lyrics_btn.rs b/参考/NexBox-main/src-tauri/src/utils/lyrics_btn.rs deleted file mode 100644 index bfefa78..0000000 --- a/参考/NexBox-main/src-tauri/src/utils/lyrics_btn.rs +++ /dev/null @@ -1,98 +0,0 @@ -//! 桌面歌词解锁按钮独立窗口管理 -//! -//! 创建一个永不穿透的小窗口,固定叠在歌词窗口顶部中央。 -//! 从根本上解决 WebView2 穿透状态下 mousemove 不可靠的问题。 - -use tauri::Manager; -use tauri::Emitter; - -/// 显示解锁按钮窗口,定位到歌词窗口顶部中央,并强制置于最顶层 -#[tauri::command] -pub fn show_lyrics_unlock_btn(app_handle: tauri::AppHandle) -> Result<(), String> { - let lyrics_win = app_handle - .get_webview_window("desktop-lyrics") - .ok_or_else(|| "desktop-lyrics window not found".to_string())?; - - let btn_win = app_handle - .get_webview_window("lyrics-unlock-btn") - .ok_or_else(|| "lyrics-unlock-btn window not found".to_string())?; - - // 获取歌词窗口位置和大小 - let pos = lyrics_win - .outer_position() - .map_err(|e| format!("Failed to get lyrics window position: {}", e))?; - let size = lyrics_win - .outer_size() - .map_err(|e| format!("Failed to get lyrics window size: {}", e))?; - - // 计算按钮位置:窗口顶部中央 - let btn_size = 48.0_f64; - let x = pos.x as f64 + (size.width as f64 - btn_size) / 2.0; - let y = pos.y as f64; - - // 设置按钮窗口位置和大小 - btn_win - .set_position(tauri::LogicalPosition::new(x, y)) - .map_err(|e| format!("Failed to set button position: {}", e))?; - btn_win - .set_size(tauri::LogicalSize::new(btn_size, btn_size)) - .map_err(|e| format!("Failed to set button size: {}", e))?; - - // 显示按钮 - btn_win - .show() - .map_err(|e| format!("Failed to show button: {}", e))?; - - // 用 Win32 SetWindowPos(HWND_TOPMOST) 强制按钮到所有窗口最顶层 - #[cfg(windows)] - force_topmost(&btn_win); - - Ok(()) -} - -#[cfg(windows)] -fn force_topmost(btn_win: &tauri::WebviewWindow) { - use winapi::um::winuser::{SetWindowPos, HWND_TOPMOST, SWP_NOMOVE, SWP_NOSIZE, SWP_NOACTIVATE}; - use winapi::shared::windef::HWND; - - if let Ok(hwnd) = btn_win.hwnd() { - unsafe { - SetWindowPos( - hwnd.0 as HWND, - HWND_TOPMOST, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE, - ); - } - } -} - -/// 隐藏解锁按钮窗口 -#[tauri::command] -pub fn hide_lyrics_unlock_btn(app_handle: tauri::AppHandle) -> Result<(), String> { - if let Some(btn_win) = app_handle.get_webview_window("lyrics-unlock-btn") { - btn_win - .hide() - .map_err(|e| format!("Failed to hide button: {}", e))?; - } - Ok(()) -} - -/// 解锁按钮被点击时调用:关闭穿透、隐藏按钮、通知歌词窗口 -#[tauri::command] -pub fn unlock_lyrics(app_handle: tauri::AppHandle) -> Result<(), String> { - // 1. 隐藏按钮窗口 - if let Some(btn_win) = app_handle.get_webview_window("lyrics-unlock-btn") { - let _ = btn_win.hide(); - } - - // 2. 关闭歌词窗口穿透 - if let Some(lyrics_win) = app_handle.get_webview_window("desktop-lyrics") { - let _ = lyrics_win.set_ignore_cursor_events(false); - } - - // 3. 通知歌词窗口前端更新状态 - let _ = app_handle.emit("lyrics:unlock-triggered", ()); - - Ok(()) -} diff --git a/参考/NexBox-main/src-tauri/src/utils/mod.rs b/参考/NexBox-main/src-tauri/src/utils/mod.rs deleted file mode 100644 index c508f8c..0000000 --- a/参考/NexBox-main/src-tauri/src/utils/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod sys_info; -pub mod cursor; -pub mod lyrics_btn; diff --git a/参考/NexBox-main/src-tauri/src/utils/sys_info.rs b/参考/NexBox-main/src-tauri/src/utils/sys_info.rs deleted file mode 100644 index d051612..0000000 --- a/参考/NexBox-main/src-tauri/src/utils/sys_info.rs +++ /dev/null @@ -1,95 +0,0 @@ -use serde_json::json; -use tauri_plugin_os::locale; -use tauri_plugin_store::StoreExt; - -async fn send_statistics(version: String, os: String) { - let client = reqwest::Client::builder() - .timeout(std::time::Duration::from_secs(10)) - .build() - .unwrap_or_else(|_| reqwest::Client::new()); - - match client - .post("https://mc.sjtu.cn/api-sjmcl/statistics") - .json(&json!({ - "version": format!("box-{}", version), - "os": os, - })) - .send() - .await - { - Ok(resp) => log::info!("Statistics sent, status: {}", resp.status()), - Err(e) => log::error!("Failed to send statistics: {}", e), - } -} - -pub fn check_and_send_statistics(app: &tauri::App) { - let store = match app.store("settings.json") { - Ok(s) => s, - Err(e) => { - log::error!("Failed to open settings store: {}", e); - return; - } - }; - - if store.has("box-statistics-sent") { - log::info!("Statistics already sent, skipping"); - return; - } - - let version = env!("CARGO_PKG_VERSION").to_string(); - let os = std::env::consts::OS.to_string(); - log::info!("Sending statistics: version={}, os={}", version, os); - - let app_handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - send_statistics(version, os).await; - - if let Ok(store) = app_handle.store("settings.json") { - store.set("box-statistics-sent", json!(true)); - let _ = store.save(); - log::info!("Statistics flag saved"); - } - }); -} - -pub fn get_mapped_locale() -> String { - let locale = locale().unwrap_or_else(|| "en".to_string()); - let matched_locale; - - #[cfg(target_os = "macos")] - { - let language_map = [ - ("fr", vec!["fr"]), - ("ja", vec!["ja"]), - ("zh-Hans", vec!["zh-Hans", "wuu-Hans", "yue-Hans"]), - ("zh-Hant", vec!["zh-Hant", "yue-Hant"]), - ]; - - matched_locale = language_map - .iter() - .find(|(_, locales)| locales.iter().any(|l| locale.starts_with(l))) - .map(|(mapped, _)| mapped.to_string()); - } - - #[cfg(not(target_os = "macos"))] - { - let language_map = [ - ("fr", vec!["fr"]), - ("ja", vec!["ja"]), - ("zh-Hans", vec!["zh-CN", "zh-SG"]), - ("zh-Hant", vec!["zh-TW", "zh-HK", "zh-MO"]), - ]; - - matched_locale = language_map - .iter() - .find(|(_, locales)| locales.iter().any(|l| locale.starts_with(l))) - .map(|(mapped, _)| mapped.to_string()); - } - - matched_locale.unwrap_or_else(|| "en".to_string()) -} - -#[tauri::command] -pub fn get_system_locale() -> String { - get_mapped_locale() -} diff --git a/参考/NexBox-main/src-tauri/src/vertical_overlay.rs b/参考/NexBox-main/src-tauri/src/vertical_overlay.rs deleted file mode 100644 index 2a81ad4..0000000 --- a/参考/NexBox-main/src-tauri/src/vertical_overlay.rs +++ /dev/null @@ -1,246 +0,0 @@ -//! 竖排悬浮框模块 — 基于 Tauri Webview 窗口 -//! -//! 与 Win32 GDI+ overlay 并存,当 style == "vertical_panel" 时使用此模块。 - -use std::sync::atomic::{AtomicBool, Ordering}; -use std::thread; -use std::time::Duration; -use tauri::{Emitter, Manager}; - -use crate::overlay_panel::{OverlayResult, OverlaySettings, collect_hardware_data, CURRENT_HARDWARE_DATA, CURRENT_SETTINGS, get_or_init_settings}; - -static VERTICAL_OVERLAY_ACTIVE: AtomicBool = AtomicBool::new(false); -static DATA_THREAD_STARTED: AtomicBool = AtomicBool::new(false); - -/// 启动竖排悬浮框 -#[tauri::command] -pub async fn start_vertical_overlay( - app_handle: tauri::AppHandle, - settings: Option, -) -> Result { - if VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Ok(OverlayResult { - success: true, - message: "竖排悬浮框已处于启用状态".to_string(), - }); - } - - // 如果 Win32 overlay 正在运行,先停止 - if crate::overlay_panel::is_overlay_active() { - crate::overlay_panel::stop_overlay()?; - std::thread::sleep(Duration::from_millis(200)); - } - - // 保存设置 - if let Some(ref s) = settings { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - *settings_lock = Some(s.clone()); - } - - let settings = get_or_init_settings(); - VERTICAL_OVERLAY_ACTIVE.store(true, Ordering::SeqCst); - - // 显示 Tauri 窗口 - let window = app_handle - .get_webview_window("vertical-overlay") - .ok_or("找不到 vertical-overlay 窗口")?; - - // 恢复保存的位置或使用默认位置(屏幕右上角) - if let (Some(x), Some(y)) = (settings.position_x, settings.position_y) { - let _ = window.set_position(tauri::PhysicalPosition { x, y }); - } else { - // 默认:屏幕右上角 - if let Ok(monitor) = window.current_monitor() { - if let Some(monitor) = monitor { - let screen_size = monitor.size(); - let scale = monitor.scale_factor(); - let win_w = 220.0 * scale; - let _win_h = 400.0 * scale; - let x = (screen_size.width as f64 - win_w - 20.0 * scale) as i32; - let y = (20.0 * scale) as i32; - let _ = window.set_position(tauri::PhysicalPosition { x, y }); - } - } - } - - let _ = window.show(); - let _ = window.set_always_on_top(true); - - // 启动数据推送线程(如果尚未启动) - if !DATA_THREAD_STARTED.swap(true, Ordering::SeqCst) { - let handle_clone = app_handle.clone(); - thread::spawn(move || { - while DATA_THREAD_STARTED.load(Ordering::SeqCst) { - let data = collect_hardware_data(); - // 更新 CURRENT_HARDWARE_DATA 供硬件报告使用 - *CURRENT_HARDWARE_DATA.lock().unwrap() = Some(data.clone()); - - // 推送给竖排悬浮框窗口 - if VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) { - let _ = handle_clone.emit("vertical-overlay-data", &data); - } - - thread::sleep(Duration::from_millis(1000)); - } - }); - } - - // 推送当前设置到前端 - let _ = app_handle.emit("vertical-overlay-settings", &settings); - - let _ = app_handle.emit("overlay-status-changed", ()); - Ok(OverlayResult { - success: true, - message: "竖排悬浮框已启动".to_string(), - }) -} - -/// 停止竖排悬浮框 -#[tauri::command] -pub async fn stop_vertical_overlay( - app_handle: tauri::AppHandle, -) -> Result { - if !VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) { - return Ok(OverlayResult { - success: true, - message: "竖排悬浮框已处于关闭状态".to_string(), - }); - } - - VERTICAL_OVERLAY_ACTIVE.store(false, Ordering::SeqCst); - - if let Some(window) = app_handle.get_webview_window("vertical-overlay") { - let _ = window.hide(); - } - - let _ = app_handle.emit("overlay-status-changed", ()); - Ok(OverlayResult { - success: true, - message: "竖排悬浮框已关闭".to_string(), - }) -} - -/// 保存悬浮框位置 -#[tauri::command] -pub async fn save_vertical_overlay_position( - x: i32, - y: i32, -) -> Result { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref mut settings) = *settings_lock { - settings.position_x = Some(x); - settings.position_y = Some(y); - } - Ok(OverlayResult { - success: true, - message: "位置已保存".to_string(), - }) -} - -/// 设置鼠标穿透 -#[tauri::command] -pub async fn set_vertical_overlay_click_through( - app_handle: tauri::AppHandle, - enabled: bool, -) -> Result { - if let Some(window) = app_handle.get_webview_window("vertical-overlay") { - let _ = window.set_ignore_cursor_events(enabled); - } - Ok(OverlayResult { - success: true, - message: if enabled { - "已开启鼠标穿透".to_string() - } else { - "已关闭鼠标穿透".to_string() - }, - }) -} - -/// 重置竖排悬浮框位置 -#[tauri::command] -pub async fn reset_vertical_overlay_position( - app_handle: tauri::AppHandle, -) -> Result { - // 清除保存的位置 - { - let mut settings_lock = CURRENT_SETTINGS.lock().unwrap(); - if let Some(ref mut settings) = *settings_lock { - settings.position_x = None; - settings.position_y = None; - } - } - - // 移动窗口到默认位置(右上角) - if let Some(window) = app_handle.get_webview_window("vertical-overlay") { - if let Ok(monitor) = window.current_monitor() { - if let Some(monitor) = monitor { - let screen_size = monitor.size(); - let scale = monitor.scale_factor(); - let win_w = 220.0 * scale; - let x = (screen_size.width as f64 - win_w - 20.0 * scale) as i32; - let y = (20.0 * scale) as i32; - let _ = window.set_position(tauri::PhysicalPosition { x, y }); - } - } - } - - Ok(OverlayResult { - success: true, - message: "位置已重置为默认".to_string(), - }) -} - -/// 调整竖排悬浮框窗口大小 -#[tauri::command] -pub async fn resize_vertical_overlay( - app_handle: tauri::AppHandle, - height: u32, -) -> Result<(), String> { - if let Some(window) = app_handle.get_webview_window("vertical-overlay") { - let scale = window - .scale_factor() - .unwrap_or(1.0); - let _ = window.set_size(tauri::LogicalSize { - width: 220.0, - height: height as f64 / scale, - }); - } - Ok(()) -} - -/// 切换竖排悬浮框开关(供快捷键调用) -pub fn toggle_vertical_overlay(app_handle: &tauri::AppHandle) -> Result { - if VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) { - // 使用 blocking 方式调用 async 命令 - let handle = app_handle.clone(); - tauri::async_runtime::block_on(async move { - stop_vertical_overlay(handle).await - }) - } else { - let handle = app_handle.clone(); - tauri::async_runtime::block_on(async move { - start_vertical_overlay(handle, None).await - }) - } -} - -/// 查询竖排悬浮框是否活跃 -pub fn is_vertical_overlay_active() -> bool { - VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) -} - -/// 停止数据推送线程 -pub fn stop_data_thread() { - DATA_THREAD_STARTED.store(false, Ordering::SeqCst); -} - -/// 清理(应用退出时调用) -pub fn cleanup(app_handle: &tauri::AppHandle) { - if VERTICAL_OVERLAY_ACTIVE.load(Ordering::SeqCst) { - VERTICAL_OVERLAY_ACTIVE.store(false, Ordering::SeqCst); - if let Some(window) = app_handle.get_webview_window("vertical-overlay") { - let _ = window.hide(); - } - } - stop_data_thread(); -} diff --git a/参考/NexBox-main/src-tauri/src/video_bg.rs b/参考/NexBox-main/src-tauri/src/video_bg.rs deleted file mode 100644 index b5186ef..0000000 --- a/参考/NexBox-main/src-tauri/src/video_bg.rs +++ /dev/null @@ -1,9 +0,0 @@ -/// 打开原生文件对话框选择视频文件,返回绝对路径 -#[tauri::command] -pub fn pick_video_file() -> Result, String> { - let file = rfd::FileDialog::new() - .add_filter("视频文件 (mp4/webm)", &["mp4", "webm"]) - .pick_file(); - - Ok(file.map(|p| p.to_string_lossy().to_string())) -} diff --git a/参考/NexBox-main/src-tauri/src/wmi_query.rs b/参考/NexBox-main/src-tauri/src/wmi_query.rs deleted file mode 100644 index 9934d2b..0000000 --- a/参考/NexBox-main/src-tauri/src/wmi_query.rs +++ /dev/null @@ -1,106 +0,0 @@ -// WMI COM 直调模块 — 替代 PowerShell,通过 IWbemServices 查询 WMI -// 基于 wmi crate(底层即 windows crate 的 COM 调用) - -use std::collections::HashMap; -use wmi::{COMLibrary, WMIConnection, Variant}; - -fn create_connection() -> Result { - let com_con = - COMLibrary::new().map_err(|e| format!("COM初始化失败: {}", e))?; - WMIConnection::new(com_con.into()).map_err(|e| format!("WMI连接失败: {}", e)) -} - -/// 执行 WQL 查询,返回行列表(每行是 属性名 → Variant) -pub fn wmi_query(wql: &str) -> Result>, String> { - let con = create_connection()?; - con.raw_query(wql) - .map_err(|e| format!("WMI查询失败: {}", e)) -} - -// ─── Variant 提取辅助函数 ─── - -/// 提取为字符串(null/empty 返回 None) -pub fn v_str(v: &Variant) -> Option { - match v { - Variant::String(s) => { - let s = s.trim(); - if s.is_empty() { None } else { Some(s.to_string()) } - } - Variant::UI1(n) => Some(n.to_string()), - Variant::UI2(n) => Some(n.to_string()), - Variant::UI4(n) => Some(n.to_string()), - Variant::UI8(n) => Some(n.to_string()), - Variant::I1(n) => Some(n.to_string()), - Variant::I2(n) => Some(n.to_string()), - Variant::I4(n) => Some(n.to_string()), - Variant::I8(n) => Some(n.to_string()), - Variant::R4(n) => Some(format!("{:.1}", n)), - Variant::R8(n) => Some(format!("{}", n)), - Variant::Bool(b) => Some(b.to_string()), - Variant::Empty | Variant::Null => None, - _ => None, - } -} - -pub fn v_u16(v: &Variant) -> Option { - match v { - Variant::UI1(n) => Some(*n as u16), - Variant::UI2(n) => Some(*n), - Variant::UI4(n) => Some(*n as u16), - Variant::UI8(n) => Some(*n as u16), - Variant::I1(n) => Some(*n as u16), - Variant::I2(n) => Some(*n as u16), - Variant::I4(n) => Some(*n as u16), - Variant::String(s) => s.trim().parse().ok(), - Variant::Empty | Variant::Null => None, - _ => None, - } -} - -pub fn v_u32(v: &Variant) -> Option { - match v { - Variant::UI2(n) => Some(*n as u32), - Variant::UI4(n) => Some(*n), - Variant::UI8(n) => Some(*n as u32), - Variant::I4(n) => Some(*n as u32), - Variant::String(s) => s.trim().parse().ok(), - Variant::Empty | Variant::Null => None, - _ => None, - } -} - -pub fn v_u64(v: &Variant) -> Option { - match v { - Variant::UI4(n) => Some(*n as u64), - Variant::UI8(n) => Some(*n), - Variant::I4(n) => Some(*n as u64), - Variant::I8(n) => Some(*n as u64), - Variant::String(s) => s.trim().parse().ok(), - Variant::Empty | Variant::Null => None, - _ => None, - } -} - -/// 判断 Variant 是否非空且非空字符串 -pub fn v_u16_arr(v: &Variant) -> Vec { - match v { - Variant::String(s) => s - .split(',') - .filter_map(|p| p.trim().parse::().ok()) - .collect(), - Variant::UI1(n) => vec![*n as u16], - Variant::UI2(n) => vec![*n], - Variant::UI4(n) => vec![*n as u16], - Variant::Array(arr) => arr.iter().filter_map(|e| v_u16(e)).collect(), - _ => vec![], - } -} - -/// 判断 Variant 是否非空且非空字符串 -pub fn v_nonempty(v: &Variant) -> bool { - match v { - Variant::Empty | Variant::Null => false, - Variant::String(s) => !s.trim().is_empty(), - _ => true, - } -} diff --git a/参考/NexBox-main/src-tauri/tauri.conf.json b/参考/NexBox-main/src-tauri/tauri.conf.json deleted file mode 100644 index 7ef537b..0000000 --- a/参考/NexBox-main/src-tauri/tauri.conf.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", - "productName": "NexBox", - "version": "5.9.8", - "identifier": "NexBox", - "build": { - "frontendDist": "../dist", - "devUrl": "http://127.0.0.1:3000", - "beforeDevCommand": "npm run dev", - "beforeBuildCommand": "npm run build" - }, - "app": { - "windows": [ - { - "title": "NexBox", - "width": 1230, - "height": 771, - "minWidth": 1230, - "minHeight": 771, - "resizable": true, - "fullscreen": false, - "decorations": false, - "devtools": true - }, - { - "title": "NexBox Widget", - "width": 260, - "height": 42, - "resizable": false, - "decorations": false, - "transparent": true, - "alwaysOnTop": true, - "visible": false, - "maximized": false, - "maximizable": false, - "skipTaskbar": true, - "shadow": false, - "label": "widget", - "url": "/widget" - }, - { - "title": "NexBox Tray Menu", - "width": 190, - "height": 140, - "resizable": false, - "decorations": false, - "transparent": true, - "visible": false, - "maximized": false, - "maximizable": false, - "skipTaskbar": true, - "shadow": false, - "label": "tray-menu", - "url": "/tray-menu" - }, - { - "title": "NexBox Desktop Lyrics", - "width": 800, - "height": 200, - "resizable": false, - "decorations": false, - "transparent": true, - "alwaysOnTop": true, - "visible": false, - "maximized": false, - "maximizable": false, - "skipTaskbar": true, - "shadow": false, - "label": "desktop-lyrics", - "url": "/desktop-lyrics" - }, - { - "title": "NexBox Vertical Overlay", - "width": 220, - "height": 400, - "resizable": false, - "decorations": false, - "transparent": true, - "alwaysOnTop": true, - "visible": false, - "maximized": false, - "maximizable": false, - "skipTaskbar": true, - "shadow": false, - "label": "vertical-overlay", - "url": "/vertical-overlay" - }, - { - "title": "Lyrics Unlock", - "width": 48, - "height": 48, - "resizable": false, - "decorations": false, - "transparent": true, - "alwaysOnTop": true, - "visible": false, - "maximized": false, - "maximizable": false, - "skipTaskbar": true, - "shadow": false, - "label": "lyrics-unlock-btn", - "url": "/lyrics-unlock-btn" - } - ], - "security": { - "csp": null, - "assetProtocol": { - "enable": true, - "scope": ["**"] - } - } - }, - "bundle": { - "active": false, - "targets": "all", - "resources": [ - "../nvidiaProfileInspector.exe", - "../nvidiaProfileInspector.exe.config", - "../Reference.xml", - "../power-plans/*", - "../monitor/bin/Release/net48/*", - "../aq_registry/*", - "../aq_registry_restore/*", - "resources/binaries/fxvad/*", - "resources/binaries/fxvad/presets/*", - "resources/binaries/PresentMon-2.5.1-x64.exe" - ], - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ] - } -} diff --git a/参考/NexBox-main/src/App.tsx b/参考/NexBox-main/src/App.tsx deleted file mode 100644 index 319fb82..0000000 --- a/参考/NexBox-main/src/App.tsx +++ /dev/null @@ -1,452 +0,0 @@ -import { Routes, Route, useLocation, useNavigate } from "react-router-dom"; -import { AnimatePresence } from "framer-motion"; -import { MainLayout } from "./components/ui/main-layout"; -import { AnimatedPage, type TransitionMode, readTransitionMode } from "./components/ui/animated-page"; -import HomePage from "./pages/HomePage"; -import HardwarePage from "./pages/HardwarePage"; -import ToolsPage from "./pages/ToolsPage"; -import OptimizePage from "./pages/OptimizePage"; -import MemoryLimitPage from "./pages/MemoryLimitPage"; -import MemoryCleanupPage from "./pages/MemoryCleanupPage"; -import AceOptimizePage from "./pages/AceOptimizePage"; -import DisplayFilterPage from "./pages/DisplayFilterPage"; -import SettingsPage from "./pages/SettingsPage"; -import CrosshairPage from "./pages/CrosshairPage"; -import DiskHealthPage from "./pages/DiskHealthPage"; -import OverlayPanelPage from "./pages/OverlayPanelPage"; -import DeltaForcePage from "./pages/DeltaForcePage"; -import OtherGunCodePlatformsPage from "./pages/OtherGunCodePlatformsPage"; -import MoodPage from "./pages/MoodPage"; -import BuiltinToolsPage from "./pages/BuiltinToolsPage"; -import GpuRenamePage from "./pages/GpuRenamePage"; -import ResolutionConverterPage from "./pages/ResolutionConverterPage"; -import ShaderCachePage from "./pages/ShaderCachePage"; -import PowerManagementPage from "./pages/PowerManagementPage"; -import StorageCleanPage from "./pages/StorageCleanPage"; -import StartupManagerPage from "./pages/StartupManagerPage"; -import SystemOptimizerPage from "./pages/SystemOptimizerPage"; -import NetworkOptimizerPage from "./pages/NetworkOptimizerPage"; -import PeripheralOptimizePage from "./pages/PeripheralOptimizePage"; -import WindowsUpdatePage from "./pages/WindowsUpdatePage"; -import DLSSPresetPage from "./pages/DLSSPresetPage"; -import NvidiaDriverPage from "./pages/NvidiaDriverPage"; -import EpicFreePage from "./pages/EpicFreePage"; -import TrayMenuPage from "./pages/TrayMenuPage"; -import DesktopLyricsPage from "./pages/DesktopLyricsPage"; -import LyricsUnlockBtnPage from "./pages/LyricsUnlockBtnPage"; -import VerticalOverlayPage from "./pages/VerticalOverlayPage"; -import AudioEqPage from "./pages/AudioEqPage"; -import { useState, useEffect } from "react"; - -import { - Box, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalCloseButton, - ModalBody, - ModalFooter, - Button, - Progress, - useColorModeValue, - Text, - VStack, - HStack, - useToast, -} from "@chakra-ui/react"; -import { useTranslation } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; -import { listen } from "@tauri-apps/api/event"; -import { fetchLatestRelease, compareVersions, type GiteeRelease } from "@/lib/update-checker"; -import { LiquidGlassButton } from "@/components/special/liquid-glass-button"; -import { LuDownload, LuRefreshCw } from "react-icons/lu"; -import { SplashScreen } from "./components/SplashScreen"; -import { useAppStartup } from "./contexts/app-startup-context"; -import { MusicProvider } from "./contexts/music-context"; -import MusicPage from "./pages/MusicPage"; -import { ImportantAnnouncementModal } from "./components/ImportantAnnouncementModal"; - -const CURRENT_VERSION = "5.9.8"; - -function App() { - const { t } = useTranslation(); - const { isStartupComplete } = useAppStartup(); - const location = useLocation(); - const navigate = useNavigate(); - const toast = useToast(); - - // Tray menu: render standalone, no main layout - if (location.pathname === "/tray-menu") { - return ; - } - - // Desktop lyrics window: render standalone, no main layout - if (location.pathname === "/desktop-lyrics") { - return ; - } - - // Lyrics unlock button window: tiny standalone overlay - if (location.pathname === "/lyrics-unlock-btn") { - return ; - } - - // Vertical overlay window: standalone, no main layout - if (location.pathname === "/vertical-overlay") { - return ; - } - const [latestRelease, setLatestRelease] = useState(null); - const [isModalOpen, setIsModalOpen] = useState(false); - const [isDownloading, setIsDownloading] = useState(false); - const [downloadProgress, setDownloadProgress] = useState(0); - const [isDownloadComplete, setIsDownloadComplete] = useState(false); - const [downloadedFilePath, setDownloadedFilePath] = useState(""); - const [pageTransitionMode, setPageTransitionMode] = useState("fade"); - - const labelColor = useColorModeValue("gray.700", "#e0e0e0"); - const subLabelColor = useColorModeValue("gray.500", "#888888"); - const modalBg = useColorModeValue("white", "#111111"); - const modalBorderColor = useColorModeValue("gray.200", "#333333"); - - useEffect(() => { - const unlisten = listen<{ progress: number; total: number }>("download-progress", (event) => { - setDownloadProgress(event.payload.progress); - }); - return () => { - unlisten.then((fn) => fn()); - }; - }, []); - - useEffect(() => { - setPageTransitionMode(readTransitionMode()); - - const handler = () => setPageTransitionMode(readTransitionMode()); - - window.addEventListener("page-transition-setting-changed", handler); - return () => window.removeEventListener("page-transition-setting-changed", handler); - }, []); - - useEffect(() => { - const unlisten = listen("check-update", async () => { - navigate("/settings?section=about"); - - setTimeout(async () => { - try { - const release = await fetchLatestRelease(); - if (release) { - const hasUpdate = compareVersions(CURRENT_VERSION, release.tag_name); - if (hasUpdate) { - setLatestRelease(release); - setIsModalOpen(true); - } else { - toast({ title: "已是最新版本", status: "success", duration: 2000, isClosable: true }); - } - } - } catch (error) { - console.error("Failed to check for updates:", error); - toast({ title: "检查更新失败", status: "error", duration: 2000, isClosable: true }); - } - }, 500); - }); - - return () => { - unlisten.then((fn) => fn()); - }; - }, [navigate, toast]); - - useEffect(() => { - const checkUpdateOnStartup = async () => { - if (!isStartupComplete) return; - - try { - const release = await fetchLatestRelease(); - if (release) { - const hasUpdate = compareVersions(CURRENT_VERSION, release.tag_name); - if (hasUpdate) { - setLatestRelease(release); - setIsModalOpen(true); - } - } - } catch (error) { - console.error("Failed to check for updates on startup:", error); - } - }; - - checkUpdateOnStartup(); - }, [isStartupComplete]); - - const handleOpenLink = async (url: string) => { - try { - const { open } = await import("@tauri-apps/plugin-shell"); - await open(url); - } catch (error) { - console.error("Failed to open link:", error); - } - }; - - const handleDownload = async () => { - if (!latestRelease) return; - - setIsDownloading(true); - setDownloadProgress(0); - setIsDownloadComplete(false); - - try { - const asset = latestRelease.assets.find( - (a) => a.name.endsWith(".msi") || a.name.endsWith(".exe"), - ); - - if (asset) { - const filePath = await invoke("download_update", { - url: asset.browser_download_url, - fileName: asset.name, - }); - setDownloadedFilePath(filePath); - setIsDownloadComplete(true); - } else { - await handleOpenLink(latestRelease.html_url); - setIsDownloading(false); - } - } catch (error) { - console.error("Failed to download:", error); - toast({ - title: t("settings.aboutSettings.downloadFailed") || "下载失败", - status: "error", - duration: 2000, - isClosable: true, - }); - setIsDownloading(false); - } - }; - - const handleInstall = async () => { - if (!downloadedFilePath) return; - - try { - await invoke("install_update", { - filePath: downloadedFilePath, - }); - } catch (error) { - console.error("Failed to install:", error); - toast({ - title: t("settings.aboutSettings.installFailed") || "安装失败", - status: "error", - duration: 2000, - isClosable: true, - }); - } - }; - - const handleSkip = async () => { - if (downloadedFilePath) { - try { - await invoke("delete_download_file", { - filePath: downloadedFilePath, - }); - } catch (error) { - console.error("Failed to delete file:", error); - } - } - setIsModalOpen(false); - setIsDownloadComplete(false); - setDownloadedFilePath(""); - setIsDownloading(false); - }; - - return ( - - <> - {!isStartupComplete && } - {/* */} - - {pageTransitionMode !== "off" ? ( - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - - ) : ( - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - )} - - - - !isDownloading && !isDownloadComplete && setIsModalOpen(false)} - isCentered - closeOnOverlayClick={!isDownloading && !isDownloadComplete} - > - - - - {t("settings.aboutSettings.updateModal.title")} - - {!isDownloading && !isDownloadComplete && } - - - - - {t("settings.aboutSettings.updateModal.version")}: - - - {latestRelease?.tag_name} - - - - - {t("settings.aboutSettings.updateModal.releaseNotes")}: - - - - {latestRelease?.body || "无更新说明"} - - - - {isDownloading && !isDownloadComplete && ( - - - - {t("settings.aboutSettings.updateModal.downloading")} {downloadProgress}% - - - )} - {isDownloadComplete && ( - - - {t("settings.aboutSettings.updateModal.downloadComplete")} - - - )} - - - - {isDownloadComplete ? ( - <> - - } - > - {t("settings.aboutSettings.updateModal.restartInstall")} - - - ) : ( - <> - {!isDownloading && ( - - )} - : undefined} - > - {isDownloading - ? t("settings.aboutSettings.updateModal.downloading") - : t("settings.aboutSettings.updateModal.download")} - - - )} - - - - - - - ); -} - -export default App; diff --git a/参考/NexBox-main/src/assets/deltaforce.png b/参考/NexBox-main/src/assets/deltaforce.png deleted file mode 100644 index 138bb7f..0000000 Binary files a/参考/NexBox-main/src/assets/deltaforce.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/epic-games.png b/参考/NexBox-main/src/assets/epic-games.png deleted file mode 100644 index 1a306b3..0000000 Binary files a/参考/NexBox-main/src/assets/epic-games.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/epic-games.svg b/参考/NexBox-main/src/assets/epic-games.svg deleted file mode 100644 index 595a01d..0000000 --- a/参考/NexBox-main/src/assets/epic-games.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/参考/NexBox-main/src/assets/nvidia.png b/参考/NexBox-main/src/assets/nvidia.png deleted file mode 100644 index 10a0090..0000000 Binary files a/参考/NexBox-main/src/assets/nvidia.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/CPU-Z.png b/参考/NexBox-main/src/assets/tools/CPU-Z.png deleted file mode 100644 index b380f61..0000000 Binary files a/参考/NexBox-main/src/assets/tools/CPU-Z.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Clash-Verge.png b/参考/NexBox-main/src/assets/tools/Clash-Verge.png deleted file mode 100644 index 4dd0ad4..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Clash-Verge.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/FxSound.png b/参考/NexBox-main/src/assets/tools/FxSound.png deleted file mode 100644 index af6d0a9..0000000 Binary files a/参考/NexBox-main/src/assets/tools/FxSound.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/GPU-Z.png b/参考/NexBox-main/src/assets/tools/GPU-Z.png deleted file mode 100644 index 63ddfdd..0000000 Binary files a/参考/NexBox-main/src/assets/tools/GPU-Z.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/MCTier.png b/参考/NexBox-main/src/assets/tools/MCTier.png deleted file mode 100644 index a440da2..0000000 Binary files a/参考/NexBox-main/src/assets/tools/MCTier.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/MR.png b/参考/NexBox-main/src/assets/tools/MR.png deleted file mode 100644 index 9948b83..0000000 Binary files a/参考/NexBox-main/src/assets/tools/MR.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Memreduct.png b/参考/NexBox-main/src/assets/tools/Memreduct.png deleted file mode 100644 index ebf927f..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Memreduct.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/OBS.png b/参考/NexBox-main/src/assets/tools/OBS.png deleted file mode 100644 index 2e51e80..0000000 Binary files a/参考/NexBox-main/src/assets/tools/OBS.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Optimizer.png b/参考/NexBox-main/src/assets/tools/Optimizer.png deleted file mode 100644 index e1809b5..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Optimizer.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/PCL2.png b/参考/NexBox-main/src/assets/tools/PCL2.png deleted file mode 100644 index 04c4632..0000000 Binary files a/参考/NexBox-main/src/assets/tools/PCL2.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Pyisland.png b/参考/NexBox-main/src/assets/tools/Pyisland.png deleted file mode 100644 index 1290ace..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Pyisland.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/SJMCL.png b/参考/NexBox-main/src/assets/tools/SJMCL.png deleted file mode 100644 index 806f12e..0000000 Binary files a/参考/NexBox-main/src/assets/tools/SJMCL.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Steam.png b/参考/NexBox-main/src/assets/tools/Steam.png deleted file mode 100644 index 86275c8..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Steam.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/TieZ.png b/参考/NexBox-main/src/assets/tools/TieZ.png deleted file mode 100644 index 68ee2b0..0000000 Binary files a/参考/NexBox-main/src/assets/tools/TieZ.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/Wallpaper.png b/参考/NexBox-main/src/assets/tools/Wallpaper.png deleted file mode 100644 index 3cf1da6..0000000 Binary files a/参考/NexBox-main/src/assets/tools/Wallpaper.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/ddegame.png b/参考/NexBox-main/src/assets/tools/ddegame.png deleted file mode 100644 index 1148c5d..0000000 Binary files a/参考/NexBox-main/src/assets/tools/ddegame.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/epic-games.png b/参考/NexBox-main/src/assets/tools/epic-games.png deleted file mode 100644 index 1a306b3..0000000 Binary files a/参考/NexBox-main/src/assets/tools/epic-games.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/geek.png b/参考/NexBox-main/src/assets/tools/geek.png deleted file mode 100644 index 9e0eadf..0000000 Binary files a/参考/NexBox-main/src/assets/tools/geek.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/huorong.png b/参考/NexBox-main/src/assets/tools/huorong.png deleted file mode 100644 index cec2ce0..0000000 Binary files a/参考/NexBox-main/src/assets/tools/huorong.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/msi-afterburner.png b/参考/NexBox-main/src/assets/tools/msi-afterburner.png deleted file mode 100644 index c7da14c..0000000 Binary files a/参考/NexBox-main/src/assets/tools/msi-afterburner.png and /dev/null differ diff --git a/参考/NexBox-main/src/assets/tools/nvidia-app.png b/参考/NexBox-main/src/assets/tools/nvidia-app.png deleted file mode 100644 index 10a0090..0000000 Binary files a/参考/NexBox-main/src/assets/tools/nvidia-app.png and /dev/null differ diff --git a/参考/NexBox-main/src/components/AnnouncementCard.tsx b/参考/NexBox-main/src/components/AnnouncementCard.tsx deleted file mode 100644 index 6b6374e..0000000 --- a/参考/NexBox-main/src/components/AnnouncementCard.tsx +++ /dev/null @@ -1,211 +0,0 @@ -import { Box, Text, VStack, useColorModeValue, Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalCloseButton, useDisclosure, Badge, Divider, HStack, Spinner } from "@chakra-ui/react"; -import { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; - -interface Announcement { - title: string; - content: string; - important: boolean; - create_time: string; -} - -interface AnnouncementResponse { - version: number; - announce_list: Announcement[]; -} - -export function useAnnouncementEnabled() { - const [enabled, setEnabled] = useState(true); - - useEffect(() => { - const saved = localStorage.getItem("nexbox_announcement_enabled"); - if (saved !== null) { - setEnabled(saved === "true"); - } - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => setEnabled(e.detail); - window.addEventListener("announcement-setting-changed", handler as EventListener); - return () => window.removeEventListener("announcement-setting-changed", handler as EventListener); - }, []); - - return enabled; -} - -export function AnnouncementCard() { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - const { isOpen, onOpen, onClose } = useDisclosure(); - const [announcements, setAnnouncements] = useState([]); - const [loading, setLoading] = useState(false); - const [hasUnread, setHasUnread] = useState(false); - - const labelColor = useColorModeValue("gray.500", "#cccccc"); - const cardBg = useColorModeValue("white", "#1a1a1a"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const contentColor = useColorModeValue("gray.700", "#cccccc"); - const dateColor = useColorModeValue("gray.400", "#666666"); - const countColor = useColorModeValue("purple.500", "#b794f4"); - const modalBg = useColorModeValue("white", "#1a1a1a"); - - useEffect(() => { - const lastReadTime = localStorage.getItem("nexbox_announcement_last_read"); - const fetchAnnouncements = async () => { - try { - const response = await invoke("get_announcements"); - setAnnouncements(response.announce_list); - - if (response.announce_list.length > 0 && lastReadTime) { - const lastRead = new Date(lastReadTime); - const hasNew = response.announce_list.some(a => new Date(a.create_time) > lastRead); - setHasUnread(hasNew); - } else if (response.announce_list.length > 0) { - setHasUnread(true); - } - } catch (e) { - console.error("Failed to fetch announcements:", e); - } - }; - fetchAnnouncements(); - }, []); - - const handleOpenModal = async () => { - setLoading(true); - onOpen(); - try { - const response = await invoke("get_announcements"); - setAnnouncements(response.announce_list); - localStorage.setItem("nexbox_announcement_last_read", new Date().toISOString()); - setHasUnread(false); - } catch (e) { - console.error("Failed to fetch announcements:", e); - } finally { - setLoading(false); - } - }; - - const cardContent = ( - - - {t("home.announcement")} - - - - {announcements.length} - - {hasUnread && ( - - )} - - - ); - - const modalContent = ( - - - - {t("home.announcementList")} - - - {loading ? ( - - - {t("home.loading")} - - ) : announcements.length === 0 ? ( - - {t("home.noAnnouncement")} - - ) : ( - - {announcements.map((announcement, index) => ( - - - - - - {announcement.title} - - {announcement.important && ( - - {t("home.important")} - - )} - - - {announcement.create_time} - - - - {announcement.content} - - - {index < announcements.length - 1 && } - - ))} - - )} - - - - ); - - return ( - <> - {liquidGlassEnabled ? ( - - {cardContent} - - ) : ( - - {cardContent} - - )} - {modalContent} - - ); -} diff --git a/参考/NexBox-main/src/components/BleDeviceDialog.tsx b/参考/NexBox-main/src/components/BleDeviceDialog.tsx deleted file mode 100644 index f2ab4fe..0000000 --- a/参考/NexBox-main/src/components/BleDeviceDialog.tsx +++ /dev/null @@ -1,280 +0,0 @@ -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, - VStack, - HStack, - Text, - Button, - Icon, - Badge, - Spinner, - useColorModeValue, - useToast, - Divider, -} from "@chakra-ui/react"; -import { useState, useEffect, useCallback } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { Bluetooth, Radio, Wifi, WifiOff } from "lucide-react"; -import { useThemeColor } from "@/contexts/theme-color-context"; - -interface BleDeviceInfo { - address: number; - address_str: string; - name: string; -} - -type BleConnectionStatus = "Disconnected" | "Scanning" | "Connecting" | "Connected"; - -interface HeartRateData { - heart_rate: number | null; - device_name: string | null; - connection_status: BleConnectionStatus; -} - -interface BleDeviceDialogProps { - isOpen: boolean; - onClose: () => void; -} - -export function BleDeviceDialog({ isOpen, onClose }: BleDeviceDialogProps) { - const [devices, setDevices] = useState([]); - const [isScanning, setIsScanning] = useState(false); - const [connectingAddress, setConnectingAddress] = useState(null); - const [heartRateData, setHeartRateData] = useState({ - heart_rate: null, - device_name: null, - connection_status: "Disconnected", - }); - - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#999999"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const cardBg = useColorModeValue("gray.50", "#1a1a1a"); - const toast = useToast(); - const { getActiveColor } = useThemeColor(); - - const refreshStatus = useCallback(async () => { - try { - const data = await invoke("get_heart_rate_data"); - setHeartRateData(data); - } catch { - // ignore - } - }, []); - - useEffect(() => { - if (isOpen) { - refreshStatus(); - } - }, [isOpen, refreshStatus]); - - const handleScan = async () => { - setIsScanning(true); - setDevices([]); - try { - const result = await invoke("scan_ble_devices"); - setDevices(result); - if (result.length === 0) { - toast({ - title: "未发现设备", - description: "请确保手环/手表已开启并在系统蓝牙中已配对", - status: "warning", - duration: 3000, - isClosable: true, - }); - } - } catch (err) { - toast({ - title: "扫描失败", - description: String(err), - status: "error", - duration: 3000, - isClosable: true, - }); - } finally { - setIsScanning(false); - } - }; - - const handleConnect = async (address: number, name: string) => { - setConnectingAddress(address); - try { - // 小米设备使用纯广播监听(免配对、免连接) - const isXiaomi = name.toLowerCase().includes("mi band") - || name.toLowerCase().includes("miband") - || name.toLowerCase().includes("xiaomi smart band") - || name.toLowerCase().includes("mi smart band"); - - if (isXiaomi) { - await invoke("start_advert_hr_listen", { address }); - } else { - await invoke("connect_ble_device", { address }); - } - - toast({ - title: "连接成功", - status: "success", - duration: 2000, - isClosable: true, - }); - await refreshStatus(); - } catch (err) { - toast({ - title: "连接失败", - description: String(err), - status: "error", - duration: 3000, - isClosable: true, - }); - } finally { - setConnectingAddress(null); - } - }; - - const handleDisconnect = async () => { - try { - await invoke("disconnect_ble_device"); - setHeartRateData({ - heart_rate: null, - device_name: null, - connection_status: "Disconnected", - }); - toast({ - title: "已断开连接", - status: "info", - duration: 2000, - isClosable: true, - }); - } catch (err) { - toast({ - title: "断开失败", - description: String(err), - status: "error", - duration: 3000, - isClosable: true, - }); - } - }; - - const isConnected = heartRateData.connection_status === "Connected"; - - return ( - - - - - - - BLE 心率设备 - - - - - - {/* 连接状态 */} - {isConnected ? ( - - - - - - {heartRateData.device_name || "已连接设备"} - - - 已连接 - - - {heartRateData.heart_rate !== null ? `${heartRateData.heart_rate} BPM` : "-- BPM"} - - - - ) : ( - <> - - - {isScanning && ( - - 正在扫描附近的 BLE 设备... (5秒) - - )} - - {devices.length > 0 && ( - <> - - - 发现 {devices.length} 个设备 - - - {devices.map((device) => ( - - - - {device.name} - - - {device.address_str} - - - - - ))} - - - )} - - {!isScanning && devices.length === 0 && ( - - 点击"扫描设备"查找附近的 BLE 心率设备 - - )} - - )} - - - - - ); -} \ No newline at end of file diff --git a/参考/NexBox-main/src/components/CloseConfirmDialog.tsx b/参考/NexBox-main/src/components/CloseConfirmDialog.tsx deleted file mode 100644 index 7e304f9..0000000 --- a/参考/NexBox-main/src/components/CloseConfirmDialog.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import { - Box, - VStack, - HStack, - Text, - Checkbox, - useColorModeValue, -} from "@chakra-ui/react"; -import { AnimatePresence, motion } from "framer-motion"; -import { useTranslation } from "react-i18next"; -import { useState } from "react"; -import { LiquidGlassCard } from "./special/liquid-glass-card"; -import { LiquidGlassButton } from "./special/liquid-glass-button"; - -interface CloseConfirmDialogProps { - isOpen: boolean; - onClose: () => void; - onCloseApp: (savePreference: boolean) => void; - onMinimizeToTray: (savePreference: boolean) => void; -} - -export function CloseConfirmDialog({ - isOpen, - onClose, - onCloseApp, - onMinimizeToTray, -}: CloseConfirmDialogProps) { - const { t } = useTranslation(); - const [dontAskAgain, setDontAskAgain] = useState(false); - - const overlayBg = useColorModeValue( - "rgba(0, 0, 0, 0.5)", - "rgba(0, 0, 0, 0.7)" - ); - const titleColor = useColorModeValue("gray.800", "#ffffff"); - const textColor = useColorModeValue("gray.600", "gray.300"); - - const handleMinimizeToTray = () => { - onMinimizeToTray(dontAskAgain); - }; - - const handleCloseApp = () => { - onCloseApp(dontAskAgain); - }; - - return ( - - {isOpen && ( - - - - - - - - {t("closeDialog.title")} - - - - {t("closeDialog.message")} - - - - - {t("closeDialog.closeApp")} - - - - {t("closeDialog.minimizeToTray")} - - - - - setDontAskAgain(e.target.checked)} - colorScheme="teal" - > - - {t("closeDialog.dontAskAgain")} - - - - - - - - )} - - ); -} diff --git a/参考/NexBox-main/src/components/DesktopLyricsSettingsModal.tsx b/参考/NexBox-main/src/components/DesktopLyricsSettingsModal.tsx deleted file mode 100644 index 3aacead..0000000 --- a/参考/NexBox-main/src/components/DesktopLyricsSettingsModal.tsx +++ /dev/null @@ -1,270 +0,0 @@ -/** - * 桌面歌词设置弹窗 - * - * 可调节: - * - 字体大小 (24~60px) - * - 高亮颜色 (已唱) - * - 底色 (未唱) - * - 显示行数 (单行/双行) - * - 实时预览 - */ - -import { useState, useEffect, memo } from "react"; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalCloseButton, - ModalBody, - ModalFooter, - Button, - Text, - HStack, - VStack, - Box, - Tooltip, - useColorModeValue, - ButtonGroup, -} from "@chakra-ui/react"; -import { CustomColorPicker } from "@/components/special/custom-color-picker"; -import { useMusicStore } from "@/stores/music-store"; - -interface DesktopLyricsSettingsModalProps { - isOpen: boolean; - onClose: () => void; -} - -// 复用桌面歌词的 range slider 样式 -const rangeSliderSx = { - "&": { - appearance: "none", - WebkitAppearance: "none", - height: "6px", - borderRadius: "3px", - outline: "none", - cursor: "pointer", - }, - "&::-webkit-slider-runnable-track": { - height: "6px", - borderRadius: "3px", - }, - "&::-webkit-slider-thumb": { - WebkitAppearance: "none", - width: "14px", - height: "14px", - borderRadius: "50%", - marginTop: "-4px", - border: "none", - }, - "&::-moz-range-track": { - height: "6px", - borderRadius: "3px", - }, - "&::-moz-range-thumb": { - width: "14px", - height: "14px", - borderRadius: "50%", - border: "none", - }, -}; - -function DesktopLyricsSettingsModalInner({ - isOpen, - onClose, -}: DesktopLyricsSettingsModalProps) { - const desktopLyricsFontSize = useMusicStore((s) => s.desktopLyricsFontSize); - const desktopLyricsHighlightColor = useMusicStore((s) => s.desktopLyricsHighlightColor); - const desktopLyricsBaseColor = useMusicStore((s) => s.desktopLyricsBaseColor); - const desktopLyricsLineCount = useMusicStore((s) => s.desktopLyricsLineCount); - - const labelColor = useColorModeValue("gray.700", "#e0e0e0"); - const subLabelColor = useColorModeValue("gray.500", "#888888"); - const modalBg = useColorModeValue("white", "#111111"); - const modalBorderColor = useColorModeValue("gray.200", "#333333"); - const sliderTrackBg = useColorModeValue("rgba(0,0,0,0.1)", "rgba(255,255,255,0.9)"); - const previewBg = useColorModeValue("linear-gradient(135deg, #1a1a2e, #16213e)", "linear-gradient(135deg, #1a1a2e, #16213e)"); - - // 预览用的模拟歌词 - const previewLines = [ - { text: "你是我最美的意外", progress: 0.5 }, - { text: "让我牵着你的手", progress: 0 }, - ]; - - const accentColor = desktopLyricsHighlightColor; - - return ( - - - - - 桌面歌词设置 - - - - - - {/* 字体大小 */} - - - - 字体大小 - - - {desktopLyricsFontSize}px - - - - A - - useMusicStore.getState().setDesktopLyricsFontSize( - parseInt((e.target as HTMLInputElement).value) - ) - } - w="100%" - sx={{ - ...rangeSliderSx, - background: `linear-gradient(to right, ${accentColor} 0%, ${accentColor} ${((desktopLyricsFontSize - 24) / 36) * 100}%, ${sliderTrackBg} ${((desktopLyricsFontSize - 24) / 36) * 100}%, ${sliderTrackBg} 100%)`, - "&::-webkit-slider-thumb": { - ...rangeSliderSx["&::-webkit-slider-thumb"], - background: accentColor, - }, - "&::-moz-range-thumb": { - ...rangeSliderSx["&::-moz-range-thumb"], - background: accentColor, - }, - }} - /> - A - - - - {/* 颜色选择 */} - - - - 高亮颜色(已唱) - - useMusicStore.getState().setDesktopLyricsHighlightColor(c)} - /> - - - - 底色(未唱) - - useMusicStore.getState().setDesktopLyricsBaseColor(c)} - /> - - - - {/* 显示行数 */} - - - 显示行数 - - - - - - - - {/* 预览 */} - - - 预览效果: - - - - {/* 当前行预览 */} - - - {previewLines[0].text} - - - {previewLines[0].text} - - - {/* 下一行预览 */} - {desktopLyricsLineCount === 2 && ( - - {previewLines[1].text} - - )} - - - - - - - - - - - - ); -} - -export const DesktopLyricsSettingsModal = memo(DesktopLyricsSettingsModalInner); diff --git a/参考/NexBox-main/src/components/DraggableDisplayItems.tsx b/参考/NexBox-main/src/components/DraggableDisplayItems.tsx deleted file mode 100644 index 187402f..0000000 --- a/参考/NexBox-main/src/components/DraggableDisplayItems.tsx +++ /dev/null @@ -1,254 +0,0 @@ -import { Box, HStack, Text, Switch, useColorModeValue, Icon, useToast, Button, IconButton } from "@chakra-ui/react"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { hexToRgba } from "@/lib/color-utils"; -import { GripVertical, Cpu, Thermometer, Activity, HardDrive, Key, Gauge, Fan, Zap, Clock, Download, Settings } from "lucide-react"; -import { invoke } from "@tauri-apps/api/core"; -import { - DndContext, - closestCenter, - KeyboardSensor, - PointerSensor, - useSensor, - useSensors, - DragEndEvent, -} from "@dnd-kit/core"; -import { - arrayMove, - SortableContext, - sortableKeyboardCoordinates, - useSortable, - verticalListSortingStrategy, -} from "@dnd-kit/sortable"; -import { CSS } from "@dnd-kit/utilities"; - -export interface DisplayItem { - id: string; - label: string; - enabled: boolean; -} - -interface DraggableDisplayItemsProps { - items: DisplayItem[]; - onReorder: (items: DisplayItem[]) => void; - onToggle: (id: string, enabled: boolean) => void; - disabledItems?: string[]; - onDeltaPasswordSettings?: () => void; -} - -const ITEM_ICONS: Record> = { - cpu_usage: Cpu, - cpu_temp: Thermometer, - cpu_clock: Clock, - cpu_voltage: Zap, - cpu_power: Zap, - cpu_fan_speed: Fan, - gpu_temp: Thermometer, - gpu_usage: Activity, - gpu_fan_speed: Fan, - gpu_power: Zap, - gpu_clock: Clock, - gpu_memory_clock: Clock, - gpu_voltage: Zap, - gpu_vram: HardDrive, - memory_usage: HardDrive, - ssd_temp: HardDrive, - delta_password: Key, - game_ping: Gauge, - fps: Activity, -}; - -function SortableItem({ - item, - onToggle, - enabledCount, - disabled, - onSettingsClick, -}: { - item: DisplayItem; - onToggle: (id: string, enabled: boolean) => void; - enabledCount: number; - disabled?: boolean; - onSettingsClick?: () => void; -}) { - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const iconColor = useColorModeValue("gray.500", "#999999"); - const hoverBg = useColorModeValue("gray.50", "#1a1a1a"); - const dragBg = useColorModeValue("gray.100", "#222222"); - const toast = useToast(); - const { getActiveColor } = useThemeColor(); - - const { - attributes, - listeners, - setNodeRef, - transform, - transition, - isDragging, - } = useSortable({ id: item.id }); - - const style = { - transform: CSS.Transform.toString(transform), - transition, - opacity: isDragging ? 0.8 : 1, - zIndex: isDragging ? 10 : 1, - }; - - const IconComponent = ITEM_ICONS[item.id] || Activity; - - const handleToggle = (checked: boolean) => { - if (!checked && enabledCount <= 1) { - toast({ - title: "至少需要保留一个显示项", - status: "warning", - duration: 2000, - isClosable: true, - }); - return; - } - onToggle(item.id, checked); - }; - - return ( - - - - - } color={item.enabled ? getActiveColor() : "gray.400"} /> - - {item.label} - - {item.id === "delta_password" && onSettingsClick && ( - } - size="xs" - variant="ghost" - color={getActiveColor()} - _hover={{ bg: hexToRgba(getActiveColor(), 0.1) }} - onClick={(e) => { - e.stopPropagation(); - onSettingsClick(); - }} - mr={1} - /> - )} - {item.id === "cpu_temp" && ( - - )} - handleToggle(e.target.checked)} - size="sm" - isDisabled={disabled} - sx={{ - '& .chakra-switch__track[data-checked]': { - bg: getActiveColor(), - }, - }} - /> - - ); -} - -export function DraggableDisplayItems({ - items, - onReorder, - onToggle, - disabledItems = [], - onDeltaPasswordSettings, -}: DraggableDisplayItemsProps) { - const sensors = useSensors( - useSensor(PointerSensor, { - activationConstraint: { - distance: 8, - }, - }), - useSensor(KeyboardSensor, { - coordinateGetter: sortableKeyboardCoordinates, - }) - ); - - const enabledCount = items.filter((item) => item.enabled).length; - - const handleDragEnd = (event: DragEndEvent) => { - const { active, over } = event; - - if (over && active.id !== over.id) { - const oldIndex = items.findIndex((item) => item.id === active.id); - const newIndex = items.findIndex((item) => item.id === over.id); - - onReorder(arrayMove(items, oldIndex, newIndex)); - } - }; - - return ( - - item.id)} - strategy={verticalListSortingStrategy} - > - - {items.map((item) => ( - - ))} - - - - ); -} diff --git a/参考/NexBox-main/src/components/FeedbackBanner.tsx b/参考/NexBox-main/src/components/FeedbackBanner.tsx deleted file mode 100644 index 0b1b6b0..0000000 --- a/参考/NexBox-main/src/components/FeedbackBanner.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import { Box, Image, useColorModeValue, Flex } from "@chakra-ui/react"; -import { useState, useEffect, useCallback, useRef } from "react"; -import { motion, AnimatePresence } from "framer-motion"; - -interface CarouselImage { - src: string; - alt: string; - url: string; -} - -const carouselImages: CarouselImage[] = [ - { - src: "/qq.png", - alt: "QQ Group", - url: "https://qm.qq.com/q/atlGEA2tQk", - }, - { - src: "/feedback-banner.png", - alt: "Feedback", - url: "https://nexbox.top/feedback", - }, -]; - -export function useFeedbackEnabled() { - const [enabled, setEnabled] = useState(true); - - useEffect(() => { - const saved = localStorage.getItem("nexbox_feedback_enabled"); - if (saved !== null) { - setEnabled(saved === "true"); - } - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => setEnabled(e.detail); - window.addEventListener("feedback-setting-changed", handler as EventListener); - return () => window.removeEventListener("feedback-setting-changed", handler as EventListener); - }, []); - - return enabled; -} - -export function FeedbackBanner() { - const borderColor = useColorModeValue("gray.200", "#333333"); - const cardBg = useColorModeValue("white", "#111111"); - const [currentIndex, setCurrentIndex] = useState(0); - const [isPaused, setIsPaused] = useState(false); - const intervalRef = useRef | null>(null); - const [direction, setDirection] = useState(1); - - const images = carouselImages; - - const startAutoPlay = useCallback(() => { - if (intervalRef.current) clearInterval(intervalRef.current); - intervalRef.current = setInterval(() => { - setDirection(1); - setCurrentIndex((prev) => (prev + 1) % images.length); - }, 2000); - }, [images.length]); - - useEffect(() => { - if (!isPaused && images.length > 1) { - startAutoPlay(); - } - return () => { - if (intervalRef.current) clearInterval(intervalRef.current); - }; - }, [isPaused, images.length, startAutoPlay]); - - const handleClick = async () => { - const url = images[currentIndex].url; - if (!url) return; - const { open } = await import("@tauri-apps/plugin-shell"); - open(url); - }; - - const variants = { - enter: (dir: number) => ({ x: dir > 0 ? 300 : -300, opacity: 0 }), - center: { x: 0, opacity: 1 }, - exit: (dir: number) => ({ x: dir > 0 ? -300 : 300, opacity: 0 }), - }; - - return ( - setIsPaused(true)} - onMouseLeave={() => setIsPaused(false)} - > - - - - {images[currentIndex].alt} - - - - - ); -} diff --git a/参考/NexBox-main/src/components/GameLauncher.tsx b/参考/NexBox-main/src/components/GameLauncher.tsx deleted file mode 100644 index 45c6837..0000000 --- a/参考/NexBox-main/src/components/GameLauncher.tsx +++ /dev/null @@ -1,683 +0,0 @@ -import { - Box, - Text, - Flex, - Icon, - Image, - useColorModeValue, - IconButton, - useDisclosure, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, - ModalFooter, - Button, - Input, - VStack, - Spinner, -} from "@chakra-ui/react"; -import { Gamepad2, Plus, X, FolderOpen, GripVertical } from "lucide-react"; -import { useState, useEffect, useRef, useCallback, useMemo } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { LiquidGlassButton } from "@/components/special/liquid-glass-button"; -import { - DndContext, - closestCenter, - KeyboardSensor, - PointerSensor, - useSensor, - useSensors, - DragEndEvent, -} from "@dnd-kit/core"; -import { - arrayMove, - SortableContext, - sortableKeyboardCoordinates, - useSortable, - verticalListSortingStrategy, -} from "@dnd-kit/sortable"; -import { CSS } from "@dnd-kit/utilities"; - -// 过长文字轮播组件 -function MarqueeText({ text, color }: { text: string; color: string }) { - const containerRef = useRef(null); - const hiddenRef = useRef(null); - const textRef = useRef(null); - const [shouldScroll, setShouldScroll] = useState(false); - const [offset, setOffset] = useState(0); - const animRef = useRef(null); - - // 用隐藏的完整文本测量真实宽度,不受 noOfLines 影响 - useEffect(() => { - const check = () => { - if (containerRef.current && hiddenRef.current) { - const textW = hiddenRef.current.scrollWidth; - const containerW = containerRef.current.clientWidth; - setShouldScroll(textW > containerW); - } - }; - check(); - const observer = new ResizeObserver(check); - if (containerRef.current) observer.observe(containerRef.current); - return () => observer.disconnect(); - }, [text]); - - useEffect(() => { - if (!shouldScroll) { setOffset(0); return; } - let startTime: number | null = null; - const totalDuration = 12000; - const pauseRatio = 0.08; - - const animate = (timestamp: number) => { - if (!startTime) startTime = timestamp; - const elapsed = (timestamp - startTime) % totalDuration; - const progress = elapsed / totalDuration; - - let pos = 0; - if (progress >= pauseRatio && progress <= 1 - pauseRatio) { - const scrollProgress = (progress - pauseRatio) / (1 - 2 * pauseRatio); - if (textRef.current && containerRef.current) { - const textW = textRef.current.scrollWidth; - const containerW = containerRef.current.clientWidth; - const maxScroll = textW - containerW; - pos = maxScroll > 0 ? scrollProgress : 0; - } - } - if (textRef.current && containerRef.current) { - const textW = textRef.current.scrollWidth; - const containerW = containerRef.current.clientWidth; - const maxScroll = textW - containerW; - setOffset(maxScroll > 0 ? -pos * maxScroll : 0); - } - animRef.current = requestAnimationFrame(animate); - }; - - animRef.current = requestAnimationFrame(animate); - return () => { if (animRef.current) cancelAnimationFrame(animRef.current); }; - }, [shouldScroll, text]); - - return ( - - {/* 隐藏的测量用文本,始终能获取完整宽度 */} - - {text} - - {shouldScroll ? ( - - {text} - - ) : ( - - {text} - - )} - - ); -} - -// 可拖拽排序的游戏项(使用 @dnd-kit) -function SortableGameItem({ - game, - icon, - isLaunching, - onLaunch, - onRemove, - titleColor, - descColor, - cardBg, - hoverBg, -}: { - game: GameShortcut; - icon: string | undefined; - isLaunching: boolean; - onLaunch: (g: GameShortcut) => void; - onRemove: (id: string) => void; - titleColor: string; - descColor: string; - cardBg: string; - hoverBg: string; -}) { - const { - attributes, - listeners, - setNodeRef, - transform, - transition, - isDragging, - } = useSortable({ id: game.id, disabled: isLaunching }); - - const style = { - transform: CSS.Transform.toString(transform), - transition, - opacity: isDragging ? 0.8 : 1, - zIndex: isDragging ? 10 : 1, - }; - - return ( - onLaunch(game)} - position="relative" - role="group" - _hover={{ bg: hoverBg }} - transition="background 0.15s" - > - e.stopPropagation()} - > - - - {icon && ( - - )} - - {isLaunching ? ( - - ) : ( - } - size="xs" - variant="ghost" - opacity={0} - _groupHover={{ opacity: 1 }} - onClick={(e: React.MouseEvent) => { - e.stopPropagation(); - onRemove(game.id); - }} - /> - )} - - ); -} - -interface GameShortcut { - id: string; - name: string; - path: string; - isDefault?: boolean; -} - -const STORAGE_KEY = "nexbox_game_launcher_games"; -const ICON_CACHE_KEY = "nexbox_game_icons"; -const SIZE_KEY = "nexbox_game_launcher_size"; - -const MIN_WIDTH = 180; -const MAX_WIDTH = 600; -const MIN_HEIGHT = 150; -const MAX_HEIGHT = 800; - -export default function GameLauncher() { - const { t } = useTranslation(); - const [games, setGames] = useState([]); - const [isLoading, setIsLoading] = useState(true); - const [isLaunching, setIsLaunching] = useState(null); - const [icons, setIcons] = useState>({}); - const loadingIcons = useRef>(new Set()); - const { isOpen, onOpen, onClose } = useDisclosure(); - const [newGameName, setNewGameName] = useState(""); - const [newGamePath, setNewGamePath] = useState(""); - - const [cardSize, setCardSize] = useState<{ width: number; height: number }>(() => { - try { - const saved = localStorage.getItem(SIZE_KEY); - if (saved) return JSON.parse(saved); - } catch {} - return { width: 220, height: MIN_HEIGHT }; - }); - const resizeRef = useRef<{ - edge: "left" | "top" | "corner"; - startX: number; - startY: number; - startW: number; - startH: number; - } | null>(null); - - const updateCardSize = useCallback((size: { width: number; height: number }) => { - setCardSize(size); - localStorage.setItem(SIZE_KEY, JSON.stringify(size)); - }, []); - - const onResizeStart = useCallback( - (edge: "left" | "top" | "corner") => (e: React.MouseEvent) => { - e.preventDefault(); - e.stopPropagation(); - resizeRef.current = { - edge, - startX: e.clientX, - startY: e.clientY, - startW: cardSize.width, - startH: cardSize.height, - }; - - const cursorMap = { left: "col-resize", top: "row-resize", corner: "nwse-resize" }; - document.body.style.cursor = cursorMap[edge]; - document.body.style.userSelect = "none"; - - const onMove = (ev: MouseEvent) => { - if (!resizeRef.current) return; - const dx = ev.clientX - resizeRef.current.startX; - const dy = ev.clientY - resizeRef.current.startY; - let w = resizeRef.current.startW; - let h = resizeRef.current.startH; - if (edge === "left" || edge === "corner") { - w = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, resizeRef.current.startW - dx)); - } - if (edge === "top" || edge === "corner") { - h = Math.min(MAX_HEIGHT, Math.max(MIN_HEIGHT, resizeRef.current.startH - dy)); - } - // 限制不能超出视口(卡片固定在 bottom/right,太宽/太高会顶出屏幕) - const maxW = Math.min(MAX_WIDTH, window.innerWidth - 40); - const maxH = Math.min(MAX_HEIGHT, window.innerHeight - 140); - w = Math.max(MIN_WIDTH, Math.min(maxW, w)); - h = Math.max(MIN_HEIGHT, Math.min(maxH, h)); - updateCardSize({ width: Math.round(w), height: Math.round(h) }); - }; - - const onUp = () => { - resizeRef.current = null; - document.removeEventListener("mousemove", onMove); - document.removeEventListener("mouseup", onUp); - document.body.style.cursor = ""; - document.body.style.userSelect = ""; - }; - - document.addEventListener("mousemove", onMove); - document.addEventListener("mouseup", onUp); - }, - [cardSize, updateCardSize], - ); - - const titleColor = useColorModeValue("gray.800", "#e0e0e0"); - const descColor = useColorModeValue("gray.500", "#888888"); - const cardBg = useColorModeValue("gray.100", "#222222"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const headerColor = useColorModeValue("gray.800", "#ffffff"); - const inputBg = useColorModeValue("white", "#1a1a1a"); - - useEffect(() => { - loadGames(); - }, []); - - const loadGames = async () => { - setIsLoading(true); - try { - const savedGames = localStorage.getItem(STORAGE_KEY); - const gameList: GameShortcut[] = savedGames ? JSON.parse(savedGames) : []; - - // 加载缓存的图标 - const savedIcons = localStorage.getItem(ICON_CACHE_KEY); - if (savedIcons) { - try { setIcons(JSON.parse(savedIcons)); } catch {} - } - - setGames(gameList); - } catch (error) { - console.error("Failed to load games:", error); - } finally { - setIsLoading(false); - } - }; - - // 当 games 变化时,为没有图标的游戏提取图标 - useEffect(() => { - games.forEach((game) => { - if (icons[game.id] || loadingIcons.current.has(game.id)) return; - loadingIcons.current.add(game.id); - fetchIcon(game); - }); - }, [games]); - - const fetchIcon = async (game: GameShortcut) => { - try { - const dataUri = await invoke("get_file_icon", { filePath: game.path }); - setIcons((prev) => { - const next = { ...prev, [game.id]: dataUri }; - // 缓存到 localStorage - localStorage.setItem(ICON_CACHE_KEY, JSON.stringify(next)); - return next; - }); - } catch (error) { - console.warn("Failed to get icon for", game.name, error); - } - }; - - const saveGames = (gameList: GameShortcut[]) => { - const userGames = gameList.filter((g) => !g.isDefault); - localStorage.setItem(STORAGE_KEY, JSON.stringify(userGames)); - }; - - const handleLaunch = async (game: GameShortcut) => { - setIsLaunching(game.id); - try { - await invoke("launch_game", { gamePath: game.path }); - } catch (error) { - console.error("Failed to launch game:", error); - } finally { - setIsLaunching(null); - } - }; - - const handleRemove = (gameId: string) => { - const newGames = games.filter((g) => g.id !== gameId); - setGames(newGames); - saveGames(newGames); - }; - - // --- @dnd-kit 拖拽排序 --- - const sensors = useSensors( - useSensor(PointerSensor, { activationConstraint: { distance: 8 } }), - useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }), - ); - - const handleDragEnd = useCallback((event: DragEndEvent) => { - const { active, over } = event; - if (!over || active.id === over.id) return; - - const oldIndex = games.findIndex((g) => g.id === active.id); - const newIndex = games.findIndex((g) => g.id === over.id); - if (oldIndex === -1 || newIndex === -1) return; - - const dragGame = games[oldIndex]; - if (dragGame.isDefault) return; - const targetGame = games[newIndex]; - if (targetGame.isDefault) return; - - const reordered = arrayMove(games, oldIndex, newIndex); - setGames(reordered); - saveGames(reordered); - }, [games]); - - const handleSelectPath = async () => { - try { - const selected = await invoke("select_exe_file"); - if (selected) { - setNewGamePath(selected); - if (!newGameName) { - const fileName = selected.split(/[/\\]/).pop() || ""; - setNewGameName(fileName.replace(/\.(exe|lnk)$/i, "")); - } - } - } catch (error) { - console.error("Failed to select file:", error); - } - }; - - const handleAddGame = () => { - if (!newGameName.trim() || !newGamePath.trim()) return; - - const newGame: GameShortcut = { - id: `custom-${Date.now()}`, - name: newGameName.trim(), - path: newGamePath.trim(), - isDefault: false, - }; - - const newGames = [...games, newGame]; - setGames(newGames); - saveGames(newGames); - setNewGameName(""); - setNewGamePath(""); - onClose(); - }; - - const userGames = games.filter((g) => !g.isDefault); - const defaultGames = games.filter((g) => g.isDefault); - const userGameIds = useMemo(() => userGames.map((g) => g.id), [userGames]); - - const cornerColor = useColorModeValue("rgba(0,0,0,0.25)", "rgba(255,255,255,0.25)"); - const handleHoverBg = useColorModeValue("rgba(0,0,0,0.12)", "rgba(255,255,255,0.12)"); - const userGameHoverBg = useColorModeValue("gray.200", "#2a2a2a"); - - return ( - - {/* 左边缘拖拽手柄 */} - - - {/* 上边缘拖拽手柄 */} - - - {/* 左上角拖拽手柄 */} - - - - - - - - - {t("gameLauncher.title")} - - - } - size="xs" - variant="ghost" - onClick={onOpen} - /> - - - - {isLoading ? ( - - - - ) : games.length === 0 ? ( - - - - {t("gameLauncher.addGame")} - - - ) : ( - - - - {userGames.map((game) => ( - - ))} - - {defaultGames.map((game) => ( - handleLaunch(game)} - _hover={{ bg: userGameHoverBg }} - transition="background 0.15s" - > - {icons[game.id] && ( - - )} - - {isLaunching === game.id && ( - - )} - - ))} - - - - )} - - - - - - {t("gameLauncher.addGame")} - - - - - - {t("gameLauncher.gameName")} - - setNewGameName(e.target.value)} - placeholder={t("gameLauncher.gameNamePlaceholder")} - bg={inputBg} - border="1px solid" - borderColor={borderColor} - /> - - - - {t("gameLauncher.gamePath")} - - - setNewGamePath(e.target.value)} - placeholder={t("gameLauncher.gamePathPlaceholder")} - bg={inputBg} - border="1px solid" - borderColor={borderColor} - flex={1} - /> - } - onClick={handleSelectPath} - variant="outline" - border="1px solid" - borderColor={borderColor} - /> - - - - - - - - {t("common.add")} - - - - - - ); -} diff --git a/参考/NexBox-main/src/components/HardwareDetailModal.tsx b/参考/NexBox-main/src/components/HardwareDetailModal.tsx deleted file mode 100644 index ad2bc63..0000000 --- a/参考/NexBox-main/src/components/HardwareDetailModal.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, - VStack, - HStack, - Text, - Divider, - useColorModeValue, - Box, -} from "@chakra-ui/react"; -import { useTranslation } from "react-i18next"; -import type { ElementType } from "react"; - -export interface SpecItem { - label: string; - value: string; -} - -interface HardwareDetailModalProps { - isOpen: boolean; - onClose: () => void; - title: string; - icon: ElementType; - specs: SpecItem[]; - type: string; -} - -function iconColor(type: string): string { - switch (type) { - case "cpu": return "#3b82f6"; - case "gpu": return "#22c55e"; - case "memory": return "#06b6d4"; - case "storage": return "#a855f7"; - case "motherboard": return "#f59e0b"; - case "sound": return "#f97316"; - case "network": return "#14b8a6"; - case "monitor": return "#ec4899"; - default: return "#f59e0b"; - } -} - -export default function HardwareDetailModal({ - isOpen, - onClose, - title, - icon: IconComponent, - specs, - type, -}: HardwareDetailModalProps) { - const { t } = useTranslation(); - - const overlayBg = useColorModeValue("blackAlpha.600", "blackAlpha.700"); - const contentBg = useColorModeValue("white", "#1a1a1a"); - const borderColor = useColorModeValue("gray.200", "#2a2a2a"); - const labelColor = useColorModeValue("gray.500", "#888888"); - const valueColor = useColorModeValue("gray.800", "#e0e0e0"); - const headerColor = useColorModeValue("gray.800", "#e0e0e0"); - - const color = iconColor(type); - - // Filter out empty/meaningless values - const filteredSpecs = specs.filter( - (s) => - s.value && - s.value !== "未知" && - s.value !== "0" && - s.value !== "--" && - s.value !== "0 GB" && - s.value !== "0 GB (0GB)" && - s.value.trim() !== "" - ); - - return ( - - - - - - - - {title} - - - - - - - }> - {filteredSpecs.map((spec, i) => ( - - - {spec.label} - - - {spec.value} - - - ))} - {filteredSpecs.length === 0 && ( - - {t("hardware.noDetail") || "暂无详细信息"} - - )} - - - - - ); -} diff --git a/参考/NexBox-main/src/components/HardwareModelCard.tsx b/参考/NexBox-main/src/components/HardwareModelCard.tsx deleted file mode 100644 index 19dea94..0000000 --- a/参考/NexBox-main/src/components/HardwareModelCard.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { Box, Text, VStack, HStack, Spinner, useColorModeValue } from "@chakra-ui/react"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import type { HardwareInfo } from "@/lib/hardware"; -import { getHardwareInfo } from "@/lib/hardware"; -import { useCallback } from "react"; -import { invoke } from "@tauri-apps/api/core"; - -export default function HardwareModelCard() { - const { t } = useTranslation(); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - const [hardware, setHardware] = useState(null); - const [osShort, setOsShort] = useState(null); - - useEffect(() => { - let mounted = true; - - const load = async () => { - setLoading(true); - setError(null); - try { - const info = await getHardwareInfo(); - if (mounted) setHardware(info); - } catch (e) { - if (mounted) setError((e as Error)?.message || String(e)); - } finally { - if (mounted) setLoading(false); - } - }; - - load(); - return () => { - mounted = false; - }; - }, []); - - const detectOs = useCallback(async () => { - try { - const version = await invoke("get_os_version"); - // long_os_version 返回如 "Windows 11 Pro" 或 "Windows 10 Home" - const match = version.match(/(Windows \d+)/); - setOsShort(match ? match[1] : version); - } catch { - try { - const ua = typeof navigator !== "undefined" ? navigator.userAgent || "" : ""; - if (ua.includes("Windows")) { - setOsShort(ua.includes("Windows NT 10.0") ? "Windows 10" : "Windows"); - } else if (ua.includes("Mac")) setOsShort("macOS"); - else if (ua.includes("Linux")) setOsShort("Linux"); - else setOsShort(null); - } catch { - setOsShort(null); - } - } - }, []); - - useEffect(() => { - detectOs(); - }, [detectOs]); - - const labelColor = useColorModeValue("gray.700", "#e0e0e0"); - const valueColor = useColorModeValue("gray.800", "#e6e6e6"); - - const renderMemorySummary = () => { - if (!hardware || !hardware.memory || hardware.memory.length === 0) return null; - - const partNumbers = hardware.memory - .map((m) => (m.part_number || "").trim()) - .filter((p) => p && p !== "未知"); - - if (partNumbers.length > 0) { - const counts = new Map(); - for (const pn of partNumbers) counts.set(pn, (counts.get(pn) || 0) + 1); - return Array.from(counts.entries()).map(([pn, cnt]) => `${pn}${cnt > 1 ? ` x${cnt}` : ""}`).join("; "); - } - - // fallback to capacity summary - const caps = hardware.memory.map((m) => Math.round(m.capacity_gb || 0)); - const capCounts = new Map(); - for (const c of caps) capCounts.set(c, (capCounts.get(c) || 0) + 1); - return Array.from(capCounts.entries()).map(([cap, cnt]) => `${cap}GB${cnt > 1 ? ` x${cnt}` : ""}`).join("; "); - }; - - if (loading) { - return ( - - - - {t("home.hardwareModel.loading") || t("home.loading")} - - - ); - } - - if (error || !hardware) { - return ( - - {t("home.hardwareModel.unknown") || "未知型号"} - - ); - } - - const lines: Array<{ label: string; value: string } > = []; - - if (hardware.cpu && hardware.cpu.name) { - lines.push({ label: t("hardware.processor") || "CPU", value: hardware.cpu.name }); - } - - if (hardware.gpu && hardware.gpu.length > 0) { - hardware.gpu.forEach((g, idx) => { - const label = idx === 0 ? (t("hardware.gpu") || "GPU") : `${t("hardware.gpu")} ${idx + 1}`; - lines.push({ label, value: g.name }); - }); - } - - const memSummary = renderMemorySummary(); - if (memSummary) { - const totalGb = hardware?.memory?.reduce((s, m) => s + (m.capacity_gb || 0), 0) || 0; - const totalStr = totalGb % 1 === 0 ? `${Math.round(totalGb)}GB` : `${totalGb.toFixed(1)}GB`; - const totalLabel = t("hardware.totalCapacity") || "总容量"; - lines.push({ label: t("hardware.ram") || "内存", value: `${memSummary} · ${totalLabel}: ${totalStr}` }); - } - - if (hardware.motherboard) { - lines.push({ label: t("hardware.motherboard") || "主板", value: hardware.motherboard.product }); - } - - if (hardware.disk && hardware.disk.length > 0) { - const diskList = hardware.disk.map(d => `${d.model} (${(d.size_gb ?? 0).toFixed(0)}GB)`); - const diskDisplay = diskList.length <= 2 ? diskList.join("; ") : `${diskList.slice(0,2).join("; ")} +${diskList.length - 2}`; - lines.push({ label: t("hardware.storage") || "硬盘", value: diskDisplay }); - } - - // 操作系统放在最下面 - if (osShort) { - lines.push({ label: t("hardware.os") || "操作系统", value: osShort }); - } - - return ( - - - {lines.map((l, i) => ( - - - {l.label} - - - {l.value} - - - ))} - - - ); -} diff --git a/参考/NexBox-main/src/components/ImportantAnnouncementModal.tsx b/参考/NexBox-main/src/components/ImportantAnnouncementModal.tsx deleted file mode 100644 index 3666648..0000000 --- a/参考/NexBox-main/src/components/ImportantAnnouncementModal.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import { useState, useEffect } from "react"; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalFooter, - Button, - useColorModeValue, - Text, - VStack, - Badge, - HStack, -} from "@chakra-ui/react"; -import { useTranslation } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; -import { LiquidGlassButton } from "@/components/special/liquid-glass-button"; - -interface Announcement { - title: string; - content: string; - important: boolean; - create_time: string; -} - -interface AnnouncementResponse { - version: number; - announce_list: Announcement[]; -} - -function getAnnouncementKey(announcement: Announcement): string { - return `${announcement.title}_${announcement.create_time}`; -} - -export function ImportantAnnouncementModal() { - const { t } = useTranslation(); - const [isOpen, setIsOpen] = useState(false); - const [currentAnnouncement, setCurrentAnnouncement] = useState(null); - - const labelColor = useColorModeValue("gray.700", "#e0e0e0"); - const subLabelColor = useColorModeValue("gray.500", "#888888"); - const modalBg = useColorModeValue("white", "#1a1a1a"); - const modalBorderColor = useColorModeValue("gray.200", "#333333"); - - useEffect(() => { - const checkImportantAnnouncement = async () => { - try { - const response = await invoke("get_announcements"); - const importantAnnouncements = response.announce_list.filter(a => a.important); - - if (importantAnnouncements.length === 0) return; - - const confirmedKeys = JSON.parse( - localStorage.getItem("nexbox_confirmed_announcements") || "[]" - ) as string[]; - - const unconfirmed = importantAnnouncements.find( - a => !confirmedKeys.includes(getAnnouncementKey(a)) - ); - - if (unconfirmed) { - setCurrentAnnouncement(unconfirmed); - setIsOpen(true); - } - } catch (e) { - console.error("Failed to check important announcements:", e); - } - }; - - const timer = setTimeout(checkImportantAnnouncement, 1500); - return () => clearTimeout(timer); - }, []); - - const handleConfirm = () => { - if (!currentAnnouncement) return; - - const confirmedKeys = JSON.parse( - localStorage.getItem("nexbox_confirmed_announcements") || "[]" - ) as string[]; - - confirmedKeys.push(getAnnouncementKey(currentAnnouncement)); - localStorage.setItem("nexbox_confirmed_announcements", JSON.stringify(confirmedKeys)); - - setIsOpen(false); - setCurrentAnnouncement(null); - }; - - if (!currentAnnouncement) return null; - - return ( - {}} - isCentered - closeOnOverlayClick={false} - closeOnEsc={false} - > - - - - - - {t("home.importantAnnouncement")} - {t("home.important")} - - - {currentAnnouncement.create_time} - - - - - - - {currentAnnouncement.title} - - - {currentAnnouncement.content} - - - - - - {t("home.confirmAnnouncement")} - - - - - ); -} diff --git a/参考/NexBox-main/src/components/KaraokeLyricLine.tsx b/参考/NexBox-main/src/components/KaraokeLyricLine.tsx deleted file mode 100644 index 8e04b3c..0000000 --- a/参考/NexBox-main/src/components/KaraokeLyricLine.tsx +++ /dev/null @@ -1,212 +0,0 @@ -/** - * 卡拉OK歌词行组件 - * - * 渲染方案:双层叠加 - * - 底层:完整歌词,暗色(未唱) - * - 顶层:相同歌词,高亮色(已唱),用 width% 裁剪 - * - RAF 更新顶层 width,实现逐字填充效果 - * - 顶层右侧加 mask 渐变,实现柔和过渡边缘 - * - * 相比 background-clip:text 方案,此方案: - * - 不依赖 CSS 变量在 calc() 中的解析 - * - 不受 Chakra/Emotion 序列化干扰 - * - 兼容性更好,性能更优 - */ - -import { useEffect, useRef, useState, memo } from "react"; -import { Box, Text } from "@chakra-ui/react"; -import type { KaraokeLine } from "@/types/music"; -import { getLineProgress, calculateScrollOffset } from "@/lib/karaoke-lyrics"; - -interface KaraokeLyricLineProps { - line: KaraokeLine; - nextLine?: KaraokeLine; - isActive: boolean; - isPlaying: boolean; - fontSize: number; - activeColor: string; - highlightColor: string; - textColor: string; - subTextColor: string; - audioRef?: HTMLAudioElement | null; -} - -function KaraokeLyricLineInner({ - line, - nextLine, - isActive, - isPlaying, - fontSize, - activeColor, - highlightColor, - textColor, - subTextColor, - audioRef, -}: KaraokeLyricLineProps) { - // overlayRef 是顶层高亮文字的容器,RAF 更新它的 width - const overlayRef = useRef(null); - const containerRef = useRef(null); - const scrollRef = useRef(null); - const [scrollNeeded, setScrollNeeded] = useState(false); - const scrollLimitRef = useRef(0); - - // 检测超长歌词 - useEffect(() => { - if (!isActive || !containerRef.current || !scrollRef.current) return; - const checkOverflow = () => { - if (!scrollRef.current || !containerRef.current) return; - const overflow = scrollRef.current.scrollWidth - containerRef.current.clientWidth; - const needed = overflow > 4; - setScrollNeeded(needed); - scrollLimitRef.current = Math.max(0, overflow / 2); - }; - checkOverflow(); - const timer = setTimeout(checkOverflow, 100); - return () => clearTimeout(timer); - }, [line.text, fontSize, isActive]); - - // 动画循环:更新顶层 width(仅当前行 + 播放中运行) - useEffect(() => { - if (!isActive || !isPlaying || !overlayRef.current) return; - - const el = overlayRef.current; - el.style.width = "0%"; - - let rafId: number; - let running = true; - - const tick = () => { - if (!running) return; - const t = audioRef ? audioRef.currentTime : 0; - const progress = getLineProgress(line, nextLine, t); - - // 更新顶层裁剪宽度 - el.style.width = `${(progress * 100).toFixed(2)}%`; - - // 超长歌词智能水平滚动(滚动整个文字容器) - if (scrollNeeded && scrollRef.current) { - const offset = calculateScrollOffset(progress, scrollLimitRef.current); - scrollRef.current.style.transform = `translate3d(${offset.toFixed(2)}px, 0, 0)`; - } - - rafId = requestAnimationFrame(tick); - }; - - rafId = requestAnimationFrame(tick); - return () => { - running = false; - cancelAnimationFrame(rafId); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isActive, isPlaying, line, nextLine, scrollNeeded, audioRef]); - - // ── 非当前行:简单显示 ── - if (!isActive) { - return ( - - - {line.text} - - {line.translation && ( - - {line.translation} - - )} - - ); - } - - // ── 当前行:双层叠加卡拉OK效果 ── - const sharedTextStyle: React.CSSProperties = { - display: "inline-block", - whiteSpace: "nowrap", - fontSize: `${fontSize}px`, - fontWeight: "bold", - lineHeight: 1.4, - letterSpacing: "0px", - }; - - // mask 渐变宽度随字号缩放,避免小字号时遮罩过大导致底层透出 - const maskFade = Math.min(18, Math.max(6, fontSize * 0.7)); - const maskGradient = `linear-gradient(90deg, #000 0%, #000 calc(100% - ${maskFade}px), rgba(0,0,0,0.3) 100%)`; - - return ( - - {/* scrollRef 包裹所有文字层,超长歌词时整体平移 - 使用纯 span + position:relative 确保 overlay 绝对定位基准正确 */} - - {/* 底层:完整歌词,暗色 */} - - {line.text} - - {/* 顶层:高亮歌词,用 width 裁剪 - position:absolute 基准是 scrollRef(position:relative) - top:0 left:0 与底层文字完全对齐 */} - - {line.text} - - - {line.translation && ( - - {line.translation} - - )} - - ); -} - -export const KaraokeLyricLine = memo(KaraokeLyricLineInner); diff --git a/参考/NexBox-main/src/components/KaraokeLyricsView.tsx b/参考/NexBox-main/src/components/KaraokeLyricsView.tsx deleted file mode 100644 index 36d6782..0000000 --- a/参考/NexBox-main/src/components/KaraokeLyricsView.tsx +++ /dev/null @@ -1,215 +0,0 @@ -/** - * 卡拉OK歌词列表视图 - * - * 特性: - * - 当前行使用 KaraokeLyricLine 渲染(带逐字进度) - * - 非当前行简单显示,淡显效果 - * - 自动滚动到当前行 - * - 虚拟化渲染(仅渲染可见行 ± 前后若干行)提升性能 - * - 上下边缘遮罩渐变 - * - * 性能策略(三层解耦): - * 1. ExpandedPlayer 不再因 timeupdate 而重渲染(进度条独立组件) - * 2. 本组件用低频定时器(~250ms)检查 activeIndex,仅在行变化时 setState - * 3. KaraokeLyricLine 内部 RAF 直接读 audioRef,60fps 仅操作 DOM - * 三层完全独立,播放期间 ExpandedPlayer 零 re-render - */ - -import { useEffect, useRef, useState, memo } from "react"; -import { Box, VStack, Spinner, Text } from "@chakra-ui/react"; -import { Music as MusicIcon } from "lucide-react"; -import type { KaraokeLine } from "@/types/music"; -import { KaraokeLyricLine } from "./KaraokeLyricLine"; - -interface KaraokeLyricsViewProps { - lines: KaraokeLine[]; - loading: boolean; - fontSize: number; - activeColor: string; - highlightColor: string; - textColor: string; - subTextColor: string; - scrollbarSx: Record; - audioRef?: HTMLAudioElement | null; - isPlaying: boolean; -} - -/** - * 根据当前播放时间计算 activeIndex - */ -function calcActiveIndex(lines: KaraokeLine[], currentTime: number): number { - if (lines.length === 0) return -1; - let idx = -1; - for (let i = 0; i < lines.length; i++) { - if (lines[i].time <= currentTime) idx = i; - else break; - } - return idx; -} - -function KaraokeLyricsViewInner({ - lines, - loading, - fontSize, - activeColor, - highlightColor, - textColor, - subTextColor, - scrollbarSx, - audioRef, - isPlaying, -}: KaraokeLyricsViewProps) { - const scrollRef = useRef(null); - const [activeIndex, setActiveIndex] = useState(-1); - - // 用 ref 保存最新的 lines,供定时器闭包读取 - const linesRef = useRef(lines); - linesRef.current = lines; - - // 切歌标记:lines 变化后设为 true,等 audioRef.currentTime 明显变小(新歌曲开始)才恢复更新 - // 防止旧歌曲末尾的 currentTime 用新歌词算出高 activeIndex 导致滚到底部 - const waitingForNewSongRef = useRef(false); - const lastCurrentTimeRef = useRef(0); - - // 新歌曲歌词加载时,重置滚动位置和 activeIndex - useEffect(() => { - setActiveIndex(-1); - // 记住当前 currentTime,切歌后新歌曲的 currentTime 会从 0 附近开始 - if (audioRef) { - lastCurrentTimeRef.current = audioRef.currentTime; - } - waitingForNewSongRef.current = true; - if (scrollRef.current) { - scrollRef.current.scrollTo({ top: 0, behavior: "auto" }); - } - }, [lines]); // eslint-disable-line react-hooks/exhaustive-deps - - // 低频定时器(~250ms)检查 activeIndex,仅在行变化时 setState - // 避免依赖外部 currentTime prop 导致整个组件树重渲染 - useEffect(() => { - if (!audioRef) return; - - const checkActive = () => { - const t = audioRef.currentTime; - - // 切歌后等待 currentTime 回落到较小值(新歌曲从 0 开始播放) - // 用「当前时间比上次记录的小很多」来判断新歌曲已开始 - if (waitingForNewSongRef.current) { - // 同一首歌重新挂载(收起再展开):时间几乎没变,直接清除标记 - if (Math.abs(t - lastCurrentTimeRef.current) < 0.5) { - waitingForNewSongRef.current = false; - } else if (t > 2.0 && t >= lastCurrentTimeRef.current - 1) { - // 仍在旧歌曲位置(时间没明显变小),跳过 - return; - } - waitingForNewSongRef.current = false; // 新歌曲开始,清除标记 - } - - const newIdx = calcActiveIndex(linesRef.current, t); - setActiveIndex((prev) => (prev !== newIdx ? newIdx : prev)); - }; - - // 立即检查一次 - checkActive(); - - const interval = setInterval(checkActive, 250); - return () => clearInterval(interval); - }, [audioRef]); - - // 自动滚动到当前行 - useEffect(() => { - if (activeIndex < 0 || !scrollRef.current) return; - const container = scrollRef.current; - const activeEl = container.querySelector( - `[data-lyric-idx="${activeIndex}"]` - ) as HTMLElement | null; - if (activeEl) { - // 当前行定位在容器约 45% 处(偏下),让用户能看到更多即将到来的歌词 - container.scrollTo({ - top: - activeEl.offsetTop - - container.clientHeight * 0.5, - behavior: "smooth", - }); - } - }, [activeIndex]); - - if (loading) { - return ( - - - - ); - } - - if (lines.length === 0) { - return ( - - - - 暂无歌词 - - - ); - } - - return ( - - - - {lines.map((line, idx) => { - const isActive = idx === activeIndex; - return ( - - - - ); - })} - - - - ); -} - -export const KaraokeLyricsView = memo(KaraokeLyricsViewInner); diff --git a/参考/NexBox-main/src/components/MiniMusicPlayer.tsx b/参考/NexBox-main/src/components/MiniMusicPlayer.tsx deleted file mode 100644 index a45930f..0000000 --- a/参考/NexBox-main/src/components/MiniMusicPlayer.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { Box, IconButton, Tooltip, useColorModeValue } from "@chakra-ui/react"; -import { useMusicPlayer } from "@/contexts/music-context"; -import { StopCircle } from "lucide-react"; -import { motion, AnimatePresence } from "framer-motion"; - -export function MiniMusicPlayer() { - const { isPlaying, currentFileName, stopPlayback } = useMusicPlayer(); - - const bgColor = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - - if (!isPlaying) return null; - - return ( - - - - - } - variant="ghost" - borderRadius="full" - size="sm" - onClick={(e) => { - e.stopPropagation(); - stopPlayback(); - }} - /> - - - - - ); -} diff --git a/参考/NexBox-main/src/components/MusicLoginSection.tsx b/参考/NexBox-main/src/components/MusicLoginSection.tsx deleted file mode 100644 index afd9635..0000000 --- a/参考/NexBox-main/src/components/MusicLoginSection.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import { - HStack, - VStack, - Button, - Text, - IconButton, - Tooltip, - Avatar, - Box, - useColorModeValue, -} from "@chakra-ui/react"; -import { - ExternalLink, - LogOut, - Crown, -} from "lucide-react"; -import { useShallow } from "zustand/react/shallow"; -import { useMusicStore, coverProxyUrl } from "@/stores/music-store"; -import { useThemeColor } from "@/contexts/theme-color-context"; - -export function MusicLoginSection() { - const { loginInfo, proxyPort, logout, openLoginWindow } = useMusicStore( - useShallow((s) => ({ - loginInfo: s.loginInfo, - proxyPort: s.proxyPort, - logout: s.logout, - openLoginWindow: s.openLoginWindow, - })) - ); - const { getActiveColor, getContrastTextColor } = useThemeColor(); - - const activeColor = getActiveColor(); - const contrastText = getContrastTextColor(); - - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - - // 已登录状态 - if (loginInfo?.logged_in) { - return ( - - - - - - {loginInfo.nickname} - - {loginInfo.is_svip ? ( - - - SVIP - - ) : loginInfo.is_vip ? ( - - VIP - - ) : ( - - 普通用户 - - )} - - - - } - size="sm" - variant="ghost" - onClick={() => logout()} - /> - - - ); - } - - // 未登录状态:右上角一个明显按钮 - return ( - - ); -} diff --git a/参考/NexBox-main/src/components/MusicPlayer.tsx b/参考/NexBox-main/src/components/MusicPlayer.tsx deleted file mode 100644 index a53aa47..0000000 --- a/参考/NexBox-main/src/components/MusicPlayer.tsx +++ /dev/null @@ -1,324 +0,0 @@ -import { - Box, - HStack, - VStack, - Text, - IconButton, - Slider, - SliderTrack, - SliderFilledTrack, - SliderThumb, - useColorModeValue, - Menu, - MenuButton, - MenuList, - MenuItem, - Tooltip, -} from "@chakra-ui/react"; -import { useState, useEffect } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { Store } from "@tauri-apps/plugin-store"; -import { useTranslation } from "react-i18next"; -import { - Play, - Pause, - SkipBack, - SkipForward, - Volume2, - VolumeX, - ListMusic, - Repeat, - Repeat1, - Shuffle, - Music, -} from "lucide-react"; -import { LiquidGlassCard } from "./special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useMusicPlayer } from "@/contexts/music-context"; - -interface MusicFile { - name: string; - path: string; -} - -type PlayMode = "list" | "shuffle" | "one"; - -let storeInstance: Store | null = null; - -const getStore = async (): Promise => { - if (!storeInstance) { - storeInstance = await Store.load("music-player-settings.json"); - } - return storeInstance; -}; - -export function MusicPlayer() { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - const { - musicFiles, - currentIndex, - isPlaying, - currentTime, - duration, - volume, - isMuted, - playMode, - currentFileName, - togglePlay, - setVolume, - toggleMute, - nextTrack, - prevTrack, - seekTo, - playTrack, - } = useMusicPlayer(); - - const [localPlayMode, setLocalPlayMode] = useState("list"); - - const bgColor = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const progressBg = useColorModeValue("gray.200", "#333333"); - - useEffect(() => { - loadLocalSettings(); - }, []); - - useEffect(() => { - if (localPlayMode !== playMode) { - setLocalPlayMode(playMode); - } - }, [playMode]); - - const loadLocalSettings = async () => { - try { - const s = await getStore(); - const savedMode = await s.get("playMode"); - if (savedMode) { - setLocalPlayMode(savedMode); - } - } catch (error) { - console.error("Failed to load music settings:", error); - } - }; - - const saveSetting = async (key: string, value: unknown) => { - try { - const s = await getStore(); - await s.set(key, value); - await s.save(); - } catch (error) { - console.error("Failed to save setting:", error); - } - }; - - const handleModeToggle = () => { - const modes: PlayMode[] = ["list", "shuffle", "one"]; - const currentModeIndex = modes.indexOf(localPlayMode); - const nextMode = modes[(currentModeIndex + 1) % modes.length]; - setLocalPlayMode(nextMode); - saveSetting("playMode", nextMode); - }; - - const formatTime = (time: number): string => { - if (isNaN(time)) return "0:00"; - const minutes = Math.floor(time / 60); - const seconds = Math.floor(time % 60); - return `${minutes}:${seconds.toString().padStart(2, "0")}`; - }; - - if (musicFiles.length === 0) { - const EmptyContent = ( - - - - {t("musicPlayer.empty")} - - - public/music/ - - - ); - - if (liquidGlassEnabled) { - return ( - - {EmptyContent} - - ); - } - - return ( - - {EmptyContent} - - ); - } - - const ModeIcon = localPlayMode === "one" ? Repeat1 : localPlayMode === "shuffle" ? Shuffle : Repeat; - - const PlayerContent = ( - - - - - {currentFileName || t("musicPlayer.noTrack")} - - - {formatTime(currentTime)} / {formatTime(duration)} - - - - - - } - size="sm" - variant="ghost" - onClick={prevTrack} - /> - - - - : } - size="sm" - colorScheme="teal" - onClick={togglePlay} - /> - - - - } - size="sm" - variant="ghost" - onClick={nextTrack} - /> - - - - } - size="sm" - variant="ghost" - colorScheme={localPlayMode !== "list" ? "teal" : "gray"} - onClick={handleModeToggle} - /> - - - - - - : } - size="sm" - variant="ghost" - onClick={toggleMute} - /> - - setVolume(v)} - min={0} - max={1} - step={0.01} - size="sm" - > - - - - - - - - - - } - size="sm" - variant="ghost" - /> - - - {musicFiles.map((file, index) => ( - playTrack(index)} - bg={index === currentIndex ? "teal.500" : undefined} - color={index === currentIndex ? "white" : textColor} - _hover={{ bg: index === currentIndex ? "teal.600" : "gray.100" }} - > - - {index + 1}. {file.name} - - - ))} - - - - - seekTo(v)} - min={0} - max={duration || 100} - step={0.1} - size="sm" - > - - - - - - - ); - - if (liquidGlassEnabled) { - return ( - - {PlayerContent} - - ); - } - - return ( - - {PlayerContent} - - ); -} diff --git a/参考/NexBox-main/src/components/RandomQuote.tsx b/参考/NexBox-main/src/components/RandomQuote.tsx deleted file mode 100644 index 85668d0..0000000 --- a/参考/NexBox-main/src/components/RandomQuote.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { Box, Text, VStack, useColorModeValue } from "@chakra-ui/react"; -import { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; - -const quotes = [ - { text: "游戏不仅仅是游戏,游戏可以走进生活,改变生活", author: "刘旭东" }, - { text: "游戏可以重开,人生没有读档。", author: "木流" }, - { text: "真正的对手,从来都是自己。", author: "木流" }, - { text: "我希望你是在享受游戏。", author: "木流" }, - { text: "输赢是一瞬的结果,尽兴才是整场的意义。", author: "木流" }, - { text: "放下胜负心,游戏才真正属于自己。", author: "木流" }, - { text: "为了点游戏币,人都不做了。", author: "老飞宇66" }, - { text: "真正的强者不一定是赢家。", author: "深蓝" }, - { text: "当你觉得精疲力尽的时候,就是突破自己的最佳时机。", author: "老黑" }, - { text: "游戏怎么了,游戏提供了千千万万就业岗位。", author: "木流" }, - { text: "不是游戏害人,是不懂节制的心态害人。", author: "木流" }, - { text: "游戏非洪水猛兽,害人的是放纵,不是游戏本身。", author: "木流" }, - { text: "我们是在玩游戏,不是游戏玩我们。", author: "木流" }, - { text: "要懂得分清游戏和现实。", author: "木流" }, -]; - -function getRandomQuote() { - const index = Math.floor(Math.random() * quotes.length); - return quotes[index]; -} - -export function useRandomQuoteEnabled() { - const [enabled, setEnabled] = useState(true); - - useEffect(() => { - const saved = localStorage.getItem("nexbox_random_quote_enabled"); - if (saved !== null) { - setEnabled(saved === "true"); - } - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => setEnabled(e.detail); - window.addEventListener("random-quote-setting-changed", handler as EventListener); - return () => window.removeEventListener("random-quote-setting-changed", handler as EventListener); - }, []); - - return enabled; -} - -export function RandomQuote() { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - - const [quote, setQuote] = useState(() => getRandomQuote()); - - const labelColor = useColorModeValue("gray.500", "#cccccc"); - const textColor = useColorModeValue("gray.700", "#e0e0e0"); - const authorColor = useColorModeValue("gray.400", "#888888"); - const cardBg = useColorModeValue("white", "#1a1a1a"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const hoverBorderColor = useColorModeValue("purple.500", "#b794f4"); - - const handleRefresh = () => { - setQuote(getRandomQuote()); - }; - - const cardContent = ( - - - {t("home.randomQuote")} - - - - {quote.text} - - - -{quote.author} - - - - ); - - if (liquidGlassEnabled) { - return ( - - {cardContent} - - ); - } - - return ( - - {cardContent} - - ); -} diff --git a/参考/NexBox-main/src/components/SplashScreen.tsx b/参考/NexBox-main/src/components/SplashScreen.tsx deleted file mode 100644 index 398578e..0000000 --- a/参考/NexBox-main/src/components/SplashScreen.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { useAppStartup } from "@/contexts/app-startup-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { Box } from "@chakra-ui/react"; -import { useEffect, useState } from "react"; - -const DEFAULT_LOGO = "/logo/Chinesew.png"; - -export function SplashScreen() { - const { startupProgress } = useAppStartup(); - const { getActiveColor } = useThemeColor(); - const primaryColor = getActiveColor(); - const [logoSrc, setLogoSrc] = useState(DEFAULT_LOGO); - - useEffect(() => { - const customLogo = localStorage.getItem("nexbox_splash_logo"); - if (customLogo) { - setLogoSrc(customLogo); - } - }, []); - - return ( - = 100 ? 0 : 1} - transition="opacity 0.4s ease-out" - willChange="opacity" - > - {/* Logo - 居中 */} - - - - - {/* 进度条 - 中下方 */} - - - - - - - ); -} \ No newline at end of file diff --git a/参考/NexBox-main/src/components/TodayPopularity.tsx b/参考/NexBox-main/src/components/TodayPopularity.tsx deleted file mode 100644 index 3491f30..0000000 --- a/参考/NexBox-main/src/components/TodayPopularity.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import { Box, Text, VStack, useColorModeValue } from "@chakra-ui/react"; -import { keyframes } from "@emotion/react"; -import { useState, useEffect, useCallback } from "react"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; - -const bounceKeyframes = keyframes` - 0% { transform: scale(1); } - 30% { transform: scale(1.3); } - 100% { transform: scale(1); } -`; - -function getTodayKey(): string { - const d = new Date(); - return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`; -} - -export function useTodayPopularityEnabled() { - const [enabled, setEnabled] = useState(true); - - useEffect(() => { - const saved = localStorage.getItem("nexbox_today_popularity_enabled"); - if (saved !== null) { - setEnabled(saved === "true"); - } - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => setEnabled(e.detail); - window.addEventListener("today-popularity-setting-changed", handler as EventListener); - return () => window.removeEventListener("today-popularity-setting-changed", handler as EventListener); - }, []); - - return enabled; -} - -export function TodayPopularity() { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - - const [value, setValue] = useState(null); - const [animating, setAnimating] = useState(false); - - const valueColor = useColorModeValue("purple.500", "#b794f4"); - const labelColor = useColorModeValue("gray.500", "#cccccc"); - const cardBg = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - - useEffect(() => { - const todayKey = getTodayKey(); - const savedDate = localStorage.getItem("nexbox_today_popularity_date"); - const savedValue = localStorage.getItem("nexbox_today_popularity_value"); - - if (savedDate === todayKey && savedValue !== null) { - setValue(Number(savedValue)); - } - }, []); - - const generate = useCallback(() => { - const todayKey = getTodayKey(); - const savedDate = localStorage.getItem("nexbox_today_popularity_date"); - - if (savedDate === todayKey && value !== null) { - return; - } - - const randomValue = Math.floor(Math.random() * 101); - setValue(randomValue); - setAnimating(true); - localStorage.setItem("nexbox_today_popularity_date", todayKey); - localStorage.setItem("nexbox_today_popularity_value", String(randomValue)); - setTimeout(() => setAnimating(false), 600); - }, [value]); - - const cardContent = ( - - - {t("home.todayPopularity")} - - - - {value !== null ? value : "?"} - - - - ); - - if (liquidGlassEnabled) { - return ( - - {cardContent} - - ); - } - - return ( - - {cardContent} - - ); -} \ No newline at end of file diff --git a/参考/NexBox-main/src/components/VirtualList.tsx b/参考/NexBox-main/src/components/VirtualList.tsx deleted file mode 100644 index 93614f9..0000000 --- a/参考/NexBox-main/src/components/VirtualList.tsx +++ /dev/null @@ -1,215 +0,0 @@ -/** - * 虚拟滚动列表 — 真·窗口化(windowing) - * - * 无论列表多大,DOM 中始终只保留「可视区 + overscan」约 15~20 个节点, - * 滚动到底也不会累积节点。适用于播放队列、歌单曲目这类可能高达数千项 - * 的超大列表,彻底解决「歌太多就卡」。 - * - * 要求每一项高度固定(itemHeight),以便通过 scrollTop 直接换算区间。 - * - * 两种高度模式: - * - 传入 height:固定像素高度(如 Popover/Menu 里的播放队列) - * - 省略 height:自适应父容器(父级需为 flex 容器,本组件 flex=1 填充) - * - * 其它能力: - * - scrollToIndex:挂载时把指定项滚动到视口中间(定位当前播放曲目) - * - onEndReached / hasMore:滚动接近底部时回调,用于从后端分页加载更多 - * - loading / emptyText / resetKey:整体加载态、空态、切换列表时复位 - */ - -import { useRef, useState, useLayoutEffect, useEffect, useCallback, memo, type ReactNode } from "react"; -import { Box, VStack, Spinner, Text } from "@chakra-ui/react"; - -interface VirtualListProps { - items: T[]; - /** 每一项的固定高度(px) */ - itemHeight: number; - /** 固定高度(px);省略则自适应父容器(父级需为 flex 容器) */ - height?: number; - renderItem: (item: T, index: number) => ReactNode; - /** 视口上下额外多渲染的项数,缓冲快速滚动 */ - overscan?: number; - /** 挂载时自动滚动到该项(居中显示),用于定位当前播放曲目 */ - scrollToIndex?: number; - /** 自定义 React key,默认使用绝对索引 */ - getKey?: (item: T, index: number) => string | number; - /** 自定义滚动条样式 */ - scrollbarSx?: Record; - /** 变化时滚回顶部并复位触底状态(切换列表用) */ - resetKey?: string | number; - /** 整体加载中(首次加载),显示居中 spinner */ - loading?: boolean; - loadingText?: string; - emptyText?: string; - /** 滚动接近底部时触发(从后端加载更多) */ - onEndReached?: () => void; - /** 后端是否还有更多数据 */ - hasMore?: boolean; - /** 距底部多少 px 触发 onEndReached */ - endReachedThreshold?: number; -} - -const FOOTER_HEIGHT = 44; - -function VirtualListInner({ - items, - itemHeight, - height, - renderItem, - overscan = 6, - scrollToIndex, - getKey, - scrollbarSx, - resetKey, - loading = false, - loadingText = "加载中...", - emptyText = "暂无内容", - onEndReached, - hasMore = false, - endReachedThreshold = 400, -}: VirtualListProps) { - const scrollRef = useRef(null); - const [scrollTop, setScrollTop] = useState(0); - const [measuredHeight, setMeasuredHeight] = useState(height ?? 0); - const lastLoadLenRef = useRef(0); - const prevResetKeyRef = useRef(resetKey); - const rafIdRef = useRef(null); - - const total = items.length; - const totalHeight = total * itemHeight; - const viewportHeight = height ?? measuredHeight; - - // 自适应高度:测量滚动容器实际高度,并随窗口变化实时更新 - useLayoutEffect(() => { - if (height != null) return; - const el = scrollRef.current; - if (!el) return; - setMeasuredHeight(el.clientHeight); - const ro = new ResizeObserver((entries) => { - const h = entries[0]?.contentRect.height; - if (h != null) setMeasuredHeight(h); - }); - ro.observe(el); - return () => ro.disconnect(); - }, [height]); - - // resetKey 变化:滚回顶部并复位分页触底标记 - // 用「上一次值」判断,兼容 StrictMode 双调用,且不影响 scrollToIndex 定位 - useEffect(() => { - if (prevResetKeyRef.current === resetKey) return; - prevResetKeyRef.current = resetKey; - lastLoadLenRef.current = 0; - if (scrollRef.current) scrollRef.current.scrollTop = 0; - setScrollTop(0); - }, [resetKey]); - - // 挂载时定位到指定项(居中),用于播放队列跳到当前曲目 - useLayoutEffect(() => { - const el = scrollRef.current; - if (!el || scrollToIndex == null || scrollToIndex < 0 || viewportHeight === 0) return; - const centered = scrollToIndex * itemHeight - viewportHeight / 2 + itemHeight / 2; - const target = Math.max(0, Math.min(centered, Math.max(0, totalHeight - viewportHeight))); - el.scrollTop = target; - setScrollTop(target); - // 仅挂载时定位一次,避免打断用户手动滚动 - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - // 滚动处理:rAF 节流 + 仅在可见区间跨越项边界时才重渲染 - // 播放时主线程更繁忙,减少无效重渲染是滚动保持流畅的关键 - const handleScroll = useCallback(() => { - if (rafIdRef.current != null) return; - rafIdRef.current = requestAnimationFrame(() => { - rafIdRef.current = null; - const el = scrollRef.current; - if (!el) return; - const st = el.scrollTop; - // 顶部项未跨越边界(仍在同一项内滚动)则跳过 setState,靠 overscan 吸收误差 - setScrollTop((prev) => - Math.floor(prev / itemHeight) === Math.floor(st / itemHeight) ? prev : st - ); - if ( - onEndReached && - hasMore && - !loading && - st + viewportHeight >= totalHeight - endReachedThreshold && - lastLoadLenRef.current !== total - ) { - lastLoadLenRef.current = total; - onEndReached(); - } - }); - }, [itemHeight, onEndReached, hasMore, loading, viewportHeight, totalHeight, endReachedThreshold, total]); - - // 卸载时取消挂起的 rAF - useEffect(() => () => { - if (rafIdRef.current != null) cancelAnimationFrame(rafIdRef.current); - }, []); - - const startIndex = Math.max(0, Math.floor(scrollTop / itemHeight) - overscan); - const endIndex = Math.min(total, Math.ceil((scrollTop + viewportHeight) / itemHeight) + overscan); - const visible = viewportHeight > 0 ? items.slice(startIndex, endIndex) : []; - - const footerHeight = hasMore ? FOOTER_HEIGHT : 0; - const sizeProps = height != null ? { height: `${height}px` } : { flex: 1, minHeight: 0 }; - - return ( - - {loading ? ( - - - {loadingText} - - ) : total === 0 ? ( - {emptyText} - ) : ( - // 撑高占位容器,保证滚动条比例正确 - - {visible.map((item, i) => { - const index = startIndex + i; - return ( - - {renderItem(item, index)} - - ); - })} - {hasMore && ( - - - 加载更多... - - )} - - )} - - ); -} - -export const VirtualList = memo(VirtualListInner) as ( - props: VirtualListProps -) => React.JSX.Element; diff --git a/参考/NexBox-main/src/components/VirtualizedSongList.tsx b/参考/NexBox-main/src/components/VirtualizedSongList.tsx deleted file mode 100644 index 3357a42..0000000 --- a/参考/NexBox-main/src/components/VirtualizedSongList.tsx +++ /dev/null @@ -1,170 +0,0 @@ -/** - * 虚拟化歌曲列表 — 渐进式加载 - * - * 策略:初始渲染前 BATCH_SIZE 首,滚动接近底部时自动加载下一批。 - * 避免一次性渲染数百个 SongRow(每个含图片/按钮/Tooltip)导致卡顿。 - * - * 性能: - * - 使用 IntersectionObserver 检测底部哨兵元素,无需手动监听 scroll - * - 批量大小 50,足以覆盖一般屏幕高度,滚动时无感知 - * - 加载更多时插入新 DOM 节点,已渲染的不受影响 - */ - -import { useEffect, useRef, useState, memo, useCallback, type ReactNode } from "react"; -import { Box, VStack, Spinner, Text } from "@chakra-ui/react"; - -interface VirtualizedSongListProps { - items: T[]; - renderItem: (item: T, index: number) => ReactNode; - batchSize?: number; - /** 滚动到距底部多少 px 时触发加载下一批 */ - triggerDistance?: number; - /** key 前缀,用于切歌时重置 */ - resetKey?: string | number; - /** 空状态文案 */ - emptyText?: string; - /** loading 状态(外部加载中) */ - loading?: boolean; - /** 外部 loading 时的文案 */ - loadingText?: string; - /** 自定义滚动容器 sx */ - sx?: Record; - /** spacing between items */ - spacing?: string | number; - /** 自定义滚动容器样式 */ - scrollbarSx?: Record; - /** 当接近列表末尾时触发的回调(用于从后端加载更多) */ - onLoadMore?: () => void; - /** 外部判断是否还有更多数据(后端未加载完) */ - hasMoreServer?: boolean; -} - -const DEFAULT_BATCH = 50; -const DEFAULT_TRIGGER = 300; - -function VirtualizedSongListInner({ - items, - renderItem, - batchSize = DEFAULT_BATCH, - triggerDistance = DEFAULT_TRIGGER, - resetKey, - emptyText = "暂无曲目", - loading = false, - loadingText = "加载中...", - sx, - spacing = 1, - scrollbarSx, - onLoadMore, - hasMoreServer = false, -}: VirtualizedSongListProps) { - const [visibleCount, setVisibleCount] = useState(batchSize); - const sentinelRef = useRef(null); - const scrollRef = useRef(null); - - // resetKey 变化时重置(切歌单/切搜索结果) - useEffect(() => { - setVisibleCount(batchSize); - if (scrollRef.current) { - scrollRef.current.scrollTop = 0; - } - }, [resetKey, batchSize]); - - // IntersectionObserver 检测哨兵元素进入视口 - const loadMore = useCallback(() => { - setVisibleCount((prev) => { - if (prev >= items.length) { - // 本地数据已全部展示,触发后端加载更多 - onLoadMore?.(); - return prev; - } - return Math.min(prev + batchSize, items.length); - }); - }, [items.length, batchSize, onLoadMore]); - - useEffect(() => { - const sentinel = sentinelRef.current; - const root = scrollRef.current; - if (!sentinel || !root) return; - - const observer = new IntersectionObserver( - (entries) => { - if (entries[0]?.isIntersecting) { - loadMore(); - } - }, - { - root, - rootMargin: `${triggerDistance}px 0px`, - threshold: 0, - } - ); - - observer.observe(sentinel); - return () => observer.disconnect(); - }, [loadMore, triggerDistance]); - - // 当 items 增加时(如异步加载完成),确保 visibleCount 至少为 batchSize - useEffect(() => { - if (items.length > 0 && visibleCount === 0) { - setVisibleCount(batchSize); - } - }, [items.length, visibleCount, batchSize]); - - const visibleItems = items.slice(0, visibleCount); - const hasMore = visibleCount < items.length; - - if (loading) { - return ( - - - {loadingText} - - ); - } - - if (items.length === 0) { - return ( - - {emptyText} - - ); - } - - return ( - - - {visibleItems.map((item, i) => renderItem(item, i))} - - - {/* 底部哨兵:进入视口时触发加载下一批 / 后端更多 */} - {(hasMore || hasMoreServer) && ( - - - - {hasMore ? `加载更多... (${visibleCount}/${items.length})` : "加载更多..."} - - - )} - - {/* 全部加载完成时显示总数 */} - {!hasMore && !hasMoreServer && items.length > batchSize && ( - - 共 {items.length} 首 - - )} - - ); -} - -export const VirtualizedSongList = memo(VirtualizedSongListInner) as ( - props: VirtualizedSongListProps -) => React.JSX.Element; diff --git a/参考/NexBox-main/src/components/desktop-lyrics/LyricsCanvas.tsx b/参考/NexBox-main/src/components/desktop-lyrics/LyricsCanvas.tsx deleted file mode 100644 index 2935801..0000000 --- a/参考/NexBox-main/src/components/desktop-lyrics/LyricsCanvas.tsx +++ /dev/null @@ -1,275 +0,0 @@ -/** - * 桌面歌词渲染组件 - * - * 特性: - * - 当前行使用双层叠加实现卡拉OK逐字高亮效果 - * - 支持单行(仅当前句)和双行(当前句+下一句)模式 - * - 文字描边保证在任意背景下可读 - * - RAF 更新进度,60fps 流畅 - */ - -import { useEffect, useRef, useState, memo, useMemo } from "react"; -import type { KaraokeLine } from "@/types/music"; -import { getLineProgress, calculateScrollOffset } from "@/lib/karaoke-lyrics"; - -interface LyricsCanvasProps { - lines: KaraokeLine[]; - currentTime: number; - fontSize: number; - highlightColor: string; - baseColor: string; - lineCount: 1 | 2; - isPlaying: boolean; -} - -/** 计算当前活跃行索引 */ -function calcActiveIndex(lines: KaraokeLine[], currentTime: number): number { - if (lines.length === 0) return -1; - let idx = -1; - for (let i = 0; i < lines.length; i++) { - if (lines[i].time <= currentTime) idx = i; - else break; - } - return idx; -} - -/** 当前行的卡拉OK效果渲染 */ -function ActiveKaraokeLine({ - line, - nextLine, - currentTime, - fontSize, - highlightColor, - baseColor, - isPlaying, -}: { - line: KaraokeLine; - nextLine?: KaraokeLine; - currentTime: number; - fontSize: number; - highlightColor: string; - baseColor: string; - isPlaying: boolean; -}) { - const overlayRef = useRef(null); - const containerRef = useRef(null); - const scrollRef = useRef(null); - const [scrollNeeded, setScrollNeeded] = useState(false); - const scrollLimitRef = useRef(0); - const currentTimeRef = useRef(currentTime); - currentTimeRef.current = currentTime; - - // 文字描边样式 - const textShadow = ` - -1px -1px 0 rgba(0,0,0,0.8), - 1px -1px 0 rgba(0,0,0,0.8), - -1px 1px 0 rgba(0,0,0,0.8), - 1px 1px 0 rgba(0,0,0,0.8), - 0 0 8px rgba(0,0,0,0.5) - `; - - // 检测超长歌词 - useEffect(() => { - if (!containerRef.current || !scrollRef.current) return; - const checkOverflow = () => { - if (!scrollRef.current || !containerRef.current) return; - const overflow = scrollRef.current.scrollWidth - containerRef.current.clientWidth; - const needed = overflow > 4; - setScrollNeeded(needed); - scrollLimitRef.current = Math.max(0, overflow / 2); - }; - checkOverflow(); - const timer = setTimeout(checkOverflow, 100); - return () => clearTimeout(timer); - }, [line.text, fontSize]); - - // RAF 更新进度(仅播放时运行) - useEffect(() => { - if (!isPlaying || !overlayRef.current) return; - const el = overlayRef.current; - el.style.width = "0%"; - - let rafId: number; - let running = true; - const tick = () => { - if (!running) return; - const t = currentTimeRef.current; - const progress = getLineProgress(line, nextLine, t); - el.style.width = `${(progress * 100).toFixed(2)}%`; - - if (scrollNeeded && scrollRef.current) { - const offset = calculateScrollOffset(progress, scrollLimitRef.current); - scrollRef.current.style.transform = `translate3d(${offset.toFixed(2)}px, 0, 0)`; - } - - rafId = requestAnimationFrame(tick); - }; - rafId = requestAnimationFrame(tick); - return () => { - running = false; - cancelAnimationFrame(rafId); - }; - }, [line, nextLine, scrollNeeded, isPlaying]); - - const sharedStyle: React.CSSProperties = { - display: "inline-block", - whiteSpace: "nowrap", - fontSize: `${fontSize}px`, - fontWeight: "bold", - lineHeight: 1.4, - letterSpacing: "0px", - textShadow, - }; - - const maskFade = Math.min(18, Math.max(6, fontSize * 0.3)); - const maskGradient = `linear-gradient(90deg, #000 0%, #000 calc(100% - ${maskFade}px), rgba(0,0,0,0.3) 100%)`; - - return ( -
- - {/* 底层:完整歌词,暗色 */} - - {line.text} - - {/* 顶层:高亮歌词,用 width 裁剪 */} - - {line.text} - - -
- ); -} - -function LyricsCanvasInner({ - lines, - currentTime, - fontSize, - highlightColor, - baseColor, - lineCount, - isPlaying, -}: LyricsCanvasProps) { - const activeIndex = useMemo( - () => calcActiveIndex(lines, currentTime), - [lines, currentTime] - ); - - // 空歌词占位 - if (lines.length === 0 || activeIndex < 0) { - return ( -
- - ♪ 暂无歌词 ♪ - -
- ); - } - - const currentLine = lines[activeIndex]; - const nextLine = lines[activeIndex + 1]; - - return ( -
- - - {lineCount === 2 && nextLine && ( -
- - {nextLine.text} - -
- )} -
- ); -} - -export const LyricsCanvas = memo(LyricsCanvasInner); diff --git a/参考/NexBox-main/src/components/desktop-lyrics/LyricsControlBar.tsx b/参考/NexBox-main/src/components/desktop-lyrics/LyricsControlBar.tsx deleted file mode 100644 index 100fe94..0000000 --- a/参考/NexBox-main/src/components/desktop-lyrics/LyricsControlBar.tsx +++ /dev/null @@ -1,156 +0,0 @@ -/** - * 桌面歌词控制栏(仅未锁定时悬浮显示) - * - * 锁定状态的解锁按钮由独立小窗口(/lyrics-unlock-btn)提供, - * 不受 WebView2 穿透影响。 - * - * [上一句] [播放/暂停] [下一句] [随机播放] | [锁定] | [关闭] - */ - -import { memo } from "react"; -import { - SkipBack, - SkipForward, - Shuffle, - Play, - Pause, - Lock, - X, -} from "lucide-react"; -import type { PlayMode } from "@/types/music"; -import type { ControlAction } from "@/hooks/useDesktopLyricsSync"; - -interface LyricsControlBarProps { - isPlaying: boolean; - playMode: PlayMode; - onControl: (action: ControlAction) => void; -} - -const btnBase: React.CSSProperties = { - background: "transparent", - border: "none", - cursor: "pointer", - display: "flex", - alignItems: "center", - justifyContent: "center", - padding: "6px", - borderRadius: "50%", - color: "rgba(255,255,255,0.9)", - transition: "background 0.15s ease, transform 0.1s ease", -}; - -function LyricsControlBarInner({ - isPlaying, - playMode, - onControl, -}: LyricsControlBarProps) { - return ( -
e.stopPropagation()} - > - - - - - - - - - {/* 分隔线 */} -
- - - - {/* 分隔线 */} -
- - -
- ); -} - -export const LyricsControlBar = memo(LyricsControlBarInner); diff --git a/参考/NexBox-main/src/components/hotkey-recorder.tsx b/参考/NexBox-main/src/components/hotkey-recorder.tsx deleted file mode 100644 index c1ecfc8..0000000 --- a/参考/NexBox-main/src/components/hotkey-recorder.tsx +++ /dev/null @@ -1,161 +0,0 @@ -"use client"; - -import { Box, Text, useColorModeValue } from "@chakra-ui/react"; -import { useState, useCallback, useRef } from "react"; - -export function keyToHotkeyFormat(key: string): string | null { - if (key.startsWith("F") && key.length >= 2 && key.length <= 3) { - const num = parseInt(key.slice(1)); - if (num >= 1 && num <= 24) return key; - } - if (key === "ArrowUp") return "Up"; - if (key === "ArrowDown") return "Down"; - if (key === "ArrowLeft") return "Left"; - if (key === "ArrowRight") return "Right"; - if (key === " ") return "Space"; - if (key === "Escape") return "Escape"; - if (key === "Tab") return "Tab"; - if (key === "Enter") return "Enter"; - if (key === "Backspace") return "Backspace"; - if (key === "Delete") return "Delete"; - if (key === "Home") return "Home"; - if (key === "End") return "End"; - if (key === "PageUp") return "PageUp"; - if (key === "PageDown") return "PageDown"; - if (key === "Insert") return "Insert"; - if (key === "Pause") return "Pause"; - if (key === "ScrollLock") return "ScrollLock"; - if (key === "CapsLock") return "CapsLock"; - if (key === "NumLock") return "NumLock"; - if (key === "PrintScreen") return "PrintScreen"; - if (/^[0-9]$/.test(key)) return key; - if (/^[a-zA-Z]$/.test(key)) return key.toUpperCase(); - return null; -} - -function buildComboFromEvent(e: React.KeyboardEvent): string[] { - const parts: string[] = []; - if (e.ctrlKey) parts.push("Ctrl"); - if (e.shiftKey) parts.push("Shift"); - if (e.altKey) parts.push("Alt"); - if (e.metaKey) parts.push("Command"); - const nonModifier = e.key; - if (!["Control", "Shift", "Alt", "Meta"].includes(nonModifier)) { - const mapped = keyToHotkeyFormat(nonModifier); - if (mapped) { - parts.push(mapped); - } - } - return parts; -} - -const MODIFIER_LABELS = ["Ctrl", "Shift", "Alt", "Command"]; - -export function HotkeyRecorder({ - value, - onChange, -}: { - value: string; - onChange: (val: string) => void; -}) { - const [isRecording, setIsRecording] = useState(false); - const [displayText, setDisplayText] = useState(""); - const pendingRef = useRef([]); - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const recordBg = useColorModeValue("teal.50", "rgba(0,150,136,0.1)"); - const recordBorder = useColorModeValue("teal.400", "teal.300"); - - const handleKeyDown = useCallback( - (e: React.KeyboardEvent) => { - if (!isRecording) return; - e.preventDefault(); - e.stopPropagation(); - const parts = buildComboFromEvent(e); - pendingRef.current = parts; - setDisplayText(parts.join("+")); - }, - [isRecording] - ); - - const handleKeyUp = useCallback( - (e: React.KeyboardEvent) => { - if (!isRecording) return; - e.preventDefault(); - e.stopPropagation(); - - if (e.key === "Escape") { - setIsRecording(false); - setDisplayText(""); - pendingRef.current = []; - return; - } - - const combo = pendingRef.current; - if (combo.length > 0) { - const lastPart = combo[combo.length - 1]; - const hasMainKey = !MODIFIER_LABELS.includes(lastPart); - if (hasMainKey) { - onChange(combo.join("+")); - setIsRecording(false); - setDisplayText(""); - pendingRef.current = []; - return; - } - } - - const remainingParts = buildComboFromEvent(e); - pendingRef.current = remainingParts; - setDisplayText(remainingParts.join("+")); - }, - [isRecording, onChange] - ); - - const startRecording = useCallback(() => { - setIsRecording(true); - setDisplayText(""); - pendingRef.current = []; - }, []); - - const stopRecording = useCallback(() => { - if (isRecording) { - setIsRecording(false); - setDisplayText(""); - pendingRef.current = []; - } - }, [isRecording]); - - return ( - - {isRecording ? ( - - {displayText || "按下快捷键..."} - - ) : ( - - {value || "无"} - - )} - - ); -} diff --git a/参考/NexBox-main/src/components/special/custom-color-picker.tsx b/参考/NexBox-main/src/components/special/custom-color-picker.tsx deleted file mode 100644 index 0988fbf..0000000 --- a/参考/NexBox-main/src/components/special/custom-color-picker.tsx +++ /dev/null @@ -1,251 +0,0 @@ -import { - Box, - HStack, - Text, - VStack, - Input, - Portal, - useColorModeValue, -} from "@chakra-ui/react"; -import { useState, useRef, useEffect, useCallback } from "react"; -import { isValidHexColor, hexToHsv, hsvToHex, colorToHex } from "@/lib/color-utils"; - -const SV_PANEL_W = 200; -const SV_PANEL_H = 150; - -const PANEL_HEIGHT = 240; - -export function CustomColorPicker({ color, onChange, compact }: { color: string; onChange: (c: string) => void; compact?: boolean }) { - const [isOpen, setIsOpen] = useState(false); - const panelRef = useRef(null); - const triggerRef = useRef(null); - const panelContentRef = useRef(null); - const [popoverPos, setPopoverPos] = useState({ top: 0, left: 0 }); - const svRef = useRef(null); - const hueRef = useRef(null); - const isDragging = useRef<"sv" | "hue" | null>(null); - - const hsv = hexToHsv(color); - const hsvRef = useRef(hsv); - hsvRef.current = hsv; - const hueValueRef = useRef(hsv.h); - hueValueRef.current = hsv.h; - const onChangeRef = useRef(onChange); - onChangeRef.current = onChange; - const cardBorder = useColorModeValue("gray.200", "#333333"); - const panelBg = useColorModeValue("white", "#1a1a1a"); - const panelShadow = useColorModeValue("0 4px 20px rgba(0,0,0,0.15)", "0 4px 20px rgba(0,0,0,0.4)"); - const [hexInput, setHexInput] = useState(colorToHex(color)); - - useEffect(() => { setHexInput(colorToHex(color)); }, [color]); - - // Use a custom mousedown handler instead of useOutsideClick because - // the picker panel is rendered via Portal (outside panelRef in the DOM), - // so useOutsideClick's capturing-phase listener incorrectly treats panel - // interactions as "outside" clicks and closes the picker during drag. - useEffect(() => { - if (!isOpen) return; - const handleMouseDown = (e: MouseEvent) => { - const target = (e.composedPath?.()[0] ?? e.target) as Node | null; - if (!target) return; - if (panelRef.current?.contains(target)) return; - if (triggerRef.current?.contains(target)) return; - if (panelContentRef.current?.contains(target)) return; - setIsOpen(false); - }; - document.addEventListener("mousedown", handleMouseDown); - return () => document.removeEventListener("mousedown", handleMouseDown); - }, [isOpen]); - - const calcPos = () => { - if (!triggerRef.current) return { top: 0, left: 0 }; - const rect = triggerRef.current.getBoundingClientRect(); - const spaceBelow = window.innerHeight - rect.bottom; - const spaceAbove = rect.top; - if (spaceBelow >= PANEL_HEIGHT + 8 || spaceBelow >= spaceAbove) { - return { top: rect.bottom + 8, left: rect.left }; - } - return { top: rect.top - PANEL_HEIGHT - 8, left: rect.left }; - }; - - const openPicker = () => { - setPopoverPos(calcPos()); - setIsOpen(true); - }; - - // Follow trigger position on scroll/resize when open - useEffect(() => { - if (!isOpen || !triggerRef.current) return; - const updatePos = () => setPopoverPos(calcPos()); - window.addEventListener("scroll", updatePos, true); - window.addEventListener("resize", updatePos); - return () => { - window.removeEventListener("scroll", updatePos, true); - window.removeEventListener("resize", updatePos); - }; - }, [isOpen]); - - // SV panel: 2D saturation-value picker - const handleSvMouseDown = useCallback((e: React.MouseEvent) => { - isDragging.current = "sv"; - updateSvFromMouse(e); - const onMove = (ev: MouseEvent) => updateSvFromMouse(ev); - const onUp = () => { isDragging.current = null; document.removeEventListener("mousemove", onMove); document.removeEventListener("mouseup", onUp); }; - document.addEventListener("mousemove", onMove); - document.addEventListener("mouseup", onUp); - }, [hsv.h]); - - const updateSvFromMouse = (e: { clientX: number; clientY: number }) => { - const rect = svRef.current?.getBoundingClientRect(); - if (!rect) return; - let x = (e.clientX - rect.left) / rect.width; - let y = (e.clientY - rect.top) / rect.height; - x = Math.max(0, Math.min(1, x)); - y = Math.max(0, Math.min(1, y)); - const s = x * 100; - const v = (1 - y) * 100; - const newHex = hsvToHex(hueValueRef.current, s, v); - onChange(newHex); - }; - - // Hue slider - const updateHueFromMouse = (e: { clientX: number }) => { - const rect = hueRef.current?.getBoundingClientRect(); - if (!rect) return; - let x = (e.clientX - rect.left) / rect.width; - x = Math.max(0, Math.min(1, x)); - const newHex = hsvToHex(x * 360, hsvRef.current.s, hsvRef.current.v); - onChangeRef.current(newHex); - }; - - const handleHueMouseDown = useCallback((e: React.MouseEvent) => { - isDragging.current = "hue"; - updateHueFromMouse(e); - const onMove = (ev: MouseEvent) => updateHueFromMouse(ev); - const onUp = () => { isDragging.current = null; document.removeEventListener("mousemove", onMove); document.removeEventListener("mouseup", onUp); }; - document.addEventListener("mousemove", onMove); - document.addEventListener("mouseup", onUp); - }, []); - - const handleHexInputChange = (value: string) => { - setHexInput(value); - if (isValidHexColor(value)) { - onChange(value); - } - }; - - const cursorX = hsv.s / 100 * SV_PANEL_W; - const cursorY = (1 - hsv.v / 100) * SV_PANEL_H; - const huePos = hsv.h / 360 * SV_PANEL_W; - - return ( - - {/* Trigger swatch */} - - - {!compact && ( - handleHexInputChange(e.target.value)} - placeholder="#98DDD0" - size="sm" - width="120px" - borderRadius="lg" - /> - )} - - - {/* Picker panel via Portal (fixed positioning to avoid card clipping) */} - {isOpen && ( - - - - {/* SV square */} - - {/* Cursor */} - - - - {/* Hue slider */} - - - - - {/* Preview + hex */} - - - - {colorToHex(color)} - - - - - - )} - - ); -} diff --git a/参考/NexBox-main/src/components/special/custom-select.tsx b/参考/NexBox-main/src/components/special/custom-select.tsx deleted file mode 100644 index b6d8593..0000000 --- a/参考/NexBox-main/src/components/special/custom-select.tsx +++ /dev/null @@ -1,221 +0,0 @@ -import { Box, HStack, Text, Badge, useColorModeValue } from "@chakra-ui/react"; -import { LuChevronDown, LuCheck } from "react-icons/lu"; -import { useState, useRef, useEffect, useCallback } from "react"; -import { createPortal } from "react-dom"; -import { LiquidGlassCard } from "./liquid-glass-card"; - -interface SelectOption { - value: string; - label: string; - badge?: string; -} - -interface CustomSelectProps { - value: string; - onChange: (value: string) => void; - options: SelectOption[]; - width?: string; - placeholder?: string; - direction?: "up" | "down"; -} - -export function CustomSelect({ - value, - onChange, - options, - width = "140px", - placeholder, - direction = "down" -}: CustomSelectProps) { - const [isOpen, setIsOpen] = useState(false); - const [dropdownPos, setDropdownPos] = useState<{ top?: number; bottom?: number; left: number; width: number } | null>(null); - const selectRef = useRef(null); - const dropdownRef = useRef(null); - const scrollTopRef = useRef(0); - - const textColor = useColorModeValue("gray.700", "#e0e0e0"); - const iconColor = useColorModeValue("gray.500", "#999999"); - const dropdownBg = useColorModeValue("white", "#111111"); - const dropdownBorder = useColorModeValue("gray.200", "#333333"); - const itemBg = useColorModeValue("white", "#111111"); - const itemBgActive = useColorModeValue("gray.100", "#222222"); - const itemText = useColorModeValue("gray.600", "#cccccc"); - const itemTextActive = useColorModeValue("gray.900", "#ffffff"); - const hoverBg = useColorModeValue("gray.50", "#222222"); - - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - const target = event.target as Node; - const isClickInsideSelect = selectRef.current?.contains(target); - const isClickInsideDropdown = dropdownRef.current?.contains(target); - - if (!isClickInsideSelect && !isClickInsideDropdown) { - setIsOpen(false); - } - }; - - document.addEventListener("mousedown", handleClickOutside); - return () => document.removeEventListener("mousedown", handleClickOutside); - }, []); - - // Set initial position when opening - useEffect(() => { - if (isOpen && selectRef.current) { - const rect = selectRef.current.getBoundingClientRect(); - if (direction === "up") { - setDropdownPos({ - bottom: window.innerHeight - rect.top + 4, - left: rect.left, - width: rect.width, - }); - } else { - setDropdownPos({ - top: rect.bottom + 4, - left: rect.left, - width: rect.width, - }); - } - } else { - setDropdownPos(null); - } - }, [isOpen, direction]); - - // Follow scroll container via direct DOM manipulation (no re-render) - useEffect(() => { - if (!isOpen || !selectRef.current) return; - - // Find nearest scrollable ancestor - let scrollContainer: HTMLElement | null = selectRef.current.parentElement; - while (scrollContainer) { - const style = window.getComputedStyle(scrollContainer); - if (style.overflowY === "auto" || style.overflowY === "scroll") { - break; - } - scrollContainer = scrollContainer.parentElement; - } - if (!scrollContainer) return; - - scrollTopRef.current = scrollContainer.scrollTop; - - const onScroll = () => { - const el = dropdownRef.current; - if (!el || !scrollContainer) return; - const offset = scrollTopRef.current - scrollContainer.scrollTop; - el.style.transform = `translateY(${offset}px)`; - }; - - const onResize = () => { - const el = dropdownRef.current; - if (!el || !selectRef.current || !scrollContainer) return; - const rect = selectRef.current.getBoundingClientRect(); - el.style.transform = ""; - scrollTopRef.current = scrollContainer.scrollTop; - if (direction === "up") { - el.style.bottom = `${window.innerHeight - rect.top + 4}px`; - el.style.top = ""; - } else { - el.style.top = `${rect.bottom + 4}px`; - el.style.bottom = ""; - } - el.style.left = `${rect.left}px`; - el.style.width = `${rect.width}px`; - }; - - scrollContainer.addEventListener("scroll", onScroll); - window.addEventListener("resize", onResize); - return () => { - scrollContainer?.removeEventListener("scroll", onScroll); - window.removeEventListener("resize", onResize); - }; - }, [isOpen, direction]); - - const toggleSelect = useCallback(() => { - setIsOpen((prev) => !prev); - }, []); - - const selectedOption = options.find((opt) => opt.value === value); - const displayLabel = selectedOption?.label || placeholder || ""; - - return ( - <> - - - - - {displayLabel} - - - - - - - {isOpen && dropdownPos && createPortal( - - {options.map((option) => ( - { - onChange(option.value); - setIsOpen(false); - }} - transition="all 0.15s" - > - - - {option.label} - {option.badge && ( - - {option.badge} - - )} - - {option.value === value && } - - - ))} - , - document.body - )} - - ); -} \ No newline at end of file diff --git a/参考/NexBox-main/src/components/special/layout-toggle.tsx b/参考/NexBox-main/src/components/special/layout-toggle.tsx deleted file mode 100644 index 0307ec5..0000000 --- a/参考/NexBox-main/src/components/special/layout-toggle.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { HStack, IconButton, Tooltip, useColorModeValue } from "@chakra-ui/react"; -import { LayoutGrid, List } from "lucide-react"; -import { useTranslation } from "react-i18next"; - -export type LayoutMode = "grid" | "list"; - -interface LayoutToggleProps { - mode: LayoutMode; - onChange: (mode: LayoutMode) => void; -} - -export function LayoutToggle({ mode, onChange }: LayoutToggleProps) { - const { t } = useTranslation(); - const activeBg = useColorModeValue("blackAlpha.100", "whiteAlpha.200"); - const inactiveColor = useColorModeValue("gray.400", "gray.500"); - - const options: { - mode: LayoutMode; - icon: React.ComponentType<{ size?: number }>; - labelKey: string; - }[] = [ - { mode: "grid", icon: LayoutGrid, labelKey: "view.grid" }, - { mode: "list", icon: List, labelKey: "view.list" }, - ]; - - return ( - - {options.map((opt) => { - const Icon = opt.icon; - const isActive = mode === opt.mode; - const label = t(opt.labelKey); - return ( - - } - size="sm" - variant="ghost" - borderRadius="md" - color={isActive ? undefined : inactiveColor} - bg={isActive ? activeBg : "transparent"} - onClick={() => onChange(opt.mode)} - _hover={{ bg: activeBg }} - /> - - ); - })} - - ); -} diff --git a/参考/NexBox-main/src/components/special/liquid-glass-button.tsx b/参考/NexBox-main/src/components/special/liquid-glass-button.tsx deleted file mode 100644 index 7f48699..0000000 --- a/参考/NexBox-main/src/components/special/liquid-glass-button.tsx +++ /dev/null @@ -1,67 +0,0 @@ -"use client"; - -import { Button, useColorModeValue } from "@chakra-ui/react"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { useLiquidGlassRefraction } from "@/components/special/liquid-glass-svg-filter"; -import { useState, useEffect } from "react"; - -interface LiquidGlassButtonProps { - children: React.ReactNode; - className?: string; - [key: string]: any; -} - -export function LiquidGlassButton({ children, className, ...props }: LiquidGlassButtonProps) { - const { liquidGlassEnabled, liquidGlassBlur, liquidGlassMode } = useBackground(); - const { getActiveColor, getHoverColor, getContrastTextColor } = useThemeColor(); - const { svgSupported } = useLiquidGlassRefraction(liquidGlassEnabled && liquidGlassMode === "real"); - const [showBlur, setShowBlur] = useState(false); - - const glassBorderColor = useColorModeValue("rgba(255,255,255,0.3)", "rgba(255,255,255,0.15)"); - const glassBg = getActiveColor(); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - const isReal = liquidGlassEnabled && liquidGlassMode === "real"; - - const backdropFilter = isReal - ? (svgSupported - ? `url(#nexbox-liquid-glass-filter) saturate(1.4)` - : `saturate(1.4) brightness(1.05)`) - : `blur(${effectiveBlur}px)`; - - return ( - - ); -} diff --git a/参考/NexBox-main/src/components/special/liquid-glass-card.tsx b/参考/NexBox-main/src/components/special/liquid-glass-card.tsx deleted file mode 100644 index e024ae6..0000000 --- a/参考/NexBox-main/src/components/special/liquid-glass-card.tsx +++ /dev/null @@ -1,87 +0,0 @@ -"use client"; - -import { Box, BoxProps, useColorModeValue } from "@chakra-ui/react"; -import { useBackground } from "@/contexts/background-context"; -import { getBorderGlowStyle } from "@/hooks/use-glow-effect"; -import { useLiquidGlassRefraction } from "@/components/special/liquid-glass-svg-filter"; -import { useMemo, useState, useEffect } from "react"; - -interface LiquidGlassCardProps extends BoxProps { - children: React.ReactNode; - className?: string; - isDashed?: boolean; -} - -export function LiquidGlassCard({ - children, - className, - isDashed = false, - ...props -}: LiquidGlassCardProps) { - const { liquidGlassEnabled, liquidGlassBlur, liquidGlassMode } = useBackground(); - const { svgSupported } = useLiquidGlassRefraction(liquidGlassEnabled && liquidGlassMode === "real"); - - const glassBgColor = useColorModeValue("rgba(255,255,255,0.25)", "rgba(0,0,0,0.25)"); - const glassBorderColor = useColorModeValue("rgba(255,255,255,0.2)", "rgba(255,255,255,0.1)"); - const glowColor = useColorModeValue("rgba(255,255,255,0.8)", "rgba(255,255,255,0.5)"); - const defaultBg = useColorModeValue("white", "#111111"); - const defaultBorder = useColorModeValue("gray.200", "#333333"); - - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - const isReal = liquidGlassEnabled && liquidGlassMode === "real" && !isDashed; - - const backdropFilter = useMemo(() => { - if (!liquidGlassEnabled) return "none"; - if (isReal && svgSupported) return `url(#nexbox-liquid-glass-filter) saturate(1.4)`; - if (isReal) return `saturate(1.4) brightness(1.05)`; - return `blur(${effectiveBlur}px)`; - }, [liquidGlassEnabled, isReal, svgSupported, effectiveBlur]); - - const cardStyles = useMemo(() => ({ - bg: liquidGlassEnabled ? glassBgColor : defaultBg, - borderRadius: "xl" as const, - border: isDashed ? "1px dashed" : "1px solid", - borderColor: liquidGlassEnabled ? glassBorderColor : defaultBorder, - backdropFilter, - WebkitBackdropFilter: backdropFilter, - transition: "background 0.45s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1)", - sx: { - transform: "translateZ(0)", - WebkitTransform: "translateZ(0)", - WebkitBackfaceVisibility: "hidden", - backfaceVisibility: "hidden", - ...(liquidGlassEnabled ? { willChange: "backdrop-filter" } : {}), - }, - }), [backdropFilter, liquidGlassEnabled, glassBgColor, glassBorderColor, defaultBg, defaultBorder, isDashed]); - - const borderGlowStyle = useMemo(() => getBorderGlowStyle(glowColor), [glowColor]); - - return ( - - {!isReal && ( - - )} - {children} - - ); -} diff --git a/参考/NexBox-main/src/components/special/liquid-glass-menu-item.tsx b/参考/NexBox-main/src/components/special/liquid-glass-menu-item.tsx deleted file mode 100644 index a7afa8d..0000000 --- a/参考/NexBox-main/src/components/special/liquid-glass-menu-item.tsx +++ /dev/null @@ -1,110 +0,0 @@ -"use client"; - -import { Box, HStack, Text, useColorModeValue } from "@chakra-ui/react"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { useGlowEffect, getBorderGlowStyle } from "@/hooks/use-glow-effect"; -import { useLiquidGlassRefraction } from "@/components/special/liquid-glass-svg-filter"; -import { useState, useEffect } from "react"; - -interface LiquidGlassMenuItemProps { - children: React.ReactNode; - isActive?: boolean; - onClick?: () => void; - icon?: React.ElementType; -} - -export function LiquidGlassMenuItem({ - children, - isActive = false, - onClick, - icon: Icon -}: LiquidGlassMenuItemProps) { - const { liquidGlassEnabled, liquidGlassBlur, liquidGlassMode } = useBackground(); - const { getActiveColor, getBorderColor, getContrastTextColor } = useThemeColor(); - const { mouseX, mouseY, isHovering, handleMouseMove, handleMouseLeave, handleMouseEnter } = useGlowEffect(); - const { svgSupported } = useLiquidGlassRefraction(liquidGlassEnabled && liquidGlassMode === "real"); - - const activeBg = getActiveColor(); - const activeTextFinal = getContrastTextColor(); - const inactiveText = useColorModeValue("gray.500", "#d0d0d0"); - const glassInactiveText = useColorModeValue("gray.900", "#d0d0d0"); - const defaultInactiveBg = useColorModeValue("white", "#111111"); - const hoverBg = useColorModeValue("gray.200", "#333333"); - - const glassInactiveBg = useColorModeValue("rgba(255,255,255,0.25)", "rgba(0,0,0,0.25)"); - const glassHoverBg = useColorModeValue("rgba(255,255,255,0.35)", "rgba(0,0,0,0.35)"); - const glassBorderColor = useColorModeValue("rgba(255,255,255,0.25)", "rgba(255,255,255,0.12)"); - const glassActiveBorder = getBorderColor(); - const outlineColor = getActiveColor(); - const glowColor = useColorModeValue("rgba(255,255,255,0.8)", "rgba(255,255,255,0.5)"); - - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - const transition = "background 0.45s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1)"; - const isReal = liquidGlassEnabled && liquidGlassMode === "real"; - - const backdropFilter = isReal - ? (svgSupported - ? `url(#nexbox-liquid-glass-filter) saturate(1.4)` - : `saturate(1.4) brightness(1.05)`) - : `blur(${effectiveBlur}px)`; - - return ( - - {!isReal && ( - - )} - - {Icon && } - - {children} - - - - ); -} diff --git a/参考/NexBox-main/src/components/special/liquid-glass-svg-filter.tsx b/参考/NexBox-main/src/components/special/liquid-glass-svg-filter.tsx deleted file mode 100644 index 01be8db..0000000 --- a/参考/NexBox-main/src/components/special/liquid-glass-svg-filter.tsx +++ /dev/null @@ -1,161 +0,0 @@ -"use client"; - -import { useEffect, useRef, useState, useCallback } from "react"; - -/** - * 真实液态玻璃 SVG 折射滤镜系统 - * - * 参考 Mineradio 项目的实现: - * 1. 使用 feDisplacementMap 对 backdrop 内容进行位移,实现边缘折射 - * 2. RGB 三通道分别位移不同量,产生色差效果 - * 3. 生成一张通用位移贴图,通过 preserveAspectRatio="none" 拉伸适配所有元素 - * 4. 通过 backdrop-filter: url(#filter) 应用到背景 - */ - -const FILTER_ID = "nexbox-liquid-glass-filter"; - -/** - * 检测当前浏览器是否支持 backdrop-filter: url(#filter) - */ -export function supportsSvgBackdropFilter(): boolean { - try { - const ua = navigator.userAgent || ""; - if ((/Safari/.test(ua) && !/Chrome/.test(ua)) || /Firefox/.test(ua)) return false; - const div = document.createElement("div"); - div.style.backdropFilter = `url(#${FILTER_ID})`; - return div.style.backdropFilter !== ""; - } catch { - return false; - } -} - -/** - * 生成通用位移贴图 SVG data URI - * - * 使用固定尺寸 400x200 生成,通过 preserveAspectRatio="none" 拉伸到任意元素。 - * 这样所有元素共享同一张贴图,不会因为尺寸不匹配而产生割裂。 - * - * 贴图原理(桶形畸变 = 放大镜效果): - * - Red 通道(水平梯度):R=0 在左边缘 → 内容左移(向外);R=255 在右边缘 → 内容右移(向外) - * - Blue 通道(垂直梯度):B=0 在顶部 → 内容上移(向外);B=255 在底部 → 内容下移(向外) - * - 中心区域用灰色(128)填充并模糊,使中心位移为零,仅边缘有放大折射 - * - 使用 screen 混合模式让 R/B 通道独立互不干扰 - */ -function generateUniversalDisplacementMap(): string { - const width = 400; - const height = 200; - const radius = 24; - const borderWidth = 0.04; - const edge = Math.min(width, height) * (borderWidth * 0.5); - const innerW = Math.max(1, width - edge * 2); - const innerH = Math.max(1, height - edge * 2); - - const svg = - `` + - `` + - // R 通道:左=0(向外推)→ 中=128(零位移)→ 右=255(向外推)= 桶形畸变 - `` + - `` + - `` + - `` + - `` + - // B 通道:上=0(向外推)→ 中=128(零位移)→ 下=255(向外推)= 桶形畸变 - `` + - `` + - `` + - `` + - `` + - `` + - // 黑色底,圆角外区域为零位移 - `` + - // R 梯度层 - `` + - // B 梯度层:screen 混合使 R/B 独立叠加 - `` + - // 中心灰块:128,128,128 = 零位移,模糊产生平滑过渡 - `` + - ``; - - return "data:image/svg+xml," + encodeURIComponent(svg); -} - -/** - * 全局 SVG 滤镜定义组件 - * - * 滤镜链(极简版,避免通道分离导致灰色问题): - * 1. feImage: 加载通用位移贴图(拉伸适配) - * 2. feDisplacementMap: 单次位移,直接对完整彩色内容折射 - * 3. feGaussianBlur: 轻微模糊柔化边缘 - */ -export function LiquidGlassSvgFilter() { - const mapHref = useRef(""); - - useEffect(() => { - mapHref.current = generateUniversalDisplacementMap(); - const img = document.getElementById("nexbox-glass-displacement-map"); - if (img) { - img.setAttribute("href", mapHref.current); - try { - img.setAttributeNS("http://www.w3.org/1999/xlink", "href", mapHref.current); - } catch { - // ignore - } - } - }, []); - - return ( - - ); -} - -/** - * React Hook:检测 SVG backdrop-filter 支持 - * - * 由于使用通用贴图,不再需要按元素更新贴图。 - */ -export function useLiquidGlassRefraction(enabled: boolean) { - const [svgSupported] = useState(() => supportsSvgBackdropFilter()); - - return { - svgSupported, - }; -} diff --git a/参考/NexBox-main/src/components/special/liquid-glass-tool-card.tsx b/参考/NexBox-main/src/components/special/liquid-glass-tool-card.tsx deleted file mode 100644 index ad3b4a8..0000000 --- a/参考/NexBox-main/src/components/special/liquid-glass-tool-card.tsx +++ /dev/null @@ -1,119 +0,0 @@ -"use client"; - -import { Box, BoxProps, useColorModeValue } from "@chakra-ui/react"; -import { useBackground } from "@/contexts/background-context"; -import { useGlowEffect, getBorderGlowStyle } from "@/hooks/use-glow-effect"; -import { useLiquidGlassRefraction } from "@/components/special/liquid-glass-svg-filter"; -import { useState, useEffect } from "react"; - -interface LiquidGlassToolCardProps extends BoxProps { - children: React.ReactNode; - onClick?: () => void; - cursor?: string; - isDashed?: boolean; - className?: string; - size?: "sm" | "md" | "lg"; -} - -export function LiquidGlassToolCard({ - children, - onClick, - cursor = "pointer", - isDashed = false, - className, - size = "sm", - ...props -}: LiquidGlassToolCardProps) { - const { liquidGlassEnabled, liquidGlassBlur, liquidGlassMode } = useBackground(); - const { mouseX, mouseY, isHovering, handleMouseMove, handleMouseLeave, handleMouseEnter } = useGlowEffect(); - const { svgSupported } = useLiquidGlassRefraction(liquidGlassEnabled && liquidGlassMode === "real"); - - const defaultBg = useColorModeValue("gray.50", "#111111"); - const defaultHoverBg = useColorModeValue("gray.100", "#222222"); - const defaultBorder = useColorModeValue("gray.200", "#333333"); - - const glassBg = useColorModeValue("rgba(255,255,255,0.25)", "rgba(0,0,0,0.25)"); - const glassHoverBg = useColorModeValue("rgba(255,255,255,0.35)", "rgba(0,0,0,0.35)"); - const glassBorder = useColorModeValue("rgba(255,255,255,0.2)", "rgba(255,255,255,0.1)"); - const glowColor = useColorModeValue("rgba(255,255,255,0.8)", "rgba(255,255,255,0.5)"); - - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - const padding = size === "sm" ? 3 : size === "md" ? 4 : 5; - const borderRadius = size === "sm" ? "lg" : "xl"; - const isReal = liquidGlassEnabled && liquidGlassMode === "real" && !isDashed; - - const backdropFilter = isReal - ? (svgSupported - ? `url(#nexbox-liquid-glass-filter) saturate(1.4)` - : `saturate(1.4) brightness(1.05)`) - : `blur(${effectiveBlur}px)`; - - if (!liquidGlassEnabled) { - return ( - - {children} - - ); - } - - return ( - - {!isReal && } - {children} - - ); -} diff --git a/参考/NexBox-main/src/components/special/theme-switch.tsx b/参考/NexBox-main/src/components/special/theme-switch.tsx deleted file mode 100644 index 3a8da34..0000000 --- a/参考/NexBox-main/src/components/special/theme-switch.tsx +++ /dev/null @@ -1,40 +0,0 @@ -"use client"; - -import { Switch, useColorModeValue } from "@chakra-ui/react"; -import { useThemeColor } from "@/contexts/theme-color-context"; - -interface ThemeSwitchProps { - size?: "sm" | "md" | "lg"; - isChecked?: boolean; - onChange?: (event: React.ChangeEvent) => void; - isDisabled?: boolean; - [key: string]: any; -} - -export function ThemeSwitch({ size = "md", isChecked, onChange, isDisabled, ...props }: ThemeSwitchProps) { - const { getActiveColor } = useThemeColor(); - - const defaultTrackColor = useColorModeValue("gray.200", "gray.600"); - const primaryColor = getActiveColor(); - - return ( - span": { - bg: isChecked ? primaryColor : defaultTrackColor, - }, - "& > span > span": { - bg: "white", - }, - "&:hover > span": { - bg: isChecked ? primaryColor : defaultTrackColor, - }, - }} - {...props} - /> - ); -} diff --git a/参考/NexBox-main/src/components/special/view-grid.tsx b/参考/NexBox-main/src/components/special/view-grid.tsx deleted file mode 100644 index 2908e9f..0000000 --- a/参考/NexBox-main/src/components/special/view-grid.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import { - Box, - SimpleGrid, - VStack, - Text, - useColorModeValue, -} from "@chakra-ui/react"; -import { Link } from "react-router-dom"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "./liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { hexToRgba } from "@/lib/color-utils"; -import type { ViewItem } from "./view-types"; - -interface ViewGridProps { - tools: ViewItem[]; -} - -function GridCard({ tool }: { tool: ViewItem }) { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - const { config } = useThemeColor(); - const headingColor = useColorModeValue("gray.900", "#ffffff"); - const cardBg = useColorModeValue("white", "#111111"); - const cardBorder = useColorModeValue("gray.200", "#333333"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const IconComponent = tool.icon; - const isDark = useColorModeValue(false, true); - const hoverBg = useColorModeValue("gray.50", "#1a1a1a"); - - const cardContent = ( - <> - {tool.beta && ( - - BETA - - )} - - - - - - - {t(tool.titleKey)} - - - {t(tool.descriptionKey)} - - - - - ); - - if (liquidGlassEnabled) { - return ( - - - {cardContent} - - - ); - } - - return ( - - - {cardContent} - - - ); -} - -export function ViewGrid({ tools }: ViewGridProps) { - return ( - - {tools.map((tool) => ( - - ))} - - ); -} diff --git a/参考/NexBox-main/src/components/special/view-list.tsx b/参考/NexBox-main/src/components/special/view-list.tsx deleted file mode 100644 index a60558b..0000000 --- a/参考/NexBox-main/src/components/special/view-list.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import { - Box, - VStack, - HStack, - Text, - useColorModeValue, -} from "@chakra-ui/react"; -import { ChevronRight } from "lucide-react"; -import { Link } from "react-router-dom"; -import { useTranslation } from "react-i18next"; -import { LiquidGlassCard } from "./liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { hexToRgba } from "@/lib/color-utils"; -import type { ViewItem } from "./view-types"; - -interface ViewListProps { - tools: ViewItem[]; -} - -export function ViewList({ tools }: ViewListProps) { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - const { config } = useThemeColor(); - const headingColor = useColorModeValue("gray.900", "#ffffff"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const listBg = useColorModeValue("white", "#111111"); - const listBorder = useColorModeValue("gray.200", "#333333"); - const hoverBg = useColorModeValue("gray.50", "#1a1a1a"); - const isDark = useColorModeValue(false, true); - - const listCardContent = (tool: ViewItem) => { - const IconComponent = tool.icon; - return ( - <> - {tool.beta && ( - - BETA - - )} - - - - - - - {t(tool.titleKey)} - - - {t(tool.descriptionKey)} - - - - - - ); - }; - - return ( - - {tools.map((tool) => ( - - {liquidGlassEnabled ? ( - - {listCardContent(tool)} - - ) : ( - - {listCardContent(tool)} - - )} - - ))} - - ); -} diff --git a/参考/NexBox-main/src/components/special/view-types.ts b/参考/NexBox-main/src/components/special/view-types.ts deleted file mode 100644 index 4e04441..0000000 --- a/参考/NexBox-main/src/components/special/view-types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ComponentType } from "react"; - -export interface ViewItem { - id: string; - path: string; - icon: ComponentType<{ size?: number; strokeWidth?: number; color?: string }>; - titleKey: string; - descriptionKey: string; - color: string; - beta?: boolean; -} diff --git a/参考/NexBox-main/src/components/ui/animated-page.tsx b/参考/NexBox-main/src/components/ui/animated-page.tsx deleted file mode 100644 index 73cc424..0000000 --- a/参考/NexBox-main/src/components/ui/animated-page.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { motion, Transition, Variants } from "framer-motion"; -import { ReactNode, useEffect, useState } from "react"; - -interface AnimatedPageProps { - children: ReactNode; -} - -export type TransitionMode = "slide" | "fade" | "off"; - -const STORAGE_KEY = "nexbox_page_transition"; -const OLD_STORAGE_KEY = "nexbox_page_transition_enabled"; -const EVENT_NAME = "page-transition-setting-changed"; - -export const slideVariants: Variants = { - initial: { opacity: 0, x: 20 }, - enter: { opacity: 1, x: 0, transition: { duration: 0.3, ease: "easeOut" } }, - exit: { opacity: 0, x: -20, transition: { duration: 0.3, ease: "easeIn" } }, -}; - -export const fadeVariants: Variants = { - initial: { opacity: 0 }, - enter: { opacity: 1, transition: { duration: 0.3, ease: "easeOut" } }, - exit: { opacity: 0, transition: { duration: 0.2, ease: "easeIn" } }, -}; - -export const slideTransition: Transition = { - type: "tween", - ease: "easeOut", - duration: 0.3, -}; - -export const fadeTransition: Transition = { - type: "tween", - ease: "easeOut", - duration: 0.3, -}; - -export function getVariants(mode: TransitionMode): Variants { - switch (mode) { - case "fade": - return fadeVariants; - case "slide": - default: - return slideVariants; - } -} - -export function getTransitionConfig(mode: TransitionMode): Transition { - switch (mode) { - case "fade": - return fadeTransition; - case "slide": - default: - return slideTransition; - } -} - -export function readTransitionMode(): TransitionMode { - // migrate old key - const oldVal = localStorage.getItem(OLD_STORAGE_KEY); - if (oldVal !== null) { - localStorage.removeItem(OLD_STORAGE_KEY); - const mode: TransitionMode = oldVal === "true" ? "slide" : "off"; - localStorage.setItem(STORAGE_KEY, mode); - return mode; - } - return (localStorage.getItem(STORAGE_KEY) as TransitionMode) || "fade"; -} - -export function useTransitionMode(): TransitionMode { - const [mode, setMode] = useState(readTransitionMode); - - useEffect(() => { - const handler = () => setMode(readTransitionMode()); - window.addEventListener(EVENT_NAME, handler); - return () => window.removeEventListener(EVENT_NAME, handler); - }, []); - - return mode; -} - -export function AnimatedPage({ children }: AnimatedPageProps) { - const mode = useTransitionMode(); - - if (mode === "off") { - return
{children}
; - } - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/components/ui/border-beam.tsx b/参考/NexBox-main/src/components/ui/border-beam.tsx deleted file mode 100644 index 8730d30..0000000 --- a/参考/NexBox-main/src/components/ui/border-beam.tsx +++ /dev/null @@ -1,40 +0,0 @@ -"use client"; - -import { Box } from "@chakra-ui/react"; - -interface BorderBeamProps { - children: React.ReactNode; -} - -export function BorderBeam({ children }: BorderBeamProps) { - return ( - - {children} - - ); -} \ No newline at end of file diff --git a/参考/NexBox-main/src/components/ui/global-search.tsx b/参考/NexBox-main/src/components/ui/global-search.tsx deleted file mode 100644 index 60a7ab6..0000000 --- a/参考/NexBox-main/src/components/ui/global-search.tsx +++ /dev/null @@ -1,373 +0,0 @@ -import { - Box, - Input, - InputGroup, - InputLeftElement, - VStack, - Text, - HStack, - Icon, - useColorModeValue, - Kbd, - Image, -} from "@chakra-ui/react"; -import { Search, Home, Cpu, Wrench, Package, Crosshair, TrendingUp, Heart, Settings } from "lucide-react"; -import { useState, useEffect, useRef, useCallback, useMemo } from "react"; -import { useNavigate } from "react-router-dom"; -import { useTranslation } from "react-i18next"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { useAppStartup } from "@/contexts/app-startup-context"; -import { - searchIndex, - categoryLabels, - categoryOrder, - getThirdPartyToolIcon, - type SearchItem, - type SearchCategory, -} from "@/config/search-index"; -import { invoke } from "@tauri-apps/api/core"; -import { useToast } from "@chakra-ui/react"; - -interface GroupedResults { - [key: string]: SearchItem[]; -} - -function matchSearch(query: string, item: SearchItem, t: (key: string) => string): boolean { - const lowerQuery = query.toLowerCase(); - const name = t(item.nameKey).toLowerCase(); - const keywords = item.keywords?.map((k) => k.toLowerCase()) || []; - - if (name.includes(lowerQuery)) return true; - - for (const keyword of keywords) { - if (keyword.includes(lowerQuery)) return true; - } - - return false; -} - -export function GlobalSearch() { - const { t } = useTranslation(); - const navigate = useNavigate(); - const toast = useToast(); - const { liquidGlassEnabled, liquidGlassBlur } = useBackground(); - const { getActiveColor, getHoverColor, getContrastTextColor } = useThemeColor(); - const { tools } = useAppStartup(); - - const [isOpen, setIsOpen] = useState(false); - const [query, setQuery] = useState(""); - const [debouncedQuery, setDebouncedQuery] = useState(""); - const [results, setResults] = useState({}); - const [selectedIndex, setSelectedIndex] = useState(0); - const [flatResults, setFlatResults] = useState([]); - - const inputRef = useRef(null); - const containerRef = useRef(null); - const debounceTimerRef = useRef(null); - - const activeBg = getActiveColor(); - const activeIconColor = getContrastTextColor(); - - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - - const inputBg = useColorModeValue( - liquidGlassEnabled ? "rgba(255,255,255,0.25)" : "rgba(255,255,255,0.9)", - liquidGlassEnabled ? "rgba(0,0,0,0.25)" : "rgba(17,17,17,0.95)" - ); - const inputBorderColor = useColorModeValue( - liquidGlassEnabled ? "rgba(255,255,255,0.2)" : "rgba(200,200,200,0.3)", - liquidGlassEnabled ? "rgba(255,255,255,0.1)" : "rgba(51,51,51,0.5)" - ); - const textColor = useColorModeValue("gray.700", "gray.200"); - const placeholderColor = useColorModeValue("gray.500", "gray.400"); - const resultItemBg = useColorModeValue("gray.50", "gray.800"); - const resultItemHoverBg = useColorModeValue("gray.100", "gray.700"); - const categoryColor = useColorModeValue("gray.500", "gray.400"); - const noResultColor = useColorModeValue("gray.400", "gray.500"); - - useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "k") { - e.preventDefault(); - setIsOpen(true); - setTimeout(() => inputRef.current?.focus(), 0); - } - if (e.key === "Escape") { - setIsOpen(false); - setQuery(""); - } - }; - - window.addEventListener("keydown", handleKeyDown); - return () => window.removeEventListener("keydown", handleKeyDown); - }, []); - - useEffect(() => { - const handleClickOutside = (e: MouseEvent) => { - if (containerRef.current && !containerRef.current.contains(e.target as Node)) { - setIsOpen(false); - setQuery(""); - } - }; - - document.addEventListener("mousedown", handleClickOutside); - return () => document.removeEventListener("mousedown", handleClickOutside); - }, []); - - useEffect(() => { - if (debounceTimerRef.current) { - clearTimeout(debounceTimerRef.current); - } - - debounceTimerRef.current = setTimeout(() => { - setDebouncedQuery(query); - }, 150); - - return () => { - if (debounceTimerRef.current) { - clearTimeout(debounceTimerRef.current); - } - }; - }, [query]); - - const allSearchItems = useMemo(() => { - const items: SearchItem[] = [...searchIndex]; - - tools.forEach((tool) => { - items.push({ - id: tool.id, - nameKey: `tools.tools.${tool.id}`, - path: "/tools", - icon: getThirdPartyToolIcon(tool.id), - category: "thirdparty-tool", - keywords: [tool.name, tool.description, tool.category], - action: "run-tool", - toolId: tool.id, - }); - }); - - return items; - }, [tools]); - - useEffect(() => { - if (!debouncedQuery.trim()) { - setResults({}); - setFlatResults([]); - setSelectedIndex(0); - return; - } - - const matched = allSearchItems.filter((item) => matchSearch(debouncedQuery, item, t)); - - const grouped: GroupedResults = {}; - categoryOrder.forEach((cat) => { - grouped[cat] = []; - }); - - matched.forEach((item) => { - if (grouped[item.category]) { - grouped[item.category].push(item); - } - }); - - Object.keys(grouped).forEach((key) => { - if (grouped[key].length === 0) { - delete grouped[key]; - } - }); - - setResults(grouped); - - const flat: SearchItem[] = []; - categoryOrder.forEach((cat) => { - if (grouped[cat]) { - flat.push(...grouped[cat]); - } - }); - setFlatResults(flat); - setSelectedIndex(0); - }, [debouncedQuery, t, allSearchItems]); - - const handleSelect = useCallback( - async (item: SearchItem) => { - if (item.action === "run-tool" && item.toolId) { - try { - await invoke("run_tool", { toolId: item.toolId }); - } catch (error) { - toast({ - title: t("tools.messages.runFailed"), - description: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - } else { - navigate(item.path); - } - setIsOpen(false); - setQuery(""); - }, - [navigate, toast, t] - ); - - const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "ArrowDown") { - e.preventDefault(); - setSelectedIndex((prev) => (prev < flatResults.length - 1 ? prev + 1 : prev)); - } else if (e.key === "ArrowUp") { - e.preventDefault(); - setSelectedIndex((prev) => (prev > 0 ? prev - 1 : 0)); - } else if (e.key === "Enter" && flatResults[selectedIndex]) { - e.preventDefault(); - handleSelect(flatResults[selectedIndex]); - } - }; - - const totalResults = flatResults.length; - - return ( - - - - - - setQuery(e.target.value)} - onFocus={() => setIsOpen(true)} - onKeyDown={handleKeyDown} - bg={inputBg} - borderColor={inputBorderColor} - color={textColor} - borderRadius="lg" - _placeholder={{ color: placeholderColor }} - _focus={{ - borderColor: activeBg, - boxShadow: `0 0 0 1px ${activeBg}`, - }} - backdropFilter={`blur(${effectiveBlur}px)`} - sx={{ - transform: "translateZ(0)", - WebkitTransform: "translateZ(0)", - willChange: "auto", - transition: "backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1)", - }} - pr="60px" - /> - {!isOpen && ( - - - - Ctrl - - - K - - - - )} - - - {isOpen && ( - - {totalResults === 0 ? ( - - {query.trim() ? t("search.noResults") : t("search.typeToSearch") || "输入关键词搜索..."} - - ) : ( - - {categoryOrder.map((category) => { - const items = results[category]; - if (!items || items.length === 0) return null; - - return ( - - - {t(categoryLabels[category])} - - {items.map((item) => { - const globalIndex = flatResults.indexOf(item); - const isSelected = globalIndex === selectedIndex; - - return ( - setSelectedIndex(globalIndex)} - onClick={() => handleSelect(item)} - transition="all 0.15s" - _hover={{ - bg: isSelected ? activeBg : resultItemHoverBg, - }} - > - - - - {t(item.nameKey)} - - - - ); - })} - - ); - })} - - )} - - )} - - ); -} diff --git a/参考/NexBox-main/src/components/ui/main-layout.tsx b/参考/NexBox-main/src/components/ui/main-layout.tsx deleted file mode 100644 index 21dda45..0000000 --- a/参考/NexBox-main/src/components/ui/main-layout.tsx +++ /dev/null @@ -1,278 +0,0 @@ -"use client"; - -import { Box, useColorModeValue } from "@chakra-ui/react"; -import { ReactNode, useEffect, useRef, useState, useMemo } from "react"; -import { useLocation } from "react-router-dom"; -import { Sidebar } from "./sidebar"; -import { TitleBar } from "./title-bar"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { convertFileSrc } from "@tauri-apps/api/core"; - -function useNavPosition() { - const [navPosition, setNavPosition] = useState<"left" | "top">(() => { - const saved = localStorage.getItem("nexbox_nav_position"); - return saved === "top" ? "top" : "left"; - }); - - useEffect(() => { - const handler = (e: CustomEvent) => { - setNavPosition(e.detail === "top" ? "top" : "left"); - }; - window.addEventListener("nav-position-changed", handler as EventListener); - return () => { - window.removeEventListener("nav-position-changed", handler as EventListener); - }; - }, []); - - return navPosition; -} - -interface MainLayoutProps { - children: ReactNode; -} - -export function MainLayout({ children }: MainLayoutProps) { - const bgColor = useColorModeValue("#fafafa", "#0a0a0a"); - const { backgroundMode, customBgImages, activeBgIndex, dynamicBgVideo, activePresetIndex, presetBackgrounds, backgroundBlur, jellyBounceEnabled } = useBackground(); - const { config } = useThemeColor(); - const navPosition = useNavPosition(); - const location = useLocation(); - const videoRef = useRef(null); - const [videoReady, setVideoReady] = useState(false); - const idCounter = useRef(0); - - const activeImage = customBgImages[activeBgIndex]; - const activePreset = presetBackgrounds[activePresetIndex]; - const showImageBg = backgroundMode === "image" && activeImage; - const showDynamicBg = backgroundMode === "dynamic" && dynamicBgVideo; - const showPresetBg = backgroundMode === "preset" && activePreset; - const videoSrc = useMemo(() => { - if (!dynamicBgVideo) return null; - return convertFileSrc(dynamicBgVideo); - }, [dynamicBgVideo]); - - // 背景交叉淡化 - interface BgLayer { - url: string; - id: number; - fading: boolean; - } - const [bgLayers, setBgLayers] = useState([]); - - useEffect(() => { - const src = showPresetBg - ? activePreset?.path ?? null - : showImageBg - ? activeImage - : null; - - if (!src) { - setBgLayers([]); - return; - } - - const newId = ++idCounter.current; - - setBgLayers((prev) => [ - ...prev.map((l) => ({ ...l, fading: true })), - { url: src, id: newId, fading: false }, - ]); - - // 动画完成后移除旧的图层 - const timer = setTimeout(() => { - setBgLayers((prev) => prev.filter((l) => l.id === newId)); - }, 600); - - return () => clearTimeout(timer); - }, [showPresetBg, activePresetIndex, showImageBg, activeBgIndex, activeImage, activePreset]); - - useEffect(() => { - if (!dynamicBgVideo) { - setVideoReady(false); - } else { - setVideoReady(false); - }; - }, [dynamicBgVideo]); - - useEffect(() => { - let bgColorToUse = bgColor; - - if (showImageBg || showPresetBg || showDynamicBg) { - bgColorToUse = "transparent"; - } - - document.body.style.backgroundColor = bgColorToUse; - - return () => { - document.body.style.backgroundColor = ""; - }; - }, [showImageBg, showDynamicBg, showPresetBg, bgColor]); - - useEffect(() => { - if (videoRef.current && dynamicBgVideo) { - videoRef.current.play().catch(() => {}); - } - }, [dynamicBgVideo, showDynamicBg]); - - // 顶部导航栏模式下,body 不滚动,内容区域自行管理滚动 - useEffect(() => { - if (navPosition === "top") { - document.body.style.overflow = "hidden"; - } else { - document.body.style.overflow = ""; - } - return () => { - document.body.style.overflow = ""; - }; - }, [navPosition]); - - // 果冻弹跳效果开关:在 body 上添加/移除 class,供全局 CSS 使用 - useEffect(() => { - if (jellyBounceEnabled) { - document.body.classList.add("jelly-bounce-enabled"); - } else { - document.body.classList.remove("jelly-bounce-enabled"); - document.body.classList.remove("jelly-bounce-active"); - } - return () => { - document.body.classList.remove("jelly-bounce-enabled"); - document.body.classList.remove("jelly-bounce-active"); - }; - }, [jellyBounceEnabled]); - - // 路由切换时触发果冻弹跳动画:在 body 添加 .jelly-bounce-active, - // 所有带 jelly-bounce-* className 的元素会播放动画。动画时长后移除 class。 - // 这样异步加载的内容(如三角洲改枪码列表)不会在挂载时触发动画,避免布局跳动。 - useEffect(() => { - if (!jellyBounceEnabled) return; - // 移除再添加以重新触发 CSS animation - document.body.classList.remove("jelly-bounce-active"); - void document.body.offsetWidth; // 强制 reflow - document.body.classList.add("jelly-bounce-active"); - const timer = setTimeout(() => { - document.body.classList.remove("jelly-bounce-active"); - }, 700); - return () => { - clearTimeout(timer); - document.body.classList.remove("jelly-bounce-active"); - }; - }, [location.pathname, jellyBounceEnabled]); - - const isNavTop = navPosition === "top"; - - return ( - - {/* 背景交叉淡化层:用 而非 CSS background-image, - 原因:CSS value 有约 2MB 上限,大图 data URL 会被截断导致黑色 */} - - {bgLayers.map((layer) => ( - - 0 ? `blur(${backgroundBlur}px)` : undefined, - willChange: backgroundBlur > 0 ? "filter" : undefined, - }} - /> - - ))} - - {showDynamicBg && ( - - - )} - - - - - {children} - - - - ); -} diff --git a/参考/NexBox-main/src/components/ui/sidebar.tsx b/参考/NexBox-main/src/components/ui/sidebar.tsx deleted file mode 100644 index 0b19602..0000000 --- a/参考/NexBox-main/src/components/ui/sidebar.tsx +++ /dev/null @@ -1,415 +0,0 @@ -import { Box as ChakraBox, Flex, IconButton, Text, useColorModeValue, Badge, Image } from "@chakra-ui/react"; -import { Home, Wrench, Settings, Cpu, TrendingUp, Heart, Package, Music } from "lucide-react"; -import { Link, useLocation } from "react-router-dom"; -import { useTranslation } from "react-i18next"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { getBorderGlowStyle } from "@/hooks/use-glow-effect"; -import { useLiquidGlassRefraction } from "@/components/special/liquid-glass-svg-filter"; -import deltaForceIcon from "@/assets/deltaforce.png"; -import epicGamesIcon from "@/assets/epic-games.png"; -import { useState, useEffect, useRef, useCallback } from "react"; - -interface NavItem { - path: string; - icon: React.ComponentType<{ size?: number; strokeWidth?: number }> | null; - customIcon?: string; - ariaLabel: string; - beta?: boolean; -} - -function NavButton({ item, isActive, activeBg, hoverBg, iconColor, activeIconColor, showLabel }: { - item: NavItem; - isActive: boolean; - activeBg: string; - hoverBg: string; - iconColor: string; - activeIconColor: string; - showLabel: boolean; -}) { - const isCustom = !!item.customIcon; - const { getActiveColor } = useThemeColor(); - const activeColor = getActiveColor(); - const [bursts, setBursts] = useState>([]); - const nextId = useRef(0); - - const handleBurst = useCallback((e: React.MouseEvent) => { - const rect = e.currentTarget.getBoundingClientRect(); - const x = e.clientX - rect.left; - const y = e.clientY - rect.top; - const id = nextId.current++; - setBursts(prev => [...prev, { id, x, y }]); - setTimeout(() => { - setBursts(prev => prev.filter(b => b.id !== id)); - }, 450); - }, []); - - const iconElement = isCustom ? ( - {item.ariaLabel} - ) : ( - - ); - - return ( - - - {showLabel ? ( - - - {iconElement} - - - {item.ariaLabel} - - {bursts.map(b => ( - - ))} - - ) : ( - - - - - {bursts.map(b => ( - - ))} - - )} - {!showLabel && item.beta && ( - - BETA - - )} - - - ); -} - -export function Sidebar() { - const location = useLocation(); - const { t } = useTranslation(); - const { liquidGlassEnabled, liquidGlassBlur, liquidGlassMode, jellyBounceEnabled } = useBackground(); - const { getActiveColor, getHoverColor, getContrastTextColor } = useThemeColor(); - const { svgSupported } = useLiquidGlassRefraction(liquidGlassEnabled && liquidGlassMode === "real"); - const [showLabel, setShowLabel] = useState(() => { - return localStorage.getItem("nexbox_sidebar_show_label") === "true"; - }); - const [navPosition, setNavPosition] = useState<"left" | "top">(() => { - const saved = localStorage.getItem("nexbox_nav_position"); - return saved === "top" ? "top" : "left"; - }); - - // 果冻弹跳效果:当导航栏状态切换(位置/标签/可见性)时触发 - const sidebarContentRef = useRef(null); - const sidebarContainerRef = useRef(null); - const isFirstRender = useRef(true); - - const triggerJellyBounce = useCallback(() => { - if (!jellyBounceEnabled) return; - // 触发内容区弹跳 - const contentEl = sidebarContentRef.current; - if (contentEl) { - contentEl.classList.remove("jelly-bouncing"); - void contentEl.offsetWidth; - contentEl.classList.add("jelly-bouncing"); - } - // 触发外层容器弹跳 - const containerEl = sidebarContainerRef.current; - if (containerEl) { - containerEl.classList.remove("jelly-bouncing"); - void containerEl.offsetWidth; - containerEl.classList.add("jelly-bouncing"); - } - }, [jellyBounceEnabled]); - - useEffect(() => { - const handler = (e: CustomEvent) => { - setShowLabel(e.detail === true); - }; - window.addEventListener("sidebar-show-label-changed", handler as EventListener); - return () => { - window.removeEventListener("sidebar-show-label-changed", handler as EventListener); - }; - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => { - const val = e.detail; - setNavPosition(val === "top" ? "top" : "left"); - }; - window.addEventListener("nav-position-changed", handler as EventListener); - return () => { - window.removeEventListener("nav-position-changed", handler as EventListener); - }; - }, []); - - const isTop = navPosition === "top"; - - const hideableNavPaths = ["/hardware", "/tools", "/builtin-tools", "/optimization", "/music", "/delta-force", "/epic-free", "/mood"]; - const getNavStorageKey = (path: string) => `nexbox_nav_visible_${path.replace(/\//g, "").replace(/-/g, "_")}`; - - const [navVisibility, setNavVisibility] = useState>(() => { - const initial: Record = {}; - for (const path of hideableNavPaths) { - initial[path] = localStorage.getItem(getNavStorageKey(path)) !== "false"; - } - return initial; - }); - - useEffect(() => { - const handler = (e: CustomEvent) => { - const { path, visible } = e.detail || {}; - if (path) { - setNavVisibility(prev => ({ ...prev, [path]: visible })); - } - }; - window.addEventListener("nav-visibility-changed", handler as EventListener); - return () => { window.removeEventListener("nav-visibility-changed", handler as EventListener); }; - }, []); - - // 监听导航栏状态变化/页面切换,触发果冻弹跳动画(跳过初次渲染) - const navVisibilityKey = JSON.stringify(navVisibility); - useEffect(() => { - if (isFirstRender.current) { - return; - } - triggerJellyBounce(); - }, [navPosition, showLabel, navVisibilityKey, location.pathname, triggerJellyBounce]); - - useEffect(() => { - isFirstRender.current = false; - }, []); - - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (typeof document === "undefined") return; - const styleId = "nav-burst-keyframes"; - if (document.getElementById(styleId)) return; - const style = document.createElement("style"); - style.id = styleId; - style.textContent = `@keyframes navBurstGrow{from{transform:scale(0);opacity:0.8}to{transform:scale(3.5);opacity:0}}`; - document.head.appendChild(style); - }, []); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - const isReal = liquidGlassEnabled && liquidGlassMode === "real"; - const backdropFilter = isReal - ? (svgSupported - ? `url(#nexbox-liquid-glass-filter) saturate(1.4)` - : `saturate(1.4) brightness(1.05)`) - : `blur(${effectiveBlur}px)`; - - const defaultBgColor = useColorModeValue("rgba(255,255,255,0.9)", "rgba(17,17,17,0.95)"); - const glassBgColor = useColorModeValue("rgba(255,255,255,0.25)", "rgba(0,0,0,0.25)"); - const defaultBorderColor = useColorModeValue("rgba(200,200,200,0.3)", "rgba(51,51,51,0.5)"); - const glassBorderColor = useColorModeValue("rgba(255,255,255,0.2)", "rgba(255,255,255,0.1)"); - const glowColor = useColorModeValue("rgba(255,255,255,0.8)", "rgba(255,255,255,0.5)"); - - const iconColor = useColorModeValue("rgba(0,0,0,0.75)", "rgba(255,255,255,0.8)"); - - const activeBg = getActiveColor(); - const hoverBg = getHoverColor(true); - const activeIconColor = getContrastTextColor(); - - const navItems: NavItem[] = [ - { path: "/", icon: Home, ariaLabel: t("sidebar.home") }, - { path: "/hardware", icon: Cpu, ariaLabel: t("sidebar.hardware") }, - { path: "/tools", icon: Wrench, ariaLabel: t("sidebar.tools") }, - { path: "/builtin-tools", icon: Package, ariaLabel: t("sidebar.builtinTools") }, - { path: "/optimization", icon: TrendingUp, ariaLabel: t("sidebar.optimization") }, - { path: "/music", icon: Music, ariaLabel: t("sidebar.music") }, - { path: "/delta-force", icon: null, customIcon: deltaForceIcon, ariaLabel: t("sidebar.deltaForce") }, - { path: "/epic-free", icon: null, customIcon: epicGamesIcon, ariaLabel: t("sidebar.epicFree") }, - { path: "/mood", icon: Heart, ariaLabel: t("sidebar.mood") }, - { path: "/settings", icon: Settings, ariaLabel: t("sidebar.settings") }, - ]; - - const sidebarContent = ( - { - if (e.animationName === "jellyBounce") { - sidebarContentRef.current?.classList.remove("jelly-bouncing"); - } - }} - > - {navItems.filter(item => { - if (item.path === "/" || item.path === "/settings") return true; - return navVisibility[item.path] !== false; - }).map((item) => ( - - ))} - - ); - - const containerTransition = "max-width 0.25s cubic-bezier(0.95, 0, 1, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1), top 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1)"; - - const leftContainerStyles = { - position: "fixed" as const, - left: 6, - top: "50%", - transform: "translateY(-50%) translateZ(0)", - zIndex: 40, - borderRadius: "2xl", - boxShadow: "2xl", - py: 6, - px: 2, - maxWidth: "64px", - transition: containerTransition, - sx: { WebkitBackfaceVisibility: "hidden" as const, backfaceVisibility: "hidden" as const }, - }; - - const topContainerStyles = { - position: "fixed" as const, - top: "54px", - left: "50%", - transform: "translateX(-50%) translateZ(0)", - zIndex: 40, - borderRadius: "2xl", - boxShadow: "2xl", - py: 2, - px: 3, - maxWidth: "2000px", - width: "max-content", - transition: containerTransition, - sx: { WebkitBackfaceVisibility: "hidden" as const, backfaceVisibility: "hidden" as const }, - }; - - const containerStyles = isTop ? topContainerStyles : leftContainerStyles; - - return ( - { - const name = e.animationName; - if (name === "jellyBounceSidebarLeft" || name === "jellyBounceSidebarTop") { - sidebarContainerRef.current?.classList.remove("jelly-bouncing"); - } - }} - > - {!isReal && ( - - )} - {sidebarContent} - - ); -} diff --git a/参考/NexBox-main/src/components/ui/title-bar.tsx b/参考/NexBox-main/src/components/ui/title-bar.tsx deleted file mode 100644 index 3992862..0000000 --- a/参考/NexBox-main/src/components/ui/title-bar.tsx +++ /dev/null @@ -1,183 +0,0 @@ -"use client"; - -import { Box, Flex, HStack, IconButton, Image, useColorModeValue } from "@chakra-ui/react"; -import { getCurrentWindow } from "@tauri-apps/api/window"; -import { invoke } from "@tauri-apps/api/core"; -import { LuMinus, LuX } from "react-icons/lu"; -import { useCallback, useState, useEffect } from "react"; -import { GlobalSearch } from "./global-search"; -import { CloseConfirmDialog } from "../CloseConfirmDialog"; - -export function TitleBar() { - const iconColor = useColorModeValue("gray.600", "gray.400"); - const hoverColor = useColorModeValue("gray.800", "gray.200"); - const closeHoverColor = useColorModeValue("red.600", "red.400"); - const minimizeHoverBg = useColorModeValue("gray.100", "gray.700"); - const closeHoverBg = useColorModeValue("red.50", "red.900"); - const bgColor = useColorModeValue("whiteAlpha.800", "blackAlpha.800"); - const logoSrc = useColorModeValue("/logo/NexBoxW.png", "/logo/NexBoxB.png"); - - const [showCloseDialog, setShowCloseDialog] = useState(false); - const [searchBarVisible, setSearchBarVisible] = useState(() => { - const saved = localStorage.getItem("nexbox_search_bar_enabled"); - return saved === null ? true : saved === "true"; - }); - - const [navPosition, setNavPosition] = useState<"left" | "top">(() => { - const saved = localStorage.getItem("nexbox_nav_position"); - return saved === "top" ? "top" : "left"; - }); - - useEffect(() => { - const handler = (e: CustomEvent) => { - setNavPosition(e.detail === "top" ? "top" : "left"); - }; - window.addEventListener("nav-position-changed", handler as EventListener); - return () => { - window.removeEventListener("nav-position-changed", handler as EventListener); - }; - }, []); - - useEffect(() => { - const handler = (e: CustomEvent) => { - setSearchBarVisible(!!e.detail); - }; - window.addEventListener("search-bar-setting-changed", handler as EventListener); - return () => { - window.removeEventListener("search-bar-setting-changed", handler as EventListener); - }; - }, []); - - const getCloseBehavior = useCallback(() => { - return localStorage.getItem("nexbox_close_behavior") || "ask"; - }, []); - - const handleMouseDown = useCallback(async (e: React.MouseEvent) => { - const target = e.target as HTMLElement; - if (target.closest("button") || target.closest("input") || target.closest('[role="search"]')) { - return; - } - try { - const appWindow = getCurrentWindow(); - await appWindow.startDragging(); - } catch (error) { - console.error("Failed to start dragging:", error); - } - }, []); - - const handleMinimize = async () => { - try { - const appWindow = getCurrentWindow(); - await appWindow.minimize(); - } catch (error) { - console.error("Failed to minimize window:", error); - } - }; - - const handleClose = async () => { - const behavior = getCloseBehavior(); - switch (behavior) { - case "close": - await performClose(); - break; - case "minimize": - await performMinimizeToTray(); - break; - case "ask": - default: - setShowCloseDialog(true); - break; - } - }; - - const performMinimizeToTray = async (savePreference: boolean = false) => { - if (savePreference) { - localStorage.setItem("nexbox_close_behavior", "minimize"); - } - try { - await invoke("minimize_to_tray"); - } catch (error) { - console.error("Failed to minimize to tray:", error); - } - setShowCloseDialog(false); - }; - - const performClose = async (savePreference: boolean = false) => { - if (savePreference) { - localStorage.setItem("nexbox_close_behavior", "close"); - } - try { - await invoke("exit_app"); - } catch (error) { - console.error("Failed to exit app:", error); - } - setShowCloseDialog(false); - }; - - return ( - <> - - - e.stopPropagation()} - > - {searchBarVisible && } - - - } - aria-label="最小化" - variant="solid" - borderRadius="full" - bg={bgColor} - backdropFilter="blur(10px)" - color={iconColor} - h="36px" - minW="36px" - w="36px" - _hover={{ - color: hoverColor, - bg: minimizeHoverBg, - }} - onClick={handleMinimize} - /> - } - aria-label="关闭" - variant="solid" - borderRadius="full" - bg={bgColor} - backdropFilter="blur(10px)" - color={iconColor} - h="36px" - minW="36px" - w="36px" - _hover={{ - color: closeHoverColor, - bg: closeHoverBg, - }} - onClick={handleClose} - /> - - - - - setShowCloseDialog(false)} - onCloseApp={(savePreference) => performClose(savePreference)} - onMinimizeToTray={(savePreference) => performMinimizeToTray(savePreference)} - /> - - ); -} diff --git a/参考/NexBox-main/src/components/webview-restrictions.tsx b/参考/NexBox-main/src/components/webview-restrictions.tsx deleted file mode 100644 index 8e1bde9..0000000 --- a/参考/NexBox-main/src/components/webview-restrictions.tsx +++ /dev/null @@ -1,89 +0,0 @@ -"use client"; - -import { useEffect } from "react"; - -export function WebviewRestrictions() { - useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === "F5" || (e.ctrlKey && e.key === "r") || (e.metaKey && e.key === "r")) { - e.preventDefault(); - e.stopPropagation(); - return false; - } - - if (e.key === "F12") { - e.preventDefault(); - e.stopPropagation(); - return false; - } - - if (e.ctrlKey && e.shiftKey && (e.key === "I" || e.key === "i")) { - e.preventDefault(); - e.stopPropagation(); - return false; - } - - if (e.ctrlKey && e.shiftKey && (e.key === "C" || e.key === "c")) { - e.preventDefault(); - e.stopPropagation(); - return false; - } - - if (e.ctrlKey && e.shiftKey && (e.key === "J" || e.key === "j")) { - e.preventDefault(); - e.stopPropagation(); - return false; - } - }; - - const handleContextMenu = (e: MouseEvent) => { - e.preventDefault(); - e.stopPropagation(); - return false; - }; - - const handleSelectStart = (e: Event) => { - const target = e.target as HTMLElement; - if (target.tagName === "INPUT" || target.tagName === "TEXTAREA") { - return true; - } - e.preventDefault(); - e.stopPropagation(); - return false; - }; - - const handleDragStart = (e: DragEvent) => { - const target = e.target as HTMLElement; - if (target.tagName === "IMG") { - e.preventDefault(); - e.stopPropagation(); - return false; - } - }; - - const handleDrop = (e: DragEvent) => { - e.preventDefault(); - e.stopPropagation(); - return false; - }; - - document.addEventListener("keydown", handleKeyDown, true); - document.addEventListener("contextmenu", handleContextMenu, true); - document.addEventListener("selectstart", handleSelectStart, true); - document.addEventListener("dragstart", handleDragStart, true); - document.addEventListener("drop", handleDrop, true); - - document.body.style.userSelect = "none"; - document.body.style.webkitUserSelect = "none"; - - return () => { - document.removeEventListener("keydown", handleKeyDown, true); - document.removeEventListener("contextmenu", handleContextMenu, true); - document.removeEventListener("selectstart", handleSelectStart, true); - document.removeEventListener("dragstart", handleDragStart, true); - document.removeEventListener("drop", handleDrop, true); - }; - }, []); - - return null; -} diff --git a/参考/NexBox-main/src/config/network-optimizer.ts b/参考/NexBox-main/src/config/network-optimizer.ts deleted file mode 100644 index cbdb54b..0000000 --- a/参考/NexBox-main/src/config/network-optimizer.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { ComponentType } from "react"; -import { Globe, Network, Zap } from "lucide-react"; - -export interface DnsPreset { - id: string; - name: string; - primary: string; - secondary: string; - iconColor: string; -} - -export const dnsPresets: DnsPreset[] = [ - { id: "alidns", name: "阿里 DNS", primary: "223.5.5.5", secondary: "223.6.6.6", iconColor: "#FF6A00" }, - { id: "dnspod", name: "DNSPod", primary: "119.29.29.29", secondary: "119.28.28.28", iconColor: "#007FFF" }, - { id: "114dns", name: "114 DNS", primary: "114.114.114.114", secondary: "114.114.115.115", iconColor: "#3182CE" }, - { id: "baidu", name: "百度 DNS", primary: "180.76.76.76", secondary: "", iconColor: "#DE2910" }, - { id: "google", name: "Google DNS", primary: "8.8.8.8", secondary: "8.8.4.4", iconColor: "#4285F4" }, - { id: "cloudflare", name: "Cloudflare", primary: "1.1.1.1", secondary: "1.0.0.1", iconColor: "#F6821F" }, -]; - -export interface NetworkOptimizerItem { - id: string; - stateKey: string; - icon: ComponentType<{ size?: number; strokeWidth?: number }>; - color: string; - enableCmd: string; - disableCmd: string; - titleKey: string; - descKey: string; - requiresReboot: boolean; -} - -export const networkOptimizerItems: NetworkOptimizerItem[] = [ - { - id: "tcp-congestion", - stateKey: "tcp_congestion_optimized", - icon: Network, - color: "#38A169", - enableCmd: "set_tcp_congestion", - disableCmd: "restore_tcp_congestion", - titleKey: "networkOptimize.tcpCongestion.title", - descKey: "networkOptimize.tcpCongestion.description", - requiresReboot: false, - }, - { - id: "chimney-offload", - stateKey: "chimney_offload", - icon: Network, - color: "#DD6B20", - enableCmd: "set_tcp_chimney_off", - disableCmd: "restore_tcp_chimney", - titleKey: "networkOptimize.chimney.title", - descKey: "networkOptimize.chimney.description", - requiresReboot: false, - }, - { - id: "nagle-algorithm", - stateKey: "nagle_optimized", - icon: Network, - color: "#805AD5", - enableCmd: "set_nagle_optimization", - disableCmd: "restore_nagle_optimization", - titleKey: "networkOptimize.nagle.title", - descKey: "networkOptimize.nagle.description", - requiresReboot: false, - }, - { - id: "adapter-power", - stateKey: "adapter_power_saving_off", - icon: Zap, - color: "#FF6B9D", - enableCmd: "set_adapter_power_saving_off", - disableCmd: "restore_adapter_power_saving", - titleKey: "networkOptimize.adapterPower.title", - descKey: "networkOptimize.adapterPower.description", - requiresReboot: false, - }, -]; diff --git a/参考/NexBox-main/src/config/search-index.ts b/参考/NexBox-main/src/config/search-index.ts deleted file mode 100644 index 07b7a69..0000000 --- a/参考/NexBox-main/src/config/search-index.ts +++ /dev/null @@ -1,317 +0,0 @@ -import { - Home, - Cpu, - Wrench, - List, - Package, - Crosshair, - TrendingUp, - Heart, - Settings, - Palette, - Layout, - Zap, - MousePointer2, - Monitor, - Download, - Network, - Bot, - Volume2, - Trash2, - MemoryStick, - Gauge, - Gamepad2, - Battery, - Music, - HardDrive, - Settings2, - Tv2, -} from "lucide-react"; -import type { ComponentType } from "react"; - -export type SearchCategory = "page" | "builtin-tool" | "optimization" | "thirdparty-tool"; - -export interface SearchItem { - id: string; - nameKey: string; - path: string; - icon: ComponentType<{ size?: number; strokeWidth?: number }>; - category: SearchCategory; - keywords?: string[]; - customIcon?: string; - action?: "navigate" | "run-tool"; - toolId?: string; -} - -export const searchIndex: SearchItem[] = [ - { - id: "home", - nameKey: "sidebar.home", - path: "/", - icon: Home, - category: "page", - keywords: ["首页", "主页", "home", "main"], - }, - { - id: "hardware", - nameKey: "sidebar.hardware", - path: "/hardware", - icon: Cpu, - category: "page", - keywords: ["硬件", "信息", "hardware", "cpu", "gpu", "显卡", "处理器"], - }, - { - id: "tools", - nameKey: "sidebar.tools", - path: "/tools", - icon: Wrench, - category: "page", - keywords: ["工具", "tools", "工具箱"], - }, - { - id: "builtin-tools", - nameKey: "sidebar.builtinTools", - path: "/builtin-tools", - icon: Package, - category: "page", - keywords: ["内置", "工具", "builtin", "tools"], - }, - { - id: "optimization", - nameKey: "sidebar.optimization", - path: "/optimization", - icon: TrendingUp, - category: "page", - keywords: ["优化", "optimization", "性能"], - }, - { - id: "delta-force", - nameKey: "sidebar.deltaForce", - path: "/delta-force", - icon: Crosshair, - category: "page", - keywords: ["三角洲", "delta", "force", "密码", "改枪码"], - }, - { - id: "mood", - nameKey: "sidebar.mood", - path: "/mood", - icon: Heart, - category: "page", - keywords: ["心境", "mood", "心情"], - }, - { - id: "epic-free", - nameKey: "sidebar.epicFree", - path: "/epic-free", - icon: Gamepad2, - category: "page", - keywords: ["epic", "喜加一", "免费", "游戏", "free", "games", "白嫖"], - }, - { - id: "music", - nameKey: "sidebar.music", - path: "/music", - icon: Music, - category: "page", - keywords: ["音乐", "播放器", "music", "player", "网易云", "netease"], - }, - { - id: "sponsor", - nameKey: "settings.sponsor", - path: "/settings", - icon: Heart, - category: "page", - keywords: ["赞助", "sponsor", "支持", "捐赠", "打赏", "donate", "support"], - }, - { - id: "settings", - nameKey: "sidebar.settings", - path: "/settings", - icon: Settings, - category: "page", - keywords: ["设置", "settings", "配置"], - }, - { - id: "display-filter", - nameKey: "sidebar.displayFilter", - path: "/display-filter", - icon: Palette, - category: "builtin-tool", - keywords: ["滤镜", "显示器", "display", "filter", "色彩", "色温"], - }, - { - id: "crosshair", - nameKey: "sidebar.crosshair", - path: "/crosshair", - icon: Crosshair, - category: "builtin-tool", - keywords: ["准心", "准星", "crosshair", "瞄准"], - }, - { - id: "overlay-panel", - nameKey: "sidebar.overlayPanel", - path: "/overlay-panel", - icon: Layout, - category: "builtin-tool", - keywords: ["悬浮", "overlay", "面板", "监控"], - }, - { - id: "gpu-rename", - nameKey: "sidebar.gpuRename", - path: "/gpu-rename", - icon: Cpu, - category: "builtin-tool", - keywords: ["显卡", "改写", "gpu", "rename", "伪装"], - }, - { - id: "nvidia-driver", - nameKey: "sidebar.nvidiaDriver", - path: "/nvidia-driver", - icon: Tv2, - category: "builtin-tool", - keywords: ["显卡设置", "nvidia", "驱动", "垂直同步", "纹理", "抗锯齿", "fxaa", "帧率", "电源", "各向异性过滤", "nvapi", "3d设置", "g-sync", "vr", "分辨率", "显示器", "切换分辨率", "resolution"], - }, - { - id: "resolution-converter", - nameKey: "sidebar.resolutionConverter", - path: "/resolution-converter", - icon: Monitor, - category: "builtin-tool", - keywords: ["分辨率", "换算", "resolution", "converter", "比例"], - }, - { - id: "dlss-preset", - nameKey: "sidebar.dlssPreset", - path: "/dlss-preset", - icon: Zap, - category: "builtin-tool", - keywords: ["dlss", "预设", "preset", "三角洲", "delta", "force", "nvidia", "模型"], - }, - { - id: "audio-eq", - nameKey: "sidebar.audioEq", - path: "/audio-eq", - icon: Volume2, - category: "builtin-tool", - keywords: ["EQ", "调音", "均衡器", "音频", "声卡", "equalizer", "audio", "fxsound", "音效"], - }, - { - id: "memory-limit", - nameKey: "optimization.memoryLimit.title", - path: "/optimize/memory-limit", - icon: Cpu, - category: "optimization", - keywords: ["内存", "限制", "memory", "limit", "优化"], - }, - { - id: "memory-cleanup", - nameKey: "optimization.memoryCleanup.title", - path: "/optimize/memory-cleanup", - icon: MemoryStick, - category: "optimization", - keywords: ["内存", "清理", "memory", "cleanup", "释放", "优化"], - }, - { - id: "ace-optimize", - nameKey: "optimization.aceOptimize.title", - path: "/optimize/ace-optimize", - icon: Gauge, - category: "optimization", - keywords: ["ace", "优化", "反作弊", "游戏", "进程", "三角洲", "delta"], - }, - { - id: "shader-cache", - nameKey: "shaderCache.title", - path: "/optimize/shader-cache", - icon: Trash2, - category: "optimization", - keywords: ["着色器", "缓存", "shader", "cache", "清理", "nvidia", "amd"], - }, - { - id: "power-management", - nameKey: "optimization.powerManagement.title", - path: "/optimize/power-management", - icon: Battery, - category: "optimization", - keywords: ["电源", "管理", "power", "management", "电源计划", "高性能"], - }, - { - id: "storage-clean", - nameKey: "storageClean.title", - path: "/optimize/storage-clean", - icon: HardDrive, - category: "optimization", - keywords: ["存储", "清理", "storage", "clean", "磁盘", "垃圾", "临时文件", "缓存"], - }, - { - id: "startup-manager", - nameKey: "optimization.startupManager.title", - path: "/optimize/startup-manager", - icon: List, - category: "optimization", - keywords: ["启动", "startup", "开机自启", "管理"], - }, - { - id: "system-optimizer", - nameKey: "systemOptimizer.pageTitle", - path: "/optimize/system-optimizer", - icon: Settings2, - category: "optimization", - keywords: ["系统优化", "system", "optimizer", "注册表", "服务", "性能", "隐私", "游戏", "一键优化"], - }, - { - id: "windows-update", - nameKey: "windowsUpdate.pageTitle", - path: "/optimize/windows-update", - icon: Download, - category: "optimization", - keywords: ["关闭更新", "禁用更新", "windows更新", "自动更新", "Windows Update", "wuauserv", "停止更新", "系统更新"], - }, - { - id: "network-optimizer", - nameKey: "networkOptimize.pageTitle", - path: "/optimize/network-optimizer", - icon: Network, - category: "optimization", - keywords: ["网络优化", "network", "dns", "tcp", "延迟", "网速", "域名", "解析"], - }, - { - id: "peripheral-optimize", - nameKey: "peripheralOptimize.pageTitle", - path: "/optimize/peripheral-optimize", - icon: MousePointer2, - category: "optimization", - keywords: ["外设", "鼠标", "键盘", "peripheral", "mouse", "keyboard", "注册表", "优化", "输入延迟", "Win32PrioritySeparation", "KeyboardDataQueueSize"], - }, -]; - -export const thirdPartyToolIcons: Record> = { - "memreduct": Zap, - "windows-core-optimizer": Cpu, - "optimizer": TrendingUp, - "cpu-z": Cpu, - "gpu-z": Monitor, - "clash-verge": Network, - "gamepp": Bot, - "fxsound": Volume2, - "process-lasso": Cpu, -}; - -export function getThirdPartyToolIcon(toolId: string): ComponentType<{ size?: number; strokeWidth?: number }> { - return thirdPartyToolIcons[toolId] || Wrench; -} - -export const categoryLabels: Record = { - "page": "search.categories.pages", - "builtin-tool": "search.categories.builtinTools", - "optimization": "search.categories.optimization", - "thirdparty-tool": "search.categories.thirdpartyTools", -}; - -export const categoryOrder: SearchCategory[] = [ - "page", - "builtin-tool", - "optimization", - "thirdparty-tool", -]; diff --git a/参考/NexBox-main/src/config/system-optimizer.ts b/参考/NexBox-main/src/config/system-optimizer.ts deleted file mode 100644 index b3bc594..0000000 --- a/参考/NexBox-main/src/config/system-optimizer.ts +++ /dev/null @@ -1,721 +0,0 @@ -import type { ComponentType } from "react"; -import { - Zap, - Clock, - Network, - AlertTriangle, - Shield, - Printer, - Phone, - ShieldOff, - HardDrive, - Cpu, - FileText, - Radio, - MonitorOff, - Activity, - Server, - Eye, - Layout, - MessageSquare, - Chrome, - Monitor, - Code, - Pen, - Gamepad2, - Gamepad, - Video, - Power, - MousePointer, - Camera, - Map as MapIcon, - Search, -} from "lucide-react"; - -export type OptimizerCategory = - | "gaming" - | "nvidia" - | "amd" - | "performance" - | "privacy" - | "services" - | "disk" - | "apps"; - -export interface OptimizerItem { - id: string; - regName: string; - category: OptimizerCategory; - icon: ComponentType<{ size?: number; strokeWidth?: number }>; - color: string; - titleKey: string; - descKey: string; - requiresReboot: boolean; -} - -// 预定义颜色池(固定顺序,避免刷新变化) -const COLORS = [ - "#FF6B9D", "#3182CE", "#38A169", "#DD6B20", "#805AD5", - "#E53E3E", "#00B5D8", "#D69E2E", "#319795", "#667EEA", - "#ED64A6", "#F56565", "#48BB78", "#9F7AEA", "#F6AD55", -]; - -export const optimizerItems: OptimizerItem[] = [ - // ============== 游戏与图形优化(12 项) ============== - { - id: "mmcssGameConfig", - regName: "MMCSS完整游戏配置", - category: "gaming", - icon: Gamepad2, - color: COLORS[0], - titleKey: "systemOptimizer.gaming.mmcssGameConfig", - descKey: "systemOptimizer.gaming.mmcssGameConfigDesc", - requiresReboot: true, - }, - { - id: "gamePriority", - regName: "优先考虑游戏责任", - category: "gaming", - icon: Gamepad2, - color: COLORS[1], - titleKey: "systemOptimizer.gaming.gamePriority", - descKey: "systemOptimizer.gaming.gamePriorityDesc", - requiresReboot: true, - }, - { - id: "networkSRResponse", - regName: "改进网络和 SR 响应能力", - category: "gaming", - icon: Network, - color: COLORS[2], - titleKey: "systemOptimizer.gaming.networkSRResponse", - descKey: "systemOptimizer.gaming.networkSRResponseDesc", - requiresReboot: false, - }, - { - id: "directXAutoHDR", - regName: "启用DirectX AutoHDR", - category: "gaming", - icon: Monitor, - color: COLORS[3], - titleKey: "systemOptimizer.gaming.directXAutoHDR", - descKey: "systemOptimizer.gaming.directXAutoHDRDesc", - requiresReboot: false, - }, - { - id: "directXFlipModel", - regName: "启用DirectX Flip Model", - category: "gaming", - icon: Monitor, - color: COLORS[4], - titleKey: "systemOptimizer.gaming.directXFlipModel", - descKey: "systemOptimizer.gaming.directXFlipModelDesc", - requiresReboot: false, - }, - { - id: "directXVRR", - regName: "启用DirectX VRR优化", - category: "gaming", - icon: Monitor, - color: COLORS[5], - titleKey: "systemOptimizer.gaming.directXVRR", - descKey: "systemOptimizer.gaming.directXVRRDesc", - requiresReboot: false, - }, - { - id: "disableDXMaxWindow", - regName: "禁用DX最大化窗口模式", - category: "gaming", - icon: MonitorOff, - color: COLORS[6], - titleKey: "systemOptimizer.gaming.disableDXMaxWindow", - descKey: "systemOptimizer.gaming.disableDXMaxWindowDesc", - requiresReboot: false, - }, - { - id: "disableGPUPreemption", - regName: "禁用 GPU 抢占", - category: "gaming", - icon: Cpu, - color: COLORS[7], - titleKey: "systemOptimizer.gaming.disableGPUPreemption", - descKey: "systemOptimizer.gaming.disableGPUPreemptionDesc", - requiresReboot: false, - }, - { - id: "disableGameBar", - regName: "禁用GameBar提示", - category: "gaming", - icon: Gamepad, - color: COLORS[8], - titleKey: "systemOptimizer.gaming.disableGameBar", - descKey: "systemOptimizer.gaming.disableGameBarDesc", - requiresReboot: false, - }, - { - id: "disableGameDVR", - regName: "禁用游戏硬盘录像机Game DVR", - category: "gaming", - icon: Video, - color: COLORS[9], - titleKey: "systemOptimizer.gaming.disableGameDVR", - descKey: "systemOptimizer.gaming.disableGameDVRDesc", - requiresReboot: false, - }, - { - id: "disableBcastDVR", - regName: "禁用广播DVR服务", - category: "gaming", - icon: Radio, - color: COLORS[10], - titleKey: "systemOptimizer.gaming.disableBcastDVR", - descKey: "systemOptimizer.gaming.disableBcastDVRDesc", - requiresReboot: true, - }, - { - id: "disableAutoColorMgmt", - regName: "关闭自动色彩管理", - category: "gaming", - icon: Eye, - color: COLORS[11], - titleKey: "systemOptimizer.gaming.disableAutoColorMgmt", - descKey: "systemOptimizer.gaming.disableAutoColorMgmtDesc", - requiresReboot: false, - }, - - // ============== NVIDIA 显卡优化(11 项) ============== - { - id: "lowLatencyThreshold", - regName: "NVIDIA低延迟阈值优化", - category: "nvidia", - icon: Zap, - color: COLORS[0], - titleKey: "systemOptimizer.nvidia.lowLatencyThreshold", - descKey: "systemOptimizer.nvidia.lowLatencyThresholdDesc", - requiresReboot: true, - }, - { - id: "perCpuDPC", - regName: "启用NVIDIA Per-CPU DPC", - category: "nvidia", - icon: Cpu, - color: COLORS[1], - titleKey: "systemOptimizer.nvidia.perCpuDPC", - descKey: "systemOptimizer.nvidia.perCpuDCPDesc", - requiresReboot: true, - }, - { - id: "imageSharpening", - regName: "启用NVIDIA锐化", - category: "nvidia", - icon: Eye, - color: COLORS[2], - titleKey: "systemOptimizer.nvidia.imageSharpening", - descKey: "systemOptimizer.nvidia.imageSharpeningDesc", - requiresReboot: false, - }, - { - id: "disableGpuPowerMgmt", - regName: "禁用NVIDIA GPU电源管理", - category: "nvidia", - icon: Power, - color: COLORS[3], - titleKey: "systemOptimizer.nvidia.disableGpuPowerMgmt", - descKey: "systemOptimizer.nvidia.disableGpuPowerMgmtDesc", - requiresReboot: true, - }, - { - id: "disableHDCP", - regName: "禁用NVIDIA HDCP", - category: "nvidia", - icon: ShieldOff, - color: COLORS[4], - titleKey: "systemOptimizer.nvidia.disableHDCP", - descKey: "systemOptimizer.nvidia.disableHDCPDesc", - requiresReboot: false, - }, - { - id: "disableWriteCombining", - regName: "禁用NVIDIA写合并", - category: "nvidia", - icon: Cpu, - color: COLORS[5], - titleKey: "systemOptimizer.nvidia.disableWriteCombining", - descKey: "systemOptimizer.nvidia.disableWriteCombiningDesc", - requiresReboot: false, - }, - { - id: "disableClockGating", - regName: "禁用NVIDIA时钟门控", - category: "nvidia", - icon: Clock, - color: COLORS[6], - titleKey: "systemOptimizer.nvidia.disableClockGating", - descKey: "systemOptimizer.nvidia.disableClockGatingDesc", - requiresReboot: true, - }, - { - id: "disableTelemetry", - regName: "禁用NVIDIA遥测", - category: "nvidia", - icon: Eye, - color: COLORS[7], - titleKey: "systemOptimizer.nvidia.disableTelemetry", - descKey: "systemOptimizer.nvidia.disableTelemetryDesc", - requiresReboot: false, - }, - { - id: "disableDriverLog", - regName: "禁用NVIDIA驱动日志", - category: "nvidia", - icon: FileText, - color: COLORS[8], - titleKey: "systemOptimizer.nvidia.disableDriverLog", - descKey: "systemOptimizer.nvidia.disableDriverLogDesc", - requiresReboot: false, - }, - { - id: "lockPState0", - regName: "锁定NVIDIA P-State 0", - category: "nvidia", - icon: Zap, - color: COLORS[9], - titleKey: "systemOptimizer.nvidia.lockPState0", - descKey: "systemOptimizer.nvidia.lockPState0Desc", - requiresReboot: true, - }, - { - id: "disableMiracastOverlay", - regName: "禁用Miracast和Overlay", - category: "nvidia", - icon: MonitorOff, - color: COLORS[10], - titleKey: "systemOptimizer.nvidia.disableMiracastOverlay", - descKey: "systemOptimizer.nvidia.disableMiracastOverlayDesc", - requiresReboot: true, - }, - - // ============== AMD 显卡优化(1 项) ============== - { - id: "shaderCache", - regName: "强制启用AMD Shader Cache", - category: "amd", - icon: Cpu, - color: COLORS[0], - titleKey: "systemOptimizer.amd.shaderCache", - descKey: "systemOptimizer.amd.shaderCacheDesc", - requiresReboot: false, - }, - - // ============== 系统性能调优(8 项) ============== - { - id: "intelTSX", - regName: "启用Intel TSX", - category: "performance", - icon: Cpu, - color: COLORS[1], - titleKey: "systemOptimizer.performance.intelTSX", - descKey: "systemOptimizer.performance.intelTSXDesc", - requiresReboot: true, - }, - { - id: "mergeSvcHost", - regName: "合并ServiceHost进程", - category: "performance", - icon: Server, - color: COLORS[2], - titleKey: "systemOptimizer.performance.mergeSvcHost", - descKey: "systemOptimizer.performance.mergeSvcHostDesc", - requiresReboot: true, - }, - { - id: "shortenTaskTimeout", - regName: "缩短任务超时", - category: "performance", - icon: Clock, - color: COLORS[3], - titleKey: "systemOptimizer.performance.shortenTaskTimeout", - descKey: "systemOptimizer.performance.shortenTaskTimeoutDesc", - requiresReboot: false, - }, - { - id: "shortenServiceTimeout", - regName: "缩短服务超时", - category: "performance", - icon: Clock, - color: COLORS[4], - titleKey: "systemOptimizer.performance.shortenServiceTimeout", - descKey: "systemOptimizer.performance.shortenServiceTimeoutDesc", - requiresReboot: false, - }, - { - id: "mouseHoverDelay", - regName: "鼠标悬停延迟优化", - category: "performance", - icon: MousePointer, - color: COLORS[5], - titleKey: "systemOptimizer.performance.mouseHoverDelay", - descKey: "systemOptimizer.performance.mouseHoverDelayDesc", - requiresReboot: false, - }, - { - id: "disableStartupDelay", - regName: "禁用启动延迟", - category: "performance", - icon: Zap, - color: COLORS[6], - titleKey: "systemOptimizer.performance.disableStartupDelay", - descKey: "systemOptimizer.performance.disableStartupDelayDesc", - requiresReboot: false, - }, - { - id: "disablePowerSaving", - regName: "禁用省电模式", - category: "performance", - icon: Power, - color: COLORS[7], - titleKey: "systemOptimizer.performance.disablePowerSaving", - descKey: "systemOptimizer.performance.disablePowerSavingDesc", - requiresReboot: true, - }, - { - id: "nvmeTuning", - regName: "NVMe调优", - category: "performance", - icon: HardDrive, - color: COLORS[8], - titleKey: "systemOptimizer.performance.nvmeTuning", - descKey: "systemOptimizer.performance.nvmeTuningDesc", - requiresReboot: true, - }, - - // ============== 隐私与遥测(10 项) ============== - { - id: "disableTelemetrySvc", - regName: "禁用遥测服务", - category: "privacy", - icon: Eye, - color: COLORS[0], - titleKey: "systemOptimizer.privacy.disableTelemetrySvc", - descKey: "systemOptimizer.privacy.disableTelemetrySvcDesc", - requiresReboot: true, - }, - { - id: "disableCEIP", - regName: "禁用CEIP-SQM", - category: "privacy", - icon: Activity, - color: COLORS[1], - titleKey: "systemOptimizer.privacy.disableCEIP", - descKey: "systemOptimizer.privacy.disableCEIPDesc", - requiresReboot: false, - }, - { - id: "disableDotNetTelemetry", - regName: "禁用DotNet遥测", - category: "privacy", - icon: Code, - color: COLORS[2], - titleKey: "systemOptimizer.privacy.disableDotNetTelemetry", - descKey: "systemOptimizer.privacy.disableDotNetTelemetryDesc", - requiresReboot: false, - }, - { - id: "disableAppImpactTelemetry", - regName: "禁用应用影响遥测", - category: "privacy", - icon: Activity, - color: COLORS[3], - titleKey: "systemOptimizer.privacy.disableAppImpactTelemetry", - descKey: "systemOptimizer.privacy.disableAppImpactTelemetryDesc", - requiresReboot: false, - }, - { - id: "disableAppImpactTelemetryAgent", - regName: "禁用应用影响遥测代理", - category: "privacy", - icon: Activity, - color: COLORS[4], - titleKey: "systemOptimizer.privacy.disableAppImpactTelemetryAgent", - descKey: "systemOptimizer.privacy.disableAppImpactTelemetryAgentDesc", - requiresReboot: false, - }, - { - id: "disableLicenseTelemetry", - regName: "禁用许可遥测", - category: "privacy", - icon: Shield, - color: COLORS[5], - titleKey: "systemOptimizer.privacy.disableLicenseTelemetry", - descKey: "systemOptimizer.privacy.disableLicenseTelemetryDesc", - requiresReboot: false, - }, - { - id: "disableScheduledDiag", - regName: "禁用计划诊断", - category: "privacy", - icon: Clock, - color: COLORS[6], - titleKey: "systemOptimizer.privacy.disableScheduledDiag", - descKey: "systemOptimizer.privacy.disableScheduledDiagDesc", - requiresReboot: false, - }, - { - id: "disableWebcamTelemetry", - regName: "禁用网络摄像头遥测", - category: "privacy", - icon: Camera, - color: COLORS[7], - titleKey: "systemOptimizer.privacy.disableWebcamTelemetry", - descKey: "systemOptimizer.privacy.disableWebcamTelemetryDesc", - requiresReboot: false, - }, - { - id: "disableWritingFeedback", - regName: "禁用写入反馈", - category: "privacy", - icon: Pen, - color: COLORS[8], - titleKey: "systemOptimizer.privacy.disableWritingFeedback", - descKey: "systemOptimizer.privacy.disableWritingFeedbackDesc", - requiresReboot: false, - }, - { - id: "disableErrorReporting", - regName: "禁用Windows错误报告", - category: "privacy", - icon: AlertTriangle, - color: COLORS[9], - titleKey: "systemOptimizer.privacy.disableErrorReporting", - descKey: "systemOptimizer.privacy.disableErrorReportingDesc", - requiresReboot: false, - }, - - // ============== 系统服务精简(11 项) ============== - { - id: "disableSensorSvc", - regName: "禁用传感器服务", - category: "services", - icon: Radio, - color: COLORS[0], - titleKey: "systemOptimizer.services.disableSensorSvc", - descKey: "systemOptimizer.services.disableSensorSvcDesc", - requiresReboot: true, - }, - { - id: "disableFaxSvc", - regName: "禁用传真服务", - category: "services", - icon: Phone, - color: COLORS[1], - titleKey: "systemOptimizer.services.disableFaxSvc", - descKey: "systemOptimizer.services.disableFaxSvcDesc", - requiresReboot: true, - }, - { - id: "disablePrintSvc", - regName: "禁用打印服务", - category: "services", - icon: Printer, - color: COLORS[2], - titleKey: "systemOptimizer.services.disablePrintSvc", - descKey: "systemOptimizer.services.disablePrintSvcDesc", - requiresReboot: true, - }, - { - id: "disableMapsBroker", - regName: "禁用下载地图管理器", - category: "services", - icon: MapIcon, - color: COLORS[3], - titleKey: "systemOptimizer.services.disableMapsBroker", - descKey: "systemOptimizer.services.disableMapsBrokerDesc", - requiresReboot: true, - }, - { - id: "disableUCPD", - regName: "禁用UCPD", - category: "services", - icon: Shield, - color: COLORS[4], - titleKey: "systemOptimizer.services.disableUCPD", - descKey: "systemOptimizer.services.disableUCPDDesc", - requiresReboot: true, - }, - { - id: "disableDCOM", - regName: "禁用DCOM", - category: "services", - icon: Server, - color: COLORS[5], - titleKey: "systemOptimizer.services.disableDCOM", - descKey: "systemOptimizer.services.disableDCOMDesc", - requiresReboot: false, - }, - { - id: "disableStorageSense", - regName: "禁用StorageSense", - category: "services", - icon: HardDrive, - color: COLORS[6], - titleKey: "systemOptimizer.services.disableStorageSense", - descKey: "systemOptimizer.services.disableStorageSenseDesc", - requiresReboot: false, - }, - { - id: "disableAutoMaintenance", - regName: "禁用自动维护", - category: "services", - icon: Clock, - color: COLORS[7], - titleKey: "systemOptimizer.services.disableAutoMaintenance", - descKey: "systemOptimizer.services.disableAutoMaintenanceDesc", - requiresReboot: false, - }, - { - id: "disableAppCompat", - regName: "禁用应用程序兼容性", - category: "services", - icon: Shield, - color: COLORS[8], - titleKey: "systemOptimizer.services.disableAppCompat", - descKey: "systemOptimizer.services.disableAppCompatDesc", - requiresReboot: false, - }, - { - id: "disableStepRecorder", - regName: "禁用步骤记录器", - category: "services", - icon: Monitor, - color: COLORS[9], - titleKey: "systemOptimizer.services.disableStepRecorder", - descKey: "systemOptimizer.services.disableStepRecorderDesc", - requiresReboot: false, - }, - { - id: "disablePerfTips", - regName: "禁用性能提醒", - category: "services", - icon: Activity, - color: COLORS[10], - titleKey: "systemOptimizer.services.disablePerfTips", - descKey: "systemOptimizer.services.disablePerfTipsDesc", - requiresReboot: false, - }, - - // ============== 磁盘与文件系统(5 项) ============== - { - id: "disable8dot3", - regName: "禁用8.3文件名", - category: "disk", - icon: FileText, - color: COLORS[0], - titleKey: "systemOptimizer.disk.disable8dot3", - descKey: "systemOptimizer.disk.disable8dot3Desc", - requiresReboot: true, - }, - { - id: "disableNtfsEncryption", - regName: "禁用NTFS加密", - category: "disk", - icon: ShieldOff, - color: COLORS[1], - titleKey: "systemOptimizer.disk.disableNtfsEncryption", - descKey: "systemOptimizer.disk.disableNtfsEncryptionDesc", - requiresReboot: false, - }, - { - id: "disableLastAccess", - regName: "禁用最后访问更新", - category: "disk", - icon: HardDrive, - color: COLORS[2], - titleKey: "systemOptimizer.disk.disableLastAccess", - descKey: "systemOptimizer.disk.disableLastAccessDesc", - requiresReboot: true, - }, - { - id: "disableReservedStorage", - regName: "禁用更新保留存储", - category: "disk", - icon: HardDrive, - color: COLORS[3], - titleKey: "systemOptimizer.disk.disableReservedStorage", - descKey: "systemOptimizer.disk.disableReservedStorageDesc", - requiresReboot: false, - }, - { - id: "disableFullFsSearch", - regName: "禁用搜索全文件系统", - category: "disk", - icon: Search, - color: COLORS[4], - titleKey: "systemOptimizer.disk.disableFullFsSearch", - descKey: "systemOptimizer.disk.disableFullFsSearchDesc", - requiresReboot: false, - }, - - // ============== 应用与界面(4 项) ============== - { - id: "disableBackgroundApps", - regName: "禁用后台应用", - category: "apps", - icon: Layout, - color: COLORS[0], - titleKey: "systemOptimizer.apps.disableBackgroundApps", - descKey: "systemOptimizer.apps.disableBackgroundAppsDesc", - requiresReboot: false, - }, - { - id: "disableEdgeStartupBoost", - regName: "禁用Edge启动加速", - category: "apps", - icon: Chrome, - color: COLORS[1], - titleKey: "systemOptimizer.apps.disableEdgeStartupBoost", - descKey: "systemOptimizer.apps.disableEdgeStartupBoostDesc", - requiresReboot: false, - }, - { - id: "slimEdgeAds", - regName: "精简Edge广告推荐", - category: "apps", - icon: MessageSquare, - color: COLORS[2], - titleKey: "systemOptimizer.apps.slimEdgeAds", - descKey: "systemOptimizer.apps.slimEdgeAdsDesc", - requiresReboot: false, - }, - { - id: "disableSearchWebView2", - regName: "禁用搜索WebView2", - category: "apps", - icon: Search, - color: COLORS[3], - titleKey: "systemOptimizer.apps.disableSearchWebView2", - descKey: "systemOptimizer.apps.disableSearchWebView2Desc", - requiresReboot: false, - }, -]; - -export const categoryLabels: Record = { - gaming: "systemOptimizer.category.gaming", - nvidia: "systemOptimizer.category.nvidia", - amd: "systemOptimizer.category.amd", - performance: "systemOptimizer.category.performance", - privacy: "systemOptimizer.category.privacy", - services: "systemOptimizer.category.services", - disk: "systemOptimizer.category.disk", - apps: "systemOptimizer.category.apps", -}; - -export const categoryOrder: OptimizerCategory[] = [ - "gaming", - "nvidia", - "amd", - "performance", - "privacy", - "services", - "disk", - "apps", -]; diff --git a/参考/NexBox-main/src/contexts/app-startup-context.tsx b/参考/NexBox-main/src/contexts/app-startup-context.tsx deleted file mode 100644 index 14938fb..0000000 --- a/参考/NexBox-main/src/contexts/app-startup-context.tsx +++ /dev/null @@ -1,445 +0,0 @@ -"use client"; - -import { createContext, useContext, useState, ReactNode, useEffect, useRef } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { store } from "@/lib/store"; -import { type HardwareInfo, getHardwareInfo } from "@/lib/hardware"; - -const DEFAULT_OVERLAY_HOTKEY = "Shift+F10"; -const DEFAULT_CROSSHAIR_HOTKEY = "Shift+F9"; -const DEFAULT_FILTER_HOTKEY = "Shift+F8"; - -interface DisplayItem { - id: string; - label: string; - enabled: boolean; -} - -type DisplayItems = DisplayItem[]; - -interface CustomOverlayItem { - id: string; - text: string; - color: string; - enabled: boolean; -} - -interface CrosshairSettings { - enabled: boolean; - style: string; - size: number; - thickness: number; - color: string; - gap: number; - dot_size: number; - opacity: number; - monitor_index: number; -} - -interface OverlaySettings { - display_items: DisplayItems; - custom_items: CustomOverlayItem[]; - opacity: number; - style: string; - font: string; - font_color: string; - _version?: number; - position_x?: number | null; - position_y?: number | null; - delta_password_maps?: string[]; -} - -interface ThirdPartyTool { - id: string; - name: string; - description: string; - category: string; - tool_type: string; - download_url: string; - file_name: string; - website_url: string | null; - check_executable: string | null; -} - -interface ToolWithStatus { - tool: ThirdPartyTool; - installed: boolean; -} - -interface AppStartupContextType { - isStartupComplete: boolean; - startupProgress: number; - startupMessage: string; - hardwareInfo: HardwareInfo | null; - tools: ThirdPartyTool[]; - initTools: () => Promise; - overlaySettings: OverlaySettings | null; - saveOverlaySettings: (settings: OverlaySettings) => Promise; - overlayHotkey: string; - saveOverlayHotkey: (shortcut: string) => Promise; - crosshairHotkey: string; - saveCrosshairHotkey: (shortcut: string) => Promise; - filterHotkey: string; - saveFilterHotkey: (shortcut: string) => Promise; -} - -const DEFAULT_OVERLAY_SETTINGS: OverlaySettings = { - display_items: [ - { id: "fps", label: "FPS", enabled: true }, - { id: "cpu_temp", label: "CPU温度", enabled: false }, - { id: "cpu_usage", label: "CPU占用", enabled: true }, - { id: "cpu_fan_speed", label: "CPU风扇转速", enabled: false }, - { id: "cpu_clock", label: "CPU频率", enabled: false }, - { id: "cpu_voltage", label: "CPU电压", enabled: false }, - { id: "cpu_power", label: "CPU功耗", enabled: false }, - { id: "gpu_temp", label: "GPU温度", enabled: true }, - { id: "gpu_usage", label: "GPU占用", enabled: true }, - { id: "gpu_fan_speed", label: "GPU风扇转速", enabled: false }, - { id: "gpu_power", label: "GPU功耗", enabled: false }, - { id: "gpu_clock", label: "GPU频率", enabled: false }, - { id: "gpu_voltage", label: "GPU电压", enabled: false }, - { id: "gpu_vram", label: "GPU显存占用", enabled: false }, - { id: "gpu_memory_clock", label: "GPU显存频率", enabled: false }, - { id: "memory_usage", label: "内存占用", enabled: true }, - { id: "ssd_temp", label: "硬盘温度", enabled: false }, - { id: "game_ping", label: "游戏延迟", enabled: true }, - { id: "delta_password", label: "三角洲密码", enabled: true }, - ], - custom_items: [], - opacity: 255, - style: "default", - font: "Microsoft YaHei", - font_color: "#ffffff", - position_x: null, - position_y: null, - delta_password_maps: [], -}; - -const AppStartupContext = createContext({ - isStartupComplete: false, - startupProgress: 0, - startupMessage: "正在启动...", - hardwareInfo: null, - tools: [], - initTools: async () => {}, - overlaySettings: null, - saveOverlaySettings: async () => {}, - overlayHotkey: DEFAULT_OVERLAY_HOTKEY, - saveOverlayHotkey: async () => {}, - crosshairHotkey: DEFAULT_CROSSHAIR_HOTKEY, - saveCrosshairHotkey: async () => {}, - filterHotkey: DEFAULT_FILTER_HOTKEY, - saveFilterHotkey: async () => {}, -}); - -export function useAppStartup() { - return useContext(AppStartupContext); -} - -export function AppStartupProvider({ children }: { children: ReactNode }) { - const [isStartupComplete, setIsStartupComplete] = useState(false); - const [startupProgress, setStartupProgress] = useState(0); - const [startupMessage, setStartupMessage] = useState("正在启动..."); - const [hardwareInfo, setHardwareInfo] = useState(null); - const [tools, setTools] = useState([]); - const [overlaySettings, setOverlaySettings] = useState(null); - const [overlayHotkey, setOverlayHotkey] = useState(DEFAULT_OVERLAY_HOTKEY); - const [crosshairHotkey, setCrosshairHotkey] = useState(DEFAULT_CROSSHAIR_HOTKEY); - const [filterHotkey, setFilterHotkey] = useState(DEFAULT_FILTER_HOTKEY); - const hasStarted = useRef(false); - - const updateProgress = (progress: number, message: string) => { - setStartupProgress(progress); - setStartupMessage(message); - }; - - const loadHardwareInfo = async () => { - try { - const info = await getHardwareInfo(); - setHardwareInfo(info); - return true; - } catch (error) { - console.error("Failed to load hardware info:", error); - return false; - } - }; - - const initTools = async () => { - try { - const toolsData = await invoke("get_thirdparty_tools"); - setTools(toolsData); - } catch (error) { - console.error("Failed to load tools:", error); - } - }; - - const loadOverlaySettings = async () => { - try { - const savedSettings = await store.get("overlay-settings"); - let settingsToUse: OverlaySettings; - let needsMigration = false; - if (savedSettings) { - // 处理旧格式(对象)到新格式(数组)的迁移 - let displayItems: DisplayItems; - if (Array.isArray(savedSettings.display_items)) { - // 新格式数组:检查版本,过旧则重置顺序和标签,保留启用状态 - const currentVersion = 3; - const savedVersion = savedSettings._version ?? 1; - if (savedVersion < currentVersion) { - // 版本过旧:用默认项重建,只保留启用状态 - const savedMap = new Map(savedSettings.display_items.map((i) => [i.id, i.enabled])); - displayItems = DEFAULT_OVERLAY_SETTINGS.display_items.map((d) => ({ - ...d, - enabled: savedMap.has(d.id) ? savedMap.get(d.id)! : d.enabled, - })); - needsMigration = true; - } else { - // 最新版本,补充可能缺失的项,移除已废弃的项 - const defaultItems = DEFAULT_OVERLAY_SETTINGS.display_items; - const defaultIds = new Set(defaultItems.map((i) => i.id)); - displayItems = [ - ...savedSettings.display_items.filter((i) => defaultIds.has(i.id)), - ...defaultItems.filter((i) => !savedSettings.display_items.some((s) => s.id === i.id)), - ]; - } - } else { - // 旧格式:对象,需要迁移 - needsMigration = true; - const oldItems = savedSettings.display_items as unknown as { - fps: boolean; - cpu_usage: boolean; - gpu_temp: boolean; - gpu_usage: boolean; - memory_usage: boolean; - delta_password: boolean; - game_ping: boolean; - }; - displayItems = [ - { id: "fps", label: "FPS", enabled: oldItems.fps ?? true }, - { id: "cpu_usage", label: "CPU占用", enabled: oldItems.cpu_usage ?? true }, - { id: "gpu_temp", label: "GPU温度", enabled: oldItems.gpu_temp ?? true }, - { id: "gpu_usage", label: "GPU占用", enabled: oldItems.gpu_usage ?? true }, - { id: "gpu_fan_speed", label: "GPU风扇转速", enabled: false }, - { id: "gpu_power", label: "GPU功耗", enabled: false }, - { id: "gpu_clock", label: "GPU频率", enabled: false }, - { id: "gpu_vram", label: "GPU显存占用", enabled: false }, - { id: "memory_usage", label: "内存占用", enabled: oldItems.memory_usage ?? true }, - { id: "game_ping", label: "游戏延迟", enabled: oldItems.game_ping ?? true }, - { id: "delta_password", label: "三角洲密码", enabled: oldItems.delta_password ?? true }, - ]; - } - if (needsMigration) { - settingsToUse = { - ...DEFAULT_OVERLAY_SETTINGS, - ...savedSettings, - _version: 3, - display_items: displayItems, - }; - await store.set("overlay-settings", settingsToUse); - await store.save(); - } else { - settingsToUse = { - ...DEFAULT_OVERLAY_SETTINGS, - ...savedSettings, - display_items: displayItems, - }; - } - } else { - settingsToUse = DEFAULT_OVERLAY_SETTINGS; - } - setOverlaySettings(settingsToUse); - - await invoke("update_overlay_settings", { settings: settingsToUse }); - } catch (error) { - console.error("Failed to load overlay settings:", error); - setOverlaySettings(DEFAULT_OVERLAY_SETTINGS); - try { - await invoke("update_overlay_settings", { settings: DEFAULT_OVERLAY_SETTINGS }); - } catch (e) { - console.error("Failed to initialize backend settings:", e); - } - } - }; - - const loadOverlayHotkey = async () => { - try { - const saved = await store.get("overlay-hotkey"); - if (saved) { - setOverlayHotkey(saved); - await invoke("set_overlay_hotkey", { shortcut: saved }); - } - // 没有保存值则无需调用,Rust 端已用默认值初始化 - } catch (error) { - console.error("Failed to load overlay hotkey:", error); - } - }; - - const saveOverlayHotkey = async (shortcut: string) => { - setOverlayHotkey(shortcut); - try { - await invoke("set_overlay_hotkey", { shortcut }); - await store.set("overlay-hotkey", shortcut); - await store.save(); - } catch (error) { - console.error("Failed to save overlay hotkey:", error); - } - }; - - const loadCrosshairHotkey = async () => { - try { - const saved = await store.get("crosshair-hotkey"); - if (saved) { - setCrosshairHotkey(saved); - await invoke("set_crosshair_hotkey", { shortcut: saved }); - } - // 没有保存值则无需调用,Rust 端已用默认值初始化 - } catch (error) { - console.error("Failed to load crosshair hotkey:", error); - } - }; - - const saveCrosshairHotkey = async (shortcut: string) => { - setCrosshairHotkey(shortcut); - try { - await invoke("set_crosshair_hotkey", { shortcut }); - await store.set("crosshair-hotkey", shortcut); - await store.save(); - } catch (error) { - console.error("Failed to save crosshair hotkey:", error); - } - }; - - const loadCrosshairSettings = async () => { - try { - const saved = await store.get("crosshair-settings"); - if (saved) { - saved.enabled = false; - await invoke("update_crosshair_settings", { settings: saved }); - } - } catch (error) { - console.error("Failed to load crosshair settings:", error); - } - }; - - const loadFilterHotkey = async () => { - try { - const saved = await store.get("filter-hotkey"); - if (saved) { - setFilterHotkey(saved); - await invoke("set_filter_hotkey", { shortcut: saved }); - } - // 没有保存值则无需调用,Rust 端已用默认值初始化 - } catch (error) { - console.error("Failed to load filter hotkey:", error); - } - }; - - const saveFilterHotkey = async (shortcut: string) => { - setFilterHotkey(shortcut); - try { - await invoke("set_filter_hotkey", { shortcut }); - await store.set("filter-hotkey", shortcut); - await store.save(); - } catch (error) { - console.error("Failed to save filter hotkey:", error); - } - }; - - const saveTimerRef = useRef | null>(null); - const pendingSettingsRef = useRef(null); - -const saveOverlaySettings = async (settings: OverlaySettings) => { - setOverlaySettings(settings); - pendingSettingsRef.current = settings; - if (saveTimerRef.current) { - clearTimeout(saveTimerRef.current); - } - saveTimerRef.current = setTimeout(async () => { - saveTimerRef.current = null; - const s = pendingSettingsRef.current; - if (s) { - invoke("update_overlay_settings", { settings: s }); - try { - await store.set("overlay-settings", s); - await store.save(); - } catch (error) { - console.error("Failed to save overlay settings:", error); - } - } - }, 100); - }; - - useEffect(() => { - if (hasStarted.current) return; - hasStarted.current = true; - - const runStartup = async () => { - const tasks = [ - { name: "overlay-settings", fn: loadOverlaySettings, weight: 1 }, - { name: "hardware-info", fn: loadHardwareInfo, weight: 4 }, - { name: "overlay-hotkey", fn: loadOverlayHotkey, weight: 1 }, - { name: "crosshair-hotkey", fn: loadCrosshairHotkey, weight: 1 }, - { name: "crosshair-settings", fn: loadCrosshairSettings, weight: 1 }, - { name: "filter-hotkey", fn: loadFilterHotkey, weight: 1 }, - ]; - - const totalWeight = tasks.reduce((sum, t) => sum + t.weight, 0); - let completedWeight = 0; - - setStartupProgress(5); - - const updateProgress = () => { - const baseProgress = 5; - const maxProgress = 95; - const progress = baseProgress + (completedWeight / totalWeight) * (maxProgress - baseProgress); - setStartupProgress(Math.min(progress, 95)); - }; - - await Promise.all( - tasks.map(async (task) => { - try { - await task.fn(); - } catch (error) { - console.error(`Failed to load ${task.name}:`, error); - } finally { - completedWeight += task.weight; - updateProgress(); - } - }) - ); - - setStartupProgress(100); - setTimeout(() => { - setIsStartupComplete(true); - }, 100); - }; - - runStartup(); - - return () => {}; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/contexts/background-context.tsx b/参考/NexBox-main/src/contexts/background-context.tsx deleted file mode 100644 index a37c085..0000000 --- a/参考/NexBox-main/src/contexts/background-context.tsx +++ /dev/null @@ -1,387 +0,0 @@ -"use client"; - -import { createContext, useContext, useState, ReactNode, useEffect, useRef, useCallback, useMemo } from "react"; -import { store } from "@/lib/store"; - -type BackgroundMode = "none" | "preset" | "image" | "dynamic"; - -interface PresetBackground { - id: number; - name: string; - path: string; -} - -const PRESET_BACKGROUNDS: PresetBackground[] = [ - { id: 1, name: "预设1", path: "/backgrounds/preset1.jpg" }, - { id: 2, name: "预设2", path: "/backgrounds/preset2.jpg" }, - { id: 3, name: "预设3", path: "/backgrounds/preset3.png" }, - { id: 4, name: "预设4", path: "/backgrounds/preset4.png" }, -]; - -type LiquidGlassMode = "normal" | "real"; - -interface BackgroundContextType { - backgroundMode: BackgroundMode; - customBgImages: string[]; - activeBgIndex: number; - dynamicBgVideo: string | null; - liquidGlassEnabled: boolean; - liquidGlassBlur: number; - liquidGlassMode: LiquidGlassMode; - backgroundBlur: number; - activePresetIndex: number; - presetBackgrounds: PresetBackground[]; - carouselEnabled: boolean; - jellyBounceEnabled: boolean; - setBackgroundMode: (mode: BackgroundMode) => void; - setCustomBgImages: (images: string[]) => void; - addCustomBgImage: (image: string) => boolean; - removeCustomBgImage: (index: number) => void; - setActiveBgIndex: (index: number) => void; - setDynamicBgVideo: (video: string | null) => void; - setLiquidGlassEnabled: (enabled: boolean) => void; - setLiquidGlassBlur: (blur: number) => void; - setLiquidGlassMode: (mode: LiquidGlassMode) => void; - setBackgroundBlur: (blur: number) => void; - setActivePresetIndex: (index: number) => void; - setCarouselEnabled: (enabled: boolean) => void; - setJellyBounceEnabled: (enabled: boolean) => void; -} - -const BackgroundContext = createContext({ - backgroundMode: "none", - customBgImages: [], - activeBgIndex: 0, - dynamicBgVideo: null, - liquidGlassEnabled: false, - liquidGlassBlur: 1, - liquidGlassMode: "normal", - backgroundBlur: 0, - activePresetIndex: 0, - presetBackgrounds: PRESET_BACKGROUNDS, - carouselEnabled: false, - jellyBounceEnabled: false, - setBackgroundMode: () => {}, - setCustomBgImages: () => {}, - addCustomBgImage: () => false, - removeCustomBgImage: () => {}, - setActiveBgIndex: () => {}, - setDynamicBgVideo: () => {}, - setLiquidGlassEnabled: () => {}, - setLiquidGlassBlur: () => {}, - setLiquidGlassMode: () => {}, - setBackgroundBlur: () => {}, - setActivePresetIndex: () => {}, - setCarouselEnabled: () => {}, - setJellyBounceEnabled: () => {}, -}); - -export function useBackground() { - return useContext(BackgroundContext); -} - - -const MAX_BG_IMAGES = 3; - -export function BackgroundProvider({ children }: { children: ReactNode }) { - const [backgroundMode, setBackgroundMode] = useState("none"); - const [customBgImages, setCustomBgImages] = useState([]); - const [activeBgIndex, setActiveBgIndex] = useState(0); - const [dynamicBgVideo, setDynamicBgVideo] = useState(null); - const [liquidGlassEnabled, setLiquidGlassEnabled] = useState(false); - const [liquidGlassBlur, setLiquidGlassBlur] = useState(1); - const [liquidGlassMode, setLiquidGlassMode] = useState("normal"); - const [backgroundBlur, setBackgroundBlur] = useState(0); - const [activePresetIndex, setActivePresetIndex] = useState(0); - const [carouselEnabled, setCarouselEnabled] = useState(false); - const [jellyBounceEnabled, setJellyBounceEnabled] = useState(false); - - useEffect(() => { - async function loadSettings() { - try { - // 批量读取所有设置,减少 store IO 调用次数 - const [savedMode, savedImages, savedActiveIndex, savedDynamicVideo, savedLiquidGlass, savedLiquidGlassBlur, savedLiquidGlassMode, savedBgBlur, savedActivePreset, savedCarousel, savedJellyBounce, hasLaunched] = - await Promise.all([ - store.get("background-mode"), - store.get("custom-bg-images"), - store.get("active-bg-index"), - store.get("dynamic-bg-video"), - store.get("liquid-glass-enabled"), - store.get("liquid-glass-blur"), - store.get("liquid-glass-mode"), - store.get("background-blur"), - store.get("active-preset-index"), - store.get("carousel-enabled"), - store.get("jelly-bounce-enabled"), - store.get("has-launched"), - ]); - - // 兼容旧版 liquid-glass-enhanced 设置 - const savedLiquidGlassEnhanced = await store.get("liquid-glass-enhanced"); - if (savedLiquidGlassEnhanced === true && !savedLiquidGlassMode) { - setLiquidGlassMode("real"); - persist("liquid-glass-mode", "real"); - persistDelete("liquid-glass-enhanced"); - } - - // 检测是否首次启动 - if (!hasLaunched) { - // 首次启动默认启用预设背景和自动轮播,并直接持久化 - const defaultMode: BackgroundMode = "preset"; - const defaultPresetIndex = 0; - const defaultCarousel = true; - setBackgroundMode(defaultMode); - setActivePresetIndex(defaultPresetIndex); - setCarouselEnabled(defaultCarousel); - await store.set("background-mode", defaultMode); - await store.set("active-preset-index", defaultPresetIndex); - await store.set("carousel-enabled", defaultCarousel); - await store.set("has-launched", true); - await store.save(); - } else { - // 非首次启动,加载保存的设置 - if (savedMode && ["none", "preset", "image", "dynamic"].includes(savedMode)) { - setBackgroundMode(savedMode as BackgroundMode); - } - if (savedActivePreset !== null && savedActivePreset !== undefined) { - setActivePresetIndex(savedActivePreset); - } - if (savedCarousel !== null && savedCarousel !== undefined) { - setCarouselEnabled(savedCarousel); - } - } - - if (savedImages && Array.isArray(savedImages)) { - setCustomBgImages(savedImages); - } - if (savedActiveIndex !== null && savedActiveIndex !== undefined) { - setActiveBgIndex(savedActiveIndex); - } - if (savedDynamicVideo) { - setDynamicBgVideo(savedDynamicVideo); - } - if (savedLiquidGlass !== null && savedLiquidGlass !== undefined) { - setLiquidGlassEnabled(savedLiquidGlass); - } - if (savedLiquidGlassBlur !== null && savedLiquidGlassBlur !== undefined) { - setLiquidGlassBlur(savedLiquidGlassBlur); - } - if (savedLiquidGlassMode === "normal" || savedLiquidGlassMode === "real") { - setLiquidGlassMode(savedLiquidGlassMode); - } - if (savedBgBlur !== null && savedBgBlur !== undefined) { - setBackgroundBlur(savedBgBlur); - } - if (savedJellyBounce !== null && savedJellyBounce !== undefined) { - setJellyBounceEnabled(savedJellyBounce); - } - } catch (error) { - console.error("Failed to load background settings:", error); - } - } - - loadSettings(); - }, []); - - // ─── 显式持久化 helper ─────────────────────────────────────────────── - // 和"能保存的"项使用完全相同的方式:store.set / store.delete + store.save。 - // 不再依赖 useEffect 批量保存,彻底消除闭包过期 / 竞态导致丢值的问题。 - // - // 优化:按 key 合并 + 短延迟批量 flush。 - // - 同一个 key 在 250ms 内连续修改只保留最新值(滑块拖动不会积压上百次 IPC)。 - // - 多个不同 key 的修改会合并到同一次 store.save() 写盘。 - // - flush 用串行链保证不会并发写盘互相覆盖。 - const pendingValuesRef = useRef>({}); - const pendingDeleteKeysRef = useRef>(new Set()); - const flushTimerRef = useRef | null>(null); - const flushChainRef = useRef>(Promise.resolve()); - - const flush = useCallback(() => { - const values = pendingValuesRef.current; - const deletes = pendingDeleteKeysRef.current; - pendingValuesRef.current = {}; - pendingDeleteKeysRef.current = new Set(); - flushChainRef.current = flushChainRef.current.then(async () => { - try { - for (const [key, value] of Object.entries(values)) { - await store.set(key, value); - } - for (const key of deletes) { - await store.delete(key); - } - await store.save(); - } catch (e) { - console.error("[Persist] flush failed:", e); - } - }); - }, []); - - const scheduleFlush = useCallback(() => { - if (flushTimerRef.current) clearTimeout(flushTimerRef.current); - flushTimerRef.current = setTimeout(() => { - flushTimerRef.current = null; - flush(); - }, 250); - }, [flush]); - - const persist = useCallback((key: string, value: unknown) => { - pendingValuesRef.current[key] = value; - pendingDeleteKeysRef.current.delete(key); - scheduleFlush(); - }, [scheduleFlush]); - - const persistDelete = useCallback((key: string) => { - pendingDeleteKeysRef.current.add(key); - delete pendingValuesRef.current[key]; - scheduleFlush(); - }, [scheduleFlush]); - - // ─── 对外暴露的 setter:更新 state + 立即持久化 ────────────────────── - const setBackgroundModePersist = useCallback((mode: BackgroundMode) => { - setBackgroundMode(mode); - persist("background-mode", mode); - }, [persist]); - - const setCustomBgImagesPersist = useCallback((images: string[]) => { - setCustomBgImages(images); - if (images.length > 0) { - persist("custom-bg-images", images); - } else { - persistDelete("custom-bg-images"); - } - }, [persist, persistDelete]); - - const setActiveBgIndexPersist = useCallback((index: number) => { - setActiveBgIndex(index); - persist("active-bg-index", index); - }, [persist]); - - const setDynamicBgVideoPersist = useCallback((video: string | null) => { - setDynamicBgVideo(video); - if (video) { - persist("dynamic-bg-video", video); - } else { - persistDelete("dynamic-bg-video"); - } - }, [persist, persistDelete]); - - const setLiquidGlassEnabledPersist = useCallback((enabled: boolean) => { - setLiquidGlassEnabled(enabled); - persist("liquid-glass-enabled", enabled); - }, [persist]); - - const setLiquidGlassBlurPersist = useCallback((blur: number) => { - setLiquidGlassBlur(blur); - persist("liquid-glass-blur", blur); - }, [persist]); - - const setLiquidGlassModePersist = useCallback((mode: LiquidGlassMode) => { - setLiquidGlassMode(mode); - persist("liquid-glass-mode", mode); - }, [persist]); - - const setBackgroundBlurPersist = useCallback((blur: number) => { - setBackgroundBlur(blur); - persist("background-blur", blur); - }, [persist]); - - const setActivePresetIndexPersist = useCallback((index: number) => { - setActivePresetIndex(index); - persist("active-preset-index", index); - }, [persist]); - - const setCarouselEnabledPersist = useCallback((enabled: boolean) => { - setCarouselEnabled(enabled); - persist("carousel-enabled", enabled); - }, [persist]); - - const setJellyBounceEnabledPersist = useCallback((enabled: boolean) => { - setJellyBounceEnabled(enabled); - persist("jelly-bounce-enabled", enabled); - }, [persist]); - - // 预设壁纸轮播定时器 - // 轮播是临时展示,用内部 setActivePresetIndex(不持久化), - // 避免每 10 秒写一次磁盘;用户手动切换预设时才走 setActivePresetIndexPersist 持久化。 - const carouselTimerRef = useRef | null>(null); - - useEffect(() => { - if (backgroundMode === "preset" && carouselEnabled) { - carouselTimerRef.current = setInterval(() => { - setActivePresetIndex((prev) => (prev + 1) % PRESET_BACKGROUNDS.length); - }, 10000); - } else { - if (carouselTimerRef.current) { - clearInterval(carouselTimerRef.current); - carouselTimerRef.current = null; - } - } - - return () => { - if (carouselTimerRef.current) { - clearInterval(carouselTimerRef.current); - carouselTimerRef.current = null; - } - }; - }, [backgroundMode, carouselEnabled]); - - const addCustomBgImage = useCallback((image: string): boolean => { - if (customBgImages.length >= MAX_BG_IMAGES) { - return false; - } - const newImages = [...customBgImages, image]; - setCustomBgImages(newImages); - persist("custom-bg-images", newImages); - return true; - }, [customBgImages, persist]); - - const removeCustomBgImage = useCallback((index: number) => { - const newImages = customBgImages.filter((_, i) => i !== index); - setCustomBgImages(newImages); - if (newImages.length > 0) { - persist("custom-bg-images", newImages); - } else { - persistDelete("custom-bg-images"); - } - if (activeBgIndex >= newImages.length) { - const newIdx = Math.max(0, newImages.length - 1); - setActiveBgIndex(newIdx); - persist("active-bg-index", newIdx); - } - }, [customBgImages, activeBgIndex, persist, persistDelete]); - - // useMemo 稳定 context value,避免每次渲染创建新对象导致所有消费者重渲染 - const value = useMemo(() => ({ - backgroundMode, - customBgImages, - activeBgIndex, - dynamicBgVideo, - liquidGlassEnabled, - liquidGlassBlur, - liquidGlassMode, - backgroundBlur, - activePresetIndex, - presetBackgrounds: PRESET_BACKGROUNDS, - carouselEnabled, - jellyBounceEnabled, - setBackgroundMode: setBackgroundModePersist, - setCustomBgImages: setCustomBgImagesPersist, - addCustomBgImage, - removeCustomBgImage, - setActiveBgIndex: setActiveBgIndexPersist, - setDynamicBgVideo: setDynamicBgVideoPersist, - setLiquidGlassEnabled: setLiquidGlassEnabledPersist, - setLiquidGlassBlur: setLiquidGlassBlurPersist, - setLiquidGlassMode: setLiquidGlassModePersist, - setBackgroundBlur: setBackgroundBlurPersist, - setActivePresetIndex: setActivePresetIndexPersist, - setCarouselEnabled: setCarouselEnabledPersist, - setJellyBounceEnabled: setJellyBounceEnabledPersist, - }), [backgroundMode, customBgImages, activeBgIndex, dynamicBgVideo, liquidGlassEnabled, liquidGlassBlur, liquidGlassMode, backgroundBlur, activePresetIndex, carouselEnabled, jellyBounceEnabled, setBackgroundModePersist, setCustomBgImagesPersist, addCustomBgImage, removeCustomBgImage, setActiveBgIndexPersist, setDynamicBgVideoPersist, setLiquidGlassEnabledPersist, setLiquidGlassBlurPersist, setLiquidGlassModePersist, setBackgroundBlurPersist, setActivePresetIndexPersist, setCarouselEnabledPersist, setJellyBounceEnabledPersist]); - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/contexts/font-context.tsx b/参考/NexBox-main/src/contexts/font-context.tsx deleted file mode 100644 index af395a2..0000000 --- a/参考/NexBox-main/src/contexts/font-context.tsx +++ /dev/null @@ -1,257 +0,0 @@ -"use client"; - -import { createContext, useContext, useState, ReactNode, useEffect, useCallback, useMemo, useRef } from "react"; -import { store } from "@/lib/store"; - -/** 可选字体项 */ -export interface FontOption { - /** 存储值(CSS font-family 名称) */ - value: string; - /** 显示名称 */ - label: string; - /** 是否为用户导入的自定义字体 */ - isCustom?: boolean; -} - -/** 自定义字体记录(持久化) */ -interface CustomFontRecord { - /** CSS font-family 名称 */ - value: string; - /** 显示名称 */ - label: string; - /** base64 编码的字体数据 */ - data: string; - /** mime 类型 */ - format: string; -} - -/** 内置可选字体列表 */ -export const BUILTIN_FONT_OPTIONS: FontOption[] = [ - { value: "MiSans", label: "MiSans" }, - { value: "Sinter-Regular", label: "Sinter" }, - { value: "AiDianFengYaHei", label: "AiDianFengYaHei" }, - { value: "Cubic", label: "Cubic" }, -]; - -/** 默认字体 */ -export const DEFAULT_FONT = "MiSans"; - -interface FontContextType { - /** 当前字体 */ - font: string; - /** 设置字体 */ - setFont: (font: string) => void; - /** 恢复默认 */ - resetToDefault: () => void; - /** 所有可选字体(内置 + 自定义) */ - fontOptions: FontOption[]; - /** 导入自定义字体 */ - importCustomFont: (file: File) => Promise; - /** 删除自定义字体 */ - removeCustomFont: (value: string) => void; - /** 正在导入 */ - importing: boolean; -} - -const FontContext = createContext({ - font: DEFAULT_FONT, - setFont: () => {}, - resetToDefault: () => {}, - fontOptions: BUILTIN_FONT_OPTIONS, - importCustomFont: async () => {}, - removeCustomFont: () => {}, - importing: false, -}); - -export function useFont() { - return useContext(FontContext); -} - -/** 从文件名提取字体显示名 */ -function getFontLabel(fileName: string): string { - const base = fileName.replace(/\.(ttf|otf|woff|woff2)$/i, ""); - // 去掉常见的版本后缀 - return base.replace(/[-_](\d+|Medium|Regular|Bold|Light|Thin|Black|SemiBold|ExtraBold)$/i, "").replace(/[-_]/g, " "); -} - -/** 从文件名推断 font-format */ -function getFontFormat(fileName: string): string { - const ext = fileName.split(".").pop()?.toLowerCase(); - switch (ext) { - case "ttf": return "truetype"; - case "otf": return "opentype"; - case "woff": return "woff"; - case "woff2": return "woff2"; - default: return "truetype"; - } -} - -/** 用 FontFace API 注册一个字体 */ -async function registerFontFace(name: string, base64Data: string, format: string) { - try { - const fontFace = new FontFace(name, `url(data:font/${format === "opentype" ? "opentype" : format};base64,${base64Data})`); - await fontFace.load(); - document.fonts.add(fontFace); - } catch (error) { - console.error(`Failed to register font "${name}":`, error); - } -} - -export function FontProvider({ children }: { children: ReactNode }) { - const [font, setFontState] = useState(DEFAULT_FONT); - const [customFonts, setCustomFonts] = useState([]); - const [isLoaded, setIsLoaded] = useState(false); - const [importing, setImporting] = useState(false); - const fontRef = useRef(font); - - // 加载已保存的字体设置和自定义字体 - useEffect(() => { - async function loadSettings() { - try { - // 加载当前选中字体 - const savedFont = await store.get("app-font-family"); - if (savedFont) { - setFontState(savedFont); - fontRef.current = savedFont; - } - - // 加载自定义字体列表 - const savedCustomFonts = await store.get("app-custom-fonts"); - if (savedCustomFonts && Array.isArray(savedCustomFonts) && savedCustomFonts.length > 0) { - // 先注册所有自定义字体到 document.fonts - for (const cf of savedCustomFonts) { - await registerFontFace(cf.value, cf.data, cf.format); - } - setCustomFonts(savedCustomFonts); - } - - setIsLoaded(true); - } catch (error) { - console.error("Failed to load font settings:", error); - setIsLoaded(true); - } - } - loadSettings(); - }, []); - - // 应用字体到 CSS 变量 - useEffect(() => { - if (!isLoaded) return; - document.documentElement.style.setProperty("--app-font-family", `"${font}"`); - fontRef.current = font; - }, [font, isLoaded]); - - // 持久化当前选中字体 - useEffect(() => { - if (!isLoaded) return; - async function saveFont() { - try { - await store.set("app-font-family", font); - await store.save(); - } catch (error) { - console.error("Failed to save font settings:", error); - } - } - saveFont(); - }, [font, isLoaded]); - - // 持久化自定义字体列表 - useEffect(() => { - if (!isLoaded) return; - async function saveCustomFonts() { - try { - await store.set("app-custom-fonts", customFonts); - await store.save(); - } catch (error) { - console.error("Failed to save custom fonts:", error); - } - } - saveCustomFonts(); - }, [customFonts, isLoaded]); - - const setFont = useCallback((newFont: string) => { - setFontState(newFont); - }, []); - - const resetToDefault = useCallback(() => { - setFontState(DEFAULT_FONT); - }, []); - - /** 导入自定义字体 */ - const importCustomFont = useCallback(async (file: File) => { - setImporting(true); - try { - const fileName = file.name; - const format = getFontFormat(fileName); - const label = getFontLabel(fileName); - // 用文件名(去扩展名)作为 CSS font-family 名,确保唯一性 - const value = fileName.replace(/\.(ttf|otf|woff|woff2)$/i, "").replace(/\s+/g, "-"); - - // 检查是否已存在同名字体 - const exists = customFonts.some(cf => cf.value === value); - if (exists) { - throw new Error("DUPLICATE_FONT"); - } - - // 读取文件为 base64 - const arrayBuffer = await file.arrayBuffer(); - const bytes = new Uint8Array(arrayBuffer); - let binary = ""; - for (let i = 0; i < bytes.length; i++) { - binary += String.fromCharCode(bytes[i]); - } - const base64Data = btoa(binary); - - // 注册到 document.fonts - await registerFontFace(value, base64Data, format); - - // 添加到自定义字体列表 - setCustomFonts(prev => [...prev, { value, label, data: base64Data, format }]); - } finally { - setImporting(false); - } - }, [customFonts]); - - /** 删除自定义字体 */ - const removeCustomFont = useCallback((value: string) => { - // 从 document.fonts 中移除 - const fontFaces = document.fonts; - fontFaces.forEach(ff => { - if (ff.family === `"${value}"` || ff.family === value) { - fontFaces.delete(ff); - } - }); - - // 从列表中移除 - setCustomFonts(prev => prev.filter(cf => cf.value !== value)); - - // 如果当前正在使用被删除的字体,恢复默认 - if (fontRef.current === value) { - setFontState(DEFAULT_FONT); - } - }, []); - - /** 合并内置 + 自定义字体选项 */ - const fontOptions = useMemo(() => { - return [ - ...BUILTIN_FONT_OPTIONS, - ...customFonts.map(cf => ({ value: cf.value, label: cf.label, isCustom: true })), - ]; - }, [customFonts]); - - const value = useMemo(() => ({ - font, - setFont, - resetToDefault, - fontOptions, - importCustomFont, - removeCustomFont, - importing, - }), [font, setFont, resetToDefault, fontOptions, importCustomFont, removeCustomFont, importing]); - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/contexts/music-context.tsx b/参考/NexBox-main/src/contexts/music-context.tsx deleted file mode 100644 index 545e07d..0000000 --- a/参考/NexBox-main/src/contexts/music-context.tsx +++ /dev/null @@ -1,284 +0,0 @@ -import { createContext, useContext, useState, useCallback, useRef, useEffect, ReactNode } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { Store } from "@tauri-apps/plugin-store"; - -interface MusicFile { - name: string; - path: string; -} - -type PlayMode = "list" | "shuffle" | "one"; - -interface MusicContextType { - musicFiles: MusicFile[]; - currentIndex: number; - isPlaying: boolean; - currentTime: number; - duration: number; - volume: number; - isMuted: boolean; - playMode: PlayMode; - currentFileName: string | null; - togglePlay: () => void; - stopPlayback: () => void; - setVolume: (v: number) => void; - toggleMute: () => void; - nextTrack: () => void; - prevTrack: () => void; - seekTo: (time: number) => void; - playTrack: (index: number) => void; -} - -const MusicContext = createContext(null); - -let storeInstance: Store | null = null; - -const getStore = async (): Promise => { - if (!storeInstance) { - storeInstance = await Store.load("music-player-settings.json"); - } - return storeInstance; -}; - -export function useMusicPlayer() { - const context = useContext(MusicContext); - if (!context) { - throw new Error("useMusicPlayer must be used within MusicProvider"); - } - return context; -} - -export function MusicProvider({ children }: { children: ReactNode }) { - const [musicFiles, setMusicFiles] = useState([]); - const [currentIndex, setCurrentIndex] = useState(0); - const [isPlaying, setIsPlaying] = useState(false); - const [currentTime, setCurrentTime] = useState(0); - const [duration, setDuration] = useState(0); - const [volume, setVolumeState] = useState(0.7); - const [isMuted, setIsMuted] = useState(false); - const [playMode, setPlayMode] = useState("list"); - - const audioRef = useRef(null); - - useEffect(() => { - loadSettings(); - loadMusicFiles(); - }, []); - - useEffect(() => { - if (!audioRef.current && typeof document !== "undefined") { - const audio = document.createElement("audio"); - audio.style.display = "none"; - document.body.appendChild(audio); - audioRef.current = audio; - - audio.addEventListener("timeupdate", () => { - if (audioRef.current) { - setCurrentTime(audioRef.current.currentTime); - } - }); - - audio.addEventListener("loadedmetadata", () => { - if (audioRef.current) { - setDuration(audioRef.current.duration); - } - }); - - audio.addEventListener("ended", handleEnded); - } - - return () => { - if (audioRef.current && audioRef.current.parentNode) { - audioRef.current.pause(); - audioRef.current.src = ""; - audioRef.current.parentNode.removeChild(audioRef.current); - audioRef.current = null; - } - }; - }, []); - - const loadSettings = async () => { - try { - const s = await getStore(); - const savedVolume = await s.get("volume"); - if (savedVolume !== undefined && savedVolume !== null) { - setVolumeState(savedVolume); - } - const savedMode = await s.get("playMode"); - if (savedMode) { - setPlayMode(savedMode); - } - } catch (error) { - console.error("Failed to load music settings:", error); - } - }; - - const saveSetting = async (key: string, value: unknown) => { - try { - const s = await getStore(); - await s.set(key, value); - await s.save(); - } catch (error) { - console.error("Failed to save setting:", error); - } - }; - - const loadMusicFiles = async () => { - try { - const files = await invoke("get_music_files"); - setMusicFiles(files); - } catch (error) { - console.error("Failed to load music files:", error); - } - }; - - const switchToIndex = useCallback((newIndex: number) => { - if (!audioRef.current || musicFiles.length === 0 || newIndex < 0 || newIndex >= musicFiles.length) return; - - const file = musicFiles[newIndex]; - const newSrc = `/${file.path}`; - - const audio = audioRef.current; - audio.src = newSrc; - audio.volume = isMuted ? 0 : volume; - audio.load(); - audio.play().catch(() => {}); - - setCurrentTime(0); - setDuration(0); - setCurrentIndex(newIndex); - setIsPlaying(true); - }, [musicFiles, volume, isMuted]); - - const handleEnded = useCallback(() => { - if (playMode === "one") { - if (audioRef.current) { - audioRef.current.currentTime = 0; - audioRef.current.play().catch(() => {}); - } - } else if (currentIndex < musicFiles.length - 1 || playMode === "list") { - let nextIndex = currentIndex + 1; - if (nextIndex >= musicFiles.length) { - nextIndex = 0; - } - switchToIndex(nextIndex); - } else { - setIsPlaying(false); - } - }, [playMode, currentIndex, musicFiles.length, switchToIndex]); - - const togglePlay = useCallback(async () => { - if (!audioRef.current || musicFiles.length === 0) return; - - const currentFile = musicFiles[currentIndex]; - - if (!currentFile) { - switchToIndex(0); - return; - } - - const audio = audioRef.current; - if (isPlaying) { - audio.pause(); - setIsPlaying(false); - } else { - if (audio.src === "" || !audio.src.includes(currentFile.path)) { - audio.src = `/${currentFile.path}`; - audio.volume = isMuted ? 0 : volume; - audio.load(); - } - try { - await audio.play(); - setIsPlaying(true); - } catch { - setIsPlaying(false); - } - } - }, [isPlaying, currentIndex, musicFiles, volume, isMuted, switchToIndex]); - - const stopPlayback = useCallback(() => { - if (audioRef.current) { - audioRef.current.pause(); - audioRef.current.currentTime = 0; - setIsPlaying(false); - setCurrentTime(0); - } - }, []); - - const setVolume = useCallback((v: number) => { - setVolumeState(v); - saveSetting("volume", v); - if (audioRef.current) { - audioRef.current.volume = v; - if (v > 0 && isMuted) { - setIsMuted(false); - } - } - }, [isMuted]); - - const toggleMute = useCallback(() => { - if (audioRef.current) { - audioRef.current.muted = !isMuted; - setIsMuted(!isMuted); - } - }, [isMuted]); - - const nextTrack = useCallback(() => { - if (musicFiles.length === 0) return; - let nextIndex = currentIndex + 1; - if (nextIndex >= musicFiles.length) { - nextIndex = 0; - } - switchToIndex(nextIndex); - }, [musicFiles, currentIndex, switchToIndex]); - - const prevTrack = useCallback(() => { - if (musicFiles.length === 0) return; - let prevIndex = currentIndex - 1; - if (prevIndex < 0) { - prevIndex = musicFiles.length - 1; - } - switchToIndex(prevIndex); - }, [musicFiles, currentIndex, switchToIndex]); - - const seekTo = useCallback((time: number) => { - if (audioRef.current) { - audioRef.current.currentTime = time; - setCurrentTime(time); - } - }, []); - - const playTrack = useCallback((index: number) => { - if (index >= 0 && index < musicFiles.length) { - switchToIndex(index); - } - }, [musicFiles, switchToIndex]); - - const currentFileName = musicFiles[currentIndex]?.name ?? null; - - const value: MusicContextType = { - musicFiles, - currentIndex, - isPlaying, - currentTime, - duration, - volume, - isMuted, - playMode, - currentFileName, - togglePlay, - stopPlayback, - setVolume, - toggleMute, - nextTrack, - prevTrack, - seekTo, - playTrack, - }; - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/contexts/theme-color-context.tsx b/参考/NexBox-main/src/contexts/theme-color-context.tsx deleted file mode 100644 index 81c16a2..0000000 --- a/参考/NexBox-main/src/contexts/theme-color-context.tsx +++ /dev/null @@ -1,162 +0,0 @@ -"use client"; - -import { createContext, useContext, useState, ReactNode, useEffect, useCallback, useMemo } from "react"; -import { store } from "@/lib/store"; -import { hexToRgba, getContrastColor, isValidHexColor, normalizeHexColor } from "@/lib/color-utils"; - -export interface ThemeColorConfig { - primaryColor: string; - hoverOpacity: number; - activeOpacity: number; - borderOpacity: number; -} - -export const DEFAULT_THEME_COLOR_CONFIG: ThemeColorConfig = { - primaryColor: "#98DDD0", - hoverOpacity: 0.2, - activeOpacity: 0.3, - borderOpacity: 0.4, -}; - -interface ThemeColorContextType { - config: ThemeColorConfig; - setPrimaryColor: (color: string) => void; - setHoverOpacity: (opacity: number) => void; - setActiveOpacity: (opacity: number) => void; - setBorderOpacity: (opacity: number) => void; - resetToDefault: () => void; - getHoverColor: (isDark?: boolean) => string; - getActiveColor: () => string; - getBorderColor: () => string; - getContrastTextColor: () => string; -} - -const ThemeColorContext = createContext({ - config: DEFAULT_THEME_COLOR_CONFIG, - setPrimaryColor: () => {}, - setHoverOpacity: () => {}, - setActiveOpacity: () => {}, - setBorderOpacity: () => {}, - resetToDefault: () => {}, - getHoverColor: () => "rgba(152,221,208,0.2)", - getActiveColor: () => "#98DDD0", - getBorderColor: () => "rgba(152,221,208,0.4)", - getContrastTextColor: () => "#1a1a1a", -}); - -export function useThemeColor() { - return useContext(ThemeColorContext); -} - -export function ThemeColorProvider({ children }: { children: ReactNode }) { - const [config, setConfig] = useState(DEFAULT_THEME_COLOR_CONFIG); - const [isLoaded, setIsLoaded] = useState(false); - - useEffect(() => { - async function loadSettings() { - try { - const savedPrimaryColor = await store.get("theme-primary-color"); - const savedHoverOpacity = await store.get("theme-hover-opacity"); - const savedActiveOpacity = await store.get("theme-active-opacity"); - const savedBorderOpacity = await store.get("theme-border-opacity"); - - if (savedPrimaryColor && isValidHexColor(savedPrimaryColor)) { - setConfig(prev => ({ ...prev, primaryColor: normalizeHexColor(savedPrimaryColor) })); - } - if (savedHoverOpacity !== null && savedHoverOpacity !== undefined) { - setConfig(prev => ({ ...prev, hoverOpacity: savedHoverOpacity })); - } - if (savedActiveOpacity !== null && savedActiveOpacity !== undefined) { - setConfig(prev => ({ ...prev, activeOpacity: savedActiveOpacity })); - } - if (savedBorderOpacity !== null && savedBorderOpacity !== undefined) { - setConfig(prev => ({ ...prev, borderOpacity: savedBorderOpacity })); - } - - setIsLoaded(true); - } catch (error) { - console.error("Failed to load theme color settings:", error); - setIsLoaded(true); - } - } - - loadSettings(); - }, []); - - useEffect(() => { - if (!isLoaded) return; - - async function saveSettings() { - try { - await store.set("theme-primary-color", config.primaryColor); - await store.set("theme-hover-opacity", config.hoverOpacity); - await store.set("theme-active-opacity", config.activeOpacity); - await store.set("theme-border-opacity", config.borderOpacity); - await store.save(); - } catch (error) { - console.error("Failed to save theme color settings:", error); - } - } - - saveSettings(); - }, [config, isLoaded]); - - const setPrimaryColor = useCallback((color: string) => { - if (isValidHexColor(color)) { - setConfig(prev => ({ ...prev, primaryColor: normalizeHexColor(color) })); - } - }, []); - - const setHoverOpacity = useCallback((opacity: number) => { - setConfig(prev => ({ ...prev, hoverOpacity: Math.max(0, Math.min(1, opacity)) })); - }, []); - - const setActiveOpacity = useCallback((opacity: number) => { - setConfig(prev => ({ ...prev, activeOpacity: Math.max(0, Math.min(1, opacity)) })); - }, []); - - const setBorderOpacity = useCallback((opacity: number) => { - setConfig(prev => ({ ...prev, borderOpacity: Math.max(0, Math.min(1, opacity)) })); - }, []); - - const resetToDefault = useCallback(() => { - setConfig(DEFAULT_THEME_COLOR_CONFIG); - }, []); - - const getHoverColor = useCallback((isDark: boolean = true) => { - const opacity = isDark ? config.hoverOpacity + 0.1 : config.hoverOpacity; - return hexToRgba(config.primaryColor, opacity); - }, [config.hoverOpacity, config.primaryColor]); - - const getActiveColor = useCallback(() => { - return config.primaryColor; - }, [config.primaryColor]); - - const getBorderColor = useCallback(() => { - return hexToRgba(config.primaryColor, config.borderOpacity); - }, [config.primaryColor, config.borderOpacity]); - - const getContrastTextColor = useCallback(() => { - return getContrastColor(config.primaryColor); - }, [config.primaryColor]); - - // useMemo 稳定 context value,避免每次渲染创建新对象导致所有消费者重渲染 - const value = useMemo(() => ({ - config, - setPrimaryColor, - setHoverOpacity, - setActiveOpacity, - setBorderOpacity, - resetToDefault, - getHoverColor, - getActiveColor, - getBorderColor, - getContrastTextColor, - }), [config, setPrimaryColor, setHoverOpacity, setActiveOpacity, setBorderOpacity, resetToDefault, getHoverColor, getActiveColor, getBorderColor, getContrastTextColor]); - - return ( - - {children} - - ); -} diff --git a/参考/NexBox-main/src/hooks/use-cover-color.ts b/参考/NexBox-main/src/hooks/use-cover-color.ts deleted file mode 100644 index 3e6c35b..0000000 --- a/参考/NexBox-main/src/hooks/use-cover-color.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { useEffect, useState } from "react"; - -interface CoverColor { - hex: string; // 主色 hex 值 - isLight: boolean; // 是否为浅色 - rgb: [number, number, number]; -} - -/** - * 从图片提取主导颜色 - * 使用 Canvas 采样像素,计算平均颜色 - */ -function extractDominantColor(img: HTMLImageElement): CoverColor { - const canvas = document.createElement("canvas"); - const size = 100; // 缩小到 100x100 加速采样 - canvas.width = size; - canvas.height = size; - const ctx = canvas.getContext("2d"); - if (!ctx) return { hex: "#1a1a2e", isLight: false, rgb: [26, 26, 46] }; - - ctx.drawImage(img, 0, 0, size, size); - const data = ctx.getImageData(0, 0, size, size).data; - - let r = 0, g = 0, b = 0; - let count = 0; - - // 采样每个像素,加权中心区域(忽略边缘) - for (let y = 0; y < size; y++) { - for (let x = 0; x < size; x++) { - const idx = (y * size + x) * 4; - const alpha = data[idx + 3]; - if (alpha < 128) continue; // 跳过透明像素 - - // 中心区域权重更高 - const cx = Math.abs(x - size / 2) / (size / 2); - const cy = Math.abs(y - size / 2) / (size / 2); - const weight = 1 - Math.min(cx + cy, 1) * 0.5; - - r += data[idx] * weight; - g += data[idx + 1] * weight; - b += data[idx + 2] * weight; - count += weight; - } - } - - if (count === 0) return { hex: "#1a1a2e", isLight: false, rgb: [26, 26, 46] }; - - r = Math.round(r / count); - g = Math.round(g / count); - b = Math.round(b / count); - - // 增强饱和度 - const avg = (r + g + b) / 3; - r = Math.min(255, Math.max(0, Math.round(r + (r - avg) * 0.35))); - g = Math.min(255, Math.max(0, Math.round(g + (g - avg) * 0.35))); - b = Math.min(255, Math.max(0, Math.round(b + (b - avg) * 0.35))); - - const hex = "#" + [r, g, b].map((v) => v.toString(16).padStart(2, "0")).join(""); - - // 计算相对亮度 (WCAG) - const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255; - const isLight = luminance > 0.55; - - return { hex, isLight, rgb: [r, g, b] }; -} - -const DEFAULT_COLOR: CoverColor = { hex: "#1a1a2e", isLight: false, rgb: [26, 26, 46] }; - -// 缓存:同一 URL 不重复提取,避免 Strict Mode 双调用和重复展开时重复计算 -const coverColorCache = new Map(); - -/** - * 从专辑封面提取主色 - * - * 清理策略: - * - cancelled 标志防止卸载后 setState - * - 断开 onload/onerror 闭包引用,允许 GC - * - 不设置 img.src = ""(会取消图片加载) - * - 不使用 lastUrlRef 跳过(与 Strict Mode 双调用冲突,导致图片永不加载) - * - 用模块级缓存替代 lastUrlRef 去重 - */ -export function useCoverColor(coverUrl: string): CoverColor { - const [color, setColor] = useState(() => { - // 初始化时尝试从缓存读取,避免首次渲染闪烁 - return coverColorCache.get(coverUrl) ?? DEFAULT_COLOR; - }); - - useEffect(() => { - if (!coverUrl) return; - - // 缓存命中:直接使用,无需创建 Image - const cached = coverColorCache.get(coverUrl); - if (cached) { - setColor(cached); - return; - } - - let cancelled = false; - const img = new Image(); - img.crossOrigin = "anonymous"; - - img.onload = () => { - if (cancelled) return; - const c = extractDominantColor(img); - if (cancelled) return; - coverColorCache.set(coverUrl, c); - setColor(c); - }; - - img.onerror = () => { - if (cancelled) return; - setColor(DEFAULT_COLOR); - }; - - img.src = coverUrl; - - return () => { - cancelled = true; - img.onload = null; - img.onerror = null; - }; - }, [coverUrl]); - - return color; -} diff --git a/参考/NexBox-main/src/hooks/use-glow-effect.ts b/参考/NexBox-main/src/hooks/use-glow-effect.ts deleted file mode 100644 index 7060af1..0000000 --- a/参考/NexBox-main/src/hooks/use-glow-effect.ts +++ /dev/null @@ -1,62 +0,0 @@ -"use client"; - -import { useState, useCallback } from "react"; - -interface GlowEffectResult { - mouseX: number; - mouseY: number; - isHovering: boolean; - handleMouseMove: (e: React.MouseEvent) => void; - handleMouseLeave: () => void; - handleMouseEnter: () => void; -} - -export function useGlowEffect(): GlowEffectResult { - const [mouseX, setMouseX] = useState(50); - const [mouseY, setMouseY] = useState(50); - const [isHovering, setIsHovering] = useState(false); - - const handleMouseMove = useCallback((e: React.MouseEvent) => { - const rect = e.currentTarget.getBoundingClientRect(); - const x = ((e.clientX - rect.left) / rect.width) * 100; - const y = ((e.clientY - rect.top) / rect.height) * 100; - setMouseX(x); - setMouseY(y); - }, []); - - const handleMouseLeave = useCallback(() => { - setIsHovering(false); - }, []); - - const handleMouseEnter = useCallback(() => { - setIsHovering(true); - }, []); - - return { - mouseX, - mouseY, - isHovering, - handleMouseMove, - handleMouseLeave, - handleMouseEnter, - }; -} - -export function getBorderGlowStyle( - glowColor?: string, - borderWidth: number = 1 -): React.CSSProperties { - const color = glowColor || "rgba(255, 255, 255, 0.6)"; - - return { - position: "absolute" as const, - inset: `-${borderWidth}px`, - borderRadius: "inherit", - padding: `${borderWidth}px`, - background: color, - WebkitMask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)", - WebkitMaskComposite: "xor", - maskComposite: "exclude", - pointerEvents: "none" as const, - }; -} diff --git a/参考/NexBox-main/src/hooks/use-real-liquid-glass.ts b/参考/NexBox-main/src/hooks/use-real-liquid-glass.ts deleted file mode 100644 index 1737b88..0000000 --- a/参考/NexBox-main/src/hooks/use-real-liquid-glass.ts +++ /dev/null @@ -1,5 +0,0 @@ -"use client"; - -// 此文件已被 liquid-glass-svg-filter.tsx 替代 -// 保留空导出以兼容旧导入 -export {}; diff --git a/参考/NexBox-main/src/hooks/useDesktopLyricsSync.ts b/参考/NexBox-main/src/hooks/useDesktopLyricsSync.ts deleted file mode 100644 index 099fa4c..0000000 --- a/参考/NexBox-main/src/hooks/useDesktopLyricsSync.ts +++ /dev/null @@ -1,215 +0,0 @@ -/** - * 桌面歌词跨窗口通信 Hook - * - * 在桌面歌词窗口中运行,负责: - * 1. 监听主窗口发来的歌词数据、时间同步、播放状态、设置 - * 2. 通过 RAF 插值实现 60fps 平滑歌词进度 - * 3. 向主窗口发送控制指令 - */ - -import { useEffect, useRef, useState, useCallback } from "react"; -import { listen, emit, type UnlistenFn } from "@tauri-apps/api/event"; -import type { Song, KaraokeLine, PlayMode } from "@/types/music"; -import { Store } from "@tauri-apps/plugin-store"; - -export interface DesktopLyricsSettings { - fontSize: number; - highlightColor: string; - baseColor: string; - lineCount: 1 | 2; - isLocked: boolean; -} - -const DEFAULT_SETTINGS: DesktopLyricsSettings = { - fontSize: 36, - highlightColor: "#FFD700", - baseColor: "rgba(255,255,255,0.35)", - lineCount: 2, - isLocked: false, -}; - -export type ControlAction = - | "play-pause" - | "prev" - | "next" - | "toggle-shuffle" - | "lock" - | "unlock" - | "close"; - -export function useDesktopLyricsSync() { - const [song, setSong] = useState(null); - const [karaokeLines, setKaraokeLines] = useState([]); - const [isPlaying, setIsPlaying] = useState(false); - const [playMode, setPlayMode] = useState("list"); - const [settings, setSettings] = useState(DEFAULT_SETTINGS); - const [isLocked, setIsLocked] = useState(false); - const [estimatedTime, setEstimatedTime] = useState(0); - - // 时间插值 refs - const audioTimeRef = useRef(0); - const lastSyncRef = useRef(performance.now()); - const isPlayingRef = useRef(false); - const hasDataRef = useRef(false); - - // 初始化:从 Store 读取设置 - useEffect(() => { - (async () => { - try { - const store = await Store.load("music-player-settings.json"); - const fontSize = await store.get("desktopLyricsFontSize"); - const highlightColor = await store.get("desktopLyricsHighlightColor"); - const baseColor = await store.get("desktopLyricsBaseColor"); - const lineCount = await store.get<1 | 2>("desktopLyricsLineCount"); - const locked = await store.get("desktopLyricsLocked"); - setSettings((prev) => ({ - ...prev, - fontSize: fontSize ?? prev.fontSize, - highlightColor: highlightColor ?? prev.highlightColor, - baseColor: baseColor ?? prev.baseColor, - lineCount: lineCount ?? prev.lineCount, - isLocked: locked ?? prev.isLocked, - })); - setIsLocked(locked ?? false); - } catch { - // ignore - } - })(); - }, []); - - // 注册监听器 + 请求数据(合并为一次 effect,确保 listener 就绪后再 request) - useEffect(() => { - let unlistenFns: UnlistenFn[] = []; - let cancelled = false; - - const setup = async () => { - // 1. 先注册所有监听器,确保就绪 - unlistenFns.push( - await listen<{ - song: Song | null; - karaokeLines: KaraokeLine[]; - currentTime: number; - isPlaying: boolean; - }>("desktop-lyrics:data", (e) => { - setSong(e.payload.song); - setKaraokeLines(e.payload.karaokeLines); - // 使用主窗口传来的当前播放时间,避免重置为 0 导致闪烁 - audioTimeRef.current = e.payload.currentTime; - setEstimatedTime(e.payload.currentTime); - isPlayingRef.current = e.payload.isPlaying; - lastSyncRef.current = performance.now(); - hasDataRef.current = true; - }) - ); - - unlistenFns.push( - await listen<{ - currentTime: number; - isPlaying: boolean; - }>("desktop-lyrics:time", (e) => { - audioTimeRef.current = e.payload.currentTime; - lastSyncRef.current = performance.now(); - isPlayingRef.current = e.payload.isPlaying; - if (!e.payload.isPlaying) { - setEstimatedTime(e.payload.currentTime); - } - }) - ); - - unlistenFns.push( - await listen<{ - isPlaying: boolean; - playMode: PlayMode; - volume: number; - }>("desktop-lyrics:state", (e) => { - setIsPlaying(e.payload.isPlaying); - setPlayMode(e.payload.playMode); - isPlayingRef.current = e.payload.isPlaying; - if (e.payload.isPlaying) { - lastSyncRef.current = performance.now(); - } - }) - ); - - unlistenFns.push( - await listen("desktop-lyrics:settings", (e) => { - setSettings(e.payload); - setIsLocked(e.payload.isLocked); - }) - ); - - if (cancelled) { - unlistenFns.forEach((fn) => fn()); - return; - } - - // 2. 监听器已就绪,主动请求主窗口推送数据 - // 指数退避重试,直到收到数据为止 - const retryDelays = [0, 300, 1000, 3000]; - for (const delay of retryDelays) { - if (cancelled || hasDataRef.current) return; - if (delay > 0) await new Promise((r) => setTimeout(r, delay)); - if (cancelled || hasDataRef.current) return; - emit("desktop-lyrics:request-data", {}); - } - }; - - setup(); - - return () => { - cancelled = true; - unlistenFns.forEach((fn) => fn()); - }; - }, []); - - // RAF 时间插值 (60fps,仅播放时运行) - useEffect(() => { - if (!isPlaying) return; - let rafId: number; - let running = true; - const tick = () => { - if (!running || !isPlayingRef.current) return; - const elapsed = (performance.now() - lastSyncRef.current) / 1000; - setEstimatedTime(audioTimeRef.current + elapsed); - rafId = requestAnimationFrame(tick); - }; - rafId = requestAnimationFrame(tick); - return () => { - running = false; - cancelAnimationFrame(rafId); - }; - }, [isPlaying]); - - // 发送控制指令 - const sendControl = useCallback(async (action: ControlAction) => { - try { - await emit("desktop-lyrics:control", { action }); - } catch (e) { - console.error("[DesktopLyrics] sendControl emit failed:", action, e); - } - }, []); - - // 锁定/解锁(需要同步设置窗口的 ignoreCursorEvents) - const lock = useCallback(() => { - setIsLocked(true); - sendControl("lock"); - }, [sendControl]); - - const unlock = useCallback(() => { - setIsLocked(false); - sendControl("unlock"); - }, [sendControl]); - - return { - song, - karaokeLines, - estimatedTime, - isPlaying, - playMode, - settings, - isLocked, - sendControl, - lock, - unlock, - }; -} diff --git a/参考/NexBox-main/src/index.css b/参考/NexBox-main/src/index.css deleted file mode 100644 index cee0117..0000000 --- a/参考/NexBox-main/src/index.css +++ /dev/null @@ -1,261 +0,0 @@ -/* 自定义字体 */ -@font-face { - font-family: "Sinter-Regular"; - src: url("/fonts/Sinter-Regular.otf") format("opentype"); - font-weight: normal; - font-style: normal; - font-display: swap; -} - -@font-face { - font-family: "MiSans"; - src: url("/fonts/MiSansVF.ttf") format("truetype"); - font-weight: normal; - font-style: normal; - font-display: swap; -} - -@font-face { - font-family: "AiDianFengYaHei"; - src: url("/fonts/AiDianFengYaHei.ttf") format("truetype"); - font-weight: normal; - font-style: normal; - font-display: swap; -} - -@font-face { - font-family: "Cubic"; - src: url("/fonts/Cubic.ttf") format("truetype"); - font-weight: normal; - font-style: normal; - font-display: swap; -} - -:root { - font-family: var(--app-font-family, "Sinter-Regular"), Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -body { - margin: 0; - min-height: 100vh; -} - -#root { - width: 100%; - height: 100vh; -} - -[data-backdrop-filter] { - transform: translateZ(0); - backface-visibility: hidden; -} - -.chakra-ui-backdrop { - transform: translateZ(0); - backface-visibility: hidden; -} - -/* 全局滚动条样式 */ -::-webkit-scrollbar { - width: 6px; - height: 6px; -} - -::-webkit-scrollbar-track { - background: transparent; - margin: 10px 0; -} - -::-webkit-scrollbar-thumb { - background: #98DDD0; - border-radius: 3px; - min-height: 40px; -} - -::-webkit-scrollbar-thumb:hover { - background: #7FD1C1; -} - -/* 碟片旋转动画 */ -@keyframes vinylSpin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -/* MiniMusicPlayer 按钮慢速旋转动画 */ -@keyframes spin-slow { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -/* ============================================================ - 果冻弹跳缩放动画(scale 弹性,非上下位移) - ============================================================ */ -@keyframes jellyBounce { - 0% { - transform: scale(1) translateZ(0); - } - 18% { - transform: scale(1.05) translateZ(0); - } - 38% { - transform: scale(0.97) translateZ(0); - } - 58% { - transform: scale(1.02) translateZ(0); - } - 76% { - transform: scale(0.99) translateZ(0); - } - 100% { - transform: scale(1) translateZ(0); - } -} - -/* 果冻弹跳的轻量版(用于导航栏按钮) */ -@keyframes jellyBounceSubtle { - 0% { - transform: scale(1) translateZ(0); - } - 22% { - transform: scale(1.06) translateZ(0); - } - 48% { - transform: scale(0.97) translateZ(0); - } - 72% { - transform: scale(1.015) translateZ(0); - } - 100% { - transform: scale(1) translateZ(0); - } -} - -/* 导航栏外层容器专用(侧边模式,需保留 translateY(-50%) 定位) */ -@keyframes jellyBounceSidebarLeft { - 0% { transform: translateY(-50%) translateZ(0) scale(1); } - 18% { transform: translateY(-50%) translateZ(0) scale(1.05); } - 38% { transform: translateY(-50%) translateZ(0) scale(0.97); } - 58% { transform: translateY(-50%) translateZ(0) scale(1.02); } - 76% { transform: translateY(-50%) translateZ(0) scale(0.99); } - 100% { transform: translateY(-50%) translateZ(0) scale(1); } -} - -/* 导航栏外层容器专用(顶部模式,需保留 translateX(-50%) 定位) */ -@keyframes jellyBounceSidebarTop { - 0% { transform: translateX(-50%) translateZ(0) scale(1); } - 18% { transform: translateX(-50%) translateZ(0) scale(1.05); } - 38% { transform: translateX(-50%) translateZ(0) scale(0.97); } - 58% { transform: translateX(-50%) translateZ(0) scale(1.02); } - 76% { transform: translateX(-50%) translateZ(0) scale(0.99); } - 100% { transform: translateX(-50%) translateZ(0) scale(1); } -} - -/* ============================================================ - 触发规则 - ============================================================ */ - -/* 路由切换时,JS 在 body 添加 .jelly-bounce-active, - 所有带 jelly-bounce-* className 的元素播放动画。 - 动画结束后 JS 移除该 class,这样异步加载的内容不会触发动画。 */ -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-card, -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-tool-card, -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-menu-item, -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-button { - animation: jellyBounce 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-nav-button { - animation: jellyBounceSubtle 0.56s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-sidebar-left { - animation: jellyBounceSidebarLeft 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled.jelly-bounce-active .jelly-bounce-sidebar-top { - animation: jellyBounceSidebarTop 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -/* 导航栏状态切换时触发(通过 JS 添加 .jelly-bouncing class) */ -body.jelly-bounce-enabled .jelly-bounce-sidebar-content.jelly-bouncing { - animation: jellyBounce 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled .jelly-bounce-nav-button.jelly-bouncing { - animation: jellyBounceSubtle 0.56s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled .jelly-bounce-sidebar-left.jelly-bouncing { - animation: jellyBounceSidebarLeft 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -body.jelly-bounce-enabled .jelly-bounce-sidebar-top.jelly-bouncing { - animation: jellyBounceSidebarTop 0.62s cubic-bezier(0.4, 0, 0.2, 1); -} - -/* ============================================================ - 真实液态玻璃效果 (Real Liquid Glass Effect) - 参考 Mineradio 项目:SVG feDisplacementMap 实现边缘折射 - 配合多层 inset 阴影营造深度感 - ============================================================ */ - -/* 基础类:SVG 折射液态玻璃 - 不设置 position,避免覆盖组件自身的 position(如 sidebar 的 fixed) */ -.real-liquid-glass { - isolation: isolate; -} - -/* ── 多层 inset 阴影:模拟玻璃边缘高光 + 内部深度 ── - 白色 inset 阴影:模拟玻璃边缘的光线折射(细微高光) - 深色 inset 阴影:模拟玻璃内部的深度和暗角 - 外部阴影:投影 */ -.real-liquid-glass { - box-shadow: - inset 0 0 2px 1px rgba(255, 255, 255, 0.18), - inset 0 0 10px 4px rgba(255, 255, 255, 0.06), - inset 0 4px 16px rgba(0, 0, 0, 0.04), - inset 0 8px 24px rgba(0, 0, 0, 0.03), - 0 4px 16px rgba(0, 0, 0, 0.08), - 0 8px 24px rgba(0, 0, 0, 0.04); -} - -/* 暗色模式:减弱白色高光,增强深色阴影 */ -.chakra-ui-dark .real-liquid-glass { - box-shadow: - inset 0 0 2px 1px rgba(255, 255, 255, 0.10), - inset 0 0 10px 4px rgba(255, 255, 255, 0.03), - inset 0 4px 16px rgba(0, 0, 0, 0.12), - inset 0 8px 24px rgba(0, 0, 0, 0.08), - 0 4px 16px rgba(0, 0, 0, 0.20), - 0 8px 24px rgba(0, 0, 0, 0.10); -} - -/* SVG 滤镜容器:隐藏不占空间 */ -.real-liquid-glass-svg-defs { - position: absolute; - width: 0; - height: 0; - overflow: hidden; - pointer-events: none; -} - diff --git a/参考/NexBox-main/src/lib/color-utils.ts b/参考/NexBox-main/src/lib/color-utils.ts deleted file mode 100644 index ba764a9..0000000 --- a/参考/NexBox-main/src/lib/color-utils.ts +++ /dev/null @@ -1,114 +0,0 @@ -export function hexToRgba(hex: string, alpha: number): string { - const cleanHex = hex.replace("#", ""); - const r = parseInt(cleanHex.slice(0, 2), 16); - const g = parseInt(cleanHex.slice(2, 4), 16); - const b = parseInt(cleanHex.slice(4, 6), 16); - return `rgba(${r},${g},${b},${alpha})`; -} - -export function getContrastColor(hex: string): string { - const cleanHex = hex.replace("#", ""); - const r = parseInt(cleanHex.slice(0, 2), 16); - const g = parseInt(cleanHex.slice(2, 4), 16); - const b = parseInt(cleanHex.slice(4, 6), 16); - const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255; - return luminance > 0.5 ? "#1a1a1a" : "#ffffff"; -} - -export function isValidHexColor(hex: string): boolean { - return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(hex); -} - -export function normalizeHexColor(hex: string): string { - if (hex.startsWith("#") && hex.length === 4) { - const r = hex[1]; - const g = hex[2]; - const b = hex[3]; - return `#${r}${r}${g}${g}${b}${b}`; - } - return hex; -} - -function parseColorToRgb(color: string): { r: number; g: number; b: number } | null { - const rgbaMatch = color.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i); - if (rgbaMatch) { - return { - r: parseInt(rgbaMatch[1], 10) / 255, - g: parseInt(rgbaMatch[2], 10) / 255, - b: parseInt(rgbaMatch[3], 10) / 255, - }; - } - const hex = color.replace("#", ""); - if (/^[A-Fa-f0-9]{6}$/.test(hex)) { - return { - r: parseInt(hex.slice(0, 2), 16) / 255, - g: parseInt(hex.slice(2, 4), 16) / 255, - b: parseInt(hex.slice(4, 6), 16) / 255, - }; - } - return null; -} - -export function hexToHsv(hex: string): { h: number; s: number; v: number } { - const rgb = parseColorToRgb(hex); - if (!rgb) { - return { h: 0, s: 0, v: 0 }; - } - const { r, g, b } = rgb; - const max = Math.max(r, g, b); - const min = Math.min(r, g, b); - const d = max - min; - let h = 0; - if (d !== 0) { - switch (max) { - case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break; - case g: h = ((b - r) / d + 2) / 6; break; - case b: h = ((r - g) / d + 4) / 6; break; - } - } - return { h: h * 360, s: max === 0 ? 0 : (d / max) * 100, v: max * 100 }; -} - -export function hsvToHex(h: number, s: number, v: number): string { - s /= 100; - v /= 100; - const i = Math.floor(h / 60); - const f = h / 60 - i; - const p = v * (1 - s); - const q = v * (1 - s * f); - const t = v * (1 - s * (1 - f)); - let r = 0, g = 0, b = 0; - switch (i % 6) { - case 0: r = v; g = t; b = p; break; - case 1: r = q; g = v; b = p; break; - case 2: r = p; g = v; b = t; break; - case 3: r = p; g = q; b = v; break; - case 4: r = t; g = p; b = v; break; - case 5: r = v; g = p; b = q; break; - } - const toHex = (n: number) => Math.round(n * 255).toString(16).padStart(2, "0"); - return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toUpperCase(); -} - -export function colorToHex(color: string): string { - if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color)) { - return normalizeHexColor(color); - } - const rgbaMatch = color.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i); - if (rgbaMatch) { - const toHex = (n: string) => parseInt(n, 10).toString(16).padStart(2, "0"); - return `#${toHex(rgbaMatch[1])}${toHex(rgbaMatch[2])}${toHex(rgbaMatch[3])}`.toUpperCase(); - } - return "#FFFFFF"; -} - -export const PRESET_COLORS = [ - { name: "cyan", value: "#98DDD0", labelKey: "settings.appearanceSettings.presetColors.cyan" }, - { name: "blue", value: "#60A5FA", labelKey: "settings.appearanceSettings.presetColors.blue" }, - { name: "purple", value: "#A78BFA", labelKey: "settings.appearanceSettings.presetColors.purple" }, - { name: "pink", value: "#F472B6", labelKey: "settings.appearanceSettings.presetColors.pink" }, - { name: "orange", value: "#FB923C", labelKey: "settings.appearanceSettings.presetColors.orange" }, - { name: "green", value: "#4ADE80", labelKey: "settings.appearanceSettings.presetColors.green" }, - { name: "red", value: "#F87171", labelKey: "settings.appearanceSettings.presetColors.red" }, - { name: "yellow", value: "#FBBF24", labelKey: "settings.appearanceSettings.presetColors.yellow" }, -]; diff --git a/参考/NexBox-main/src/lib/desktop-lyrics-window.ts b/参考/NexBox-main/src/lib/desktop-lyrics-window.ts deleted file mode 100644 index e55be29..0000000 --- a/参考/NexBox-main/src/lib/desktop-lyrics-window.ts +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 桌面歌词窗口管理工具 - * - * 在桌面歌词窗口中运行,提供: - * - 窗口拖动 - * - 鼠标穿透切换 (setIgnoreCursorEvents) - * - 位置记忆 - */ - -import { getCurrentWindow } from "@tauri-apps/api/window"; -import { invoke } from "@tauri-apps/api/core"; -import { Store } from "@tauri-apps/plugin-store"; - -const lyricsWindow = getCurrentWindow(); - -let storeInstance: Store | null = null; -async function getStore(): Promise { - if (!storeInstance) { - storeInstance = await Store.load("music-player-settings.json"); - } - return storeInstance; -} - -/** 开始拖动窗口 */ -export async function startDragging() { - try { - await lyricsWindow.startDragging(); - } catch (e) { - console.error("[DesktopLyrics] startDragging failed:", e); - } -} - -/** 设置鼠标穿透(使用 Tauri 标准 API) - * - * 关键前提:WebView2 的 CSS 背景必须为 transparent, - * 否则 solid background 会阻止鼠标穿透。 - * 见 DesktopLyricsPage 中的 useEffect 强制设置背景透明。 - */ -export async function setIgnoreCursorEvents(ignore: boolean) { - try { - await lyricsWindow.setIgnoreCursorEvents(ignore); - } catch (e) { - console.error("[DesktopLyrics] setIgnoreCursorEvents failed:", e); - } -} - -/** 保存窗口位置 */ -export async function saveWindowPosition() { - try { - const pos = await lyricsWindow.outerPosition(); - const store = await getStore(); - await store.set("desktopLyricsPosition", { x: pos.x, y: pos.y }); - await store.save(); - } catch (e) { - console.error("[DesktopLyrics] saveWindowPosition failed:", e); - } -} - -/** 恢复窗口位置 */ -export async function restoreWindowPosition() { - try { - const store = await getStore(); - const pos = await store.get<{ x: number; y: number }>("desktopLyricsPosition"); - if (pos) { - const { LogicalPosition } = await import("@tauri-apps/api/window"); - await lyricsWindow.setPosition(new LogicalPosition(pos.x, pos.y)); - } - } catch (e) { - console.error("[DesktopLyrics] restoreWindowPosition failed:", e); - } -} - -/** 显示解锁按钮独立窗口,定位到歌词窗口顶部中央 */ -export async function showUnlockBtn() { - try { - await invoke("show_lyrics_unlock_btn"); - } catch (e) { - console.error("[DesktopLyrics] showUnlockBtn failed:", e); - } -} - -/** 隐藏解锁按钮独立窗口 */ -export async function hideUnlockBtn() { - try { - await invoke("hide_lyrics_unlock_btn"); - } catch (e) { - console.error("[DesktopLyrics] hideUnlockBtn failed:", e); - } -} - -/** - * 监听解锁按钮窗口发出的解锁事件(由 Rust unlock_lyrics 命令发射) - * 在 DesktopLyricsPage 中调用,收到事件后执行解锁 - */ -export async function onUnlockBtnClicked(callback: () => void) { - const { listen } = await import("@tauri-apps/api/event"); - return await listen("lyrics:unlock-triggered", () => { - callback(); - }); -} -export async function isCursorInWindow(): Promise { - try { - const cursor = await invoke<{ x: number; y: number }>("get_cursor_position"); - const [pos, size] = await Promise.all([ - lyricsWindow.outerPosition(), - lyricsWindow.outerSize(), - ]); - // Tauri v2 的 outerPosition()/outerSize() 以及 Win32 GetCursorPos - // 均返回物理屏幕坐标,无需乘以 devicePixelRatio。 - return ( - cursor.x >= pos.x && - cursor.x <= pos.x + size.width && - cursor.y >= pos.y && - cursor.y <= pos.y + size.height - ); - } catch { - return false; - } -} - -/** - * 检查光标是否在解锁按钮区域内(锁定状态下使用) - * - * 解锁按钮位于窗口顶部中央,约 100x50 物理像素的区域。 - * 只在这个小区域内关闭穿透显示解锁按钮,其余区域保持穿透。 - */ -export async function isCursorInUnlockArea(): Promise { - try { - const cursor = await invoke<{ x: number; y: number }>("get_cursor_position"); - const [pos, size] = await Promise.all([ - lyricsWindow.outerPosition(), - lyricsWindow.outerSize(), - ]); - // 解锁按钮位于窗口顶部中央 - const unlockWidth = Math.min(120, size.width as number); - const unlockHeight = 50; - const unlockX = pos.x + ((size.width as number) - unlockWidth) / 2; - const unlockY = pos.y; - return ( - cursor.x >= unlockX && - cursor.x <= unlockX + unlockWidth && - cursor.y >= unlockY && - cursor.y <= unlockY + unlockHeight - ); - } catch { - return false; - } -} diff --git a/参考/NexBox-main/src/lib/hardware.ts b/参考/NexBox-main/src/lib/hardware.ts deleted file mode 100644 index 8fe7a84..0000000 --- a/参考/NexBox-main/src/lib/hardware.ts +++ /dev/null @@ -1,145 +0,0 @@ - -import { invoke } from "@tauri-apps/api/core"; - -export enum GpuVendor { - NVIDIA = "NVIDIA", - AMD = "AMD", - Intel = "Intel", - Unknown = "Unknown", -} - -export interface CpuInfo { - name: string; - manufacturer: string; - cores: number; - threads: number; - max_clock_speed: number; - l2_cache_size: number; - l3_cache_size: number; - load_percentage: number | null; - architecture: string; - socket: string; - l2_cache_speed: number | null; - l3_cache_speed: number | null; - current_clock_speed: number | null; - ext_clock: number | null; - processor_id: string; - family: number; - stepping: string; - revision: string; - enabled_cores: number | null; - voltage_caps: string | null; -} - -export interface GpuInfo { - name: string; - vendor: GpuVendor; - memory_gb: number; - driver_version: string; - temperature: number | null; - usage: number | null; - video_processor: string; - adapter_compatibility: string; - driver_date: string; - installed_drivers: string; - video_mode: string; - resolution_width: number | null; - resolution_height: number | null; - refresh_rate: number | null; - device_id: string; - pnp_device_id: string; - status: string; - inf_filename: string; - video_architecture: string | null; - video_memory_type: string | null; -} - -export interface MemoryInfo { - manufacturer: string; - part_number: string; - capacity_gb: number; - speed_mhz: number; - bank_label: string; - form_factor: string; - memory_type: string; - configured_clock_speed: number | null; - configured_voltage: number | null; - data_width: number | null; - total_width: number | null; - serial_number: string; - type_detail: string; -} - -export interface SoundCardInfo { - name: string; - manufacturer: string; - status: string; - device_id: string; - pnp_device_id: string; -} - -export interface NetworkCardInfo { - name: string; - manufacturer: string; - adapter_type: string; - mac_address: string; - speed_mbps: number; - connection_name: string; - service_name: string; - index: number; - max_speed: number | null; - guid: string; -} - -export interface MotherboardInfo { - product: string; - manufacturer: string; - serial_number: string; - version: string; - bios_vendor: string; - bios_version: string; - bios_release_date: string; - system_manufacturer: string; - system_model: string; - system_type: string; - chassis_type: string; -} - -export interface DiskDetailInfo { - model: string; - size_gb: number; - interface_type: string; - serial_number: string; - firmware_revision: string; - media_type: string; - bytes_per_sector: number | null; - partitions: number; - status: string; - is_ssd: boolean; -} - -export interface MonitorInfo { - name: string; - manufacturer: string; - screen_width: number | null; - screen_height: number | null; - refresh_rate: number | null; - pnp_device_id: string; - status: string; - availability: number | null; -} - -export interface HardwareInfo { - cpu: CpuInfo; - gpu: GpuInfo[]; - memory: MemoryInfo[]; - motherboard: MotherboardInfo; - disk: DiskDetailInfo[]; - sound_card: SoundCardInfo[]; - network_card: NetworkCardInfo[]; - monitor: MonitorInfo[]; -} - -export async function getHardwareInfo(): Promise { - return await invoke("get_hardware"); -} diff --git a/参考/NexBox-main/src/lib/i18n.ts b/参考/NexBox-main/src/lib/i18n.ts deleted file mode 100644 index 389591b..0000000 --- a/参考/NexBox-main/src/lib/i18n.ts +++ /dev/null @@ -1,64 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import { invoke } from "@tauri-apps/api/core"; - -import zh from "@/locales/zh.json"; -import en from "@/locales/en.json"; -import zhTW from "@/locales/zh-TW.json"; -import fr from "@/locales/fr.json"; -import ja from "@/locales/ja.json"; -import de from "@/locales/de.json"; - -const STORAGE_KEY = "i18nextLng"; - -async function getSystemLocale(): Promise { - try { - const locale = await invoke("get_system_locale"); - const localeMap: Record = { - "zh-Hans": "zh", - "zh-Hant": "zh-TW", - "fr": "fr", - "ja": "ja", - "de": "de", - }; - return localeMap[locale] || "zh"; - } catch { - return "zh"; - } -} - -async function initI18n() { - let initialLang = localStorage.getItem(STORAGE_KEY); - - if (!initialLang) { - initialLang = await getSystemLocale(); - localStorage.setItem(STORAGE_KEY, initialLang); - } - - await i18n.use(initReactI18next).init({ - resources: { - zh: { translation: zh }, - en: { translation: en }, - "zh-TW": { translation: zhTW }, - fr: { translation: fr }, - ja: { translation: ja }, - de: { translation: de }, - }, - lng: initialLang, - fallbackLng: "zh", - supportedLngs: ["zh", "en", "zh-TW", "fr", "ja", "de"], - interpolation: { - escapeValue: false, - }, - }); - - i18n.on('languageChanged', (lng) => { - localStorage.setItem(STORAGE_KEY, lng); - }); - - return i18n; -} - -initI18n(); - -export default i18n; diff --git a/参考/NexBox-main/src/lib/karaoke-lyrics.ts b/参考/NexBox-main/src/lib/karaoke-lyrics.ts deleted file mode 100644 index f94f684..0000000 --- a/参考/NexBox-main/src/lib/karaoke-lyrics.ts +++ /dev/null @@ -1,302 +0,0 @@ -/** - * 卡拉OK歌词解析与进度算法 - * 参考 Mineradio 开源项目的 YRC 逐字歌词实现 - */ - -import type { Lyrics, LyricWord, KaraokeLine } from "@/types/music"; - -// ═══════════════════════════════════════════════ -// YRC 逐字歌词解析 -// ═══════════════════════════════════════════════ - -/** - * 解析 YRC 逐字歌词格式 - * 格式: [lineStartMs,lineDurMs](wordStartMs,wordDurMs,0)word(wordStartMs,wordDurMs,0)word... - */ -export function parseYrc(yrcText: string): KaraokeLine[] { - if (!yrcText || !yrcText.trim()) return []; - - const lines: KaraokeLine[] = []; - - for (const rawLine of yrcText.split(/\r?\n/)) { - // 匹配行头: [startMs,durMs] - const lineMatch = rawLine.match(/^\[(\d+),(\d+)\](.*)$/); - if (!lineMatch) continue; - - const lineStartMs = parseInt(lineMatch[1], 10) || 0; - const lineDurMs = parseInt(lineMatch[2], 10) || 0; - const body = lineMatch[3] || ""; - - // 匹配每个词: (startMs,durMs,0)text - const wordRegex = /\((\d+),(\d+),\d+\)([^()]*)/g; - const words: LyricWord[] = []; - let fullText = ""; - let wm: RegExpExecArray | null; - - while ((wm = wordRegex.exec(body)) !== null) { - const txt = (wm[3] || "").replace(/\s+/g, " "); - if (!txt) continue; - - const rawStart = parseInt(wm[1], 10) || 0; - const rawDur = parseInt(wm[2], 10) || 0; - // 判断是绝对时间戳还是相对行头的偏移 - const absStartMs = rawStart >= lineStartMs - 500 ? rawStart : lineStartMs + rawStart; - - const c0 = fullText.length; - fullText += txt; - - words.push({ - text: txt, - t: absStartMs / 1000, - d: Math.max(0.06, rawDur / 1000), - c0, - c1: fullText.length, - }); - } - - // 如果没有匹配到词,尝试提取纯文本 - if (!fullText) { - fullText = body.replace(/\(\d+,\d+,\d+\)/g, "").replace(/\s+/g, " "); - } - - // 清理文本 - const leading = (fullText.match(/^\s+/) || [""])[0].length; - fullText = fullText.replace(/\s+/g, " ").trim(); - if (!fullText) continue; - - // 修正词的字符偏移 - if (words.length) { - words.forEach((w) => { - w.c0 = Math.max(0, Math.min(fullText.length, w.c0 - leading)); - w.c1 = Math.max(w.c0, Math.min(fullText.length, w.c1 - leading)); - }); - // 过滤掉无效的词 - const validWords = words.filter((w) => w.c1 > w.c0); - if (validWords.length === 0) continue; - lines.push({ - time: lineStartMs / 1000, - duration: lineDurMs / 1000, - text: fullText, - words: validWords, - charCount: Math.max(1, fullText.length), - hasKaraoke: true, - }); - } else { - lines.push({ - time: lineStartMs / 1000, - duration: lineDurMs / 1000, - text: fullText, - charCount: Math.max(1, fullText.length), - hasKaraoke: false, - }); - } - } - - return finalizeLineDurations(lines); -} - -// ═══════════════════════════════════════════════ -// LRC 逐行歌词解析(增强版,兼容旧格式) -// ═══════════════════════════════════════════════ - -/** - * 解析 LRC 格式歌词,附带翻译 - */ -export function parseLrcEnhanced(lyric: string, translation?: string): KaraokeLine[] { - if (!lyric) return []; - - const lines: KaraokeLine[] = []; - const transMap = new Map(); - - // 解析翻译歌词 - if (translation) { - const transLines = translation.split("\n"); - for (const line of transLines) { - const match = line.match(/\[(\d+):(\d+(?:\.\d+)?)\]/); - if (match) { - const time = parseInt(match[1]) * 60 + parseFloat(match[2]); - const text = line.replace(/\[\d+:\d+(?:\.\d+)?\]/, "").trim(); - if (text) transMap.set(time, text); - } - } - } - - // 解析主歌词 - const mainLines = lyric.split("\n"); - for (const line of mainLines) { - const matches = [...line.matchAll(/\[(\d+):(\d+(?:\.\d+)?)\]/g)]; - if (matches.length === 0) continue; - const text = line.replace(/\[\d+:\d+(?:\.\d+)?\]/g, "").trim(); - if (!text) continue; - for (const m of matches) { - const time = parseInt(m[1]) * 60 + parseFloat(m[2]); - lines.push({ - time, - duration: 0, - text, - translation: transMap.get(time), - charCount: Math.max(1, text.length), - hasKaraoke: false, - }); - } - } - - return finalizeLineDurations(lines); -} - -// ═══════════════════════════════════════════════ -// 辅助函数 -// ═══════════════════════════════════════════════ - -/** - * 排序、填充持续时间、确保 charCount 有效 - */ -function finalizeLineDurations(lines: KaraokeLine[]): KaraokeLine[] { - lines.sort((a, b) => a.time - b.time); - - for (let i = 0; i < lines.length; i++) { - const next = lines[i + 1]; - const inferred = next && next.time > lines[i].time ? next.time - lines[i].time : 4.8; - if (!isFinite(lines[i].duration) || lines[i].duration <= 0) { - lines[i].duration = inferred; - } - lines[i].duration = Math.max(0.45, Math.min(12, lines[i].duration)); - lines[i].charCount = Math.max(1, lines[i].charCount || String(lines[i].text || "").length); - } - - return lines; -} - -// ═══════════════════════════════════════════════ -// 行进度计算(核心算法) -// ═══════════════════════════════════════════════ - -/** - * 计算当前歌词行的填充进度 (0~1) - * 参考 Mineradio 的 getLyricLineProgress - * - * - 有逐字数据时:遍历每个词,精确计算已唱到的字符位置 - * - 无逐字数据时:行级线性插值 + smoothstep 缓动 - */ -export function getLineProgress( - line: KaraokeLine | undefined, - nextLine: KaraokeLine | undefined, - currentTime: number -): number { - if (!line) return 0; - - // 微小偏移,让进度略超前于实际音频(视觉补偿) - const now = currentTime + (line.words && line.words.length ? 0.03 : 0.02); - - // 有逐字数据:精确计算已唱字符位置 - if (line.words && line.words.length && line.charCount > 0) { - let lastP = 0; - for (const w of line.words) { - const ws = w.t; - const we = w.t + Math.max(0.08, w.d || 0.24); - if (now < ws) return lastP; - const local = now >= we ? 1 : (now - ws) / Math.max(0.08, we - ws); - const clamped = Math.max(0, Math.min(1, local)); - const p = (w.c0 + (w.c1 - w.c0) * clamped) / line.charCount; - lastP = Math.max(lastP, p); - if (now < we) return lastP; - } - return 1; - } - - // 无逐字数据:行级线性插值 + smoothstep 缓动 - const nextT = - nextLine && nextLine.time > line.time - ? nextLine.time - : line.time + (line.duration || 4.8); - const span = Math.max(0.75, nextT - line.time); - const prog = Math.max(0, Math.min(1, (now - line.time) / span)); - return prog * prog * (3 - 2 * prog); // smoothstep -} - -// ═══════════════════════════════════════════════ -// 超长歌词水平滚动算法 -// ═══════════════════════════════════════════════ - -/** - * 超长歌词水平滚动偏移量计算 - * 参考 Mineradio 的 updateLyricScroll - * - * 策略: - * - 前 startGate% 静止(让用户看到行首) - * - 中段缓动滚动到最远处 - * - 末尾保持在最远位置 - */ -export function calculateScrollOffset(progress: number, limit: number): number { - if (limit <= 0) return 0; - - const p = Math.max(0, Math.min(1, progress)); - const startGate = 0.08; // 前8%静止 - const endGate = 0.78; // 78%时到达最远 - - if (p < startGate) return 0; - if (p >= endGate) return -limit; - - // 缓动函数:smoothstep - const t = (p - startGate) / (endGate - startGate); - const eased = t * t * (3 - 2 * t); - return -limit * eased; -} - -// ═══════════════════════════════════════════════ -// 统一入口:从 Lyrics 构建卡拉OK歌词行 -// ═══════════════════════════════════════════════ - -/** - * 从 Lyrics 数据构建卡拉OK歌词行 - * 优先使用 YRC 逐字歌词,降级为 LRC 逐行歌词 - */ -export function buildKaraokeLines(lyrics: Lyrics | null | undefined): KaraokeLine[] { - if (!lyrics) return []; - - // 优先使用 YRC 逐字歌词 - if (lyrics.yrc) { - const yrcLines = parseYrc(lyrics.yrc); - if (yrcLines.length > 0) { - // 尝试合并翻译 - if (lyrics.translation) { - const transMap = new Map(); - for (const line of lyrics.translation.split("\n")) { - const match = line.match(/\[(\d+):(\d+(?:\.\d+)?)\]/); - if (match) { - const time = parseInt(match[1]) * 60 + parseFloat(match[2]); - const text = line.replace(/\[\d+:\d+(?:\.\d+)?\]/, "").trim(); - if (text) transMap.set(time, text); - } - } - // 为 YRC 行匹配翻译(按时间近似匹配) - yrcLines.forEach((line) => { - // 精确匹配 - if (transMap.has(line.time)) { - line.translation = transMap.get(line.time); - return; - } - // 模糊匹配:找最接近的时间 - let bestMatch: string | undefined; - let bestDiff = Infinity; - for (const [t, txt] of transMap) { - const diff = Math.abs(t - line.time); - if (diff < bestDiff && diff < 0.5) { - bestDiff = diff; - bestMatch = txt; - } - } - if (bestMatch) line.translation = bestMatch; - }); - } - return yrcLines; - } - } - - // 降级为 LRC 逐行歌词 - if (lyrics.lyric) { - return parseLrcEnhanced(lyrics.lyric, lyrics.translation); - } - - return []; -} diff --git a/参考/NexBox-main/src/lib/sensors.ts b/参考/NexBox-main/src/lib/sensors.ts deleted file mode 100644 index 80ce745..0000000 --- a/参考/NexBox-main/src/lib/sensors.ts +++ /dev/null @@ -1,30 +0,0 @@ -export type SensorReading = { - hardware: string; - hardwareType: string; - subHardware?: string; - name: string; - sensorType: string; - value: number; - unit?: string; -}; - -export type SensorsResponse = { - updatedAt: string; - sensors: SensorReading[]; -}; - -const DEFAULT_BASE = "http://127.0.0.1:58888"; - -export function getSensorBaseUrl(): string { - if (typeof window === "undefined") return DEFAULT_BASE; - return process.env.NEXT_PUBLIC_SENSOR_URL ?? DEFAULT_BASE; -} - -export async function fetchSensors(signal?: AbortSignal): Promise { - const base = getSensorBaseUrl().replace(/\/$/, ""); - const res = await fetch(`${base}/api/sensors`, { signal, cache: "no-store" }); - if (!res.ok) { - throw new Error(`传感器服务返回 ${res.status}`); - } - return res.json() as Promise; -} diff --git a/参考/NexBox-main/src/lib/store.ts b/参考/NexBox-main/src/lib/store.ts deleted file mode 100644 index 7eab6bd..0000000 --- a/参考/NexBox-main/src/lib/store.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { LazyStore } from "@tauri-apps/plugin-store"; - -/** 所有组件共享的 settings.json 存储实例 */ -export const store = new LazyStore("settings.json"); diff --git a/参考/NexBox-main/src/lib/theme.ts b/参考/NexBox-main/src/lib/theme.ts deleted file mode 100644 index ccf121e..0000000 --- a/参考/NexBox-main/src/lib/theme.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { extendTheme, type ThemeConfig } from "@chakra-ui/react"; - -const config: ThemeConfig = { - initialColorMode: "light", - useSystemColorMode: false, -}; - -const theme = extendTheme({ - config, - fonts: { - heading: 'var(--app-font-family, "Sinter-Regular"), Inter, system-ui, sans-serif', - body: 'var(--app-font-family, "Sinter-Regular"), Inter, system-ui, sans-serif', - }, - colors: { - brand: { - 50: "#eef2ff", - 100: "#e0e7ff", - 200: "#c7d2fe", - 300: "#a5b4fc", - 400: "#818cf8", - 500: "#6366f1", - 600: "#4f46e5", - 700: "#4338ca", - 800: "#3730a3", - 900: "#312e81", - }, - }, - styles: { - global: (props: any) => ({ - body: { - bg: props.colorMode === 'dark' ? '#000000' : '#f7fafc', - color: props.colorMode === 'dark' ? '#e0e0e0' : '#1a202c', - }, - }), - }, - components: { - Button: { - baseStyle: { - borderRadius: "lg", - fontWeight: "medium", - }, - }, - Card: { - baseStyle: { - container: { - borderRadius: "xl", - bg: undefined, - borderColor: undefined, - borderWidth: undefined, - }, - }, - }, - }, -}); - -export default theme; diff --git a/参考/NexBox-main/src/lib/update-checker.ts b/参考/NexBox-main/src/lib/update-checker.ts deleted file mode 100644 index 5eb589e..0000000 --- a/参考/NexBox-main/src/lib/update-checker.ts +++ /dev/null @@ -1,102 +0,0 @@ -"use client"; - -const GITEE_API_TOKEN = "9957e6fc1011498ba0fd0602d37c9da0"; -const GITEE_OWNER = "muliuawa"; -const GITEE_REPO = "nexbox"; - -export interface GiteeRelease { - tag_name: string; - name: string; - body: string; - assets: Array<{ - name: string; - browser_download_url: string; - size: number; - }>; - published_at: string; - html_url: string; -} - -export async function fetchLatestRelease(): Promise { - try { - const response = await fetch( - `https://gitee.com/api/v5/repos/${GITEE_OWNER}/${GITEE_REPO}/releases/latest`, - { - headers: { - Authorization: `token ${GITEE_API_TOKEN}`, - "Content-Type": "application/json", - }, - } - ); - - if (!response.ok) { - return null; - } - - return await response.json(); - } catch (error) { - return null; - } -} - -export async function fetchAllReleases(): Promise { - try { - const response = await fetch( - `https://gitee.com/api/v5/repos/${GITEE_OWNER}/${GITEE_REPO}/releases?per_page=100`, - { - headers: { - Authorization: `token ${GITEE_API_TOKEN}`, - "Content-Type": "application/json", - }, - } - ); - - if (!response.ok) { - return []; - } - - return await response.json(); - } catch (error) { - return []; - } -} - -export async function fetchReleaseByTag(tag: string): Promise { - try { - const response = await fetch( - `https://gitee.com/api/v5/repos/${GITEE_OWNER}/${GITEE_REPO}/releases/tags/${tag}`, - { - headers: { - Authorization: `token ${GITEE_API_TOKEN}`, - "Content-Type": "application/json", - }, - } - ); - - if (!response.ok) { - return null; - } - - return await response.json(); - } catch (error) { - return null; - } -} - -export function compareVersions(current: string, latest: string): boolean { - const cleanCurrent = current.replace(/^v/, ""); - const cleanLatest = latest.replace(/^v/, ""); - - const currentParts = cleanCurrent.split(".").map(Number); - const latestParts = cleanLatest.split(".").map(Number); - - for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) { - const currentPart = currentParts[i] || 0; - const latestPart = latestParts[i] || 0; - - if (latestPart > currentPart) return true; - if (latestPart < currentPart) return false; - } - - return false; -} diff --git a/参考/NexBox-main/src/lib/use-hardware-report-export.ts b/参考/NexBox-main/src/lib/use-hardware-report-export.ts deleted file mode 100644 index 3c86368..0000000 --- a/参考/NexBox-main/src/lib/use-hardware-report-export.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { useCallback, useState } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { save } from "@tauri-apps/plugin-dialog"; -import { useToast } from "@chakra-ui/react"; -import { useTranslation } from "react-i18next"; - -/** - * 硬件报告导出 Hook - * - * 在硬件信息页面和悬浮框页面共用。 - * 点击导出 → 弹出文件保存对话框 → 调用后端生成 HTML → 写入文件 → toast 反馈 - */ -export function useHardwareReportExport() { - const toast = useToast(); - const { t } = useTranslation(); - const [isExporting, setIsExporting] = useState(false); - - const exportReport = useCallback(async () => { - if (isExporting) return; - - try { - // 1. 用户选择保存位置 - const defaultName = `NexBox-Hardware-Report-${new Date() - .toISOString() - .slice(0, 19) - .replace(/[:T]/g, "-")}.html`; - - const path = await save({ - filters: [{ name: "HTML", extensions: ["html"] }], - title: t("hardwareReport.selectPath") || "选择导出位置", - defaultPath: defaultName, - }); - - if (!path) return; // 用户取消 - - // 2. 显示导出中提示 - setIsExporting(true); - const toastId = "exporting"; - if (!toast.isActive(toastId)) { - toast({ - id: toastId, - title: t("hardwareReport.exporting") || "正在生成报告...", - status: "loading", - duration: null, - }); - } - - // 3. 调用后端导出 - const result = await invoke("export_hardware_report", { path }); - - // 4. 成功提示 - toast.update(toastId, { - title: t("hardwareReport.exportSuccess") || "报告导出成功", - description: result, - status: "success", - duration: 5000, - isClosable: true, - }); - } catch (error) { - const errorMsg = String(error); - if (errorMsg.includes("记录器未启动")) { - toast({ - title: t("hardwareReport.exportFailed") || "导出失败", - description: t("hardwareReport.recorderNotStarted") || "记录器未启动,请稍后重试", - status: "error", - duration: 5000, - isClosable: true, - }); - } else { - toast({ - title: t("hardwareReport.exportFailed") || "导出失败", - description: errorMsg, - status: "error", - duration: 5000, - isClosable: true, - }); - } - } finally { - setIsExporting(false); - } - }, [isExporting, toast, t]); - - return { exportReport, isExporting }; -} diff --git a/参考/NexBox-main/src/locales/de.json b/参考/NexBox-main/src/locales/de.json deleted file mode 100644 index daf83e2..0000000 --- a/参考/NexBox-main/src/locales/de.json +++ /dev/null @@ -1,1282 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "New Horizon Box", - "description": "Plattformübergreifende Leistungsüberwachung (Tauri + Next.js + Sensordienst)" - }, - "view": { - "grid": "Rasteransicht", - "list": "Listenansicht" - }, - "onboarding": { - "title": "Willkommen bei NexBox", - "subtitle": "Lassen Sie uns beginnen", - "step": "Schritt", - "steps": { - "language": { - "title": "Wählen Sie Ihre Sprache", - "description": "Wählen Sie Ihre bevorzugte Sprache" - }, - "theme": { - "title": "Wählen Sie Ihr Design", - "description": "Wählen Sie Ihre bevorzugte Oberfläche", - "light": "Hell", - "dark": "Dunkel" - }, - "complete": { - "title": "Alles bereit!", - "description": "Sie haben alle Einstellungen abgeschlossen. Beginnen Sie jetzt mit NexBox!", - "button": "Loslegen" - } - } - }, - "sidebar": { - "home": "Startseite", - "tools": "Werkzeuge", - "hardware": "Hardware", - "optimization": "Optimieren", - "displayFilter": "Filter", - "floatingNav": "Schwebende Navigation", - "crosshair": "Fadenkreuz", - "overlayPanel": "Overlay-Panel", - "builtinTools": "Eingebaute Werkzeuge", - "deltaForce": "Delta Force", - "music": "Musik", - "mood": "Stimmung", - "settings": "Einstellungen", - "gpuRename": "GPU-Umbenennung", - "resolutionConverter": "Auflösungskonverter", - "dlssPreset": "Delta Force DLSS-Einstellungen", - "epicFree": "Epic Gratis-Spiele", - "diskHealth": "Festplatten-Gesundheit", -"screenRecord": "Bildschirmaufnahme", - "audioEq": "EQ-Tuner" - }, - "optimization": { - "pageTitle": "Optimieren", - "pageDesc": "Systemoptimierung und Leistungstools", - "windowsTitle": "Windows-Optimierung", - "windowsDesc": "Optimieren Sie die Systemleistung und verbessern Sie das Spielerlebnis", - "title": "Windows-Optimierung", - "description": "Optimieren Sie die Systemleistung und verbessern Sie das Spielerlebnis", - "selectAll": "Alle auswählen", - "recommended": "Empfohlen", - "options": { - "tempFileCleanup": "Temporäre Dateien bereinigen", - "privacyServiceOptimize": "Dienstoptimierung (Datenschutz & Telemetrie)", - "memoryCleanup": "Computerspeicher freigeben", - "closeWallpaperEngine": "Wallpaper Engine schließen", - "optimizeAce": "ACE-Prozesse optimieren", - "highPerformancePower": "Zu Höchstleistungs-Energieplan wechseln", - "flushDns": "DNS-Cache leeren" - }, - "tip": "Tipp: Nachdem Sie auf \"Optimierung starten\" geklickt haben, hilft es Ihnen, die ausgewählten Funktionen zu optimieren. Die Optimierung wird nur einmal wirksam, und das Beenden des Spiels oder Klicken auf die Stopp-Taste stoppt die Optimierung.", - "startButton": "Optimierung starten", - "optimizing": "Optimiere...", - "starting": "Optimierung wird gestartet...", - "completed": "Optimierung abgeschlossen", - "completedDesc": "Systemoptimierung erfolgreich abgeschlossen", - "error": "Optimierung fehlgeschlagen, bitte versuchen Sie es erneut", - "pleaseSelectOptions": "Bitte wählen Sie zu optimierende Optionen aus", - "results": { - "tempFiles": "Temporäre Dateien", - "tempFilesComplete": "Bereinigung abgeschlossen", - "serviceOptimize": "Dienstoptimierung", - "serviceOptimizeComplete": "Abgeschlossen", - "memoryOptimize": "Speicheroptimierung", - "memoryOptimizeComplete": "Abgeschlossen", - "aceProcess": "ACE-Prozess", - "powerPlan": "Energieplan" - }, - "startupManager": { - "title": "Startup-Manager", - "description": "Systemstart-Elemente verwalten", - "scanError": "Fehler beim Scannen der Startelemente", - "deleteSuccess": "Gelöscht: {{name}}", - "deleteError": "Löschen fehlgeschlagen", - "locateError": "Datei konnte nicht gefunden werden", - "registryError": "Registrierung konnte nicht geöffnet werden", - "totalItems": "{{count}} Startelemente", - "refresh": "Aktualisieren", - "scanning": "Startelemente werden gescannt...", - "noItems": "Keine Startelemente gefunden", - "columnName": "Name", - "columnPath": "Pfad", - "columnActions": "Aktionen", - "locateFile": "Datei öffnen", - "findInRegistry": "In Registrierung suchen", - "delete": "Löschen", - "tipTitle": "💡 Tipp", - "tipDescription": "Der Startup-Manager hilft Ihnen, alle Autostart-Elemente Ihres Systems anzuzeigen und zu verwalten. Das Deaktivieren unnötiger Elemente kann die Systemstartzeit verkürzen. Gehen Sie vorsichtig vor, da einige Elemente für den normalen Systembetrieb erforderlich sein können." - }, - "systemOptimize": { - "title": "Systemoptimierung", - "description": "Systemdienste und Datenschutzeinstellungen optimieren", - "loadFailed": "Status laden fehlgeschlagen", - "loading": "Aktuellen Status prüfen...", - "optimizing": "Optimiere...", - "restoring": "Stelle wieder her...", - "optimizeAll": { - "title": "Alle aktivieren", - "description": "Alle Schalter einschalten, um alle Optimierungen zu aktivieren", - "button": "Alle aktivieren" - }, - "restore": { - "title": "Alle deaktivieren", - "description": "Alle Schalter ausschalten, um alle Optimierungen zu deaktivieren", - "button": "Alle deaktivieren" - }, - "enabled": "Aktiviert", - "tweakList": "Optimierungsstatus", - "tweaks": { - "master": "Nicht reagierende Programme automatisch beenden", - "removeMenuDelay": "Menüverzögerung reduzieren", - "disableNetworkThrottling": "Netzwerkdrosselung deaktivieren", - "disableErrorReporting": "Fehlerberichterstattung deaktivieren", - "disableCompatibilityAssistant": "Kompatibilitätsassistent deaktivieren", - "disablePrintService": "Druckdienst deaktivieren", - "disableFaxService": "Faxdienst deaktivieren", - "disableStickyKeys": "Klebrige Tasten deaktivieren", - "disableSmartScreen": "SmartScreen deaktivieren", - "disableSystemRestore": "Systemwiederherstellung deaktivieren", - "disableSuperfetch": "Superfetch/SysMain deaktivieren", - "disableHibernate": "Ruhezustand deaktivieren", - "disableNtfsTimestamp": "NTFS-Zeitstempel deaktivieren", - "disableTelemetryTasks": "Telemetrieaufgaben deaktivieren", - "disableMediaPlayerSharing": "Media Player-Freigabe deaktivieren", - "disableHomeGroup": "HomeGroup deaktivieren", - "disableSmb1": "SMB1-Protokoll deaktivieren", - "disableSmb2": "SMB2-Protokoll deaktivieren", - "disableCortana": "Cortana deaktivieren", - "disableTelemetryServices": "Telemetriedienste deaktivieren", - "disableNewsInterests": "Nachrichten und Interessen deaktivieren", - "disableStartMenuAds": "Startmenü-Werbung deaktivieren", - "disableAdvertisingId": "Werbe-ID deaktivieren", - "disableDiagnosticData": "Diagnosedatenerfassung deaktivieren", - "disableOfficeTelemetry": "Office-Telemetrie deaktivieren", - "disableFirefoxTelemetry": "Firefox-Telemetrie deaktivieren", - "disableChromeTelemetry": "Chrome-Telemetrie deaktivieren", - "disableNvidiaTelemetry": "NVIDIA-Telemetrie deaktivieren", - "disableVsTelemetry": "VS-Telemetrie deaktivieren", - "disableEdgeTelemetry": "Edge-Telemetrie deaktivieren", - "disableEdgeDiscoverBar": "Edge-Entdecken-Leiste deaktivieren", - "optimizeProcessCount": "Prozessaufteilungsschwelle optimieren", - "disableStoreSearchApp": "Store-Suche-App deaktivieren", - "disableStorePromotions": "Store-Werbung deaktivieren", - "disableStoreAutoUpdate": "Store-Auto-Update deaktivieren", - "disableSpotlightLock": "Spotlight-Sperrbildschirm deaktivieren", - "disableMyPeople": "Meine Personen deaktivieren", - "disableTPMCheck": "TPM-Prüfung deaktivieren", - "disableSensorServices": "Sensor-Dienste deaktivieren", - "removeCastToDevice": "Cast to Device entfernen", - "disableVBS": "Virtualisierungsbasierte Sicherheit deaktivieren", - "disableModernStandby": "Modernen Standby deaktivieren", - "enableGameMode": "Spielemodus aktivieren", - "disableXboxLive": "Xbox Live deaktivieren", - "disableGameBar": "Spieleleiste deaktivieren", - "disableWindowsInk": "Windows Ink deaktivieren", - "disableSpellCheck": "Rechtschreibprüfung deaktivieren", - "disableAppLaunchTracking": "App-Startverfolgung deaktivieren", - "disableFileSystemAccess": "Dateisystemzugriff deaktivieren", - "disableDocumentsAccess": "Dokumentenzugriff deaktivieren", - "disableCalendarAccess": "Kalenderzugriff deaktivieren", - "disableContactsAccess": "Kontaktzugriff deaktivieren", - "disableLanguageTracking": "Sprachverfolgung deaktivieren", - "disableWelcomeExperience": "Begrüßungserlebnis deaktivieren", - "disableFeedbackFrequency": "Rückmeldungshäufigkeit deaktivieren", - "disableWritingHabits": "Eingabegewohnheiten deaktivieren" - } - }, - "networkOptimize": { - "title": "Netzwerkoptimierung", - "description": "Netzwerkparameter und DNS optimieren", - "loadFailed": "Status laden fehlgeschlagen", - "restore": "Standard wiederherstellen", - "tcpCongestion": { - "title": "TCP-Überlastungssteuerung", - "description": "TCP-Überlastungssteuerung auf CTCP/CUBIC setzen" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "TCP Chimney Offload deaktivieren zur Reduzierung der Latenz" - }, - "nagle": { - "title": "Nagle-Algorithmus", - "description": "Nagle-Algorithmus deaktivieren für geringere Paketlatenz" - }, - "adapterPower": { - "title": "Adapter-Energiesparen", - "description": "Energiesparen auf Netzwerkadaptern deaktivieren" - }, - "dns": { - "title": "DNS-Einstellungen", - "primary": "Primärer DNS", - "secondary": "Sekundärer DNS", - "apply": "DNS anwenden", - "applied": "Angewendet", - "restore": "Automatischen DNS wiederherstellen" - }, - "dnsRequired": "Bitte geben Sie mindestens die primäre DNS-Adresse ein", - "batch": { - "title": "Batch-Optimierung", - "description": "Alle Netzwerkoptimierungen auf einmal anwenden/wiederherstellen", - "enable": "Alle aktivieren", - "disable": "Alle wiederherstellen" - } - }, - "memoryLimit": { - "title": "Speicherlimit", - "description": "Systemverfügbaren Speicher begrenzen, um die Gaming-Leistung zu optimieren", - "currentStatus": "Aktueller Status", - "physicalMemory": "Physischer Speicher", - "currentLimit": "Aktuelles Limit", - "noLimit": "Kein Limit", - "selectLimit": "Limit auswählen", - "applyLimit": "Limit anwenden", - "restoreLimit": "Standard wiederherstellen", - "limitApplied": "Limit angewendet", - "limitRestored": "Standard wiederhergestellt", - "requiresRestart": "Neustart erforderlich", - "warning": "Warnung", - "warningText": "Das Festlegen des Speicherlimits erfordert Administratorrechte und einen Systemneustart, um wirksam zu werden", - "adminRequired": "Administrator erforderlich", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "Voreingestelltes Limit", - "customTab": "Benutzerdefiniertes Limit", - "customPlaceholder": "Limitwert eingeben (GB)", - "selectPreset": "Voreingestelltes Limit auswählen", - "invalidInput": "Bitte geben Sie einen gültigen Speicherlimitwert ein", - "outOfRange": "Limit muss zwischen 0,1 und physischem Speicher liegen" - }, - "powerManagement": { - "title": "Energieverwaltung", - "description": "Optimierte Energiepläne importieren und aktivieren für bessere Gaming-Leistung", - "currentPlan": "Aktueller Energieplan", - "builtinPlans": "Integrierte Energiepläne", - "systemPlans": "System-Energiepläne", - "import": "Importieren", - "importAndActivate": "Importieren & Aktivieren", - "activate": "Aktivieren", - "importing": "Importiere...", - "activating": "Aktiviere...", - "importSuccess": "Energieplan erfolgreich importiert", - "importFailed": "Energieplan-Import fehlgeschlagen", - "activateSuccess": "Energieplan aktiviert", - "activateFailed": "Energieplan-Aktivierung fehlgeschlagen", - "alreadyImported": "Importiert", - "notImported": "Nicht importiert", - "active": "Aktiv", - "loadFailed": "Energiepläne konnten nicht geladen werden", - "refresh": "Aktualisieren", - "tipTitle": "Hinweis", - "tip": "Energiepläne beeinflussen den Stromverbrauch und die Systemleistung. Hochleistungspläne werden für Gaming empfohlen. Die Aktivierung erfordert Administratorrechte.", - "importAll": "Alle importieren", - "importingAll": "Batch-Import...", - "importAllSuccess": "{{count}} Energieplan(e) erfolgreich importiert", - "importAllFailed": "{{count}} Energieplan(e) konnten nicht importiert werden", - "allImported": "Alle Energiepläne wurden bereits importiert", - "delete": "Löschen", - "deleting": "Lösche...", - "deleteSuccess": "Energieplan gelöscht", - "deleteFailed": "Energieplan konnte nicht gelöscht werden", - "deleteConfirmTitle": "Löschen bestätigen", - "deleteConfirmText": "Möchten Sie den Energieplan \"{{name}}\" wirklich aus dem System löschen?", - "cancel": "Abbrechen" - }, - "memoryCleanup": { - "title": "Speicherbereinigung", - "description": "Speicherdetails anzeigen und Speicherplatz freigeben", - "physicalMemory": "Physikalischer Speicher", - "virtualMemory": "Virtueller Speicher", - "workingSet": "Arbeitssatz", - "used": "Verwendet", - "available": "Verfügbar", - "total": "Gesamt", - "cleanAll": "Alles bereinigen", - "cleanStandby": "Standby-Speicher bereinigen", - "trimWorkingSet": "Arbeitssatz reduzieren", - "loading": "Laden...", - "cleaning": "Bereinigung...", - "freedMemory": "{{size}} MB freigegeben", - "noMemoryFreed": "Keine Bereinigung erforderlich", - "error": "Bereinigung fehlgeschlagen" - }, - "aceOptimize": { - "title": "Delta Force/ACE Optimierung", - "description": "Optimierung der Delta Force-Prozesse und Einschränkung der ACE-Anti-Cheat-Ressourcen", - "deltaSection": { - "title": "Delta Force Optimierung", - "subtitle": "Steigern Sie die Spielleistung von Delta Force" - }, - "deltaBoost": { - "title": "Prioritäts-Boost", - "description": "DeltaForceClient-Win64-Shipping.exe Priorität auf „Echtzeit\" setzen, um CPU-Ressourcen bevorzugt zuzuweisen und die Spielflüssigkeit zu verbessern", - "affinityTitle": "Kernaffinitäts-Optimierung", - "affinityDescription": "Delta Force-Prozess allen CPU-Kernen außer CPU0 zuweisen, um die Multikernleistung zu maximieren und Kern 0 für das System zu reservieren", - "success": "Delta Force-Priorität auf Echtzeit erhöht", - "notRunning": "Delta Force-Spiel läuft nicht", - "affinitySuccess": "Delta Force-Kernzuweisung optimiert" - }, - "aceSection": { - "title": "ACE Anti-Cheat Optimierung", - "subtitle": "Ressourcennutzung von Anti-Cheat-Prozessen einschränken, um mehr Leistung für das Spiel freizugeben" - }, - "aceLimit": { - "title": "Prioritätseinschränkung", - "description": "Priorität von ACE-Tray, SGuard64, SGuardSvc96 auf „Niedrig\" setzen, um CPU-Konflikte zu reduzieren", - "affinityTitle": "Kernaffinitäts-Einschränkung", - "affinityDescription": "ACE-Anti-Cheat-Prozesse auf einen einzelnen Kern (CPU0) beschränken, um zu verhindern, dass sie wichtige CPU-Ressourcen des Spiels belegen", - "success": "Priorität von {{count}} ACE-Prozessen eingeschränkt", - "notRunning": "Keine laufenden ACE-Prozesse gefunden", - "affinitySuccess": "{{count}} ACE-Prozesse auf Einzelkern beschränkt" - }, - "aceEfficiency": { - "title": "Windows-Energiesparmodus", - "description": "Aufgabenmanager-Energiesparmodus für ACE-Prozesse aktivieren: Priorität auf Idle setzen + Energiedrosselung (EcoQoS) aktivieren, um die Hintergrundressourcennutzung erheblich zu reduzieren" - }, - "optimizeAll": { - "button": "Alles optimieren", - "optimizing": "Optimiere...", - "title": "Alles auf einmal optimieren", - "description": "Delta-Prioritäts-Boost und ACE-Prioritäts-/Kern-Einschränkungen gemeinsam ausführen", - "success": "Alle Optimierungen abgeschlossen", - "partial": "Teilweise Optimierung abgeschlossen, Details prüfen" - }, - "autoDetect": { - "title": "Automatische Erkennung und Optimierung von ACE-Prozessen", - "description": "Hintergrundüberwachung - erkennt ACE-Tray/SGuard-Prozesse automatisch und begrenzt Priorität und Kernaffinität (Prüfung alle 5 Sekunden)", - "status": { - "running": "Automatische Erkennung läuft", - "stopped": "Automatische Erkennung gestoppt" - }, - "lastCheck": "Letzte Prüfung", - "never": "Nie geprüft", - "optimizing": "{{count}} Prozesse werden optimiert", - "enabled": "Automatische Erkennung aktiviert", - "disabled": "Automatische Erkennung deaktiviert" - }, - "status": { - "optimized": "Optimiert", - "notRunning": "Nicht ausgeführt", - "notOptimized": "Zu optimieren", - "processRunning": "Prozess läuft", - "processNotRunning": "Prozess läuft nicht" - }, - "apply": "Anwenden", - "applied": "Angewendet", - "error": "Optimierung fehlgeschlagen" - } - }, - "home": { - "title": "Willkommen bei NexBox", - "welcome": "Willkommen", - "selectTools": "Schnelltools auswählen", - "todayPopularity": "Heutige Beliebtheit", - "randomQuote": "Zufälliges Zitat", - "announcement": "Ankündigung", - "announcementList": "Ankündigungsliste", - "loading": "Laden...", - "noAnnouncement": "Keine Ankündigungen", - "important": "Wichtig", - "importantAnnouncement": "Wichtige Ankündigung", - "confirmAnnouncement": "OK" - }, - "hardware": { - "title": "Hardware-Informationen", - "processor": "Prozessor", - "model": "Modell", - "coresThreads": "Kerne + Threads", - "cores": "Kerne", - "threads": "Threads", - "baseClock": "Grundtakt", - "l3Cache": "L3-Cache", - "cpuUsage": "CPU-Nutzung", - "gpu": "GPU", - "memory": "Speicher", - "driverVersion": "Treiberversion", - "temperature": "Temperatur", - "temperatureUnit": "°C", - "usage": "Nutzung", - "motherboard": "Mainboard", - "ram": "RAM", - "manufacturer": "Hersteller", - "partNumber": "Teilenummer", - "capacity": "Kapazität", - "speed": "Geschwindigkeit", - "bankLabel": "Slot", - "storage": "Speicher", - "totalCapacity": "Gesamtkapazität", - "count": "Module", - "soundCard": "Soundkarte", - "networkCard": "Netzwerkkarte", - "adapterType": "Adaptertyp", - "macAddress": "MAC-Adresse", - "linkSpeed": "Verbindungsgeschwindigkeit", - "deltaPasswordFetched": "Abgerufen", - "deltaPasswordNotFetched": "--" - }, - "tools": { - "title": "Werkzeuge", - "subtitle": "Werkzeugkasten", - "description": "Stellt verschiedene Dienstprogramme bereit, um Ihnen bei der besseren Verwaltung und Optimierung Ihres Systems zu helfen.", - "all": "Alle", - "hardware": "Hardware", - "assistant": "Assistent", - "network": "Netzwerk", - "optimization": "Optimierung", - "builtinTools": "Eingebaute Werkzeuge", - "thirdpartyTools": "Drittanbieter-Tools", - "officialTools": "Offizielle Empfehlungen", - "recommended": "Empfohlen", - "tools": { - "assistantCrosshair": "Fadenkreuzassistent", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Windows-Core-Optimierer", - "windows-core-optimizer": "Windows-Core-Optimierer", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "huorong": "火绒安全" - }, - "mctierDesc": "Universelles virtuelles LAN-Netzwerk-Tool", - "sjmclDesc": "Drittanbieter-Minecraft-Launcher, entwickelt von der Shanghai Jiao Tong Universität", - "ddegameDesc": "Spiele sind nicht nur Spiele, sie können ins Leben treten und es verändern", - "huorongDesc": "Reiner Endpunktschutz. Leicht, leise, umfassende Verteidigung", - "descriptions": { - "assistantCrosshair": "Fadenkreuz-Hilfswerkzeug für Spielbildschirme", - "memreduct": "Speicherbereinigungs-Tool", - "windowsCoreOptimizer": "Nur wirksam für CPUs mit big.LITTLE-Architektur", - "windows-core-optimizer": "Nur wirksam für CPUs mit big.LITTLE-Architektur", - "optimizer": "Windows-Systemoptimierungstool", - "cpu-z": "CPU-Informationserkennungstool", - "gpu-z": "GPU-Informationserkennungstool", - "processLasso": "Systemprozess-Optimierungstool", - "process-lasso": "Systemprozess-Optimierungstool", - "fxsound": "Audioverbesserungstool", - "msi-afterburner": "GPU-Übertaktungs- und Überwachungstool", - "huorong": "Reiner Endpunktschutz. Leicht, leise, umfassende Verteidigung" - }, - "status": { - "available": "Verfügbar", - "comingSoon": "Demnächst verfügbar", - "installed": "Installiert", - "notInstalled": "Nicht installiert", - "downloading": "Lädt herunter...", - "scanning": "Scanne..." - }, - "buttons": { - "openTool": "Werkzeug öffnen", - "comingSoon": "Demnächst verfügbar", - "download": "Zum Herunterladen klicken", - "run": "Zum Ausführen klicken", - "website": "Zur Webseite" - }, - "messages": { - "installerStarted": "Installer gestartet", - "installerStartedDesc": "Bitte schließen Sie die Installation ab. Das Tool wird anschließend als verfügbar angezeigt.", - "installComplete": "Installation abgeschlossen", - "installCompleteDesc": "Das Tool wurde erfolgreich installiert. Klicken Sie zum Ausführen.", - "installerStartedAlt": "Installer gestartet", - "installerStartedDescAlt": "Bitte schließen Sie die Installation ab. Das System erkennt automatisch den Installationsstatus.", - "downloadComplete": "Download abgeschlossen", - "downloadCompleteDesc": "Das Tool ist bereit. Klicken Sie zum Ausführen.", - "downloadFailed": "Download fehlgeschlagen", - "runFailed": "Ausführung fehlgeschlagen" - }, - "ariaLabels": { - "refreshToolList": "Werkzeugliste aktualisieren" - }, - "customAdded": { - "add": "Werkzeug manuell hinzufügen", - "remove": "Manuelle Hinzufügung entfernen", - "addSuccess": "Werkzeug hinzugefügt", - "addFailed": "Hinzufügen fehlgeschlagen", - "removed": "Manuelle Hinzufügung entfernt" - } - }, - "displayFilter": { - "title": "Anzeigefilter", - "enable": "Filter aktivieren", - "presets": "Voreinstellungen", - "currentSettings": "Aktuelle Einstellungen", - "colorTemperature": "Farbton", - "brightness": "Helligkeit", - "contrast": "Kontrast", - "saturation": "Sättigung", - "resetDefault": "Auf Standard zurücksetzen", - "resetSuccess": "Einstellungen auf Standard zurückgesetzt", - "filterEnabled": "Filter aktiviert", - "filterDisabled": "Filter deaktiviert", - "presetAppliedPrefix": "Voreinstellung ", - "presetAppliedSuffix": " angewendet", - "error": "Vorgang fehlgeschlagen", - "custom": "Benutzerdefiniert", - "customDescription": "Benutzerdefinierte Filterparameter", - "tip": "Der Filter passt die Display-Gammakurve für Farbeffekte an. Einstellungen werden automatisch wiederhergestellt, wenn die Anwendung geschlossen wird.", - "customFilter": "Benutzerdefinierter Filter", - "saveSuccess": "Einstellungen gespeichert und angewendet", - "saveAndApply": "Speichern und anwenden", - "iccProfiles": "ICC-Farbprofile", - "importIcc": "ICC-Datei importieren", - "importIccSuccess": "ICC-Datei importiert", - "importIccFailed": "ICC-Import fehlgeschlagen", - "iccApplied": "ICC-Profil angewendet", - "deleteIcc": "Löschen", - "deleteIccConfirm": "Diese ICC-Voreinstellung löschen?", - "deleteIccSuccess": "ICC-Voreinstellung gelöscht", - "noIccProfiles": "Keine ICC-Profile importiert", - "selectDisplay": "Bildschirm auswählen", - "primary": "Primär", - "cancel": "Abbrechen", - "delete": "Löschen", - "exportIcc": "Als ICC-Datei exportieren", - "exportIccSuccess": "ICC-Datei exportiert", - "exportIccFailed": "ICC-Export fehlgeschlagen", - "previewTitle": "Filter-Vorschau", - "previewOriginal": "Original", - "previewFiltered": "Filter", - "previewDisabledNote": "Filter inaktiv · Nur Vorschau", - "paramsUpdated": "Parameter aktualisiert", - "paramsUpdatedHint": "Filter-Schalter manuell aktivieren", - "myPresets": "Meine Voreinstellungen", - "noPresets": "Noch keine benutzerdefinierten Voreinstellungen\nPassen Sie Parameter an und klicken Sie auf „Als Voreinstellung speichern“", - "saveAsPreset": "Als Voreinstellung speichern", - "presetNamePlaceholder": "Voreinstellungsnamen eingeben...", - "savePresetSuccess": "Voreinstellung gespeichert", - "deletePreset": "Voreinstellung löschen", - "deletePresetConfirm": "Diese Voreinstellung löschen?", - "deletePresetSuccess": "Voreinstellung gelöscht", - "save": "Speichern" - }, -"floatingNav": { - "title": "Schwebendes Navigationsfeld", - "enable": "Schwebendes Feld aktivieren", - "settings": "Einstellungen", - "displayText": "Text anzeigen", - "width": "Breite", - "height": "Höhe", - "opacity": "Deckkraft", - "applySettings": "Einstellungen anwenden", - "preview": "Vorschau", - "previewNote": "Effektvorschau (Das tatsächliche schwebende Feld befindet sich oben in der Mitte des Bildschirms).", - "enabled": "Schwebende Navigation aktiviert", - "disabled": "Schwebende Navigation deaktiviert", - "settingsApplied": "Einstellungen angewendet", - "error": "Vorgang fehlgeschlagen", - "tip": "Das schwebende Navigationsfeld wird oben in der Mitte des Bildschirms angezeigt und bleibt immer im Vordergrund aller Fenster. Sie können die Deckkraft anpassen, um die Auswirkungen auf andere Anwendungen zu steuern.", - "displayContent": "Angezeigter Inhalt", - "cpuUsage": "CPU-Nutzung", - "gpuTemp": "GPU-Temperatur", - "gpuUsage": "GPU-Nutzung" - }, - "crosshair": { - "title": "Fadenkreuzassistent", - "enableCrosshair": "Fadenkreuz aktivieren", - "statusEnabled": "Aktiviert", - "statusDisabled": "Deaktiviert", - "style": "Fadenkreuzstil", - "color": "Farbe", - "customColor": "Benutzerdefinierte Farbe", - "size": "Größe", - "thickness": "Dicke", - "gap": "Lücke", - "dotSize": "Punktgröße", - "opacity": "Deckkraft", - "preview": "Vorschau", - "parameters": "Parameter", - "monitor": "Bildschirm", - "primaryMonitor": "Hauptbildschirm", - "advanced": "Erweitert", - "resetDefault": "Auf Standard zurücksetzen", - "updateFailed": "Einstellungen aktualisieren fehlgeschlagen", - "toggleFailed": "Fadenkreuz umschalten fehlgeschlagen", - "renderMode": "Render-Modus", - "procedural": "Voreingestellt", - "customImage": "Benutzerdefiniertes Bild", - "selectImage": "Bild auswählen", - "styles": { - "cross": "Kreuz", - "dot": "Punkt", - "circle": "Kreis", - "crossDot": "Kreuz+Punkt", - "circleCross": "Kreis+Kreuz" - } - }, - "hardwareReport": { - "export": "Bericht exportieren", - "selectPath": "Exportort auswählen", - "exporting": "Bericht wird erstellt...", - "exportSuccess": "Bericht erfolgreich exportiert", - "exportFailed": "Export fehlgeschlagen", - "recorderNotStarted": "Recorder nicht gestartet, bitte später erneut versuchen" - }, - "overlayPanel": { - "title": "Overlay-Panel", - "enableOverlay": "Overlay-Panel aktivieren", - "statusEnabled": "Aktiviert", - "statusDisabled": "Deaktiviert", - "displayItems": "Anzuzeigende Elemente", - "hardwareMonitor": "Hardware-Überwachung", - "cpuUsage": "CPU-Nutzung", - "gpuTemp": "GPU-Temperatur", - "gpuUsage": "GPU-Nutzung", - "memoryUsage": "Speichernutzung", - "deltaPassword": "Delta-Passwort", - "custom": "Benutzerdefiniert", - "customText": "Benutzerdefinierter Text", - "color": "Farbe", - "addCustomItem": "Benutzerdefiniert hinzufügen", - "appearance": "Darstellungseinstellungen", - "styles": "Overlay-Stil", - "styles.default": "Standard", - "styles.dynamicIsland": "Dynamic Island", - "styles.verticalPanel": "Vertikales Panel", - "fontColor": "Schriftfarbe", - "opacity": "Deckkraft", - "startFailed": "Starten fehlgeschlagen", - "stopFailed": "Stoppen fehlgeschlagen", - "hotkey": "Tastenkürzel", - "toggleHotkey": "Overlay umschalten", - "hotkeySaved": "Tastenkürzel gespeichert" - }, - "deltaForce": { - "title": "Delta Force", - "dailyPassword": "Tägliches Passwort", - "weaponCodes": "Waffenkennungen", - "weaponCodeDesc": "Wählen Sie eine Plattform für Waffenkennungen, um Kennungen in einem neuen Fenster zu durchsuchen und zu kopieren.", - "weaponCodePlatforms": "Plattformen für Waffenkennungen", - "openPlatform": "Plattform öffnen", - "officialMaps": "Offizielle Karten", - "openOfficialMap": "Offizielles Karten-Tool für Delta Force", - "mapToolDesc": "Beute-Punkte, Spawn-Punkte, Extraktionspunkte und Boss-Koordinaten", - "dlssPreset": "DLSS-Voreinstellung", - "dlssPresetDesc": "Wählen Sie eine DLSS-Neuronales Netzmodell-Voreinstellung aus. Verschiedene Voreinstellungen für verschiedene Szenarien.", - "loading": "Lade...", - "noPassword": "Keine Passwortdaten verfügbar", - "copy": "Kopieren", - "copied": "Kopiert", - "copySuccess": "In Zwischenablage kopiert", - "copyFailed": "Kopieren fehlgeschlagen", - "all": "Alle", - "recommended": "Empfohlen", - "currentSelection": "Aktuelle Auswahl", - "applyPreset": "Voreinstellung anwenden", - "dlssNote": "Erfordert NVIDIA Profile Inspector. Starten Sie das Spiel neu, um die Änderungen zu übernehmen.", - "back": "Zurück", - "dlssModels": { - "A": { "name": "Modell A", "description": "Frühes Modell" }, - "B": { "name": "Modell B", "description": "Frühes Modell" }, - "C": { "name": "Modell C", "description": "Frühes Modell" }, - "D": { "name": "Modell D", "description": "Stabiles Modell" }, - "E": { "name": "Modell E", "description": "Experimentelles Modell" }, - "F": { "name": "Modell F", "description": "Verbessertes Modell" }, - "G": { "name": "Modell G", "description": "Verbessertes Modell" }, - "J": { "name": "Modell J", "description": "Neueres Modell, Qualitätspriorität" }, - "K": { "name": "Modell K", "description": "Empfohlenes Modell für die meisten DLSS-Modi" }, - "L": { "name": "Modell L", "description": "Optimiert für Ultra Performance-Modus" }, - "M": { "name": "Modell M", "description": "Optimiert für Performance-Modus" } - }, - "weaponCodePlatformNames": { - "maqt": "Maqt", - "anchor-codes": "Anchor Codes", - "xiaotao-check": "Xiaotao Check", - "delta-workshop": "Delta Workshop" - }, - "officialMapToolTitle": "Delta Force - Offizielles Karten-Tool", - "officialWallpaper": "Offizieller Hintergrund", - "officialWallpaperTitle": "Delta Force - Offizieller Hintergrund", - "wallpaperDesc": "Offizielle HD-Hintergrundbilder herunterladen", - "allCategories": "Alle Kategorien", - "searchPlaceholder": "Waffen suchen...", - "allWeapons": "Alle Waffen", - "noLoadouts": "Keine Ausrüstungen gefunden", - "noLoadoutsHint": "Versuchen Sie andere Filter", - "previousPage": "Zurück", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "Weiter", - "upload": "Ausrüstung hochladen", - "category": "Kategorie", - "weaponName": "Waffe", - "selectWeapon": "Waffe auswählen", - "code": "Ausrüstungscode", - "codePlaceholder": "Ausrüstungscode eingeben, max. 500 Zeichen", - "description": "Beschreibung", - "descriptionPlaceholder": "Beschreibung eingeben (optional)", - "cost": "Kosten", - "author": "Autor", - "nicknamePlaceholder": "Spitznamen eingeben (optional)", - "cancel": "Abbrechen", - "submit": "Einreichen", - "report": "Defekt?", - "reported": "Admin gemeldet", - "uploadSuccess": "Hochladen erfolgreich", - "uploadQueueHint": "Ihre Ausrüstung wurde zur Überprüfung in die Warteschlange gestellt und erscheint nach Freigabe", - "uploadFailed": "Hochladen fehlgeschlagen", - "otherPlatformsCard": { - "title": "Andere Plattformen", - "description": "Weitere Waffencode-Plattformen entdecken" - }, - "viewMore": "Mehr anzeigen", - "moreGunCodes": "Mehr Waffencodes", - "moreGunCodesDesc": "Weitere Waffencode-Plattformen entdecken", - "openFailed": "Öffnen fehlgeschlagen", - "otherPlatforms": { - "title": "Andere Waffencode-Plattformen", - "description": "Hier sind einige andere Waffencode-Plattformen. Klicken zum Öffnen in einem neuen Fenster.", - "maqt": { - "name": "MaQT", - "description": "MaQT Waffencode-Plattform" - }, - "anxu": { - "name": "ANXU Codes", - "description": "ANXU Waffencode-Plattform" - }, - "aitags": { - "name": "Streamer Codes", - "description": "Streamer Waffencode-Plattform" - }, - "xiaotao": { - "name": "XiaoTao", - "description": "XiaoTao Waffencode-Plattform" - } - } - }, - "dlssPreset": { - "title": "Delta Force DLSS-Einstellungen", - "description": "DLSS-Neuronales Netzmodell-Voreinstellungen wechseln, um Spielgrafiken zu optimieren", - "presetLabel": "DLSS-Voreinstellung", - "driverVersion": "Treiberversion", - "noGpuFound": "Keine GPU erkannt" - }, - "dlssIndicator": { - "title": "DLSS Indikator", - "description": "DLSS-Abzeichen in der unteren linken Ecke des Spiels anzeigen", - "enabled": "DLSS Indikator aktiviert", - "disabled": "DLSS Indikator deaktiviert", - "enabling": "Aktivierung...", - "disabling": "Deaktivierung...", - "note": "Erfordert Administratorrechte, Spielneustart erforderlich" - }, - "dlssLock": { - "title": "DLSS Sperre", - "description": "nvidiaProfileInspector Treiberkonfiguration sperren", - "enabled": "DLSS Konfiguration gesperrt", - "disabled": "DLSS Konfiguration entsperrt", - "note": "Verhindert das Überschreiben von Einstellungen durch Treiberupdates" - }, - "dlssPresetTable": { - "title": "Voreinstellungsreferenz", - "description": "Empfohlene DLSS-Voreinstellungen für verschiedene GPU-Serien", - "gpuSeries": "GPU", - "recommendedPreset": "Voreinst.", - "driverVersion": "Treiber", - "scenario": "Typ", - "rtx20Series": "RTX 20 Serie", - "rtx30Series": "RTX 30 Serie", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 High FPS", - "rtx50HighQuality": "RTX 50 Hohe Qualität", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "Allgemeine Verbesserung", - "typePerformanceFirst": "Leistung zuerst", - "typeQualityEnhance": "Qualitätsverbesserung", - "typeFpsPriority": "FPS-Priorität" - }, - "musicPlayer": { - "title": "Shushu Musik", - "play": "Wiedergabe", - "pause": "Pause", - "previous": "Zurück", - "next": "Weiter", - "modeList": "Listenwiederholung", - "modeShuffle": "Zufall", - "modeOne": "Einzel wiederholen", - "mute": "Stumm", - "unmute": "Ton an", - "playlist": "Wiedergabeliste", - "noTrack": "Kein Titel ausgewählt", - "empty": "Keine Musikdateien, bitte MP3-Dateien in", - "minimize": "Minimieren" - }, - "mood": { - "title": "Stimmung", - "connecting": "Verbinde mit www.nexbox.top/love..." - }, - "builtinTools": { - "title": "Eingebaute Werkzeuge", - "back": "Zurück", - "displayFilterDesc": "Anzeigefarbenfilter anpassen", - "crosshairDesc": "Fadenkreuz-Hilfswerkzeug für Spielbildschirme", - "overlayPanelDesc": "Schwebendes Panel, das Systemhardware-Status anzeigt", - "gpuRenameDesc": "GPU-Namen ändern, um Spielleistung zu optimieren", - "resolutionConverterDesc": "Seitenverhältnisse für verschiedene Auflösungen umrechnen", - "shaderCacheDesc": "NVIDIA/AMD Shader-Cache bereinigen, um Speicherplatz freizugeben", - "dlssPresetDesc": "DLSS-Modell-Voreinstellungen wechseln, um Spielgrafiken zu optimieren", - "diskHealthDesc": "Festplatten-Gesundheit und SMART-Informationen prüfen", -"screenRecordDesc": "Hochleistungs-Bildschirmaufnahme (Hardware-Codierung)", - "audioEqDesc": "Systemweite Audio-Equalizer-Anpassung" - }, - "gpuRename": { - "title": "GPU-Umbenennung", - "loading": "Laden...", - "loadError": "Laden fehlgeschlagen", - "currentGpu": "Aktuelle GPU", - "originalGpu": "Ursprüngliche GPU", - "backupStatus": "Sicherungsstatus", - "backedUp": "Gesichert", - "notBackedUp": "Nicht gesichert", - "selectTarget": "Ziel-GPU auswählen", - "lowEnd": "Low-End GPU", - "highEnd": "High-End GPU", - "selectPlaceholder": "Bitte GPU auswählen", - "presetTab": "Voreingestellte GPU", - "customTab": "Benutzerdefinierte GPU", - "customPlaceholder": "Benutzerdefinierten GPU-Namen eingeben", - "selectGpu": "Bitte zuerst eine GPU auswählen", - "apply": "Anwenden", - "applying": "Anwendung...", - "restore": "Wiederherstellen", - "restoring": "Wiederherstellung...", - "success": "Erfolgreich", - "restored": "Wiederhergestellt", - "error": "Fehler", - "note": "⚠️ Wichtige Hinweise:\n1. Administratorrechte erforderlich, um die Registrierung zu bearbeiten\n2. Neustart von Spiel oder Computer nach Änderung erforderlich\n3. Diese Funktion unterstützt nur Windows-Systeme und NVIDIA-Grafikkarten\n4. Wenn Änderungen nicht angewendet werden können, versuchen Sie, die Anwendung als Administrator auszuführen" - }, - "resolutionConverter": { - "title": "Auflösungskonverter", - "selectResolution": "Auflösung auswählen", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "Seitenverhältnisse", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "Breite", - "height": "Höhe", - "pixels": "Pixel", - "standard": "Standard", - "tip": "Nach der Auswahl des Auflösungstyps werden unten die spezifischen Auflösungswerte für drei gängige Seitenverhältnisse angezeigt, die Ihnen helfen, die Seitenverhältnis-Einstellungen im Spiel anzupassen." - }, - "shaderCache": { - "title": "Shader-Cache-Bereinigung", - "vendorTitle": "GPU-Hersteller", - "vendorSubtitle": "Bereinigungselemente nach Hersteller organisiert, NVIDIA standardmäßig ausgewählt.", - "nvidia": { - "name": "NVIDIA", - "description": "DXCache, GLCache, NV_Cache gemäß offiziellen NVIDIA-Pfaden bereinigen.", - "selected": "Ausgewählt", - "selectable": "Auswählbar" - }, - "amd": { - "name": "AMD", - "description": "Benutzerebene Cache-Verzeichnisse für AMD Software Reset Shader Cache bereinigen.", - "selected": "Ausgewählt", - "selectable": "Zum Auswählen klicken" - }, - "detected": "Erkannt", - "notDetected": "Nicht erkannt", - "dirs": "{{count}} Verzeichnisse", - "cleanButton": "Bereinigung starten", - "cleaning": "Bereinigung...", - "scanButton": "Erneut scannen", - "officialTip": { - "title": "Offizielle NVIDIA-Empfehlung", - "description": "Es wird empfohlen, die folgenden Schritte durchzuführen, bevor Sie die Bereinigung auf dieser Seite durchführen.", - "step1": "1. Öffnen Sie das NVIDIA-Kontrollzentrum und setzen Sie die Shader-Cache-Größe in den 3D-Einstellungen auf „Deaktiviert“.", - "step2": "2. Starten Sie Ihren Computer neu und kehren Sie dann zu dieser Seite zurück, um „NVIDIA bereinigen“ auszuführen.", - "step3": "3. Aktivieren Sie den Shader-Cache nach Abschluss der Bereinigung erneut. Die Größe hängt von der Kapazität Ihrer C-Festplatte ab." - }, - "cleanSuccess": "Bereinigung abgeschlossen, {{size}} freigegeben", - "cleanError": "Bereinigung fehlgeschlagen", - "scanError": "Scan fehlgeschlagen", - "noVendorSelected": "Bitte mindestens einen GPU-Hersteller auswählen" - }, - "settings": { - "general": "Allgemein", - "appearance": "Darstellung", - "hotkeys": "Hotkeys", - "network": "Netzwerk", - "sponsor": "Unterstützen", - "navigation": "Navigation", - "about": "Über", - "generalSettings": { - "title": "Allgemeine Einstellungen", - "language": "Sprache", - "languageLabel": "Sprache", - "languages": { - "zh": "Vereinfachtes Chinesisch", - "zh-TW": "Traditionelles Chinesisch", - "en": "Englisch", - "fr": "Französisch", - "ja": "Japanisch", - "de": "Deutsch" - }, - "homepage": "Startseite", - "todayPopularityLabel": "Heutige Beliebtheit", - "todayPopularityDesc": "Zeige die heutige Beliebtheits-Zufallszahl auf der Startseite", - "announcementLabel": "Ankündigungen", - "announcementDesc": "Ankündigungs-Karte auf der Startseite anzeigen", - "randomQuoteLabel": "Zufälliges Zitat", - "randomQuoteDesc": "Zufällige Zitat-Karte auf der Startseite anzeigen", - "gameLauncherLabel": "Schnellstart", - "gameLauncherDesc": "Schnellstart-Karte auf der Startseite anzeigen", - "feedbackLabel": "Bilderkarussell", - "feedbackDesc": "Bilderkarussell auf der Startseite anzeigen", - "splash": "Animation", - "splashLogoLabel": "Startlogo", - "splashLogoDesc": "Passen Sie das beim Start angezeigte Logo an", - "splashLogoReset": "Auf Standard zurücksetzen", - "features": "Funktionen", - "advanced": "Erweitert", - "discoveryPage": "Erkennungsseite", - "discoveryPageDesc": "Ändern Sie, ob die linke Navigationsleiste auf der Instanzen-Seite angezeigt wird und wie sie gruppiert wird", - "navMode": "Instanzenseite-Navigationsmodus", - "navModeDesc": "Ändern Sie Anzeige und Gruppierung der linken Navigationsleiste der Instanzen-Seite", - "quickSwitch": "Schnelles Wechseln von Instanzen und Konten", - "quickSwitchDesc": "Wenn aktiviert, können Sie durch Klicken auf den Wechsel-Button auf der Startseite direkt ein Konto oder eine Instanz auswählen, ohne zu einer anderen Seite zu navigieren", - "resourceTranslation": "Ressourcenübersetzungen anzeigen", - "resourceTranslationDesc": "Wenn aktiviert, versucht die Ressourcen-Download-Seite, vereinfachte chinesische Übersetzungen für Namen oder Beschreibungen anzuzeigen", - "autoLanguage": "Instanzsprache automatisch festlegen", - "autoLanguageDesc": "Wenn aktiviert, werden neu erstellte Instanzen automatisch auf vereinfachtes Chinesisch gesetzt, wobei Barrierefreiheitseinstellungen übersprungen werden", - "navModes": { - "byInstance": "Nach Instanz", - "byGroup": "Nach Gruppe" - }, - "startup": "Start", - "autoStartLabel": "Beim Start ausführen", - "autoStartDesc": "NexBox automatisch beim Systemstart starten", - "closeBehavior": "Schließverhalten", - "closeBehaviorLabel": "Beim Klicken auf Schließen", - "closeBehaviorDesc": "Wählen Sie, was beim Klicken auf den Schließen-Button passiert", - "closeDirectly": "Direkt schließen", - "minimizeToTray": "In Tray minimieren", - "navPositionLabel": "Navigationsposition", - "navPositionDesc": "Wählen Sie, ob die Navigation an der Seite oder oben angezeigt wird", - "navPositionLeft": "Seite", - "navPositionTop": "Oben", - "sidebarShowLabel": "Sidebar-Beschriftungen", - "sidebarShowLabelDesc": "Anzeigemodus der Seitenleiste wählen", - "sidebarShowLabelNoText": "Nur Symbole", - "sidebarShowLabelWithText": "Symbole & Text", - "navButtonVisibility": "Nav-Button Sichtbarkeit", - "navButtonVisibilityDesc": "Ein- oder Ausblenden einzelner Navigationsschaltflächen. Einstellungen ist immer sichtbar.", - "pageTransitionLabel": "Seitenübergangsanimation", - "pageTransitionDesc": "Deaktivieren, um Seitenübergangsanimationen auszuschalten", - "pageTransitionSlide": "Schieben", - "pageTransitionFade": "Einblenden", - "pageTransitionOff": "Aus" - }, - "appearanceSettings": { - "title": "Darstellungseinstellungen", - "theme": "Design", - "themeStyle": "Designstil", - "themeStyles": { - "light": "Hell", - "dark": "Dunkel" - }, - "font": "Schriftart", - "fontLabel": "Interface-Schriftart", - "fontDesc": "Wählen Sie die Schriftart der Benutzeroberfläche, Standard ist Sinter", - "importCustomFontLabel": "Benutzerdefinierte Schriftart importieren", - "importCustomFontDesc": "Unterstützt TTF / OTF / WOFF Schriftartdateien", - "importFontButton": "Schriftart importieren", - "importingFont": "Importiere...", - "removeFont": "Schriftart entfernen", - "duplicateFont": "Diese Schriftart existiert bereits", - "importFontFailed": "Schriftartimport fehlgeschlagen", - "liquidGlass": "Flüssiges Glas", - "liquidGlassLabel": "Flüssiges Glas", - "liquidGlassDesc": "Wenn aktiviert, verwenden einige Oberflächen den \"Flüssiges Glas\"-Effekt, der die Leistung beeinträchtigen kann", - "liquidGlassBlurLabel": "Unschärfeintensität", - "liquidGlassModeLabel": "Glasmodus", - "liquidGlassModeNormal": "Normales Flüssiges Glas", - "liquidGlassModeReal": "Echtes Flüssiges Glas", - "liquidGlassModeNormalDesc": "Simuliert Glastextur mit Unschärfe und Transparenz, Unschärfe einstellbar", - "liquidGlassModeRealDesc": "Verwendet SVG-Brechungsfilter für Kantenbrechung und Chromatische Aberration, realistischer aber GPU-intensiver", - "jellyBounce": "Gelee-Wackeln", - "jellyBounceLabel": "Gelee-Wackel-Effekt", - "jellyBounceDesc": "Wenn aktiviert, haben alle Karten, Menüs und die Navigationsleiste eine elastische Skalierungsanimation bei Interaktionen und Zustandswechseln", - "customBackground": "Benutzerdefinierter Hintergrund", - "customBackgroundLabel": "Benutzerdefinierten Hintergrund aktivieren", - "imageUrlPlaceholder": "Bild-URL eingeben oder zum Hochladen klicken", - "maxImagesReached": "Maximal 3 Hintergrundbilder erlaubt", - "presetBackground": "Voreingestellter Hintergrund", - "imageBackground": "Bildhintergrund", - "dynamicBackground": "Dynamischer Hintergrund", - "dynamicBackgroundDesc": "Wenn aktiviert, wird ein dynamischer Hintergrundeffekt angezeigt", - "uploadVideo": "Video hochladen", - "unsupportedVideoFormat": "Nicht unterstütztes Videoformat. Bitte verwenden Sie mp4- oder webm-Dateien.", - "themeColor": "Designfarbe", - "themeColorLabel": "Benutzerdefinierte Designfarbe", - "themeColorDesc": "Designfarbe für Navigationsleiste, Schaltflächen, Menüs und andere Elemente festlegen", - "presets": "Voreingestellte Farben", - "customColor": "Benutzerdefinierte Farbe", - "advancedSettings": "Erweiterte Einstellungen", - "hoverOpacity": "Hover-Deckkraft", - "activeOpacity": "Aktive Deckkraft", - "borderOpacity": "Randdeckkraft", - "backgroundBlurLabel": "Hintergrundunschärfe", - "backgroundBlurHint": "Gilt für alle Hintergrundmodi (Voreinstellung / Bild / Video)", - "resetToDefault": "Auf Standard zurücksetzen", - "presetColors": { - "cyan": "Zyan", - "blue": "Blau", - "purple": "Lila", - "pink": "Rosa", - "orange": "Orange", - "green": "Grün", - "red": "Rot", - "yellow": "Gelb" - } - }, - "sponsorSettings": { - "title": "Entwickler unterstützen", - "description": "Wenn Sie NexBox nützlich finden, laden Sie den Autor auf einen Kaffee ein ☕", - "wechat": "WeChat Pay", - "alipay": "Alipay", - "thankYou": "Vielen Dank für Ihre Unterstützung!", - "placeholder": "Bitte QR-Code-Bild hinzufügen", - "sponsorList": { - "title": "Sponsorenliste", - "loading": "Laden...", - "error": "Laden fehlgeschlagen", - "empty": "Noch keine Sponsoren" - } - }, - "aboutSettings": { - "title": "Über", - "version": "Version", - "author": "Autor", - "newVersion": "Neue Version verfügbar", - "check": "Überprüfen", - "noUpdate": "Bereits auf dem neuesten Stand", - "checkFailed": "Update-Prüfung fehlgeschlagen", - "downloadFailed": "Download fehlgeschlagen", - "installFailed": "Installation fehlgeschlagen", - "acknowledgments": "Danksagungen", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "Danke an das Open-Source-Projekt der Shanghai Jiao Tong University Minecraft Club", - "changelog": "Änderungsprotokoll", - "changelogTitle": "Aktuelle Versionsaktualisierungen", - "noChangelog": "Kein Änderungsprotokoll verfügbar", - "loadingChangelog": "Lädt...", - "updateModal": { - "title": "Neue Version verfügbar", - "version": "Version", - "releaseNotes": "Versionshinweise", - "downloading": "Lädt herunter...", - "downloadComplete": "Download abgeschlossen. Bitte wählen Sie eine Aktion.", - "cancel": "Abbrechen", - "download": "Herunterladen", - "restartInstall": "Neu starten zum Installieren", - "skip": "Später" - } - }, - "networkSettings": { - "title": "Netzwerklatenztest", - "description": "Netzwerklatenz zu verschiedenen Servern testen", - "testButton": "Testen", - "testing": "Test läuft...", - "testingAll": "Alle Tests laufen...", - "testAll": "Alle testen", - "latency": "Latenz", - "timeout": "Zeitüberschreitung", - "unreachable": "Nicht erreichbar", - "servers": { - "baidu": "Baidu", - "gitee": "Gitee", - "github": "GitHub", - "qq": "Tencent", - "aliyun": "Alibaba Cloud", - "wangyi": "NetEase", - "bilibili": "Bilibili", - "douyin": "Douyin", - "jd": "JD.com", - "zhihu": "Zhihu" - } - } - }, - "epic": { - "title": "Epic Gratis-Spiele", - "loading": "Gratis-Spiele werden geladen...", - "errorFetch": "Daten konnten nicht abgerufen werden", - "errorNetwork": "Netzwerkanfrage fehlgeschlagen, bitte Verbindung prüfen", - "deadline": "Bis {{date}}", - "claimNow": "Jetzt holen", - "noGames": "Keine gratis Spiele verfügbar, schauen Sie später vorbei", - "reload": "Neu laden" - }, - "search": { - "placeholder": "Funktionen suchen...", - "noResults": "Keine Ergebnisse gefunden", - "typeToSearch": "Suchbegriff eingeben...", - "categories": { - "pages": "Seiten", - "builtinTools": "Eingebaute Tools", - "optimization": "Optimierung", - "thirdpartyTools": "Drittanbieter-Tools" - } - }, - "gpuDriverRestart": { - "pageTitle": "Grafiktreiber Neustarten", - "pageDesc": "Simuliert Win+Strg+Umschalt+B zum Neustart des Grafiktreibers (für Internetcafé-Benutzer)", - "detailDesc": "Klicken Sie auf die Schaltfläche, um einen Neustartbefehl für den Grafiktreiber an das System zu senden, vergleichbar mit Win+Strg+Umschalt+B. Der Bildschirm wird kurz schwarz oder flackert und kehrt innerhalb weniger Sekunden zum Normalzustand zurück.", - "restartBtn": "Grafiktreiber Neustarten", - "success": "Neustartbefehl gesendet, Bildschirm flackert kurz", - "error": "Grafiktreiber-Neustart fehlgeschlagen", - "waiting": "Neustartbefehl wird ausgeführt, bitte warten...", - "warningTitle": "Hinweis", - "warningDesc": "Der Neustart des Grafiktreibers führt zu einem kurzen schwarzen Bildschirm oder Flackern. Stellen Sie sicher, dass keine wichtigen Vorgänge (wie Spiele oder Dateibearbeitung) ausgeführt werden." - }, - "closeDialog": { - "title": "Schließen bestätigen", - "message": "Wie möchten Sie die App schließen?", - "closeApp": "App schließen", - "minimizeToTray": "In Tray minimieren", - "dontAskAgain": "Nicht mehr fragen" - }, - "tray": { - "show": "Hauptfenster anzeigen", - "exit": "Beenden" - }, - "hotkeySettings": { - "title": "Tastenkürzel-Einstellungen", - "overlay": "Overlay", - "overlayToggle": "Overlay-Panel umschalten", - "overlayToggleDesc": "Tastenkürzel zum Ein- und Ausblenden des Overlay-Panels", - "crosshair": "Fadenkreuz", - "crosshairToggle": "Fadenkreuz umschalten", - "crosshairToggleDesc": "Tastenkürzel zum Ein- und Ausblenden des Fadenkreuzes", - "filter": "Filter", - "filterToggle": "Filter umschalten", - "filterToggleDesc": "Tastenkürzel zum Ein- und Ausschalten des Anzeigefilters", - "saved": "Tastenkürzel gespeichert" - }, - "diskHealth": { - "title": "Festplatten-Gesundheit", - "refresh": "Aktualisieren", - "scanning": "Scannen...", - "total": "Festplatten gesamt", - "healthy": "Gesund", - "warning": "Warnung", - "unhealthy": "Fehlerhaft", - "temperature": "Temperatur", - "lifespan": "Lebensdauer", - "powerOnHours": "Betriebsstunden", - "operationalStatus": "Betriebsstatus", - "readErrors": "Lesefehler", - "writeErrors": "Schreibfehler", - "partitions": "Partitionen", - "loadError": "Laden fehlgeschlagen", - "retry": "Wiederholen" - }, - "screenRecord": { - "title": "Bildschirmaufnahme", - "description": "Hardware-beschleunigte Bildschirmaufnahme mit hoher Bildrate", - "loading": "Laden...", - "previewWaiting": "Warten auf Aufnahmestart...", - "recording": "Aufnahme", - "idle": "Bereit", - "openPreview": "Vorschaufenster öffnen", - "closePreview": "Vorschau schließen", - "settings": { - "title": "Aufnahme-Einstellungen", - "source": "Aufnahmequelle", - "display": "Anzeige", - "window": "Fenster", - "windowSrc": "Anwendungsfenster", - "fps": "Bildrate", - "resolution": "Auflösung", - "original": "Original", - "bitrate": "Bitrate", - "codec": "Encoder", - "container": "Format", - "captureCursor": "Mauszeiger aufnehmen", - "savePath": "Speicherpfad", - "selectPath": "Speicherort wählen" - }, - "controls": { - "start": "Aufnahme starten", - "stop": "Aufnahme stoppen", - "recording": "Aufnahme läuft", - "paused": "Pausiert" - }, - "stats": { - "title": "Aufnahme-Statistik", - "lastRecording": "Letzte Aufnahme", - "elapsed": "Verstrichene Zeit", - "targetFps": "Ziel-FPS", - "captureFps": "Capture-FPS", - "outputFps": "Ausgabe-FPS", - "droppedFrames": "Verlorene Frames", - "totalFrames": "Gesamt-Frames", - "fileSize": "Dateigröße", - "currentBitrate": "Aktuelle Bitrate" - }, - "warnings": { - "refreshRateLow": "Display-Wiederholungsrate ({{hz}}Hz) ist niedriger als Ziel-FPS ({{fps}}fps). Frame-Duplikation wird verwendet.", - "noDisplayFound": "Keine aufnehmbare Anzeige gefunden", - "savePathRequired": "Bitte zuerst einen Speicherpfad wählen", - "encodingError": "Codierungsfehler: {{message}}" - }, - "messages": { - "recordingStarted": "Aufnahme gestartet", - "recordingStopped": "Aufnahme gestoppt, Datei gespeichert unter: {{path}}", - "recordingError": "Aufnahmefehler: {{message}}" - } - }, - "audioEq": { - "title": "EQ-Tuner", - "loading": "Laden...", - "virtualSoundCard": "Virtuelle Soundkarte", - "virtualSoundCardDesc": "FxSound virtuellen Audiotreiber installieren, um systemweites EQ zu aktivieren", - "installed": "Installiert", - "notInstalled": "Nicht installiert", - "serviceRunning": "Dienst läuft", - "installDriver": "Treiber installieren", - "uninstallDriver": "Treiber deinstallieren", - "installing": "Installation...", - "uninstalling": "Deinstallation...", - "installSuccess": "Installation erfolgreich", - "installFailed": "Installation fehlgeschlagen", - "uninstallSuccess": "Deinstallation erfolgreich", - "uninstallFailed": "Deinstallation fehlgeschlagen", - "installHint": "Die Treiberinstallation erfordert Administratorrechte. Bitte führen Sie NexBox als Administrator aus.", - "eqEngine": "EQ-Engine", - "eqEngineDesc": "Audio-Verarbeitungs-Engine starten, um EQ-Effekte anzuwenden", - "running": "Läuft", - "stopped": "Gestoppt", - "startEngine": "Engine starten", - "stopEngine": "Engine stoppen", - "starting": "Startet...", - "engineStarted": "EQ-Engine gestartet", - "engineStartFailed": "EQ-Engine konnte nicht gestartet werden", - "engineStopped": "EQ-Engine gestoppt", - "engineStopFailed": "EQ-Engine konnte nicht gestoppt werden", - "installDriverFirst": "Bitte installieren Sie zuerst den virtuellen Soundkartentreiber", - "presets": "Voreinstellungen", - "equalizer": "Equalizer", - "reset": "Zurücksetzen", - "presetApplied": "Voreinstellung angewendet", - "usageGuide": "Benutzerhandbuch", - "step1": "Klicken Sie auf „Treiber installieren“, um den FxSound virtuellen Audiotreiber zu installieren (Administratorrechte erforderlich)", - "step2": "Klicken Sie nach der Installation auf „Engine starten“, um die EQ-Audio-Verarbeitungs-Engine zu starten", - "step3": "Wählen Sie eine Voreinstellung oder ziehen Sie die Band-Schieberegler, um EQ-Parameter anzupassen. Die Frequenzgangkurve wird in Echtzeit aktualisiert.", - "step4": "Klicken Sie nach Abschluss auf „Engine stoppen“, um die Audioverarbeitung zu beenden. Sie können den Treiber jederzeit deinstallieren." - } -} - diff --git a/参考/NexBox-main/src/locales/en.json b/参考/NexBox-main/src/locales/en.json deleted file mode 100644 index 7007799..0000000 --- a/参考/NexBox-main/src/locales/en.json +++ /dev/null @@ -1,1658 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "New Horizon Box", - "description": "Cross-platform performance monitoring (Tauri + Next.js + Sensor Service)", - "cancel": "Cancel", - "add": "Add" - }, - "view": { - "grid": "Grid View", - "list": "List View" - }, - "onboarding": { - "title": "Welcome to NexBox", - "subtitle": "Let's get started", - "step": "Step", - "steps": { - "language": { - "title": "Choose your language", - "description": "Select your preferred language" - }, - "theme": { - "title": "Choose your theme", - "description": "Select your preferred interface theme", - "light": "Light", - "dark": "Dark" - }, - "complete": { - "title": "All set!", - "description": "You've completed all the setup. Start using NexBox now!", - "button": "Get Started" - } - } - }, - "sidebar": { - "home": "Home", - "tools": "Tools", - "hardware": "Hardware", - "optimization": "Optimize", - "displayFilter": "Filter", - "floatingNav": "Floating Nav", - "crosshair": "Crosshair", - "overlayPanel": "Overlay Panel", - "builtinTools": "Built-in Tools", - "deltaForce": "Delta Force", - "music": "Music", - "mood": "Mood", - "settings": "Settings", - "gpuRename": "GPU Rename", - "dlssPreset": "Delta Force DLSS Settings", - "epicFree": "Epic Free Games", - "diskHealth": "Disk Health", -"screenRecord": "Screen Record", - "audioEq": "EQ Tuner" - }, - "optimization": { - "pageTitle": "Optimize", - "pageDesc": "System optimization and performance tools", - "windowsTitle": "Windows Optimization", - "windowsDesc": "Optimize system performance and enhance gaming experience", - "title": "Windows Optimization", - "description": "Optimize system performance and enhance gaming experience", - "selectAll": "Select All", - "recommended": "Recommended", - "options": { - "tempFileCleanup": "Clean temp files", - "privacyServiceOptimize": "Service optimization (privacy & telemetry)", - "memoryCleanup": "Free up computer memory", - "closeWallpaperEngine": "Close Wallpaper Engine", - "optimizeAce": "Optimize ACE Processes", - "highPerformancePower": "Switch to High Performance Power Plan", - "flushDns": "Flush DNS Cache" - }, - "tip": "Tip: After clicking start optimization, it will help you optimize the selected features. The optimization only takes effect once, and exiting the game or clicking the stop button will stop optimization", - "startButton": "Start Optimization", - "optimizing": "Optimizing...", - "starting": "Starting optimization...", - "completed": "Optimization completed", - "completedDesc": "System optimization successfully completed", - "error": "Optimization failed, please try again", - "pleaseSelectOptions": "Please select options to optimize", - "results": { - "tempFiles": "Temp Files", - "tempFilesComplete": "Cleanup complete", - "serviceOptimize": "Service Optimize", - "serviceOptimizeComplete": "Complete", - "memoryOptimize": "Memory Optimize", - "memoryOptimizeComplete": "Complete", - "aceProcess": "ACE Process", - "powerPlan": "Power Plan" - }, - "startupManager": { - "title": "Startup Manager", - "description": "Manage system startup items", - "scanError": "Failed to scan startup items", - "deleteSuccess": "Deleted: {{name}}", - "deleteError": "Failed to delete", - "locateError": "Failed to locate file", - "registryError": "Failed to open registry", - "totalItems": "{{count}} startup items", - "refresh": "Refresh", - "scanning": "Scanning startup items...", - "noItems": "No startup items found", - "columnName": "Name", - "columnPath": "Path", - "columnActions": "Actions", - "locateFile": "Locate file", - "findInRegistry": "Find in registry", - "delete": "Delete", - "tipTitle": "💡 Tip", - "tipDescription": "Startup Manager helps you view and manage all auto-start items on your system. Disabling unnecessary startup items can speed up system boot time. Please proceed with caution, as some system startup items may be required for normal operation." - }, - "systemOptimize": { - "title": "System Optimization", - "description": "Optimize system services and privacy settings", - "loadFailed": "Failed to load state", - "loading": "Checking current state...", - "optimizing": "Optimizing...", - "restoring": "Restoring...", - "optimizeAll": { - "title": "Enable All", - "description": "Turn on all switches to enable all optimizations", - "button": "Enable All" - }, - "restore": { - "title": "Disable All", - "description": "Turn off all switches to disable all optimizations", - "button": "Disable All" - }, - "enabled": "Enabled", - "tweakList": "Optimization Status", - "tweaks": { - "master": "Auto-end non-responsive programs", - "removeMenuDelay": "Reduce menu delay", - "disableNetworkThrottling": "Disable network throttling", - "disableErrorReporting": "Disable error reporting", - "disableCompatibilityAssistant": "Disable compatibility assistant", - "disablePrintService": "Disable print service", - "disableFaxService": "Disable fax service", - "disableStickyKeys": "Disable sticky keys", - "disableSmartScreen": "Disable SmartScreen", - "disableSystemRestore": "Disable system restore", - "disableSuperfetch": "Disable Superfetch/SysMain", - "disableHibernate": "Disable hibernate", - "disableNtfsTimestamp": "Disable NTFS timestamp updates", - "disableTelemetryTasks": "Disable telemetry scheduled tasks", - "disableMediaPlayerSharing": "Disable media player sharing", - "disableHomeGroup": "Disable home group", - "disableSmb1": "Disable SMB1 protocol", - "disableSmb2": "Disable SMB2 protocol", - "disableCortana": "Disable Cortana", - "disableTelemetryServices": "Disable telemetry services", - "disableNewsInterests": "Disable news & interests", - "disableStartMenuAds": "Disable start menu ads", - "disableAdvertisingId": "Disable advertising ID", - "disableDiagnosticData": "Disable diagnostic data collection", - "disableOfficeTelemetry": "Disable Office telemetry", - "disableFirefoxTelemetry": "Disable Firefox telemetry", - "disableChromeTelemetry": "Disable Chrome telemetry", - "disableNvidiaTelemetry": "Disable NVIDIA telemetry", - "disableVsTelemetry": "Disable VS telemetry", - "disableEdgeTelemetry": "Disable Edge telemetry", - "disableEdgeDiscoverBar": "Disable Edge discover bar", - "optimizeProcessCount": "Optimize process count", - "disableStoreSearchApp": "Disable Store search app", - "disableStorePromotions": "Disable Store promotions", - "disableStoreAutoUpdate": "Disable Store auto-update", - "disableSpotlightLock": "Disable Spotlight lock screen", - "disableMyPeople": "Disable My People", - "disableTPMCheck": "Disable TPM check", - "disableSensorServices": "Disable sensor services", - "removeCastToDevice": "Remove Cast to Device", - "disableVBS": "Disable Virtualization-Based Security", - "disableModernStandby": "Disable modern standby", - "enableGameMode": "Enable game mode", - "disableXboxLive": "Disable Xbox Live", - "disableGameBar": "Disable game bar", - "disableWindowsInk": "Disable Windows Ink", - "disableSpellCheck": "Disable spell check", - "disableAppLaunchTracking": "Disable app launch tracking", - "disableFileSystemAccess": "Disable file system access", - "disableDocumentsAccess": "Disable documents access", - "disableCalendarAccess": "Disable calendar access", - "disableContactsAccess": "Disable contacts access", - "disableLanguageTracking": "Disable language tracking", - "disableWelcomeExperience": "Disable welcome experience", - "disableFeedbackFrequency": "Disable feedback frequency", - "disableWritingHabits": "Disable writing habits collection" - } - }, - "networkOptimize": { - "title": "Network Optimization", - "pageTitle": "Network Optimization", - "description": "Optimize network parameters and DNS settings", - "pageDesc": "Optimize network parameters and DNS settings", - "loadFailed": "Failed to load state", - "scanning": "Scanning...", - "restore": "Restore default", - "currentDns": "Current DNS", - "noDnsConfig": "Auto-obtained", - "dnsApplied": "DNS Applied", - "dnsRestored": "DNS restored to auto", - "applyError": "DNS apply failed", - "tcpCongestion": { - "title": "TCP Congestion Control", - "description": "Set TCP congestion control to CTCP/CUBIC for better throughput" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "Disable TCP Chimney Offload to reduce latency" - }, - "nagle": { - "title": "Nagle Algorithm", - "description": "Disable Nagle algorithm to reduce small packet latency for gaming" - }, - "adapterPower": { - "title": "Adapter Power Saving", - "description": "Disable power saving on network adapters to reduce latency spikes" - }, - "dns": { - "title": "DNS Settings", - "primary": "Primary DNS", - "secondary": "Secondary DNS", - "apply": "Apply DNS", - "applied": "Applied", - "restore": "Restore Auto DNS", - "customLabel": "Custom DNS" - }, - "dnsRequired": "Please enter at least primary DNS address", - "batch": { - "title": "Batch Optimization", - "description": "Apply or restore all network optimizations at once", - "enable": "Enable All", - "disable": "Restore All" - }, - "batchOptimized": "All network optimizations applied", - "batchReverted": "All network optimizations restored", - "batchError": "Batch operation failed", - "optimized": "Optimized", - "reverted": "Reverted", - "optimizing": "Applying...", - "operationError": "Operation failed" - }, - "peripheralOptimize": { - "pageTitle": "Peripheral Optimization", - "pageDesc": "Optimize mouse and keyboard registry parameters to reduce input lag", - "mouseSection": "Mouse Registry Optimization", - "mouseDesc": "Set Win32PrioritySeparation decimal value", - "keyboardSection": "Keyboard Registry Optimization", - "keyboardDesc": "Set KeyboardDataQueueSize decimal value", - "apply": "Apply to Registry", - "applying": "Applying...", - "success": "Registry optimization applied", - "error": "Optimization failed", - "revert": "Restore Default", - "reverting": "Restoring...", - "revertSuccess": "Restored to system defaults", - "currentValue": "Current", - "lowerIsBetter": "Lower is better" - }, - "memoryLimit": { - "title": "Memory Limit", - "description": "Limit system available memory to optimize gaming performance", - "currentStatus": "Current Status", - "physicalMemory": "Physical Memory", - "currentLimit": "Current Limit", - "noLimit": "No Limit", - "selectLimit": "Select Limit", - "applyLimit": "Apply Limit", - "restoreLimit": "Restore Default", - "limitApplied": "Limit Applied", - "limitRestored": "Restored to Default", - "requiresRestart": "Requires Restart", - "warning": "Warning", - "warningText": "Setting memory limit requires administrator privileges and system restart to take effect", - "adminRequired": "Administrator Required", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "Preset Limit", - "customTab": "Custom Limit", - "customPlaceholder": "Enter limit value (GB)", - "selectPreset": "Select a preset limit", - "invalidInput": "Please enter a valid memory limit value", - "outOfRange": "Limit must be between 0.1 and physical memory" - }, - "powerManagement": { - "title": "Power Management", - "description": "Import and activate optimized power plans for better gaming performance", - "currentPlan": "Current Power Plan", - "builtinPlans": "Built-in Power Plans", - "systemPlans": "System Power Plans", - "import": "Import", - "importAndActivate": "Import and Activate", - "activate": "Activate", - "importing": "Importing...", - "activating": "Activating...", - "importSuccess": "Power plan imported successfully", - "importFailed": "Failed to import power plan", - "activateSuccess": "Power plan activated", - "activateFailed": "Failed to activate power plan", - "alreadyImported": "Imported", - "notImported": "Not Imported", - "active": "Active", - "loadFailed": "Failed to load power plans", - "refresh": "Refresh", - "tipTitle": "Tip", - "tip": "Power plans affect system power consumption and performance. High performance plans are recommended for gaming. Activating a power plan requires administrator privileges.", - "importAll": "Import All", - "importingAll": "Batch importing...", - "importAllSuccess": "Successfully imported {{count}} power plan(s)", - "importAllFailed": "{{count}} power plan(s) failed to import", - "allImported": "All power plans have been imported", - "delete": "Delete", - "deleting": "Deleting...", - "deleteSuccess": "Power plan deleted", - "deleteFailed": "Failed to delete power plan", - "deleteConfirmTitle": "Confirm Delete", - "deleteConfirmText": "Are you sure you want to delete the power plan \"{{name}}\" from the system?", - "cancel": "Cancel" - }, - - "memoryCleanup": { - "title": "Memory Cleanup", - "description": "View memory details and free up memory", - "physicalMemory": "Physical Memory", - "virtualMemory": "Virtual Memory", - "workingSet": "Working Set", - "used": "Used", - "available": "Available", - "total": "Total", - "cleanAll": "Clean All", - "cleanStandby": "Clean Standby Memory", - "trimWorkingSet": "Trim Working Set", - "loading": "Loading...", - "cleaning": "Cleaning...", - "freedMemory": "Freed {{size}} MB", - "noMemoryFreed": "No memory needs cleaning", - "error": "Cleanup failed", - "autoClean": "Auto Clean", - "autoCleanDesc": "Automatically clean memory when conditions are met", - "interval": "Interval", - "intervalSec": "{{seconds}}s", - "interval5min": "5 min", - "interval10min": "10 min", - "interval30min": "30 min", - "interval1hour": "1 hour", - "threshold": "Memory Threshold", - "thresholdDesc": "Trigger cleanup when used memory exceeds this value", - "thresholdGB": "{{gb}} GB", - "cleanType": "Clean Type", - "cleanTypeAll": "Clean All", - "cleanTypeStandby": "Clean Standby Memory", - "cleanTypeWorkingSet": "Trim Working Set", - "autoCleanEnabled": "Auto clean enabled", - "autoCleanDisabled": "Auto clean disabled", - "configSaved": "Auto clean config saved" - }, - "aceOptimize": { - "title": "Delta/ACE Optimize", - "description": "Delta Force process optimization and ACE anti-cheat resource limiting", - "deltaSection": { - "title": "Delta Force Optimize", - "subtitle": "Boost Delta Force gaming performance" - }, - "deltaBoost": { - "title": "Priority Boost", - "description": "Set DeltaForceClient-Win64-Shipping.exe priority to RealTime for smoother gameplay", - "affinityTitle": "Core Affinity Optimize", - "affinityDescription": "Assign Delta Force process to all CPU cores except CPU0 to maximize multi-core performance while reserving core 0 for system", - "success": "Delta Force priority boosted to real-time", - "notRunning": "Delta Force game not running", - "affinitySuccess": "Delta Force core allocation optimized" - }, - "aceSection": { - "title": "ACE Anti-Cheat Optimize", - "subtitle": "Limit anti-cheat resource usage, free more performance for the game" - }, - "aceLimit": { - "title": "Priority Limit", - "description": "Lower ACE-Tray, SGuard64, SGuardSvc64 priority to Low to reduce CPU contention", - "affinityTitle": "Core Affinity Restrict", - "affinityDescription": "Restrict ACE anti-cheat processes to single core (CPU0) only, preventing them from occupying critical game CPU resources", - "success": "Limited {{count}} ACE process(es) priority", - "notRunning": "No running ACE processes found", - "affinitySuccess": "Restricted {{count}} ACE process(es) to single core" - }, - "aceEfficiency": { - "title": "Scheduling Optimization", - "description": "Enable background power-saving scheduling for ACE processes: Below Normal priority + background I/O throttle + low memory priority, significantly reducing background resource usage", - "success": "Scheduling optimization enabled for {{count}} ACE process(es)", - "notRunning": "No running ACE processes found" - }, - "optimizeAll": { - "button": "Optimize All", - "optimizing": "Optimizing...", - "title": "Optimize All at Once", - "description": "Execute delta priority boost and ACE priority/core restrictions together", - "success": "All optimizations complete", - "partial": "Partial optimization complete, check details" - }, - "autoDetect": { - "title": "Auto Detect & Optimize ACE Processes", - "description": "Background monitoring - automatically limit priority and core affinity when ACE-Tray/SGuard processes are detected (checks every 5 seconds)", - "status": { - "running": "Auto detect running", - "stopped": "Auto detect stopped" - }, - "lastCheck": "Last check", - "never": "Never checked", - "optimizing": "Optimizing {{count}} process(es)", - "enabled": "Auto detect enabled", - "disabled": "Auto detect disabled" - }, - "status": { - "optimized": "Optimized", - "notRunning": "Not Running", - "notOptimized": "Not Optimized", - "processRunning": "Process Running", - "processNotRunning": "Process Not Running" - }, - "affinitySettings": { - "title": "Core Selection", - "description": "Select CPU cores to assign ({{count}} logical cores available)", - "save": "Save", - "cancel": "Cancel", - "selectAll": "Select All", - "clearAll": "Clear", - "configSaved": "Core configuration saved", - "deltaDefault": "All cores except CPU0 (default)", - "aceDefault": "CPU0 only (default)" - }, - "apply": "Apply", - "applied": "Applied", - "error": "Optimization failed" - } - }, - "home": { - "title": "Welcome to NexBox", - "welcome": "Welcome", - "selectTools": "Select Quick Tools", - "todayPopularity": "Today's Popularity", - "randomQuote": "Random Quote", - "announcement": "Announcement", - "announcementList": "Announcements", - "loading": "Loading...", - "noAnnouncement": "No announcements", - "important": "Important", - "importantAnnouncement": "Important Announcement", - "confirmAnnouncement": "OK" - }, - "gameLauncher": { - "title": "Quick Launch", - "addGame": "Add Game", - "gameName": "Game Name", - "gameNamePlaceholder": "Enter game name", - "gamePath": "Game Path", - "gamePathPlaceholder": "Select game executable" - }, - "hardware": { - "title": "Hardware Info", - "processor": "Processor", - "model": "Model", - "name": "Name", - "vendor": "Vendor", - "coresThreads": "Cores + Threads", - "cores": "cores", - "threads": "threads", - "baseClock": "Base Clock", - "l2Cache": "L2 Cache", - "l3Cache": "L3 Cache", - "cpuUsage": "CPU Usage", - "gpu": "GPU", - "memory": "Memory", - "driverVersion": "Driver Version", - "driverDate": "Driver Date", - "temperature": "Temperature", - "temperatureUnit": "°C", - "usage": "Usage", - "motherboard": "Motherboard", - "monitor": "Monitor", - "os": "OS", - "ram": "RAM", - "manufacturer": "Manufacturer", - "partNumber": "Part Number", - "capacity": "Capacity", - "speed": "Speed", - "bankLabel": "Slot", - "storage": "Storage", - "totalCapacity": "Total Capacity", - "count": "Sticks", - "soundCard": "Sound Card", - "networkCard": "Network Card", - "adapterType": "Adapter Type", - "macAddress": "MAC Address", - "linkSpeed": "Link Speed", - "deltaPasswordFetched": "Fetched", - "deltaPasswordNotFetched": "--", - "connectionName": "Connection Name", - "architecture": "Architecture", - "socket": "Socket", - "currentClock": "Current Clock", - "extClock": "Bus Clock", - "enabledCores": "Enabled Cores", - "family": "Family", - "stepping": "Stepping", - "revision": "Revision", - "processorId": "Processor ID", - "voltageCaps": "Voltage", - "videoProcessor": "Core Architecture", - "videoMemoryType": "VRAM Type", - "installedDrivers": "Driver Files", - "infFilename": "INF File", - "deviceId": "Device ID", - "pnpDeviceId": "PNP ID", - "resolution": "Resolution", - "refreshRate": "Refresh Rate", - "status": "Status", - "diskType": "Type", - "interfaceType": "Interface", - "serialNumber": "Serial Number", - "firmware": "Firmware", - "memoryType": "Memory Type", - "formFactor": "Form Factor", - "guid": "GUID", - "maxSpeed": "Max Speed", - "biosVendor": "BIOS Vendor", - "biosVersion": "BIOS Version", - "biosReleaseDate": "BIOS Date", - "systemManufacturer": "System Mfr", - "systemModel": "System Model", - "systemType": "System Type", - "chassisType": "Chassis Type", - "version": "Version", - "noDetail": "No detailed info available" - }, - "tools": { - "title": "Tools", - "subtitle": "Toolbox", - "description": "Provides various utilities to help you better manage and optimize your system.", - "all": "All", - "hardware": "Hardware", - "assistant": "Assistant", - "network": "Network", - "optimization": "Optimization", - "builtinTools": "Built-in Tools", - "thirdpartyTools": "Third-party Tools", - "officialTools": "Official Recommendations", - "recommended": "Recommended", - "tools": { - "assistantCrosshair": "Assistant Crosshair", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Windows Core Optimizer", - "windows-core-optimizer": "Windows Core Optimizer", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "huorong": "火绒安全", - "geek": "Geek", - "gamepp": "GamePP" - }, - "mctierDesc": "Virtual LAN universal networking tool", - "sjmclDesc": "Third-party Minecraft launcher developed by Shanghai Jiao Tong University", - "ddegameDesc": "Games are not just games, they can enter life and change life", - "huorongDesc": "Pure endpoint protection. Lightweight, quiet, comprehensive defense", - "steamDesc": "The world's largest comprehensive digital game distribution platform", - "epicGamesDesc": "Cross-platform game store powered by Unreal Engine developer", - "nvidiaAppDesc": "NVIDIA official driver and application management tool", - "pcl2Desc": "Open-source, powerful Minecraft launcher", - "obsDesc": "Free and open-source video recording and live streaming software", - "descriptions": { - "assistantCrosshair": "Game screen crosshair assistant tool", - "memreduct": "Memory cleaning tool", - "windowsCoreOptimizer": "Only effective for CPUs with big.LITTLE architecture", - "windows-core-optimizer": "Only effective for CPUs with big.LITTLE architecture", - "optimizer": "Windows system optimization tool", - "cpu-z": "CPU information detection tool", - "gpu-z": "GPU information detection tool", - "processLasso": "System process optimization tool", - "process-lasso": "System process optimization tool", - "fxsound": "Audio enhancement tool", - "msi-afterburner": "GPU overclocking and monitoring tool", - "huorong": "Pure endpoint protection. Lightweight, quiet, comprehensive defense", - "geek": "System uninstallation and cleaning tool", - "gamepp": "Game acceleration and optimization tool" - }, - "status": { - "available": "Available", - "comingSoon": "Coming Soon", - "installed": "Installed", - "notInstalled": "Not Installed", - "downloading": "Downloading", - "scanning": "Scanning..." - }, - "buttons": { - "openTool": "Open Tool", - "comingSoon": "Coming Soon", - "download": "Click to Download", - "run": "Click to Run", - "website": "Visit Website" - }, - "messages": { - "installerStarted": "Installer Started", - "installerStartedDesc": "Please complete the installation, the tool will show as available afterwards", - "installComplete": "Installation Complete", - "installCompleteDesc": "Tool successfully installed, click to run", - "installerStartedAlt": "Installer Started", - "installerStartedDescAlt": "Please complete the installation, system will automatically detect installation status", - "downloadComplete": "Download Complete", - "downloadCompleteDesc": "Tool is ready, click to run", - "downloadFailed": "Download Failed", - "runFailed": "Run Failed" - }, - "ariaLabels": { - "refreshToolList": "Refresh tool list" - }, - "customAdded": { - "add": "Manually add tool", - "remove": "Remove manual addition", - "addSuccess": "Tool added", - "addFailed": "Failed to add", - "removed": "Manual addition removed" - } - }, - "displayFilter": { - "title": "Display Filter", - "enable": "Enable Filter", - "presets": "Presets", - "currentSettings": "Current Settings", - "colorTemperature": "Color Temperature", - "brightness": "Brightness", - "contrast": "Contrast", - "saturation": "Saturation", - "resetDefault": "Reset to Default", - "resetSuccess": "Settings reset to default", - "filterEnabled": "Filter enabled", - "filterDisabled": "Filter disabled", - "presetAppliedPrefix": "Applied ", - "presetAppliedSuffix": " preset", - "error": "Operation failed", - "custom": "Custom", - "customDescription": "Custom filter parameters", - "tip": "Filter adjusts display gamma curve for color effects. Settings are automatically restored when the app exits.", - "customFilter": "Custom Filter", - "saveSuccess": "Settings saved and applied", - "saveAndApply": "Save & Apply", - "iccProfiles": "ICC Color Profiles", - "importIcc": "Import ICC File", - "importIccSuccess": "ICC file imported", - "importIccFailed": "ICC import failed", - "iccApplied": "ICC profile applied", - "deleteIcc": "Delete", - "deleteIccConfirm": "Confirm delete this ICC preset?", - "deleteIccSuccess": "ICC preset deleted", - "noIccProfiles": "No ICC profiles imported", - "selectDisplay": "Select Display", - "primary": "Primary", - "cancel": "Cancel", - "delete": "Delete", - "exportIcc": "Export as ICC File", - "exportIccSuccess": "ICC file exported", - "exportIccFailed": "ICC export failed", - "previewTitle": "Filter Preview", - "previewOriginal": "Original", - "previewFiltered": "Filter", - "previewDisabledNote": "Filter inactive · Preview only", - "paramsUpdated": "Parameters updated", - "paramsUpdatedHint": "Enable filter switch to apply", - "myPresets": "My Presets", - "noPresets": "No custom presets yet.\nAdjust parameters and click \"Save as Preset\" to save.", - "saveAsPreset": "Save as Preset", - "presetNamePlaceholder": "Enter preset name...", - "savePresetSuccess": "Preset saved", - "deletePreset": "Delete Preset", - "deletePresetConfirm": "Delete this preset?", - "deletePresetSuccess": "Preset deleted", - "save": "Save" - }, - "floatingNav": { - "title": "Floating Navigation Box", - "enable": "Enable Floating Box", - "settings": "Settings", - "displayText": "Display Text", - "width": "Width", - "height": "Height", - "opacity": "Opacity", - "applySettings": "Apply Settings", - "preview": "Preview", - "previewNote": "Preview effect (actual floating box is at the top center of the monitor)", - "enabled": "Floating navigation enabled", - "disabled": "Floating navigation disabled", - "settingsApplied": "Settings applied", - "error": "Operation failed", - "tip": "The floating navigation box will be displayed at the top center of the monitor, always staying on top of all windows. You can adjust the opacity to control its impact on other applications.", - "displayContent": "Display Content", - "cpuUsage": "CPU Usage", - "gpuTemp": "GPU Temperature", - "gpuUsage": "GPU Usage" - }, - "crosshair": { - "title": "Crosshair Assistant", - "enableCrosshair": "Enable Crosshair", - "statusEnabled": "Enabled", - "statusDisabled": "Disabled", - "style": "Crosshair Style", - "color": "Color", - "customColor": "Custom Color", - "size": "Size", - "thickness": "Thickness", - "gap": "Gap", - "dotSize": "Dot Size", - "opacity": "Opacity", - "preview": "Preview", - "parameters": "Parameters", - "monitor": "Display Monitor", - "primaryMonitor": "Primary Monitor", - "advanced": "Advanced", - "resetDefault": "Reset to Default", - "updateFailed": "Failed to update settings", - "toggleFailed": "Failed to toggle crosshair", - "renderMode": "Render Mode", - "procedural": "Preset", - "customImage": "Custom Image", - "selectImage": "Select Image", - "styles": { - "cross": "Cross", - "dot": "Dot", - "circle": "Circle", - "crossDot": "Cross+Dot", - "circleCross": "Circle+Cross" - } - }, - "hardwareReport": { - "export": "Export Report", - "selectPath": "Select Export Location", - "exporting": "Generating report...", - "exportSuccess": "Report exported successfully", - "exportFailed": "Export failed", - "recorderNotStarted": "Recorder not started, please try again later" - }, - "overlayPanel": { - "title": "Overlay Panel", - "enableOverlay": "Enable Overlay Panel", - "statusEnabled": "Enabled", - "statusDisabled": "Disabled", - "displayItems": "Display Items", - "hardwareMonitor": "Hardware Monitor", - "cpuUsage": "CPU Usage", - "gpuTemp": "GPU Temperature", - "gpuUsage": "GPU Usage", - "memoryUsage": "Memory Usage", - "deltaPassword": "Delta Password", - "gamePing": "Game Latency", - "pingSettings": "Latency Test", - "pingDescription": "Select a server to measure network latency. The latency data will be displayed in the overlay", - "testPing": "Test Latency", - "pingCurrentValue": "Current Latency", - "custom": "Custom", - "customText": "Custom Text", - "color": "Color", - "addCustomItem": "Add Custom Item", - "appearance": "Appearance Settings", - "styles": "Overlay Style", - "styles.default": "Default", - "styles.dynamicIsland": "Dynamic Island", - "styles.verticalPanel": "Vertical Panel", - "fontColor": "Font Color", - "opacity": "Opacity", - "startFailed": "Failed to start", - "stopFailed": "Failed to stop", - "hotkey": "Hotkey", - "toggleHotkey": "Toggle Overlay", - "hotkeySaved": "Hotkey saved", - "minOneItem": "At least one display item must be kept", - "position": "Position Settings", - "dragMode": "Drag Overlay", - "dragModeHint": "Click to enter drag mode, click button again to exit and save position", - "dragModeStart": "Start Dragging", - "dragModeActive": "Stop Dragging", - "dragModeEnabled": "Entered drag mode, click button to exit", - "dragModeDisabled": "Exited drag mode", - "dragModeFailed": "Failed to toggle drag mode", - "overlayNotEnabled": "Please enable the overlay first", - "positionSaved": "Position saved", - "resetPosition": "Reset Position", - "positionReset": "Position restored to default", - "positionResetFailed": "Failed to reset position" - }, - "deltaForce": { - "title": "Delta Force", - "dailyPassword": "Daily Password", - "weaponCodes": "Weapon Codes", - "weaponCodeDesc": "Select a weapon code platform to browse and copy codes in a new window", - "weaponCodePlatforms": "Weapon Code Platforms", - "openPlatform": "Open Platform", - "officialMaps": "Official Maps", - "openOfficialMap": "Delta Force Official Map Tool", - "mapToolDesc": "Loot spots, spawn points, extraction points and boss coordinates", - "dlssPreset": "DLSS Preset", - "dlssPresetDesc": "Select DLSS neural network model preset, different presets for different scenarios", - "loading": "Loading...", - "noPassword": "No password data available", - "copy": "Copy", - "copied": "Copied", - "copySuccess": "Copied to clipboard", - "copyFailed": "Copy failed", - "all": "All", - "recommended": "Recommended", - "currentSelection": "Current Selection", - "applyPreset": "Apply Preset", - "dlssNote": "Requires NVIDIA Profile Inspector, restart game to take effect", - "back": "Back", - "dlssModels": { - "A": { "name": "Model A", "description": "Early model" }, - "B": { "name": "Model B", "description": "Early model" }, - "C": { "name": "Model C", "description": "Early model" }, - "D": { "name": "Model D", "description": "Stable model" }, - "E": { "name": "Model E", "description": "Experimental model" }, - "F": { "name": "Model F", "description": "Improved model" }, - "G": { "name": "Model G", "description": "Improved model" }, - "J": { "name": "Model J", "description": "Newer model, quality priority" }, - "K": { "name": "Model K", "description": "Recommended model, for most DLSS modes" }, - "L": { "name": "Model L", "description": "Optimized for Ultra Performance mode" }, - "M": { "name": "Model M", "description": "Optimized for Performance mode" } - }, - "weaponCodePlatformNames": { - "maqt": "Maqt", - "anchor-codes": "Anchor Codes", - "xiaotao-check": "Xiaotao Check", - "delta-workshop": "Delta Workshop" - }, - "officialMapToolTitle": "Delta Force - Official Map Tool", - "officialWallpaper": "Official Wallpaper", - "officialWallpaperTitle": "Delta Force - Official Wallpaper", - "wallpaperDesc": "Official HD wallpaper download", - "allCategories": "All Categories", - "searchPlaceholder": "Search weapons...", - "allWeapons": "All Weapons", - "noLoadouts": "No loadouts found", - "noLoadoutsHint": "Try different filters", - "previousPage": "Previous", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "Next", - "upload": "Upload Loadout", - "category": "Category", - "weaponName": "Weapon", - "selectWeapon": "Select a weapon", - "code": "Loadout Code", - "codePlaceholder": "Enter loadout code, max 500 characters", - "description": "Description", - "descriptionPlaceholder": "Enter description (optional)", - "cost": "Cost", - "author": "Author", - "nicknamePlaceholder": "Enter nickname (optional)", - "cancel": "Cancel", - "submit": "Submit", - "report": "Broken?", - "reported": "Reported to admin", - "uploadSuccess": "Upload successful", - "uploadQueueHint": "Your loadout has been queued for review and will appear after approval", - "uploadFailed": "Upload failed", - "otherPlatformsCard": { - "title": "Other Platforms", - "description": "Explore more gun code platforms" - }, - "viewMore": "View More", - "moreGunCodes": "More Gun Codes", - "moreGunCodesDesc": "Explore more gun code platforms", - "openFailed": "Failed to open", - "otherPlatforms": { - "title": "Other Gun Code Platforms", - "description": "Here are some other gun code platforms. Click to open in a new window.", - "maqt": { - "name": "MaQT", - "description": "MaQT gun code platform" - }, - "anxu": { - "name": "ANXU Codes", - "description": "ANXU gun code platform" - }, - "aitags": { - "name": "Streamer Codes", - "description": "Streamer gun code platform" - }, - "xiaotao": { - "name": "XiaoTao", - "description": "XiaoTao gun code platform" - } - } - }, - "dlssPreset": { - "title": "Delta Force DLSS Settings", - "description": "Switch DLSS neural network model presets to optimize game graphics", - "presetLabel": "DLSS Preset", - "driverVersion": "Driver Version", - "noGpuFound": "No GPU detected" - }, - "dlssIndicator": { - "title": "DLSS Indicator", - "description": "Show DLSS badge in bottom-left corner of game screen", - "enabled": "DLSS Indicator enabled", - "disabled": "DLSS Indicator disabled", - "enabling": "Enabling...", - "disabling": "Disabling...", - "note": "Requires admin privileges, restart game to take effect" - }, - "dlssLock": { - "title": "DLSS Lock", - "description": "Lock nvidiaProfileInspector driver configuration", - "enabled": "DLSS configuration locked", - "disabled": "DLSS configuration unlocked", - "note": "Prevents driver updates from overwriting settings" - }, - "dlssPresetTable": { - "title": "Preset Reference Table", - "description": "Recommended DLSS presets for different GPU series", - "gpuSeries": "GPU", - "recommendedPreset": "Preset", - "driverVersion": "Driver", - "scenario": "Type", - "rtx20Series": "RTX 20 Series", - "rtx30Series": "RTX 30 Series", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 High FPS", - "rtx50HighQuality": "RTX 50 High Quality", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "General Enhancement", - "typePerformanceFirst": "Performance First", - "typeQualityEnhance": "Quality Enhancement", - "typeFpsPriority": "FPS Priority" - }, - "musicPlayer": { - "title": "Shushu Music", - "play": "Play", - "pause": "Pause", - "previous": "Previous", - "next": "Next", - "modeList": "List Loop", - "modeShuffle": "Shuffle", - "modeOne": "Repeat One", - "mute": "Mute", - "unmute": "Unmute", - "playlist": "Playlist", - "noTrack": "No track selected", - "empty": "No music files, please put MP3 files in", - "minimize": "Minimize" - }, - "mood": { - "title": "Mood", - "connecting": "Connecting to www.nexbox.top/love ..." - }, - "builtinTools": { - "title": "Built-in Tools", - "back": "Back", - "displayFilterDesc": "Adjust display color filters", - "crosshairDesc": "Game screen crosshair assistant tool", - "overlayPanelDesc": "Floating panel showing system hardware status", - "gpuRenameDesc": "Modify GPU name to optimize gaming performance", - "resolutionConverterDesc": "Convert aspect ratios at different resolutions", - "shaderCacheDesc": "Clean up NVIDIA/AMD shader cache to free disk space", - "dlssPresetDesc": "Switch DLSS model presets to optimize game graphics", - "diskHealthDesc": "Check disk health status and SMART information", - "screenRecordDesc": "High-performance screen recording (hardware encoding)", - "audioEqDesc": "System-level audio equalizer tuning" - }, - "gpuRename": { - "title": "GPU Rename", - "loading": "Loading...", - "loadError": "Failed to load", - "currentGpu": "Current GPU", - "originalGpu": "Original GPU", - "backupStatus": "Backup Status", - "backedUp": "Backed up", - "notBackedUp": "Not backed up", - "selectTarget": "Select Target GPU", - "lowEnd": "Low-end GPU", - "highEnd": "High-end GPU", - "selectPlaceholder": "Please select a GPU", - "presetTab": "Preset GPU", - "customTab": "Custom GPU", - "customPlaceholder": "Enter a custom GPU name", - "selectGpu": "Please select a GPU first", - "apply": "Apply", - "applying": "Applying...", - "restore": "Restore", - "restoring": "Restoring...", - "success": "Success", - "restored": "Restored", - "error": "Error", - "note": "⚠️ Important Notes:\n1. Administrator privileges required to modify the registry\n2. Requires restarting the game or computer to take effect\n3. Only supports Windows systems and NVIDIA GPUs\n4. If you can't apply changes, try running as Administrator" - }, - "settings": { - "general": "General", - "appearance": "Appearance", - "hotkeys": "Hotkeys", - "network": "Network", - "sponsor": "Sponsor", - "navigation": "Navigation", - "about": "About", - "generalSettings": { - "title": "General Settings", - "language": "Language", - "languageLabel": "Language", - "languages": { - "zh": "Simplified Chinese", - "zh-TW": "Traditional Chinese", - "en": "English", - "fr": "French", - "ja": "Japanese", - "de": "German" - }, - "homepage": "Homepage", - "todayPopularityLabel": "Today's Popularity", - "todayPopularityDesc": "Show today's popularity random number on homepage", - "announcementLabel": "Announcement", - "announcementDesc": "Show announcement card on homepage", - "randomQuoteLabel": "Random Quote", - "randomQuoteDesc": "Show random quote card on homepage", - "gameLauncherLabel": "Quick Launch", - "gameLauncherDesc": "Show quick launch card on homepage", - "homeHardwareModelLabel": "Hardware Model", - "homeHardwareModelDesc": "Show a brief summary of CPU/GPU/RAM/Motherboard/Storage on the homepage", - "searchBarLabel": "Search Bar", - "searchBarDesc": "Show the global search bar in the title bar", - "feedbackLabel": "Image Carousel", - "feedbackDesc": "Show image carousel on the home page", - "splash": "Animation", - "splashLogoLabel": "Splash Logo", - "splashLogoDesc": "Customize the logo image shown during startup", - "splashLogoReset": "Reset to Default", - "features": "Features", - "advanced": "Advanced", - "discoveryPage": "Discovery Page", - "discoveryPageDesc": "Change whether the left navigation bar on the instance page is displayed and its grouping method", - "navMode": "Instance Page Navigation Mode", - "navModeDesc": "Change the display and grouping method of the instance page left navigation bar", - "quickSwitch": "Quick Switch Instances & Accounts", - "quickSwitchDesc": "When enabled, clicking the switch button on the launch page allows you to directly select an account or instance without navigating to another page", - "resourceTranslation": "Display Resource Translations", - "resourceTranslationDesc": "When enabled, the resource download page will attempt to display Simplified Chinese translations for names or descriptions", - "autoLanguage": "Auto-Set Instance Language", - "autoLanguageDesc": "When enabled, newly created instances will automatically be set to Simplified Chinese, which will also skip accessibility settings", - "navModes": { - "byInstance": "By Instance", - "byGroup": "By Group" - }, - "startup": "Startup", - "autoStartLabel": "Launch on Startup", - "autoStartDesc": "Automatically launch NexBox when system starts", - "closeBehavior": "Close Behavior", - "closeBehaviorLabel": "When clicking close button", - "closeBehaviorDesc": "Choose what happens when clicking the close button", - "closeDirectly": "Close Directly", - "minimizeToTray": "Minimize to Tray", - "navPositionLabel": "Navigation Position", - "navPositionDesc": "Choose whether to display the navigation on the side or top", - "navPositionLeft": "Side", - "navPositionTop": "Top", - "sidebarShowLabel": "Sidebar Labels", - "sidebarShowLabelDesc": "Choose the sidebar display mode", - "sidebarShowLabelNoText": "Icons Only", - "sidebarShowLabelWithText": "Icons & Text", - "navButtonVisibility": "Nav Button Visibility", - "navButtonVisibilityDesc": "Show or hide individual navigation buttons. Settings is always visible.", - "pageTransitionLabel": "Page Transition Animation", - "pageTransitionDesc": "Disable to turn off page transition animations", - "pageTransitionSlide": "Slide", - "pageTransitionFade": "Fade", - "pageTransitionOff": "Off" - }, - "appearanceSettings": { - "title": "Appearance Settings", - "theme": "Theme", - "themeStyle": "Theme Style", - "themeStyles": { - "light": "Light", - "dark": "Dark" - }, - "font": "Font", - "fontLabel": "Interface Font", - "fontDesc": "Choose the application interface font, default is Sinter", - "importCustomFontLabel": "Import Custom Font", - "importCustomFontDesc": "Supports TTF / OTF / WOFF format font files", - "importFontButton": "Import Font", - "importingFont": "Importing...", - "removeFont": "Remove Font", - "duplicateFont": "This font already exists", - "importFontFailed": "Failed to import font", - "liquidGlass": "Liquid Glass", - "liquidGlassLabel": "Liquid Glass", - "liquidGlassDesc": "When enabled, some interfaces will use the \"Liquid Glass\" effect, which may affect performance", - "liquidGlassBlurLabel": "Blur Intensity", - "liquidGlassModeLabel": "Glass Mode", - "liquidGlassModeNormal": "Normal Liquid Glass", - "liquidGlassModeReal": "Real Liquid Glass", - "liquidGlassModeNormalDesc": "Uses blur and transparency to simulate glass texture, blur intensity adjustable", - "liquidGlassModeRealDesc": "Uses SVG refraction filter for edge refraction and chromatic aberration, more realistic but requires more GPU resources", - "jellyBounce": "Jelly Bounce", - "jellyBounceLabel": "Jelly Bounce Effect", - "jellyBounceDesc": "When enabled, all cards, menus, and the navigation bar will have an elastic scale animation during interactions and state changes", - "customBackground": "Custom Background", - "customBackgroundLabel": "Enable Custom Background", - "imageUrlPlaceholder": "Enter image URL or click to upload", - "maxImagesReached": "Maximum of 3 background images allowed", - "presetBackground": "Preset Background", - "carouselLabel": "Auto Carousel", - "carouselDesc": "Auto-switch presets every 10 seconds", - "imageBackground": "Image Background", - "dynamicBackground": "Dynamic Background", - "dynamicBackgroundDesc": "When enabled, dynamic background effect will be displayed", - "uploadVideo": "Upload Video", - "unsupportedVideoFormat": "Unsupported video format. Please use mp4 or webm files.", - "themeColor": "Theme Color", - "themeColorLabel": "Custom Theme Color", - "themeColorDesc": "Set the theme color for navigation bar, buttons, menus and other elements", - "presets": "Preset Colors", - "customColor": "Custom Color", - "advancedSettings": "Advanced Settings", - "hoverOpacity": "Hover Opacity", - "activeOpacity": "Active Opacity", - "borderOpacity": "Border Opacity", - "backgroundBlurLabel": "Background Blur", - "backgroundBlurHint": "Applies to all background modes (preset / image / video)", - "resetToDefault": "Reset to Default", - "presetColors": { - "cyan": "Cyan", - "blue": "Blue", - "purple": "Purple", - "pink": "Pink", - "orange": "Orange", - "green": "Green", - "red": "Red", - "yellow": "Yellow" - } - }, - "networkSettings": { - "title": "Network Latency Test", - "description": "Test network latency to various servers", - "testButton": "Test", - "testing": "Testing...", - "testingAll": "Testing All...", - "testAll": "Test All", - "latency": "Latency", - "timeout": "Timeout", - "unreachable": "Unreachable", - "servers": { - "baidu": "Baidu", - "gitee": "Gitee", - "github": "GitHub", - "qq": "Tencent", - "aliyun": "Alibaba Cloud", - "wangyi": "NetEase", - "bilibili": "Bilibili", - "douyin": "Douyin", - "jd": "JD.com", - "zhihu": "Zhihu" - }, - "customServers": "Custom Servers", - "addServer": "Add", - "customServerPlaceholder": "Enter server address, e.g. example.com", - "remove": "Remove" - }, - "sponsorSettings": { - "title": "Support the Developer", - "description": "If you find NexBox helpful, consider buying the author a coffee ☕", - "wechat": "WeChat Pay", - "alipay": "Alipay", - "thankYou": "Thank you for your support!", - "placeholder": "Please add QR code image", - "sponsorList": { - "title": "Sponsors", - "loading": "Loading...", - "error": "Failed to load", - "empty": "No sponsors yet" - } - }, - "aboutSettings": { - "title": "About", - "version": "Version", - "author": "Author", - "newVersion": "New Version Available", - "check": "Check", - "noUpdate": "Already up to date", - "checkFailed": "Check update failed", - "downloadFailed": "Download failed", - "installFailed": "Installation failed", - "acknowledgments": "Acknowledgments", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "Thanks to SJTU Minecraft Club open source project", - "joinUs": "Join Us", - "changelog": "Changelog", - "changelogTitle": "Current Version Updates", - "noChangelog": "No changelog available", - "loadingChangelog": "Loading...", - "updateModal": { - "title": "New Version Available", - "version": "Version", - "releaseNotes": "Release Notes", - "downloading": "Downloading...", - "downloadComplete": "Download complete. Please choose an action.", - "cancel": "Cancel", - "download": "Download", - "restartInstall": "Restart to Install", - "skip": "Later" - } - } - }, - "resolutionConverter": { - "title": "Resolution Converter", - "selectResolution": "Select Resolution", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "Aspect Ratios", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "W", - "height": "H", - "pixels": "px", - "standard": "Standard", - "tip": "Select a resolution type to see the specific resolution values for three common aspect ratios below, helping you adjust aspect ratio settings in games." - }, - "systemOptimizer": { - "pageTitle": "System Optimizer", - "pageDesc": "Toggle system optimizations for better performance and privacy", - "credits": "Powered by 1U Toolbox system optimization", - "loading": "Loading...", - "category": { - "gaming": "Gaming & Graphics", - "nvidia": "NVIDIA GPU", - "amd": "AMD GPU", - "performance": "System Performance", - "privacy": "Privacy & Telemetry", - "services": "System Services", - "disk": "Disk & File System", - "apps": "Apps & UI" - }, - "gaming": { - "mmcssGameConfig": "MMCSS Full Game Config", - "mmcssGameConfigDesc": "Set game task highest priority, GPU priority 8, disable lazy mode", - "gamePriority": "Prioritize Game Tasks", - "gamePriorityDesc": "Boost MMCSS Games task priority for more CPU resources", - "networkSRResponse": "Network & SR Response", - "networkSRResponseDesc": "Disable network throttling, set SystemResponsiveness to 0", - "directXAutoHDR": "Enable DirectX AutoHDR", - "directXAutoHDRDesc": "Enable DirectX automatic high dynamic range", - "directXFlipModel": "Enable DirectX Flip Model", - "directXFlipModelDesc": "Force Flip Model presentation, reduce frame latency", - "directXVRR": "Enable DirectX VRR", - "directXVRRDesc": "Enable variable refresh rate optimization", - "disableDXMaxWindow": "Disable DX Max Window Mode", - "disableDXMaxWindowDesc": "Globally disable maximized window mode, avoid DWM latency", - "disableGPUPreemption": "Disable GPU Preemption", - "disableGPUPreemptionDesc": "Disable GPU preemption, reduce input latency", - "disableGameBar": "Disable GameBar", - "disableGameBarDesc": "Disable GameBar controller shortcuts and startup panel", - "disableGameDVR": "Disable Game DVR", - "disableGameDVRDesc": "Disable Game DVR background recording, free system resources", - "disableBcastDVR": "Disable Broadcast DVR Service", - "disableBcastDVRDesc": "Disable BcastDVRUserService service", - "disableAutoColorMgmt": "Disable Auto Color Management", - "disableAutoColorMgmtDesc": "Disable DirectX auto color management, reduce GPU overhead" - }, - "nvidia": { - "lowLatencyThreshold": "NVIDIA Low Latency Threshold", - "lowLatencyThresholdDesc": "Set GPU scheduler latency thresholds to minimum, reduce input lag", - "perCpuDPC": "NVIDIA Per-CPU DPC", - "perCpuDCPDesc": "Distribute GPU interrupts across cores, reduce single-core latency", - "imageSharpening": "NVIDIA Image Sharpening", - "imageSharpeningDesc": "Enable Image Sharpening globally, improve clarity", - "disableGpuPowerMgmt": "Disable NVIDIA GPU Power Mgmt", - "disableGpuPowerMgmtDesc": "Disable runtime power management and ASPM, maintain peak performance", - "disableHDCP": "Disable NVIDIA HDCP", - "disableHDCPDesc": "Disable HDCP handshake overhead, reduce display latency", - "disableWriteCombining": "Disable NVIDIA Write Combining", - "disableWriteCombiningDesc": "Disable Write Combining, reduce GPU latency", - "disableClockGating": "Disable NVIDIA Clock Gating", - "disableClockGatingDesc": "Disable BLCG/ELCG/ELPG/FSPG/SLCG, prevent downclocking", - "disableTelemetry": "Disable NVIDIA Telemetry", - "disableTelemetryDesc": "Disable GeForce Experience telemetry data collection", - "disableDriverLog": "Disable NVIDIA Driver Log", - "disableDriverLogDesc": "Disable driver internal logging, reduce overhead", - "lockPState0": "Lock NVIDIA P-State 0", - "lockPState0Desc": "Lock maximum performance state, prevent GPU downclocking", - "disableMiracastOverlay": "Disable Miracast & Overlay", - "disableMiracastOverlayDesc": "Disable Miracast casting and driver overlay" - }, - "amd": { - "shaderCache": "Force AMD Shader Cache", - "shaderCacheDesc": "Force enable shader cache, reduce game stuttering" - }, - "performance": { - "intelTSX": "Enable Intel TSX", - "intelTSXDesc": "Enable Transactional Synchronization Extensions (Intel only)", - "mergeSvcHost": "Merge ServiceHost Processes", - "mergeSvcHostDesc": "Increase split threshold, reduce svchost process count", - "shortenTaskTimeout": "Shorten Task Timeout", - "shortenTaskTimeoutDesc": "HungAppTimeout=1000, WaitToKillApp=2000", - "shortenServiceTimeout": "Shorten Service Timeout", - "shortenServiceTimeoutDesc": "WaitToKillServiceTimeout=2000, faster shutdown", - "mouseHoverDelay": "Mouse Hover Delay", - "mouseHoverDelayDesc": "Reduce MouseHoverTime from 400ms to 10ms", - "disableStartupDelay": "Disable Startup Delay", - "disableStartupDelayDesc": "StartupDelayInMSec=0, instant availability on boot", - "disablePowerSaving": "Disable Power Saving", - "disablePowerSavingDesc": "Disable PowerThrottling and hibernation (not for laptops)", - "nvmeTuning": "NVMe Tuning", - "nvmeTuningDesc": "Continuous memory allocation, disable logging and idle power saving" - }, - "privacy": { - "disableTelemetrySvc": "Disable Telemetry Services", - "disableTelemetrySvcDesc": "Disable DiagTrack and dmwappushservice", - "disableCEIP": "Disable CEIP-SQM", - "disableCEIPDesc": "Disable Customer Experience Improvement Program", - "disableDotNetTelemetry": "Disable .NET Telemetry", - "disableDotNetTelemetryDesc": "DOTNET_CLI_TELEMETRY_OPTOUT=1", - "disableAppImpactTelemetry": "Disable App Impact Telemetry", - "disableAppImpactTelemetryDesc": "Disable AITEnable policy", - "disableAppImpactTelemetryAgent": "Disable App Impact Telemetry Agent", - "disableAppImpactTelemetryAgentDesc": "Disable AIT agent", - "disableLicenseTelemetry": "Disable License Telemetry", - "disableLicenseTelemetryDesc": "NoGenTicket=1, stop license telemetry", - "disableScheduledDiag": "Disable Scheduled Diagnostics", - "disableScheduledDiagDesc": "Disable scheduled diagnostic execution", - "disableWebcamTelemetry": "Disable Webcam Telemetry", - "disableWebcamTelemetryDesc": "webcam ConsentStore=Deny", - "disableWritingFeedback": "Disable Writing Feedback", - "disableWritingFeedbackDesc": "Disable handwriting input feedback collection", - "disableErrorReporting": "Disable Windows Error Reporting", - "disableErrorReportingDesc": "Disable WER, stop error data upload" - }, - "services": { - "disableSensorSvc": "Disable Sensor Services", - "disableSensorSvcDesc": "Disable SensrSvc and SensorDataService", - "disableFaxSvc": "Disable Fax Service", - "disableFaxSvcDesc": "Disable Fax service", - "disablePrintSvc": "Disable Print Service", - "disablePrintSvcDesc": "Disable Print Spooler service", - "disableMapsBroker": "Disable Maps Broker", - "disableMapsBrokerDesc": "Disable MapsBroker service", - "disableUCPD": "Disable UCPD", - "disableUCPDDesc": "Disable User Choice Protection Driver", - "disableDCOM": "Disable DCOM", - "disableDCOMDesc": "Disable Distributed Component Object Model", - "disableStorageSense": "Disable StorageSense", - "disableStorageSenseDesc": "Disable storage sense auto cleanup", - "disableAutoMaintenance": "Disable Auto Maintenance", - "disableAutoMaintenanceDesc": "MaintenanceDisabled=1", - "disableAppCompat": "Disable App Compatibility", - "disableAppCompatDesc": "Disable compatibility engine and PCA", - "disableStepRecorder": "Disable Step Recorder", - "disableStepRecorderDesc": "DisableUAR=1", - "disablePerfTips": "Disable Performance Tips", - "disablePerfTipsDesc": "Disable performance improvement suggestions" - }, - "disk": { - "disable8dot3": "Disable 8.3 Filenames", - "disable8dot3Desc": "NtfsDisable8dot3NameCreation=1, reduce disk overhead", - "disableNtfsEncryption": "Disable NTFS Encryption", - "disableNtfsEncryptionDesc": "NtfsDisableEncryption=1", - "disableLastAccess": "Disable Last Access Update", - "disableLastAccessDesc": "NtfsDisableLastAccessUpdate, reduce disk writes", - "disableReservedStorage": "Disable Reserved Storage", - "disableReservedStorageDesc": "Free up ~7GB reserved space", - "disableFullFsSearch": "Disable Full FS Search", - "disableFullFsSearchDesc": "Only search indexed locations, reduce disk scanning" - }, - "apps": { - "disableBackgroundApps": "Disable Background Apps", - "disableBackgroundAppsDesc": "GlobalUserDisabled=1", - "disableEdgeStartupBoost": "Disable Edge Startup Boost", - "disableEdgeStartupBoostDesc": "Disable Edge pre-launch and background running", - "slimEdgeAds": "Slim Edge Ads", - "slimEdgeAdsDesc": "Disable sidebar, ads, shopping assistant, etc.", - "disableSearchWebView2": "Disable Search WebView2", - "disableSearchWebView2Desc": "Disable Search WebView2 rendering" - }, - "batchEnable": "Optimize All", - "batchDisable": "Revert All", - "batchOptimized": "All optimizations applied successfully", - "batchReverted": "All optimizations reverted", - "batchError": "Batch operation failed", - "optimized": "Optimized", - "reverted": "Reverted", - "optimizing": "Running...", - "operationError": "Operation failed", - "requiresReboot": "Requires system reboot to take full effect" - }, - "windowsUpdate": { - "pageTitle": "Disable Windows Update", - "pageDesc": "Completely disable Windows auto-update including services, group policies and scheduled tasks (reversible)", - "servicesStatus": "Update Services", - "servicesDisabled": "Disabled", - "servicesRunning": "Running", - "policyStatus": "Group Policy", - "policyConfigured": "Configured", - "policyNotConfigured": "Not Configured", - "schedulerStatus": "Scheduled Tasks", - "schedulerDisabled": "Disabled", - "schedulerRunning": "Running", - "overallStatus": "Overall Status", - "allDisabled": "Completely Disabled", - "notAllDisabled": "Not Fully Disabled", - "disableBtn": "Disable Windows Update", - "enableBtn": "Restore Windows Update", - "disableSuccess": "Windows Update has been successfully disabled", - "enableSuccess": "Windows Update has been successfully restored", - "disableError": "Disable failed", - "enableError": "Restore failed", - "checking": "Checking status...", - "warningTitle": "\u26a0\ufe0f Warning", - "warningDesc": "After disabling Windows Update, you will no longer receive security patches and feature updates. It is recommended to manually check for updates periodically or re-enable when needed.", - "pauseCard": { - "title": "Pause Windows Update (1000 Weeks)", - "desc": "Pause Windows Update for about 1000 weeks (~19 years). After writing to the registry, you need to manually adjust the pause duration in Windows Update settings.", - "checking": "Checking pause status...", - "paused": "Paused", - "notPaused": "Not Paused", - "applyBtn": "Pause Updates for 1000 Weeks", - "restoreBtn": "Restore Updates", - "applySuccess": "Successfully wrote pause update registry", - "restoreSuccess": "Successfully restored update registry", - "applyError": "Failed to write pause update", - "restoreError": "Failed to restore update", - "manualHintTitle": "💡 Important Note", - "manualHint": "After writing successfully, open Settings → Windows Update → Pause Updates and manually adjust the pause duration to the maximum value, otherwise the registry time will not take effect." - } - }, - "gpuDriverRestart": { - "pageTitle": "Restart Graphics Driver", - "pageDesc": "Simulate Win+Ctrl+Shift+B to restart graphics driver (for internet cafe users)", - "detailDesc": "Click the button to send a graphics driver restart command to the system, equivalent to pressing Win+Ctrl+Shift+B. The screen will briefly go black or flicker and return to normal within seconds. No administrator privileges required.", - "restartBtn": "Restart Graphics Driver", - "success": "Restart command sent, screen will flicker briefly", - "error": "Failed to restart graphics driver", - "waiting": "Executing restart command, please wait...", - "warningTitle": "Note", - "warningDesc": "Restarting the graphics driver will cause a brief black screen or flicker. Please ensure no important tasks (such as gaming or file editing) are in progress. Suitable for display anomalies, screen artifacts, stuttering, etc. Windows only." - }, - "shaderCache": { - "title": "Shader Cache Cleanup", - "vendorTitle": "GPU Vendor", - "vendorSubtitle": "Organize cleanup items by vendor, NVIDIA selected by default.", - "nvidia": { - "name": "NVIDIA", - "description": "Clean DXCache, GLCache, NV_Cache following NVIDIA official paths.", - "selected": "Selected", - "selectable": "Selectable" - }, - "amd": { - "name": "AMD", - "description": "Clean AMD Software Reset Shader Cache user-level cache directories.", - "selected": "Selected", - "selectable": "Click to Select" - }, - "detected": "Detected", - "notDetected": "Not Detected", - "dirs": "{{count}} dirs", - "cleanButton": "Force Cleanup", - "cleaning": "Cleaning...", - "scanButton": "Re-scan", - "forceCleanTip": "Force cleanup will attempt to delete all cache files. Files in use will be marked for deletion on next reboot.", - "rebootPending": "{{count}} file(s) are currently in use and will be deleted after reboot.", - "officialTip": { - "title": "NVIDIA Official Recommendation", - "description": "Follow the steps below before running cleanup on this page.", - "step1": "1. Open NVIDIA Control Panel, set shader cache size to Disabled in 3D Settings.", - "step2": "2. Restart your computer, then come back and run \"Clean NVIDIA\".", - "step3": "3. After cleanup, re-enable shader cache. The size depends on your C drive capacity." - }, - "cleanSuccess": "Cleanup complete, freed {{size}}", - "cleanError": "Cleanup failed", - "scanError": "Scan failed", - "noVendorSelected": "Please select at least one GPU vendor" - }, - "epic": { - "title": "Epic Free Games", - "loading": "Loading free games...", - "errorFetch": "Failed to fetch data", - "errorNetwork": "Network request failed, please check your connection", - "deadline": "Until {{date}}", - "claimNow": "Claim Now", - "noGames": "No free games available, check back later", - "reload": "Reload" - }, - "search": { - "placeholder": "Search features...", - "noResults": "No results found", - "typeToSearch": "Type to search...", - "categories": { - "pages": "Pages", - "builtinTools": "Built-in Tools", - "optimization": "Optimization", - "thirdpartyTools": "Third-party Tools" - } - }, - "closeDialog": { - "title": "Close Confirmation", - "message": "How would you like to close the app?", - "closeApp": "Close App", - "minimizeToTray": "Minimize to Tray", - "dontAskAgain": "Don't ask again" - }, - "tray": { - "show": "Show Main Window", - "exit": "Exit" - }, - "hotkeySettings": { - "title": "Hotkey Settings", - "overlay": "Overlay", - "overlayToggle": "Toggle Overlay Panel", - "overlayToggleDesc": "Use shortcut to show or hide the overlay panel", - "crosshair": "Crosshair", - "crosshairToggle": "Toggle Crosshair", - "crosshairToggleDesc": "Use shortcut to show or hide the crosshair", - "filter": "Filter", - "filterToggle": "Toggle Display Filter", - "filterToggleDesc": "Use shortcut to enable or disable the display filter", - "saved": "Hotkey saved" - }, - "diskHealth": { - "title": "Disk Health", - "refresh": "Refresh", - "scanning": "Scanning...", - "total": "Total Disks", - "healthy": "Healthy", - "warning": "Warning", - "unhealthy": "Unhealthy", - "temperature": "Temperature", - "lifespan": "Health", - "powerOnHours": "Power On Hours", - "operationalStatus": "Status", - "readErrors": "Read Errors", - "writeErrors": "Write Errors", - "partitions": "partitions", - "loadError": "Failed to load disk data", - "retry": "Retry" - }, - "screenRecord": { - "title": "Screen Recording", - "description": "Hardware-accelerated screen recording with high frame rate capture", - "loading": "Loading...", - "previewWaiting": "Waiting for recording to start...", - "recording": "Recording", - "idle": "Idle", - "openPreview": "Open Preview Window", - "closePreview": "Close Preview", - "settings": { - "title": "Recording Settings", - "source": "Capture Source", - "display": "Display", - "window": "Window", - "windowSrc": "App Window", - "fps": "Frame Rate", - "resolution": "Resolution", - "original": "Original", - "bitrate": "Bitrate", - "codec": "Encoder", - "container": "Format", - "captureCursor": "Capture Cursor", - "savePath": "Save Path", - "selectPath": "Select Save Location" - }, - "controls": { - "start": "Start Recording", - "stop": "Stop Recording", - "recording": "Recording", - "paused": "Paused" - }, - "stats": { - "title": "Recording Stats", - "lastRecording": "Last Recording", - "elapsed": "Elapsed Time", - "targetFps": "Target FPS", - "captureFps": "Capture FPS", - "outputFps": "Output FPS", - "droppedFrames": "Dropped Frames", - "totalFrames": "Total Frames", - "fileSize": "File Size", - "currentBitrate": "Current Bitrate" - }, - "warnings": { - "refreshRateLow": "Display refresh rate ({{hz}}Hz) is lower than target FPS ({{fps}}fps). Frame duplication will be used.", - "noDisplayFound": "No captureable display found", - "savePathRequired": "Please select a save path first", - "encodingError": "Encoding error: {{message}}" - }, - "messages": { - "recordingStarted": "Recording started", - "recordingStopped": "Recording stopped, file saved to: {{path}}", - "recordingError": "Recording error: {{message}}" - } - }, - "audioEq": { - "title": "EQ Tuner", - "loading": "Loading...", - "virtualSoundCard": "Virtual Sound Card", - "virtualSoundCardDesc": "Install FxSound virtual audio driver to enable system-level EQ", - "installed": "Installed", - "notInstalled": "Not Installed", - "needsReboot": "Reboot Required", - "rebootHint": "The driver has been marked for deletion. A system restart is required to complete the uninstallation. After rebooting, run the uninstall again to clean up remaining files.", - "serviceRunning": "Service Running", - "installDriver": "Install Driver", - "uninstallDriver": "Uninstall Driver", - "installing": "Installing...", - "uninstalling": "Uninstalling...", - "installSuccess": "Installation Successful", - "installFailed": "Installation Failed", - "uninstallSuccess": "Uninstallation Successful", - "uninstallFailed": "Uninstallation Failed", - "installHint": "Installing the driver requires administrator privileges. Please run NexBox as administrator.", - "eqEngine": "EQ Engine", - "eqEngineDesc": "Start the audio processing engine to apply EQ effects", - "running": "Running", - "stopped": "Stopped", - "startEngine": "Start Engine", - "stopEngine": "Stop Engine", - "starting": "Starting...", - "engineStarted": "EQ Engine Started", - "engineStartFailed": "Failed to Start EQ Engine", - "engineStopped": "EQ Engine Stopped", - "engineStopFailed": "Failed to Stop EQ Engine", - "installDriverFirst": "Please install the virtual sound card driver first", - "presets": "Presets", - "equalizer": "Equalizer", - "reset": "Reset", - "presetApplied": "Preset Applied", - "usageGuide": "Usage Guide", - "step1": "Click \"Install Driver\" to install the FxSound virtual audio driver (requires admin privileges)", - "step2": "After installation, click \"Start Engine\" to launch the EQ audio processing engine", - "step3": "Select a preset or drag the band sliders to adjust EQ parameters. The frequency response curve updates in real-time.", - "step4": "When done, click \"Stop Engine\" to stop audio processing. You can uninstall the driver at any time.", - "import": "Import", - "importDesc": "Import a .fac preset file. It will appear in the import list.", - "chooseFacFile": "Choose .fac file", - "importSuccess": "Import successful", - "importFailed": "Import failed", - "deletePreset": "Delete", - "deleteSuccess": "Deleted", - "deleteFailed": "Delete failed", - "deleteConfirm": "Are you sure you want to delete \"{name}\"?", - "noImported": "No imported presets" - } -} - diff --git a/参考/NexBox-main/src/locales/fr.json b/参考/NexBox-main/src/locales/fr.json deleted file mode 100644 index e11db93..0000000 --- a/参考/NexBox-main/src/locales/fr.json +++ /dev/null @@ -1,1283 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "New Horizon Box", - "description": "Surveillance des performances multiplateforme (Tauri + Next.js + Service de capteur)" - }, - "view": { - "grid": "Vue grille", - "list": "Vue liste" - }, - "onboarding": { - "title": "Bienvenue sur NexBox", - "subtitle": "Commençons", - "step": "Étape", - "steps": { - "language": { - "title": "Choisissez votre langue", - "description": "Sélectionnez votre langue préférée" - }, - "theme": { - "title": "Choisissez votre thème", - "description": "Sélectionnez votre thème d'interface préféré", - "light": "Clair", - "dark": "Sombre" - }, - "complete": { - "title": "Prêt !", - "description": "Vous avez terminé toute la configuration. Commencez à utiliser NexBox maintenant !", - "button": "Commencer" - } - } - }, - "sidebar": { - "home": "Accueil", - "tools": "Outils", - "hardware": "Matériel", - "optimization": "Optimiser", - "displayFilter": "Filtre", - "floatingNav": "Navigation flottante", - "crosshair": "Réticule", - "overlayPanel": "Panneau superposé", - "builtinTools": "Outils intégrés", - "deltaForce": "Delta Force", - "music": "Musique", - "mood": "Humeur", - "settings": "Paramètres", - "gpuRename": "Renommage GPU", - "resolutionConverter": "Convertisseur de résolution", - "dlssPreset": "Paramètres DLSS Delta Force", - "epicFree": "Jeux gratuits Epic", - "diskHealth": "Santé du disque", -"screenRecord": "Enregistrement d'écran", - "audioEq": "Égaliseur EQ" - }, - "optimization": { - "pageTitle": "Optimiser", - "pageDesc": "Outils d'optimisation système et de performances", - "windowsTitle": "Optimisation Windows", - "windowsDesc": "Optimisez les performances du système et améliorez l'expérience de jeu", - "title": "Optimisation Windows", - "description": "Optimisez les performances du système et améliorez l'expérience de jeu", - "selectAll": "Tout sélectionner", - "recommended": "Recommandé", - "options": { - "tempFileCleanup": "Nettoyer les fichiers temporaires", - "privacyServiceOptimize": "Optimisation des services (vie privée et télémétrie)", - "memoryCleanup": "Libérer la mémoire de l'ordinateur", - "closeWallpaperEngine": "Fermer Wallpaper Engine", - "optimizeAce": "Optimiser les processus ACE", - "highPerformancePower": "Passer au plan d'alimentation haute performance", - "flushDns": "Vider le cache DNS" - }, - "tip": "Astuce : Après avoir cliqué sur commencer l'optimisation, cela vous aidera à optimiser les fonctionnalités sélectionnées. L'optimisation ne prend effet qu'une seule fois, et quitter le jeu ou cliquer sur le bouton d'arrêt arrêtera l'optimisation", - "startButton": "Commencer l'optimisation", - "optimizing": "Optimisation en cours...", - "starting": "Démarrage de l'optimisation...", - "completed": "Optimisation terminée", - "completedDesc": "Optimisation du système terminée avec succès", - "error": "L'optimisation a échoué, veuillez réessayer", - "pleaseSelectOptions": "Veuillez sélectionner les options à optimiser", - "results": { - "tempFiles": "Fichiers temporaires", - "tempFilesComplete": "Nettoyage terminé", - "serviceOptimize": "Optimisation des services", - "serviceOptimizeComplete": "Terminé", - "memoryOptimize": "Optimisation de la mémoire", - "memoryOptimizeComplete": "Terminé", - "aceProcess": "Processus ACE", - "powerPlan": "Plan d'alimentation" - }, - "startupManager": { - "title": "Gestionnaire de démarrage", - "description": "Gérer les éléments de démarrage du système", - "scanError": "Échec de l'analyse des éléments de démarrage", - "deleteSuccess": "Supprimé: {{name}}", - "deleteError": "Échec de la suppression", - "locateError": "Échec de la localisation du fichier", - "registryError": "Échec de l'ouverture du registre", - "totalItems": "{{count}} éléments de démarrage", - "refresh": "Actualiser", - "scanning": "Analyse des éléments de démarrage...", - "noItems": "Aucun élément de démarrage trouvé", - "columnName": "Nom", - "columnPath": "Chemin", - "columnActions": "Actions", - "locateFile": "Localiser le fichier", - "findInRegistry": "Rechercher dans le registre", - "delete": "Supprimer", - "tipTitle": "💡 Astuce", - "tipDescription": "Le gestionnaire de démarrage vous aide à voir et gérer tous les éléments de démarrage automatique de votre système. La désactivation des éléments inutiles peut accélérer le démarrage. Soyez prudent, certains éléments peuvent être nécessaires au fonctionnement normal du système." - }, - "systemOptimize": { - "title": "Optimisation système", - "description": "Optimiser les services système et les paramètres de confidentialité", - "loadFailed": "Échec du chargement", - "loading": "Vérification de l'état...", - "optimizing": "Optimisation...", - "restoring": "Restauration...", - "optimizeAll": { - "title": "Tout activer", - "description": "Activer tous les interrupteurs pour activer toutes les optimisations", - "button": "Tout activer" - }, - "restore": { - "title": "Tout désactiver", - "description": "Désactiver tous les interrupteurs pour annuler toutes les optimisations", - "button": "Tout désactiver" - }, - "enabled": "Activé", - "tweakList": "État des optimisations", - "tweaks": { - "master": "Arrêt auto des programmes sans réponse", - "removeMenuDelay": "Réduire le délai des menus", - "disableNetworkThrottling": "Désactiver la limitation réseau", - "disableErrorReporting": "Désactiver les rapports d'erreurs", - "disableCompatibilityAssistant": "Désactiver l'assistant de compatibilité", - "disablePrintService": "Désactiver le service d'impression", - "disableFaxService": "Désactiver le service de fax", - "disableStickyKeys": "Désactiver les touches rémanentes", - "disableSmartScreen": "Désactiver SmartScreen", - "disableSystemRestore": "Désactiver la restauration système", - "disableSuperfetch": "Désactiver Superfetch/SysMain", - "disableHibernate": "Désactiver la mise en veille prolongée", - "disableNtfsTimestamp": "Désactiver les horodatages NTFS", - "disableTelemetryTasks": "Désactiver les tâches de télémétrie", - "disableMediaPlayerSharing": "Désactiver le partage du lecteur média", - "disableHomeGroup": "Désactiver le groupe résidentiel", - "disableSmb1": "Désactiver le protocole SMB1", - "disableSmb2": "Désactiver le protocole SMB2", - "disableCortana": "Désactiver Cortana", - "disableTelemetryServices": "Désactiver les services de télémétrie", - "disableNewsInterests": "Désactiver les actualités et centres d'intérêt", - "disableStartMenuAds": "Désactiver les pubs du menu démarrer", - "disableAdvertisingId": "Désactiver l'identifiant publicitaire", - "disableDiagnosticData": "Désactiver la collecte de données de diagnostic", - "disableOfficeTelemetry": "Désactiver la télémétrie Office", - "disableFirefoxTelemetry": "Désactiver la télémétrie Firefox", - "disableChromeTelemetry": "Désactiver la télémétrie Chrome", - "disableNvidiaTelemetry": "Désactiver la télémétrie NVIDIA", - "disableVsTelemetry": "Désactiver la télémétrie VS", - "disableEdgeTelemetry": "Désactiver la télémétrie Edge", - "disableEdgeDiscoverBar": "Désactiver la barre de découverte Edge", - "optimizeProcessCount": "Optimiser le seuil de fractionnement", - "disableStoreSearchApp": "Désactiver l'application de recherche Store", - "disableStorePromotions": "Désactiver les promotions Store", - "disableStoreAutoUpdate": "Désactiver la mise à jour auto Store", - "disableSpotlightLock": "Désactiver l'écran de verrouillage Spotlight", - "disableMyPeople": "Désactiver Mes contacts", - "disableTPMCheck": "Désactiver la vérification TPM", - "disableSensorServices": "Désactiver les services de capteurs", - "removeCastToDevice": "Supprimer Cast vers l'appareil", - "disableVBS": "Désactiver la sécurité basée sur la virtualisation", - "disableModernStandby": "Désactiver la veille moderne", - "enableGameMode": "Activer le mode jeu", - "disableXboxLive": "Désactiver Xbox Live", - "disableGameBar": "Désactiver la barre de jeu", - "disableWindowsInk": "Désactiver Windows Ink", - "disableSpellCheck": "Désactiver la vérification orthographique", - "disableAppLaunchTracking": "Désactiver le suivi des lancements", - "disableFileSystemAccess": "Désactiver l'accès au système de fichiers", - "disableDocumentsAccess": "Désactiver l'accès aux documents", - "disableCalendarAccess": "Désactiver l'accès au calendrier", - "disableContactsAccess": "Désactiver l'accès aux contacts", - "disableLanguageTracking": "Désactiver le suivi linguistique", - "disableWelcomeExperience": "Désactiver l'expérience d'accueil", - "disableFeedbackFrequency": "Désactiver la fréquence des retours", - "disableWritingHabits": "Désactiver la collecte d'habitudes d'écriture" - } - }, - "networkOptimize": { - "title": "Optimisation réseau", - "description": "Optimiser les paramètres réseau et DNS", - "loadFailed": "Échec du chargement", - "restore": "Restaurer", - "tcpCongestion": { - "title": "Contrôle de congestion TCP", - "description": "Définir le contrôle de congestion TCP sur CTCP/CUBIC" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "Désactiver TCP Chimney Offload pour réduire la latence" - }, - "nagle": { - "title": "Algorithme de Nagle", - "description": "Désactiver l'algorithme de Nagle pour réduire la latence des petits paquets" - }, - "adapterPower": { - "title": "Économie d'énergie adaptateur", - "description": "Désactiver l'économie d'énergie sur les adaptateurs réseau" - }, - "dns": { - "title": "Paramètres DNS", - "primary": "DNS principal", - "secondary": "DNS secondaire", - "apply": "Appliquer DNS", - "applied": "Appliqué", - "restore": "Restaurer DNS automatique" - }, - "dnsRequired": "Veuillez entrer au moins l'adresse DNS principale", - "batch": { - "title": "Optimisation par lot", - "description": "Appliquer ou restaurer toutes les optimisations réseau", - "enable": "Tout activer", - "disable": "Tout restaurer" - } - }, - "memoryLimit": { - "title": "Limite de mémoire", - "description": "Limiter la mémoire système disponible pour optimiser les performances de jeu", - "currentStatus": "État actuel", - "physicalMemory": "Mémoire physique", - "currentLimit": "Limite actuelle", - "noLimit": "Aucune limite", - "selectLimit": "Sélectionner la limite", - "applyLimit": "Appliquer la limite", - "restoreLimit": "Restaurer par défaut", - "limitApplied": "Limite appliquée", - "limitRestored": "Restauré par défaut", - "requiresRestart": "Redémarrage requis", - "warning": "Avertissement", - "warningText": "La définition de la limite de mémoire nécessite des privilèges d'administrateur et un redémarrage du système pour prendre effet", - "adminRequired": "Administrateur requis", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "Limite prédéfinie", - "customTab": "Limite personnalisée", - "customPlaceholder": "Entrez la valeur limite (GB)", - "selectPreset": "Sélectionnez une limite prédéfinie", - "invalidInput": "Veuillez entrer une valeur de limite mémoire valide", - "outOfRange": "La limite doit être comprise entre 0,1 et la mémoire physique" - }, - "powerManagement": { - "title": "Gestion de l'alimentation", - "description": "Importer et activer des plans d'alimentation optimisés pour de meilleures performances de jeu", - "currentPlan": "Plan d'alimentation actuel", - "builtinPlans": "Plans d'alimentation intégrés", - "systemPlans": "Plans d'alimentation système", - "import": "Importer", - "importAndActivate": "Importer et activer", - "activate": "Activer", - "importing": "Importation...", - "activating": "Activation...", - "importSuccess": "Plan d'alimentation importé avec succès", - "importFailed": "Échec de l'importation du plan d'alimentation", - "activateSuccess": "Plan d'alimentation activé", - "activateFailed": "Échec de l'activation du plan d'alimentation", - "alreadyImported": "Importé", - "notImported": "Non importé", - "active": "Actif", - "loadFailed": "Échec du chargement des plans d'alimentation", - "refresh": "Actualiser", - "tipTitle": "Conseil", - "tip": "Les plans d'alimentation affectent la consommation et les performances du système. Les plans haute performance sont recommandés pour le jeu. L'activation nécessite des privilèges d'administrateur.", - "importAll": "Tout importer", - "importingAll": "Importation en lot...", - "importAllSuccess": "{{count}} plan(s) d'alimentation importé(s) avec succès", - "importAllFailed": "{{count}} plan(s) d'alimentation n'ont pas pu être importé(s)", - "allImported": "Tous les plans d'alimentation ont déjà été importés", - "delete": "Supprimer", - "deleting": "Suppression...", - "deleteSuccess": "Plan d'alimentation supprimé", - "deleteFailed": "Échec de la suppression du plan d'alimentation", - "deleteConfirmTitle": "Confirmer la suppression", - "deleteConfirmText": "Voulez-vous vraiment supprimer le plan d'alimentation \"{{name}}\" du système ?", - "cancel": "Annuler" - }, - "memoryCleanup": { - "title": "Nettoyage de la mémoire", - "description": "Afficher les détails de la mémoire et libérer de l'espace", - "physicalMemory": "Mémoire physique", - "virtualMemory": "Mémoire virtuelle", - "workingSet": "Ensemble de travail", - "used": "Utilisé", - "available": "Disponible", - "total": "Total", - "cleanAll": "Tout nettoyer", - "cleanStandby": "Nettoyer la mémoire en attente", - "trimWorkingSet": "Réduire l'ensemble de travail", - "loading": "Chargement...", - "cleaning": "Nettoyage...", - "freedMemory": "{{size}} Mo libérés", - "noMemoryFreed": "Aucun nettoyage nécessaire", - "error": "Échec du nettoyage" - }, - "aceOptimize": { - "title": "Optimisation Delta Force/ACE", - "description": "Optimisation des processus Delta Force et limitation des ressources anti-triche ACE", - "deltaSection": { - "title": "Optimisation Delta Force", - "subtitle": "Améliorez les performances du jeu Delta Force" - }, - "deltaBoost": { - "title": "Boost de priorité", - "description": "Définir la priorité de DeltaForceClient-Win64-Shipping.exe sur Temps réel pour allouer les ressources CPU en priorité et améliorer la fluidité du jeu", - "affinityTitle": "Optimisation de l'affinité des cœurs", - "affinityDescription": "Attribuer le processus Delta Force à tous les cœurs CPU sauf CPU0 pour maximiser les performances multicœurs tout en réservant le cœur 0 pour le système", - "success": "La priorité de Delta Force est passée en temps réel", - "notRunning": "Delta Force n'est pas en cours d'exécution", - "affinitySuccess": "L'allocation des cœurs de Delta Force a été optimisée" - }, - "aceSection": { - "title": "Optimisation anti-triche ACE", - "subtitle": "Limiter l'utilisation des ressources des processus anti-triche pour libérer plus de performances pour le jeu" - }, - "aceLimit": { - "title": "Limitation de priorité", - "description": "Réduire la priorité des processus anti-triche ACE-Tray, SGuard64, SGuardSvc64 à Basse pour réduire la contention CPU", - "affinityTitle": "Restriction d'affinité des cœurs", - "affinityDescription": "Restreindre les processus anti-triche ACE à un seul cœur (CPU0) seulement, les empêchant d'occuper des ressources CPU critiques pour le jeu", - "success": "Priorité de {{count}} processus ACE limitée", - "notRunning": "Aucun processus ACE en cours d'exécution", - "affinitySuccess": "{{count}} processus ACE limités à un seul cœur" - }, - "aceEfficiency": { - "title": "Mode efficacité Windows", - "description": "Activer le mode efficacité du gestionnaire de tâches pour les processus ACE : priorité à Idle + activation de l'économie d'énergie (EcoQoS), réduisant considérablement l'utilisation des ressources en arrière-plan" - }, - "optimizeAll": { - "button": "Tout optimiser", - "optimizing": "Optimisation...", - "title": "Optimiser tout en une fois", - "description": "Exécuter ensemble le boost de priorité Delta Force et les restrictions de priorité/affinité ACE", - "success": "Toutes les optimisations terminées", - "partial": "Optimisation partielle terminée, vérifiez les détails" - }, - "autoDetect": { - "title": "Détection et optimisation automatique des processus ACE", - "description": "Surveillance en arrière-plan - limite automatiquement la priorité et l'affinité des cœurs lors de la détection des processus ACE-Tray/SGuard (vérification toutes les 5 secondes)", - "status": { - "running": "Détection automatique en cours", - "stopped": "Détection automatique arrêtée" - }, - "lastCheck": "Dernière vérification", - "never": "Jamais vérifié", - "optimizing": "Optimisation de {{count}} processus", - "enabled": "Détection automatique activée", - "disabled": "Détection automatique désactivée" - }, - "status": { - "optimized": "Optimisé", - "notRunning": "Non en cours", - "notOptimized": "À optimiser", - "processRunning": "Processus en cours", - "processNotRunning": "Processus non en cours" - }, - "apply": "Appliquer", - "applied": "Appliqué", - "error": "Échec de l'optimisation" - } - }, - "home": { - "title": "Bienvenue sur NexBox", - "welcome": "Bienvenue", - "selectTools": "Sélectionner les outils rapides", - "todayPopularity": "Popularité du jour", - "randomQuote": "Citation aléatoire", - "announcement": "Annonce", - "announcementList": "Liste des annonces", - "loading": "Chargement...", - "noAnnouncement": "Aucune annonce", - "important": "Important", - "importantAnnouncement": "Annonce importante", - "confirmAnnouncement": "OK" - }, - "hardware": { - "title": "Informations matérielles", - "processor": "Processeur", - "model": "Modèle", - "coresThreads": "Cœurs + Threads", - "cores": "cœurs", - "threads": "threads", - "baseClock": "Horloge de base", - "l3Cache": "Cache L3", - "cpuUsage": "Utilisation CPU", - "gpu": "GPU", - "memory": "Mémoire", - "driverVersion": "Version du pilote", - "temperature": "Température", - "temperatureUnit": "°C", - "usage": "Utilisation", - "motherboard": "Carte mère", - "ram": "RAM", - "manufacturer": "Fabricant", - "partNumber": "Numéro de pièce", - "capacity": "Capacité", - "speed": "Vitesse", - "bankLabel": "Emplacement", - "storage": "Stockage", - "totalCapacity": "Capacité totale", - "count": "Barrettes", - "soundCard": "Carte son", - "networkCard": "Carte réseau", - "adapterType": "Type d'adaptateur", - "macAddress": "Adresse MAC", - "linkSpeed": "Vitesse de liaison", - "deltaPasswordFetched": "Récupéré", - "deltaPasswordNotFetched": "--" - }, - "tools": { - "title": "Outils", - "subtitle": "Boîte à outils", - "description": "Fournit divers utilitaires pour vous aider à mieux gérer et optimiser votre système.", - "all": "Tout", - "hardware": "Matériel", - "assistant": "Assistant", - "network": "Réseau", - "optimization": "Optimisation", - "builtinTools": "Outils intégrés", - "thirdpartyTools": "Outils tiers", - "officialTools": "Recommandations officielles", - "recommended": "Recommandé", - "tools": { - "assistantCrosshair": "Réticule d'assistance", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Optimiseur de cœur Windows", - "windows-core-optimizer": "Optimiseur de cœur Windows", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "huorong": "火绒安全" - }, - "mctierDesc": "Outil de mise en réseau universel LAN virtuel", - "sjmclDesc": "Lanceur Minecraft tiers développé par l'Université Jiao Tong de Shanghai", - "ddegameDesc": "Les jeux ne sont pas que des jeux, ils peuvent entrer dans la vie et la changer", - "huorongDesc": "Protection terminale pure. Léger, silencieux, défense complète", - "descriptions": { - "assistantCrosshair": "Outil d'assistance de réticule d'écran de jeu", - "memreduct": "Outil de nettoyage de mémoire", - "windowsCoreOptimizer": "Uniquement efficace pour les processeurs avec architecture big.LITTLE", - "windows-core-optimizer": "Uniquement efficace pour les processeurs avec architecture big.LITTLE", - "optimizer": "Outil d'optimisation du système Windows", - "cpu-z": "Outil de détection d'informations CPU", - "gpu-z": "Outil de détection d'informations GPU", - "processLasso": "Outil d'optimisation des processus système", - "process-lasso": "Outil d'optimisation des processus système", - "fxsound": "Outil d'amélioration audio", - "msi-afterburner": "Outil d'overclocking et de surveillance GPU", - "huorong": "Protection terminale pure. Léger, silencieux, défense complète" - }, - "status": { - "available": "Disponible", - "comingSoon": "Bientôt disponible", - "installed": "Installé", - "notInstalled": "Non installé", - "downloading": "Téléchargement en cours", - "scanning": "Analyse en cours..." - }, - "buttons": { - "openTool": "Ouvrir l'outil", - "comingSoon": "Bientôt disponible", - "download": "Cliquez pour télécharger", - "run": "Cliquez pour exécuter", - "website": "Visiter le site" - }, - "messages": { - "installerStarted": "Installateur démarré", - "installerStartedDesc": "Veuillez terminer l'installation, l'outil s'affichera comme disponible par la suite", - "installComplete": "Installation terminée", - "installCompleteDesc": "Outil installé avec succès, cliquez pour exécuter", - "installerStartedAlt": "Installateur démarré", - "installerStartedDescAlt": "Veuillez terminer l'installation, le système détectera automatiquement l'état d'installation", - "downloadComplete": "Téléchargement terminé", - "downloadCompleteDesc": "L'outil est prêt, cliquez pour exécuter", - "downloadFailed": "Échec du téléchargement", - "runFailed": "Échec de l'exécution" - }, - "ariaLabels": { - "refreshToolList": "Actualiser la liste des outils" - }, - "customAdded": { - "add": "Ajouter l'outil manuellement", - "remove": "Supprimer l'ajout manuel", - "addSuccess": "Outil ajouté", - "addFailed": "Échec de l'ajout", - "removed": "Ajout manuel supprimé" - } - }, - "displayFilter": { - "title": "Filtre d'affichage", - "enable": "Activer le filtre", - "presets": "Préréglages", - "currentSettings": "Paramètres actuels", - "colorTemperature": "Température de couleur", - "brightness": "Luminosité", - "contrast": "Contraste", - "saturation": "Saturation", - "resetDefault": "Réinitialiser par défaut", - "resetSuccess": "Paramètres réinitialisés par défaut", - "filterEnabled": "Filtre activé", - "filterDisabled": "Filtre désactivé", - "presetAppliedPrefix": "Préréglage ", - "presetAppliedSuffix": " appliqué", - "error": "L'opération a échoué", - "custom": "Personnalisé", - "customDescription": "Paramètres de filtre personnalisés", - "tip": "Le filtre ajuste la courbe gamma de l'affichage pour des effets de couleur. Les paramètres sont automatiquement restaurés lorsque l'application se ferme.", - "customFilter": "Filtre personnalisé", - "saveSuccess": "Paramètres sauvegardés et appliqués", - "saveAndApply": "Sauvegarder et appliquer", - "iccProfiles": "Profils de couleur ICC", - "importIcc": "Importer un fichier ICC", - "importIccSuccess": "Fichier ICC importé", - "importIccFailed": "Échec de l'importation ICC", - "iccApplied": "Profil ICC appliqué", - "deleteIcc": "Supprimer", - "deleteIccConfirm": "Confirmer la suppression de ce préréglage ICC ?", - "deleteIccSuccess": "Préréglage ICC supprimé", - "noIccProfiles": "Aucun profil ICC importé", - "selectDisplay": "Sélectionner l'écran", - "primary": "Principal", - "cancel": "Annuler", - "delete": "Supprimer", - "exportIcc": "Exporter en fichier ICC", - "exportIccSuccess": "Fichier ICC exporté", - "exportIccFailed": "Échec de l'exportation ICC", - "previewTitle": "Aperçu du filtre", - "previewOriginal": "Original", - "previewFiltered": "Filtre", - "previewDisabledNote": "Filtre inactif · Aperçu uniquement", - "paramsUpdated": "Paramètres mis à jour", - "paramsUpdatedHint": "Activer manuellement le filtre", - "myPresets": "Mes préréglages", - "noPresets": "Aucun préréglage personnalisé\nAjustez les paramètres et cliquez sur « Enregistrer comme préréglage »", - "saveAsPreset": "Enregistrer comme préréglage", - "presetNamePlaceholder": "Entrez le nom du préréglage...", - "savePresetSuccess": "Préréglage enregistré", - "deletePreset": "Supprimer le préréglage", - "deletePresetConfirm": "Supprimer ce préréglage ?", - "deletePresetSuccess": "Préréglage supprimé", - "save": "Enregistrer" - }, -"floatingNav": { - "title": "Boîte de navigation flottante", - "enable": "Activer la boîte flottante", - "settings": "Paramètres", - "displayText": "Afficher le texte", - "width": "Largeur", - "height": "Hauteur", - "opacity": "Opacité", - "applySettings": "Appliquer les paramètres", - "preview": "Aperçu", - "previewNote": "Aperçu de l'effet (la boîte flottante réelle est en haut et au centre de l'écran)", - "enabled": "Navigation flottante activée", - "disabled": "Navigation flottante désactivée", - "settingsApplied": "Paramètres appliqués", - "error": "L'opération a échoué", - "tip": "La boîte de navigation flottante s'affichera en haut et au centre de l'écran, restant toujours au premier plan de toutes les fenêtres. Vous pouvez ajuster l'opacité pour contrôler son impact sur les autres applications.", - "displayContent": "Contenu affiché", - "cpuUsage": "Utilisation CPU", - "gpuTemp": "Température GPU", - "gpuUsage": "Utilisation GPU" - }, - "crosshair": { - "title": "Réticule d'assistance", - "enableCrosshair": "Activer le réticule", - "statusEnabled": "Activé", - "statusDisabled": "Désactivé", - "style": "Style du réticule", - "color": "Couleur", - "customColor": "Couleur personnalisée", - "size": "Taille", - "thickness": "Épaisseur", - "gap": "Espacement", - "dotSize": "Taille du point", - "opacity": "Opacité", - "preview": "Aperçu", - "parameters": "Paramètres", - "monitor": "Moniteur", - "primaryMonitor": "Moniteur principal", - "advanced": "Avancé", - "resetDefault": "Réinitialiser par défaut", - "updateFailed": "Échec de la mise à jour des paramètres", - "toggleFailed": "Échec du basculement du réticule", - "renderMode": "Mode de rendu", - "procedural": "Préréglage", - "customImage": "Image personnalisée", - "selectImage": "Choisir une image", - "styles": { - "cross": "Croix", - "dot": "Point", - "circle": "Cercle", - "crossDot": "Croix+Point", - "circleCross": "Cercle+Croix" - } - }, - "hardwareReport": { - "export": "Exporter le rapport", - "selectPath": "Sélectionner l'emplacement d'export", - "exporting": "Génération du rapport...", - "exportSuccess": "Rapport exporté avec succès", - "exportFailed": "Échec de l'exportation", - "recorderNotStarted": "L'enregistreur n'est pas démarré, veuillez réessayer plus tard" - }, - "overlayPanel": { - "title": "Panneau superposé", - "enableOverlay": "Activer le panneau superposé", - "statusEnabled": "Activé", - "statusDisabled": "Désactivé", - "displayItems": "Éléments affichés", - "hardwareMonitor": "Moniteur matériel", - "cpuUsage": "Utilisation CPU", - "gpuTemp": "Température GPU", - "gpuUsage": "Utilisation GPU", - "memoryUsage": "Utilisation de la mémoire", - "deltaPassword": "Mot de passe Delta", - "custom": "Personnalisé", - "customText": "Texte personnalisé", - "color": "Couleur", - "addCustomItem": "Ajouter un élément", - "appearance": "Paramètres d'apparence", - "styles": "Style de superposition", - "styles.default": "Par défaut", - "styles.dynamicIsland": "Île dynamique", - "styles.verticalPanel": "Panneau vertical", - "fontColor": "Couleur du texte", - "opacity": "Opacité", - "startFailed": "Échec du démarrage", - "stopFailed": "Échec de l'arrêt", - "hotkey": "Raccourci clavier", - "toggleHotkey": "Activer/Désactiver l'overlay", - "hotkeySaved": "Raccourci enregistré" - }, - "deltaForce": { - "title": "Delta Force", - "dailyPassword": "Mot de passe quotidien", - "weaponCodes": "Codes d'armes", - "weaponCodeDesc": "Sélectionnez une plateforme de codes d'armes pour parcourir et copier les codes dans une nouvelle fenêtre", - "weaponCodePlatforms": "Plateformes de codes d'armes", - "openPlatform": "Ouvrir la plateforme", - "officialMaps": "Cartes officielles", - "openOfficialMap": "Outil de carte officiel de Delta Force", - "mapToolDesc": "Points de butin, points d'apparition, points d'extraction et coordonnées des boss", - "dlssPreset": "Préréglage DLSS", - "dlssPresetDesc": "Sélectionnez un préréglage de modèle de réseau neuronal DLSS, différents préréglages pour différents scénarios", - "loading": "Chargement...", - "noPassword": "Aucune donnée de mot de passe disponible", - "copy": "Copier", - "copied": "Copié", - "copySuccess": "Copié dans le presse-papiers", - "copyFailed": "Échec de la copie", - "all": "Tout", - "recommended": "Recommandé", - "currentSelection": "Sélection actuelle", - "applyPreset": "Appliquer le préréglage", - "dlssNote": "Nécessite NVIDIA Profile Inspector, redémarrez le jeu pour que les modifications prennent effet", - "back": "Retour", - "dlssModels": { - "A": { "name": "Modèle A", "description": "Modèle précoce" }, - "B": { "name": "Modèle B", "description": "Modèle précoce" }, - "C": { "name": "Modèle C", "description": "Modèle précoce" }, - "D": { "name": "Modèle D", "description": "Modèle stable" }, - "E": { "name": "Modèle E", "description": "Modèle expérimental" }, - "F": { "name": "Modèle F", "description": "Modèle amélioré" }, - "G": { "name": "Modèle G", "description": "Modèle amélioré" }, - "J": { "name": "Modèle J", "description": "Modèle plus récent, priorité qualité" }, - "K": { "name": "Modèle K", "description": "Modèle recommandé, pour la plupart des modes DLSS" }, - "L": { "name": "Modèle L", "description": "Optimisé pour le mode Ultra Performance" }, - "M": { "name": "Modèle M", "description": "Optimisé pour le mode Performance" } - }, - "weaponCodePlatformNames": { - "maqt": "Maqt", - "anchor-codes": "Anchor Codes", - "xiaotao-check": "Xiaotao Check", - "delta-workshop": "Delta Workshop" - }, - "officialMapToolTitle": "Delta Force - Outil de carte officiel", - "officialWallpaper": "Fond d'écran officiel", - "officialWallpaperTitle": "Delta Force - Fond d'écran officiel", - "wallpaperDesc": "Téléchargement de fonds d'écran HD officiels", - "allCategories": "Toutes les catégories", - "searchPlaceholder": "Rechercher des armes...", - "allWeapons": "Toutes les armes", - "noLoadouts": "Aucun équipement trouvé", - "noLoadoutsHint": "Essayez différents filtres", - "previousPage": "Précédent", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "Suivant", - "upload": "Publier un équipement", - "category": "Catégorie", - "weaponName": "Arme", - "selectWeapon": "Sélectionnez une arme", - "code": "Code d'équipement", - "codePlaceholder": "Entrez le code d'équipement, max 500 caractères", - "description": "Description", - "descriptionPlaceholder": "Entrez une description (facultatif)", - "cost": "Coût", - "author": "Auteur", - "nicknamePlaceholder": "Entrez un pseudonyme (facultatif)", - "cancel": "Annuler", - "submit": "Soumettre", - "report": "Inutilisable ?", - "reported": "Signalé à l'admin", - "uploadSuccess": "Publication réussie", - "uploadQueueHint": "Votre équipement a été mis en file d'attente pour examen et apparaîtra après approbation", - "uploadFailed": "Échec de la publication", - "otherPlatformsCard": { - "title": "Autres plateformes", - "description": "Découvrir plus de plateformes de codes" - }, - "viewMore": "Voir plus", - "moreGunCodes": "Plus de codes", - "moreGunCodesDesc": "Découvrir plus de plateformes de codes", - "openFailed": "Échec de l'ouverture", - "otherPlatforms": { - "title": "Autres plateformes de codes", - "description": "Voici d'autres plateformes de codes d'armes. Cliquez pour ouvrir dans une nouvelle fenêtre.", - "maqt": { - "name": "MaQT", - "description": "Plateforme de codes MaQT" - }, - "anxu": { - "name": "ANXU Codes", - "description": "Plateforme de codes ANXU" - }, - "aitags": { - "name": "Codes Streamers", - "description": "Plateforme de codes streamers" - }, - "xiaotao": { - "name": "XiaoTao", - "description": "Plateforme de codes XiaoTao" - } - } - }, - "dlssPreset": { - "title": "Paramètres DLSS Delta Force", - "description": "Changer les préréglages de modèle de réseau neuronal DLSS pour optimiser les graphismes du jeu", - "presetLabel": "Préréglage DLSS", - "driverVersion": "Version du pilote", - "noGpuFound": "Aucun GPU détecté" - }, - "dlssIndicator": { - "title": "Indicateur DLSS", - "description": "Afficher le badge DLSS dans le coin inférieur gauche de l'écran de jeu", - "enabled": "Indicateur DLSS activé", - "disabled": "Indicateur DLSS désactivé", - "enabling": "Activation en cours...", - "disabling": "Désactivation en cours...", - "note": "Nécessite des privilèges administrateur, redémarrer le jeu pour appliquer" - }, - "dlssLock": { - "title": "Verrouillage DLSS", - "description": "Verrouiller la configuration du pilote nvidiaProfileInspector", - "enabled": "Configuration DLSS verrouillée", - "disabled": "Configuration DLSS déverrouillée", - "note": "Empêche les mises à jour de pilote d'écraser les paramètres" - }, - "dlssPresetTable": { - "title": "Tableau de référence des préréglages", - "description": "Préréglages DLSS recommandés pour différentes séries de GPU", - "gpuSeries": "GPU", - "recommendedPreset": "Prérégl.", - "driverVersion": "Pilote", - "scenario": "Type", - "rtx20Series": "Série RTX 20", - "rtx30Series": "Série RTX 30", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 Haut FPS", - "rtx50HighQuality": "RTX 50 Haute Qualité", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "Amélioration générale", - "typePerformanceFirst": "Performance prioritaire", - "typeQualityEnhance": "Amélioration qualité", - "typeFpsPriority": "Priorité FPS" - }, - "musicPlayer": { - "title": "Musique Shushu", - "play": "Lecture", - "pause": "Pause", - "previous": "Précédent", - "next": "Suivant", - "modeList": "Boucle liste", - "modeShuffle": "Aléatoire", - "modeOne": "Répéter une fois", - "mute": "Muet", - "unmute": "Activer le son", - "playlist": "Liste de lecture", - "noTrack": "Aucune piste sélectionnée", - "empty": "Aucun fichier musical, veuillez ajouter des fichiers MP3 dans", - "minimize": "Réduire" - }, - "mood": { - "title": "Humeur", - "connecting": "Connexion à www.nexbox.top/love ..." - }, - "builtinTools": { - "title": "Outils intégrés", - "back": "Retour", - "displayFilterDesc": "Ajuster les filtres de couleur de l'affichage", - "crosshairDesc": "Outil d'assistance de réticule d'écran de jeu", - "overlayPanelDesc": "Panneau flottant affichant l'état du matériel système", - "gpuRenameDesc": "Modifier le nom du GPU pour optimiser les performances de jeu", - "resolutionConverterDesc": "Convertir les proportions d'image pour différentes résolutions", - "shaderCacheDesc": "Nettoyer le cache des shaders NVIDIA/AMD pour libérer de l'espace disque", - "dlssPresetDesc": "Changer les préréglages de modèle DLSS pour optimiser les graphismes du jeu", - "diskHealthDesc": "Vérifier l'état de santé du disque et les informations SMART", -"screenRecordDesc": "Enregistrement d'écran haute performance (encodage matériel)", - "audioEqDesc": "Réglage d'égaliseur audio au niveau système" - }, - "gpuRename": { - "title": "Renommage GPU", - "loading": "Chargement...", - "loadError": "Échec du chargement", - "currentGpu": "GPU actuel", - "originalGpu": "GPU d'origine", - "backupStatus": "État de la sauvegarde", - "backedUp": "Sauvegardé", - "notBackedUp": "Non sauvegardé", - "selectTarget": "Sélectionner le GPU cible", - "lowEnd": "GPU bas de gamme", - "highEnd": "GPU haut de gamme", - "selectPlaceholder": "Veuillez sélectionner un GPU", - "presetTab": "GPU prédéfini", - "customTab": "GPU personnalisé", - "customPlaceholder": "Entrez un nom GPU personnalisé", - "selectGpu": "Veuillez d'abord sélectionner un GPU", - "apply": "Appliquer", - "applying": "Application...", - "restore": "Restaurer", - "restoring": "Restauration...", - "success": "Succès", - "restored": "Restauré", - "error": "Erreur", - "note": "⚠️ Remarques importantes :\n1. Privilèges d'administrateur nécessaires pour modifier le registre\n2. Redémarrage du jeu ou de l'ordinateur nécessaire après modification\n3. Cette fonction ne prend en charge que Windows et les cartes graphiques NVIDIA\n4. Si vous ne pouvez pas appliquer les modifications, essayez d'exécuter l'application en administrateur" - }, - "resolutionConverter": { - "title": "Convertisseur de résolution", - "selectResolution": "Sélectionner la résolution", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "Ratios d'aspect", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "Largeur", - "height": "Hauteur", - "pixels": "Pixels", - "standard": "Standard", - "tip": "Après avoir sélectionné le type de résolution, les valeurs de résolution spécifiques pour trois ratios d'aspect courants s'affichent ci-dessous, vous aidant à ajuster les paramètres de proportion d'image dans le jeu." - }, - "shaderCache": { - "title": "Nettoyage du cache de shader", - "vendorTitle": "Fournisseur GPU", - "vendorSubtitle": "Organiser les éléments à nettoyer par fournisseur, NVIDIA sélectionné par défaut.", - "nvidia": { - "name": "NVIDIA", - "description": "Nettoyer DXCache, GLCache, NV_Cache selon les chemins officiels NVIDIA.", - "selected": "Sélectionné", - "selectable": "Sélectionnable" - }, - "amd": { - "name": "AMD", - "description": "Nettoyer les répertoires de cache utilisateur correspondant à AMD Software Reset Shader Cache.", - "selected": "Sélectionné", - "selectable": "Cliquez pour sélectionner" - }, - "detected": "Détecté", - "notDetected": "Non détecté", - "dirs": "{{count}} répertoires", - "cleanButton": "Commencer le nettoyage", - "cleaning": "Nettoyage...", - "scanButton": "Rescanner", - "officialTip": { - "title": "Recommandation officielle NVIDIA", - "description": "Il est recommandé de suivre les étapes ci-dessous avant d'effectuer le nettoyage sur cette page.", - "step1": "1. Ouvrez le Panneau de configuration NVIDIA et définissez la taille du cache des shaders dans les paramètres 3D sur Désactivé.", - "step2": "2. Redémarrez votre ordinateur, puis revenez sur cette page et exécutez « Nettoyer NVIDIA ».", - "step3": "3. Après le nettoyage, réactivez le cache des shaders. La taille dépend de la capacité de votre disque C." - }, - "cleanSuccess": "Nettoyage terminé, {{size}} libérés", - "cleanError": "Échec du nettoyage", - "scanError": "Échec de la numérisation", - "noVendorSelected": "Veuillez sélectionner au moins un fournisseur GPU" - }, - "settings": { - "general": "Général", - "appearance": "Apparence", - "hotkeys": "Hotkeys", - "network": "Réseau", - "sponsor": "Soutenir", - "navigation": "Navigation", - "about": "À propos", - "generalSettings": { - "title": "Paramètres généraux", - "language": "Langue", - "languageLabel": "Langue", - "languages": { - "zh": "Chinois simplifié", - "zh-TW": "Chinois traditionnel", - "en": "Anglais", - "fr": "Français", - "ja": "Japonais", - "de": "Allemand" - }, - "homepage": "Page d'accueil", - "todayPopularityLabel": "Popularité du jour", - "todayPopularityDesc": "Afficher le nombre aléatoire de popularité du jour sur la page d'accueil", - "announcementLabel": "Annonces", - "announcementDesc": "Afficher la carte d'annonces sur la page d'accueil", - "randomQuoteLabel": "Citation aléatoire", - "randomQuoteDesc": "Afficher la carte de citation aléatoire sur la page d'accueil", - "gameLauncherLabel": "Lancement rapide", - "gameLauncherDesc": "Afficher la carte de lancement rapide sur la page d'accueil", - "feedbackLabel": "Carrousel d'images", - "feedbackDesc": "Afficher le carrousel d'images sur la page d'accueil", - "splash": "Animation", - "splashLogoLabel": "Logo de démarrage", - "splashLogoDesc": "Personnalisez l'image du logo affichée au démarrage", - "splashLogoReset": "Réinitialiser", - "features": "Fonctionnalités", - "advanced": "Avancé", - "discoveryPage": "Page de découverte", - "discoveryPageDesc": "Modifier si la barre de navigation gauche sur la page d'instance est affichée et sa méthode de regroupement", - "navMode": "Mode de navigation de la page d'instance", - "navModeDesc": "Modifier l'affichage et la méthode de regroupement de la barre de navigation gauche de la page d'instance", - "quickSwitch": "Changement rapide d'instances et de comptes", - "quickSwitchDesc": "Lorsque activé, cliquer sur le bouton de changement sur la page de lancement vous permet de sélectionner directement un compte ou une instance sans naviguer vers une autre page", - "resourceTranslation": "Afficher les traductions des ressources", - "resourceTranslationDesc": "Lorsque activé, la page de téléchargement des ressources tentera d'afficher des traductions en chinois simplifié pour les noms ou les descriptions", - "autoLanguage": "Langue d'instance automatique", - "autoLanguageDesc": "Lorsque activé, les instances nouvellement créées seront automatiquement définies en chinois simplifié, ce qui sautera également les paramètres d'accessibilité", - "navModes": { - "byInstance": "Par instance", - "byGroup": "Par groupe" - }, - "startup": "Démarrage", - "autoStartLabel": "Lancer au démarrage", - "autoStartDesc": "Lancer NexBox automatiquement au démarrage du système", - "closeBehavior": "Comportement de fermeture", - "closeBehaviorLabel": "Lors du clic sur fermer", - "closeBehaviorDesc": "Choisir l'action lors du clic sur le bouton fermer", - "closeDirectly": "Fermer directement", - "minimizeToTray": "Minimiser dans la barre", - "navPositionLabel": "Position de navigation", - "navPositionDesc": "Choisir d'afficher la navigation sur le côté ou en haut", - "navPositionLeft": "Côté", - "navPositionTop": "Haut", - "sidebarShowLabel": "Étiquettes de la barre latérale", - "sidebarShowLabelDesc": "Choisir le mode d'affichage de la barre latérale", - "sidebarShowLabelNoText": "Icônes uniquement", - "sidebarShowLabelWithText": "Icônes et texte", - "navButtonVisibility": "Visibilité des boutons", - "navButtonVisibilityDesc": "Afficher ou masquer les boutons de navigation individuels. Paramètres toujours visible.", - "pageTransitionLabel": "Animation de transition de page", - "pageTransitionDesc": "Désactiver pour supprimer les animations de transition", - "pageTransitionSlide": "Glissement", - "pageTransitionFade": "Fondu", - "pageTransitionOff": "Désactivé" - }, - "appearanceSettings": { - "title": "Paramètres d'apparence", - "theme": "Thème", - "themeStyle": "Style de thème", - "themeStyles": { - "light": "Clair", - "dark": "Sombre" - }, - "font": "Police", - "fontLabel": "Police d'interface", - "fontDesc": "Choisissez la police de l'interface, par défaut Sinter", - "importCustomFontLabel": "Importer une police personnalisée", - "importCustomFontDesc": "Prend en charge les fichiers TTF / OTF / WOFF", - "importFontButton": "Importer", - "importingFont": "Importation...", - "removeFont": "Supprimer", - "duplicateFont": "Cette police existe déjà", - "importFontFailed": "Échec de l'importation de la police", - "liquidGlass": "Verre liquide", - "liquidGlassLabel": "Verre liquide", - "liquidGlassDesc": "Lorsque activé, certaines interfaces utiliseront l'effet \"Verre liquide\", ce qui peut affecter les performances", - "liquidGlassBlurLabel": "Intensité du flou", - "liquidGlassModeLabel": "Mode de verre", - "liquidGlassModeNormal": "Verre liquide normal", - "liquidGlassModeReal": "Verre liquide réel", - "liquidGlassModeNormalDesc": "Simule la texture du verre avec flou et transparence, intensité réglable", - "liquidGlassModeRealDesc": "Utilise un filtre de réfraction SVG pour la réfraction des bords et l'aberration chromatique, plus réaliste mais nécessite plus de GPU", - "jellyBounce": "Rebond Gélatine", - "jellyBounceLabel": "Effet Rebond Gélatine", - "jellyBounceDesc": "Lorsque activé, toutes les cartes, menus et la barre de navigation auront une animation d'échelle élastique lors des interactions et des changements d'état", - "customBackground": "Arrière-plan personnalisé", - "customBackgroundLabel": "Activer l'arrière-plan personnalisé", - "imageUrlPlaceholder": "Entrez l'URL de l'image ou cliquez pour télécharger", - "maxImagesReached": "Maximum de 3 images d'arrière-plan autorisées", - "presetBackground": "Arrière-plan prédéfini", - "imageBackground": "Arrière-plan d'image", - "dynamicBackground": "Arrière-plan dynamique", - "dynamicBackgroundDesc": "Lorsque activé, un effet d'arrière-plan dynamique s'affichera", - "uploadVideo": "Télécharger une vidéo", - "unsupportedVideoFormat": "Format vidéo non pris en charge. Veuillez utiliser un fichier mp4 ou webm.", - "themeColor": "Couleur du thème", - "themeColorLabel": "Couleur de thème personnalisée", - "themeColorDesc": "Définir la couleur du thème pour la barre de navigation, les boutons, les menus et d'autres éléments", - "presets": "Couleurs prédéfinies", - "customColor": "Couleur personnalisée", - "advancedSettings": "Paramètres avancés", - "hoverOpacity": "Opacité au survol", - "activeOpacity": "Opacité active", - "borderOpacity": "Opacité de la bordure", - "backgroundBlurLabel": "Flou d'arrière-plan", - "backgroundBlurHint": "S'applique à tous les modes (préréglé / image / vidéo)", - "resetToDefault": "Réinitialiser par défaut", - "uploadVideo": "Télécharger une vidéo", - "presetColors": { - "cyan": "Cyan", - "blue": "Bleu", - "purple": "Violet", - "pink": "Rose", - "orange": "Orange", - "green": "Vert", - "red": "Rouge", - "yellow": "Jaune" - } - }, - "sponsorSettings": { - "title": "Soutenir le développeur", - "description": "Si vous trouvez NexBox utile, offrez un café à l'auteur ☕", - "wechat": "WeChat Pay", - "alipay": "Alipay", - "thankYou": "Merci pour votre soutien !", - "placeholder": "Veuillez ajouter l'image du code QR", - "sponsorList": { - "title": "Liste des sponsors", - "loading": "Chargement...", - "error": "Échec du chargement", - "empty": "Aucun sponsor pour l'instant" - } - }, - "aboutSettings": { - "title": "À propos", - "version": "Version", - "author": "Auteur", - "newVersion": "Nouvelle version disponible", - "check": "Vérifier", - "noUpdate": "Déjà à jour", - "checkFailed": "Échec de la vérification des mises à jour", - "downloadFailed": "Échec du téléchargement", - "installFailed": "Échec de l'installation", - "acknowledgments": "Remerciements", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "Merci au projet open source du SJTU Minecraft Club", - "changelog": "Journal des modifications", - "changelogTitle": "Mises à jour de la version actuelle", - "noChangelog": "Aucun journal des modifications disponible", - "loadingChangelog": "Chargement...", - "updateModal": { - "title": "Nouvelle version disponible", - "version": "Version", - "releaseNotes": "Notes de version", - "downloading": "Téléchargement en cours...", - "downloadComplete": "Téléchargement terminé. Veuillez choisir une action.", - "cancel": "Annuler", - "download": "Télécharger", - "restartInstall": "Redémarrer pour installer", - "skip": "Plus tard" - } - }, - "networkSettings": { - "title": "Test de latence réseau", - "description": "Tester la latence vers divers serveurs", - "testButton": "Tester", - "testing": "Test en cours...", - "testingAll": "Test de tous en cours...", - "testAll": "Tester tout", - "latency": "Latence", - "timeout": "Expiration", - "unreachable": "Injoignable", - "servers": { - "baidu": "Baidu", - "gitee": "Gitee", - "github": "GitHub", - "qq": "Tencent", - "aliyun": "Alibaba Cloud", - "wangyi": "NetEase", - "bilibili": "Bilibili", - "douyin": "Douyin", - "jd": "JD.com", - "zhihu": "Zhihu" - } - } - }, - "epic": { - "title": "Jeux gratuits Epic", - "loading": "Chargement des jeux gratuits...", - "errorFetch": "Échec de la récupération des données", - "errorNetwork": "Échec de la requête réseau, veuillez vérifier votre connexion", - "deadline": "Jusqu'au {{date}}", - "claimNow": "Récupérer maintenant", - "noGames": "Aucun jeu gratuit disponible, revenez plus tard", - "reload": "Recharger" - }, - "search": { - "placeholder": "Rechercher...", - "noResults": "Aucun résultat trouvé", - "typeToSearch": "Tapez pour rechercher...", - "categories": { - "pages": "Pages", - "builtinTools": "Outils intégrés", - "optimization": "Optimisation", - "thirdpartyTools": "Outils tiers" - } - }, - "gpuDriverRestart": { - "pageTitle": "Redémarrer le pilote graphique", - "pageDesc": "Simule Win+Ctrl+Maj+B pour redémarrer le pilote graphique (pour les cybercafés)", - "detailDesc": "Cliquez sur le bouton pour envoyer une commande de redémarrage du pilote graphique au système, équivalent à Win+Ctrl+Maj+B. L'écran deviendra brièvement noir ou scintillera et reviendra à la normale en quelques secondes.", - "restartBtn": "Redémarrer le pilote graphique", - "success": "Commande de redémarrage envoyée, l'écran va brièvement scintiller", - "error": "Échec du redémarrage du pilote graphique", - "waiting": "Exécution de la commande de redémarrage, veuillez patienter...", - "warningTitle": "Remarque", - "warningDesc": "Le redémarrage du pilote graphique provoquera un bref écran noir ou scintillement. Assurez-vous qu'aucune tâche importante (comme un jeu ou l'édition de fichiers) n'est en cours." - }, - "closeDialog": { - "title": "Confirmation de fermeture", - "message": "Comment souhaitez-vous fermer l'application ?", - "closeApp": "Fermer l'application", - "minimizeToTray": "Minimiser dans la barre", - "dontAskAgain": "Ne plus demander" - }, - "tray": { - "show": "Afficher la fenêtre principale", - "exit": "Quitter" - }, - "hotkeySettings": { - "title": "Paramètres des raccourcis", - "overlay": "Overlay", - "overlayToggle": "Activer/Désactiver le panneau overlay", - "overlayToggleDesc": "Utiliser un raccourci pour afficher ou masquer le panneau overlay", - "crosshair": "Réticule", - "crosshairToggle": "Activer/Désactiver le réticule", - "crosshairToggleDesc": "Utiliser un raccourci pour afficher ou masquer le réticule", - "filter": "Filtre", - "filterToggle": "Activer/Désactiver le filtre", - "filterToggleDesc": "Utiliser un raccourci pour activer ou désactiver le filtre d'affichage", - "saved": "Raccourci enregistré" - }, - "diskHealth": { - "title": "Santé du disque", - "refresh": "Actualiser", - "scanning": "Analyse en cours...", - "total": "Disques totaux", - "healthy": "Sain", - "warning": "Avertissement", - "unhealthy": "Défaillant", - "temperature": "Température", - "lifespan": "Durée de vie", - "powerOnHours": "Heures de fonctionnement", - "operationalStatus": "État", - "readErrors": "Erreurs de lecture", - "writeErrors": "Erreurs d'écriture", - "partitions": "partitions", - "loadError": "Échec du chargement", - "retry": "Réessayer" - }, - "screenRecord": { - "title": "Enregistrement d'écran", - "description": "Enregistrement d'écran accéléré par matériel avec capture haute fréquence", - "loading": "Chargement...", - "previewWaiting": "En attente du démarrage de l'enregistrement...", - "recording": "Enregistrement", - "idle": "Inactif", - "openPreview": "Ouvrir la fenêtre d'aperçu", - "closePreview": "Fermer l'aperçu", - "settings": { - "title": "Paramètres d'enregistrement", - "source": "Source de capture", - "display": "Affichage", - "window": "Fenêtre", - "windowSrc": "Fenêtre d'application", - "fps": "Fréquence d'images", - "resolution": "Résolution", - "original": "Original", - "bitrate": "Débit", - "codec": "Encodeur", - "container": "Format", - "captureCursor": "Capturer le curseur", - "savePath": "Chemin d'enregistrement", - "selectPath": "Choisir l'emplacement" - }, - "controls": { - "start": "Démarrer l'enregistrement", - "stop": "Arrêter l'enregistrement", - "recording": "Enregistrement", - "paused": "En pause" - }, - "stats": { - "title": "Statistiques", - "lastRecording": "Dernier enregistrement", - "elapsed": "Temps écoulé", - "targetFps": "FPS cible", - "captureFps": "FPS de capture", - "outputFps": "FPS de sortie", - "droppedFrames": "Images perdues", - "totalFrames": "Total d'images", - "fileSize": "Taille du fichier", - "currentBitrate": "Débit actuel" - }, - "warnings": { - "refreshRateLow": "La fréquence de rafraîchissement ({{hz}}Hz) est inférieure au FPS cible ({{fps}}fps). La duplication d'images sera utilisée.", - "noDisplayFound": "Aucun affichage capturable trouvé", - "savePathRequired": "Veuillez d'abord sélectionner un chemin d'enregistrement", - "encodingError": "Erreur d'encodage: {{message}}" - }, - "messages": { - "recordingStarted": "Enregistrement démarré", - "recordingStopped": "Enregistrement arrêté, fichier enregistré sous: {{path}}", - "recordingError": "Erreur d'enregistrement: {{message}}" - } - }, - "audioEq": { - "title": "Égaliseur EQ", - "loading": "Chargement...", - "virtualSoundCard": "Carte son virtuelle", - "virtualSoundCardDesc": "Installer le pilote audio virtuel FxSound pour activer l'EQ système", - "installed": "Installé", - "notInstalled": "Non installé", - "serviceRunning": "Service en cours", - "installDriver": "Installer le pilote", - "uninstallDriver": "Désinstaller le pilote", - "installing": "Installation...", - "uninstalling": "Désinstallation...", - "installSuccess": "Installation réussie", - "installFailed": "Échec de l'installation", - "uninstallSuccess": "Désinstallation réussie", - "uninstallFailed": "Échec de la désinstallation", - "installHint": "L'installation du pilote nécessite des privilèges d'administrateur. Veuillez exécuter NexBox en tant qu'administrateur.", - "eqEngine": "Moteur EQ", - "eqEngineDesc": "Démarrer le moteur de traitement audio pour appliquer les effets EQ", - "running": "En cours", - "stopped": "Arrêté", - "startEngine": "Démarrer le moteur", - "stopEngine": "Arrêter le moteur", - "starting": "Démarrage...", - "engineStarted": "Moteur EQ démarré", - "engineStartFailed": "Échec du démarrage du moteur EQ", - "engineStopped": "Moteur EQ arrêté", - "engineStopFailed": "Échec de l'arrêt du moteur EQ", - "installDriverFirst": "Veuillez d'abord installer le pilote de carte son virtuelle", - "presets": "Préréglages", - "equalizer": "Égaliseur", - "reset": "Réinitialiser", - "presetApplied": "Préréglage appliqué", - "usageGuide": "Guide d'utilisation", - "step1": "Cliquez sur « Installer le pilote » pour installer le pilote audio virtuel FxSound (nécessite des privilèges d'administrateur)", - "step2": "Après l'installation, cliquez sur « Démarrer le moteur » pour lancer le moteur de traitement audio EQ", - "step3": "Sélectionnez un préréglage ou faites glisser les curseurs de bande pour ajuster les paramètres EQ. La courbe de réponse en fréquence se met à jour en temps réel.", - "step4": "Lorsque vous avez terminé, cliquez sur « Arrêter le moteur » pour arrêter le traitement audio. Vous pouvez désinstaller le pilote à tout moment." - } -} - diff --git a/参考/NexBox-main/src/locales/ja.json b/参考/NexBox-main/src/locales/ja.json deleted file mode 100644 index acfea93..0000000 --- a/参考/NexBox-main/src/locales/ja.json +++ /dev/null @@ -1,1492 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "New Horizon Box", - "description": "クロスプラットフォームパフォーマンスモニタリング (Tauri + Next.js + センサーサービス)" - }, - "view": { - "grid": "グリッド表示", - "list": "リスト表示" - }, - "onboarding": { - "title": "NexBoxへようこそ", - "subtitle": "始めましょう", - "step": "ステップ", - "steps": { - "language": { - "title": "言語を選択してください", - "description": "優先する言語を選択してください" - }, - "theme": { - "title": "テーマを選択してください", - "description": "好みのインターフェーステーマを選択してください", - "light": "ライト", - "dark": "ダーク" - }, - "complete": { - "title": "準備完了!", - "description": "すべての設定が完了しました。今すぐNexBoxを使い始めましょう!", - "button": "始める" - } - } - }, - "sidebar": { - "home": "ホーム", - "tools": "ツール", - "hardware": "ハードウェア", - "optimization": "最適化", - "displayFilter": "フィルター", - "floatingNav": "フローティングナビ", - "crosshair": "クロスヘア", - "overlayPanel": "オーバーレイパネル", - "builtinTools": "内蔵ツール", - "deltaForce": "デルタフォース", - "music": "音楽", - "mood": "ムード", - "settings": "設定", - "gpuRename": "GPU名前変更", - "resolutionConverter": "解像度変換", - "dlssPreset": "デルタフォースDLSS設定", - "epicFree": "Epic 無料ゲーム", - "diskHealth": "ディスク健全性", -"screenRecord": "画面録画", - "audioEq": "EQチューニング" - }, - "optimization": { - "pageTitle": "最適化", - "pageDesc": "システム最適化とパフォーマンスツール", - "windowsTitle": "Windows 最適化", - "windowsDesc": "システムパフォーマンスを最適化し、ゲーム体験を向上させます", - "title": "Windows最適化", - "description": "システムパフォーマンスを最適化し、ゲーム体験を向上させます", - "selectAll": "すべて選択", - "recommended": "推奨", - "options": { - "tempFileCleanup": "一時ファイルをクリーンアップ", - "privacyServiceOptimize": "サービス最適化(プライバシーとテレメトリ)", - "memoryCleanup": "コンピューターのメモリを解放", - "closeWallpaperEngine": "Wallpaper Engineを閉じる", - "optimizeAce": "ACEプロセスを最適化", - "highPerformancePower": "高パフォーマンス電源プランに切り替え", - "flushDns": "DNSキャッシュをフラッシュ" - }, - "tip": "ヒント:最適化の開始をクリックした後、選択した機能の最適化を支援します。最適化は1回だけ有効で、ゲームを終了するか停止ボタンをクリックすると最適化が停止します", - "startButton": "最適化を開始", - "optimizing": "最適化中...", - "starting": "最適化を開始しています...", - "completed": "最適化完了", - "completedDesc": "システムの最適化が正常に完了しました", - "error": "最適化に失敗しました。再試行してください", - "pleaseSelectOptions": "最適化するオプションを選択してください", - "results": { - "tempFiles": "一時ファイル", - "tempFilesComplete": "クリーンアップ完了", - "serviceOptimize": "サービス最適化", - "serviceOptimizeComplete": "完了", - "memoryOptimize": "メモリ最適化", - "memoryOptimizeComplete": "完了", - "aceProcess": "ACEプロセス", - "powerPlan": "電源プラン" - }, - "startupManager": { - "title": "スタートアップ管理", - "description": "システムの起動項目を管理", - "scanError": "スタートアップ項目のスキャンに失敗", - "deleteSuccess": "削除しました: {{name}}", - "deleteError": "削除に失敗", - "locateError": "ファイルの特定に失敗", - "registryError": "レジストリの開封に失敗", - "totalItems": "全 {{count}} 個のスタートアップ項目", - "refresh": "更新", - "scanning": "スタートアップ項目をスキャン中...", - "noItems": "スタートアップ項目が見つかりません", - "columnName": "名前", - "columnPath": "パス", - "columnActions": "操作", - "locateFile": "ファイルを開く", - "findInRegistry": "レジストリで検索", - "delete": "削除", - "tipTitle": "💡 ヒント", - "tipDescription": "スタートアップ管理では、システムの自動起動項目を表示・管理できます。不要な項目を無効にすると起動時間を短縮できます。システムに必要な項目もあるため、注意して操作してください。" - }, - "systemOptimize": { - "title": "システム最適化", - "description": "システムサービスとプライバシー設定を最適化", - "loadFailed": "状態の読み込みに失敗", - "loading": "現在の状態を確認中...", - "optimizing": "最適化中...", - "restoring": "復元中...", - "optimizeAll": { - "title": "すべて有効", - "description": "すべてのスイッチをオンにして最適化を有効化", - "button": "すべて有効" - }, - "restore": { - "title": "すべて無効", - "description": "すべてのスイッチをオフにして最適化を無効化", - "button": "すべて無効" - }, - "enabled": "有効", - "tweakList": "最適化ステータス", - "tweaks": { - "master": "応答しないプログラムを自動終了", - "removeMenuDelay": "メニュー遅延を削減", - "disableNetworkThrottling": "ネットワーク調整を無効化", - "disableErrorReporting": "エラー報告を無効化", - "disableCompatibilityAssistant": "互性アシスタントを無効化", - "disablePrintService": "印刷サービスを無効化", - "disableFaxService": "FAXサービスを無効化", - "disableStickyKeys": "固定キーを無効化", - "disableSmartScreen": "SmartScreenを無効化", - "disableSystemRestore": "システムの復元を無効化", - "disableSuperfetch": "Superfetch/SysMainを無効化", - "disableHibernate": "休止状態を無効化", - "disableNtfsTimestamp": "NTFSタイムスタンプ更新を無効化", - "disableTelemetryTasks": "テレメトリタスクを無効化", - "disableMediaPlayerSharing": "メディアプレイヤー共有を無効化", - "disableHomeGroup": "ホームグループを無効化", - "disableSmb1": "SMB1プロトコルを無効化", - "disableSmb2": "SMB2プロトコルを無効化", - "disableCortana": "Cortanaを無効化", - "disableTelemetryServices": "テレメトリサービスを無効化", - "disableNewsInterests": "ニュースと興味を無効化", - "disableStartMenuAds": "スタートメニュー広告を無効化", - "disableAdvertisingId": "広告IDを無効化", - "disableDiagnosticData": "診断データ収集を無効化", - "disableOfficeTelemetry": "Officeテレメトリを無効化", - "disableFirefoxTelemetry": "Firefoxテレメトリを無効化", - "disableChromeTelemetry": "Chromeテレメトリを無効化", - "disableNvidiaTelemetry": "NVIDIAテレメトリを無効化", - "disableVsTelemetry": "VSテレメトリを無効化", - "disableEdgeTelemetry": "Edgeテレメトリを無効化", - "disableEdgeDiscoverBar": "Edgeディスカバーバーを無効化", - "optimizeProcessCount": "プロセス分割しきい値を最適化", - "disableStoreSearchApp": "ストア検索アプリを無効化", - "disableStorePromotions": "ストアプロモーションを無効化", - "disableStoreAutoUpdate": "ストア自動更新を無効化", - "disableSpotlightLock": "スポットライトロックを無効化", - "disableMyPeople": "My Peopleを無効化", - "disableTPMCheck": "TPMチェックを無効化", - "disableSensorServices": "センサーサービスを無効化", - "removeCastToDevice": "デバイスへのキャストを削除", - "disableVBS": "仮想化ベースのセキュリティを無効化", - "disableModernStandby": "モダンスタンバイを無効化", - "enableGameMode": "ゲームモードを有効化", - "disableXboxLive": "Xbox Liveを無効化", - "disableGameBar": "ゲームバーを無効化", - "disableWindowsInk": "Windows Inkを無効化", - "disableSpellCheck": "スペルチェックを無効化", - "disableAppLaunchTracking": "アプリ起動追跡を無効化", - "disableFileSystemAccess": "ファイルシステムアクセスを無効化", - "disableDocumentsAccess": "ドキュメントアクセスを無効化", - "disableCalendarAccess": "カレンダーアクセスを無効化", - "disableContactsAccess": "連絡先アクセスを無効化", - "disableLanguageTracking": "言語追跡を無効化", - "disableWelcomeExperience": "ウェルカム体験を無効化", - "disableFeedbackFrequency": "フィードバック頻度を無効化", - "disableWritingHabits": "入力習慣収集を無効化" - } - }, - "networkOptimize": { - "title": "ネットワーク最適化", - "description": "ネットワーク設定とDNSを最適化", - "loadFailed": "状態の読み込みに失敗", - "restore": "デフォルトに戻す", - "tcpCongestion": { - "title": "TCP輻輳制御", - "description": "TCP輻輳制御をCTCP/CUBICに設定" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "TCP Chimney Offloadを無効にしてレイテンシを削減" - }, - "nagle": { - "title": "Nagleアルゴリズム", - "description": "Nagleアルゴリズムを無効にしてゲームの遅延を削減" - }, - "adapterPower": { - "title": "アダプター省電力", - "description": "ネットワークアダプターの省電力を無効化" - }, - "dns": { - "title": "DNS設定", - "primary": "プライマリDNS", - "secondary": "セカンダリDNS", - "apply": "DNSを適用", - "applied": "適用済み", - "restore": "自動取得に戻す" - }, - "dnsRequired": "プライマリDNSアドレスを入力してください", - "batch": { - "title": "一括最適化", - "description": "すべてのネットワーク最適化を一括で適用/復元", - "enable": "すべて有効", - "disable": "すべて復元" - } - }, - "memoryLimit": { - "title": "メモリ制限", - "description": "システムの利用可能メモリを制限してゲームパフォーマンスを最適化", - "currentStatus": "現在の状態", - "physicalMemory": "物理メモリ", - "currentLimit": "現在の制限", - "noLimit": "制限なし", - "selectLimit": "制限を選択", - "applyLimit": "制限を適用", - "restoreLimit": "デフォルトに戻す", - "limitApplied": "制限が適用されました", - "limitRestored": "デフォルトに戻りました", - "requiresRestart": "再起動が必要です", - "warning": "警告", - "warningText": "メモリ制限の設定には管理者権限が必要で、システムの再起動が必要です", - "adminRequired": "管理者権限が必要", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "プリセット制限", - "customTab": "カスタム制限", - "customPlaceholder": "制限値を入力 (GB)", - "selectPreset": "プリセット制限値を選択", - "invalidInput": "有効なメモリ制限値を入力してください", - "outOfRange": "制限値は0.1から物理メモリの間である必要があります" - }, - "powerManagement": { - "title": "電源管理", - "description": "最適化された電源プランをインポートして有効化し、ゲームパフォーマンスを向上", - "currentPlan": "現在の電源プラン", - "builtinPlans": "内蔵電源プラン", - "systemPlans": "システム電源プラン", - "import": "インポート", - "importAndActivate": "インポートして有効化", - "activate": "有効化", - "importing": "インポート中...", - "activating": "有効化中...", - "importSuccess": "電源プランのインポートに成功しました", - "importFailed": "電源プランのインポートに失敗しました", - "activateSuccess": "電源プランが有効化されました", - "activateFailed": "電源プランの有効化に失敗しました", - "alreadyImported": "インポート済み", - "notImported": "未インポート", - "active": "有効", - "loadFailed": "電源プランの読み込みに失敗しました", - "refresh": "更新", - "tipTitle": "ヒント", - "tip": "電源プランはシステムの消費電力とパフォーマンスに影響します。ゲームには高性能プランをお勧めします。電源プランの有効化には管理者権限が必要です。", - "importAll": "一括インポート", - "importingAll": "一括インポート中...", - "importAllSuccess": "{{count}}個の電源プランのインポートに成功しました", - "importAllFailed": "{{count}}個の電源プランのインポートに失敗しました", - "allImported": "すべての電源プランがインポート済みです", - "delete": "削除", - "deleting": "削除中...", - "deleteSuccess": "電源プランを削除しました", - "deleteFailed": "電源プランの削除に失敗しました", - "deleteConfirmTitle": "削除の確認", - "deleteConfirmText": "電源プラン「{{name}}」をシステムから削除してもよろしいですか?", - "cancel": "キャンセル" - }, - "memoryCleanup": { - "title": "メモリクリーンアップ", - "description": "メモリの詳細を表示して空間を解放", - "physicalMemory": "物理メモリ", - "virtualMemory": "仮想メモリ", - "workingSet": "ワーキングセット", - "used": "使用中", - "available": "利用可能", - "total": "合計", - "cleanAll": "すべてクリーン", - "cleanStandby": "スタンバイメモリをクリーン", - "trimWorkingSet": "ワーキングセットを削減", - "loading": "読み込み中...", - "cleaning": "クリーニング中...", - "freedMemory": "{{size}} MB 解放しました", - "noMemoryFreed": "現在クリーンアップの必要はありません", - "error": "クリーニングに失敗しました" - }, - "aceOptimize": { - "title": "デルタフォース/ACE最適化", - "description": "デルタフォースプロセスの最適化とACEアンチチートのリソース制限", - "deltaSection": { - "title": "デルタフォース最適化", - "subtitle": "デルタフォースのゲームパフォーマンスを向上" - }, - "deltaBoost": { - "title": "プロセス優先度ブースト", - "description": "DeltaForceClient-Win64-Shipping.exe の優先度を「リアルタイム」に設定し、CPUリソースを優先的に割り当ててゲームをよりスムーズに", - "affinityTitle": "コア親和性最適化", - "affinityDescription": "デルタフォースプロセスをCPU0以外のすべてのコアに割り当て、マルチコアパフォーマンスを最大化しつつ、コア0をシステム用に確保", - "success": "デルタフォースの優先度がリアルタイムに向上しました", - "notRunning": "デルタフォースは実行されていません", - "affinitySuccess": "デルタフォースのコア割り当てを最適化しました" - }, - "aceSection": { - "title": "ACEアンチチート最適化", - "subtitle": "アンチチートプロセスのリソース使用を制限し、ゲームにより多くのパフォーマンスを解放" - }, - "aceLimit": { - "title": "プロセス優先度制限", - "description": "ACE-Tray、SGuard64、SGuardSvc64の優先度を「低」に下げ、CPU競合を削減", - "affinityTitle": "コア親和性制限", - "affinityDescription": "ACEアンチチートプロセスをシングルコア(CPU0)のみに制限し、ゲームの重要なCPUリソースを占有しないようにする", - "success": "{{count}} 個のACEプロセスの優先度を制限しました", - "notRunning": "実行中のACEプロセスが見つかりません", - "affinitySuccess": "{{count}} 個のACEプロセスをシングルコアに制限しました" - }, - "aceEfficiency": { - "title": "Windows効率モード", - "description": "ACEプロセスにタスクマネージャー形式の効率モードを有効化:優先度をIdleに設定し、電源スロットリング(EcoQoS)を有効にしてバックグラウンドリソース使用を大幅に削減" - }, - "optimizeAll": { - "button": "一括最適化", - "optimizing": "最適化中...", - "title": "すべてを一度に最適化", - "description": "デルタフォースの優先度ブーストとACEの優先度/コア制限を同時に実行", - "success": "すべての最適化が完了しました", - "partial": "一部の最適化が完了しました。詳細を確認してください" - }, - "autoDetect": { - "title": "ACEプロセスの自動検出と最適化", - "description": "バックグラウンドで継続的に監視 - ACE-Tray/SGuardプロセス検出時に自動的に優先度とコア親和性を制限(5秒ごとにチェック)", - "status": { - "running": "自動検出実行中", - "stopped": "自動検出停止中" - }, - "lastCheck": "前回チェック", - "never": "チェックされたことなし", - "optimizing": "{{count}} 個のプロセスを最適化中", - "enabled": "自動検出が有効になりました", - "disabled": "自動検出が無効になりました" - }, - "status": { - "optimized": "最適化済み", - "notRunning": "実行中ではありません", - "notOptimized": "最適化待ち", - "processRunning": "プロセス実行中", - "processNotRunning": "プロセス未実行" - }, - "apply": "適用", - "applied": "適用済み", - "error": "最適化に失敗しました" - } - }, - "home": { - "title": "NexBoxへようこそ", - "welcome": "ようこそ", - "selectTools": "クイックツールを選択", - "todayPopularity": "今日の人気", - "randomQuote": "ランダム名言", - "announcement": "お知らせ", - "announcementList": "お知らせ一覧", - "loading": "読み込み中...", - "noAnnouncement": "お知らせはありません", - "important": "重要", - "importantAnnouncement": "重要なお知らせ", - "confirmAnnouncement": "OK" - }, - "hardware": { - "title": "ハードウェア情報", - "processor": "プロセッサ", - "model": "モデル", - "name": "名前", - "vendor": "ベンダー", - "coresThreads": "コア + スレッド", - "cores": "コア", - "threads": "スレッド", - "baseClock": "ベースクロック", - "l2Cache": "L2キャッシュ", - "l3Cache": "L3キャッシュ", - "cpuUsage": "CPU使用率", - "gpu": "GPU", - "memory": "メモリ", - "driverVersion": "ドライバーバージョン", - "driverDate": "ドライバー日付", - "temperature": "温度", - "temperatureUnit": "°C", - "usage": "使用率", - "motherboard": "マザーボード", - "monitor": "モニター", - "os": "OS", - "ram": "RAM", - "manufacturer": "メーカー", - "partNumber": "型番", - "capacity": "容量", - "speed": "速度", - "bankLabel": "スロット", - "storage": "ストレージ", - "totalCapacity": "合計容量", - "count": "枚数", - "soundCard": "サウンドカード", - "networkCard": "ネットワークカード", - "adapterType": "アダプター種類", - "macAddress": "MACアドレス", - "linkSpeed": "リンク速度", - "deltaPasswordFetched": "取得済み", - "deltaPasswordNotFetched": "--", - "connectionName": "接続名", - "architecture": "アーキテクチャ", - "socket": "ソケット", - "currentClock": "現在のクロック", - "extClock": "バスクロック", - "enabledCores": "有効コア数", - "family": "ファミリー", - "stepping": "ステッピング", - "revision": "リビジョン", - "processorId": "プロセッサID", - "voltageCaps": "電圧", - "videoProcessor": "コアアーキテクチャ", - "videoMemoryType": "VRAMタイプ", - "installedDrivers": "ドライバファイル", - "infFilename": "INFファイル", - "deviceId": "デバイスID", - "pnpDeviceId": "PNP ID", - "resolution": "解像度", - "refreshRate": "リフレッシュレート", - "status": "ステータス", - "diskType": "タイプ", - "interfaceType": "インターフェース", - "serialNumber": "シリアル番号", - "firmware": "ファームウェア", - "memoryType": "メモリタイプ", - "formFactor": "フォームファクタ", - "guid": "GUID", - "maxSpeed": "最大速度", - "biosVendor": "BIOSベンダー", - "biosVersion": "BIOSバージョン", - "biosReleaseDate": "BIOS日付", - "systemManufacturer": "システムメーカー", - "systemModel": "システムモデル", - "systemType": "システムタイプ", - "chassisType": "筐体タイプ", - "version": "バージョン", - "noDetail": "詳細情報なし" - }, - "tools": { - "title": "ツール", - "subtitle": "ツールボックス", - "description": "システムをより適切に管理および最適化するための様々なユーティリティを提供します。", - "all": "すべて", - "hardware": "ハードウェア", - "assistant": "アシスタント", - "network": "ネットワーク", - "optimization": "最適化", - "builtinTools": "内蔵ツール", - "thirdpartyTools": "サードパーティツール", - "officialTools": "公式おすすめ", - "recommended": "推奨", - "tools": { - "assistantCrosshair": "アシスタントクロスヘア", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Windowsコアオプティマイザー", - "windows-core-optimizer": "Windowsコアオプティマイザー", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "huorong": "火绒安全" - }, - "mctierDesc": "仮想LAN汎用ネットワーキングツール", - "sjmclDesc": "上海交通大学が開発したサードパーティMinecraftランチャー", - "ddegameDesc": "ゲームはただのゲームではなく、生活に入り込み生活を変えることができる", - "huorongDesc": "純粋なエンドポイント保護。軽快な動作、静かな守り、全面防御", - "descriptions": { - "assistantCrosshair": "ゲーム画面クロスヘアアシスタントツール", - "memreduct": "メモリクリーニングツール", - "windowsCoreOptimizer": "big.LITTLEアーキテクチャのCPUでのみ有効", - "windows-core-optimizer": "big.LITTLEアーキテクチャのCPUでのみ有効", - "optimizer": "Windowsシステム最適化ツール", - "cpu-z": "CPU情報検出ツール", - "gpu-z": "GPU情報検出ツール", - "processLasso": "システムプロセス最適化ツール", - "process-lasso": "システムプロセス最適化ツール", - "fxsound": "オーディオ強化ツール", - "msi-afterburner": "GPUオーバークロック監視ツール", - "huorong": "純粋なエンドポイント保護。軽快な動作、静かな守り、包括的な防御" - }, - "status": { - "available": "利用可能", - "comingSoon": "近日公開", - "installed": "インストール済み", - "notInstalled": "未インストール", - "downloading": "ダウンロード中", - "scanning": "スキャン中..." - }, - "buttons": { - "openTool": "ツールを開く", - "comingSoon": "近日公開", - "download": "クリックしてダウンロード", - "run": "クリックして実行", - "website": "公式サイトへ" - }, - "messages": { - "installerStarted": "インストーラーが開始されました", - "installerStartedDesc": "インストールを完了してください。その後、ツールは利用可能として表示されます", - "installComplete": "インストール完了", - "installCompleteDesc": "ツールは正常にインストールされました。クリックして実行してください", - "installerStartedAlt": "インストーラーが開始されました", - "installerStartedDescAlt": "インストールを完了してください。システムが自動的にインストール状態を検出します", - "downloadComplete": "ダウンロード完了", - "downloadCompleteDesc": "ツールの準備ができました。クリックして実行してください", - "downloadFailed": "ダウンロードに失敗しました", - "runFailed": "実行に失敗しました" - }, - "ariaLabels": { - "refreshToolList": "ツールリストを更新" - }, - "customAdded": { - "add": "ツールを手動で追加", - "remove": "手動追加を削除", - "addSuccess": "ツールを追加しました", - "addFailed": "追加に失敗しました", - "removed": "手動追加を削除しました" - } - }, - "displayFilter": { - "title": "ディスプレイフィルター", - "enable": "フィルターを有効化", - "presets": "プリセット", - "currentSettings": "現在の設定", - "colorTemperature": "色温度", - "brightness": "明るさ", - "contrast": "コントラスト", - "saturation": "彩度", - "resetDefault": "デフォルトにリセット", - "resetSuccess": "設定がデフォルトにリセットされました", - "filterEnabled": "フィルターが有効化されました", - "filterDisabled": "フィルターが無効化されました", - "presetAppliedPrefix": "プリセット ", - "presetAppliedSuffix": " が適用されました", - "error": "操作に失敗しました", - "custom": "カスタム", - "customDescription": "カスタムフィルターパラメーター", - "tip": "フィルターはディスプレイのガンマ曲線を調整してカラー効果を実現します。アプリケーションを終了すると設定は自動的に復元されます。", - "customFilter": "カスタムフィルター", - "saveSuccess": "設定が保存され適用されました", - "saveAndApply": "保存して適用", - "iccProfiles": "ICC カラープロファイル", - "importIcc": "ICC ファイルをインポート", - "importIccSuccess": "ICC ファイルがインポートされました", - "importIccFailed": "ICC インポートに失敗しました", - "iccApplied": "ICC プロファイルが適用されました", - "deleteIcc": "削除", - "deleteIccConfirm": "この ICC プリセットを削除しますか?", - "deleteIccSuccess": "ICC プリセットが削除されました", - "noIccProfiles": "インポートされた ICC プロファイルはありません", - "selectDisplay": "ディスプレイを選択", - "primary": "メイン", - "cancel": "キャンセル", - "delete": "削除", - "exportIcc": "ICCファイルとしてエクスポート", - "exportIccSuccess": "ICCファイルをエクスポートしました", - "exportIccFailed": "ICCエクスポートに失敗しました", - "previewTitle": "フィルタープレビュー", - "previewOriginal": "元画像", - "previewFiltered": "フィルター", - "previewDisabledNote": "フィルター無効 · プレビューのみ", - "paramsUpdated": "パラメータを更新しました", - "paramsUpdatedHint": "フィルタースイッチを手動で有効にしてください", - "myPresets": "マイプリセット", - "noPresets": "カスタムプリセットはまだありません\nパラメータを調整して「プリセットとして保存」をクリック", - "saveAsPreset": "プリセットとして保存", - "presetNamePlaceholder": "プリセット名を入力...", - "savePresetSuccess": "プリセットを保存しました", - "deletePreset": "プリセットを削除", - "deletePresetConfirm": "このプリセットを削除しますか?", - "deletePresetSuccess": "プリセットを削除しました", - "save": "保存" - }, -"floatingNav": { - "title": "フローティングナビゲーションボックス", - "enable": "フローティングボックスを有効化", - "settings": "設定", - "displayText": "テキストを表示", - "width": "幅", - "height": "高さ", - "opacity": "不透明度", - "applySettings": "設定を適用", - "preview": "プレビュー", - "previewNote": "効果のプレビュー(実際のフローティングボックスは画面の上部中央に表示されます)", - "enabled": "フローティングナビゲーションが有効化されました", - "disabled": "フローティングナビゲーションが無効化されました", - "settingsApplied": "設定が適用されました", - "error": "操作に失敗しました", - "tip": "フローティングナビゲーションボックスは画面の上部中央に表示され、常にすべてのウィンドウの最前面に表示されます。不透明度を調整して他のアプリケーションへの影響を制御できます。", - "displayContent": "表示するコンテンツ", - "cpuUsage": "CPU使用率", - "gpuTemp": "GPU温度", - "gpuUsage": "GPU使用率" - }, - "crosshair": { - "title": "クロスヘアアシスタント", - "enableCrosshair": "クロスヘアを有効化", - "statusEnabled": "有効化", - "statusDisabled": "無効化", - "style": "クロスヘアスタイル", - "color": "色", - "customColor": "カスタムカラー", - "size": "サイズ", - "thickness": "太さ", - "gap": "ギャップ", - "dotSize": "ドットサイズ", - "opacity": "不透明度", - "preview": "プレビュー", - "parameters": "パラメーター", - "monitor": "モニター選択", - "primaryMonitor": "プライマリモニター", - "advanced": "詳細設定", - "resetDefault": "デフォルトにリセット", - "updateFailed": "設定の更新に失敗しました", - "toggleFailed": "クロスヘアの切り替えに失敗しました", - "renderMode": "レンダーモード", - "procedural": "プリセット", - "customImage": "カスタム画像", - "selectImage": "画像を選択", - "styles": { - "cross": "十字", - "dot": "ドット", - "circle": "円", - "crossDot": "十字+ドット", - "circleCross": "円+十字" - } - }, - "hardwareReport": { - "export": "レポートをエクスポート", - "selectPath": "エクスポート先を選択", - "exporting": "レポートを生成中...", - "exportSuccess": "レポートのエクスポートに成功しました", - "exportFailed": "エクスポートに失敗しました", - "recorderNotStarted": "レコーダーが起動していません。後でもう一度お試しください" - }, - "overlayPanel": { - "title": "オーバーレイパネル", - "enableOverlay": "オーバーレイパネルを有効化", - "statusEnabled": "有効化", - "statusDisabled": "無効化", - "displayItems": "表示する項目", - "hardwareMonitor": "ハードウェア監視", - "cpuUsage": "CPU使用率", - "gpuTemp": "GPU温度", - "gpuUsage": "GPU使用率", - "memoryUsage": "メモリ使用率", - "deltaPassword": "デルタパスワード", - "custom": "カスタム", - "customText": "カスタムテキスト", - "color": "色", - "addCustomItem": "カスタム項目を追加", - "appearance": "外観設定", - "styles": "オーバーレイスタイル", - "styles.default": "デフォルト", - "styles.dynamicIsland": "ダイナミックアイランド", - "styles.verticalPanel": "縦型パネル", - "fontColor": "フォント色", - "opacity": "不透明度", - "startFailed": "起動に失敗しました", - "stopFailed": "停止に失敗しました", - "hotkey": "ホットキー", - "toggleHotkey": "オーバーレイ切替", - "hotkeySaved": "ホットキーを保存しました" - }, - "deltaForce": { - "title": "デルタフォース", - "dailyPassword": "デイリーパスワード", - "weaponCodes": "ウェポンコード", - "weaponCodeDesc": "ウェポンコードプラットフォームを選択して、新しいウィンドウでコードを閲覧およびコピーします", - "weaponCodePlatforms": "ウェポンコードプラットフォーム", - "openPlatform": "プラットフォームを開く", - "officialMaps": "公式マップ", - "openOfficialMap": "デルタフォース公式マップツール", - "mapToolDesc": "戦利品ポイント、スポーンポイント、抽出ポイント、ボス座標", - "dlssPreset": "DLSSプリセット", - "dlssPresetDesc": "DLSSニューラルネットワークモデルプリセットを選択してください。異なるシナリオに異なるプリセットを使用できます", - "loading": "読み込み中...", - "noPassword": "パスワードデータがありません", - "copy": "コピー", - "copied": "コピー済み", - "copySuccess": "クリップボードにコピーされました", - "copyFailed": "コピーに失敗しました", - "all": "すべて", - "recommended": "推奨", - "currentSelection": "現在の選択", - "applyPreset": "プリセットを適用", - "dlssNote": "NVIDIA Profile Inspectorが必要です。変更を有効にするにはゲームを再起動してください", - "back": "戻る", - "dlssModels": { - "A": { "name": "モデルA", "description": "初期モデル" }, - "B": { "name": "モデルB", "description": "初期モデル" }, - "C": { "name": "モデルC", "description": "初期モデル" }, - "D": { "name": "モデルD", "description": "安定モデル" }, - "E": { "name": "モデルE", "description": "実験モデル" }, - "F": { "name": "モデルF", "description": "改善モデル" }, - "G": { "name": "モデルG", "description": "改善モデル" }, - "J": { "name": "モデルJ", "description": "新しいモデル、品質優先" }, - "K": { "name": "モデルK", "description": "推奨モデル、ほとんどのDLSSモード向け" }, - "L": { "name": "モデルL", "description": "Ultra Performanceモード向けに最適化" }, - "M": { "name": "モデルM", "description": "Performanceモード向けに最適化" } - }, - "weaponCodePlatformNames": { - "maqt": "Maqt", - "anchor-codes": "Anchor Codes", - "xiaotao-check": "Xiaotao Check", - "delta-workshop": "Delta Workshop" - }, - "officialMapToolTitle": "デルタフォース - 公式マップツール", - "officialWallpaper": "公式壁紙", - "officialWallpaperTitle": "デルタフォース - 公式壁紙", - "wallpaperDesc": "公式HD壁紙ダウンロード", - "allCategories": "すべてのカテゴリ", - "searchPlaceholder": "武器を検索...", - "allWeapons": "すべての武器", - "noLoadouts": "ロードアウトがありません", - "noLoadoutsHint": "フィルターを変更してみてください", - "previousPage": "前へ", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "次へ", - "upload": "ロードアウトをアップロード", - "category": "カテゴリ", - "weaponName": "武器名", - "selectWeapon": "武器を選択", - "code": "ロードアウトコード", - "codePlaceholder": "ロードアウトコードを入力(最大500文字)", - "description": "説明", - "descriptionPlaceholder": "説明を入力(任意)", - "cost": "費用", - "author": "作成者", - "nicknamePlaceholder": "ニックネームを入力(任意)", - "cancel": "キャンセル", - "submit": "送信", - "report": "使用不可?", - "reported": "管理者に報告済み", - "uploadSuccess": "アップロード成功", - "uploadQueueHint": "ロードアウトは審査キューに追加されました。承認後に表示されます", - "uploadFailed": "アップロード失敗", - "otherPlatformsCard": { - "title": "その他のプラットフォーム", - "description": "他の改槍コードプラットフォームを探索" - }, - "viewMore": "もっと見る", - "moreGunCodes": "他のガンコード", - "moreGunCodesDesc": "他のガンコードプラットフォームを探索", - "openFailed": "開けませんでした", - "otherPlatforms": { - "title": "その他の改槍コードプラットフォーム", - "description": "以下は他の改槍コードプラットフォームです。クリックして新しいウィンドウで開きます。", - "maqt": { - "name": "MaQT", - "description": "MaQT 改槍コードプラットフォーム" - }, - "anxu": { - "name": "ANXU Codes", - "description": "ANXU 改槍コードプラットフォーム" - }, - "aitags": { - "name": "配信者コード", - "description": "配信者改槍コードプラットフォーム" - }, - "xiaotao": { - "name": "XiaoTao", - "description": "XiaoTao 改槍コードプラットフォーム" - } - } - }, - "dlssPreset": { - "title": "デルタフォースDLSS設定", - "description": "DLSSニューラルネットワークモデルプリセットを切り替えてゲーム画質を最適化", - "presetLabel": "DLSS プリセット", - "driverVersion": "ドライバーバージョン", - "noGpuFound": "GPUが検出されませんでした" - }, - "dlssIndicator": { - "title": "DLSS インジケーター", - "description": "ゲーム画面の左下にDLSSバッジを表示", - "enabled": "DLSS インジケーターが有効になりました", - "disabled": "DLSS インジケーターを無効にしました", - "enabling": "有効化中...", - "disabling": "無効化中...", - "note": "管理者権限が必要です。変更を有効にするにはゲームを再起動してください" - }, - "dlssLock": { - "title": "DLSS ロック", - "description": "nvidiaProfileInspector ドライバー設定をロック", - "enabled": "DLSS 設定がロックされました", - "disabled": "DLSS 設定のロックが解除されました", - "note": "ドライバー更新による設定上書きを防ぎます" - }, - "dlssPresetTable": { - "title": "プリセット参照表", - "description": "GPUシリーズ別のおすすめDLSSプリセット", - "gpuSeries": "GPU", - "recommendedPreset": "プリセット", - "driverVersion": "ドライバー", - "scenario": "タイプ", - "rtx20Series": "RTX 20 シリーズ", - "rtx30Series": "RTX 30 シリーズ", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 高FPS", - "rtx50HighQuality": "RTX 50 高画質", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "汎用強化", - "typePerformanceFirst": "性能優先", - "typeQualityEnhance": "画質強化", - "typeFpsPriority": "FPS優先" - }, - "musicPlayer": { - "title": "シュシュミュージック", - "play": "再生", - "pause": "一時停止", - "previous": "前へ", - "next": "次へ", - "modeList": "リストリピート", - "modeShuffle": "シャッフル", - "modeOne": "1曲リピート", - "mute": "ミュート", - "unmute": "ミュート解除", - "playlist": "プレイリスト", - "noTrack": "曲が選択されていません", - "empty": "音楽ファイルがありません。MP3ファイルを入れてください", - "minimize": "最小化" - }, - "mood": { - "title": "ムード", - "connecting": "www.nexbox.top/love に接続中..." - }, - "builtinTools": { - "title": "内蔵ツール", - "back": "戻る", - "displayFilterDesc": "ディスプレイカラーフィルターを調整", - "crosshairDesc": "ゲーム画面クロスヘアアシスタントツール", - "overlayPanelDesc": "システムハードウェア状態を表示するフローティングパネル", - "gpuRenameDesc": "ゲームパフォーマンスを最適化するためにGPU名を変更", - "resolutionConverterDesc": "様々な解像度で画面アスペクト比を変換", - "shaderCacheDesc": "NVIDIA/AMDのシェーダーキャッシュをクリーンアップしてディスクスペースを解放", - "dlssPresetDesc": "DLSSモデルプリセットを切り替えてゲームグラフィックを最適化", - "diskHealthDesc": "ディスクの健全性とSMART情報を確認", -"screenRecordDesc": "高性能画面録画(ハードウェアエンコード)", - "audioEqDesc": "システムレベルのオーディオイコライザー調整" - }, - "gpuRename": { - "title": "GPU名前変更", - "loading": "読み込み中...", - "loadError": "読み込みに失敗しました", - "currentGpu": "現在のGPU", - "originalGpu": "元のGPU", - "backupStatus": "バックアップ状態", - "backedUp": "バックアップ済み", - "notBackedUp": "バックアップなし", - "selectTarget": "ターゲットGPUを選択", - "lowEnd": "ローエンドGPU", - "highEnd": "ハイエンドGPU", - "selectPlaceholder": "GPUを選択してください", - "presetTab": "プリセットGPU", - "customTab": "カスタムGPU", - "customPlaceholder": "カスタムGPU名を入力", - "selectGpu": "先にGPUを選択してください", - "apply": "適用", - "applying": "適用中...", - "restore": "復元", - "restoring": "復元中...", - "success": "成功", - "restored": "復元されました", - "error": "エラー", - "note": "⚠️ 重要な注意事項:\n1. レジストリを変更するには管理者権限が必要です\n2. 変更後はゲームまたはコンピュータを再起動する必要があります\n3. この機能はWindowsシステムとNVIDIAグラフィックカードのみをサポートしています\n4. 変更を適用できない場合は、管理者としてアプリケーションを実行してみてください" - }, - "resolutionConverter": { - "title": "解像度変換", - "selectResolution": "解像度を選択", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "アスペクト比", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "幅", - "height": "高さ", - "pixels": "ピクセル", - "standard": "標準", - "tip": "解像度タイプを選択すると、3つの一般的なアスペクト比の特定の解像度値が下に表示され、ゲームで画面比率設定を調整するのに役立ちます。" - }, - "systemOptimizer": { - "pageTitle": "システム最適化", - "pageDesc": "システム最適化をワンクリックで切り替え、パフォーマンスとプライバシーを向上", - "credits": "1Uツールボックスのシステム最適化サポートに感謝", - "loading": "読み込み中...", - "category": { - "gaming": "ゲーム&グラフィック", - "nvidia": "NVIDIA GPU", - "amd": "AMD GPU", - "performance": "システムパフォーマンス", - "privacy": "プライバシー&テレメトリ", - "services": "システムサービス", - "disk": "ディスク&ファイルシステム", - "apps": "アプリ&UI" - }, - "gaming": { - "mmcssGameConfig": "MMCSSフルゲーム設定", - "mmcssGameConfigDesc": "ゲームタスク最高優先度、GPU優先度8、レイジーモード無効", - "gamePriority": "ゲームタスク優先", - "gamePriorityDesc": "MMCSS Games タスク優先度を向上し、CPUリソースを確保", - "networkSRResponse": "ネットワーク&SR応答性", - "networkSRResponseDesc": "ネットワークスロットリング無効、SystemResponsiveness=0", - "directXAutoHDR": "DirectX AutoHDR有効化", - "directXAutoHDRDesc": "DirectX自動高ダイナミックレンジを有効化", - "directXFlipModel": "DirectX Flip Model有効化", - "directXFlipModelDesc": "Flip Model提示を強制、フレーム遅延を削減", - "directXVRR": "DirectX VRR最適化", - "directXVRRDesc": "可変リフレッシュレート最適化を有効化", - "disableDXMaxWindow": "DX最大化ウィンドウモード無効", - "disableDXMaxWindowDesc": "最大化ウィンドウモードを全局無効化、DWM遅延を回避", - "disableGPUPreemption": "GPUプリエンプション無効", - "disableGPUPreemptionDesc": "GPUプリエンプション無効、入力遅延を削減", - "disableGameBar": "GameBar無効", - "disableGameBarDesc": "GameBarコントローラーショートカットと起動パネルを無効化", - "disableGameDVR": "Game DVR無効", - "disableGameDVRDesc": "Game DVRバックグラウンド録画を無効化、リソース解放", - "disableBcastDVR": "ブロードキャストDVRサービス無効", - "disableBcastDVRDesc": "BcastDVRUserServiceサービスを無効化", - "disableAutoColorMgmt": "自動カラーマネジメント無効", - "disableAutoColorMgmtDesc": "DirectX自動カラーマネジメントを無効化、GPUオーバーヘッド削減" - }, - "nvidia": { - "lowLatencyThreshold": "NVIDIA低レイテンシしきい値", - "lowLatencyThresholdDesc": "GPUスケジューラの遅延しきい値を最低値に設定", - "perCpuDPC": "NVIDIA Per-CPU DPC", - "perCpuDCPDesc": "GPU割り込みをマルチコアに分散、シングルコア遅延を削減", - "imageSharpening": "NVIDIAイメージシャープニング", - "imageSharpeningDesc": "Image Sharpeningをグローバル有効化、画質向上", - "disableGpuPowerMgmt": "NVIDIA GPU電源管理無効", - "disableGpuPowerMgmtDesc": "ランタイム電源管理とASPMを無効化、最高性能を維持", - "disableHDCP": "NVIDIA HDCP無効", - "disableHDCPDesc": "HDCPハンドシェイクオーバーヘッドを無効化、遅延削減", - "disableWriteCombining": "NVIDIAライトコンバイニング無効", - "disableWriteCombiningDesc": "Write Combiningを無効化、GPU遅延を削減", - "disableClockGating": "NVIDIAクロックゲーティング無効", - "disableClockGatingDesc": "BLCG/ELCG/ELPG/FSPG/SLCGを無効化、クロックダウン防止", - "disableTelemetry": "NVIDIAテレメトリ無効", - "disableTelemetryDesc": "GeForce Experienceテレメトリデータ収集を無効化", - "disableDriverLog": "NVIDIAドライバーログ無効", - "disableDriverLogDesc": "ドライバー内部ログを無効化、オーバーヘッド削減", - "lockPState0": "NVIDIA P-State 0ロック", - "lockPState0Desc": "最高性能状態にロック、GPUダウンクロック防止", - "disableMiracastOverlay": "Miracast&Overlay無効", - "disableMiracastOverlayDesc": "Miracastキャストとドライバーオーバーレイを無効化" - }, - "amd": { - "shaderCache": "AMD Shader Cache強制有効", - "shaderCacheDesc": "シェーダーキャッシュを強制有効化、ゲームカクつき削減" - }, - "performance": { - "intelTSX": "Intel TSX有効化", - "intelTSXDesc": "Transactional Synchronization Extensions有効化(Intelのみ)", - "mergeSvcHost": "ServiceHostプロセス統合", - "mergeSvcHostDesc": "分割しきい値を増やし、svchostプロセス数を削減", - "shortenTaskTimeout": "タスクタイムアウト短縮", - "shortenTaskTimeoutDesc": "HungAppTimeout=1000, WaitToKillApp=2000", - "shortenServiceTimeout": "サービスタイムアウト短縮", - "shortenServiceTimeoutDesc": "WaitToKillServiceTimeout=2000、シャットダウン高速化", - "mouseHoverDelay": "マウスホバー遅延最適化", - "mouseHoverDelayDesc": "MouseHoverTimeを400msから10msに短縮", - "disableStartupDelay": "起動遅延無効", - "disableStartupDelayDesc": "StartupDelayInMSec=0、起動直後に利用可能", - "disablePowerSaving": "省電力モード無効", - "disablePowerSavingDesc": "PowerThrottlingと休止を無効化(ノートPC非推奨)", - "nvmeTuning": "NVMeチューニング", - "nvmeTuningDesc": "連続メモリ割り当て、ログとアイドル省電力を無効化" - }, - "privacy": { - "disableTelemetrySvc": "テレメトリサービス無効", - "disableTelemetrySvcDesc": "DiagTrackとdmwappushserviceを無効化", - "disableCEIP": "CEIP-SQM無効", - "disableCEIPDesc": "カスタマーエクスペリエンス向上プログラムを無効化", - "disableDotNetTelemetry": ".NETテレメトリ無効", - "disableDotNetTelemetryDesc": "DOTNET_CLI_TELEMETRY_OPTOUT=1", - "disableAppImpactTelemetry": "アプリ影響テレメトリ無効", - "disableAppImpactTelemetryDesc": "AITEnableポリシーを無効化", - "disableAppImpactTelemetryAgent": "アプリ影響テレメトリエージェント無効", - "disableAppImpactTelemetryAgentDesc": "AITエージェントを無効化", - "disableLicenseTelemetry": "ライセンステレメトリ無効", - "disableLicenseTelemetryDesc": "NoGenTicket=1、ライセンステレメトリ停止", - "disableScheduledDiag": "スケジュール診断無効", - "disableScheduledDiagDesc": "スケジュール診断実行を無効化", - "disableWebcamTelemetry": "Webカメラテレメトリ無効", - "disableWebcamTelemetryDesc": "webcam ConsentStore=Deny", - "disableWritingFeedback": "書き込みフィードバック無効", - "disableWritingFeedbackDesc": "手書き入力フィードバック収集を無効化", - "disableErrorReporting": "Windowsエラー報告無効", - "disableErrorReportingDesc": "WERを無効化、エラーデータアップロード停止" - }, - "services": { - "disableSensorSvc": "センサーサービス無効", - "disableSensorSvcDesc": "SensrSvcとSensorDataServiceを無効化", - "disableFaxSvc": "FAXサービス無効", - "disableFaxSvcDesc": "Faxサービスを無効化", - "disablePrintSvc": "印刷サービス無効", - "disablePrintSvcDesc": "Print Spoolerサービスを無効化", - "disableMapsBroker": "マップブローカー無効", - "disableMapsBrokerDesc": "MapsBrokerサービスを無効化", - "disableUCPD": "UCPD無効", - "disableUCPDDesc": "User Choice Protection Driverを無効化", - "disableDCOM": "DCOM無効", - "disableDCOMDesc": "分散コンポーネントオブジェクトモデルを無効化", - "disableStorageSense": "StorageSense無効", - "disableStorageSenseDesc": "ストレージセンサー自動クリーンアップを無効化", - "disableAutoMaintenance": "自動メンテナンス無効", - "disableAutoMaintenanceDesc": "MaintenanceDisabled=1", - "disableAppCompat": "アプリ互換性無効", - "disableAppCompatDesc": "互換性エンジンとPCAを無効化", - "disableStepRecorder": "ステップ記録ツール無効", - "disableStepRecorderDesc": "DisableUAR=1", - "disablePerfTips": "パフォーマンスヒント無効", - "disablePerfTipsDesc": "パフォーマンス改善提案を無効化" - }, - "disk": { - "disable8dot3": "8.3ファイル名無効", - "disable8dot3Desc": "NtfsDisable8dot3NameCreation=1、ディスクオーバーヘッド削減", - "disableNtfsEncryption": "NTFS暗号化無効", - "disableNtfsEncryptionDesc": "NtfsDisableEncryption=1", - "disableLastAccess": "最終アクセス更新無効", - "disableLastAccessDesc": "NtfsDisableLastAccessUpdate、ディスク書き込み削減", - "disableReservedStorage": "更新予約ストレージ無効", - "disableReservedStorageDesc": "約7GBの予約領域を解放", - "disableFullFsSearch": "フルFS検索無効", - "disableFullFsSearchDesc": "インデックス位置のみ検索、ディスクスキャン削減" - }, - "apps": { - "disableBackgroundApps": "バックグラウンドアプリ無効", - "disableBackgroundAppsDesc": "GlobalUserDisabled=1", - "disableEdgeStartupBoost": "Edge起動ブースト無効", - "disableEdgeStartupBoostDesc": "Edgeプレローンチとバックグラウンド実行を無効化", - "slimEdgeAds": "Edge広告スリム化", - "slimEdgeAdsDesc": "サイドバー、広告、ショッピングアシスタントなどを無効化", - "disableSearchWebView2": "Search WebView2無効", - "disableSearchWebView2Desc": "Search WebView2レンダリングを無効化" - }, - "batchEnable": "すべて最適化", - "batchDisable": "すべて復元", - "batchOptimized": "すべての最適化が完了しました", - "batchReverted": "すべての最適化を復元しました", - "batchError": "バッチ操作に失敗しました", - "optimized": "最適化済み", - "reverted": "復元済み", - "optimizing": "実行中...", - "operationError": "操作に失敗しました", - "requiresReboot": "システムの再起動が必要です" - }, - "shaderCache": { - "title": "シェーダーキャッシュクリーンアップ", - "vendorTitle": "GPUベンダー", - "vendorSubtitle": "ベンダーごとにクリーンアップ項目を整理し、デフォルトでNVIDIAを選択します。", - "nvidia": { - "name": "NVIDIA", - "description": "NVIDIAの公式パスに従ってDXCache、GLCache、NV_Cacheをクリーンアップします。", - "selected": "選択済み", - "selectable": "選択可能" - }, - "amd": { - "name": "AMD", - "description": "AMD Software Reset Shader Cacheに対応するユーザーレベルのキャッシュディレクトリをクリーンアップします。", - "selected": "選択済み", - "selectable": "クリックして選択" - }, - "detected": "検出済み", - "notDetected": "未検出", - "dirs": "{{count}} 個のディレクトリ", - "cleanButton": "クリーンアップを開始", - "cleaning": "クリーニング中...", - "scanButton": "再スキャン", - "officialTip": { - "title": "NVIDIA公式推奨", - "description": "このページでクリーンアップを実行する前に、以下の手順に従うことをお勧めします。", - "step1": "1. NVIDIAコントロールパネルを開き、3D設定でシェーダーキャッシュサイズを「無効」に設定します。", - "step2": "2. コンピュータを再起動してからこのページに戻り、「NVIDIAをクリーン」を実行します。", - "step3": "3. クリーンアップが完了したら、シェーダーキャッシュを再度有効にします。サイズはCドライブの容量に依存します。" - }, - "cleanSuccess": "クリーンアップ完了、{{size}} 解放しました", - "cleanError": "クリーニングに失敗しました", - "scanError": "スキャンに失敗しました", - "noVendorSelected": "少なくとも1つのGPUベンダーを選択してください" - }, - "settings": { - "general": "一般", - "appearance": "外観", - "hotkeys": "ホットキー", - "network": "ネットワーク", - "sponsor": "スポンサー", - "navigation": "ナビゲーション", - "about": "について", - "generalSettings": { - "title": "一般設定", - "language": "言語", - "languageLabel": "言語", - "languages": { - "zh": "簡体字中国語", - "zh-TW": "繁体字中国語", - "en": "英語", - "fr": "フランス語", - "ja": "日本語", - "de": "ドイツ語" - }, - "homepage": "ホームページ", - "todayPopularityLabel": "今日の人気", - "todayPopularityDesc": "ホームページに今日の人気ランダム番号を表示", - "announcementLabel": "お知らせ", - "announcementDesc": "ホームページにお知らせカードを表示", - "randomQuoteLabel": "ランダム名言", - "randomQuoteDesc": "ホームページにランダム名言カードを表示", - "gameLauncherLabel": "クイック起動", - "gameLauncherDesc": "ホームページにクイック起動カードを表示", - "feedbackLabel": "画像カルーセル", - "feedbackDesc": "ホームページに画像カルーセルを表示", - "splash": "アニメーション", - "splashLogoLabel": "スプラッシュロゴ", - "splashLogoDesc": "起動時に表示されるロゴ画像をカスタマイズ", - "splashLogoReset": "デフォルトに戻す", - "features": "機能", - "advanced": "詳細設定", - "discoveryPage": "ディスカバリーページ", - "discoveryPageDesc": "インスタンスページの左ナビゲーションバーの表示とグループ化方法を変更", - "navMode": "インスタンスページナビゲーションモード", - "navModeDesc": "インスタンスページの左ナビゲーションバーの表示とグループ化方法を変更", - "quickSwitch": "インスタンスとアカウントのクイック切り替え", - "quickSwitchDesc": "有効にすると、起動ページの切り替えボタンをクリックして、他のページに移動せずに直接アカウントまたはインスタンスを選択できます", - "resourceTranslation": "リソース翻訳を表示", - "resourceTranslationDesc": "有効にすると、リソースダウンロードページで名前または説明の簡体字中国語翻訳の表示を試みます", - "autoLanguage": "インスタンス言語を自動設定", - "autoLanguageDesc": "有効にすると、新しく作成されたインスタンスは自動的に簡体字中国語に設定され、アクセシビリティ設定もスキップされます", - "navModes": { - "byInstance": "インスタンス別", - "byGroup": "グループ別" - }, - "startup": "起動", - "autoStartLabel": "起動時に自動起動", - "autoStartDesc": "システム起動時にNexBoxを自動起動します", - "closeBehavior": "終了動作", - "closeBehaviorLabel": "閉じるボタンを押した時", - "closeBehaviorDesc": "閉じるボタンを押した時の動作を選択", - "closeDirectly": "直接閉じる", - "minimizeToTray": "トレイに最小化", - "navPositionLabel": "ナビゲーション位置", - "navPositionDesc": "ナビゲーションをサイドに表示するか上部に表示するかを選択", - "navPositionLeft": "サイド", - "navPositionTop": "上部", - "sidebarShowLabel": "サイドバーラベル", - "sidebarShowLabelDesc": "サイドバーの表示モードを選択", - "sidebarShowLabelNoText": "アイコンのみ", - "sidebarShowLabelWithText": "アイコン&テキスト", - "navButtonVisibility": "ナビボタン表示", - "navButtonVisibilityDesc": "各ナビゲーションボタンの表示/非表示を切り替えます。設定は常に表示されます。", - "pageTransitionLabel": "ページ遷移アニメーション", - "pageTransitionDesc": "無効にするとページ遷移アニメーションがオフになります", - "pageTransitionSlide": "スライド", - "pageTransitionFade": "フェード", - "pageTransitionOff": "オフ" - }, - "appearanceSettings": { - "title": "外観設定", - "theme": "テーマ", - "themeStyle": "テーマスタイル", - "themeStyles": { - "light": "ライト", - "dark": "ダーク" - }, - "font": "フォント", - "fontLabel": "インターフェースフォント", - "fontDesc": "アプリのインターフェースフォントを選択、デフォルトは Sinter", - "importCustomFontLabel": "カスタムフォントをインポート", - "importCustomFontDesc": "TTF / OTF / WOFF 形式のフォントファイルをサポート", - "importFontButton": "フォントをインポート", - "importingFont": "インポート中...", - "removeFont": "フォントを削除", - "duplicateFont": "このフォントは既に存在します", - "importFontFailed": "フォントのインポートに失敗しました", - "liquidGlass": "リキッドガラス", - "liquidGlassLabel": "リキッドガラス", - "liquidGlassDesc": "有効にすると、一部のインターフェースで「リキッドガラス」効果を使用します。これによりパフォーマンスに影響する可能性があります", - "liquidGlassBlurLabel": "ぼかし強度", - "liquidGlassModeLabel": "ガラスモード", - "liquidGlassModeNormal": "通常リキッドガラス", - "liquidGlassModeReal": "リアルリキッドガラス", - "liquidGlassModeNormalDesc": "ぼかしと透明度でガラス質感をシミュレート、ぼかし強度調整可能", - "liquidGlassModeRealDesc": "SVG屈折フィルターでエッジ屈折と色差効果を実現、よりリアルだがGPU負荷大", - "jellyBounce": "ゼリーバウンス", - "jellyBounceLabel": "ゼリーバウンス効果", - "jellyBounceDesc": "有効にすると、すべてのカード、メニュー、ナビゲーションバーがインタラクションや状態切り替え時に弾性のあるスケールアニメーションを行います", - "customBackground": "カスタム背景", - "customBackgroundLabel": "カスタム背景を有効化", - "imageUrlPlaceholder": "画像URLを入力するか、クリックしてアップロード", - "maxImagesReached": "最大3枚の背景画像まで追加できます", - "presetBackground": "プリセット背景", - "imageBackground": "画像背景", - "dynamicBackground": "動的背景", - "dynamicBackgroundDesc": "有効にすると動的背景効果が表示されます", - "uploadVideo": "動画をアップロード", - "unsupportedVideoFormat": "サポートされていない動画形式です。mp4 または webm ファイルを使用してください。", - "themeColor": "テーマカラー", - "themeColorLabel": "カスタムテーマカラー", - "themeColorDesc": "ナビゲーションバー、ボタン、メニューなどの要素のテーマカラーを設定", - "presets": "プリセットカラー", - "customColor": "カスタムカラー", - "advancedSettings": "詳細設定", - "hoverOpacity": "ホバー時の不透明度", - "activeOpacity": "アクティブ時の不透明度", - "borderOpacity": "ボーダーの不透明度", - "backgroundBlurLabel": "背景ぼかし", - "backgroundBlurHint": "すべての背景モードに適用(プリセット / 画像 / 動画)", - "resetToDefault": "デフォルトにリセット", - "uploadVideo": "動画をアップロード", - "presetColors": { - "cyan": "シアン", - "blue": "ブルー", - "purple": "パープル", - "pink": "ピンク", - "orange": "オレンジ", - "green": "グリーン", - "red": "レッド", - "yellow": "イエロー" - } - }, - "sponsorSettings": { - "title": "開発者を支援", - "description": "NexBoxが役立つと思ったら、作者にコーヒーを奢ってください ☕", - "wechat": "WeChat Pay", - "alipay": "Alipay", - "thankYou": "ご支援ありがとうございます!", - "placeholder": "QRコード画像を追加してください", - "sponsorList": { - "title": "スポンサー一覧", - "loading": "読み込み中...", - "error": "読み込み失敗", - "empty": "スポンサーはいません" - } - }, - "aboutSettings": { - "title": "について", - "version": "バージョン", - "author": "作者", - "newVersion": "新しいバージョンが利用可能", - "check": "チェック", - "noUpdate": "最新です", - "checkFailed": "更新チェックに失敗しました", - "downloadFailed": "ダウンロードに失敗しました", - "installFailed": "インストールに失敗しました", - "acknowledgments": "謝辞", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "上海交通大学Minecraftクラブのオープンソースプロジェクトに感謝します", - "changelog": "変更履歴", - "changelogTitle": "現在のバージョンの更新内容", - "noChangelog": "変更履歴はありません", - "loadingChangelog": "読み込み中...", - "updateModal": { - "title": "新しいバージョンが利用可能", - "version": "バージョン", - "releaseNotes": "リリースノート", - "downloading": "ダウンロード中...", - "downloadComplete": "ダウンロードが完了しました。アクションを選択してください。", - "cancel": "キャンセル", - "download": "ダウンロード", - "restartInstall": "再起動してインストール", - "skip": "後で" - } - }, - "networkSettings": { - "title": "ネットワーク遅延テスト", - "description": "様々なサーバーへのネットワーク遅延をテスト", - "testButton": "テスト", - "testing": "テスト中...", - "testingAll": "すべてテスト中...", - "testAll": "すべてテスト", - "latency": "遅延", - "timeout": "タイムアウト", - "unreachable": "到達不能", - "servers": { - "baidu": "Baidu", - "gitee": "Gitee", - "github": "GitHub", - "qq": "Tencent", - "aliyun": "Alibaba Cloud", - "wangyi": "NetEase", - "bilibili": "Bilibili", - "douyin": "Douyin", - "jd": "JD.com", - "zhihu": "Zhihu" - } - } - }, - "epic": { - "title": "Epic 無料ゲーム", - "loading": "無料ゲームを読み込み中...", - "errorFetch": "データの取得に失敗しました", - "errorNetwork": "ネットワークリクエストに失敗しました。接続を確認してください", - "deadline": "{{date}} まで", - "claimNow": "今すぐ入手", - "noGames": "現在無料ゲームはありません。後でもう一度確認してください", - "reload": "再読み込み" - }, - "search": { - "placeholder": "機能を検索...", - "noResults": "結果が見つかりません", - "typeToSearch": "キーワードを入力して検索...", - "categories": { - "pages": "ページ", - "builtinTools": "内蔵ツール", - "optimization": "最適化", - "thirdpartyTools": "サードパーティツール" - } - }, - "gpuDriverRestart": { - "pageTitle": "グラフィックドライバーの再起動", - "pageDesc": "Win+Ctrl+Shift+B をシミュレートしてグラフィックドライバーを再起動(ネットカフェユーザー向け)", - "detailDesc": "ボタンをクリックすると、システムにグラフィックドライバーの再起動コマンドを送信します(Win+Ctrl+Shift+B と同等)。画面が一瞬暗くなるかちらつきますが、数秒で通常に戻ります。", - "restartBtn": "グラフィックドライバーを再起動", - "success": "再起動コマンドを送信しました。画面が一瞬ちらつきます", - "error": "グラフィックドライバーの再起動に失敗しました", - "waiting": "再起動コマンドを実行中です。お待ちください...", - "warningTitle": "注意", - "warningDesc": "グラフィックドライバーの再起動により、画面が一瞬暗くなるかちらつきます。重要な作業(ゲームやファイル編集など)を行っていないことを確認してください。" - }, - "closeDialog": { - "title": "終了確認", - "message": "アプリをどのように終了しますか?", - "closeApp": "アプリを閉じる", - "minimizeToTray": "トレイに最小化", - "dontAskAgain": "次回から確認しない" - }, - "tray": { - "show": "メインウィンドウを表示", - "exit": "終了" - }, - "hotkeySettings": { - "title": "ホットキー設定", - "overlay": "オーバーレイ", - "overlayToggle": "オーバーレイパネル切替", - "overlayToggleDesc": "ショートカットでオーバーレイパネルを表示/非表示", - "crosshair": "クロスヘア", - "crosshairToggle": "クロスヘア切替", - "crosshairToggleDesc": "ショートカットでクロスヘアを表示/非表示", - "filter": "フィルター", - "filterToggle": "フィルター切替", - "filterToggleDesc": "ショートカットでフィルターを有効/無効", - "saved": "ホットキーを保存しました" - }, - "diskHealth": { - "title": "ディスク健全性", - "refresh": "更新", - "scanning": "スキャン中...", - "total": "ディスク数", - "healthy": "正常", - "warning": "警告", - "unhealthy": "異常", - "temperature": "温度", - "lifespan": "健全寿命", - "powerOnHours": "稼働時間", - "operationalStatus": "動作状態", - "readErrors": "読み取りエラー", - "writeErrors": "書き込みエラー", - "partitions": "パーティション", - "loadError": "読み込み失敗", - "retry": "再試行" - }, - "screenRecord": { - "title": "画面録画", - "description": "ハードウェアアクセラレーション画面録画、高フレームレートキャプチャ対応", - "loading": "読み込み中...", - "previewWaiting": "録画開始を待っています...", - "recording": "録画中", - "idle": "待機中", - "openPreview": "プレビューウィンドウを開く", - "closePreview": "プレビューを閉じる", - "settings": { - "title": "録画設定", - "source": "キャプチャソース", - "display": "ディスプレイ", - "window": "ウィンドウ", - "windowSrc": "アプリウィンドウ", - "fps": "フレームレート", - "resolution": "解像度", - "original": "オリジナル", - "bitrate": "ビットレート", - "codec": "エンコーダー", - "container": "フォーマット", - "captureCursor": "カーソルをキャプチャ", - "savePath": "保存パス", - "selectPath": "保存場所を選択" - }, - "controls": { - "start": "録画開始", - "stop": "録画停止", - "recording": "録画中", - "paused": "一時停止" - }, - "stats": { - "title": "録画統計", - "lastRecording": "前回の録画", - "elapsed": "録画時間", - "targetFps": "目標FPS", - "captureFps": "キャプチャFPS", - "outputFps": "出力FPS", - "droppedFrames": "ドロップフレーム", - "totalFrames": "総フレーム数", - "fileSize": "ファイルサイズ", - "currentBitrate": "現在のビットレート" - }, - "warnings": { - "refreshRateLow": "ディスプレイのリフレッシュレート ({{hz}}Hz) が目標FPS ({{fps}}fps) より低いです。フレーム補間で目標FPSに到達します。", - "noDisplayFound": "キャプチャ可能なディスプレイが見つかりません", - "savePathRequired": "保存パスを先に選択してください", - "encodingError": "エンコードエラー: {{message}}" - }, - "messages": { - "recordingStarted": "録画を開始しました", - "recordingStopped": "録画を停止しました。ファイル保存先: {{path}}", - "recordingError": "録画エラー: {{message}}" - } - }, - "audioEq": { - "title": "EQチューニング", - "loading": "読み込み中...", - "virtualSoundCard": "仮想サウンドカード", - "virtualSoundCardDesc": "FxSound 仮想オーディオドライバーをインストールしてシステムレベルの EQ を有効化", - "installed": "インストール済み", - "notInstalled": "未インストール", - "serviceRunning": "サービス実行中", - "installDriver": "ドライバーをインストール", - "uninstallDriver": "ドライバーをアンインストール", - "installing": "インストール中...", - "uninstalling": "アンインストール中...", - "installSuccess": "インストール成功", - "installFailed": "インストール失敗", - "uninstallSuccess": "アンインストール成功", - "uninstallFailed": "アンインストール失敗", - "installHint": "ドライバーのインストールには管理者権限が必要です。NexBox を管理者として実行してください。", - "eqEngine": "EQ エンジン", - "eqEngineDesc": "オーディオ処理エンジンを起動して EQ エフェクトを適用", - "running": "実行中", - "stopped": "停止", - "startEngine": "エンジン起動", - "stopEngine": "エンジン停止", - "starting": "起動中...", - "engineStarted": "EQ エンジンが起動しました", - "engineStartFailed": "EQ エンジンの起動に失敗しました", - "engineStopped": "EQ エンジンが停止しました", - "engineStopFailed": "EQ エンジンの停止に失敗しました", - "installDriverFirst": "先に仮想サウンドカードドライバーをインストールしてください", - "presets": "プリセット", - "equalizer": "イコライザー", - "reset": "リセット", - "presetApplied": "プリセットを適用しました", - "usageGuide": "使用ガイド", - "step1": "「ドライバーをインストール」をクリックして FxSound 仮想オーディオドライバーをインストールします(管理者権限が必要)", - "step2": "インストール後、「エンジン起動」をクリックして EQ オーディオ処理エンジンを起動します", - "step3": "プリセットを選択するか、バンドスライダーをドラッグして EQ パラメーターを調整します。周波数応答曲線がリアルタイムで更新されます。", - "step4": "完了したら、「エンジン停止」をクリックしてオーディオ処理を停止します。ドライバーはいつでもアンインストールできます。" - } -} - diff --git a/参考/NexBox-main/src/locales/zh-TW.json b/参考/NexBox-main/src/locales/zh-TW.json deleted file mode 100644 index 5b4cf32..0000000 --- a/参考/NexBox-main/src/locales/zh-TW.json +++ /dev/null @@ -1,1265 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "新境盒", - "description": "跨平台性能監控(Tauri + Next.js + 傳感器服務)" - }, - "view": { - "grid": "網格視圖", - "list": "列表視圖" - }, - "onboarding": { - "title": "歡迎使用新境盒", - "subtitle": "讓我們一起開始", - "step": "步驟", - "steps": { - "language": { - "title": "選擇您的語言", - "description": "請選擇您偏好的語言" - }, - "theme": { - "title": "選擇您的主題", - "description": "選擇您喜歡的介面主題", - "light": "淺色", - "dark": "深色" - }, - "complete": { - "title": "一切就緒!", - "description": "您已經完成了所有設定,現在開始使用新境盒吧!", - "button": "開始使用" - } - } - }, - "sidebar": { - "home": "首頁", - "tools": "工具", - "hardware": "硬體", - "optimization": "優化", - "displayFilter": "濾鏡", - "floatingNav": "懸浮框", - "crosshair": "準心", - "overlayPanel": "懸浮框", - "builtinTools": "內建工具", - "deltaForce": "三角洲", - "music": "音樂", - "mood": "心境", - "settings": "設定", - "gpuRename": "顯卡改寫", - "resolutionConverter": "解析度換算", - "dlssPreset": "三角洲DLSS設定", - "epicFree": "喜加一", - "diskHealth": "磁碟健康", -"screenRecord": "螢幕錄製", - "audioEq": "EQ調音" - }, - "optimization": { - "pageTitle": "優化", - "pageDesc": "系統優化與效能提升工具", - "windowsTitle": "Windows 優化", - "windowsDesc": "優化系統效能,提升遊戲體驗", - "title": "Windows優化", - "description": "優化系統效能,提升遊戲體驗", - "selectAll": "全選", - "recommended": "推薦", - "options": { - "tempFileCleanup": "清理暫存檔案", - "privacyServiceOptimize": "服務優化(隱私與遙測)", - "memoryCleanup": "釋放電腦記憶體", - "closeWallpaperEngine": "關閉 Wallpaper Engine", - "optimizeAce": "優化 ACE 程序", - "highPerformancePower": "切換高效能電源計劃", - "flushDns": "清理 DNS 快取" - }, - "tip": "小提示:點擊開始優化按鈕後,將幫您優化選擇的功能,單次優化只會生效一次,退出遊戲或加或者點擊停止按鈕都會停止優化", - "startButton": "開始優化", - "optimizing": "優化中...", - "starting": "開始優化...", - "completed": "優化完成", - "completedDesc": "已成功完成系統優化", - "error": "優化失敗,請重試", - "pleaseSelectOptions": "請選擇要優化的選項", - "results": { - "tempFiles": "暫存檔案", - "tempFilesComplete": "清理完成", - "serviceOptimize": "服務優化", - "serviceOptimizeComplete": "完成", - "memoryOptimize": "記憶體優化", - "memoryOptimizeComplete": "完成", - "aceProcess": "ACE程序", - "powerPlan": "電源計劃" - }, - "startupManager": { - "title": "啟動項管理", - "description": "管理系統開機自啟項", - "scanError": "掃描啟動項失敗", - "deleteSuccess": "已刪除: {{name}}", - "deleteError": "刪除失敗", - "locateError": "定位檔案失敗", - "registryError": "打開登錄檔失敗", - "totalItems": "共 {{count}} 個啟動項", - "refresh": "重新整理", - "scanning": "正在掃描啟動項...", - "noItems": "未發現啟動項", - "columnName": "名稱", - "columnPath": "路徑", - "columnActions": "操作", - "locateFile": "定位檔案", - "findInRegistry": "在登錄檔中查詢", - "delete": "刪除", - "tipTitle": "💡 提示", - "tipDescription": "啟動項管理可以幫助您檢視和管理系統中所有開機自啟的專案。禁用不必要的啟動項可以加快系統開機速度。請謹慎操作,某些系統啟動項可能為系統正常執行所必需。" - }, - "systemOptimize": { - "title": "系統優化", - "description": "優化系統服務與隱私設定", - "loadFailed": "載入狀態失敗", - "loading": "正在檢測目前狀態...", - "optimizing": "優化中...", - "restoring": "恢復中...", - "optimizeAll": { - "title": "全部優化", - "description": "將所有開關打開,啟用全部優化項目", - "button": "全部優化" - }, - "restore": { - "title": "全部取消優化", - "description": "將所有開關關閉,取消全部優化項目", - "button": "全部取消優化" - }, - "enabled": "已啟用", - "tweakList": "優化項目狀態", - "tweaks": { - "master": "自動結束無響應程式", - "removeMenuDelay": "減少選單延遲", - "disableNetworkThrottling": "禁用網路限制", - "disableErrorReporting": "禁用錯誤報告", - "disableCompatibilityAssistant": "禁用相容性助手", - "disablePrintService": "禁用列印服務", - "disableFaxService": "禁用傳真服務", - "disableStickyKeys": "禁用粘滯鍵", - "disableSmartScreen": "禁用 SmartScreen", - "disableSystemRestore": "禁用系統還原", - "disableSuperfetch": "禁用 Superfetch/SysMain", - "disableHibernate": "禁用休眠", - "disableNtfsTimestamp": "禁用 NTFS 時間戳更新", - "disableTelemetryTasks": "禁用遙測計劃任務", - "disableMediaPlayerSharing": "禁用媒體播放器共用", - "disableHomeGroup": "禁用家庭組", - "disableSmb1": "禁用 SMB1 協定", - "disableSmb2": "禁用 SMB2 協定", - "disableCortana": "禁用 Cortana", - "disableTelemetryServices": "禁用遙測服務", - "disableNewsInterests": "禁用資訊與興趣", - "disableStartMenuAds": "禁用開始功能表廣告", - "disableAdvertisingId": "禁用廣告識別碼", - "disableDiagnosticData": "禁用診斷資料收集", - "disableOfficeTelemetry": "禁用 Office 遙測", - "disableFirefoxTelemetry": "禁用 Firefox 遙測", - "disableChromeTelemetry": "禁用 Chrome 遙測", - "disableNvidiaTelemetry": "禁用 NVIDIA 遙測", - "disableVsTelemetry": "禁用 VS 遙測", - "disableEdgeTelemetry": "禁用 Edge 遙測", - "disableEdgeDiscoverBar": "禁用 Edge 發現欄", - "optimizeProcessCount": "優化行程拆分閾值", - "disableStoreSearchApp": "禁用商店搜尋應用", - "disableStorePromotions": "禁用商店推廣", - "disableStoreAutoUpdate": "禁用商店自動更新", - "disableSpotlightLock": "禁用聚焦鎖屏", - "disableMyPeople": "禁用人員列", - "disableTPMCheck": "禁用 TPM 檢查", - "disableSensorServices": "禁用感應器服務", - "removeCastToDevice": "移除投射到裝置", - "disableVBS": "禁用虛擬化安全", - "disableModernStandby": "禁用新式待機", - "enableGameMode": "啟用遊戲模式", - "disableXboxLive": "禁用 Xbox Live", - "disableGameBar": "禁用遊戲列", - "disableWindowsInk": "禁用 Windows Ink", - "disableSpellCheck": "禁用拼字檢查", - "disableAppLaunchTracking": "禁用應用啟動追蹤", - "disableFileSystemAccess": "禁用檔案系統存取", - "disableDocumentsAccess": "禁用文件存取", - "disableCalendarAccess": "禁用日曆存取", - "disableContactsAccess": "禁用連絡人存取", - "disableLanguageTracking": "禁用語言追蹤", - "disableWelcomeExperience": "禁用歡迎體驗", - "disableFeedbackFrequency": "禁用回饋頻率", - "disableWritingHabits": "禁用輸入習慣收集" - } - }, - "networkOptimize": { - "title": "網路優化", - "description": "優化網路參數與 DNS 設定", - "loadFailed": "載入狀態失敗", - "restore": "恢復預設", - "tcpCongestion": { - "title": "TCP 擁塞控制", - "description": "設定 TCP 擁塞控制協定為 CTCP/CUBIC,提升網路吞吐量" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "禁用 TCP Chimney Offload,減少網路延遲" - }, - "nagle": { - "title": "Nagle 演算法優化", - "description": "關閉 Nagle 演算法,減少小數據包延遲,適合遊戲場景" - }, - "adapterPower": { - "title": "網卡省電模式", - "description": "禁用物理網卡省電模式,減少網路延遲波動" - }, - "dns": { - "title": "DNS 設定", - "primary": "首選 DNS", - "secondary": "備選 DNS", - "apply": "套用 DNS", - "applied": "已套用", - "restore": "恢復自動獲取" - }, - "dnsRequired": "請至少輸入首選 DNS 位址", - "batch": { - "title": "批次優化", - "description": "一鍵套用或恢復所有網路優化項目", - "enable": "全部啟用", - "disable": "全部恢復" - } - }, - "memoryLimit": { - "title": "記憶體限制", - "description": "限制系統可用記憶體以優化遊戲效能", - "currentStatus": "目前狀態", - "physicalMemory": "實體記憶體", - "currentLimit": "目前限制", - "noLimit": "無限制", - "selectLimit": "選擇限制", - "applyLimit": "應用限制", - "restoreLimit": "恢復預設", - "limitApplied": "限制已應用", - "limitRestored": "已恢復預設", - "requiresRestart": "需要重啟生效", - "warning": "警告", - "warningText": "設定記憶體限制需要管理員權限,且需要重啟系統才能生效", - "adminRequired": "需要管理員權限", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "預設限制", - "customTab": "自訂限制", - "customPlaceholder": "輸入限制值 (GB)", - "selectPreset": "選擇預設限制值", - "invalidInput": "請輸入有效的記憶體限制值", - "outOfRange": "限制值必須在 0.1 到實體記憶體之間" - }, - "powerManagement": { - "title": "電源管理", - "description": "匯入並啟用優化電源計劃,提升遊戲效能", - "currentPlan": "目前電源計劃", - "builtinPlans": "內建電源計劃", - "systemPlans": "系統電源計劃", - "import": "匯入", - "importAndActivate": "匯入並啟用", - "activate": "啟用", - "importing": "匯入中...", - "activating": "啟用中...", - "importSuccess": "電源計劃匯入成功", - "importFailed": "電源計劃匯入失敗", - "activateSuccess": "電源計劃已啟用", - "activateFailed": "電源計劃啟用失敗", - "alreadyImported": "已匯入", - "notImported": "未匯入", - "active": "已啟用", - "loadFailed": "載入電源計劃失敗", - "refresh": "重新整理", - "tipTitle": "提示", - "tip": "電源計劃會影響系統功耗與效能表現,遊戲場景建議使用高效能方案。啟用電源計劃需要管理員權限。", - "importAll": "一鍵匯入全部", - "importingAll": "批次匯入中...", - "importAllSuccess": "成功匯入 {{count}} 個電源計劃", - "importAllFailed": "{{count}} 個電源計劃匯入失敗", - "allImported": "所有電源計劃已匯入系統", - "delete": "刪除", - "deleting": "刪除中...", - "deleteSuccess": "電源計劃已刪除", - "deleteFailed": "刪除電源計劃失敗", - "deleteConfirmTitle": "確認刪除", - "deleteConfirmText": "確定要從系統中刪除電源計劃「{{name}}」嗎?", - "cancel": "取消" - }, - "memoryCleanup": { - "title": "記憶體清理", - "description": "檢視記憶體詳情並釋放記憶體", - "physicalMemory": "物理記憶體", - "virtualMemory": "虛擬記憶體", - "workingSet": "系統工作集", - "used": "已使用", - "available": "可用", - "total": "總共", - "cleanAll": "全部清理", - "cleanStandby": "清理待機記憶體", - "trimWorkingSet": "收緊系統工作集", - "loading": "載入中...", - "cleaning": "清理中...", - "freedMemory": "已釋放 {{size}} MB 記憶體", - "noMemoryFreed": "目前無需清理", - "error": "清理失敗" - }, - "aceOptimize": { - "title": "ACE/遊戲最佳化", - "description": "最佳化遊戲程序優先順序,限制反作弊程序資源佔用", - "deltaBoost": { - "title": "三角洲優先順序提升", - "description": "提升 DeltaForceClient-Win64-Shipping.exe 程序優先順序為「即時」,提升遊戲流暢度", - "button": "最佳化三角洲", - "optimizing": "最佳化中...", - "success": "三角洲程序優先順序已提升", - "notRunning": "三角洲遊戲未執行,請先啟動遊戲", - "affinitySuccess": "三角洲核心分配已最佳化" - }, - "aceLimit": { - "title": "ACE 程序限制", - "description": "將 ACE-Tray、SGuard64、SGuardSvc64 等反作弊程序優先順序降為「低」,並限制使用單核心 CPU", - "button": "限制 ACE", - "limiting": "限制中...", - "success": "已限制 {{count}} 個 ACE 程序", - "notRunning": "未找到執行中的 ACE 程序", - "affinitySuccess": "已限制 {{count}} 個 ACE 程序使用單核心" - }, - "optimizeAll": { - "button": "一鍵全部最佳化", - "optimizing": "最佳化中...", - "success": "全部最佳化完成", - "partial": "部分最佳化完成,請檢視詳情" - }, - "autoDetect": { - "title": "自動偵測並優化 ACE 進程", - "description": "背景持續監測,發現 ACE-Tray/SGuard 進程自動限制優先級和核心親和性(每 5 秒檢測一次)", - "status": { - "running": "自動偵測運行中", - "stopped": "自動偵測已停止" - }, - "lastCheck": "上次偵測", - "never": "從未偵測", - "optimizing": "正在優化 {{count}} 個進程", - "enabled": "自動偵測已啟用", - "disabled": "自動偵測已禁用" - }, - "status": { - "optimized": "已最佳化", - "notRunning": "未執行", - "notOptimized": "待最佳化" - }, - "error": "最佳化失敗" - } - }, - "home": { - "title": "歡迎使用新境盒", - "welcome": "歡迎", - "selectTools": "選擇快捷工具", - "todayPopularity": "今日人氣", - "randomQuote": "隨機一言", - "announcement": "公告", - "announcementList": "公告列表", - "loading": "載入中...", - "noAnnouncement": "暫無公告", - "important": "重要", - "importantAnnouncement": "重要公告", - "confirmAnnouncement": "好的" - }, - "hardware": { - "title": "硬體資訊", - "processor": "處理器", - "model": "型號", - "coresThreads": "核心+執行緒", - "cores": "核", - "threads": "執行緒", - "baseClock": "基頻", - "l3Cache": "三緩", - "cpuUsage": "CPU佔用", - "gpu": "顯示卡", - "memory": "顯存", - "driverVersion": "驅動程式版本", - "temperature": "溫度", - "temperatureUnit": "°C", - "usage": "佔用", - "motherboard": "主機板", - "ram": "記憶體", - "manufacturer": "製造商", - "partNumber": "型號", - "capacity": "容量", - "speed": "時脈", - "bankLabel": "插槽", - "storage": "儲存", - "totalCapacity": "總容量", - "count": "條數", - "soundCard": "音效卡", - "networkCard": "網路卡", - "adapterType": "介面卡類型", - "macAddress": "MAC位址", - "linkSpeed": "鏈路速率", - "deltaPasswordFetched": "已取得", - "deltaPasswordNotFetched": "--" - }, - "tools": { - "title": "工具", - "subtitle": "工具箱", - "description": "提供各種實用工具,幫助您更好地管理和優化系統。", - "all": "全部", - "hardware": "硬體", - "assistant": "輔助", - "network": "網路", - "optimization": "優化", - "builtinTools": "內建工具", - "thirdpartyTools": "第三方工具", - "officialTools": "官方推薦", - "recommended": "推薦", - "tools": { - "assistantCrosshair": "輔助準心", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Windows大小核優化", - "windows-core-optimizer": "Windows大小核優化", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "huorong": "火绒安全" - }, - "mctierDesc": "虛擬區域網路通用組網工具", - "sjmclDesc": "上海交通大學開發的第三方我的世界啟動器", - "ddegameDesc": "遊戲不僅僅是遊戲,遊戲可以走進生活改變生活", - "huorongDesc": "暢享純粹終端防護。輕快運行,靜享守護,全面防禦", - "descriptions": { - "assistantCrosshair": "遊戲畫面準心輔助工具", - "memreduct": "記憶體清理工具", - "windowsCoreOptimizer": "僅對有大小核心的CPU有效", - "windows-core-optimizer": "僅對有大小核心的CPU有效", - "optimizer": "Windows系統優化工具", - "cpu-z": "CPU資訊檢測工具", - "gpu-z": "顯示卡資訊檢測工具", - "processLasso": "系統程序優化工具", - "process-lasso": "系統程序優化工具", - "fxsound": "音訊增強工具", - "msi-afterburner": "顯示卡超頻監控工具", - "huorong": "暢享純粹終端防護。輕快運行,靜享守護,全面防禦" - }, - "status": { - "available": "可用", - "comingSoon": "開發中", - "installed": "已安裝", - "notInstalled": "未安裝", - "downloading": "下載中", - "scanning": "掃描中..." - }, - "buttons": { - "openTool": "開啟工具", - "comingSoon": "即將推出", - "download": "點擊下載", - "run": "點擊執行", - "website": "前往官網" - }, - "messages": { - "installerStarted": "安裝程式已啟動", - "installerStartedDesc": "請完成安裝後,工具將自動顯示為可用狀態", - "installComplete": "安裝完成", - "installCompleteDesc": "工具已成功安裝,點擊即可執行", - "installerStartedAlt": "安裝程式已啟動", - "installerStartedDescAlt": "請完成安裝,系統將自動偵測安裝狀態", - "downloadComplete": "下載完成", - "downloadCompleteDesc": "工具已就緒,點擊即可執行", - "downloadFailed": "下載失敗", - "runFailed": "執行失敗" - }, - "ariaLabels": { - "refreshToolList": "重新整理工具清單" - }, - "customAdded": { - "add": "手動新增工具", - "remove": "刪除手動新增", - "addSuccess": "已新增工具", - "addFailed": "新增失敗", - "removed": "已刪除手動新增" - } - }, - "displayFilter": { - "title": "顯示器濾鏡", - "enable": "啟用濾鏡", - "presets": "預設模式", - "currentSettings": "目前設定", - "colorTemperature": "色溫", - "brightness": "亮度", - "contrast": "對比度", - "saturation": "飽和度", - "resetDefault": "恢復預設", - "resetSuccess": "已恢復預設設定", - "filterEnabled": "濾鏡已啟用", - "filterDisabled": "濾鏡已停用", - "presetAppliedPrefix": "已套用 ", - "presetAppliedSuffix": " 預設", - "error": "操作失敗", - "custom": "自訂", - "customDescription": "自訂濾鏡參數", - "tip": "濾鏡透過調整顯示器 Gamma 曲線實現色彩效果,退出應用時自動恢復預設設定。", - "customFilter": "自訂濾鏡", - "saveSuccess": "設定已儲存並套用", - "saveAndApply": "儲存並套用", - "iccProfiles": "ICC 色彩配置文件", - "importIcc": "匯入 ICC 檔案", - "importIccSuccess": "ICC 檔案已匯入", - "importIccFailed": "ICC 檔案匯入失敗", - "iccApplied": "ICC 色彩配置已套用", - "deleteIcc": "刪除", - "deleteIccConfirm": "確認刪除此 ICC 預設?", - "deleteIccSuccess": "ICC 預設已刪除", - "noIccProfiles": "暫無匯入的 ICC 配置文件", - "selectDisplay": "選擇顯示器", - "primary": "主", - "cancel": "取消", - "delete": "刪除", - "exportIcc": "匯出為 ICC 檔案", - "exportIccSuccess": "ICC 檔案已匯出", - "exportIccFailed": "ICC 檔案匯出失敗", - "previewTitle": "濾鏡預覽", - "previewOriginal": "原始", - "previewFiltered": "濾鏡", - "previewDisabledNote": "濾鏡未啟用 · 僅預覽效果", - "paramsUpdated": "參數已更新", - "paramsUpdatedHint": "請手動開啟濾鏡開關以生效", - "myPresets": "我的濾鏡預設", - "noPresets": "還沒有自訂預設\n調整參數後點擊「另存為預設」儲存", - "saveAsPreset": "另存為預設", - "presetNamePlaceholder": "輸入預設名稱...", - "savePresetSuccess": "預設已儲存", - "deletePreset": "刪除預設", - "deletePresetConfirm": "確定刪除此預設?", - "deletePresetSuccess": "預設已刪除", - "save": "儲存" - }, -"floatingNav": { - "title": "懸浮導航框", - "enable": "啟用懸浮框", - "settings": "設定", - "displayText": "顯示文字", - "width": "寬度", - "height": "高度", - "opacity": "透明度", - "applySettings": "套用設定", - "preview": "預覽", - "previewNote": "預覽效果(實際懸浮框位於顯示器頂部中央)", - "enabled": "懸浮導航已啟用", - "disabled": "懸浮導航已關閉", - "settingsApplied": "設定已套用", - "error": "操作失敗", - "tip": "懸浮導航框會在顯示器頂部中央顯示,始終保持在所有視窗最上層。可以透過調整透明度來控制其對其他應用的影響程度。", - "displayContent": "顯示內容", - "cpuUsage": "CPU佔用", - "gpuTemp": "GPU溫度", - "gpuUsage": "GPU佔用" - }, - "crosshair": { - "title": "輔助準心", - "enableCrosshair": "啟用準心", - "statusEnabled": "已啟用", - "statusDisabled": "已關閉", - "style": "準心樣式", - "color": "顏色", - "customColor": "自訂顏色", - "size": "大小", - "thickness": "粗細", - "gap": "間距", - "dotSize": "中心點大小", - "opacity": "透明度", - "preview": "預覽", - "parameters": "參數調整", - "monitor": "顯示器選擇", - "primaryMonitor": "主顯示器", - "advanced": "進階設定", - "resetDefault": "恢復預設", - "updateFailed": "更新設定失敗", - "toggleFailed": "切換準心失敗", - "renderMode": "渲染模式", - "procedural": "預設準心", - "customImage": "自定義圖片", - "selectImage": "選擇圖片", - "styles": { - "cross": "十字", - "dot": "點", - "circle": "圓形", - "crossDot": "十字+點", - "circleCross": "圓形+十字" - } - }, - "hardwareReport": { - "export": "匯出報告", - "selectPath": "選擇匯出位置", - "exporting": "正在產生報告...", - "exportSuccess": "報告匯出成功", - "exportFailed": "匯出失敗", - "recorderNotStarted": "記錄器未啟動,請稍後重試" - }, - "overlayPanel": { - "title": "懸浮框", - "enableOverlay": "啟用懸浮框", - "statusEnabled": "已啟用", - "statusDisabled": "已關閉", - "displayItems": "顯示項目", - "hardwareMonitor": "硬體監控", - "cpuUsage": "CPU佔用", - "gpuTemp": "GPU溫度", - "gpuUsage": "GPU佔用", - "memoryUsage": "記憶體佔用", - "deltaPassword": "三角洲密碼", - "custom": "自訂", - "customText": "自訂文字", - "color": "顏色", - "addCustomItem": "新增自訂項", - "appearance": "外觀設定", - "styles": "懸浮框樣式", - "styles.default": "預設", - "styles.dynamicIsland": "動態島", - "styles.verticalPanel": "豎排面板", - "fontColor": "字體顏色", - "opacity": "透明度", - "startFailed": "啟動失敗", - "stopFailed": "停止失敗", - "hotkey": "快速鍵", - "toggleHotkey": "切換懸浮框", - "hotkeySaved": "快速鍵已保存" - }, - "deltaForce": { - "title": "三角洲專區", - "dailyPassword": "每日密碼", - "weaponCodes": "改槍碼", - "weaponCodeDesc": "選擇改槍碼平台,在新視窗中瀏覽和複製改槍碼", - "weaponCodePlatforms": "改槍碼平台", - "openPlatform": "開啟平台", - "officialMaps": "官方地圖", - "openOfficialMap": "三角洲行動官方地圖工具", - "mapToolDesc": "物資點、出生點、撤離點及首領座標", - "dlssPreset": "DLSS預設", - "dlssPresetDesc": "選擇DLSS類神經網路模型預設,不同預設適用於不同場景", - "loading": "載入中...", - "noPassword": "暫無密碼資料", - "copy": "複製", - "copied": "已複製", - "copySuccess": "已複製到剪貼簿", - "copyFailed": "複製失敗", - "all": "全部", - "recommended": "推薦", - "currentSelection": "目前選擇", - "applyPreset": "套用預設", - "dlssNote": "需要NVIDIA Profile Inspector支援,套用後重新啟動遊戲生效", - "back": "返回", - "dlssModels": { - "A": { "name": "A模型", "description": "早期模型" }, - "B": { "name": "B模型", "description": "早期模型" }, - "C": { "name": "C模型", "description": "早期模型" }, - "D": { "name": "D模型", "description": "穩定模型" }, - "E": { "name": "E模型", "description": "實驗性模型" }, - "F": { "name": "F模型", "description": "改進模型" }, - "G": { "name": "G模型", "description": "改進模型" }, - "J": { "name": "J模型", "description": "較新模型,畫質優先" }, - "K": { "name": "K模型", "description": "推薦模型,大多數DLSS模式" }, - "L": { "name": "L模型", "description": "優化Ultra Performance模式" }, - "M": { "name": "M模型", "description": "優化Performance模式" } - }, - "weaponCodePlatformNames": { - "maqt": "碼槍堂", - "anchor-codes": "主播改槍碼", - "xiaotao-check": "小濤查", - "delta-workshop": "三角洲工坊" - }, - "officialMapToolTitle": "三角洲行動 - 官方地圖工具", - "officialWallpaper": "官方壁紙", - "officialWallpaperTitle": "三角洲行動 - 官方壁紙", - "wallpaperDesc": "官方高清壁紙下載", - "allCategories": "全部", - "searchPlaceholder": "搜尋武器...", - "allWeapons": "全部武器", - "noLoadouts": "暫無改槍碼", - "noLoadoutsHint": "換個篩選條件試試", - "previousPage": "上一頁", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "下一頁", - "upload": "上傳改槍碼", - "category": "分類", - "weaponName": "武器名稱", - "selectWeapon": "請選擇武器", - "code": "改槍碼", - "codePlaceholder": "請輸入改槍碼,最多500字元", - "description": "描述", - "descriptionPlaceholder": "請輸入描述(可選)", - "cost": "改槍費用", - "author": "作者", - "nicknamePlaceholder": "輸入暱稱(可選)", - "cancel": "取消", - "submit": "提交審核", - "report": "無法使用?", - "reported": "已報告管理員", - "uploadSuccess": "上傳成功", - "uploadQueueHint": "你的改槍碼已進入審核佇列,通過後即可顯示", - "uploadFailed": "上傳失敗", - "otherPlatformsCard": { - "title": "其他改槍碼平台", - "description": "探索更多改槍碼平台" - }, - "viewMore": "檢視更多", - "moreGunCodes": "更多改槍碼", - "moreGunCodesDesc": "探索更多改槍碼平台", - "openFailed": "打開失敗", - "otherPlatforms": { - "title": "其他改槍碼平台", - "description": "以下是一些其他改槍碼平台,點擊在新視窗中開啟", - "maqt": { - "name": "碼槍堂", - "description": "碼槍堂改槍碼平台" - }, - "anxu": { - "name": "ANXU改槍碼", - "description": "ANXU改槍碼平台" - }, - "aitags": { - "name": "主播改槍碼", - "description": "主播改槍碼平台" - }, - "xiaotao": { - "name": "小濤查", - "description": "小濤查改槍碼平台" - } - } - }, - "dlssPreset": { - "title": "三角洲DLSS設定", - "description": "切換DLSS類神經網路模型預設以優化遊戲畫質", - "presetLabel": "DLSS 預設", - "driverVersion": "驅動版本", - "noGpuFound": "未偵測到顯卡" - }, - "dlssIndicator": { - "title": "DLSS 指示器", - "description": "在畫面左下角顯示 DLSS 標識", - "enabled": "DLSS 指示器已啟用", - "disabled": "DLSS 指示器已關閉", - "enabling": "正在開啟...", - "disabling": "正在關閉...", - "note": "需要管理員權限,重啟遊戲後生效" - }, - "dlssLock": { - "title": "DLSS 鎖定", - "description": "鎖定 nvidiaProfileInspector 驅動配置", - "enabled": "DLSS 配置已鎖定", - "disabled": "DLSS 配置已解鎖", - "note": "鎖定後防止驅動更新覆蓋設置" - }, - "dlssPresetTable": { - "title": "預設參考表", - "description": "不同顯卡系列推薦的 DLSS 預設配置", - "gpuSeries": "顯卡", - "recommendedPreset": "預設", - "driverVersion": "驅動", - "scenario": "類型", - "rtx20Series": "RTX 20 系列", - "rtx30Series": "RTX 30 系列", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 高幀", - "rtx50HighQuality": "RTX 50 高畫質", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "通用增強", - "typePerformanceFirst": "性能優先", - "typeQualityEnhance": "畫質增強", - "typeFpsPriority": "幀率優先" - }, - "musicPlayer": { - "title": "鼠鼠音樂", - "play": "播放", - "pause": "暫停", - "previous": "上一首", - "next": "下一首", - "modeList": "列表循環", - "modeShuffle": "隨機播放", - "modeOne": "單曲循環", - "mute": "靜音", - "unmute": "取消靜音", - "playlist": "播放列表", - "noTrack": "未選擇歌曲", - "empty": "暫無音樂檔案,請將 MP3 檔案放入", - "minimize": "最小化" - }, - "mood": { - "title": "心境", - "connecting": "正在連線到 www.nexbox.top/love ..." - }, - "builtinTools": { - "title": "內建工具", - "back": "返回", - "displayFilterDesc": "調整顯示器色彩濾鏡", - "crosshairDesc": "遊戲畫面準心輔助工具", - "overlayPanelDesc": "顯示系統硬體狀態的懸浮框", - "gpuRenameDesc": "改寫顯卡名稱以優化遊戲效能", - "resolutionConverterDesc": "換算不同解析度下的畫面比例", - "shaderCacheDesc": "清理 NVIDIA/AMD 著色器快取釋放磁碟空間", - "dlssPresetDesc": "切換DLSS模型預設以優化遊戲畫質", - "diskHealthDesc": "檢測硬碟健康狀態與SMART資訊", -"screenRecordDesc": "高效能螢幕錄製(硬體編碼)", - "audioEqDesc": "系統級音訊等化器調音" - }, - "gpuRename": { - "title": "顯卡改寫", - "loading": "載入中...", - "loadError": "載入失敗", - "currentGpu": "目前顯卡", - "originalGpu": "原始顯卡", - "backupStatus": "備份狀態", - "backedUp": "已備份", - "notBackedUp": "未備份", - "selectTarget": "選擇目標顯卡", - "lowEnd": "低階顯卡", - "highEnd": "高階顯卡", - "selectPlaceholder": "請選擇顯卡", - "presetTab": "預設顯卡", - "customTab": "自訂顯卡", - "customPlaceholder": "輸入自訂顯卡名稱", - "selectGpu": "請先選擇顯卡", - "apply": "套用", - "applying": "套用中...", - "restore": "還原", - "restoring": "還原中...", - "success": "操作成功", - "restored": "已還原", - "error": "操作失敗", - "note": "⚠️ 重要提示:\n1. 需要管理員權限才能修改登錄檔\n2. 修改後需要重新啟動遊戲或電腦才能生效\n3. 此功能僅支援 Windows 系統和 NVIDIA 顯卡\n4. 如果無法套用,請嘗試以管理員身分執行應用" - }, - "resolutionConverter": { - "title": "解析度換算", - "selectResolution": "選擇解析度", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "畫面比例", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "寬", - "height": "高", - "pixels": "畫素", - "standard": "標準", - "tip": "選擇解析度類型後,下方將顯示三種常見畫面比例的具體解析度值,方便您在遊戲中調整畫面比例設定。" - }, - "shaderCache": { - "title": "著色器快取清理", - "vendorTitle": "顯卡廠商", - "vendorSubtitle": "按廠商組織清理項,預設僅選 NVIDIA。", - "nvidia": { - "name": "NVIDIA", - "description": "按 NVIDIA 官方路徑清理 DXCache、GLCache、NV_Cache。", - "selected": "已選擇", - "selectable": "可選擇" - }, - "amd": { - "name": "AMD", - "description": "清理 AMD Software Reset Shader Cache 對應的使用者級快取目錄。", - "selected": "已選擇", - "selectable": "點擊選擇" - }, - "detected": "已偵測到", - "notDetected": "未偵測到", - "dirs": "{{count}} 個目錄", - "cleanButton": "開始清理", - "cleaning": "清理中...", - "scanButton": "重新掃描", - "officialTip": { - "title": "NVIDIA 官方建議", - "description": "建議先按下列步驟處理,再回到本頁執行清理。", - "step1": "1. 開啟 NVIDIA 控制面板,將 3D 設定裡的著色器快取大小改成停用。", - "step2": "2. 重新啟動電腦後回到本頁,執行「清理 NVIDIA」。", - "step3": "3. 清理完成後再將著色器快取開啟,選擇多少取決於您的 C 槽容量。" - }, - "cleanSuccess": "清理完成,已釋放 {{size}}", - "cleanError": "清理失敗", - "scanError": "掃描失敗", - "noVendorSelected": "請至少選擇一個顯卡廠商" - }, - "settings": { - "general": "一般", - "appearance": "外觀", - "hotkeys": "熱鍵", - "network": "網路", - "sponsor": "贊助", - "navigation": "導航欄", - "about": "關於", - "generalSettings": { - "title": "一般設定", - "language": "語言", - "languageLabel": "語言 (Language)", - "languages": { - "zh": "簡體中文", - "zh-TW": "繁體中文", - "en": "English", - "fr": "Français", - "ja": "日本語", - "de": "Deutsch" - }, - "homepage": "首頁", - "todayPopularityLabel": "今日人氣", - "todayPopularityDesc": "在首頁顯示今日人氣隨機數", - "announcementLabel": "公告", - "announcementDesc": "在首頁顯示公告卡片", - "randomQuoteLabel": "隨機一言", - "randomQuoteDesc": "在首頁顯示隨機一言卡片", - "gameLauncherLabel": "快捷啟動", - "gameLauncherDesc": "在首頁顯示快捷啟動卡片", - "feedbackLabel": "圖片輪播", - "feedbackDesc": "在首頁顯示圖片輪播", - "splash": "動畫", - "splashLogoLabel": "啟動動畫 Logo", - "splashLogoDesc": "自訂啟動動畫中顯示的 Logo 圖片", - "splashLogoReset": "恢復預設", - "features": "功能", - "advanced": "進階", - "discoveryPage": "探索頁", - "discoveryPageDesc": "變更執行個體頁左側導航列是否顯示、分組方式", - "navMode": "執行個體頁導航列模式", - "navModeDesc": "變更執行個體頁左側導航列是否顯示、分組方式", - "quickSwitch": "快捷切換執行個體與帳戶", - "quickSwitchDesc": "啟用後,點擊啟動頁的切換按鈕可直接選擇帳戶或執行個體,而無需跳轉頁面", - "resourceTranslation": "顯示資源翻譯", - "resourceTranslationDesc": "啟用後,在資源下載介面嘗試顯示名稱或描述的簡體中文翻譯", - "autoLanguage": "自動設定執行個體語言", - "autoLanguageDesc": "啟用後,新建執行個體的語言將自動設定為簡體中文,這將同時略過輔助功能設定", - "navModes": { - "byInstance": "按執行個體", - "byGroup": "按分組" - }, - "startup": "啟動", - "autoStartLabel": "開機自啟", - "autoStartDesc": "系統啟動時自動執行 NexBox", - "closeBehavior": "關閉行為", - "closeBehaviorLabel": "點擊關閉按鈕時", - "closeBehaviorDesc": "選擇點擊關閉按鈕時的行為", - "closeDirectly": "直接關閉", - "minimizeToTray": "最小化到系統匣", - "navPositionLabel": "導航欄位置", - "navPositionDesc": "選擇導航欄顯示在側邊還是頂部", - "navPositionLeft": "側邊", - "navPositionTop": "頂部", - "sidebarShowLabel": "導航欄標籤", - "sidebarShowLabelDesc": "選擇導航欄的顯示模式", - "sidebarShowLabelNoText": "無字", - "sidebarShowLabelWithText": "有字", - "navButtonVisibility": "導航欄按鈕顯示", - "navButtonVisibilityDesc": "控制導航欄中每個按鈕的顯示和隱藏,設定項始終可見", - "pageTransitionLabel": "頁面切換動畫", - "pageTransitionDesc": "關閉後頁面切換將不再有過渡動畫", - "pageTransitionSlide": "滑動", - "pageTransitionFade": "淡化", - "pageTransitionOff": "關閉" - }, - "appearanceSettings": { - "title": "外觀設定", - "theme": "主題", - "themeStyle": "主題樣式", - "themeStyles": { - "light": "淺色", - "dark": "深色" - }, - "font": "字體", - "fontLabel": "介面字體", - "fontDesc": "選擇應用介面字體,預設為 Sinter", - "importCustomFontLabel": "匯入自訂字體", - "importCustomFontDesc": "支援 TTF / OTF / WOFF 格式字體檔", - "importFontButton": "匯入字體", - "importingFont": "匯入中...", - "removeFont": "刪除字體", - "duplicateFont": "該字體已存在", - "importFontFailed": "匯入字體失敗", - "liquidGlass": "液態玻璃", - "liquidGlassLabel": "液態玻璃", - "liquidGlassDesc": "啟用後,部分介面將使用「液態玻璃」效果,這可能會影響效能", - "liquidGlassBlurLabel": "模糊程度", - "liquidGlassModeLabel": "玻璃模式", - "liquidGlassModeNormal": "普通液態玻璃", - "liquidGlassModeReal": "真實液態玻璃", - "liquidGlassModeNormalDesc": "使用模糊和透明度模擬玻璃質感,可調節模糊程度", - "liquidGlassModeRealDesc": "使用 SVG 折射濾鏡實現邊緣折射和色差效果,更真實但需要更多 GPU 開銷", - "jellyBounce": "果凍彈跳", - "jellyBounceLabel": "果凍彈跳效果", - "jellyBounceDesc": "啟用後,所有卡片、選單和導航列在互動與狀態切換時會有彈性縮放動畫", - "customBackground": "自訂背景", - "customBackgroundLabel": "啟用自訂背景", - "imageUrlPlaceholder": "輸入圖片URL或點擊上傳", - "maxImagesReached": "最多只能新增3張背景圖片", - "presetBackground": "預設背景", - "imageBackground": "圖片背景", - "dynamicBackground": "動態背景", - "dynamicBackgroundDesc": "啟用後將顯示動態背景效果", - "uploadVideo": "上傳影片", - "unsupportedVideoFormat": "不支援的影片格式,請使用 mp4 或 webm 檔案", - "themeColor": "主題色", - "themeColorLabel": "自訂主題色", - "themeColorDesc": "設定導航列、按鈕、功能表等元素的主題顏色", - "presets": "預設顏色", - "customColor": "自訂顏色", - "advancedSettings": "進階設定", - "hoverOpacity": "懸停透明度", - "activeOpacity": "啟用透明度", - "borderOpacity": "邊框透明度", - "backgroundBlurLabel": "背景模糊", - "backgroundBlurHint": "對所有背景模式生效(預設 / 圖片 / 影片)", - "resetToDefault": "重置為預設", - "uploadVideo": "上傳影片", - "presetColors": { - "cyan": "青色", - "blue": "藍色", - "purple": "紫色", - "pink": "粉色", - "orange": "橙色", - "green": "綠色", - "red": "紅色", - "yellow": "黃色" - } - }, - "sponsorSettings": { - "title": "支持開發者", - "description": "如果您覺得 NexBox 對您有幫助,歡迎請作者喝杯咖啡 ☕", - "wechat": "微信支付", - "alipay": "支付寶", - "thankYou": "感謝您的支持!", - "placeholder": "請新增收款碼圖片", - "sponsorList": { - "title": "贊助者名單", - "loading": "載入中...", - "error": "載入失敗", - "empty": "暫無贊助者" - } - }, - "aboutSettings": { - "title": "關於", - "version": "版本", - "author": "作者", - "newVersion": "發現新版本", - "check": "檢查", - "noUpdate": "已是最新版本", - "checkFailed": "檢查更新失敗", - "downloadFailed": "下載失敗", - "installFailed": "安裝失敗", - "acknowledgments": "致謝", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "感謝上海交通大學Minecraft社開源專案", - "changelog": "更新日誌", - "changelogTitle": "當前版本更新內容", - "noChangelog": "暫無更新日誌", - "loadingChangelog": "載入中...", - "updateModal": { - "title": "發現新版本", - "version": "版本", - "releaseNotes": "更新說明", - "downloading": "下載中...", - "downloadComplete": "下載完成,請選擇操作", - "cancel": "取消", - "download": "下載", - "restartInstall": "重新啟動安裝", - "skip": "暫不" - } - }, - "networkSettings": { - "title": "網路延遲測試", - "description": "測試到國內各伺服器的網路延遲", - "testButton": "測試", - "testing": "測試中...", - "testingAll": "全部測試中...", - "testAll": "全部測試", - "latency": "延遲", - "timeout": "逾時", - "unreachable": "無法連線", - "servers": { - "baidu": "百度", - "gitee": "Gitee", - "github": "GitHub", - "qq": "騰訊", - "aliyun": "阿里雲", - "wangyi": "網易", - "bilibili": "bilibili", - "douyin": "抖音", - "jd": "京東", - "zhihu": "知乎" - } - } - }, - "epic": { - "title": "Epic 喜加一", - "loading": "正在載入免費遊戲...", - "errorFetch": "取得資料失敗", - "errorNetwork": "網路請求失敗,請檢查網路連線", - "deadline": "截止 {{date}}", - "claimNow": "立即領取", - "noGames": "暫無免費遊戲,請稍後再來查看", - "reload": "重新載入" - }, - "search": { - "placeholder": "搜尋功能...", - "noResults": "未找到相關功能", - "typeToSearch": "輸入關鍵字搜尋...", - "categories": { - "pages": "頁面", - "builtinTools": "內建工具", - "optimization": "優化", - "thirdpartyTools": "第三方工具" - } - }, - "gpuDriverRestart": { - "pageTitle": "重啟顯示卡驅動", - "pageDesc": "模擬 Win+Ctrl+Shift+B 快速鍵重啟顯示卡驅動(網咖使用者適用)", - "detailDesc": "點擊按鈕將向系統發送重啟顯示卡驅動的指令,效果等同於按下 Win+Ctrl+Shift+B。螢幕會短暫黑屏或閃爍,幾秒後恢復正常。此功能無需管理員權限。", - "restartBtn": "重啟顯示卡驅動", - "success": "已發送重啟指令,螢幕即將短暫閃爍", - "error": "重啟顯示卡驅動失敗", - "waiting": "正在執行重啟指令,請稍候...", - "warningTitle": "請注意", - "warningDesc": "重啟顯示卡驅動會導致螢幕短暫黑屏或閃爍,請先確認沒有正在進行的重要操作(如遊戲、檔案編輯等)。此功能適用於顯示卡顯示異常、花屏、卡頓等情形,僅限 Windows 系統使用。" - }, - "closeDialog": { - "title": "關閉確認", - "message": "您希望如何關閉應用?", - "closeApp": "直接關閉", - "minimizeToTray": "最小化到系統匣", - "dontAskAgain": "不再提醒" - }, - "tray": { - "show": "顯示主視窗", - "exit": "退出" - }, - "hotkeySettings": { - "title": "熱鍵設置", - "overlay": "懸浮框", - "overlayToggle": "切換懸浮框", - "overlayToggleDesc": "使用快速鍵顯示或隱藏懸浮框", - "crosshair": "準心", - "crosshairToggle": "切換準心", - "crosshairToggleDesc": "使用快速鍵顯示或隱藏準心", - "filter": "濾鏡", - "filterToggle": "切換濾鏡", - "filterToggleDesc": "使用快速鍵開啟或關閉濾鏡", - "saved": "快速鍵已保存" - }, - "diskHealth": { - "title": "磁碟健康檢測", - "refresh": "重新整理", - "scanning": "檢測中...", - "total": "磁碟總數", - "healthy": "健康", - "warning": "警告", - "unhealthy": "故障", - "temperature": "溫度", - "lifespan": "健康壽命", - "powerOnHours": "通電時間", - "operationalStatus": "運行狀態", - "readErrors": "讀取錯誤", - "writeErrors": "寫入錯誤", - "partitions": "個分割區", - "loadError": "載入失敗", - "retry": "重試" - }, - "screenRecord": { - "title": "螢幕錄製", - "description": "硬體加速螢幕錄製,支援高幀率擷取", - "loading": "載入中...", - "previewWaiting": "等待錄製開始...", - "recording": "錄製中", - "idle": "待機", - "openPreview": "開啟預覽視窗", - "closePreview": "關閉預覽", - "settings": { - "title": "錄製設定", - "source": "擷取來源", - "display": "顯示器", - "window": "視窗", - "windowSrc": "應用視窗", - "fps": "幀率", - "resolution": "解析度", - "original": "原始", - "bitrate": "位元率", - "codec": "編碼器", - "container": "格式", - "captureCursor": "擷取游標", - "savePath": "儲存路徑", - "selectPath": "選擇儲存位置" - }, - "controls": { - "start": "開始錄製", - "stop": "停止錄製", - "recording": "錄製中", - "paused": "已暫停" - }, - "stats": { - "title": "錄製統計", - "lastRecording": "上次錄製", - "elapsed": "已錄製時長", - "targetFps": "目標幀率", - "captureFps": "擷取幀率", - "outputFps": "輸出幀率", - "droppedFrames": "丟幀數", - "totalFrames": "總幀數", - "fileSize": "檔案大小", - "currentBitrate": "目前位元率" - }, - "warnings": { - "refreshRateLow": "顯示器更新率 ({{hz}}Hz) 低於目標幀率 ({{fps}}fps),將透過補幀達到目標幀率", - "noDisplayFound": "未找到可擷取的顯示器", - "savePathRequired": "請先選擇儲存路徑", - "encodingError": "編碼錯誤: {{message}}" - }, - "messages": { - "recordingStarted": "錄製已開始", - "recordingStopped": "錄製已停止,檔案已儲存到: {{path}}", - "recordingError": "錄製出錯: {{message}}" - } - }, - "audioEq": { - "title": "EQ 調音", - "loading": "載入中...", - "virtualSoundCard": "虛擬音效卡", - "virtualSoundCardDesc": "安裝 FxSound 虛擬音訊驅動以啟用系統級 EQ", - "installed": "已安裝", - "notInstalled": "未安裝", - "serviceRunning": "服務執行中", - "installDriver": "安裝音效卡", - "uninstallDriver": "解除安裝音效卡", - "installing": "安裝中...", - "uninstalling": "解除安裝中...", - "installSuccess": "安裝成功", - "installFailed": "安裝失敗", - "uninstallSuccess": "解除安裝成功", - "uninstallFailed": "解除安裝失敗", - "installHint": "安裝驅動需要管理員權限,請以管理員身分執行 NexBox", - "eqEngine": "EQ 引擎", - "eqEngineDesc": "啟動音訊處理引擎以套用 EQ 效果", - "running": "執行中", - "stopped": "已停止", - "startEngine": "啟動引擎", - "stopEngine": "停止引擎", - "starting": "啟動中...", - "engineStarted": "EQ 引擎已啟動", - "engineStartFailed": "啟動 EQ 引擎失敗", - "engineStopped": "EQ 引擎已停止", - "engineStopFailed": "停止 EQ 引擎失敗", - "installDriverFirst": "請先安裝虛擬音效卡驅動", - "presets": "預設", - "equalizer": "等化器", - "reset": "重設", - "presetApplied": "預設已套用", - "usageGuide": "使用指南", - "step1": "點擊「安裝音效卡」按鈕安裝 FxSound 虛擬音訊驅動(需要管理員權限)", - "step2": "安裝成功後,點擊「啟動引擎」按鈕啟動 EQ 音訊處理引擎", - "step3": "選擇預設或拖動頻段滑桿調整 EQ 參數,頻率響應曲線將即時更新", - "step4": "使用完畢後,點擊「停止引擎」關閉音訊處理,可隨時解除安裝音效卡驅動" - } -} - diff --git a/参考/NexBox-main/src/locales/zh.json b/参考/NexBox-main/src/locales/zh.json deleted file mode 100644 index f7dda3e..0000000 --- a/参考/NexBox-main/src/locales/zh.json +++ /dev/null @@ -1,1712 +0,0 @@ -{ - "common": { - "appName": "NexBox", - "appFullName": "新境盒", - "description": "跨平台性能监控(Tauri + Next.js + 传感器服务)", - "cancel": "取消", - "add": "添加" - }, - "view": { - "grid": "网格视图", - "list": "列表视图" - }, - "onboarding": { - "title": "欢迎使用新境盒", - "subtitle": "让我们一起开始", - "step": "步骤", - "steps": { - "language": { - "title": "选择您的语言", - "description": "请选择您偏好的语言" - }, - "theme": { - "title": "选择您的主题", - "description": "选择您喜欢的界面主题", - "light": "浅色", - "dark": "深色" - }, - "complete": { - "title": "一切就绪!", - "description": "您已经完成了所有设置,现在开始使用新境盒吧!", - "button": "开始使用" - } - } - }, - "sidebar": { - "home": "主页", - "tools": "工具", - "hardware": "硬件", - "optimization": "优化", - "displayFilter": "滤镜", - "floatingNav": "悬浮框", - "crosshair": "准心", - "overlayPanel": "悬浮框", - "builtinTools": "内置工具", - "deltaForce": "三角洲", - "music": "音乐", - "mood": "心境", - "settings": "设置", - "gpuRename": "显卡改写", - "resolutionConverter": "分辨率管理", - "dlssPreset": "三角洲DLSS设置", - "epicFree": "喜加一", - "nvidiaDriver": "显卡设置(仅NVIDIA)", - "diskHealth": "磁盘健康", -"screenRecord": "屏幕录制", - "audioEq": "EQ调音" - }, - "optimization": { - "pageTitle": "优化", - "pageDesc": "系统优化与性能提升工具", - "windowsTitle": "Windows 优化", - "windowsDesc": "优化系统性能,提升游戏体验", - "title": "Windows优化", - "description": "优化系统性能,提升游戏体验", - "selectAll": "全选", - "recommended": "推荐", - "options": { - "tempFileCleanup": "清理临时文件", - "privacyServiceOptimize": "服务优化(隐私与遥测)", - "memoryCleanup": "释放电脑内存", - "closeWallpaperEngine": "关闭 Wallpaper Engine", - "optimizeAce": "优化 ACE 进程", - "highPerformancePower": "切换高性能电源计划", - "flushDns": "清理 DNS 缓存" - }, - "tip": "小提示:点击开始优化按钮后,将帮您优化选择的功能,单次优化只会生效一次,退出游戏或加或者点击停止按钮都会停止优化", - "startButton": "开始优化", - "optimizing": "优化中...", - "starting": "开始优化...", - "completed": "优化完成", - "completedDesc": "已成功完成系统优化", - "error": "优化失败,请重试", - "pleaseSelectOptions": "请选择要优化的选项", - "results": { - "tempFiles": "临时文件", - "tempFilesComplete": "清理完成", - "serviceOptimize": "服务优化", - "serviceOptimizeComplete": "完成", - "memoryOptimize": "内存优化", - "memoryOptimizeComplete": "完成", - "aceProcess": "ACE进程", - "powerPlan": "电源计划" - }, - "startupManager": { - "title": "启动项管理", - "description": "管理系统开机自启项", - "scanError": "扫描启动项失败", - "deleteSuccess": "已删除: {{name}}", - "deleteError": "删除失败", - "locateError": "定位文件失败", - "registryError": "打开注册表失败", - "totalItems": "共 {{count}} 个启动项", - "refresh": "刷新", - "scanning": "正在扫描启动项...", - "noItems": "未发现启动项", - "columnName": "名称", - "columnPath": "路径", - "columnActions": "操作", - "locateFile": "定位文件", - "findInRegistry": "在注册表中查找", - "delete": "删除", - "tipTitle": "💡 提示", - "tipDescription": "启动项管理可以帮助您查看和管理系统中所有开机自启的项目。禁用不必要的启动项可以加快系统开机速度。请谨慎操作,某些系统启动项可能为系统正常运行所必需。" - }, - "memoryLimit": { - "title": "内存限制", - "description": "限制系统可用内存以优化游戏性能", - "currentStatus": "当前状态", - "physicalMemory": "物理内存", - "currentLimit": "当前限制", - "noLimit": "无限制", - "selectLimit": "选择限制", - "applyLimit": "应用限制", - "restoreLimit": "恢复默认", - "limitApplied": "限制已应用", - "limitRestored": "已恢复默认", - "requiresRestart": "需要重启生效", - "warning": "警告", - "warningText": "设置内存限制需要管理员权限,且需要重启系统才能生效", - "adminRequired": "需要管理员权限", - "options": { - "7.9gb": "7.9 GB", - "11.9gb": "11.9 GB", - "13.9gb": "13.9 GB", - "15.9gb": "15.9 GB" - }, - "presetTab": "预设限制", - "customTab": "自定义限制", - "customPlaceholder": "输入限制值 (GB)", - "selectPreset": "选择预设限制值", - "invalidInput": "请输入有效的内存限制值", - "outOfRange": "限制值必须在 0.1 到物理内存之间" - }, - "powerManagement": { - "title": "电源管理", - "description": "导入并激活优化电源计划,提升游戏性能", - "currentPlan": "当前电源计划", - "builtinPlans": "内置电源计划", - "systemPlans": "系统电源计划", - "import": "导入", - "importAndActivate": "导入并激活", - "activate": "激活", - "importing": "导入中...", - "activating": "激活中...", - "importSuccess": "电源计划导入成功", - "importFailed": "电源计划导入失败", - "activateSuccess": "电源计划已激活", - "activateFailed": "电源计划激活失败", - "alreadyImported": "已导入", - "notImported": "未导入", - "active": "已激活", - "loadFailed": "加载电源计划失败", - "refresh": "刷新", - "tipTitle": "提示", - "tip": "电源计划会影响系统功耗和性能表现,游戏场景建议使用高性能方案。激活电源计划需要管理员权限。", - "importAll": "一键导入全部", - "importingAll": "批量导入中...", - "importAllSuccess": "成功导入 {{count}} 个电源计划", - "importAllFailed": "{{count}} 个电源计划导入失败", - "allImported": "所有电源计划已导入系统", - "delete": "删除", - "deleting": "删除中...", - "deleteSuccess": "电源计划已删除", - "deleteFailed": "删除电源计划失败", - "deleteConfirmTitle": "确认删除", - "deleteConfirmText": "确定要从系统中删除电源计划「{{name}}」吗?", - "cancel": "取消" - }, - - "memoryCleanup": { - "title": "内存清理", - "description": "查看内存详情并释放内存", - "physicalMemory": "物理内存", - "virtualMemory": "虚拟内存", - "workingSet": "系统工作集", - "used": "已用", - "available": "可用", - "total": "总共", - "cleanAll": "全部清理", - "cleanStandby": "清理待机内存", - "trimWorkingSet": "收紧系统工作集", - "loading": "加载中...", - "cleaning": "清理中...", - "freedMemory": "释放了 {{size}} MB 内存", - "noMemoryFreed": "当前无需清理", - "error": "清理失败", - "autoClean": "定时清理", - "autoCleanDesc": "自动在设定的条件满足时清理内存", - "interval": "间隔时间", - "intervalSec": "{{seconds}}秒", - "interval5min": "5分钟", - "interval10min": "10分钟", - "interval30min": "30分钟", - "interval1hour": "1小时", - "threshold": "内存阈值", - "thresholdDesc": "当已用内存超过此值时触发清理", - "thresholdGB": "{{gb}} GB", - "cleanType": "清理类型", - "cleanTypeAll": "全部清理", - "cleanTypeStandby": "清理待机内存", - "cleanTypeWorkingSet": "收紧系统工作集", - "autoCleanEnabled": "定时清理已开启", - "autoCleanDisabled": "定时清理已关闭", - "configSaved": "定时清理配置已保存" - }, - "aceOptimize": { - "title": "三角洲/ACE优化", - "description": "三角洲进程优化与 ACE 反作弊进程资源限制", - "deltaSection": { - "title": "三角洲优化", - "subtitle": "提升三角洲行动游戏性能表现" - }, - "deltaBoost": { - "title": "进程优先级提升", - "description": "将三角洲游戏主进程优先级设为「实时」,优先分配 CPU 资源,显著提升游戏流畅度", - "affinityTitle": "核心分配优化", - "affinityDescription": "将三角洲进程分配到除 CPU0 外的所有核心,充分发挥多核性能的同时保留核心0供系统使用", - "success": "三角洲进程优先级已提升至实时", - "notRunning": "三角洲游戏未运行", - "affinitySuccess": "三角洲核心分配已优化" - }, - "aceSection": { - "title": "ACE 反作弊优化", - "subtitle": "限制反作弊进程资源占用,释放更多性能给游戏" - }, - "aceLimit": { - "title": "进程优先级限制", - "description": "将 ACE-Tray、SGuard64、SGuardSvc64 反作弊相关进程优先级降为「低」,减少 CPU 抢占", - "affinityTitle": "核心分配限制", - "affinityDescription": "限制 ACE 反作弊进程仅使用单核心(CPU0)运行,避免占用游戏关键 CPU 资源", - "success": "已限制 {{count}} 个 ACE 进程优先级", - "notRunning": "未找到运行中的 ACE 进程", - "affinitySuccess": "已限制 {{count}} 个 ACE 进程使用单核心" - }, - "aceEfficiency": { - "title": "调度优化", - "description": "对 ACE 反作弊进程启用后台节能调度:优先级降为低于正常 + 后台 I/O 节流 + 低内存优先级,大幅减少后台资源占用", - "success": "已为 {{count}} 个 ACE 进程开启调度优化", - "notRunning": "未找到运行中的 ACE 进程" - }, - "optimizeAll": { - "button": "一键全部优化", - "optimizing": "优化中...", - "title": "一键全部优化", - "description": "同时执行三角洲进程优先级提升和 ACE 进程优先级/核心限制", - "success": "全部优化完成", - "partial": "部分优化完成,请查看详情" - }, - "autoDetect": { - "title": "自动检测并优化 ACE 进程", - "description": "后台持续监测,发现 ACE-Tray/SGuard 进程自动限制优先级和核心亲和性(每 5 秒检测一次)", - "status": { - "running": "自动检测运行中", - "stopped": "自动检测已停止" - }, - "lastCheck": "上次检测", - "never": "从未检测", - "optimizing": "正在优化 {{count}} 个进程", - "enabled": "自动检测已启用", - "disabled": "自动检测已禁用" - }, - "status": { - "optimized": "已优化", - "notRunning": "未运行", - "notOptimized": "待优化", - "processRunning": "进程运行中", - "processNotRunning": "进程未运行" - }, - "affinitySettings": { - "title": "核心选择", - "description": "选择要分配的 CPU 核心(共 {{count}} 个逻辑核心)", - "save": "保存", - "cancel": "取消", - "selectAll": "全选", - "clearAll": "清空", - "configSaved": "核心配置已保存", - "deltaDefault": "除 CPU0 外的所有核心(默认)", - "aceDefault": "仅 CPU0(默认)" - }, - "apply": "应用", - "applied": "已应用", - "error": "优化失败" - } - }, - "home": { - "title": "欢迎使用新境盒", - "welcome": "欢迎", - "selectTools": "选择快捷工具", - "todayPopularity": "今日人气", - "randomQuote": "随机一言", - "announcement": "公告", - "announcementList": "公告列表", - "loading": "加载中...", - "noAnnouncement": "暂无公告", - "important": "重要", - "importantAnnouncement": "重要公告", - "confirmAnnouncement": "好的" - }, - "gameLauncher": { - "title": "快捷启动", - "addGame": "添加游戏", - "gameName": "游戏名称", - "gameNamePlaceholder": "请输入游戏名称", - "gamePath": "游戏路径", - "gamePathPlaceholder": "请选择游戏可执行文件" - }, - "hardware": { - "title": "硬件信息", - "processor": "处理器", - "model": "型号", - "name": "名称", - "vendor": "厂商", - "coresThreads": "核心+线程", - "cores": "核", - "threads": "线程", - "baseClock": "主频", - "l2Cache": "L2缓存", - "l3Cache": "三缓", - "cpuUsage": "CPU占用", - "gpu": "显卡", - "memory": "显存", - "driverVersion": "驱动版本", - "driverDate": "驱动日期", - "temperature": "温度", - "temperatureUnit": "°C", - "usage": "占用", - "motherboard": "主板", - "monitor": "显示器", - "os": "操作系统", - "ram": "内存", - "manufacturer": "制造商", - "partNumber": "型号", - "capacity": "容量", - "speed": "频率", - "bankLabel": "插槽", - "storage": "存储", - "totalCapacity": "总容量", - "count": "条数", - "soundCard": "声卡", - "networkCard": "网卡", - "adapterType": "适配器类型", - "macAddress": "MAC地址", - "linkSpeed": "链路速率", - "deltaPasswordFetched": "已获取", - "deltaPasswordNotFetched": "--", - "connectionName": "连接名称", - "architecture": "架构", - "socket": "插槽", - "currentClock": "当前频率", - "extClock": "外频", - "enabledCores": "已启用核心", - "family": "系列", - "stepping": "步进", - "revision": "修订", - "processorId": "处理器 ID", - "voltageCaps": "电压", - "videoProcessor": "核心架构", - "videoMemoryType": "显存类型", - "installedDrivers": "驱动文件", - "infFilename": "INF 文件", - "deviceId": "设备 ID", - "pnpDeviceId": "PNP ID", - "resolution": "分辨率", - "refreshRate": "刷新率", - "status": "状态", - "diskType": "类型", - "interfaceType": "接口", - "serialNumber": "序列号", - "firmware": "固件版本", - "memoryType": "内存类型", - "formFactor": "外形规格", - "guid": "GUID", - "maxSpeed": "最大速率", - "biosVendor": "BIOS 厂商", - "biosVersion": "BIOS 版本", - "biosReleaseDate": "BIOS 日期", - "systemManufacturer": "系统制造商", - "systemModel": "系统型号", - "systemType": "系统类型", - "chassisType": "机箱类型", - "version": "版本", - "noDetail": "暂无详细信息" - }, - "tools": { - "title": "工具", - "subtitle": "工具箱", - "description": "提供各种实用工具,帮助您更好地管理和优化系统。", - "all": "全部", - "hardware": "硬件", - "assistant": "辅助", - "network": "网络", - "optimization": "优化", - "builtinTools": "内置工具", - "hardwareModel": { - "loading": "加载硬件信息...", - "unknown": "无法获取硬件信息" - }, - "thirdpartyTools": "第三方工具", - "officialTools": "官方推荐", - "recommended": "推荐", - "tools": { - "assistantCrosshair": "辅助准心", - "memreduct": "Memreduct", - "windowsCoreOptimizer": "Windows大小核优化", - "windows-core-optimizer": "Windows大小核优化", - "optimizer": "Optimizer", - "cpu-z": "CPU-Z", - "gpu-z": "GPU-Z", - "processLasso": "Process Lasso", - "process-lasso": "Process Lasso", - "fxsound": "FxSound", - "msi-afterburner": "MSI Afterburner", - "geek": "Geek", - "gamepp": "GamePP", - "huorong": "火绒安全" - }, - "mctierDesc": "虚拟局域网通用组网工具", - "sjmclDesc": "上海交通大学开发的第三方我的世界启动器", - "ddegameDesc": "游戏不仅仅是游戏,游戏可以走进生活改变生活", - "huorongDesc": "畅享纯粹终端防护。轻快运行,静享守护,全面防御", - "steamDesc": "全球最大的综合性数字游戏发行平台", - "epicGamesDesc": "知名虚幻引擎开发商打造的跨平台游戏商城", - "nvidiaAppDesc": "NVIDIA 官方驱动与应用管理工具", - "pcl2Desc": "开源、强大的我的世界启动器", - "obsDesc": "免费开源的视频录制和直播推流软件", - "descriptions": { - "assistantCrosshair": "游戏屏幕准心辅助工具", - "memreduct": "内存清理工具", - "windowsCoreOptimizer": "仅对有大小核心的CPU有效", - "windows-core-optimizer": "仅对有大小核心的CPU有效", - "optimizer": "Windows系统优化工具", - "cpu-z": "CPU信息检测工具", - "gpu-z": "显卡信息检测工具", - "processLasso": "系统进程优化工具", - "process-lasso": "系统进程优化工具", - "fxsound": "音频增强工具", - "msi-afterburner": "显卡超频监控工具", - "geek": "软件卸载清理工具", - "gamepp": "游戏加速优化工具", - "huorong": "畅享纯粹终端防护。轻快运行,静享守护,全面防御" - }, - "status": { - "available": "可用", - "comingSoon": "开发中", - "installed": "已安装", - "notInstalled": "未安装", - "downloading": "下载中", - "scanning": "扫描中..." - }, - "buttons": { - "openTool": "打开工具", - "comingSoon": "即将推出", - "download": "点击下载", - "run": "点击运行", - "website": "前往官网" - }, - "messages": { - "installerStarted": "安装程序已启动", - "installerStartedDesc": "请完成安装后,工具将自动显示为可用状态", - "installComplete": "安装完成", - "installCompleteDesc": "工具已成功安装,点击即可运行", - "installerStartedAlt": "安装程序已启动", - "installerStartedDescAlt": "请完成安装,系统将自动检测安装状态", - "downloadComplete": "下载完成", - "downloadCompleteDesc": "工具已就绪,点击即可运行", - "downloadFailed": "下载失败", - "runFailed": "运行失败" - }, - "ariaLabels": { - "refreshToolList": "刷新工具列表" - }, - "customAdded": { - "add": "手动添加工具", - "remove": "删除手动添加", - "addSuccess": "已添加工具", - "addFailed": "添加失败", - "removed": "已删除手动添加" - } - }, - "displayFilter": { - "title": "显示器滤镜", - "enable": "启用滤镜", - "presets": "预设模式", - "currentSettings": "当前设置", - "colorTemperature": "色温", - "brightness": "亮度", - "contrast": "对比度", - "saturation": "饱和度", - "resetDefault": "恢复默认", - "resetSuccess": "已恢复默认设置", - "filterEnabled": "滤镜已启用", - "filterDisabled": "滤镜已禁用", - "presetAppliedPrefix": "已应用 ", - "presetAppliedSuffix": " 预设", - "error": "操作失败", - "custom": "自定义", - "customDescription": "自定义滤镜参数", - "tip": "滤镜通过调整显示器 Gamma 曲线实现色彩效果,退出应用时自动恢复默认设置。", - "customFilter": "自定义滤镜", - "saveSuccess": "设置已保存并应用", - "saveAndApply": "保存并应用", - "iccProfiles": "ICC 色彩配置文件", - "importIcc": "导入 ICC 文件", - "importIccSuccess": "ICC 文件已导入", - "importIccFailed": "ICC 文件导入失败", - "iccApplied": "ICC 色彩配置已应用", - "deleteIcc": "删除", - "deleteIccConfirm": "确认删除此 ICC 预设?", - "deleteIccSuccess": "ICC 预设已删除", - "noIccProfiles": "暂无导入的 ICC 配置文件", - "selectDisplay": "选择显示器", - "primary": "主", - "cancel": "取消", - "delete": "删除", - "exportIcc": "导出为 ICC 文件", - "exportIccSuccess": "ICC 文件已导出", - "exportIccFailed": "ICC 文件导出失败", - "previewTitle": "滤镜预览", - "previewOriginal": "原始", - "previewFiltered": "滤镜", - "previewDisabledNote": "滤镜未启用 · 仅预览效果", - "paramsUpdated": "参数已更新", - "paramsUpdatedHint": "请手动开启滤镜开关以生效", - "rgbGamma": "RGB 通道伽马", - "rGamma": "红色", - "gGamma": "绿色", - "bGamma": "蓝色", - "myPresets": "我的滤镜预设", - "noPresets": "还没有自定义预设\n调整参数后点击「另存为预设」保存", - "saveAsPreset": "另存为预设", - "presetNamePlaceholder": "输入预设名称...", - "savePresetSuccess": "预设已保存", - "deletePreset": "删除预设", - "deletePresetConfirm": "确定删除此预设?", - "deletePresetSuccess": "预设已删除", - "save": "保存" - }, - "floatingNav": { - "title": "悬浮导航框", - "enable": "启用悬浮框", - "settings": "设置", - "displayText": "显示文本", - "width": "宽度", - "height": "高度", - "opacity": "透明度", - "applySettings": "应用设置", - "preview": "预览", - "previewNote": "预览效果(实际悬浮框位于显示器顶部中央)", - "enabled": "悬浮导航已启用", - "disabled": "悬浮导航已关闭", - "settingsApplied": "设置已应用", - "error": "操作失败", - "tip": "悬浮导航框会在显示器顶部中央显示,始终保持在所有窗口最上层。可以通过调整透明度来控制其对其他应用的影响程度。", - "displayContent": "显示内容", - "cpuUsage": "CPU占用", - "gpuTemp": "GPU温度", - "gpuUsage": "GPU占用" - }, - "crosshair": { - "title": "辅助准心", - "enableCrosshair": "启用准心", - "statusEnabled": "已启用", - "statusDisabled": "已关闭", - "style": "准心样式", - "color": "颜色", - "customColor": "自定义颜色", - "size": "大小", - "thickness": "粗细", - "gap": "间隙", - "dotSize": "中心点大小", - "opacity": "透明度", - "parameters": "参数调整", - "preview": "预览", - "monitor": "显示器选择", - "primaryMonitor": "主显示器", - "advanced": "高级设置", - "resetDefault": "恢复默认", - "updateFailed": "更新设置失败", - "toggleFailed": "切换准心失败", - "renderMode": "渲染模式", - "procedural": "预设准心", - "customImage": "自定义图片", - "selectImage": "选择图片", - "styles": { - "cross": "十字", - "dot": "点", - "circle": "圆形", - "crossDot": "十字+点", - "circleCross": "圆形+十字" - } - }, - "hardwareReport": { - "export": "导出报告", - "selectPath": "选择导出位置", - "exporting": "正在生成报告...", - "exportSuccess": "报告导出成功", - "exportFailed": "导出失败", - "recorderNotStarted": "记录器未启动,请稍后重试" - }, - "overlayPanel": { - "title": "悬浮框", - "enableOverlay": "启用悬浮框", - "statusEnabled": "已启用", - "statusDisabled": "已关闭", - "displayItems": "显示项", - "hardwareMonitor": "硬件监控", - "cpuUsage": "CPU占用", - "gpuTemp": "GPU温度", - "gpuUsage": "GPU占用", - "memoryUsage": "内存占用", - "deltaPassword": "三角洲密码", - "gamePing": "游戏延迟", - "pingSettings": "延迟测试", - "pingDescription": "选择一个服务器来测量网络延迟,延迟数据将显示在悬浮框中", - "testPing": "测试延迟", - "pingCurrentValue": "当前延迟", - "custom": "自定义", - "customText": "自定义文字", - "color": "颜色", - "addCustomItem": "添加自定义项", - "appearance": "外观设置", - "styles": "悬浮框样式", - "styles.default": "默认", - "styles.dynamicIsland": "灵动岛", - "styles.verticalPanel": "竖排面板", - "fontColor": "字体颜色", - "opacity": "透明度", - "startFailed": "启动失败", - "stopFailed": "停止失败", - "hotkey": "快捷键", - "toggleHotkey": "切换悬浮框", - "hotkeySaved": "快捷键已保存", - "minOneItem": "至少需要保留一个显示项", - "position": "位置设置", - "dragMode": "拖动悬浮框", - "dragModeHint": "点击进入拖动模式,拖动后点击按钮退出并保存位置", - "dragModeStart": "开始拖动", - "dragModeActive": "退出拖动", - "dragModeEnabled": "已进入拖动模式,拖动后点击按钮退出", - "dragModeDisabled": "已退出拖动模式", - "dragModeFailed": "切换拖动模式失败", - "overlayNotEnabled": "请先启用悬浮框", - "positionSaved": "位置已保存", - "resetPosition": "恢复默认", - "positionReset": "位置已恢复默认", - "positionResetFailed": "重置位置失败" - }, - "deltaForce": { - "title": "三角洲专区", - "dailyPassword": "每日密码", - "weaponCodes": "改枪码", - "weaponCodeDesc": "选择改枪码平台,在新窗口中浏览和复制改枪码", - "weaponCodePlatforms": "改枪码平台", - "openPlatform": "打开平台", - "officialMaps": "官方地图", - "openOfficialMap": "三角洲行动官方地图工具", - "mapToolDesc": "物资点、出生点、撤离点及首领坐标", - "dlssPreset": "DLSS预设", - "dlssPresetDesc": "选择DLSS神经网络模型预设,不同预设适用于不同场景", - "loading": "加载中...", - "noPassword": "暂无密码数据", - "copy": "复制", - "copied": "已复制", - "copySuccess": "已复制到剪贴板", - "copyFailed": "复制失败", - "all": "全部", - "recommended": "推荐", - "currentSelection": "当前选择", - "applyPreset": "应用预设", - "dlssNote": "需要NVIDIA Profile Inspector支持,应用后重启游戏生效", - "back": "返回", - "dlssModels": { - "A": { "name": "A模型", "description": "早期模型" }, - "B": { "name": "B模型", "description": "早期模型" }, - "C": { "name": "C模型", "description": "早期模型" }, - "D": { "name": "D模型", "description": "稳定模型" }, - "E": { "name": "E模型", "description": "实验性模型" }, - "F": { "name": "F模型", "description": "改进模型" }, - "G": { "name": "G模型", "description": "改进模型" }, - "J": { "name": "J模型", "description": "较新模型,画质优先" }, - "K": { "name": "K模型", "description": "推荐模型,大多数DLSS模式" }, - "L": { "name": "L模型", "description": "优化Ultra Performance模式" }, - "M": { "name": "M模型", "description": "优化Performance模式" } - }, - "weaponCodePlatformNames": { - "maqt": "码枪堂", - "anchor-codes": "主播改枪码", - "xiaotao-check": "小涛查", - "delta-workshop": "三角洲工坊" - }, - "officialMapToolTitle": "三角洲行动 - 官方地图工具", - "officialWallpaper": "官方壁纸", - "officialWallpaperTitle": "三角洲行动 - 官方壁纸", - "wallpaperDesc": "官方高清壁纸下载", - "allCategories": "全部", - "searchPlaceholder": "搜索武器...", - "allWeapons": "全部武器", - "noLoadouts": "暂无改枪码", - "noLoadoutsHint": "换个筛选条件试试", - "previousPage": "上一页", - "pageInfo": "{{page}} / {{totalPages}}", - "nextPage": "下一页", - "upload": "上传改枪码", - "category": "分类", - "weaponName": "武器名称", - "selectWeapon": "请选择武器", - "code": "改枪码", - "codePlaceholder": "请输入改枪码,最多500字符", - "description": "描述", - "descriptionPlaceholder": "请输入描述(可选)", - "cost": "改枪费用", - "author": "作者", - "nicknamePlaceholder": "输入昵称(可选)", - "cancel": "取消", - "submit": "提交审核", - "report": "无法使用?", - "reported": "已报告管理员", - "uploadSuccess": "上传成功", - "uploadQueueHint": "你的改枪码已进入审核队列,通过后即可显示", - "uploadFailed": "上传失败", - "otherPlatformsCard": { - "title": "其他改枪码平台", - "description": "探索更多改枪码平台" - }, - "viewMore": "查看更多", - "moreGunCodes": "更多改枪码", - "moreGunCodesDesc": "探索更多改枪码平台", - "openFailed": "打开失败", - "otherPlatforms": { - "title": "其他改枪码平台", - "description": "以下是一些其他改枪码平台,点击在新窗口中打开", - "maqt": { - "name": "码枪堂", - "description": "码枪堂改枪码平台" - }, - "anxu": { - "name": "ANXU改枪码", - "description": "ANXU改枪码平台" - }, - "aitags": { - "name": "主播改枪码", - "description": "主播改枪码平台" - }, - "xiaotao": { - "name": "小涛查", - "description": "小涛查改枪码平台" - } - } - }, - "dlssPreset": { - "title": "三角洲DLSS设置", - "description": "切换DLSS神经网络模型预设以优化游戏画质", - "presetLabel": "DLSS 预设", - "driverVersion": "驱动版本", - "noGpuFound": "未检测到显卡" - }, - "dlssQuality": { - "label": "DLSS 质量级别", - "default": { - "name": "默认", - "description": "由游戏自行决定,不做强制覆盖" - }, - "ultraPerformance": { - "name": "超高性能", - "description": "约 33% 渲染分辨率,帧率最大化" - }, - "performance": { - "name": "性能", - "description": "50% 渲染分辨率,高帧率优先" - }, - "balanced": { - "name": "平衡", - "description": "约 58% 渲染分辨率,兼顾画质与性能" - }, - "quality": { - "name": "质量", - "description": "约 67% 渲染分辨率,画质优先" - }, - "dlaa": { - "name": "DLAA", - "description": "100% 渲染分辨率 + AI 抗锯齿" - } - }, - "dlssIndicator": { - "title": "DLSS 指示器", - "description": "在画面左下角显示 DLSS 标识", - "enabled": "DLSS 指示器已启用", - "disabled": "DLSS 指示器已关闭", - "enabling": "正在开启...", - "disabling": "正在关闭...", - "note": "需要管理员权限,重启游戏后生效" - }, - "dlssLock": { - "title": "DLSS 锁定", - "description": "锁定 nvidiaProfileInspector 驱动配置", - "enabled": "DLSS 配置已锁定", - "disabled": "DLSS 配置已解锁", - "note": "锁定后防止驱动更新覆盖设置" - }, - "dlssPresetTable": { - "title": "预设参考表", - "description": "不同显卡系列推荐的 DLSS 预设配置", - "gpuSeries": "显卡", - "recommendedPreset": "预設", - "driverVersion": "驱动", - "scenario": "类型", - "rtx20Series": "RTX 20 系列", - "rtx30Series": "RTX 30 系列", - "rtx4060Ti": "RTX 4060 Ti", - "rtx50HighFps": "RTX 50 高帧", - "rtx50HighQuality": "RTX 50 高画质", - "presetK": "K", - "presetM": "M", - "typeGeneralEnhance": "通用增强", - "typePerformanceFirst": "性能优先", - "typeQualityEnhance": "画质增强", - "typeFpsPriority": "帧率优先" - }, - "musicPlayer": { - "title": "鼠鼠音乐", - "play": "播放", - "pause": "暂停", - "previous": "上一首", - "next": "下一首", - "modeList": "列表循环", - "modeShuffle": "随机播放", - "modeOne": "单曲循环", - "mute": "静音", - "unmute": "取消静音", - "playlist": "播放列表", - "noTrack": "未选择歌曲", - "empty": "暂无音乐文件,请将 MP3 文件放入", - "minimize": "最小化" - }, - "mood": { - "title": "心境", - "connecting": "正在连接到 www.nexbox.top/love ..." - }, - "builtinTools": { - "title": "内置工具", - "back": "返回", - "displayFilterDesc": "调整显示器色彩滤镜", - "crosshairDesc": "游戏屏幕准心辅助工具", - "overlayPanelDesc": "显示系统硬件状态的悬浮框", - "gpuRenameDesc": "改写显卡名称以优化游戏性能", - "resolutionConverterDesc": "管理显示器分辨率与画面比例", - "shaderCacheDesc": "强制清理 NVIDIA/AMD 着色器缓存释放磁盘空间", - "dlssPresetDesc": "切换DLSS模型预设以优化游戏画质", - "nvidiaDriverDesc": "通过 NVAPI 直接控制 NVIDIA 驱动图形设置", - "diskHealthDesc": "检测硬盘健康状态与SMART信息", -"screenRecordDesc": "高性能屏幕录制(硬件编码)", - "audioEqDesc": "系统级音频均衡器调音", - "resolutionManagement": "显示器分辨率管理", - "selectDisplay": "选择显示器", - "selectResolution": "选择分辨率", - "applyResolution": "应用分辨率", - "resolutionApplied": "分辨率已应用" - }, - "gpuRename": { - "title": "显卡改写", - "loading": "加载中...", - "loadError": "加载失败", - "currentGpu": "当前显卡", - "originalGpu": "原始显卡", - "backupStatus": "备份状态", - "backedUp": "已备份", - "notBackedUp": "未备份", - "selectTarget": "选择目标显卡", - "lowEnd": "低端显卡", - "highEnd": "高端显卡", - "selectPlaceholder": "请选择显卡", - "presetTab": "预设显卡", - "customTab": "自定义显卡", - "customPlaceholder": "输入自定义显卡名称", - "selectGpu": "请先选择显卡", - "apply": "应用", - "applying": "应用中...", - "restore": "恢复", - "restoring": "恢复中...", - "success": "操作成功", - "restored": "已恢复", - "error": "操作失败", - "note": "⚠️ 重要提示:\n1. 需要管理员权限才能修改注册表\n2. 修改后需要重启游戏或电脑才能生效\n3. 此功能仅支持 Windows 系统和 NVIDIA 显卡\n4. 如果无法应用,请尝试以管理员身份运行应用" - }, - "settings": { - "general": "通用", - "appearance": "外观", - "hotkeys": "热键", - "network": "网络", - "sponsor": "赞助", - "navigation": "导航栏", - "about": "关于", - "generalSettings": { - "title": "通用设置", - "language": "语言", - "languageLabel": "语言 (Language)", - "languages": { - "zh": "简体中文", - "zh-TW": "繁體中文", - "en": "English", - "fr": "Français", - "ja": "日本語", - "de": "Deutsch" - }, - "homepage": "主页", - "todayPopularityLabel": "今日人气", - "todayPopularityDesc": "在主页显示今日人气随机数", - "announcementLabel": "公告", - "announcementDesc": "在主页显示公告卡片", - "randomQuoteLabel": "随机一言", - "randomQuoteDesc": "在主页显示随机一言卡片", - "gameLauncherLabel": "快捷启动", - "gameLauncherDesc": "在主页显示快捷启动卡片", - "homeHardwareModelLabel": "硬件型号", - "homeHardwareModelDesc": "在主页显示 CPU/GPU/内存/主板/硬盘的型号摘要", - "searchBarLabel": "搜索框", - "searchBarDesc": "在标题栏显示全局搜索框", - "feedbackLabel": "图片轮播", - "feedbackDesc": "在首页显示图片轮播", - "splash": "动画", - "splashLogoLabel": "启动动画 Logo", - "splashLogoDesc": "自定义启动动画中显示的 Logo 图片", - "splashLogoReset": "恢复默认", - "features": "功能", - "advanced": "高级", - "discoveryPage": "发现页", - "discoveryPageDesc": "更改实例页左侧导航栏是否显示、分组方式", - "navMode": "实例页导航栏模式", - "navModeDesc": "更改实例页左侧导航栏是否显示、分组方式", - "quickSwitch": "快捷切换实例与账户", - "quickSwitchDesc": "启用后,点击启动页的切换按钮可直接选择账户或实例,而无需跳转页面", - "resourceTranslation": "显示资源翻译", - "resourceTranslationDesc": "启用后,在资源下载界面尝试显示名称或描述的简体中文翻译", - "autoLanguage": "自动设置实例语言", - "autoLanguageDesc": "启用后,新建实例的语言将自动设置为简体中文,这将同时跳过辅助功能设置", - "navModes": { - "byInstance": "按实例", - "byGroup": "按分组" - }, - "startup": "启动", - "autoStartLabel": "开机自启", - "autoStartDesc": "系统启动时自动运行 NexBox", - "closeBehavior": "关闭行为", - "closeBehaviorLabel": "点击关闭按钮时", - "closeBehaviorDesc": "选择点击关闭按钮时的行为", - "closeDirectly": "直接关闭", - "minimizeToTray": "最小化到托盘", - "navPositionLabel": "导航栏位置", - "navPositionDesc": "选择导航栏显示在侧边还是顶部", - "navPositionLeft": "侧边", - "navPositionTop": "顶部", - "sidebarShowLabel": "导航栏标签", - "sidebarShowLabelDesc": "选择导航栏的显示模式", - "sidebarShowLabelNoText": "无字", - "sidebarShowLabelWithText": "有字", - "navButtonVisibility": "导航栏按钮显示", - "navButtonVisibilityDesc": "控制导航栏中每个按钮的显示和隐藏,设置项始终可见", - "pageTransitionLabel": "页面切换动画", - "pageTransitionDesc": "关闭后页面切换将不再有过渡动画", - "pageTransitionSlide": "滑动", - "pageTransitionFade": "淡化", - "pageTransitionOff": "关闭" - }, - "appearanceSettings": { - "title": "外观设置", - "theme": "主题", - "themeStyle": "主题样式", - "themeStyles": { - "light": "浅色", - "dark": "深色" - }, - "font": "字体", - "fontLabel": "界面字体", - "fontDesc": "选择应用界面字体,默认为 Sinter", - "importCustomFontLabel": "导入自定义字体", - "importCustomFontDesc": "支持 TTF / OTF / WOFF 格式字体文件", - "importFontButton": "导入字体", - "importingFont": "导入中...", - "removeFont": "删除字体", - "duplicateFont": "该字体已存在", - "importFontFailed": "导入字体失败", - "liquidGlass": "液态玻璃", - "liquidGlassLabel": "液态玻璃", - "liquidGlassDesc": "启用后,部分界面将使用「液态玻璃」效果,这可能会影响性能", - "liquidGlassBlurLabel": "模糊程度", - "liquidGlassModeLabel": "玻璃模式", - "liquidGlassModeNormal": "普通液态玻璃", - "liquidGlassModeReal": "真实液态玻璃", - "liquidGlassModeNormalDesc": "使用模糊和透明度模拟玻璃质感,可调节模糊程度", - "liquidGlassModeRealDesc": "使用 SVG 折射滤镜实现边缘折射和色差效果,更真实但需要更多 GPU 开销", - "jellyBounce": "果冻弹跳", - "jellyBounceLabel": "果冻弹跳效果", - "jellyBounceDesc": "启用后,所有卡片、菜单和导航栏在交互与状态切换时会有弹性缩放动画", - "customBackground": "自定义背景", - "customBackgroundLabel": "启用自定义背景", - "imageUrlPlaceholder": "输入图片URL或点击上传", - "maxImagesReached": "最多只能添加3张背景图片", - "presetBackground": "预设背景", - "carouselLabel": "自动轮播", - "carouselDesc": "每10秒自动切换预设壁纸", - "imageBackground": "图片背景", - "dynamicBackground": "动态背景", - "dynamicBackgroundDesc": "启用后将显示动态背景效果", - "uploadVideo": "上传视频", - "unsupportedVideoFormat": "不支持的视频格式,请使用 mp4 或 webm 文件", - "themeColor": "主题色", - "themeColorLabel": "自定义主题色", - "themeColorDesc": "设置导航栏、按钮、菜单等元素的主题颜色", - "presets": "预设颜色", - "customColor": "自定义颜色", - "advancedSettings": "高级设置", - "hoverOpacity": "悬停透明度", - "activeOpacity": "激活透明度", - "borderOpacity": "边框透明度", - "backgroundBlurLabel": "背景模糊", - "backgroundBlurHint": "对所有背景模式生效(预设 / 图片 / 视频)", - "resetToDefault": "恢复默认", - "presetColors": { - "cyan": "青色", - "blue": "蓝色", - "purple": "紫色", - "pink": "粉色", - "orange": "橙色", - "green": "绿色", - "red": "红色", - "yellow": "黄色" - } - }, - "networkSettings": { - "title": "网络延迟测试", - "description": "测试到国内各服务器的网络延迟", - "testButton": "测试", - "testing": "测试中...", - "testingAll": "全部测试中...", - "testAll": "全部测试", - "latency": "延迟", - "timeout": "超时", - "unreachable": "不可达", - "servers": { - "baidu": "百度", - "gitee": "Gitee", - "github": "GitHub", - "qq": "腾讯", - "aliyun": "阿里云", - "wangyi": "网易", - "bilibili": "B站", - "douyin": "抖音", - "jd": "京东", - "zhihu": "知乎" - }, - "customServers": "自定义服务器", - "addServer": "添加", - "customServerPlaceholder": "输入服务器地址,如 example.com", - "remove": "删除" - }, - "sponsorSettings": { - "title": "支持开发者", - "description": "如果您觉得 NexBox 对您有帮助,欢迎请作者喝杯咖啡 ☕", - "wechat": "微信支付", - "alipay": "支付宝", - "thankYou": "感谢您的支持!", - "placeholder": "请添加收款码图片", - "sponsorList": { - "title": "赞助者名单", - "loading": "加载中...", - "error": "加载失败", - "empty": "暂无赞助者" - } - }, - "aboutSettings": { - "title": "关于", - "version": "版本", - "author": "作者", - "newVersion": "发现新版本", - "check": "检查", - "noUpdate": "已是最新版本", - "checkFailed": "检查更新失败", - "downloadFailed": "下载失败", - "installFailed": "安装失败", - "acknowledgments": "致谢", - "sjmcLauncher": "SJMC Launcher", - "sjmcLauncherDesc": "感谢上海交通大学Minecraft社开源项目", - "joinUs": "加入我们", - "changelog": "更新日志", - "changelogTitle": "当前版本更新内容", - "noChangelog": "暂无更新日志", - "loadingChangelog": "加载中...", - "updateModal": { - "title": "发现新版本", - "version": "版本", - "releaseNotes": "更新说明", - "downloading": "下载中...", - "downloadComplete": "下载完成,请选择操作", - "cancel": "取消", - "download": "下载", - "restartInstall": "重启安装", - "skip": "暂不" - } - } - }, - "resolutionConverter": { - "title": "分辨率管理", - "selectResolution": "选择分辨率", - "resolution1K": "1K (1080p)", - "resolution1_5K": "1.5K", - "resolution2K": "2K (1440p)", - "resolution2_5K": "2.5K", - "resolution3K": "3K", - "resolution4K": "4K (2160p)", - "aspectRatios": "画面比例", - "ratio169": "16:9", - "ratio43": "4:3", - "ratio1610": "16:10", - "width": "宽", - "height": "高", - "pixels": "像素", - "standard": "标准", - "tip": "选择分辨率类型后,下方将显示三种常见画面比例的具体分辨率值,方便您在游戏中调整画面比例设置。", - "noModes": "无法获取可用分辨率列表", - "applying": "应用分辨率...", - "loadModesFailed": "加载分辨率失败", - "resolutionApplied": "分辨率已应用", - "applyFailed": "应用分辨率失败", - "applyCustom": "应用此分辨率", - "selectDisplayFirst": "请先在下方选择显示器" - }, - "systemOptimizer": { - "pageTitle": "系统优化", - "pageDesc": "一键开关系统各项优化,提升性能与隐私保护", - "credits": "感谢 1U 工具箱提供系统优化支持", - "loading": "加载中...", - "category": { - "gaming": "游戏与图形优化", - "nvidia": "NVIDIA 显卡优化", - "amd": "AMD 显卡优化", - "performance": "系统性能调优", - "privacy": "隐私与遥测", - "services": "系统服务精简", - "disk": "磁盘与文件系统", - "apps": "应用与界面" - }, - "gaming": { - "mmcssGameConfig": "MMCSS 完整游戏配置", - "mmcssGameConfigDesc": "设置游戏任务最高优先级、GPU 优先级 8、禁用懒模式", - "gamePriority": "优先考虑游戏责任", - "gamePriorityDesc": "提升 MMCSS Games 任务优先级,确保游戏获得更多 CPU 资源", - "networkSRResponse": "改进网络和 SR 响应能力", - "networkSRResponseDesc": "禁用网络节流、SystemResponsiveness 设为 0", - "directXAutoHDR": "启用 DirectX AutoHDR", - "directXAutoHDRDesc": "启用 DirectX 自动高动态范围,提升画面质量", - "directXFlipModel": "启用 DirectX Flip Model", - "directXFlipModelDesc": "强制 Flip Model 呈现,减少帧延迟", - "directXVRR": "启用 DirectX VRR 优化", - "directXVRRDesc": "启用可变刷新率优化,减少画面撕裂", - "disableDXMaxWindow": "禁用 DX 最大化窗口模式", - "disableDXMaxWindowDesc": "全局禁用最大化窗口模式,避免 DWM 延迟", - "disableGPUPreemption": "禁用 GPU 抢占", - "disableGPUPreemptionDesc": "禁用 GPU 抢占,降低输入延迟", - "disableGameBar": "禁用 GameBar 提示", - "disableGameBarDesc": "禁用 GameBar 控制器快捷键和启动面板", - "disableGameDVR": "禁用 Game DVR", - "disableGameDVRDesc": "禁用 Game DVR 后台录制,释放系统资源", - "disableBcastDVR": "禁用广播 DVR 服务", - "disableBcastDVRDesc": "禁用 BcastDVRUserService 服务", - "disableAutoColorMgmt": "关闭自动色彩管理", - "disableAutoColorMgmtDesc": "关闭 DirectX 自动色彩管理,减少 GPU 开销" - }, - "nvidia": { - "lowLatencyThreshold": "NVIDIA 低延迟阈值优化", - "lowLatencyThresholdDesc": "调整 GPU 调度器各项延迟阈值到最低值,减少输入延迟", - "perCpuDPC": "启用 NVIDIA Per-CPU DPC", - "perCpuDCPDesc": "GPU 中断分散到多核处理,降低单核延迟", - "imageSharpening": "启用 NVIDIA 锐化", - "imageSharpeningDesc": "启用 Image Sharpening 全局锐化,提升画面清晰度", - "disableGpuPowerMgmt": "禁用 NVIDIA GPU 电源管理", - "disableGpuPowerMgmtDesc": "关闭运行时电源管理和 ASPM,保持最高性能", - "disableHDCP": "禁用 NVIDIA HDCP", - "disableHDCPDesc": "禁用 HDCP 握手开销,降低显示延迟", - "disableWriteCombining": "禁用 NVIDIA 写合并", - "disableWriteCombiningDesc": "关闭 Write Combining,降低 GPU 延迟", - "disableClockGating": "禁用 NVIDIA 时钟门控", - "disableClockGatingDesc": "禁用 BLCG/ELCG/ELPG/FSPG/SLCG,防止降频", - "disableTelemetry": "禁用 NVIDIA 遥测", - "disableTelemetryDesc": "禁用 GeForce Experience 遥测数据收集", - "disableDriverLog": "禁用 NVIDIA 驱动日志", - "disableDriverLogDesc": "关闭驱动内部日志,减少不必要开销", - "lockPState0": "锁定 NVIDIA P-State 0", - "lockPState0Desc": "锁定最高性能状态,防止 GPU 降频", - "disableMiracastOverlay": "禁用 Miracast 和 Overlay", - "disableMiracastOverlayDesc": "禁用 Miracast 投屏和驱动叠加层" - }, - "amd": { - "shaderCache": "强制启用 AMD Shader Cache", - "shaderCacheDesc": "强制开启着色器缓存,减少游戏卡顿" - }, - "performance": { - "intelTSX": "启用 Intel TSX", - "intelTSXDesc": "启用事务性同步扩展,提升多线程性能(仅 Intel)", - "mergeSvcHost": "合并 ServiceHost 进程", - "mergeSvcHostDesc": "增大拆分阈值,减少 svchost 进程数", - "shortenTaskTimeout": "缩短任务超时", - "shortenTaskTimeoutDesc": "HungAppTimeout=1000, WaitToKillApp=2000", - "shortenServiceTimeout": "缩短服务超时", - "shortenServiceTimeoutDesc": "WaitToKillServiceTimeout=2000,加速关机", - "mouseHoverDelay": "鼠标悬停延迟优化", - "mouseHoverDelayDesc": "MouseHoverTime 从 400ms 降到 10ms", - "disableStartupDelay": "禁用启动延迟", - "disableStartupDelayDesc": "StartupDelayInMSec=0,开机立即可用", - "disablePowerSaving": "禁用省电模式", - "disablePowerSavingDesc": "禁用 PowerThrottling 和休眠(不建议笔记本使用)", - "nvmeTuning": "NVMe 调优", - "nvmeTuningDesc": "连续内存分配、禁用日志和空闲节能" - }, - "privacy": { - "disableTelemetrySvc": "禁用遥测服务", - "disableTelemetrySvcDesc": "禁用 DiagTrack 和 dmwappushservice 服务", - "disableCEIP": "禁用 CEIP-SQM", - "disableCEIPDesc": "禁用客户体验改善计划", - "disableDotNetTelemetry": "禁用 DotNet 遥测", - "disableDotNetTelemetryDesc": "DOTNET_CLI_TELEMETRY_OPTOUT=1", - "disableAppImpactTelemetry": "禁用应用影响遥测", - "disableAppImpactTelemetryDesc": "禁用 AITEnable 策略", - "disableAppImpactTelemetryAgent": "禁用应用影响遥测代理", - "disableAppImpactTelemetryAgentDesc": "禁用 AIT 代理", - "disableLicenseTelemetry": "禁用许可遥测", - "disableLicenseTelemetryDesc": "NoGenTicket=1,停止许可遥测", - "disableScheduledDiag": "禁用计划诊断", - "disableScheduledDiagDesc": "禁用计划诊断执行", - "disableWebcamTelemetry": "禁用网络摄像头遥测", - "disableWebcamTelemetryDesc": "webcam ConsentStore=Deny", - "disableWritingFeedback": "禁用写入反馈", - "disableWritingFeedbackDesc": "禁用手写输入反馈收集", - "disableErrorReporting": "禁用 Windows 错误报告", - "disableErrorReportingDesc": "禁用 WER,停止错误数据上传" - }, - "services": { - "disableSensorSvc": "禁用传感器服务", - "disableSensorSvcDesc": "禁用 SensrSvc 和 SensorDataService", - "disableFaxSvc": "禁用传真服务", - "disableFaxSvcDesc": "禁用 Fax 服务", - "disablePrintSvc": "禁用打印服务", - "disablePrintSvcDesc": "禁用打印后台处理程序 Spooler", - "disableMapsBroker": "禁用下载地图管理器", - "disableMapsBrokerDesc": "禁用 MapsBroker 服务", - "disableUCPD": "禁用 UCPD", - "disableUCPDDesc": "禁用 User Choice Protection Driver", - "disableDCOM": "禁用 DCOM", - "disableDCOMDesc": "禁用分布式组件对象模型", - "disableStorageSense": "禁用 StorageSense", - "disableStorageSenseDesc": "禁用存储感知自动清理", - "disableAutoMaintenance": "禁用自动维护", - "disableAutoMaintenanceDesc": "MaintenanceDisabled=1", - "disableAppCompat": "禁用应用程序兼容性", - "disableAppCompatDesc": "禁用兼容性引擎和 PCA", - "disableStepRecorder": "禁用步骤记录器", - "disableStepRecorderDesc": "DisableUAR=1", - "disablePerfTips": "禁用性能提醒", - "disablePerfTipsDesc": "禁用性能改进建议" - }, - "disk": { - "disable8dot3": "禁用 8.3 文件名", - "disable8dot3Desc": "NtfsDisable8dot3NameCreation=1,减少磁盘开销", - "disableNtfsEncryption": "禁用 NTFS 加密", - "disableNtfsEncryptionDesc": "NtfsDisableEncryption=1", - "disableLastAccess": "禁用最后访问更新", - "disableLastAccessDesc": "NtfsDisableLastAccessUpdate,减少磁盘写入", - "disableReservedStorage": "禁用更新保留存储", - "disableReservedStorageDesc": "释放约 7GB 保留空间", - "disableFullFsSearch": "禁用搜索全文件系统", - "disableFullFsSearchDesc": "仅搜索索引位置,减少磁盘扫描" - }, - "apps": { - "disableBackgroundApps": "禁用后台应用", - "disableBackgroundAppsDesc": "GlobalUserDisabled=1", - "disableEdgeStartupBoost": "禁用 Edge 启动加速", - "disableEdgeStartupBoostDesc": "禁用 Edge 预启动和后台运行", - "slimEdgeAds": "精简 Edge 广告推荐", - "slimEdgeAdsDesc": "禁用侧边栏、广告、购物助手等", - "disableSearchWebView2": "禁用搜索 WebView2", - "disableSearchWebView2Desc": "禁用 Search WebView2 渲染" - }, - "batchEnable": "全部优化", - "batchDisable": "全部恢复", - "batchOptimized": "全部优化已执行完成", - "batchReverted": "全部优化已恢复", - "batchError": "批量操作执行失败", - "optimized": "已优化", - "reverted": "已恢复", - "optimizing": "执行中...", - "operationError": "操作执行失败", - "requiresReboot": "需要重启系统才能完全生效" - }, - "windowsUpdate": { - "pageTitle": "关闭 Windows 更新", - "pageDesc": "完全关闭 Windows 自动更新,包括服务、组策略和定时任务(可恢复)", - "servicesStatus": "更新服务状态", - "servicesDisabled": "已禁用", - "servicesRunning": "运行中", - "policyStatus": "组策略状态", - "policyConfigured": "已配置", - "policyNotConfigured": "未配置", - "schedulerStatus": "计划任务状态", - "schedulerDisabled": "已禁用", - "schedulerRunning": "运行中", - "overallStatus": "总体状态", - "allDisabled": "已完全关闭", - "notAllDisabled": "未完全关闭", - "disableBtn": "关闭 Windows 更新", - "enableBtn": "恢复 Windows 更新", - "disableSuccess": "Windows 更新已成功关闭", - "enableSuccess": "Windows 更新已成功恢复", - "disableError": "关闭失败", - "enableError": "恢复失败", - "checking": "正在检查状态...", - "warningTitle": "⚠️ 请注意", - "warningDesc": "关闭 Windows 更新后将不再接收安全补丁和功能更新。建议定期手动检查更新,或在需要时再开启。", - "pauseCard": { - "title": "暂停 Windows 更新(1000 周)", - "desc": "将 Windows 更新暂停约 1000 周(约 19 年),写入注册表后需手动到 Windows 更新设置中修改暂停时间。", - "checking": "正在检查暂停状态...", - "paused": "已暂停", - "notPaused": "未暂停", - "applyBtn": "暂停更新 1000 周", - "restoreBtn": "恢复更新", - "applySuccess": "已成功写入暂停更新注册表", - "restoreSuccess": "已成功恢复更新注册表", - "applyError": "写入暂停更新失败", - "restoreError": "恢复更新失败", - "manualHintTitle": "💡 重要提示", - "manualHint": "写入成功后,请打开「设置 → Windows 更新 → 暂停更新」手动调整暂停周数为最大值,否则注册表时间无法生效。" - } - }, - "gpuDriverRestart": { - "pageTitle": "重启显卡驱动", - "pageDesc": "模拟 Win+Ctrl+Shift+B 快捷键重启显卡驱动(网吧用户适用)", - "detailDesc": "点击按钮将向系统发送重启显卡驱动的指令,效果等同于按下 Win+Ctrl+Shift+B。屏幕会短暂黑屏或闪烁,几秒后恢复正常。此功能无需管理员权限。", - "restartBtn": "重启显卡驱动", - "success": "已发送重启指令,屏幕即将短暂闪烁", - "error": "重启显卡驱动失败", - "waiting": "正在执行重启指令,请稍候...", - "warningTitle": "请注意", - "warningDesc": "重启显卡驱动会导致屏幕短暂黑屏或闪烁,请先确认没有正在进行的重要操作(如游戏、文件编辑等)。此功能适用于显卡显示异常、花屏、卡顿等情形,仅限 Windows 系统使用。" - }, - "networkOptimize": { - "pageTitle": "网络优化", - "pageDesc": "优化网络参数,配置 DNS 提升解析速度", - "loadFailed": "加载状态失败", - "scanning": "扫描中...", - "currentDns": "当前 DNS", - "noDnsConfig": "使用自动获取", - "dnsApplied": "DNS 已应用", - "dnsRestored": "DNS 已恢复为自动获取", - "applyError": "DNS 应用失败", - "dns": { - "title": "DNS 设置", - "primary": "首选 DNS", - "secondary": "备选 DNS", - "apply": "应用", - "applied": "已应用", - "restore": "恢复自动获取", - "customLabel": "自定义 DNS" - }, - "dnsRequired": "请至少填写首选 DNS 地址", - "tcpCongestion": { - "title": "TCP 拥塞控制", - "description": "启用 CTCP/CUBIC 拥塞控制算法,提升网络吞吐量" - }, - "chimney": { - "title": "TCP Chimney Offload", - "description": "关闭 TCP Chimney Offload 降低网络延迟" - }, - "nagle": { - "title": "Nagle 算法", - "description": "禁用 Nagle 算法,减少小包延迟(适合游戏)" - }, - "adapterPower": { - "title": "网卡节能禁用", - "description": "关闭网卡电源节省模式,降低延迟抖动" - }, - "batch": { - "title": "批量优化", - "enable": "全部优化", - "disable": "全部恢复默认" - }, - "batchOptimized": "全部网络优化已执行", - "batchReverted": "全部网络优化已恢复", - "batchError": "批量操作执行失败", - "optimized": "已优化", - "reverted": "已取消优化", - "optimizing": "执行中...", - "operationError": "操作执行失败", - "rescan": "重新扫描", - "rescanComplete": "扫描完成", - "scanError": "扫描失败" - }, - "peripheralOptimize": { - "pageTitle": "外设优化", - "pageDesc": "优化鼠标和键盘注册表参数,降低输入延迟", - "mouseSection": "鼠标注册表优化", - "mouseDesc": "按需设置 Win32PrioritySeparation 的十进制数值", - "keyboardSection": "键盘注册表优化", - "keyboardDesc": "按需设置 KeyboardDataQueueSize 的十进制数值", - "apply": "应用到注册表", - "applying": "正在应用...", - "success": "注册表优化已应用", - "error": "优化失败", - "revert": "恢复默认", - "reverting": "正在恢复...", - "revertSuccess": "已恢复为系统默认值", - "currentValue": "当前值", - "lowerIsBetter": "越低越好" - }, - "shaderCache": { - "title": "着色器缓存清理", - "vendorTitle": "显卡厂商", - "vendorSubtitle": "按厂商组织清理项,默认只选 NVIDIA。", - "nvidia": { - "name": "NVIDIA", - "description": "按 NVIDIA 官方路径清理 DXCache、GLCache、NV_Cache。", - "selected": "已选择", - "selectable": "可选择" - }, - "amd": { - "name": "AMD", - "description": "清理 AMD Software Reset Shader Cache 对应的用户级缓存目录。", - "selected": "已选择", - "selectable": "点击选择" - }, - "detected": "已检测到", - "notDetected": "未检测到", - "dirs": "{{count}} 个目录", - "cleanButton": "强制清理", - "cleaning": "清理中...", - "scanButton": "重新扫描", - "forceCleanTip": "强制清理会尝试删除所有缓存文件,被占用的文件将标记为重启后删除。", - "rebootPending": "{{count}} 个文件已被占用,将在重启后自动删除。", - "officialTip": { - "title": "NVIDIA 官方建议", - "description": "建议先按下述步骤处理,再回到本页执行清理。", - "step1": "1. 打开英伟达控制面板,将 3D 设置里的着色器缓存大小改成禁用。", - "step2": "2. 重启电脑后回到本页,执行「清理 NVIDIA」。", - "step3": "3. 清理完成后再将着色器缓存开启,选择多少取决于你的 C 盘容量。" - }, - "cleanSuccess": "清理完成,释放了 {{size}}", - "cleanError": "清理失败", - "scanError": "扫描失败", - "noVendorSelected": "请至少选择一个显卡厂商" - }, - "storageClean": { - "title": "存储清理", - "description": "清理系统临时文件、缓存和垃圾文件释放磁盘空间", - "totalScanned": "扫描总量", - "itemsFound": "发现项目", - "selectedSize": "选中大小", - "selectAll": "全选", - "deselectAll": "取消全选", - "emptyRecycleBin": "清空回收站", - "scanning": "扫描中...", - "cleanButton": "开始清理", - "cleaning": "清理中...", - "scanButton": "重新扫描", - "cleanSuccess": "清理完成,释放了 {{size}}", - "cleanError": "清理失败", - "scanError": "扫描失败", - "noItemSelected": "请选择要清理的项目", - "skippedFiles": "跳过 {{count}} 个被占用文件", - "recycleBinEmpty": "回收站已清空", - "recycleBinError": "清空回收站失败", - "adminRequired": "需管理员", - "items": { - "temp_user": { - "name": "用户临时文件", - "description": "程序运行时产生的中间文件,可安全删除" - }, - "temp_system": { - "name": "系统临时文件", - "description": "系统级临时文件,需要管理员权限" - }, - "recycle_bin": { - "name": "回收站", - "description": "已删除文件的暂存区,清空后释放磁盘空间" - }, - "thumbnail_cache": { - "name": "缩略图缓存", - "description": "图片、视频预览图缓存,删除后自动重建" - }, - "prefetch": { - "name": "预读文件", - "description": "程序启动预读数据,删除后首次启动略慢" - }, - "wer_archive": { - "name": "错误报告存档", - "description": "程序崩溃错误报告存档" - }, - "wer_queue": { - "name": "错误报告队列", - "description": "待上报的错误报告" - }, - "crash_dumps": { - "name": "崩溃转储", - "description": "应用程序崩溃转储文件" - }, - "memory_dmp": { - "name": "完整内存转储", - "description": "蓝屏完整内存转储文件" - }, - "minidump": { - "name": "蓝屏精简转储", - "description": "蓝屏精简转储文件,排查问题后可删除" - }, - "windows_logs": { - "name": "系统日志", - "description": "Windows各组件运行日志" - }, - "d3dscache": { - "name": "DirectX着色器缓存", - "description": "显卡着色器编译缓存" - }, - "thumbs_db": { - "name": "thumbs.db残留文件", - "description": "早期Windows遗留的缩略图缓存文件" - } - }, - "tip": { - "title": "使用提示", - "description": "存储清理功能可以安全删除系统临时文件和缓存,释放磁盘空间。", - "note1": "• 需要管理员权限的项目会在清理时自动请求权限", - "note2": "• 被占用的文件会自动跳过,不会影响系统运行" - } - }, - "epic": { - "title": "Epic 喜加一", - "loading": "正在加载免费游戏...", - "errorFetch": "获取数据失败", - "errorNetwork": "网络请求失败,请检查网络连接", - "deadline": "截止 {{date}}", - "claimNow": "立即领取", - "noGames": "暂无免费游戏,请稍后再来查看", - "reload": "重新加载" - }, - "search": { - "placeholder": "搜索功能...", - "noResults": "未找到相关功能", - "typeToSearch": "输入关键词搜索...", - "categories": { - "pages": "页面", - "builtinTools": "内置工具", - "optimization": "优化", - "thirdpartyTools": "第三方工具" - } - }, - "closeDialog": { - "title": "关闭确认", - "message": "您希望如何关闭应用?", - "closeApp": "直接关闭", - "minimizeToTray": "最小化到托盘", - "dontAskAgain": "不再提醒" - }, - "tray": { - "show": "显示主窗口", - "exit": "退出" - }, - "hotkeySettings": { - "title": "热键设置", - "overlay": "悬浮框", - "overlayToggle": "切换悬浮框", - "overlayToggleDesc": "使用快捷键显示或隐藏悬浮框", - "crosshair": "准心", - "crosshairToggle": "切换准心", - "crosshairToggleDesc": "使用快捷键显示或隐藏准心", - "filter": "滤镜", - "filterToggle": "切换滤镜", - "filterToggleDesc": "使用快捷键开启或关闭滤镜", - "saved": "快捷键已保存" - }, - "diskHealth": { - "title": "磁盘健康检测", - "refresh": "刷新", - "scanning": "检测中...", - "total": "磁盘总数", - "healthy": "健康", - "warning": "警告", - "unhealthy": "故障", - "temperature": "温度", - "lifespan": "健康寿命", - "powerOnHours": "通电时间", - "operationalStatus": "运行状态", - "readErrors": "读取错误", - "writeErrors": "写入错误", - "partitions": "个分区", - "loadError": "加载失败", - "retry": "重试" - }, - "screenRecord": { - "title": "屏幕录制", - "description": "硬件加速屏幕录制,支持高帧率捕获", - "loading": "加载中...", - "previewWaiting": "等待录制开始...", - "recording": "录制中", - "idle": "待机", - "openPreview": "打开预览窗口", - "closePreview": "关闭预览", - "settings": { - "title": "录制设置", - "source": "采集源", - "display": "显示器", - "window": "窗口", - "windowSrc": "应用窗口", - "fps": "帧率", - "resolution": "分辨率", - "original": "原始", - "bitrate": "码率", - "codec": "编码器", - "container": "格式", - "captureCursor": "采集光标", - "savePath": "保存路径", - "selectPath": "选择保存位置" - }, - "controls": { - "start": "开始录制", - "stop": "停止录制", - "recording": "录制中", - "paused": "已暂停" - }, - "stats": { - "title": "录制统计", - "lastRecording": "上次录制", - "elapsed": "已录制时长", - "targetFps": "目标帧率", - "captureFps": "采集帧率", - "outputFps": "输出帧率", - "droppedFrames": "丢帧数", - "totalFrames": "总帧数", - "fileSize": "文件大小", - "currentBitrate": "当前码率" - }, - "warnings": { - "refreshRateLow": "显示器刷新率 ({{hz}}Hz) 低于目标帧率 ({{fps}}fps),将通过补帧达到目标帧率", - "noDisplayFound": "未找到可采集的显示器", - "savePathRequired": "请先选择保存路径", - "encodingError": "编码错误: {{message}}" - }, - "messages": { - "recordingStarted": "录制已开始", - "recordingStopped": "录制已停止,文件已保存到: {{path}}", - "recordingError": "录制出错: {{message}}" - } - }, - "audioEq": { - "title": "EQ 调音", - "loading": "加载中...", - "virtualSoundCard": "虚拟声卡", - "virtualSoundCardDesc": "安装 FxSound 虚拟音频驱动以启用系统级 EQ", - "installed": "已安装", - "notInstalled": "未安装", - "needsReboot": "需要重启", - "rebootHint": "驱动已被标记为删除,需要重启电脑才能完成卸载。重启后请再次运行卸载以清理残留。", - "serviceRunning": "服务运行中", - "installDriver": "安装声卡", - "uninstallDriver": "卸载声卡", - "installing": "安装中...", - "uninstalling": "卸载中...", - "installSuccess": "安装成功", - "installFailed": "安装失败", - "uninstallSuccess": "卸载成功", - "uninstallFailed": "卸载失败", - "installHint": "安装驱动需要管理员权限,请以管理员身份运行 NexBox", - "eqEngine": "EQ 引擎", - "eqEngineDesc": "启动音频处理引擎以应用 EQ 效果", - "running": "运行中", - "stopped": "已停止", - "startEngine": "启动引擎", - "stopEngine": "停止引擎", - "starting": "启动中...", - "engineStarted": "EQ 引擎已启动", - "engineStartFailed": "启动 EQ 引擎失败", - "engineStopped": "EQ 引擎已停止", - "engineStopFailed": "停止 EQ 引擎失败", - "installDriverFirst": "请先安装虚拟声卡驱动", - "presets": "预设", - "equalizer": "均衡器", - "reset": "重置", - "presetApplied": "预设已应用", - "usageGuide": "使用指南", - "step1": "点击\u201C安装声卡\u201D按钮安装 FxSound 虚拟音频驱动(需要管理员权限)", - "step2": "安装成功后,点击\u201C启动引擎\u201D按钮启动 EQ 音频处理引擎", - "step3": "选择预设或拖动频段滑块调整 EQ 参数,频率响应曲线将实时更新", - "step4": "使用完毕后,点击\u201C停止引擎\u201D关闭音频处理,可随时卸载声卡驱动", - "import": "导入", - "importDesc": "导入 .fac 预设文件,将显示在导入列表中。", - "chooseFacFile": "选择 .fac 文件", - "importSuccess": "导入成功", - "importFailed": "导入失败", - "deletePreset": "删除", - "deleteSuccess": "已删除", - "deleteFailed": "删除失败", - "deleteConfirm": "确定要删除预设「{name}」吗?", - "noImported": "暂无导入的预设" - } -} - - diff --git a/参考/NexBox-main/src/main.tsx b/参考/NexBox-main/src/main.tsx deleted file mode 100644 index 7738589..0000000 --- a/参考/NexBox-main/src/main.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import React, { useEffect, useState } from "react"; -import ReactDOM from "react-dom/client"; -import { ChakraProvider, ColorModeScript, Spinner, Center } from "@chakra-ui/react"; -import { CacheProvider } from "@emotion/react"; -import createCache from "@emotion/cache"; -import { BrowserRouter } from "react-router-dom"; -import App from "./App"; -import "./index.css"; -import { I18nextProvider } from "react-i18next"; -import i18n from "./lib/i18n"; -import { BackgroundProvider } from "./contexts/background-context"; -import { ThemeColorProvider } from "./contexts/theme-color-context"; -import { AppStartupProvider } from "./contexts/app-startup-context"; -import { FontProvider } from "./contexts/font-context"; -import { LiquidGlassSvgFilter } from "./components/special/liquid-glass-svg-filter"; -import theme from "./lib/theme"; -import { mockIPC, mockWindows, mockConvertFileSrc } from "@tauri-apps/api/mocks"; - -// Mock Tauri APIs when running in browser dev mode (no top-level await needed) -if (typeof window !== "undefined" && !("__TAURI_INTERNALS__" in window)) { - const npmMockStore = new Map(); - mockWindows("main"); - mockConvertFileSrc("windows"); - mockIPC( - (cmd, args) => { - switch (cmd) { - case "plugin:store|load": - return 1; - case "plugin:store|get_store": - return 1; - case "plugin:store|get": { - const a = args as Record; - const v = npmMockStore.get(a.key as string); - return [v !== undefined ? v : null, v !== undefined]; - } - case "plugin:store|set": { - const a = args as Record; - npmMockStore.set(a.key as string, a.value); - return; - } - case "plugin:store|has": { - const a = args as Record; - return npmMockStore.has(a.key as string); - } - case "plugin:store|delete": { - const a = args as Record; - npmMockStore.delete(a.key as string); - return; - } - case "plugin:store|keys": - return Array.from(npmMockStore.keys()); - case "plugin:store|clear": - npmMockStore.clear(); - return; - case "plugin:store|save": - case "plugin:store|reload": - return; - case "get_system_locale": - return "zh"; - case "get_hardware": - return null; - case "get_thirdparty_tools": - return []; - case "update_overlay_settings": - case "set_overlay_hotkey": - case "set_crosshair_hotkey": - case "set_filter_hotkey": - case "update_crosshair_settings": - case "minimize_to_tray": - case "exit_app": - case "install_update": - case "delete_download_file": - return; - case "download_update": - return "downloaded.exe"; - default: - if (cmd.startsWith("plugin:")) return; - console.warn("[Tauri Mock] Unhandled command:", cmd, args); - return null; - } - }, - { shouldMockEvents: true }, - ); -} - -const emotionCache = createCache({ - key: "css", - prepend: true, -}); - -function Root() { - const [isI18nReady, setIsI18nReady] = useState(false); - - useEffect(() => { - if (i18n.isInitialized) { - setIsI18nReady(true); - } else { - i18n.on("initialized", () => setIsI18nReady(true)); - } - }, []); - - if (!isI18nReady) { - return ( -
- -
- ); - } - - return ( - - - - - - - - - - - - - - - - - - - - - - ); -} - -ReactDOM.createRoot(document.getElementById("root")!).render(); diff --git a/参考/NexBox-main/src/pages/AceOptimizePage.tsx b/参考/NexBox-main/src/pages/AceOptimizePage.tsx deleted file mode 100644 index 096ba84..0000000 --- a/参考/NexBox-main/src/pages/AceOptimizePage.tsx +++ /dev/null @@ -1,842 +0,0 @@ -import { - Box, - Text, - Heading, - VStack, - HStack, - Button, - SimpleGrid, - useColorModeValue, - useToast, - Badge, - IconButton, - Switch, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalCloseButton, - ModalBody, - ModalFooter, - Checkbox, - useDisclosure, - Tooltip, -} from "@chakra-ui/react"; -import { useState, useCallback, useEffect, useRef } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { useTranslation } from "react-i18next"; -import { LazyStore } from "@tauri-apps/plugin-store"; -import { - ArrowLeft, - Gauge, - Cpu, - Shield, - Zap, - RefreshCw, - Settings2, -} from "lucide-react"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useNavigate } from "react-router-dom"; -import { useThemeColor } from "@/contexts/theme-color-context"; - -interface OptionState { - running: boolean; - message: string; -} - -interface AceAutoDetectStatus { - enabled: boolean; - is_running: boolean; - last_check: string | null; - total_optimized: number; - currently_optimized: string[]; -} - -function formatRelativeTime(isoString: string): string { - const date = new Date(isoString); - const now = new Date(); - const diffMs = now.getTime() - date.getTime(); - const diffSecs = Math.floor(diffMs / 1000); - - if (diffSecs < 60) { - return `${diffSecs}秒前`; - } - const diffMins = Math.floor(diffSecs / 60); - if (diffMins < 60) { - return `${diffMins}分钟前`; - } - const diffHours = Math.floor(diffMins / 60); - if (diffHours < 24) { - return `${diffHours}小时前`; - } - const diffDays = Math.floor(diffHours / 24); - return `${diffDays}天前`; -} - -const STORE = new LazyStore("ace-affinity-config.json"); - -function OptionRow({ - icon, - title, - description, - isLoading, - isApplied, - gameRunning, - onApply, - onSettings, - titleBadge, -}: { - icon: React.ReactNode; - title: string; - description: string; - isLoading: boolean; - isApplied: boolean; - gameRunning: boolean | null; - onApply: () => void; - onSettings?: () => void; - titleBadge?: string; -}) { - const { t } = useTranslation(); - const { liquidGlassEnabled } = useBackground(); - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const iconBg = useColorModeValue("white", "#222222"); - const rowBg = useColorModeValue("gray.50", "#1a1a1a"); - const { getActiveColor } = useThemeColor(); - - const content = ( - - - {icon} - - - - - {title} - - {titleBadge && ( - - {titleBadge} - - )} - - - {description} - - - - - {onSettings && ( - - } - size="sm" - variant="outline" - color={getActiveColor()} - borderColor={getActiveColor()} - _hover={{ bg: getActiveColor(), color: "white", opacity: 0.9 }} - onClick={(e) => { e.stopPropagation(); onSettings?.(); }} - /> - - )} - - - {gameRunning !== null && ( - - {gameRunning ? t("optimization.aceOptimize.status.processRunning") : t("optimization.aceOptimize.status.processNotRunning")} - - )} - - - ); - - if (liquidGlassEnabled) { - return ( - - {content} - - ); - } - - return ( - - {content} - - ); -} - -function SettingCard({ - title, - subTitle, - icon, - color, - children, -}: { - title: string; - subTitle?: string; - icon?: React.ReactNode; - color?: string; - children: React.ReactNode; -}) { - const { liquidGlassEnabled } = useBackground(); - const cardBg = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const headerColor = useColorModeValue("gray.900", "#ffffff"); - const { getActiveColor } = useThemeColor(); - const accentColor = color || getActiveColor(); - - const content = ( - - - {icon && ( - - {icon} - - )} - - - {title} - - {subTitle && ( - - {subTitle} - - )} - - - {children} - - ); - - if (liquidGlassEnabled) { - return {content}; - } - - return ( - - {content} - - ); -} - -function CoreSelectionModal({ - isOpen, - onClose, - coreCount, - target, - currentSavedMask, - onSave, -}: { - isOpen: boolean; - onClose: () => void; - coreCount: number; - target: "delta" | "ace"; - currentSavedMask: number; - onSave: (mask: number) => void; -}) { - const { t } = useTranslation(); - const { getActiveColor } = useThemeColor(); - const modalBg = useColorModeValue("white", "#1a1a1a"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const headingColor = useColorModeValue("gray.900", "#ffffff"); - - const [selectedCores, setSelectedCores] = useState([]); - - useEffect(() => { - const cores: number[] = []; - for (let i = 0; i < coreCount; i++) { - if (currentSavedMask & (1 << i)) { - cores.push(i); - } - } - setSelectedCores(cores); - }, [currentSavedMask, coreCount, isOpen]); - - const handleToggle = (coreIndex: number) => { - setSelectedCores(prev => - prev.includes(coreIndex) - ? prev.filter(c => c !== coreIndex) - : [...prev, coreIndex] - ); - }; - - const handleSelectAll = () => { - setSelectedCores(Array.from({ length: coreCount }, (_, i) => i)); - }; - - const handleClearAll = () => { - setSelectedCores([]); - }; - - const handleSave = () => { - const mask = selectedCores.reduce((acc, core) => acc | (1 << core), 0); - onSave(mask); - onClose(); - }; - - const isDefaultForDelta = coreCount > 0 && currentSavedMask === ((1 << coreCount) - 2); - const isDefaultForAce = currentSavedMask === 1; - - return ( - - - - - {t("optimization.aceOptimize.affinitySettings.title")} - - {t("optimization.aceOptimize.affinitySettings.description", { count: coreCount })} - - - - - - - - CPU0 - CPU{coreCount - 1} - - - - - - - - - {Array.from({ length: coreCount }, (_, i) => ( - handleToggle(i)} - size="sm" - sx={{ - "& .chakra-checkbox__control": { - borderColor: getActiveColor(), - }, - "& .chakra-checkbox__control[data-checked]": { - bg: getActiveColor(), - borderColor: getActiveColor(), - color: "white", - }, - }} - > - - CPU{i} - - - ))} - - - - {target === "delta" - ? t("optimization.aceOptimize.affinitySettings.deltaDefault") - : t("optimization.aceOptimize.affinitySettings.aceDefault")} - {isDefaultForDelta || isDefaultForAce ? " ✓" : ""} - - - - - - - - - - ); -} - -export default function AceOptimizePage() { - const { t } = useTranslation(); - const toast = useToast(); - const navigate = useNavigate(); - - const { liquidGlassEnabled } = useBackground(); - const headingColor = useColorModeValue("gray.900", "#ffffff"); - const borderColorVal = useColorModeValue("gray.200", "#333333"); - const { getActiveColor } = useThemeColor(); - - const [deltaPriority, setDeltaPriority] = useState({ running: false, message: "" }); - const [deltaAffinity, setDeltaAffinity] = useState({ running: false, message: "" }); - const [acePriority, setAcePriority] = useState({ running: false, message: "" }); - const [aceAffinity, setAceAffinity] = useState({ running: false, message: "" }); - const [aceEfficiency, setAceEfficiency] = useState({ running: false, message: "" }); - const [optimizeAllLoading, setOptimizeAllLoading] = useState(false); - - // 核心选择配置 - const [deltaAffinityMask, setDeltaAffinityMask] = useState(null); - const [aceAffinityMask, setAceAffinityMask] = useState(null); - const [coreCount, setCoreCount] = useState(0); - const [settingsTarget, setSettingsTarget] = useState<"delta" | "ace">("delta"); - const { isOpen: isSettingsOpen, onOpen: onSettingsOpen, onClose: onSettingsClose } = useDisclosure(); - - const getDefaultDeltaMask = useCallback((cores: number) => cores > 0 ? (1 << cores) - 2 : 0, []); - const getDefaultAceMask = useCallback(() => 1, []); - - // 从 Store 加载已保存的配置 - useEffect(() => { - const cores = navigator.hardwareConcurrency || 4; - setCoreCount(cores); - - const loadConfig = async () => { - const savedDelta = await STORE.get("delta_affinity_mask"); - const savedAce = await STORE.get("ace_affinity_mask"); - setDeltaAffinityMask(savedDelta ?? getDefaultDeltaMask(cores)); - setAceAffinityMask(savedAce ?? getDefaultAceMask()); - }; - loadConfig(); - }, [getDefaultDeltaMask, getDefaultAceMask]); - - // ACE 自动检测状态 - const [autoDetectEnabled, setAutoDetectEnabled] = useState(null); // null = 加载中 - const [autoDetectStatus, setAutoDetectStatus] = useState(null); - const [autoDetectLoading, setAutoDetectLoading] = useState(false); - const pollIntervalRef = useRef(null); - const lastBackendEnabledRef = useRef(null); - const isMountedRef = useRef(true); - - // 加载自动检测状态并开始轮询 - useEffect(() => { - isMountedRef.current = true; - const loadStatus = async () => { - try { - const status = await invoke("get_ace_auto_detect_status"); - if (!isMountedRef.current) return; - setAutoDetectStatus(status); - setAutoDetectEnabled(status.enabled); - lastBackendEnabledRef.current = status.enabled; - } catch (e) { - console.error("Failed to load auto detect status:", e); - if (!isMountedRef.current) return; - setAutoDetectEnabled(false); - } - }; - loadStatus(); - - // 每 3 秒轮询一次状态 - pollIntervalRef.current = window.setInterval(loadStatus, 3000); - return () => { - isMountedRef.current = false; - if (pollIntervalRef.current) clearInterval(pollIntervalRef.current); - }; - }, []); - - const handleToggleAutoDetect = useCallback(async (checked: boolean | React.ChangeEvent) => { - // Chakra UI Switch 在某些版本中可能传递 event 而非 boolean - const isChecked = typeof checked === 'boolean' ? checked : checked.target.checked; - - // 防抖:如果后端状态已经是目标状态,不重复发送命令 - if (lastBackendEnabledRef.current === isChecked) { - return; - } - - setAutoDetectLoading(true); - try { - await invoke("set_ace_auto_detect", { enabled: isChecked }); - if (!isMountedRef.current) return; - setAutoDetectEnabled(isChecked); - lastBackendEnabledRef.current = isChecked; - toast({ - title: isChecked - ? t("optimization.aceOptimize.autoDetect.enabled") - : t("optimization.aceOptimize.autoDetect.disabled"), - status: "success", - duration: 2000, - }); - } catch (e: any) { - if (!isMountedRef.current) return; - setAutoDetectEnabled(lastBackendEnabledRef.current ?? false); - toast({ title: String(e), status: "error", duration: 2000 }); - } finally { - if (isMountedRef.current) setAutoDetectLoading(false); - } - }, [toast, t]); - - const applyDeltaPriority = useCallback(async () => { - setDeltaPriority(prev => ({ ...prev, running: true })); - try { - const result = await invoke<{ success: boolean; message: string; was_running: boolean }>("boost_delta_force_priority"); - setDeltaPriority({ running: false, message: result.message }); - toast({ - title: result.was_running ? t("optimization.aceOptimize.deltaBoost.success") : t("optimization.aceOptimize.deltaBoost.notRunning"), - status: result.was_running ? "success" : "info", - duration: 2000, - }); - } catch (e: any) { - setDeltaPriority({ running: false, message: String(e) }); - toast({ title: String(e), status: "error", duration: 2000 }); - } - }, [toast, t]); - - const applyDeltaAffinity = useCallback(async () => { - setDeltaAffinity(prev => ({ ...prev, running: true })); - try { - const mask = deltaAffinityMask ?? getDefaultDeltaMask(coreCount); - const result = await invoke<{ success: boolean; message: string; was_running: boolean }>("boost_delta_force_affinity_with_mask", { mask }); - setDeltaAffinity({ running: false, message: result.message }); - toast({ - title: result.was_running ? t("optimization.aceOptimize.deltaBoost.affinitySuccess") : t("optimization.aceOptimize.deltaBoost.notRunning"), - status: result.was_running ? "success" : "info", - duration: 2000, - }); - } catch (e: any) { - setDeltaAffinity({ running: false, message: String(e) }); - toast({ title: String(e), status: "error", duration: 2000 }); - } - }, [toast, t, deltaAffinityMask, getDefaultDeltaMask, coreCount]); - - const applyAcePriority = useCallback(async () => { - setAcePriority(prev => ({ ...prev, running: true })); - try { - const result = await invoke<{ success: boolean; message: string; count: number }>("limit_ace_priority"); - setAcePriority({ running: false, message: result.message }); - toast({ - title: result.count > 0 ? t("optimization.aceOptimize.aceLimit.success", { count: result.count }) : t("optimization.aceOptimize.aceLimit.notRunning"), - status: result.count > 0 ? "success" : "info", - duration: 2000, - }); - } catch (e: any) { - setAcePriority({ running: false, message: String(e) }); - toast({ title: String(e), status: "error", duration: 2000 }); - } - }, [toast, t]); - - const applyAceAffinity = useCallback(async () => { - setAceAffinity(prev => ({ ...prev, running: true })); - try { - const mask = aceAffinityMask ?? getDefaultAceMask(); - const result = await invoke<{ success: boolean; message: string; count: number }>("restrict_ace_affinity_with_mask", { mask }); - setAceAffinity({ running: false, message: result.message }); - toast({ - title: result.count > 0 ? t("optimization.aceOptimize.aceLimit.affinitySuccess", { count: result.count }) : t("optimization.aceOptimize.aceLimit.notRunning"), - status: result.count > 0 ? "success" : "info", - duration: 2000, - }); - } catch (e: any) { - setAceAffinity({ running: false, message: String(e) }); - toast({ title: String(e), status: "error", duration: 2000 }); - } - }, [toast, t, aceAffinityMask, getDefaultAceMask]); - - const applyAceEfficiency = useCallback(async () => { - setAceEfficiency(prev => ({ ...prev, running: true })); - try { - const result = await invoke<{ success: boolean; message: string; count: number }>("set_ace_efficiency_mode"); - setAceEfficiency({ running: false, message: result.message }); - toast({ - title: result.count > 0 ? t("optimization.aceOptimize.aceEfficiency.success", { count: result.count }) : t("optimization.aceOptimize.aceEfficiency.notRunning"), - status: result.count > 0 ? "success" : "info", - duration: 2000, - }); - } catch (e: any) { - setAceEfficiency({ running: false, message: String(e) }); - toast({ title: String(e), status: "error", duration: 2000 }); - } - }, [toast, t]); - - const openDeltaSettings = useCallback(() => { - setSettingsTarget("delta"); - onSettingsOpen(); - }, [onSettingsOpen]); - - const openAceSettings = useCallback(() => { - setSettingsTarget("ace"); - onSettingsOpen(); - }, [onSettingsOpen]); - - const handleSaveAffinityConfig = useCallback(async (mask: number) => { - if (settingsTarget === "delta") { - setDeltaAffinityMask(mask); - await STORE.set("delta_affinity_mask", mask); - } else { - setAceAffinityMask(mask); - await STORE.set("ace_affinity_mask", mask); - } - toast({ - title: t("optimization.aceOptimize.affinitySettings.configSaved"), - status: "success", - duration: 2000, - }); - }, [settingsTarget, t, toast]); - - const applyAll = useCallback(async () => { - setOptimizeAllLoading(true); - try { - const result = await invoke<{ success: boolean; message: string; delta_boosted: boolean; ace_limited: boolean; ace_count: number }>("optimize_all_game_processes"); - if (result.delta_boosted) { - setDeltaPriority({ running: false, message: t("optimization.aceOptimize.status.optimized") }); - setDeltaAffinity({ running: false, message: t("optimization.aceOptimize.status.optimized") }); - } - if (result.ace_limited) { - setAcePriority({ running: false, message: t("optimization.aceOptimize.status.optimized") }); - setAceAffinity({ running: false, message: t("optimization.aceOptimize.status.optimized") }); - } - toast({ - title: result.message, - status: result.success ? "success" : "info", - duration: 3000, - }); - } catch (e: any) { - toast({ title: String(e), status: "error", duration: 2000 }); - } - setOptimizeAllLoading(false); - }, [toast, t]); - - return ( - - - - } - variant="ghost" - onClick={() => navigate("/optimize")} - color={headingColor} - /> - - {t("optimization.aceOptimize.title")} - - - - - - } - color={getActiveColor()} - > - - } - title={t("optimization.aceOptimize.deltaBoost.title")} - description={t("optimization.aceOptimize.deltaBoost.description")} - isLoading={deltaPriority.running} - isApplied={!!deltaPriority.message && !deltaPriority.message.includes("未运行")} - gameRunning={deltaPriority.message ? !deltaPriority.message.includes("未运行") : null} - onApply={applyDeltaPriority} - /> - } - title={t("optimization.aceOptimize.deltaBoost.affinityTitle")} - description={t("optimization.aceOptimize.deltaBoost.affinityDescription")} - isLoading={deltaAffinity.running} - isApplied={!!deltaAffinity.message && !deltaAffinity.message.includes("未运行")} - gameRunning={deltaAffinity.message ? !deltaAffinity.message.includes("未运行") : null} - onApply={applyDeltaAffinity} - onSettings={openDeltaSettings} - /> - - - - } - color="#DD6B20" - > - - } - title={t("optimization.aceOptimize.aceLimit.title")} - description={t("optimization.aceOptimize.aceLimit.description")} - isLoading={acePriority.running} - isApplied={!!acePriority.message && !acePriority.message.includes("未找到")} - gameRunning={acePriority.message ? !acePriority.message.includes("未找到") : null} - onApply={applyAcePriority} - /> - } - title={t("optimization.aceOptimize.aceLimit.affinityTitle")} - description={t("optimization.aceOptimize.aceLimit.affinityDescription")} - isLoading={aceAffinity.running} - isApplied={!!aceAffinity.message && !aceAffinity.message.includes("未找到")} - gameRunning={aceAffinity.message ? !aceAffinity.message.includes("未找到") : null} - onApply={applyAceAffinity} - onSettings={openAceSettings} - /> - } - title={t("optimization.aceOptimize.aceEfficiency.title")} - description={t("optimization.aceOptimize.aceEfficiency.description")} - isLoading={aceEfficiency.running} - isApplied={!!aceEfficiency.message && !aceEfficiency.message.includes("未找到")} - gameRunning={aceEfficiency.message ? !aceEfficiency.message.includes("未找到") : null} - onApply={applyAceEfficiency} - /> - - {/* 自动检测并优化 */} - - - - - {t("optimization.aceOptimize.autoDetect.title")} - - {autoDetectStatus && ( - - - {t("optimization.aceOptimize.autoDetect.lastCheck")}:{" "} - {autoDetectStatus.last_check - ? formatRelativeTime(autoDetectStatus.last_check) - : t("optimization.aceOptimize.autoDetect.never")} - - {autoDetectStatus.currently_optimized.length > 0 && ( - - {t("optimization.aceOptimize.autoDetect.optimizing", { count: autoDetectStatus.currently_optimized.length })} - - )} - - )} - - span": { - bg: autoDetectEnabled ? getActiveColor() : useColorModeValue("gray.200", "gray.600"), - }, - "& > span > span": { - bg: "white", - }, - "&:hover > span": { - bg: autoDetectEnabled ? getActiveColor() : useColorModeValue("gray.200", "gray.600"), - }, - "&[data-disabled] > span": { - bg: useColorModeValue("gray.200", "gray.600"), - }, - }} - aria-label={t("optimization.aceOptimize.autoDetect.title")} - /> - - - - - - - {(() => { - const optimizeAllContent = ( - - - - - - {t("optimization.aceOptimize.optimizeAll.title")} - - - - {t("optimization.aceOptimize.optimizeAll.description")} - - - - - ); - - if (liquidGlassEnabled) { - return {optimizeAllContent}; - } - - return ( - - {optimizeAllContent} - - ); - })()} - - - - ); -} diff --git a/参考/NexBox-main/src/pages/AudioEqPage.tsx b/参考/NexBox-main/src/pages/AudioEqPage.tsx deleted file mode 100644 index 9acf7bd..0000000 --- a/参考/NexBox-main/src/pages/AudioEqPage.tsx +++ /dev/null @@ -1,1626 +0,0 @@ -import { - Box, - Text, - Heading, - VStack, - HStack, - useColorModeValue, - useToast, - Button, - Badge, - Spinner, - IconButton, - Tabs, - TabList, - TabPanels, - TabPanel, - Tab, - Input, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalFooter, - ModalBody, - ModalCloseButton, - useDisclosure, -} from "@chakra-ui/react"; -import { useState, useEffect, useCallback, useRef } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { useTranslation } from "react-i18next"; -import { useNavigate } from "react-router-dom"; -import { - ArrowLeft, - Volume2, - Trash2, - Download, - Activity, - Music, - Gamepad2, - Mic, - Headphones, - Play, - Square, - RefreshCw, - CheckCircle, - XCircle, - AlertTriangle, - Upload, - Save, -} from "lucide-react"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { store } from "@/lib/store"; - -// ===== 类型定义 ===== -interface DriverStatus { - installed: boolean; - service_exists: boolean; - service_running: boolean; - device_name: string; - needs_reboot: boolean; -} - -interface EqBand { - freq: number; - gain: number; -} - -interface FxPresetParams { - clarity: number; - ambience: number; - width: number; - dynamics: number; - bass: number; -} - -interface EqPreset { - id: string; - name: string; - bands: EqBand[]; - enabled: boolean; - effects?: FxPresetParams; -} - -interface EngineStatus { - running: boolean; - pid: number | null; -} - -// ===== EQ 频段常量 ===== -const DEFAULT_EQ_FREQS = [31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, 16000]; -// 每个频段的固定频率范围 -const BAND_FREQ_RANGES: [number, number][] = [ - [22, 41], [44, 81], [88, 162], [175, 325], [350, 650], - [700, 1300], [1400, 2600], [2800, 5200], [5600, 10400], [11200, 20800], -]; -const EQ_STORE_SELECTED = "eq-selected-preset-id"; -const EQ_STORE_BANDS = "eq-current-bands"; -const EQ_STORE_IMPORTED = "eq-imported-preset-ids"; -const EQ_STORE_SAVED = "eq-saved-preset-ids"; -const EQ_STORE_CUSTOM_BANDS = "eq-custom-bands"; -const EQ_STORE_PREAMP = "eq-preamp"; -const EQ_STORE_FX = "eq-effects"; - -// ===== 辅助函数 ===== -function formatFreq(freq: number): string { - if (freq >= 1000) { - return `${(freq / 1000).toFixed(freq >= 10000 ? 2 : 1)}k`; - } - return `${Math.round(freq)}`; -} - -function getPresetIcon(name: string) { - const lower = name.toLowerCase(); - if (lower.includes("人声") || lower.includes("voice") || lower.includes("vocal")) return Mic; - if (lower.includes("低音") || lower.includes("bass") || lower.includes("哈曼")) return Headphones; - if (lower.includes("音乐") || lower.includes("music")) return Music; - if (lower.includes("竞技") || lower.includes("脚步") || lower.includes("枪声") || lower.includes("gam")) return Gamepad2; - return Activity; -} - -// ===== 折线:直接连接 10 个调节旋钮(无弧度) ===== -function FrequencyResponseCurve({ bands }: { bands: EqBand[] }) { - const ref = useRef(null); - const { getActiveColor } = useThemeColor(); - const activeColor = getActiveColor(); - const fillColor = useColorModeValue("rgba(49,130,206,0.10)", "rgba(99,179,237,0.08)"); - const zeroColor = useColorModeValue("rgba(0,0,0,0.08)", "rgba(255,255,255,0.08)"); - - useEffect(() => { - const canvas = ref.current; - if (!canvas) return; - const ctx = canvas.getContext("2d"); - if (!ctx) return; - const dpr = window.devicePixelRatio || 1; - const rect = canvas.getBoundingClientRect(); - canvas.width = rect.width * dpr; - canvas.height = rect.height * dpr; - ctx.scale(dpr, dpr); - const W = rect.width, H = rect.height; - ctx.clearRect(0, 0, W, H); - if (bands.length === 0) return; - - const padX = 4; // 匹配 HStack px={1} = 4px - - // 旋钮 Y 坐标:模仿滑动条布局 - // 增益文本 ~16px + gap 4px = 20px,120px 轨道,旋钮居轨道内 - const trackTop = 20; // 轨道顶部偏移 - const trackH = H - trackTop - 18; // 轨道可用高度(底部留 ~18px 给 freq 标签) - const zeroY = trackTop + trackH / 2; - - // 10 个等距点,X 匹配 HStack 布局中心 - const pts = bands.map((b, i) => { - const x = padX + (i + 0.5) / bands.length * (W - padX * 2); - const y = trackTop + (1 - (b.gain + 12) / 24) * trackH; - return { x, y }; - }); - - // 填充(折线到底部再闭合) - ctx.beginPath(); - ctx.moveTo(pts[0].x, zeroY); - pts.forEach((p) => ctx.lineTo(p.x, p.y)); - ctx.lineTo(pts[pts.length - 1].x, zeroY); - ctx.closePath(); - ctx.fillStyle = fillColor; - ctx.fill(); - - // 零线 - ctx.strokeStyle = zeroColor; - ctx.lineWidth = 1; - ctx.beginPath(); - ctx.moveTo(0, zeroY); - ctx.lineTo(W, zeroY); - ctx.stroke(); - - // 折线:直连各点 - ctx.strokeStyle = activeColor; - ctx.lineWidth = 2; - ctx.beginPath(); - pts.forEach((p, i) => (i === 0 ? ctx.moveTo(p.x, p.y) : ctx.lineTo(p.x, p.y))); - ctx.stroke(); - - // 在同位置画小圆点 - ctx.fillStyle = activeColor; - pts.forEach((p) => { - ctx.beginPath(); - ctx.arc(p.x, p.y, 3.5, 0, Math.PI * 2); - ctx.fill(); - }); - }, [bands, activeColor, fillColor, zeroColor]); - - return ; -} - -// ===== 频率旋钮组件(可调节中心频率) ===== -function FreqKnob({ - freq, minFreq, maxFreq, onChange -}: { - freq: number; minFreq: number; maxFreq: number; onChange: (f: number) => void; -}) { - const canvasRef = useRef(null); - const { getActiveColor } = useThemeColor(); - const activeColor = getActiveColor(); - const bgColor = useColorModeValue("#ddd", "#444"); - - const [isDragging, setIsDragging] = useState(false); - - const START = Math.PI * 0.75; // 135° bottom-left - const RANGE = Math.PI * 1.5; // 270° - - // 绘制 - useEffect(() => { - const canvas = canvasRef.current; - if (!canvas) return; - const ctx = canvas.getContext("2d"); - if (!ctx) return; - const dpr = window.devicePixelRatio || 1; - const rect = canvas.getBoundingClientRect(); - canvas.width = rect.width * dpr; - canvas.height = rect.height * dpr; - ctx.scale(dpr, dpr); - const W = rect.width, H = rect.height; - ctx.clearRect(0, 0, W, H); - const cx = W / 2, cy = H / 2, r = Math.min(W, H) / 2 - 3; - - const ratio = (freq - minFreq) / (maxFreq - minFreq); - const endA = (START + RANGE) % (Math.PI * 2); - const curA = (START + ratio * RANGE) % (Math.PI * 2); - - ctx.strokeStyle = bgColor; - ctx.lineWidth = 4; - ctx.lineCap = "round"; - ctx.beginPath(); - ctx.arc(cx, cy, r, START, endA); - ctx.stroke(); - - ctx.strokeStyle = activeColor; - ctx.beginPath(); - if (curA > START) { - ctx.arc(cx, cy, r, START, curA); - } else { - ctx.arc(cx, cy, r, START, Math.PI * 2); - ctx.arc(cx, cy, r, 0, curA); - } - ctx.stroke(); - - const px = cx + r * Math.cos(curA); - const py = cy + r * Math.sin(curA); - ctx.fillStyle = activeColor; - ctx.beginPath(); - ctx.arc(px, py, 3.5, 0, Math.PI * 2); - ctx.fill(); - }, [freq, minFreq, maxFreq, activeColor, bgColor, START, RANGE]); - - // 鼠标在 arc 范围内计算频率,gap 区域不响应(避免绕回跳变) - const getAngle = (clientX: number, clientY: number) => { - const c = canvasRef.current; - if (!c) return 0; - const r = c.getBoundingClientRect(); - return Math.atan2(clientY - (r.top + r.height / 2), clientX - (r.left + r.width / 2)); - }; - - useEffect(() => { - if (!isDragging) return; - const step = (maxFreq - minFreq) / 100; - const onMove = (e: MouseEvent) => { - let a = (getAngle(e.clientX, e.clientY) - START) % (Math.PI * 2); - if (a < 0) a += Math.PI * 2; - if (a > RANGE) return; // gap 区域:不更新,值保持不变 - const t = a / RANGE; - const v = minFreq + t * (maxFreq - minFreq); - onChange(Math.min(maxFreq, Math.max(minFreq, Math.round(v / step) * step))); - }; - const onUp = () => setIsDragging(false); - window.addEventListener("mousemove", onMove); - window.addEventListener("mouseup", onUp); - return () => { - window.removeEventListener("mousemove", onMove); - window.removeEventListener("mouseup", onUp); - }; - }, [isDragging, minFreq, maxFreq, START, RANGE]); - - return ( - setIsDragging(true)} - onWheel={(e) => { - e.preventDefault(); - const step = (maxFreq - minFreq) / 100; - const dir = e.deltaY > 0 ? -1 : 1; - onChange(Math.min(maxFreq, Math.max(minFreq, freq + dir * step * 10))); - }} - /> - ); -} - -// ===== EQ 频段滑块组件 ===== -function EqBandSlider({ - band, - onChange, -}: { - band: EqBand; - onChange: (gain: number) => void; -}) { - const labelColor = useColorModeValue("gray.600", "#aaaaaa"); - const valueColor = useColorModeValue("gray.800", "#e0e0e0"); - const { getActiveColor } = useThemeColor(); - const activeColor = getActiveColor(); - - const gain = band.gain; - const gainPercent = ((gain + 12) / 24) * 100; - const sTrackBg = useColorModeValue("gray.200", "#333333"); - const sZeroBg = useColorModeValue("gray.400", "#555555"); - - return ( - - {/* 增益值 */} - 0 ? "green.500" : gain < 0 ? "orange.500" : valueColor} - minH="16px" - > - {gain > 0 ? "+" : ""}{gain.toFixed(0)} - - - {/* 垂直滑块 */} - - {/* 滑轨 */} - - {/* 0dB 基准线 */} - - {/* 填充 */} - = 0 ? `${100 - gainPercent}%` : "50%"} - height={`${Math.abs(gainPercent - 50)}%`} - opacity={0.6} - /> - {/* 滑块手柄(实心) */} - - {/* 隐藏的 input range */} - onChange(parseFloat(e.target.value))} - style={{ - position: "absolute", - width: "120px", - height: "32px", - top: "50%", - left: "50%", - transform: "translate(-50%, -50%) rotate(-90deg)", - opacity: 0, - cursor: "pointer", - }} - /> - - - {/* 频率标签 */} - - {formatFreq(band.freq)} - - - ); -} - -// ===== 主页面组件 ===== -export default function AudioEqPage() { - const { t } = useTranslation(); - const navigate = useNavigate(); - const toast = useToast(); - - const headingColor = useColorModeValue("#1A202C", "#ffffff"); - const labelColor = useColorModeValue("gray.700", "#e0e0e0"); - const descColor = useColorModeValue("gray.500", "#888888"); - const presetIconColor = useColorModeValue("#4A5568", "#aaaaaa"); - const iconBg = useColorModeValue("gray.100", "#222222"); - const warningBg = useColorModeValue("orange.50", "rgba(237, 137, 54, 0.1)"); - const warningColor = useColorModeValue("orange.600", "orange.300"); - const { getActiveColor } = useThemeColor(); - const activeColor = getActiveColor(); - - const [driverStatus, setDriverStatus] = useState(null); - const [engineStatus, setEngineStatus] = useState({ running: false, pid: null }); - const [presets, setPresets] = useState([]); - const [selectedPresetId, setSelectedPresetId] = useState(""); - const [bands, setBands] = useState( - DEFAULT_EQ_FREQS.map((f) => ({ freq: f, gain: 0 })) - ); - const [loading, setLoading] = useState(true); - const [installing, setInstalling] = useState(false); - const [uninstalling, setUninstalling] = useState(false); - const [startingEngine, setStartingEngine] = useState(false); - const [tabIndex, setTabIndex] = useState(0); - const [importing, setImporting] = useState(false); - const [importedIds, setImportedIds] = useState([]); - const [savedIds, setSavedIds] = useState([]); - const [presetName, setPresetName] = useState(""); - const [preamp, setPreamp] = useState(0); - const defaultFx = { clarity: 0, ambience: 0, width: 0, dynamics: 0, bass: 0 }; - const [fx, setFx] = useState(defaultFx); - - const { isOpen: saveModalOpen, onOpen: onSaveModalOpen, onClose: onSaveModalClose } = useDisclosure(); - const CUSTOM_PRESET_ID = "__custom__"; - const selectedPresetIdRef = useRef(""); - const lastEngineSyncRef = useRef(0); // 后端同步节流时间戳 - const fileInputRef = useRef(null); - - const builtInPresets = presets.filter((p) => !importedIds.includes(p.id) && !savedIds.includes(p.id)); - const savedPresets = presets.filter((p) => savedIds.includes(p.id)); - const importedPresets = presets.filter((p) => importedIds.includes(p.id)); - - // 加载数据 - const loadData = useCallback(async () => { - try { - setLoading(true); - const [status, engine, presetList, savedId, savedBands, savedImported, savedUser, savedPreamp, savedFx] = await Promise.all([ - invoke("check_virtual_audio_driver"), - invoke("get_eq_engine_status"), - invoke("get_eq_presets"), - store.get(EQ_STORE_SELECTED), - store.get(EQ_STORE_BANDS), - store.get(EQ_STORE_IMPORTED), - store.get(EQ_STORE_SAVED), - store.get(EQ_STORE_PREAMP), - store.get(EQ_STORE_FX), - ]); - setDriverStatus(status); - setEngineStatus(engine); - setPresets(presetList); - setImportedIds(savedImported ?? []); - setSavedIds(savedUser ?? []); - setPreamp(savedPreamp ?? 0); - setFx(savedFx ?? defaultFx); - - if (presetList.length === 0) return; - - // 恢复上次选中的预设和频段 - if (savedId) { - // 自定义:恢复之前保存的频段 - if (savedId === CUSTOM_PRESET_ID) { - setSelectedPresetId(CUSTOM_PRESET_ID); - selectedPresetIdRef.current = CUSTOM_PRESET_ID; - if (savedBands) setBands(savedBands); - return; - } - // 已保存的预设 - const saved = presetList.find((p) => p.id === savedId); - if (saved) { - setSelectedPresetId(saved.id); - selectedPresetIdRef.current = saved.id; - setBands(savedBands ?? saved.bands); - return; - } - } - - // 兜底:选第一个 - const first = presetList[0]; - setSelectedPresetId(first.id); - selectedPresetIdRef.current = first.id; - setBands(first.bands); - } catch (error) { - console.error("Failed to load EQ data:", error); - } finally { - setLoading(false); - } - }, []); - - useEffect(() => { - loadData(); - }, [loadData]); - - // 定时刷新引擎状态 - useEffect(() => { - const interval = setInterval(async () => { - try { - const status = await invoke("get_eq_engine_status"); - setEngineStatus(status); - } catch (e) { - // ignore - } - }, 3000); - return () => clearInterval(interval); - }, []); - - // 处理安装驱动 - const handleInstall = async () => { - setInstalling(true); - try { - const result = await invoke("install_virtual_audio_driver"); - toast({ - title: t("audioEq.installSuccess"), - description: result, - status: "success", - duration: 3000, - isClosable: true, - }); - await loadData(); - } catch (error) { - toast({ - title: t("audioEq.installFailed"), - description: String(error), - status: "error", - duration: 5000, - isClosable: true, - }); - } finally { - setInstalling(false); - } - }; - - // 处理卸载驱动 - const handleUninstall = async () => { - setUninstalling(true); - try { - const result = await invoke("uninstall_virtual_audio_driver"); - toast({ - title: t("audioEq.uninstallSuccess"), - description: result, - status: "success", - duration: 3000, - isClosable: true, - }); - await loadData(); - await loadData(); - } catch (error) { - toast({ - title: t("audioEq.uninstallFailed"), - description: String(error), - status: "error", - duration: 8000, - isClosable: true, - }); - } finally { - setUninstalling(false); - } - }; - - // 启动 EQ 引擎 - const handleStartEngine = async () => { - setStartingEngine(true); - try { - await invoke("start_eq_engine"); - // 引擎启动后,同步当前设置 - const bandTuples = bands.map((b) => [b.freq, b.gain] as [number, number]); - await invoke("update_eq_bands", { bands: bandTuples }).catch(() => {}); - await invoke("update_eq_preamp", { gain: preamp }).catch(() => {}); - await invoke("update_eq_effects", { ...fx }).catch(() => {}); - toast({ - title: t("audioEq.engineStarted"), - status: "success", - duration: 2000, - isClosable: true, - }); - const status = await invoke("get_eq_engine_status"); - setEngineStatus(status); - } catch (error) { - toast({ - title: t("audioEq.engineStartFailed"), - description: String(error), - status: "error", - duration: 5000, - isClosable: true, - }); - } finally { - setStartingEngine(false); - } - }; - - // 停止 EQ 引擎 - const handleStopEngine = async () => { - try { - await invoke("stop_eq_engine"); - toast({ - title: t("audioEq.engineStopped"), - status: "info", - duration: 2000, - isClosable: true, - }); - setEngineStatus({ running: false, pid: null }); - } catch (error) { - toast({ - title: t("audioEq.engineStopFailed"), - description: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - }; - - // 总增益调节 - const handlePreampChange = (gain: number) => { - setPreamp(gain); - store.set(EQ_STORE_PREAMP, gain).then(() => store.save()).catch(() => {}); - invoke("update_eq_preamp", { gain }).catch(() => {}); - }; - - // 选择预设 - const handleSelectPreset = async (preset: EqPreset) => { - setSelectedPresetId(preset.id); - selectedPresetIdRef.current = preset.id; - setBands(preset.bands); - - await store.set(EQ_STORE_SELECTED, preset.id); - await store.set(EQ_STORE_BANDS, preset.bands); - - // 音效参数:导入预设用预设值,内置/自定义重置为 0 - const fx = preset.effects - ? { - clarity: preset.effects.clarity, - ambience: preset.effects.ambience, - width: preset.effects.width, - dynamics: preset.effects.dynamics, - bass: preset.effects.bass, - } - : { clarity: 0, ambience: 0, width: 0, dynamics: 0, bass: 0 }; - setFx(fx); - invoke("update_eq_effects", { ...fx }).catch(() => {}); - await store.set(EQ_STORE_FX, fx); - - await store.save(); - try { - await invoke("apply_eq_preset", { presetId: preset.id }); - toast({ - title: t("audioEq.presetApplied"), - description: preset.name, - status: "success", - duration: 2000, - isClosable: true, - }); - } catch (error) { - console.error("Failed to apply preset:", error); - } - }; - - // 节流同步到音频引擎(避免拖拽时每帧都发送) - const syncBandsToEngine = (bands: EqBand[]) => { - if (!engineStatus.running) return; - const now = Date.now(); - if (now - lastEngineSyncRef.current < 50) return; // 50ms 节流 - lastEngineSyncRef.current = now; - const bandTuples = bands.map((b) => [b.freq, b.gain] as [number, number]); - invoke("update_eq_bands", { bands: bandTuples }).catch(() => {}); - }; - - // 更新频段频率(实时同步到音频引擎) - const handleFreqChange = (index: number, freq: number) => { - setBands((prev) => { - const newBands = [...prev]; - newBands[index] = { ...newBands[index], freq }; - syncBandsToEngine(newBands); - store.set(EQ_STORE_BANDS, newBands).then(() => store.save()).catch(() => {}); - return newBands; - }); - }; - - // 更新频段增益(实时同步到音频引擎) - const handleBandChange = (index: number, gain: number) => { - setBands((prev) => { - const newBands = [...prev]; - newBands[index] = { ...newBands[index], gain }; - syncBandsToEngine(newBands); - // 保存当前频段状态 + 当前选中的预设 ID(原子保存) - Promise.all([ - store.set(EQ_STORE_BANDS, newBands), - store.set(EQ_STORE_SELECTED, selectedPresetIdRef.current), - ]).then(() => store.save()).catch(() => {}); - // 自定义模式:额外保存自定义频段供下次切换恢复 - if (selectedPresetIdRef.current === CUSTOM_PRESET_ID) { - store.set(EQ_STORE_CUSTOM_BANDS, newBands).catch(() => {}); - } - return newBands; - }); - }; - - // 重置频段(实时同步) - const handleResetBands = () => { - const resetBands = bands.map((b) => ({ ...b, gain: 0 })); - setBands(resetBands); - store.set(EQ_STORE_BANDS, resetBands).then(() => store.save()).catch(() => {}); - if (selectedPresetIdRef.current === CUSTOM_PRESET_ID) { - store.set(EQ_STORE_CUSTOM_BANDS, resetBands).catch(() => {}); - } - if (engineStatus.running) { - const bandTuples = resetBands.map((b) => [b.freq, b.gain] as [number, number]); - invoke("update_eq_bands", { bands: bandTuples }).catch(() => {}); - } - }; - - // 导入 FAC 预设文件 - const handleImportFile = async (e: React.ChangeEvent) => { - const file = e.target.files?.[0]; - if (!file) return; - setImporting(true); - try { - const content = await file.text(); - const imported = await invoke("import_eq_preset", { content }); - setPresets((prev) => [...prev, imported]); - const newImportedIds = [...importedIds, imported.id]; - setImportedIds(newImportedIds); - await store.set(EQ_STORE_IMPORTED, newImportedIds); - await store.save(); - toast({ - title: t("audioEq.importSuccess") ?? "导入成功", - description: imported.name, - status: "success", - duration: 2000, - isClosable: true, - }); - // 重置 input 以便重复导入同一文件 - if (fileInputRef.current) fileInputRef.current.value = ""; - } catch (error) { - toast({ - title: t("audioEq.importFailed") ?? "导入失败", - description: String(error), - status: "error", - duration: 4000, - isClosable: true, - }); - } finally { - setImporting(false); - } - }; - - // 构建 FAC 文件内容(含当前音效参数) - const buildFacContent = (name: string): string => { - const midi = (v: number) => Math.round(v * 127); - const bandsStr = bands - .map( - (b, i) => - `Band ${i + 1}\n ${b.freq}: CF\n ${Math.round(b.gain)}: Boost/Cut` - ) - .join("\n"); - return `CLASS1 : Effect Type -9: Version -${name} -0: Double Params Flag -1: Total number of elements -${midi(fx.clarity)}: Main 0 -${midi(fx.width)}: Main 1 -0: Main 2 -${midi(fx.ambience)}: Main 3 -${midi(fx.dynamics)}: Main 4 -${midi(fx.bass)}: Main 5 -0: Element Number - 0: Param 0 - 0: Param 1 - 0: Param 2 - 0: Param 3 - 0: Param 4 - 0: Param 5 - 0: Param 6 -7: Number of Application Dependent Integers -0: Number of Application Dependent Reals -0: Number of Application Dependent Strings -${fx.clarity > 0 ? 1 : 0}: Integer[0] -${fx.width > 0 ? 1 : 0}: Integer[1] -${fx.ambience > 0 ? 1 : 0}: Integer[2] -${fx.dynamics > 0 ? 1 : 0}: Integer[3] -${fx.bass > 0 ? 1 : 0}: Integer[4] -0: Integer[5] -2: Integer[6] -10: Number of EQ Bands -1: On/Off Flag -${bandsStr}`; - }; - - // 保存当前频段为预设 - const handleSavePreset = async () => { - const name = presetName.trim(); - if (!name) { - toast({ - title: t("audioEq.saveFailed") ?? "保存失败", - description: "请输入预设名称", - status: "error", - duration: 2000, - isClosable: true, - }); - return; - } - try { - const content = buildFacContent(name); - const saved = await invoke("import_eq_preset", { content }); - setPresets((prev) => [...prev, saved]); - const newSavedIds = [...savedIds, saved.id]; - setSavedIds(newSavedIds); - await store.set(EQ_STORE_SAVED, newSavedIds); - await store.save(); - setPresetName(""); - onSaveModalClose(); - // 保持在预设 Tab,选中新预设 - setSelectedPresetId(saved.id); - selectedPresetIdRef.current = saved.id; - toast({ - title: t("audioEq.saveSuccess") ?? "保存成功", - description: name, - status: "success", - duration: 2000, - isClosable: true, - }); - } catch (error) { - toast({ - title: t("audioEq.saveFailed") ?? "保存失败", - description: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - }; - - // 切换到自定义模式(恢复上次自定义值,首次则为全零) - const handleCustomPreset = async () => { - setSelectedPresetId(CUSTOM_PRESET_ID); - selectedPresetIdRef.current = CUSTOM_PRESET_ID; - // 读取上次保存的自定义频段 - const savedCustom = await store.get(EQ_STORE_CUSTOM_BANDS); - const customBands = savedCustom - ? bands.map((b, i) => ({ ...b, gain: savedCustom[i]?.gain ?? 0 })) - : bands.map((b) => ({ ...b, gain: 0 })); - setBands(customBands); - // 读取上次保存的音效值 - const savedFx = await store.get(EQ_STORE_FX); - if (savedFx) { - setFx(savedFx); - invoke("update_eq_effects", { ...savedFx }).catch(() => {}); - } - store.set(EQ_STORE_SELECTED, CUSTOM_PRESET_ID).then(() => store.save()).catch(() => {}); - const bandTuples = customBands.map((b) => [b.freq, b.gain] as [number, number]); - invoke("update_eq_bands", { bands: bandTuples }).catch(() => {}); - }; - - // 删除保存的预设(从 presets tab 中删除) - const handleDeleteSavedPreset = async (presetId: string, name: string) => { - try { - await invoke("delete_eq_preset", { presetId }); - setPresets((prev) => prev.filter((p) => p.id !== presetId)); - const newSavedIds = savedIds.filter((id) => id !== presetId); - setSavedIds(newSavedIds); - await store.set(EQ_STORE_SAVED, newSavedIds); - await store.save(); - if (selectedPresetId === presetId) { - setSelectedPresetId(""); - selectedPresetIdRef.current = ""; - } - toast({ - title: t("audioEq.deleteSuccess") ?? "已删除", - description: name, - status: "info", - duration: 2000, - isClosable: true, - }); - } catch (error) { - toast({ - title: t("audioEq.deleteFailed") ?? "删除失败", - description: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - }; - - // 删除导入的预设 - const handleDeletePreset = async (presetId: string, name: string) => { - try { - await invoke("delete_eq_preset", { presetId }); - setPresets((prev) => prev.filter((p) => p.id !== presetId)); - const newImportedIds = importedIds.filter((id) => id !== presetId); - setImportedIds(newImportedIds); - await store.set(EQ_STORE_IMPORTED, newImportedIds); - await store.save(); - // 如果删除的是当前选中的,清除选中 - if (selectedPresetId === presetId) { - setSelectedPresetId(""); - selectedPresetIdRef.current = ""; - } - toast({ - title: t("audioEq.deleteSuccess") ?? "已删除", - description: name, - status: "info", - duration: 2000, - isClosable: true, - }); - } catch (error) { - toast({ - title: t("audioEq.deleteFailed") ?? "删除失败", - description: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - }; - - if (loading) { - return ( - - - - {t("audioEq.loading")} - - - ); - } - - return ( - - {/* 顶部导航 */} - - } - variant="ghost" - onClick={() => navigate("/builtin-tools")} - color={headingColor} - /> - - - {t("audioEq.title")} - - - - - {/* 虚拟声卡 & EQ引擎 合并顶部卡片 */} - - - {/* 标题行 + 状态 */} - - - - - - - - {t("audioEq.virtualSoundCard")} & {t("audioEq.eqEngine")} - - - {driverStatus?.device_name ?? t("audioEq.virtualSoundCardDesc")} - - - - - - {engineStatus.running && ( - - - - {t("audioEq.running")} - - - )} - {driverStatus?.needs_reboot ? ( - - - - {t("audioEq.needsReboot")} - - - ) : driverStatus?.installed ? ( - - - - {t("audioEq.installed")} - - - ) : ( - - - - {t("audioEq.notInstalled")} - - - )} - - - - {/* 操作按钮行 */} - - {/* 左侧:卸载 */} - - {driverStatus?.installed && !driverStatus?.needs_reboot && ( - - )} - - - {/* 右侧:安装/启动/停止/刷新 */} - - {!driverStatus?.installed && !driverStatus?.needs_reboot && ( - - )} - {!engineStatus.running && ( - - )} - {engineStatus.running && ( - - )} - } - size="sm" - variant="ghost" - onClick={loadData} - /> - - - - {/* 警告提示 */} - {driverStatus?.needs_reboot && ( - - - - {t("audioEq.rebootHint")} - - - )} - {!driverStatus?.installed && !driverStatus?.needs_reboot && ( - - - - {t("audioEq.installHint")} - - - )} - {!driverStatus?.installed && ( - - {t("audioEq.installDriverFirst")} - - )} - - - - {/* 总增益 */} - - - - 总增益 - - - handlePreampChange(parseFloat(e.target.value))} - style={{ - width: "100%", - height: "6px", - appearance: "none", - background: `linear-gradient(to right, #8884 0%, ${activeColor} ${((preamp + 12) / 24) * 100}%, #8884 ${((preamp + 12) / 24) * 100}%, #8884 100%)`, - borderRadius: "3px", - outline: "none", - cursor: "pointer", - }} - /> - - 0 ? "#38A169" : "#E53E3E")} minW="40px" textAlign="right"> - {preamp > 0 ? "+" : ""}{preamp} dB - - - - - {/* 均衡器 + 预设 双栏布局 */} - - {/* 左侧:均衡器 */} - - - - - - {t("audioEq.equalizer")} - - - - - - - {/* 频段滑块 + 覆盖折线 */} - - {/* 折线覆盖在滑块上(不阻挡交互) */} - - - - - {bands.map((band, index) => ( - handleBandChange(index, gain)} - /> - ))} - - - - {/* 频率旋钮 + 范围标签 */} - - {bands.map((band, index) => { - const [minF, maxF] = BAND_FREQ_RANGES[index]; - return ( - - - {formatFreq(minF)}-{formatFreq(maxF)} - - handleFreqChange(index, f)} - /> - - ); - })} - - - - - {/* 音效处理 */} - - - 音效处理 - - - {([ - { key: "clarity", label: "清晰度", desc: "提升声音清晰度" }, - { key: "ambience", label: "环境", desc: "模拟空间混响" }, - { key: "width", label: "环绕", desc: "拓宽声场" }, - { key: "dynamics", label: "动态", desc: "提升响度" }, - { key: "bass", label: "低音", desc: "增强低频谐波" }, - ] as const).map(({ key, label, desc }) => ( - - - - {label} - {desc} - - 0 ? activeColor : descColor} minW="28px" textAlign="right"> - {Math.round(fx[key] * 10)} - - - { - const v = parseInt(e.target.value) / 10; - setFx((prev) => { - const newFx = { ...prev, [key]: v }; - invoke("update_eq_effects", { ...newFx }).catch(() => {}); - // Promise.all 确保两个 key 都写入再保存 - Promise.all([ - store.set(EQ_STORE_FX, newFx), - store.set(EQ_STORE_SELECTED, selectedPresetIdRef.current), - ]).then(() => store.save()).catch(() => {}); - return newFx; - }); - }} - style={{ - width: "100%", - height: "6px", - appearance: "none", - background: `linear-gradient(to right, ${activeColor} ${fx[key] * 100}%, #8884 ${fx[key] * 100}%, #8884 100%)`, - borderRadius: "3px", - outline: "none", - cursor: "pointer", - accentColor: activeColor, - }} - /> - - ))} - - - - - {/* 右侧:预设 / 导入 */} - - - - - {t("audioEq.presets")} - {t("audioEq.import") ?? "导入"} - - - - {/* 预设列表 */} - - - {builtInPresets.map((preset) => { - const Icon = getPresetIcon(preset.name); - const isSelected = selectedPresetId === preset.id; - return ( - handleSelectPreset(preset)} - cursor="pointer" - px={3} - py={2.5} - borderRadius="lg" - border="1px solid" - borderColor={isSelected ? activeColor : `${activeColor}18`} - bg={isSelected ? `${activeColor}12` : `${activeColor}04`} - _hover={{ - bg: `${activeColor}10`, - borderColor: isSelected ? activeColor : `${activeColor}40`, - }} - transition="all 0.2s" - > - - - - {preset.name} - - - - ); - })} - {/* 用户保存的预设 */} - {savedPresets.map((preset) => { - const Icon = getPresetIcon(preset.name); - const isSelected = selectedPresetId === preset.id; - return ( - - handleSelectPreset(preset)} - cursor="pointer" - px={3} - py={2} - borderRadius="lg" - border="1px solid" - borderColor={isSelected ? activeColor : `${activeColor}18`} - bg={isSelected ? `${activeColor}12` : `${activeColor}04`} - _hover={{ - bg: `${activeColor}10`, - borderColor: isSelected ? activeColor : `${activeColor}40`, - }} - transition="all 0.2s" - > - - - - {preset.name} - - - - } - size="xs" - variant="ghost" - color={descColor} - _hover={{ color: "red.400", bg: "transparent" }} - onClick={(e) => { - e.stopPropagation(); - handleDeleteSavedPreset(preset.id, preset.name); - }} - ml={1} - /> - - ); - })} - {/* 自定义 */} - - - - - 自定义 - - - - - - - {/* 导入 */} - - - {/* 导入按钮 */} - - - - {t("audioEq.importDesc") ?? "导入 .fac 预设文件。"} - - - {/* 导入的预设列表 */} - {importedPresets.length === 0 ? ( - - {t("audioEq.noImported") ?? "暂无导入的预设"} - - ) : ( - - {importedPresets.map((preset) => { - const Icon = getPresetIcon(preset.name); - const isSelected = selectedPresetId === preset.id; - return ( - - handleSelectPreset(preset)} - cursor="pointer" - px={3} - py={2} - borderRadius="lg" - border="1px solid" - borderColor={isSelected ? activeColor : `${activeColor}18`} - bg={isSelected ? `${activeColor}12` : `${activeColor}04`} - _hover={{ - bg: `${activeColor}10`, - borderColor: isSelected ? activeColor : `${activeColor}40`, - }} - transition="all 0.2s" - > - - - - {preset.name} - - - - } - size="xs" - variant="ghost" - color={descColor} - _hover={{ color: "red.400", bg: "transparent" }} - onClick={(e) => { - e.stopPropagation(); - handleDeletePreset(preset.id, preset.name); - }} - ml={1} - /> - - ); - })} - - )} - - - - - {/* 预设操作按钮区 — 所有预设类型可见,"保存为预设"或"更新"+"导出" */} - {selectedPresetId && ( - - {/* 保存为预设 / 更新预设 */} - {importedPresets.some((p) => p.id === selectedPresetId) ? ( - - ) : ( - - )} - {/* 导出为 .fac */} - - - )} - - - - - {/* 说明区域 */} - - - - {t("audioEq.usageGuide")} - - - - 1. - - {t("audioEq.step1")} - - - - 2. - - {t("audioEq.step2")} - - - - 3. - - {t("audioEq.step3")} - - - - 4. - - {t("audioEq.step4")} - - - - - - - - {/* 保存为预设 模态框 */} - - - - 保存为预设 - - - - - 将当前的频段设置保存为新预设 - - setPresetName(e.target.value)} - onKeyDown={(e) => { if (e.key === "Enter") handleSavePreset(); }} - autoFocus - focusBorderColor={activeColor} - /> - - - - - - - - - - ); -} diff --git a/参考/NexBox-main/src/pages/BuiltinToolsPage.tsx b/参考/NexBox-main/src/pages/BuiltinToolsPage.tsx deleted file mode 100644 index c950cd3..0000000 --- a/参考/NexBox-main/src/pages/BuiltinToolsPage.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { useState } from "react"; -import { - Box, - Heading, - VStack, - Flex, - useColorModeValue, -} from "@chakra-ui/react"; -import { - Palette, - Crosshair, - Layout, - Cpu, - Zap, - Monitor, - HardDrive, - Volume2, -} from "lucide-react"; -import nvidiaLogoImg from "@/assets/nvidia.png"; -import { useTranslation } from "react-i18next"; - -// NVIDIA Logo 图片组件 -function NvidiaLogo({ size = 24 }: { size?: number; color?: string }) { - return NVIDIA; -} - -import { ViewGrid } from "@/components/special/view-grid"; -import { ViewList } from "@/components/special/view-list"; -import { LayoutToggle, type LayoutMode } from "@/components/special/layout-toggle"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import type { ViewItem } from "@/components/special/view-types"; - -const tools: ViewItem[] = [ - { - id: "display-filter", - path: "/display-filter", - icon: Palette, - titleKey: "sidebar.displayFilter", - descriptionKey: "builtinTools.displayFilterDesc", - color: "#98DDD0", - }, - { - id: "crosshair", - path: "/crosshair", - icon: Crosshair, - titleKey: "sidebar.crosshair", - descriptionKey: "builtinTools.crosshairDesc", - color: "#FF6B9D", - }, - { - id: "overlay-panel", - path: "/overlay-panel", - icon: Layout, - titleKey: "sidebar.overlayPanel", - descriptionKey: "builtinTools.overlayPanelDesc", - color: "#9B59B6", - }, - { - id: "gpu-rename", - path: "/gpu-rename", - icon: Cpu, - titleKey: "sidebar.gpuRename", - descriptionKey: "builtinTools.gpuRenameDesc", - color: "#F39C12", - }, - { - id: "resolution-converter", - path: "/resolution-converter", - icon: Monitor, - titleKey: "sidebar.resolutionConverter", - descriptionKey: "builtinTools.resolutionConverterDesc", - color: "#4A90E2", - }, - { - id: "dlss-preset", - path: "/dlss-preset", - icon: Zap, - titleKey: "sidebar.dlssPreset", - descriptionKey: "builtinTools.dlssPresetDesc", - color: "#76B900", - }, - { - id: "disk-health", - path: "/disk-health", - icon: HardDrive, - titleKey: "sidebar.diskHealth", - descriptionKey: "builtinTools.diskHealthDesc", - color: "#00B4D8", - }, - { - id: "nvidia-driver", - path: "/nvidia-driver", - icon: NvidiaLogo, - titleKey: "sidebar.nvidiaDriver", - descriptionKey: "builtinTools.nvidiaDriverDesc", - color: "#76B900", - beta: true, - }, - { - id: "audio-eq", - path: "/audio-eq", - icon: Volume2, - titleKey: "sidebar.audioEq", - descriptionKey: "builtinTools.audioEqDesc", - color: "#E74C3C", - beta: true, - }, -]; - -export default function BuiltinToolsPage() { - const { t } = useTranslation(); - const [layoutMode, setLayoutMode] = useState("grid"); - - const headingColor = useColorModeValue("gray.900", "#ffffff"); - - const content = ( - - - - {t("builtinTools.title")} - - - - - - {layoutMode === "grid" ? ( - - ) : ( - - )} - - ); - - return ( - - {content} - - ); -} diff --git a/参考/NexBox-main/src/pages/CrosshairPage.tsx b/参考/NexBox-main/src/pages/CrosshairPage.tsx deleted file mode 100644 index 64a33d9..0000000 --- a/参考/NexBox-main/src/pages/CrosshairPage.tsx +++ /dev/null @@ -1,650 +0,0 @@ -import { - Box, - Text, - Heading, - VStack, - HStack, - Switch, - SimpleGrid, - Slider, - SliderTrack, - SliderFilledTrack, - SliderThumb, - useColorModeValue, - useColorMode, - useToast, - Badge, - Icon, - IconButton, - Button, - Menu, - MenuButton, - MenuList, - MenuItem, - Portal, -} from "@chakra-ui/react"; -import { useState, useEffect } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { listen } from "@tauri-apps/api/event"; -import { store } from "@/lib/store"; -import { useTranslation } from "react-i18next"; -import { Eye, EyeOff, ArrowLeft, RotateCcw, Monitor, ChevronDown, Check, Image } from "lucide-react"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useAppStartup } from "@/contexts/app-startup-context"; -import { useNavigate } from "react-router-dom"; -import { HotkeyRecorder } from "@/components/hotkey-recorder"; -import { CustomColorPicker } from "@/components/special/custom-color-picker"; -import { useThemeColor } from "@/contexts/theme-color-context"; - -interface CrosshairSettings { - enabled: boolean; - style: string; - size: number; - thickness: number; - color: string; - gap: number; - dot_size: number; - opacity: number; - monitor_index: number; - use_custom_image: boolean; - custom_image_path: string | null; -} - -interface DisplayInfo { - index: number; - name: string; - device_name: string; - is_primary: boolean; - width: number; - height: number; -} - -const CROSSHAIR_STORE_KEY = "crosshair-settings"; - -const DEFAULT_SETTINGS: CrosshairSettings = { - enabled: false, - style: "Cross", - size: 20, - thickness: 2, - color: "#ff0000", - gap: 0, - dot_size: 2, - opacity: 255, - monitor_index: -1, - use_custom_image: false, - custom_image_path: null, -}; - -const STYLE_OPTIONS = [ - { id: "Cross", labelKey: "crosshair.styles.cross", icon: "+" }, - { id: "Dot", labelKey: "crosshair.styles.dot", icon: "\u25CF" }, - { id: "Circle", labelKey: "crosshair.styles.circle", icon: "\u25CB" }, - { id: "CrossDot", labelKey: "crosshair.styles.crossDot", icon: "\u271A" }, - { id: "CircleCross", labelKey: "crosshair.styles.circleCross", icon: "\u2295" }, -]; - -const COLOR_PRESETS = [ - { value: "#ff0000" }, - { value: "#00ff00" }, - { value: "#0000ff" }, - { value: "#00ffff" }, - { value: "#ff00ff" }, - { value: "#ffff00" }, - { value: "#ffffff" }, - { value: "#ff8800" }, - { value: "#ff0088" }, -]; - -function SettingCard({ - title, - children, -}: { - title: string; - children: React.ReactNode; -}) { - const { liquidGlassEnabled } = useBackground(); - const cardBg = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const { colorMode } = useColorMode(); - const headerColor = colorMode === 'light' ? '#000000' : '#ffffff'; - - if (liquidGlassEnabled) { - return ( - - - {title} - {children} - - - ); - } - - return ( - - - {title} - {children} - - - ); -} - -export default function CrosshairPage() { - const { t } = useTranslation(); - const toast = useToast(); - const navigate = useNavigate(); - const { crosshairHotkey, saveCrosshairHotkey } = useAppStartup(); - const { getActiveColor, getHoverColor, getBorderColor, getContrastTextColor } = useThemeColor(); - - const [settings, setSettings] = useState(DEFAULT_SETTINGS); - const [isLoading, setIsLoading] = useState(false); - const [displays, setDisplays] = useState([]); - - const headingColor = useColorModeValue("black", "#ffffff"); - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const cardBorder = useColorModeValue("gray.200", "#333333"); - const sliderBg = useColorModeValue("gray.200", "gray.600"); - const hoverBg = useColorModeValue("gray.100", "#252525"); - const menuListBg = useColorModeValue("white", "#1a1a1a"); - const inputBg = useColorModeValue("white", "#1a1a1a"); - - useEffect(() => { - loadSettings(); - // 延迟加载显示器列表,避免进入页面时阻塞渲染导致卡顿 - const timer = setTimeout(() => loadDisplays(), 200); - return () => clearTimeout(timer); - }, []); - - useEffect(() => { - let unlisten: (() => void) | null = null; - - listen("crosshair-status-changed", () => { - loadSettings(); - }).then((fn) => { - unlisten = fn; - }); - - return () => { - if (unlisten) unlisten(); - }; - }, []); - - const loadSettings = async () => { - try { - const status = await invoke("get_crosshair_status"); - const isDefault = JSON.stringify(status) === JSON.stringify({ ...DEFAULT_SETTINGS, enabled: status.enabled }); - if (isDefault) { - const saved = await store.get(CROSSHAIR_STORE_KEY); - if (saved) { - saved.enabled = status.enabled; - setSettings(saved); - await invoke("update_crosshair_settings", { settings: saved }); - return; - } - } - setSettings(status); - } catch (error) { - console.error("Failed to load crosshair settings:", error); - } - }; - - const loadDisplays = async () => { - try { - const list = await invoke("get_crosshair_displays"); - setDisplays(list); - } catch (error) { - console.error("Failed to load displays:", error); - } - }; - - const selectImage = async () => { - try { - const path = await invoke("pick_crosshair_image"); - if (path) { - updateSetting("custom_image_path", path); - } - } catch (error) { - console.error("Failed to pick image:", error); - } - }; - - const resetToDefault = () => { - const defaults: CrosshairSettings = { - ...DEFAULT_SETTINGS, - enabled: settings.enabled, - }; - updateSettings(defaults); - }; - - const updateSettings = async (newSettings: CrosshairSettings) => { - setSettings(newSettings); - setIsLoading(true); - try { - await invoke("update_crosshair_settings", { settings: newSettings }); - await store.set(CROSSHAIR_STORE_KEY, newSettings); - await store.save(); - } catch (error) { - console.error("Failed to update settings:", error); - toast({ - title: t("crosshair.updateFailed"), - status: "error", - duration: 2000, - isClosable: true, - }); - } - setIsLoading(false); - }; - - const toggleCrosshair = async () => { - setIsLoading(true); - try { - const result = await invoke<{ success: boolean; message: string }>("toggle_crosshair"); - if (result.success) { - setSettings(prev => ({ ...prev, enabled: !prev.enabled })); - toast({ - title: result.message, - status: "success", - duration: 2000, - isClosable: true, - }); - } - } catch (error) { - console.error("Failed to toggle crosshair:", error); - toast({ - title: t("crosshair.toggleFailed"), - status: "error", - duration: 2000, - isClosable: true, - }); - } - setIsLoading(false); - }; - - const updateSetting = ( - key: K, - value: CrosshairSettings[K] - ) => { - const newSettings = { ...settings, [key]: value }; - updateSettings(newSettings); - }; - - return ( - - - - } - variant="ghost" - onClick={() => navigate("/builtin-tools")} - color={headingColor} - /> - - {t("crosshair.title")} - - - - - - - - - - - - {settings.enabled ? t("crosshair.statusEnabled") : t("crosshair.statusDisabled")} - - - - { - saveCrosshairHotkey(val); - toast({ - title: t("crosshair.hotkeySaved") || "快捷键已保存", - status: "success", - duration: 2000, - isClosable: true, - }); - }} - /> - - - - - - - - updateSetting("use_custom_image", false)} - opacity={settings.use_custom_image ? 0.5 : 1} - border={settings.use_custom_image ? "1px solid transparent" : `1px solid ${getActiveColor()}`} - > - - {t("crosshair.procedural")} - - - updateSetting("use_custom_image", true)} - opacity={settings.use_custom_image ? 1 : 0.5} - border={settings.use_custom_image ? `1px solid ${getActiveColor()}` : "1px solid transparent"} - > - - {t("crosshair.customImage")} - - - - - - - - - - - - - - {settings.monitor_index === -1 - ? t("crosshair.primaryMonitor") - : displays.find(d => d.index === settings.monitor_index)?.name || t("crosshair.primaryMonitor")} - - - - - - - - - updateSetting("monitor_index", -1)} - bg={settings.monitor_index === -1 ? hoverBg : "transparent"} - _hover={{ bg: hoverBg }} - > - - {t("crosshair.primaryMonitor")} - {settings.monitor_index === -1 && } - - - {displays.map((d) => ( - updateSetting("monitor_index", d.index)} - bg={settings.monitor_index === d.index ? hoverBg : "transparent"} - _hover={{ bg: hoverBg }} - > - - {d.name} - {settings.monitor_index === d.index && } - - - ))} - - - - - - {!settings.use_custom_image && ( - - - {STYLE_OPTIONS.map((option) => { - const isActive = settings.style === option.id; - return ( - updateSetting("style", option.id)} - > - {option.icon} - - {t(option.labelKey)} - - - ); - })} - - - )} - - {!settings.use_custom_image && ( - - - - {COLOR_PRESETS.map((color) => ( - updateSetting("color", color.value)} - _hover={{ transform: "scale(1.15)" }} - transition="all 0.15s" - boxShadow={settings.color === color.value ? `0 0 8px ${color.value}` : "none"} - /> - ))} - updateSetting("color", c)} /> - - - - )} - - - - - - {settings.use_custom_image ? ( - <> - - - - - - - {t("crosshair.size")} - {settings.size} - - updateSetting("size", val)}> - - - - - - - - {t("crosshair.opacity")} - - {Math.round(settings.opacity / 255 * 100)}% - - - updateSetting("opacity", val)}> - - - - - - - - - - - - {t("crosshair.preview")} - {t("crosshair.customImage")} - - - - - - ) : ( - <> - - - {t("crosshair.size")} - {settings.size} - - updateSetting("size", val)}> - - - - - - - - {t("crosshair.thickness")} - {settings.thickness} - - updateSetting("thickness", val)}> - - - - - - - - {t("crosshair.gap")} - {settings.gap} - - updateSetting("gap", val)}> - - - - - - - - {t("crosshair.dotSize")} - {settings.dot_size} - - updateSetting("dot_size", val)}> - - - - - - - - {t("crosshair.opacity")} - - {Math.round(settings.opacity / 255 * 100)}% - - - updateSetting("opacity", val)}> - - - - - - - - - - {STYLE_OPTIONS.find(s => s.id === settings.style)?.icon || "+"} - - - - {t("crosshair.preview")} - {t(STYLE_OPTIONS.find(s => s.id === settings.style)?.labelKey ?? "crosshair.styles.cross")} - - - - - - )} - - - - - - ); -} diff --git a/参考/NexBox-main/src/pages/DLSSPresetPage.tsx b/参考/NexBox-main/src/pages/DLSSPresetPage.tsx deleted file mode 100644 index b0e9601..0000000 --- a/参考/NexBox-main/src/pages/DLSSPresetPage.tsx +++ /dev/null @@ -1,612 +0,0 @@ -import { - Box, - Flex, - Text, - Heading, - VStack, - HStack, - useColorModeValue, - Button, - Badge, - useToast, - Grid, - IconButton, - Switch, - Table, - Thead, - Tbody, - Tr, - Th, - Td, - Menu, - MenuButton, - MenuList, - MenuItem, - MenuOptionGroup, - MenuItemOption, - Spinner, - Divider, -} from "@chakra-ui/react"; -import { useState, useEffect } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { useTranslation } from "react-i18next"; -import { Cpu, ArrowLeft, Zap, Eye, FileText, Settings, ChevronDown, Check, Monitor, Thermometer } from "lucide-react"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; -import { hexToRgba } from "@/lib/color-utils"; -import { useNavigate } from "react-router-dom"; -import { getHardwareInfo, GpuInfo, GpuVendor } from "@/lib/hardware"; - -interface DLSSModelPreset { - id: string; - name: string; - description: string; - recommended: boolean; -} - -interface DLSSApplyResult { - success: boolean; - message: string; - preset: string; - quality: string; - texture_quality: string; - antialiasing: string; -} - -interface DLSSPresetStatus { - preset: string; - quality: string; - texture_quality: string; - antialiasing: string; -} - -interface DLSSSettingsStatus { - dlss_indicator_enabled: boolean; -} - -interface PresetReference { - id: string; - gpuSeries: string; - preset: string; - driverVersion: string; - typeLabel: string; - presetColor: "purple" | "green"; -} - -const getDLSSPresets = (t: (key: string) => string): DLSSModelPreset[] => [ - { id: "A", name: t("deltaForce.dlssModels.A.name"), description: t("deltaForce.dlssModels.A.description"), recommended: false }, - { id: "B", name: t("deltaForce.dlssModels.B.name"), description: t("deltaForce.dlssModels.B.description"), recommended: false }, - { id: "C", name: t("deltaForce.dlssModels.C.name"), description: t("deltaForce.dlssModels.C.description"), recommended: false }, - { id: "D", name: t("deltaForce.dlssModels.D.name"), description: t("deltaForce.dlssModels.D.description"), recommended: false }, - { id: "E", name: t("deltaForce.dlssModels.E.name"), description: t("deltaForce.dlssModels.E.description"), recommended: false }, - { id: "F", name: t("deltaForce.dlssModels.F.name"), description: t("deltaForce.dlssModels.F.description"), recommended: false }, - { id: "G", name: t("deltaForce.dlssModels.G.name"), description: t("deltaForce.dlssModels.G.description"), recommended: false }, - { id: "J", name: t("deltaForce.dlssModels.J.name"), description: t("deltaForce.dlssModels.J.description"), recommended: false }, - { id: "K", name: t("deltaForce.dlssModels.K.name"), description: t("deltaForce.dlssModels.K.description"), recommended: true }, - { id: "L", name: t("deltaForce.dlssModels.L.name"), description: t("deltaForce.dlssModels.L.description"), recommended: true }, - { id: "M", name: t("deltaForce.dlssModels.M.name"), description: t("deltaForce.dlssModels.M.description"), recommended: true }, -]; - -interface DLSSQualityOption { - id: string; - name: string; - description: string; -} -const getDLSSQualityOptions = (t: (key: string) => string): DLSSQualityOption[] => [ - { id: "default", name: t("dlssQuality.default.name"), description: t("dlssQuality.default.description") }, - { id: "dlaa", name: "DLAA", description: "100% 渲染分辨率" }, - { id: "quality", name: t("dlssQuality.quality.name"), description: "约 67% 渲染分辨率" }, - { id: "balanced", name: t("dlssQuality.balanced.name"), description: "约 58% 渲染分辨率" }, - { id: "performance", name: t("dlssQuality.performance.name"), description: "50% 渲染分辨率" }, - { id: "ultra_performance", name: t("dlssQuality.ultraPerformance.name"), description: "约 33% 渲染分辨率" }, -]; - -interface TextureQualityOption { - id: string; - name: string; - description: string; -} -const getTextureQualityOptions = (t: (key: string) => string): TextureQualityOption[] => [ - { id: "default", name: "默认", description: "不修改" }, - { id: "high_quality", name: "高质量", description: "最高纹理过滤质量" }, - { id: "quality", name: "质量", description: "平衡画质与性能" }, - { id: "performance", name: "性能", description: "偏性能取向" }, - { id: "high_performance", name: "高性能", description: "最高性能取向" }, -]; - -interface AntialiasingOption { - id: string; - name: string; - description: string; -} -const getAntialiasingOptions = (t: (key: string) => string): AntialiasingOption[] => [ - { id: "default", name: "默认", description: "不修改" }, - { id: "off", name: "关", description: "关闭透明度超采样" }, - { id: "2x", name: "2x 超采样", description: "2倍透明度超采样" }, - { id: "4x", name: "4x 超采样", description: "4倍透明度超采样" }, - { id: "8x", name: "8x 超采样", description: "8倍透明度超采样" }, -]; - -const getPresetReferences = (t: (key: string) => string): PresetReference[] => [ - { id: "1", gpuSeries: t("dlssPresetTable.rtx20Series"), preset: t("dlssPresetTable.presetK"), driverVersion: "581.08", typeLabel: t("dlssPresetTable.typeGeneralEnhance"), presetColor: "purple" }, - { id: "2", gpuSeries: t("dlssPresetTable.rtx30Series"), preset: t("dlssPresetTable.presetK"), driverVersion: "581.08", typeLabel: t("dlssPresetTable.typeGeneralEnhance"), presetColor: "purple" }, - { id: "3", gpuSeries: t("dlssPresetTable.rtx4060Ti"), preset: t("dlssPresetTable.presetK"), driverVersion: "581/595", typeLabel: t("dlssPresetTable.typePerformanceFirst"), presetColor: "purple" }, - { id: "4", gpuSeries: t("dlssPresetTable.rtx4060Ti"), preset: t("dlssPresetTable.presetM"), driverVersion: "581/595", typeLabel: t("dlssPresetTable.typeQualityEnhance"), presetColor: "green" }, - { id: "5", gpuSeries: t("dlssPresetTable.rtx50HighFps"), preset: t("dlssPresetTable.presetK"), driverVersion: "581/595", typeLabel: t("dlssPresetTable.typeFpsPriority"), presetColor: "purple" }, - { id: "6", gpuSeries: t("dlssPresetTable.rtx50HighQuality"), preset: t("dlssPresetTable.presetM"), driverVersion: "581/595", typeLabel: t("dlssPresetTable.typeQualityEnhance"), presetColor: "green" }, -]; - -function SectionCard({ - title, - children, - icon, -}: { - title: string; - children: React.ReactNode; - icon?: React.ReactNode; -}) { - const { liquidGlassEnabled } = useBackground(); - const { config: themeConfig } = useThemeColor(); - const cardBg = useColorModeValue("white", "#111111"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const headerColor = useColorModeValue("gray.900", "#ffffff"); - - const headerContent = ( - - {icon} - {title} - - ); - - if (liquidGlassEnabled) { - return ( - - - {headerContent} - {children} - - - ); - } - - return ( - - - {headerContent} - {children} - - - ); -} - -function DLSSCard() { - const { t } = useTranslation(); - const { config: themeConfig, getContrastTextColor } = useThemeColor(); - const toast = useToast(); - const [selectedPreset, setSelectedPreset] = useState("K"); - const [selectedQuality, setSelectedQuality] = useState("default"); - const [selectedTextureQuality, setSelectedTextureQuality] = useState("default"); - const [selectedAntialiasing, setSelectedAntialiasing] = useState("default"); - const [isApplying, setIsApplying] = useState(false); - const [isLoading, setIsLoading] = useState(true); - const dlssPresets = getDLSSPresets(t); - const dlssQualityOptions = getDLSSQualityOptions(t); - const textureQualityOptions = getTextureQualityOptions(t); - const antialiasingOptions = getAntialiasingOptions(t); - - useEffect(() => { - const style = document.createElement("style"); - style.id = "chakra-menu-z-fix"; - style.textContent = `[data-popper-placement] { z-index: 99999 !important; }`; - document.head.appendChild(style); - return () => document.getElementById("chakra-menu-z-fix")?.remove(); - }, []); - - useEffect(() => { - invoke("get_dlss_preset_status") - .then((status) => { - setSelectedPreset(status.preset || "K"); - setSelectedQuality(status.quality || "default"); - setSelectedTextureQuality(status.texture_quality || "default"); - setSelectedAntialiasing(status.antialiasing || "default"); - }) - .catch(() => {}) - .finally(() => setIsLoading(false)); - }, []); - - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const hoverBg = useColorModeValue("gray.100", "#252525"); - const menuListBg = useColorModeValue("white", "#1a1a1a"); - - const handleApply = async () => { - setIsApplying(true); - try { - const result = await invoke("apply_dlss_model_preset", { - preset: selectedPreset, - quality: selectedQuality, - textureQuality: selectedTextureQuality, - antialiasing: selectedAntialiasing, - }); - toast({ - title: result.message, - status: "success", - duration: 3000, - isClosable: true, - }); - } catch (error) { - toast({ - title: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - setIsApplying(false); - }; - - const currentPreset = dlssPresets.find(p => p.id === selectedPreset); - const currentQuality = dlssQualityOptions.find(q => q.id === selectedQuality); - const currentTextureQuality = textureQualityOptions.find(q => q.id === selectedTextureQuality); - const currentAntialiasing = antialiasingOptions.find(a => a.id === selectedAntialiasing); - - return ( - }> - - - - {t("dlssPreset.presetLabel")} - - - - - - - {currentPreset?.name} - {currentPreset?.description} - {currentPreset?.recommended && {t("deltaForce.recommended")}} - - - - - - - {dlssPresets.map(preset => ( - setSelectedPreset(preset.id)} bg={selectedPreset === preset.id ? hoverBg : "transparent"} _hover={{ bg: hoverBg }}> - - - {preset.name} - {preset.description} - - - {preset.recommended && {t("deltaForce.recommended")}} - {selectedPreset === preset.id && } - - - - ))} - - - - - - {t("dlssQuality.label")} - - - - - - {currentQuality?.name} - {currentQuality?.description} - - - - - - - {dlssQualityOptions.map(option => ( - setSelectedQuality(option.id)} bg={selectedQuality === option.id ? hoverBg : "transparent"} _hover={{ bg: hoverBg }}> - - - {option.name} - {option.description} - - {selectedQuality === option.id && } - - - ))} - - - - - - 纹理过滤质量 - - - - - - {currentTextureQuality?.name} - {currentTextureQuality?.description} - - - - - - - {textureQualityOptions.map(option => ( - setSelectedTextureQuality(option.id)} bg={selectedTextureQuality === option.id ? hoverBg : "transparent"} _hover={{ bg: hoverBg }}> - - - {option.name} - {option.description} - - {selectedTextureQuality === option.id && } - - - ))} - - - - - - 抗锯齿-透明度 - - - - - - {currentAntialiasing?.name} - {currentAntialiasing?.description} - - - - - - - {antialiasingOptions.map(option => ( - setSelectedAntialiasing(option.id)} bg={selectedAntialiasing === option.id ? hoverBg : "transparent"} _hover={{ bg: hoverBg }}> - - - {option.name} - {option.description} - - {selectedAntialiasing === option.id && } - - - ))} - - - - - - - - {t("deltaForce.dlssNote")} - - - - ); -} - -function GpuInfoCard() { - const { config: themeConfig } = useThemeColor(); - const [gpuInfo, setGpuInfo] = useState(null); - const [isLoading, setIsLoading] = useState(true); - - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - const subTextColor = useColorModeValue("gray.500", "#888888"); - - useEffect(() => { - getHardwareInfo() - .then((info) => { - const nvidiaGpu = info.gpu.find((g) => g.vendor === GpuVendor.NVIDIA); - setGpuInfo(nvidiaGpu || info.gpu[0] || null); - }) - .catch(() => {}) - .finally(() => setIsLoading(false)); - }, []); - - if (isLoading || !gpuInfo) return null; - - return ( - }> - - - 型号 - - {gpuInfo.name} - - - - 显存 - {gpuInfo.memory_gb.toFixed(0)} GB - - - 驱动 - {gpuInfo.driver_version} - - - - ); -} - -function DLSSIndicatorCard() { - const { t } = useTranslation(); - const { config: themeConfig } = useThemeColor(); - const toast = useToast(); - const [isEnabled, setIsEnabled] = useState(false); - const [isLoading, setIsLoading] = useState(false); - - const subTextColor = useColorModeValue("gray.500", "#888888"); - - useEffect(() => { - invoke("get_dlss_settings_status") - .then((status) => setIsEnabled(status.dlss_indicator_enabled)) - .catch(() => {}); - }, []); - - const handleToggle = async () => { - setIsLoading(true); - try { - const result = await invoke("toggle_dlss_indicator", { - enable: !isEnabled, - }); - setIsEnabled(result); - toast({ - title: isEnabled ? t("dlssIndicator.disabled") : t("dlssIndicator.enabled"), - status: "success", - duration: 3000, - isClosable: true, - }); - } catch (error) { - toast({ - title: String(error), - status: "error", - duration: 3000, - isClosable: true, - }); - } - setIsLoading(false); - }; - - return ( - }> - - - {isLoading ? ( - - - - {isEnabled ? t("dlssIndicator.disabling") : t("dlssIndicator.enabling")} - - - ) : ( - <> - - {t("dlssIndicator.description")} - - - {t("dlssIndicator.note")} - - - )} - - - - - ); -} - -function PresetReferenceTable() { - const { t } = useTranslation(); - const { config: themeConfig } = useThemeColor(); - const presetReferences = getPresetReferences(t); - - const tableBg = useColorModeValue("gray.50", "#1a1a1a"); - const headerBg = useColorModeValue("gray.100", "#252525"); - const textColor = useColorModeValue("gray.800", "#e0e0e0"); - - return ( - }> - - {t("dlssPresetTable.description")} - - - - - - - - - - - - - - {presetReferences.map((ref) => ( - - - - - - - ))} - -
{t("dlssPresetTable.gpuSeries")}{t("dlssPresetTable.recommendedPreset")}{t("dlssPresetTable.driverVersion")}{t("dlssPresetTable.scenario")}
{ref.gpuSeries} - - {ref.preset} - - {ref.driverVersion}{ref.typeLabel}
-
-
- ); -} - -export default function DLSSPresetPage() { - const { t } = useTranslation(); - const { config: themeConfig } = useThemeColor(); - const navigate = useNavigate(); - const headingColor = useColorModeValue("gray.900", "#ffffff"); - - return ( - - - } - variant="ghost" - onClick={() => navigate("/builtin-tools")} - color={headingColor} - /> - - - {t("dlssPreset.title")} - - - - - - - - - - - - - - - - - ); -} diff --git a/参考/NexBox-main/src/pages/DeltaForcePage.tsx b/参考/NexBox-main/src/pages/DeltaForcePage.tsx deleted file mode 100644 index 2bc9161..0000000 --- a/参考/NexBox-main/src/pages/DeltaForcePage.tsx +++ /dev/null @@ -1,1074 +0,0 @@ -import { - Box, - Text, - Heading, - VStack, - HStack, - useColorModeValue, - Badge, - Spinner, - useToast, - SimpleGrid, - Input, - InputGroup, - InputLeftElement, - Button, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalFooter, - ModalCloseButton, - Textarea, - FormControl, - FormLabel, - Wrap, - WrapItem, - Divider, - IconButton, -} from "@chakra-ui/react"; -import { useState, useEffect, useRef, useCallback, useMemo, memo } from "react"; -import { invoke } from "@tauri-apps/api/core"; -import { useTranslation } from "react-i18next"; -import { Search, Heart, Copy, Check, MapPin, Plus, ChevronLeft, ChevronRight, Globe, Flag, Map, Image } from "lucide-react"; -import { Link } from "react-router-dom"; -import { LiquidGlassCard } from "@/components/special/liquid-glass-card"; -import { LiquidGlassButton } from "@/components/special/liquid-glass-button"; -import { CustomSelect } from "@/components/special/custom-select"; -import { useBackground } from "@/contexts/background-context"; -import { useThemeColor } from "@/contexts/theme-color-context"; - - -// ── Types ── -interface DeltaPasswordItem { - name: string; - password: string; -} - -interface Category { - id: number; - name: string; - icon: string; - sort_order: number; - loadout_count: number; -} - -interface WeaponItem { - weapon_name: string; - count: number; -} - -interface LoadoutItem { - id: number; - category_id: number; - weapon_name: string; - code: string; - description: string; - cost: number; - author: string; - likes: number; - status: string; - created_at: string; - category_name: string; -} - -interface LoadoutsResponse { - data: LoadoutItem[]; - total: number; - page: number; - totalPages: number; -} - -// ── API ── -const API_BASE = "https://df.nexbox.top"; - -async function apiGet(path: string): Promise { - const res = await fetch(`${API_BASE}${path}`); - if (!res.ok) { - const text = await res.text(); - throw new Error(text.slice(0, 100) || `HTTP ${res.status}`); - } - return res.json(); -} - -async function apiPost(path: string, body?: unknown): Promise { - const res = await fetch(`${API_BASE}${path}`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: body ? JSON.stringify(body) : undefined, - }); - if (!res.ok) { - const text = await res.text(); - throw new Error(text.slice(0, 100) || `HTTP ${res.status}`); - } - return res.json(); -} - -// ── PasswordCard (unchanged) ── -function PasswordCard() { - const { t } = useTranslation(); - const toast = useToast(); - const [passwords, setPasswords] = useState([]); - const [isLoading, setIsLoading] = useState(true); - const [copiedIndex, setCopiedIndex] = useState(null); - const { getActiveColor } = useThemeColor(); - const primaryColor = getActiveColor(); - const subTextColor = useColorModeValue("#000000", "#888888"); - const textColor = useColorModeValue("#000000", "#e0e0e0"); - const cardItemBg = useColorModeValue("gray.50", "#1a1a1a"); - const cardItemHoverBg = useColorModeValue("gray.100", "#222222"); - const { liquidGlassEnabled } = useBackground(); - - useEffect(() => { - loadPasswords(); - const interval = setInterval(loadPasswords, 60000); - return () => clearInterval(interval); - }, []); - - const loadPasswords = async () => { - try { - const data = await invoke("get_delta_passwords"); - setPasswords(data); - } catch (error) { - console.error("Failed to load passwords:", error); - } finally { - setIsLoading(false); - } - }; - - const copyToClipboard = async (text: string, index: number) => { - try { - await navigator.clipboard.writeText(text); - setCopiedIndex(index); - toast({ - title: t("deltaForce.copySuccess"), - status: "success", - duration: 2000, - isClosable: true, - }); - setTimeout(() => setCopiedIndex(null), 2000); - } catch { - toast({ - title: t("deltaForce.copyFailed"), - status: "error", - duration: 2000, - isClosable: true, - }); - } - }; - - const content = ( - - - {t("deltaForce.dailyPassword")} - - {isLoading ? ( - - - {t("deltaForce.loading")} - - ) : passwords.length === 0 ? ( - {t("deltaForce.noPassword")} - ) : ( - - {passwords.map((item, index) => { - const passwordCard = ( - - - {item.name} - - {item.password} - - {copiedIndex === index && ( - - {t("deltaForce.copied")} - - )} - - ); - - if (liquidGlassEnabled) { - return ( - copyToClipboard(item.password, index)}> - {passwordCard} - - ); - } - - return ( - copyToClipboard(item.password, index)} - _hover={{ bg: cardItemHoverBg }} - transition="background-color 0.2s" - > - {passwordCard} - - ); - })} - - )} - - ); - - if (liquidGlassEnabled) { - return {content}; - } - return ( - - {content} - - ); -} - -// ── MoreGunCodesCard ── -function MoreGunCodesCard() { - const { t } = useTranslation(); - const { getActiveColor } = useThemeColor(); - const primaryColor = getActiveColor(); - const subTextColor = useColorModeValue("#000000", "#888888"); - const cardBg = useColorModeValue("gray.50", "#1a1a1a"); - const cardHoverBg = useColorModeValue("gray.100", "#222222"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const { liquidGlassEnabled } = useBackground(); - const textColor = useColorModeValue("#000000", "#e0e0e0"); - - const content = ( - - - - {t("deltaForce.moreGunCodes", "更多改枪码")} - - - {t("deltaForce.moreGunCodesDesc", "探索更多改枪码平台")} - - - ); - - if (liquidGlassEnabled) { - return ( - - - {content} - - - ); - } - - return ( - - {content} - - ); -} - -// ── OfficialMapCard ── -function OfficialMapCard() { - const { t } = useTranslation(); - const { getActiveColor } = useThemeColor(); - const primaryColor = getActiveColor(); - const subTextColor = useColorModeValue("#000000", "#888888"); - const cardBg = useColorModeValue("gray.50", "#1a1a1a"); - const cardHoverBg = useColorModeValue("gray.100", "#222222"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const { liquidGlassEnabled } = useBackground(); - const textColor = useColorModeValue("#000000", "#e0e0e0"); - const [isOpening, setIsOpening] = useState(false); - const toast = useToast(); - - const handleOpen = async () => { - if (isOpening) return; - setIsOpening(true); - try { - await invoke("open_platform_window", { - url: "https://df.qq.com/cp/a20240729directory/", - title: t("deltaForce.officialMapToolTitle", "三角洲行动 - 官方地图工具"), - label: `official-map-${Date.now()}`, - }); - } catch (error) { - toast({ - title: t("deltaForce.openFailed", "打开失败"), - status: "error", - duration: 2000, - isClosable: true, - }); - } finally { - setIsOpening(false); - } - }; - - const content = ( - - - - {t("deltaForce.officialMaps", "官方地图")} - - - {t("deltaForce.mapToolDesc", "物资点、出生点、撤离点及首领坐标")} - - {isOpening && } - - ); - - if (liquidGlassEnabled) { - return ( - - - {content} - - - ); - } - - return ( - - {content} - - ); -} - -// ── OfficialWallpaperCard ── -function OfficialWallpaperCard() { - const { t } = useTranslation(); - const { getActiveColor } = useThemeColor(); - const primaryColor = getActiveColor(); - const subTextColor = useColorModeValue("#000000", "#888888"); - const cardBg = useColorModeValue("gray.50", "#1a1a1a"); - const cardHoverBg = useColorModeValue("gray.100", "#222222"); - const borderColor = useColorModeValue("gray.200", "#333333"); - const { liquidGlassEnabled } = useBackground(); - const textColor = useColorModeValue("#000000", "#e0e0e0"); - const [isOpening, setIsOpening] = useState(false); - const toast = useToast(); - - const handleOpen = async () => { - if (isOpening) return; - setIsOpening(true); - try { - const { open } = await import("@tauri-apps/plugin-shell"); - await open("https://df.qq.com/cp/community1031/wallpaper.html#/"); - } catch (error) { - toast({ - title: t("deltaForce.openFailed", "打开失败"), - status: "error", - duration: 2000, - isClosable: true, - }); - } finally { - setIsOpening(false); - } - }; - - const content = ( - - - - {t("deltaForce.officialWallpaper", "官方壁纸")} - - - {t("deltaForce.wallpaperDesc", "官方高清壁纸下载")} - - {isOpening && } - - ); - - if (liquidGlassEnabled) { - return ( - - - {content} - - - ); - } - - return ( - - {content} - - ); -} - -// ── Memoized LoadoutCard ── -const LoadoutCard = memo(function LoadoutCard({ - item, - isCopied, - isLiked, - isReported, - onCopy, - onLike, - onReport, - textColor, - subTextColor, - borderColor, - cardBg, - cardHoverBg, - liquidGlassEnabled, - primaryColor, -}: { - item: LoadoutItem; - isCopied: boolean; - isLiked: boolean; - isReported: boolean; - onCopy: (id: number, code: string) => void; - onLike: (id: number) => void; - onReport: (id: number) => void; - textColor: string; - subTextColor: string; - borderColor: string; - cardBg: string; - cardHoverBg: string; - liquidGlassEnabled: boolean; - primaryColor: string; -}) { - const { t } = useTranslation(); - const code = ( - - - - - {item.weapon_name} - - - {item.category_name} - - - - 💰 {Number(item.cost).toLocaleString()} - - - - - - {item.code} - - - - - {item.description && ( - - {item.description} - - )} - - - - {item.author || "匿名"} - - - - onLike(item.id)} - icon={} - /> - - {item.likes} - - - - - ); - - if (liquidGlassEnabled) { - return {code}; - } - return ( - - {code} - - ); -}); - -// ── GunLoadoutBrowser ── -const GunLoadoutBrowser = memo(function GunLoadoutBrowser() { - const { t } = useTranslation(); - const toast = useToast(); - const { getActiveColor } = useThemeColor(); - const { liquidGlassEnabled, liquidGlassBlur } = useBackground(); - const [showBlur, setShowBlur] = useState(false); - - useEffect(() => { - if (liquidGlassEnabled) { - const timer = setTimeout(() => setShowBlur(true), 250); - return () => clearTimeout(timer); - } else { - setShowBlur(false); - } - }, [liquidGlassEnabled]); - - const effectiveBlur = showBlur ? liquidGlassBlur : 0; - - const primaryColor = getActiveColor(); - const textColor = useColorModeValue("#000000", "#e0e0e0"); - const subTextColor = useColorModeValue("#000000", "#888888"); - const cardBg = useColorModeValue("gray.50", "#1a1a1a"); - const cardHoverBg = useColorModeValue("gray.100", "#222222"); - const borderColor = useColorModeValue("gray.200", "#333333"); - - const [categories, setCategories] = useState([]); - const [weaponsMap, setWeaponsMap] = useState>({}); - const [selectedCategoryId, setSelectedCategoryId] = useState("all"); - const [selectedWeapon, setSelectedWeapon] = useState(""); - const [loadouts, setLoadouts] = useState([]); - const [total, setTotal] = useState(0); - const [page, setPage] = useState(1); - const [totalPages, setTotalPages] = useState(1); - const [searchQuery, setSearchQuery] = useState(""); - const [activeSearch, setActiveSearch] = useState(""); - const [sortBy, setSortBy] = useState<"likes" | "latest">("likes"); - const [isInitialLoading, setIsInitialLoading] = useState(true); - const [isRefreshing, setIsRefreshing] = useState(false); - const [copiedId, setCopiedId] = useState(null); - const [likedIds, setLikedIds] = useState>(new Set()); - const [reportedIds, setReportedIds] = useState>(new Set()); - const searchTimer = useRef | null>(null); - const abortRef = useRef(null); - - // ── Load categories ── - useEffect(() => { - (async () => { - try { - const cats = await apiGet("/api/categories"); - setCategories(cats); - } catch (err) { - console.error("Failed to load categories:", err); - } - })(); - }, []); - - // ── Load loadouts on filter change ── - useEffect(() => { - loadLoadouts(); - }, [selectedCategoryId, selectedWeapon, page, sortBy, activeSearch]); - - const loadLoadouts = useCallback(async () => { - if (abortRef.current) abortRef.current.abort(); - const controller = new AbortController(); - abortRef.current = controller; - - setIsRefreshing(true); - try { - const params = new URLSearchParams(); - if (selectedCategoryId !== "all") params.set("category_id", String(selectedCategoryId)); - if (selectedWeapon) params.set("weapon_name", selectedWeapon); - if (activeSearch.trim()) params.set("search", activeSearch.trim()); - params.set("page", String(page)); - - const res = await fetch(`${API_BASE}/api/loadouts?${params}`, { signal: controller.signal }); - if (!res.ok) { - const text = await res.text(); - throw new Error(text.slice(0, 100) || `HTTP ${res.status}`); - } - const result: LoadoutsResponse = await res.json(); - if (controller.signal.aborted) return; - setLoadouts(result.data); - setTotal(result.total); - setTotalPages(result.totalPages); - setIsInitialLoading(false); - } catch (err: unknown) { - if (err instanceof Error && err.name === "AbortError") return; - toast({ - title: "加载失败", - description: String(err), - status: "error", - duration: 3000, - isClosable: true, - }); - setLoadouts([]); - setIsInitialLoading(false); - } finally { - setIsRefreshing(false); - } - }, [selectedCategoryId, selectedWeapon, page, sortBy, activeSearch, toast]); - - // ── Load weapons when category selected ── - useEffect(() => { - if (selectedCategoryId === "all") { - setSelectedWeapon(""); - return; - } - if (!weaponsMap[selectedCategoryId]) { - (async () => { - try { - const weapons = await apiGet(`/api/weapons/${selectedCategoryId}`); - setWeaponsMap((prev) => ({ ...prev, [selectedCategoryId]: weapons })); - } catch (err) { - console.error("Failed to load weapons:", err); - } - })(); - } - setSelectedWeapon(""); - }, [selectedCategoryId]); - - // ── Search debounce ── - const handleSearchChange: React.ChangeEventHandler = useCallback((e) => { - const val = e.target.value; - setSearchQuery(val); - if (searchTimer.current) clearTimeout(searchTimer.current); - searchTimer.current = setTimeout(() => { - setActiveSearch(val); - setPage(1); - }, 300); - }, []); - - // ── Copy code ── - const handleCopy = useCallback(async (id: number, code: string) => { - try { - await navigator.clipboard.writeText(code); - setCopiedId(id); - setTimeout(() => setCopiedId(null), 1500); - } catch { - // silent - } - }, []); - - // ── Like ── - const handleLike = useCallback(async (id: number) => { - try { - const result = await apiPost<{ id: number; likes: number }>(`/api/loadouts/${id}/like`); - setLikedIds((prev) => new Set(prev).add(id)); - setLoadouts((prev) => - prev.map((l) => (l.id === id ? { ...l, likes: result.likes } : l)) - ); - } catch { - // silent - } - }, []); - - // ── Report ── - const handleReport = useCallback(async (id: number) => { - if (reportedIds.has(id)) return; - try { - await apiPost(`/api/loadouts/${id}/report`); - setReportedIds((prev) => new Set(prev).add(id)); - toast({ - title: t("deltaForce.reported", "已报告管理员"), - status: "success", - duration: 2000, - isClosable: true, - }); - } catch { - // silent - } - }, [reportedIds, toast, t]); - - // ── Upload state ── - const [isUploadOpen, setIsUploadOpen] = useState(false); - const [uploadCategory, setUploadCategory] = useState(""); - const [uploadWeapon, setUploadWeapon] = useState(""); - const [uploadCode, setUploadCode] = useState(""); - const [uploadDesc, setUploadDesc] = useState(""); - const [uploadCost, setUploadCost] = useState(""); - const [uploadAuthor, setUploadAuthor] = useState(""); - const [uploadWeapons, setUploadWeapons] = useState([]); - const [isUploading, setIsUploading] = useState(false); - const [uploadError, setUploadError] = useState(""); - - // load weapons when upload modal opens or category changes - const loadUploadWeapons = useCallback(async (catId: string) => { - try { - const weapons = await apiGet(`/api/weapons/${catId}`); - setUploadWeapons(weapons); - } catch { - setUploadWeapons([]); - } - }, []); - - const openUpload = useCallback(() => { - setUploadError(""); - setUploadCode(""); - setUploadDesc(""); - setUploadCost(""); - setUploadAuthor(""); - if (categories.length > 0) { - const firstId = String(categories[0].id); - setUploadCategory(firstId); - setUploadWeapon(""); - setUploadWeapons([]); - loadUploadWeapons(firstId); - } - setIsUploadOpen(true); - }, [categories, loadUploadWeapons]); - - const handleUploadCategoryChange = useCallback((catId: string) => { - setUploadCategory(catId); - setUploadWeapon(""); - loadUploadWeapons(catId); - }, [loadUploadWeapons]); - - const handleUploadSubmit = useCallback(async () => { - setUploadError(""); - if (!uploadCategory) { - setUploadError("请选择分类"); - return; - } - if (!uploadWeapon) { - setUploadError("请选择武器"); - return; - } - if (!uploadCode.trim()) { - setUploadError("请输入改枪码"); - return; - } - const cost = parseInt(uploadCost); - if (!cost || cost <= 0) { - setUploadError("请输入有效的改枪费用"); - return; - } - - setIsUploading(true); - try { - await apiPost("/api/loadouts", { - category_id: Number(uploadCategory), - weapon_name: uploadWeapon, - code: uploadCode.trim(), - cost: cost, - description: uploadDesc.trim(), - author: uploadAuthor.trim() || "匿名", - }); - toast({ - title: t("deltaForce.uploadSuccess"), - description: t("deltaForce.uploadQueueHint"), - status: "success", - duration: 3000, - isClosable: true, - }); - setIsUploadOpen(false); - setPage(1); - } catch (err) { - setUploadError(`${t("deltaForce.uploadFailed")}: ${err}`); - } finally { - setIsUploading(false); - } - }, [uploadCategory, uploadWeapon, uploadCode, uploadCost, uploadDesc, uploadAuthor, toast, t]); - - // ── Memoized category pills ── - const categoryPills = useMemo(() => ( - - - { setSelectedCategoryId("all"); setPage(1); }} - > - {t("deltaForce.allCategories")} - - - {categories.map((cat) => ( - - { setSelectedCategoryId(cat.id); setPage(1); }} - > - {cat.name} - {cat.loadout_count} - - - ))} - - ), [categories, selectedCategoryId, selectedWeapon, primaryColor, subTextColor, borderColor, cardHoverBg, t]); - - const showEmpty = !isInitialLoading && loadouts.length === 0; - const showCards = loadouts.length > 0; - - const weaponCodesContent = ( - <> - - - {t("deltaForce.weaponCodes")} - {total} 条 - - } onClick={openUpload}> - {t("deltaForce.upload")} - - - - {categoryPills} - - - - - - - - {selectedCategoryId !== "all" && weaponsMap[selectedCategoryId]?.length > 0 && ( - { setSelectedWeapon(val); setPage(1); }} - options={[ - { value: "", label: t("deltaForce.allWeapons") }, - ...weaponsMap[selectedCategoryId].map((w) => ({ - value: w.weapon_name, - label: `${w.weapon_name} (${w.count})` - })) - ]} - width="180px" - placeholder={t("deltaForce.allWeapons")} - /> - )} - - - - - - - {isInitialLoading ? ( - - - - ) : showEmpty ? ( - - {t("deltaForce.noLoadouts")} - {t("deltaForce.noLoadoutsHint")} - - ) : null} - - {showCards && ( - - {loadouts.map((item) => ( - - ))} - - )} - - {showCards && totalPages > 1 && ( - - - {t("deltaForce.pageInfo", { page, totalPages })} - - - )} - - setIsUploadOpen(false)} isCentered size="md"> - - - {t("deltaForce.upload")} - - - - - {t("deltaForce.category")} - ({ value: String(cat.id), label: cat.name }))} - width="100%" - /> - - - {t("deltaForce.weaponName")} - ({ - value: w.weapon_name, - label: `${w.weapon_name} (${w.count})` - })) - ]} - width="100%" - placeholder={t("deltaForce.selectWeapon")} - /> - - - {t("deltaForce.code")} -