scoop:scoop.desktop:0.1.0
src/values.scoop
Selected production source · src/values.scoop
1
package scoop.desktop3
import scoop.platform.fs.Path5
public struct DesktopApplicationCapabilities(6
val applicationIcon: Boolean,7
val badgeText: Boolean,8
val dockMenu: Boolean,9
val jumpListTasks: Boolean10
)12
public struct DesktopWindowCapabilities(13
val windowIcon: Boolean,14
val overlayIcon: Boolean,15
val progress: Boolean,16
val miniwindowCaption: Boolean,17
val thumbnailTooltip: Boolean18
)20
public enum DesktopProgress {21
None, Indeterminate, Normal(val completed: ULong, val total: ULong),22
Paused(val completed: ULong, val total: ULong), Error(val completed: ULong, val total: ULong)23
}25
public class JumpListIcon public constructor(public val path: Path, public val index: Int = 0)27
/** A native task starts this application with arguments, including after this process exits. */28
public class JumpListTask public constructor(29
public val title: String,30
public val arguments: Array<String> = [],31
public val description: String? = None,32
public val icon: JumpListIcon? = None33
) {34
init {35
if (title.byteLength == 0L)36
throw IllegalArgumentException(Some("Jump List task title is empty"))37
checkDesktopText(title)38
checkDesktopText(description ?: "")39
for (argument in arguments)40
checkDesktopText(argument)41
}42
}44
internal fun checkDesktopText(value: String) {45
for (character in value)46
if (character.code == 0)47
throw IllegalArgumentException(Some("desktop text contains NUL"))48
}