// Jackson Coxson #pragma once #include #include #include #include #include #include namespace IdeviceFFI { using ScreenshotClientPtr = std::unique_ptr>; /// C++ wrapper around the ScreenshotClient FFI handle /// /// Provides a high-level interface for capturing screenshots /// from a connected iOS device through the DVT service. class ScreenshotClient { public: /// Creates a new ScreenshotClient using an existing RemoteServer. /// /// The RemoteServer is borrowed, not consumed. static Result create(RemoteServer& server); /// Captures a screenshot and returns it as a PNG buffer. /// /// On success, returns a vector containing PNG-encoded bytes. Result, FfiError> capture(); ~ScreenshotClient() noexcept = default; ScreenshotClient(ScreenshotClient&&) noexcept = default; ScreenshotClient& operator=(ScreenshotClient&&) noexcept = default; ScreenshotClient(const ScreenshotClient&) = delete; ScreenshotClient& operator=(const ScreenshotClient&) = delete; ScreenshotClientHandle* raw() const noexcept { return handle_.get(); } static ScreenshotClient adopt(ScreenshotClientHandle* h) noexcept { return ScreenshotClient(h); } private: explicit ScreenshotClient(ScreenshotClientHandle* h) noexcept : handle_(h) {} ScreenshotClientPtr handle_{}; }; } // namespace IdeviceFFI