Native wallpaper platform API bindings for desktop apps.
Dependencies
let status = @wallpaper.apply_current(
"/home/alice/Pictures/wallpaper.jpg",
@wallpaper.WallpaperMode::Fill,
)test {
inspect(@wallpaper.WallpaperMode::Fill.to_string(), content="Fill")
inspect(@wallpaper.WallpaperMode::Span.to_string(), content="Span")
}impl Show for WallpaperModetest {
inspect(@wallpaper.WallpaperMode::Fill.to_string(), content="Fill")
}pub(all) struct WallpaperRequest {
platform : Os
source : String
mode : WallpaperMode
} derive(Eq, Debug)test {
let request : @wallpaper.WallpaperRequest = {
platform: UnknownOs,
source: "/tmp/wallpaper.jpg",
mode: Fit,
}
inspect(@wallpaper.apply(request), content="UnsupportedPlatform")
}impl Show for WallpaperRequesttest {
let request : @wallpaper.WallpaperRequest = {
platform: Linux,
source: "/tmp/wallpaper.jpg",
mode: Fit,
}
inspect(
request.to_string(),
content="{ platform: Linux, source: \"/tmp/wallpaper.jpg\", mode: Fit }",
)
}test {
inspect(@wallpaper.WallpaperStatus::Applied.is_success(), content="true")
inspect(
@wallpaper.WallpaperStatus::UnsupportedDesktop.is_success(),
content="false",
)
}impl Show for WallpaperStatustest {
inspect(
@wallpaper.WallpaperStatus::UnsupportedPlatform.to_string(),
content="UnsupportedPlatform",
)
}test {
inspect(@wallpaper.WallpaperStatus::Applied.is_success(), content="true")
inspect(
@wallpaper.WallpaperStatus::NativeFailure.is_success(),
content="false",
)
}test {
let request : @wallpaper.WallpaperRequest = {
platform: UnknownOs,
source: "/tmp/wallpaper.jpg",
mode: Fill,
}
inspect(@wallpaper.apply(request), content="UnsupportedPlatform")
}test {
inspect(@wallpaper.apply_current("", Center), content="InvalidSource")
}test {
inspect(@wallpaper.supports_platform(Linux), content="true")
inspect(@wallpaper.supports_platform(UnknownOs), content="false")
}Native wallpaper platform API bindings for desktop apps.
Dependencies