@psnext/slingcli 2.4.20260515-1 → 2.4.20260520-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/bin/sling.js +103 -10
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js +2 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +9 -13
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.browser.js +5 -5
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js +2 -3
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js +1 -4
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/BedrockRuntimeClient.d.ts +1 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/BedrockRuntimeClient.d.ts +5 -7
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +11 -19
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +14 -16
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +595 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +715 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +588 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +10 -10
- package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +36 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +26 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +37 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.js +3 -0
- package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/check-features.js +1 -1
- package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/user-agent-middleware.js +1 -1
- package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/partition.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.browser.js +1 -0
- package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +9 -9
- package/node_modules/@aws-sdk/core/dist-types/api-extractor-type-index.d.ts +3 -2
- package/node_modules/@aws-sdk/core/dist-types/index.d.ts +12 -14
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.browser.d.ts +47 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +38 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.native.d.ts +48 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -0
- package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +65 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +116 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +123 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +116 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -0
- package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -1
- package/node_modules/@aws-sdk/core/package.json +26 -7
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +156 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +80 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +12 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +9 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +12 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
- package/node_modules/@aws-sdk/{middleware-host-header → credential-provider-sso/node_modules/@aws-sdk/token-providers}/package.json +27 -17
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-websocket/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -21
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STSClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -14
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +176 -564
- package/node_modules/@mariozechner/clipboard/Cargo.toml +21 -2
- package/node_modules/@mariozechner/clipboard/README.md +2 -0
- package/node_modules/@mariozechner/clipboard/package.json +11 -11
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +307 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +93 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +313 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +471 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +252 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +431 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +712 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +916 -0
- package/node_modules/@mariozechner/clipboard/src/lib.rs +3 -0
- package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +3 -0
- package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
- package/node_modules/@mariozechner/{clipboard-linux-x64-gnu → clipboard-darwin-arm64}/package.json +6 -9
- package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +3 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +19 -0
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -3
- package/node_modules/@smithy/types/README.md +3 -3
- package/node_modules/@smithy/types/dist-types/abort.d.ts +4 -6
- package/node_modules/@smithy/types/dist-types/auth/auth.d.ts +6 -4
- package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +7 -10
- package/node_modules/@smithy/types/dist-types/checksum.d.ts +4 -6
- package/node_modules/@smithy/types/dist-types/client.d.ts +8 -8
- package/node_modules/@smithy/types/dist-types/command.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/crypto.d.ts +6 -8
- package/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +6 -7
- package/node_modules/@smithy/types/dist-types/eventStream.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +9 -10
- package/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/http.d.ts +18 -21
- package/node_modules/@smithy/types/dist-types/logger.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/middleware.d.ts +28 -27
- package/node_modules/@smithy/types/dist-types/pagination.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/serde.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/shapes.d.ts +9 -12
- package/node_modules/@smithy/types/dist-types/signature.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/stream.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +7 -11
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +23 -29
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +9 -19
- package/node_modules/@smithy/types/dist-types/transfer.d.ts +2 -1
- package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +14 -18
- package/node_modules/@smithy/types/dist-types/transform/exact.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +12 -12
- package/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +14 -9
- package/node_modules/@smithy/types/dist-types/uri.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/util.d.ts +28 -28
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/async_hooks.d.ts +108 -0
- package/node_modules/@types/node/crypto.d.ts +14 -3
- package/node_modules/@types/node/fs/promises.d.ts +126 -0
- package/node_modules/@types/node/fs.d.ts +4 -2
- package/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/node/inspector.generated.d.ts +5 -0
- package/node_modules/@types/node/module.d.ts +1 -0
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +25 -1
- package/node_modules/@types/node/quic.d.ts +2 -2
- package/node_modules/@types/node/repl.d.ts +15 -0
- package/node_modules/@types/node/stream/iter.d.ts +301 -0
- package/node_modules/@types/node/test.d.ts +38 -12
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/node/vm.d.ts +5 -4
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.js +81 -41
- package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
- package/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.js +81 -41
- package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/node/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.js +81 -41
- package/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
- package/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
- package/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.js +81 -41
- package/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
- package/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.js +81 -41
- package/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/node/index.d.ts +37 -17
- package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.js +81 -41
- package/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
- package/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/perf.js +1 -2
- package/node_modules/lru-cache/dist/esm/perf.js.map +1 -1
- package/node_modules/lru-cache/package.json +8 -8
- package/node_modules/protobufjs/README.md +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +193 -157
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +213 -177
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/index.d.ts +2 -1
- package/node_modules/protobufjs/package.json +7 -4
- package/node_modules/protobufjs/src/converter.js +5 -3
- package/node_modules/protobufjs/src/type.js +1 -1
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/package.json +2 -2
- package/slingshot/index.js +201 -201
- package/node_modules/@aws-sdk/middleware-host-header/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-host-header/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +0 -41
- package/node_modules/@aws-sdk/middleware-logger/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-logger/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +0 -48
- package/node_modules/@aws-sdk/middleware-logger/dist-es/index.js +0 -1
- package/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts +0 -1
- package/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts +0 -1
- package/node_modules/@aws-sdk/middleware-logger/package.json +0 -59
- package/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-recursion-detection/README.md +0 -17
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +0 -29
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.browser.js +0 -5
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +0 -33
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.native.js +0 -5
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +0 -66
- package/node_modules/@aws-sdk/middleware-user-agent/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-user-agent/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +0 -194
- package/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +0 -61
- package/node_modules/@aws-sdk/region-config-resolver/README.md +0 -19
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +0 -38
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.browser.js +0 -6
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +0 -19
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.native.js +0 -6
- package/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/dist-types/index.d.ts +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/dist-types/ts3.4/index.d.ts +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/package.json +0 -64
- package/node_modules/@aws-sdk/util-endpoints/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-endpoints/README.md +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +0 -406
- package/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +0 -267
- package/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +0 -267
- package/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/package.json +0 -59
- package/node_modules/@aws-sdk/util-user-agent-browser/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-user-agent-browser/README.md +0 -29
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +0 -24
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.browser.js +0 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +0 -61
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js +0 -22
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.browser.js +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.browser.d.ts +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.browser.d.ts +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +0 -60
- package/node_modules/@aws-sdk/util-user-agent-node/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-user-agent-node/README.md +0 -17
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +0 -185
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +0 -68
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/clipboard.linux-x64-gnu.node +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-es/index.js → core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-es → core/dist-es/submodules/client/middleware-logger}/loggerMiddleware.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/configuration.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/getRecursionDetectionPlugin.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/configurations.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/constants.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/encode-features.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/awsRegionConfig.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/extensions/index.js → core/dist-es/submodules/client/region-config-resolver/extensions.js} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/aws.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/parseArn.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/isIpAddress.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveEndpoint.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointError.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/ErrorRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/RuleSetObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/TreeRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/shared.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/configurations.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.native.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.native.js} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/crt-availability.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/defaultUserAgent.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/is-crt-available.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/index.d.ts → core/dist-types/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-types → core/dist-types/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/getRecursionDetectionPlugin.d.ts → core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/extensions/index.d.ts → core/dist-types/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/aws.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.native.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4/getRecursionDetectionPlugin.d.ts → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/extensions/index.d.ts → core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/aws.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.native.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver → credential-provider-sso/node_modules/@aws-sdk/token-providers}/LICENSE +0 -0
|
@@ -0,0 +1,916 @@
|
|
|
1
|
+
use crate::clipboard_rs::{
|
|
2
|
+
common::Result,
|
|
3
|
+
// #[cfg(feature = "image")]
|
|
4
|
+
ClipboardContent,
|
|
5
|
+
ClipboardHandler,
|
|
6
|
+
ContentFormat,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
#[cfg(feature = "image")]
|
|
10
|
+
use crate::clipboard_rs::{common::RustImage, RustImageData};
|
|
11
|
+
|
|
12
|
+
use crate::Clipboard;
|
|
13
|
+
use std::sync::mpsc::{self, Receiver, Sender};
|
|
14
|
+
use std::{
|
|
15
|
+
sync::{Arc, RwLock},
|
|
16
|
+
thread,
|
|
17
|
+
time::{Duration, Instant},
|
|
18
|
+
};
|
|
19
|
+
use x11rb::{
|
|
20
|
+
connection::Connection,
|
|
21
|
+
protocol::{
|
|
22
|
+
xfixes,
|
|
23
|
+
xproto::{
|
|
24
|
+
Atom, AtomEnum, ConnectionExt as _, CreateWindowAux, EventMask, PropMode, Property,
|
|
25
|
+
SelectionNotifyEvent, SelectionRequestEvent, WindowClass, SELECTION_NOTIFY_EVENT,
|
|
26
|
+
},
|
|
27
|
+
Event,
|
|
28
|
+
},
|
|
29
|
+
rust_connection::RustConnection,
|
|
30
|
+
wrapper::ConnectionExt as _,
|
|
31
|
+
COPY_DEPTH_FROM_PARENT, CURRENT_TIME,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
x11rb::atom_manager! {
|
|
35
|
+
pub Atoms: AtomCookies {
|
|
36
|
+
CLIPBOARD,
|
|
37
|
+
CLIPBOARD_MANAGER,
|
|
38
|
+
PROPERTY,
|
|
39
|
+
SAVE_TARGETS,
|
|
40
|
+
TARGETS,
|
|
41
|
+
ATOM,
|
|
42
|
+
INCR,
|
|
43
|
+
TIMESTAMP,
|
|
44
|
+
MULTIPLE,
|
|
45
|
+
|
|
46
|
+
UTF8_STRING,
|
|
47
|
+
UTF8_MIME_0: b"text/plain;charset=utf-8",
|
|
48
|
+
UTF8_MIME_1: b"text/plain;charset=UTF-8",
|
|
49
|
+
// Text in ISO Latin-1 encoding
|
|
50
|
+
// See: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.2
|
|
51
|
+
STRING,
|
|
52
|
+
// Text in unknown encoding
|
|
53
|
+
// See: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.2
|
|
54
|
+
TEXT,
|
|
55
|
+
TEXT_MIME_UNKNOWN: b"text/plain",
|
|
56
|
+
// Rich Text Format
|
|
57
|
+
RTF: b"text/rtf",
|
|
58
|
+
RTF_1: b"text/richtext",
|
|
59
|
+
HTML: b"text/html",
|
|
60
|
+
PNG_MIME: b"image/png",
|
|
61
|
+
FILE_LIST: b"text/uri-list",
|
|
62
|
+
GNOME_COPY_FILES: b"x-special/gnome-copied-files",
|
|
63
|
+
NAUTILUS_FILE_LIST: b"x-special/nautilus-clipboard",
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
pub const DEFAULT_READ_TIMEOUT: u64 = 500;
|
|
68
|
+
|
|
69
|
+
// zh: 用于创建 X11 剪贴板上下文的选项
|
|
70
|
+
// en: Options for creating an X11 clipboard context
|
|
71
|
+
pub struct ClipboardContextX11Options {
|
|
72
|
+
// zh: 剪贴板读取操作超时
|
|
73
|
+
// en: Timeout for clipboard read operations
|
|
74
|
+
pub read_timeout: Option<Duration>,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const FILE_PATH_PREFIX: &str = "file://";
|
|
78
|
+
pub struct ClipboardContext {
|
|
79
|
+
inner: Arc<InnerContext>,
|
|
80
|
+
read_timeout: Option<Duration>,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
struct ClipboardData {
|
|
84
|
+
format: Atom,
|
|
85
|
+
data: Vec<u8>,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
struct InnerContext {
|
|
89
|
+
server: XServerContext,
|
|
90
|
+
server_for_write: XServerContext,
|
|
91
|
+
ignore_formats: Vec<Atom>,
|
|
92
|
+
// 此刻待写入的剪贴板内容
|
|
93
|
+
wait_write_data: RwLock<Vec<ClipboardData>>,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
impl InnerContext {
|
|
97
|
+
pub fn new() -> Result<Self> {
|
|
98
|
+
let server = XServerContext::new()?;
|
|
99
|
+
let server_for_write = XServerContext::new()?;
|
|
100
|
+
let wait_write_data = RwLock::new(Vec::new());
|
|
101
|
+
|
|
102
|
+
let ignore_formats = vec![
|
|
103
|
+
server.atoms.TIMESTAMP,
|
|
104
|
+
server.atoms.MULTIPLE,
|
|
105
|
+
server.atoms.TARGETS,
|
|
106
|
+
server.atoms.SAVE_TARGETS,
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
Ok(Self {
|
|
110
|
+
server,
|
|
111
|
+
server_for_write,
|
|
112
|
+
ignore_formats,
|
|
113
|
+
wait_write_data,
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
pub fn handle_selection_request(&self, event: SelectionRequestEvent) -> Result<()> {
|
|
118
|
+
let success;
|
|
119
|
+
let ctx = &self.server_for_write;
|
|
120
|
+
let atoms = ctx.atoms;
|
|
121
|
+
// we are asked for a list of supported conversion targets
|
|
122
|
+
if event.target == atoms.TARGETS {
|
|
123
|
+
let reader = self.wait_write_data.read();
|
|
124
|
+
match reader {
|
|
125
|
+
Ok(data_list) => {
|
|
126
|
+
let mut targets = Vec::with_capacity(10);
|
|
127
|
+
targets.push(atoms.TARGETS);
|
|
128
|
+
targets.push(atoms.SAVE_TARGETS);
|
|
129
|
+
if !data_list.is_empty() {
|
|
130
|
+
data_list.iter().for_each(|data| {
|
|
131
|
+
targets.push(data.format);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
ctx.conn.change_property32(
|
|
135
|
+
PropMode::REPLACE,
|
|
136
|
+
event.requestor,
|
|
137
|
+
event.property,
|
|
138
|
+
AtomEnum::ATOM,
|
|
139
|
+
&targets,
|
|
140
|
+
)?;
|
|
141
|
+
success = true;
|
|
142
|
+
}
|
|
143
|
+
Err(_) => return Err("Failed to read clipboard data".into()),
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
let reader = self.wait_write_data.read();
|
|
147
|
+
match reader {
|
|
148
|
+
Ok(data_list) => {
|
|
149
|
+
success = match data_list.iter().find(|d| d.format == event.target) {
|
|
150
|
+
Some(data) => {
|
|
151
|
+
ctx.conn.change_property8(
|
|
152
|
+
PropMode::REPLACE,
|
|
153
|
+
event.requestor,
|
|
154
|
+
event.property,
|
|
155
|
+
event.target,
|
|
156
|
+
&data.data,
|
|
157
|
+
)?;
|
|
158
|
+
true
|
|
159
|
+
}
|
|
160
|
+
None => false,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
Err(_) => return Err("Failed to read clipboard data".into()),
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// on failure, we notify the requester of it
|
|
167
|
+
let property = if success {
|
|
168
|
+
event.property
|
|
169
|
+
} else {
|
|
170
|
+
AtomEnum::NONE.into()
|
|
171
|
+
};
|
|
172
|
+
// tell the requester that we finished sending data
|
|
173
|
+
ctx.conn.send_event(
|
|
174
|
+
false,
|
|
175
|
+
event.requestor,
|
|
176
|
+
EventMask::NO_EVENT,
|
|
177
|
+
SelectionNotifyEvent {
|
|
178
|
+
response_type: SELECTION_NOTIFY_EVENT,
|
|
179
|
+
sequence: event.sequence,
|
|
180
|
+
time: event.time,
|
|
181
|
+
requestor: event.requestor,
|
|
182
|
+
selection: event.selection,
|
|
183
|
+
target: event.target,
|
|
184
|
+
property,
|
|
185
|
+
},
|
|
186
|
+
)?;
|
|
187
|
+
ctx.conn.flush()?;
|
|
188
|
+
Ok(())
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
pub fn process_event(
|
|
192
|
+
&self,
|
|
193
|
+
buff: &mut Vec<u8>,
|
|
194
|
+
selection: Atom,
|
|
195
|
+
target: Atom,
|
|
196
|
+
property: Atom,
|
|
197
|
+
timeout: Option<Duration>,
|
|
198
|
+
sequence_number: u64,
|
|
199
|
+
) -> Result<()> {
|
|
200
|
+
let mut is_incr = false;
|
|
201
|
+
let start_time = if timeout.is_some() {
|
|
202
|
+
Some(Instant::now())
|
|
203
|
+
} else {
|
|
204
|
+
None
|
|
205
|
+
};
|
|
206
|
+
let ctx = &self.server;
|
|
207
|
+
let atoms = ctx.atoms;
|
|
208
|
+
loop {
|
|
209
|
+
if timeout
|
|
210
|
+
.into_iter()
|
|
211
|
+
.zip(start_time)
|
|
212
|
+
.next()
|
|
213
|
+
.map(|(timeout, time)| (Instant::now() - time) >= timeout)
|
|
214
|
+
.unwrap_or(false)
|
|
215
|
+
{
|
|
216
|
+
return Err("Timeout while waiting for clipboard data".into());
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
let (event, seq) = match ctx.conn.poll_for_event_with_sequence()? {
|
|
220
|
+
Some(event) => event,
|
|
221
|
+
None => {
|
|
222
|
+
thread::park_timeout(Duration::from_millis(50));
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
if seq < sequence_number {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
match event {
|
|
232
|
+
Event::SelectionNotify(event) => {
|
|
233
|
+
if event.selection != selection {
|
|
234
|
+
continue;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
let target_type = {
|
|
238
|
+
if target == atoms.TARGETS {
|
|
239
|
+
atoms.ATOM
|
|
240
|
+
} else {
|
|
241
|
+
target
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
let reply = ctx
|
|
246
|
+
.conn
|
|
247
|
+
.get_property(
|
|
248
|
+
false,
|
|
249
|
+
event.requestor,
|
|
250
|
+
event.property,
|
|
251
|
+
target_type,
|
|
252
|
+
buff.len() as u32,
|
|
253
|
+
u32::MAX,
|
|
254
|
+
)?
|
|
255
|
+
.reply()?;
|
|
256
|
+
|
|
257
|
+
if reply.type_ == atoms.INCR {
|
|
258
|
+
if let Some(mut value) = reply.value32() {
|
|
259
|
+
if let Some(size) = value.next() {
|
|
260
|
+
buff.reserve(size as usize);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
ctx.conn.delete_property(ctx.win_id, property)?.check()?;
|
|
264
|
+
is_incr = true;
|
|
265
|
+
continue;
|
|
266
|
+
} else if reply.type_ != target && reply.type_ != atoms.ATOM {
|
|
267
|
+
return Err("Clipboard data type mismatch".into());
|
|
268
|
+
}
|
|
269
|
+
buff.extend_from_slice(&reply.value);
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
Event::PropertyNotify(event) if is_incr => {
|
|
274
|
+
if event.state != Property::NEW_VALUE {
|
|
275
|
+
continue;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
let cookie = ctx
|
|
279
|
+
.conn
|
|
280
|
+
.get_property(false, ctx.win_id, property, AtomEnum::ATOM, 0, 0)?;
|
|
281
|
+
|
|
282
|
+
let length = cookie.reply()?.bytes_after;
|
|
283
|
+
|
|
284
|
+
let cookie =
|
|
285
|
+
ctx
|
|
286
|
+
.conn
|
|
287
|
+
.get_property(true, ctx.win_id, property, AtomEnum::NONE, 0, length)?;
|
|
288
|
+
let reply = cookie.reply()?;
|
|
289
|
+
if reply.type_ != target {
|
|
290
|
+
continue;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
let value = reply.value;
|
|
294
|
+
|
|
295
|
+
if !value.is_empty() {
|
|
296
|
+
buff.extend_from_slice(&value);
|
|
297
|
+
} else {
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
_ => (),
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
Ok(())
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
impl ClipboardContext {
|
|
309
|
+
pub fn new() -> Result<Self> {
|
|
310
|
+
Self::new_with_options(ClipboardContextX11Options {
|
|
311
|
+
read_timeout: Some(Duration::from_millis(DEFAULT_READ_TIMEOUT)),
|
|
312
|
+
})
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
pub fn new_with_options(options: ClipboardContextX11Options) -> Result<Self> {
|
|
316
|
+
// build connection to X server
|
|
317
|
+
let ctx = InnerContext::new()?;
|
|
318
|
+
let ctx_arc = Arc::new(ctx);
|
|
319
|
+
let ctx_clone = ctx_arc.clone();
|
|
320
|
+
|
|
321
|
+
thread::spawn(move || {
|
|
322
|
+
let res = process_server_req(&ctx_clone);
|
|
323
|
+
if let Err(e) = res {
|
|
324
|
+
println!("process_server_req error: {e:?}");
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
Ok(Self {
|
|
329
|
+
inner: ctx_arc,
|
|
330
|
+
read_timeout: options.read_timeout,
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
fn read(&self, format: &Atom) -> Result<Vec<u8>> {
|
|
335
|
+
let ctx = &self.inner.server;
|
|
336
|
+
let atoms = ctx.atoms;
|
|
337
|
+
let clipboard = atoms.CLIPBOARD;
|
|
338
|
+
let win_id = ctx.win_id;
|
|
339
|
+
let cookie =
|
|
340
|
+
ctx
|
|
341
|
+
.conn
|
|
342
|
+
.convert_selection(win_id, clipboard, *format, atoms.PROPERTY, CURRENT_TIME)?;
|
|
343
|
+
let sequence_num = cookie.sequence_number();
|
|
344
|
+
cookie.check()?;
|
|
345
|
+
let mut buff = Vec::new();
|
|
346
|
+
|
|
347
|
+
self.inner.process_event(
|
|
348
|
+
&mut buff,
|
|
349
|
+
clipboard,
|
|
350
|
+
*format,
|
|
351
|
+
atoms.PROPERTY,
|
|
352
|
+
self.read_timeout,
|
|
353
|
+
sequence_num,
|
|
354
|
+
)?;
|
|
355
|
+
|
|
356
|
+
ctx.conn.delete_property(win_id, atoms.PROPERTY)?.check()?;
|
|
357
|
+
|
|
358
|
+
Ok(buff)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
fn write(&self, data: Vec<ClipboardData>) -> Result<()> {
|
|
362
|
+
let writer = self.inner.wait_write_data.write();
|
|
363
|
+
match writer {
|
|
364
|
+
Ok(mut writer) => {
|
|
365
|
+
writer.clear();
|
|
366
|
+
writer.extend(data);
|
|
367
|
+
}
|
|
368
|
+
Err(_) => return Err("Failed to write clipboard data".into()),
|
|
369
|
+
}
|
|
370
|
+
let ctx = &self.inner.server_for_write;
|
|
371
|
+
let atoms = ctx.atoms;
|
|
372
|
+
|
|
373
|
+
let win_id = ctx.win_id;
|
|
374
|
+
let clipboard = atoms.CLIPBOARD;
|
|
375
|
+
ctx
|
|
376
|
+
.conn
|
|
377
|
+
.set_selection_owner(win_id, clipboard, CURRENT_TIME)?
|
|
378
|
+
.check()?;
|
|
379
|
+
|
|
380
|
+
if ctx
|
|
381
|
+
.conn
|
|
382
|
+
.get_selection_owner(clipboard)?
|
|
383
|
+
.reply()
|
|
384
|
+
.map(|reply| reply.owner == win_id)
|
|
385
|
+
.unwrap_or(false)
|
|
386
|
+
{
|
|
387
|
+
Ok(())
|
|
388
|
+
} else {
|
|
389
|
+
Err("Failed to take ownership of the clipboard".into())
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
fn process_server_req(context: &InnerContext) -> Result<()> {
|
|
395
|
+
let atoms = context.server_for_write.atoms;
|
|
396
|
+
loop {
|
|
397
|
+
match context
|
|
398
|
+
.server_for_write
|
|
399
|
+
.conn
|
|
400
|
+
.wait_for_event()
|
|
401
|
+
.map_err(|e| format!("wait_for_event error: {e:?}"))?
|
|
402
|
+
{
|
|
403
|
+
Event::DestroyNotify(_) => {
|
|
404
|
+
// This window is being destroyed.
|
|
405
|
+
println!("Clipboard server window is being destroyed x_x");
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
Event::SelectionClear(event) => {
|
|
409
|
+
// Someone else has new content in the clipboard, so it is
|
|
410
|
+
// notifying us that we should delete our data now.
|
|
411
|
+
println!("Somebody else owns the clipboard now");
|
|
412
|
+
if event.selection == atoms.CLIPBOARD {
|
|
413
|
+
// Clear the clipboard contents
|
|
414
|
+
context
|
|
415
|
+
.wait_write_data
|
|
416
|
+
.write()
|
|
417
|
+
.map(|mut writer| writer.clear())
|
|
418
|
+
.map_err(|e| format!("write clipboard data error: {e:?}"))?;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
Event::SelectionRequest(event) => {
|
|
422
|
+
// Someone is requesting the clipboard content from us.
|
|
423
|
+
context
|
|
424
|
+
.handle_selection_request(event)
|
|
425
|
+
.map_err(|e| format!("handle_selection_request error: {e:?}"))?;
|
|
426
|
+
}
|
|
427
|
+
Event::SelectionNotify(event) => {
|
|
428
|
+
// We've requested the clipboard content and this is the answer.
|
|
429
|
+
// Considering that this thread is not responsible for reading
|
|
430
|
+
// clipboard contents, this must come from the clipboard manager
|
|
431
|
+
// signaling that the data was handed over successfully.
|
|
432
|
+
if event.selection != atoms.CLIPBOARD_MANAGER {
|
|
433
|
+
println!("Received a `SelectionNotify` from a selection other than the CLIPBOARD_MANAGER. This is unexpected in this thread.");
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
_event => {
|
|
438
|
+
// May be useful for debugging but nothing else really.
|
|
439
|
+
// trace!("Received unwanted event: {:?}", event);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
Ok(())
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
impl Clipboard for ClipboardContext {
|
|
447
|
+
//https://source.chromium.org/chromium/chromium/src/+/main:ui/base/x/x11_clipboard_helper.cc;l=224;drc=4cc063ac39c4a0d1f6011421b259a9715bb16de1;bpv=0;bpt=1
|
|
448
|
+
fn available_formats(&self) -> Result<Vec<String>> {
|
|
449
|
+
let ctx = &self.inner.server;
|
|
450
|
+
let atoms = ctx.atoms;
|
|
451
|
+
self.read(&atoms.TARGETS).map(|data| {
|
|
452
|
+
let mut formats = Vec::new();
|
|
453
|
+
// 解析原子标识符列表
|
|
454
|
+
let atom_list: Vec<Atom> = parse_atom_list(&data);
|
|
455
|
+
for atom in atom_list {
|
|
456
|
+
if self.inner.ignore_formats.contains(&atom) {
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
let atom_name = ctx.get_atom_name(atom).unwrap_or("Unknown".to_string());
|
|
460
|
+
formats.push(atom_name);
|
|
461
|
+
}
|
|
462
|
+
formats
|
|
463
|
+
})
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
fn has(&self, format: crate::ContentFormat) -> bool {
|
|
467
|
+
let ctx = &self.inner.server;
|
|
468
|
+
let atoms = ctx.atoms;
|
|
469
|
+
let atom_list = self.read(&atoms.TARGETS).map(|data| parse_atom_list(&data));
|
|
470
|
+
match atom_list {
|
|
471
|
+
Ok(formats) => match format {
|
|
472
|
+
ContentFormat::Text => formats.contains(&atoms.UTF8_STRING),
|
|
473
|
+
ContentFormat::Rtf => formats.contains(&atoms.RTF),
|
|
474
|
+
ContentFormat::Html => formats.contains(&atoms.HTML),
|
|
475
|
+
#[cfg(feature = "image")]
|
|
476
|
+
ContentFormat::Image => formats.contains(&atoms.PNG_MIME),
|
|
477
|
+
ContentFormat::Files => formats.contains(&atoms.FILE_LIST),
|
|
478
|
+
ContentFormat::Other(format_name) => {
|
|
479
|
+
let atom = ctx.get_atom(format_name.as_str());
|
|
480
|
+
match atom {
|
|
481
|
+
Ok(atom) => formats.contains(&atom),
|
|
482
|
+
Err(_) => false,
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
Err(_) => false,
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
fn clear(&self) -> Result<()> {
|
|
491
|
+
self.write(vec![])
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
fn get_buffer(&self, format: &str) -> Result<Vec<u8>> {
|
|
495
|
+
let atom = self.inner.server.get_atom(format);
|
|
496
|
+
match atom {
|
|
497
|
+
Ok(atom) => self.read(&atom),
|
|
498
|
+
Err(_) => Err("Invalid format".into()),
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
fn get_text(&self) -> Result<String> {
|
|
503
|
+
let atoms = self.inner.server.atoms;
|
|
504
|
+
let text_data = self.read(&atoms.UTF8_STRING);
|
|
505
|
+
text_data.map_or_else(
|
|
506
|
+
|_| Ok("".to_string()),
|
|
507
|
+
|data| Ok(String::from_utf8_lossy(&data).to_string()),
|
|
508
|
+
)
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
fn get_rich_text(&self) -> Result<String> {
|
|
512
|
+
let atoms = self.inner.server.atoms;
|
|
513
|
+
let rtf_data = self.read(&atoms.RTF);
|
|
514
|
+
rtf_data.map_or_else(
|
|
515
|
+
|_| Ok("".to_string()),
|
|
516
|
+
|data| Ok(String::from_utf8_lossy(&data).to_string()),
|
|
517
|
+
)
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
fn get_html(&self) -> Result<String> {
|
|
521
|
+
let atoms = self.inner.server.atoms;
|
|
522
|
+
let html_data = self.read(&atoms.HTML);
|
|
523
|
+
html_data.map_or_else(
|
|
524
|
+
|_| Ok("".to_string()),
|
|
525
|
+
|data| Ok(String::from_utf8_lossy(&data).to_string()),
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
#[cfg(feature = "image")]
|
|
530
|
+
fn get_image(&self) -> Result<crate::RustImageData> {
|
|
531
|
+
let atoms = self.inner.server.atoms;
|
|
532
|
+
let image_bytes = self.read(&atoms.PNG_MIME);
|
|
533
|
+
match image_bytes {
|
|
534
|
+
Ok(bytes) => {
|
|
535
|
+
let image = RustImageData::from_bytes(&bytes);
|
|
536
|
+
match image {
|
|
537
|
+
Ok(image) => Ok(image),
|
|
538
|
+
Err(_) => Err("Invalid image data".into()),
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
Err(_) => Err("No image data found".into()),
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
fn get_files(&self) -> Result<Vec<String>> {
|
|
546
|
+
let atoms = self.inner.server.atoms;
|
|
547
|
+
let file_list_data = self.read(&atoms.FILE_LIST);
|
|
548
|
+
file_list_data.map_or_else(
|
|
549
|
+
|_| Ok(vec![]),
|
|
550
|
+
|data| {
|
|
551
|
+
let file_list_str = String::from_utf8_lossy(&data).to_string();
|
|
552
|
+
let mut list = Vec::new();
|
|
553
|
+
for line in file_list_str.lines() {
|
|
554
|
+
if !line.starts_with(FILE_PATH_PREFIX) {
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
557
|
+
list.push(line.to_string())
|
|
558
|
+
}
|
|
559
|
+
Ok(list)
|
|
560
|
+
},
|
|
561
|
+
)
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
fn get(&self, formats: &[ContentFormat]) -> Result<Vec<ClipboardContent>> {
|
|
565
|
+
let mut contents = Vec::new();
|
|
566
|
+
for format in formats {
|
|
567
|
+
match format {
|
|
568
|
+
ContentFormat::Text => match self.get_text() {
|
|
569
|
+
Ok(text) => contents.push(ClipboardContent::Text(text)),
|
|
570
|
+
Err(_) => continue,
|
|
571
|
+
},
|
|
572
|
+
ContentFormat::Rtf => match self.get_rich_text() {
|
|
573
|
+
Ok(rtf) => contents.push(ClipboardContent::Rtf(rtf)),
|
|
574
|
+
Err(_) => continue,
|
|
575
|
+
},
|
|
576
|
+
ContentFormat::Html => match self.get_html() {
|
|
577
|
+
Ok(html) => contents.push(ClipboardContent::Html(html)),
|
|
578
|
+
Err(_) => continue,
|
|
579
|
+
},
|
|
580
|
+
#[cfg(feature = "image")]
|
|
581
|
+
ContentFormat::Image => match self.get_image() {
|
|
582
|
+
Ok(image) => contents.push(ClipboardContent::Image(image)),
|
|
583
|
+
Err(_) => continue,
|
|
584
|
+
},
|
|
585
|
+
ContentFormat::Files => match self.get_files() {
|
|
586
|
+
Ok(files) => contents.push(ClipboardContent::Files(files)),
|
|
587
|
+
Err(_) => continue,
|
|
588
|
+
},
|
|
589
|
+
ContentFormat::Other(format_name) => match self.get_buffer(format_name) {
|
|
590
|
+
Ok(buffer) => contents.push(ClipboardContent::Other(format_name.clone(), buffer)),
|
|
591
|
+
Err(_) => continue,
|
|
592
|
+
},
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
Ok(contents)
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
fn set_buffer(&self, format: &str, buffer: Vec<u8>) -> Result<()> {
|
|
599
|
+
let atom = self.inner.server_for_write.get_atom(format)?;
|
|
600
|
+
let data = ClipboardData {
|
|
601
|
+
format: atom,
|
|
602
|
+
data: buffer,
|
|
603
|
+
};
|
|
604
|
+
self.write(vec![data])
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
fn set_text(&self, text: String) -> Result<()> {
|
|
608
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
609
|
+
let text_bytes = text.as_bytes().to_vec();
|
|
610
|
+
|
|
611
|
+
let data = ClipboardData {
|
|
612
|
+
format: atoms.UTF8_STRING,
|
|
613
|
+
data: text_bytes,
|
|
614
|
+
};
|
|
615
|
+
self.write(vec![data])
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
fn set_rich_text(&self, text: String) -> Result<()> {
|
|
619
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
620
|
+
let text_bytes = text.as_bytes().to_vec();
|
|
621
|
+
|
|
622
|
+
let data = ClipboardData {
|
|
623
|
+
format: atoms.RTF,
|
|
624
|
+
data: text_bytes,
|
|
625
|
+
};
|
|
626
|
+
self.write(vec![data])
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
fn set_html(&self, html: String) -> Result<()> {
|
|
630
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
631
|
+
let html_bytes = html.as_bytes().to_vec();
|
|
632
|
+
|
|
633
|
+
let data = ClipboardData {
|
|
634
|
+
format: atoms.HTML,
|
|
635
|
+
data: html_bytes,
|
|
636
|
+
};
|
|
637
|
+
self.write(vec![data])
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
#[cfg(feature = "image")]
|
|
641
|
+
fn set_image(&self, image: RustImageData) -> Result<()> {
|
|
642
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
643
|
+
let image_png = image.to_png()?;
|
|
644
|
+
let data = ClipboardData {
|
|
645
|
+
format: atoms.PNG_MIME,
|
|
646
|
+
data: image_png.get_bytes().to_vec(),
|
|
647
|
+
};
|
|
648
|
+
self.write(vec![data])
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
fn set_files(&self, files: Vec<String>) -> Result<()> {
|
|
652
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
653
|
+
let data = file_uri_list_to_clipboard_data(files, atoms);
|
|
654
|
+
self.write(data)
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
fn set(&self, contents: Vec<ClipboardContent>) -> Result<()> {
|
|
658
|
+
let mut data = Vec::new();
|
|
659
|
+
let atoms = self.inner.server_for_write.atoms;
|
|
660
|
+
for content in contents {
|
|
661
|
+
match content {
|
|
662
|
+
ClipboardContent::Text(text) => {
|
|
663
|
+
data.push(ClipboardData {
|
|
664
|
+
format: atoms.UTF8_STRING,
|
|
665
|
+
data: text.as_bytes().to_vec(),
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
ClipboardContent::Rtf(rtf) => {
|
|
669
|
+
data.push(ClipboardData {
|
|
670
|
+
format: atoms.RTF,
|
|
671
|
+
data: rtf.as_bytes().to_vec(),
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
ClipboardContent::Html(html) => {
|
|
675
|
+
data.push(ClipboardData {
|
|
676
|
+
format: atoms.HTML,
|
|
677
|
+
data: html.as_bytes().to_vec(),
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
#[cfg(feature = "image")]
|
|
681
|
+
ClipboardContent::Image(image) => {
|
|
682
|
+
let image_png = image.to_png()?;
|
|
683
|
+
data.push(ClipboardData {
|
|
684
|
+
format: atoms.PNG_MIME,
|
|
685
|
+
data: image_png.get_bytes().to_vec(),
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
ClipboardContent::Files(files) => {
|
|
689
|
+
let data_arr = file_uri_list_to_clipboard_data(files, atoms);
|
|
690
|
+
data.extend(data_arr);
|
|
691
|
+
}
|
|
692
|
+
ClipboardContent::Other(format_name, buffer) => {
|
|
693
|
+
let atom = self.inner.server_for_write.get_atom(&format_name)?;
|
|
694
|
+
data.push(ClipboardData {
|
|
695
|
+
format: atom,
|
|
696
|
+
data: buffer,
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
self.write(data)
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
pub struct ClipboardWatcherContext<T: ClipboardHandler> {
|
|
706
|
+
pub(crate) handlers: Vec<T>,
|
|
707
|
+
pub(crate) stop_signal: Sender<()>,
|
|
708
|
+
stop_receiver: Receiver<()>,
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
unsafe impl<T: ClipboardHandler> Send for ClipboardWatcherContext<T> {}
|
|
712
|
+
|
|
713
|
+
impl<T: ClipboardHandler> ClipboardWatcherContext<T> {
|
|
714
|
+
pub fn new() -> Result<Self> {
|
|
715
|
+
let (tx, rx) = mpsc::channel();
|
|
716
|
+
Ok(Self {
|
|
717
|
+
handlers: Vec::new(),
|
|
718
|
+
stop_signal: tx,
|
|
719
|
+
stop_receiver: rx,
|
|
720
|
+
})
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
impl<T: ClipboardHandler> ClipboardWatcherContext<T> {
|
|
725
|
+
pub(crate) fn start_watch_inner(&mut self) {
|
|
726
|
+
let watch_server = XServerContext::new().expect("Failed to create X server context");
|
|
727
|
+
let screen = watch_server
|
|
728
|
+
.conn
|
|
729
|
+
.setup()
|
|
730
|
+
.roots
|
|
731
|
+
.get(watch_server._screen)
|
|
732
|
+
.expect("Failed to get screen");
|
|
733
|
+
|
|
734
|
+
xfixes::query_version(&watch_server.conn, 5, 0)
|
|
735
|
+
.expect("Failed to query version xfixes is not available");
|
|
736
|
+
let cookie = xfixes::select_selection_input(
|
|
737
|
+
&watch_server.conn,
|
|
738
|
+
screen.root,
|
|
739
|
+
watch_server.atoms.CLIPBOARD,
|
|
740
|
+
xfixes::SelectionEventMask::SET_SELECTION_OWNER
|
|
741
|
+
| xfixes::SelectionEventMask::SELECTION_CLIENT_CLOSE
|
|
742
|
+
| xfixes::SelectionEventMask::SELECTION_WINDOW_DESTROY,
|
|
743
|
+
)
|
|
744
|
+
.expect("Failed to select selection input");
|
|
745
|
+
|
|
746
|
+
cookie.check().unwrap();
|
|
747
|
+
|
|
748
|
+
loop {
|
|
749
|
+
if self
|
|
750
|
+
.stop_receiver
|
|
751
|
+
.recv_timeout(Duration::from_millis(500))
|
|
752
|
+
.is_ok()
|
|
753
|
+
{
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
let event = match watch_server
|
|
757
|
+
.conn
|
|
758
|
+
.poll_for_event()
|
|
759
|
+
.expect("Failed to poll for event")
|
|
760
|
+
{
|
|
761
|
+
Some(event) => event,
|
|
762
|
+
None => {
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
if let Event::XfixesSelectionNotify(_) = event {
|
|
767
|
+
self
|
|
768
|
+
.handlers
|
|
769
|
+
.iter_mut()
|
|
770
|
+
.for_each(|handler| handler.on_clipboard_change());
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
pub(crate) fn get_shutdown_channel(&self) -> WatcherShutdown {
|
|
776
|
+
WatcherShutdown {
|
|
777
|
+
sender: self.stop_signal.clone(),
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
pub struct WatcherShutdown {
|
|
783
|
+
pub(crate) sender: Sender<()>,
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
impl Drop for WatcherShutdown {
|
|
787
|
+
fn drop(&mut self) {
|
|
788
|
+
let _ = self.sender.send(());
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
struct XServerContext {
|
|
793
|
+
conn: RustConnection,
|
|
794
|
+
win_id: u32,
|
|
795
|
+
_screen: usize,
|
|
796
|
+
atoms: Atoms,
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
impl XServerContext {
|
|
800
|
+
fn new() -> Result<Self> {
|
|
801
|
+
let (conn, screen) = x11rb::connect(None)?;
|
|
802
|
+
let win_id = conn.generate_id()?;
|
|
803
|
+
{
|
|
804
|
+
let screen = conn.setup().roots.get(screen).unwrap();
|
|
805
|
+
conn
|
|
806
|
+
.create_window(
|
|
807
|
+
COPY_DEPTH_FROM_PARENT,
|
|
808
|
+
win_id,
|
|
809
|
+
screen.root,
|
|
810
|
+
0,
|
|
811
|
+
0,
|
|
812
|
+
1,
|
|
813
|
+
1,
|
|
814
|
+
0,
|
|
815
|
+
WindowClass::INPUT_OUTPUT,
|
|
816
|
+
screen.root_visual,
|
|
817
|
+
&CreateWindowAux::new()
|
|
818
|
+
.event_mask(EventMask::STRUCTURE_NOTIFY | EventMask::PROPERTY_CHANGE),
|
|
819
|
+
)?
|
|
820
|
+
.check()?;
|
|
821
|
+
}
|
|
822
|
+
let atoms = Atoms::new(&conn)?.reply()?;
|
|
823
|
+
Ok(Self {
|
|
824
|
+
conn,
|
|
825
|
+
win_id,
|
|
826
|
+
_screen: screen,
|
|
827
|
+
atoms,
|
|
828
|
+
})
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
fn get_atom(&self, format: &str) -> Result<Atom> {
|
|
832
|
+
let cookie = self.conn.intern_atom(false, format.as_bytes())?;
|
|
833
|
+
Ok(cookie.reply()?.atom)
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
fn get_atom_name(&self, atom: Atom) -> Result<String> {
|
|
837
|
+
let cookie = self.conn.get_atom_name(atom)?;
|
|
838
|
+
Ok(String::from_utf8_lossy(&cookie.reply()?.name).to_string())
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// 解析原子标识符列表
|
|
843
|
+
fn parse_atom_list(data: &[u8]) -> Vec<Atom> {
|
|
844
|
+
data
|
|
845
|
+
.chunks(4)
|
|
846
|
+
.map(|chunk| {
|
|
847
|
+
let mut bytes = [0u8; 4];
|
|
848
|
+
bytes.copy_from_slice(chunk);
|
|
849
|
+
u32::from_ne_bytes(bytes)
|
|
850
|
+
})
|
|
851
|
+
.collect()
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
fn file_uri_list_to_clipboard_data(file_list: Vec<String>, atoms: Atoms) -> Vec<ClipboardData> {
|
|
855
|
+
let uri_list: Vec<String> = file_list
|
|
856
|
+
.iter()
|
|
857
|
+
.map(|f| {
|
|
858
|
+
if f.starts_with(FILE_PATH_PREFIX) {
|
|
859
|
+
f.to_owned()
|
|
860
|
+
} else {
|
|
861
|
+
format!("{FILE_PATH_PREFIX}{f}")
|
|
862
|
+
}
|
|
863
|
+
})
|
|
864
|
+
.collect();
|
|
865
|
+
// 再构造一个 /home/xxx/xxx 这样的路径
|
|
866
|
+
let uri_str_list: Vec<String> = file_list
|
|
867
|
+
.iter()
|
|
868
|
+
.map(|f| {
|
|
869
|
+
if let Some(stripped) = f.strip_prefix(FILE_PATH_PREFIX) {
|
|
870
|
+
stripped.to_owned()
|
|
871
|
+
} else {
|
|
872
|
+
f.to_owned()
|
|
873
|
+
}
|
|
874
|
+
})
|
|
875
|
+
.collect();
|
|
876
|
+
|
|
877
|
+
let data_text_plain = uri_str_list.join("\r\n");
|
|
878
|
+
let data_text_utf8 = uri_str_list.join("\n");
|
|
879
|
+
let data_text_uri_list = uri_list.join("\r\n");
|
|
880
|
+
let data_gnome_copied_files = ["copy\n", uri_list.join("\n").as_str()].concat();
|
|
881
|
+
|
|
882
|
+
vec![
|
|
883
|
+
ClipboardData {
|
|
884
|
+
format: atoms.TEXT_MIME_UNKNOWN,
|
|
885
|
+
data: data_text_plain.as_bytes().to_vec(),
|
|
886
|
+
},
|
|
887
|
+
ClipboardData {
|
|
888
|
+
format: atoms.UTF8_MIME_0,
|
|
889
|
+
data: data_text_plain.as_bytes().to_vec(),
|
|
890
|
+
},
|
|
891
|
+
ClipboardData {
|
|
892
|
+
format: atoms.STRING,
|
|
893
|
+
data: data_text_utf8.as_bytes().to_vec(),
|
|
894
|
+
},
|
|
895
|
+
ClipboardData {
|
|
896
|
+
format: atoms.TEXT,
|
|
897
|
+
data: data_text_utf8.as_bytes().to_vec(),
|
|
898
|
+
},
|
|
899
|
+
ClipboardData {
|
|
900
|
+
format: atoms.UTF8_STRING,
|
|
901
|
+
data: data_text_utf8.as_bytes().to_vec(),
|
|
902
|
+
},
|
|
903
|
+
ClipboardData {
|
|
904
|
+
format: atoms.FILE_LIST,
|
|
905
|
+
data: data_text_uri_list.as_bytes().to_vec(),
|
|
906
|
+
},
|
|
907
|
+
ClipboardData {
|
|
908
|
+
format: atoms.GNOME_COPY_FILES,
|
|
909
|
+
data: data_gnome_copied_files.as_bytes().to_vec(),
|
|
910
|
+
},
|
|
911
|
+
ClipboardData {
|
|
912
|
+
format: atoms.NAUTILUS_FILE_LIST,
|
|
913
|
+
data: data_gnome_copied_files.as_bytes().to_vec(),
|
|
914
|
+
},
|
|
915
|
+
]
|
|
916
|
+
}
|