package chandra:desktop@0.1.0; /// Shared value types. Everything here is plain data (no resources) so that /// it can cross any component boundary and any host implementation. interface types { record size { w: u32, h: u32 } record point { x: s32, y: s32 } record rect { x: s32, y: s32, w: u32, h: u32 } /// Non-premultiplied sRGB, 8 bits per channel. record color { r: u8, g: u8, b: u8, a: u8 } enum text-align { left, center, right } record text-style { /// Pixel height of the em box. size: u32, color: color, align: text-align, bold: bool, } record fill-rect-op { rect: rect, color: color, radius: u32 } record stroke-rect-op { rect: rect, color: color, width: u32, radius: u32 } record line-op { start: point, end: point, color: color, width: u32 } record circle-op { center: point, radius: u32, color: color, filled: bool } /// `origin` is the left edge (align=left), centre (center) or right edge /// (right) of the text, at the vertical *middle* of the line box. record text-op { origin: point, text: string, style: text-style } /// The render-list vocabulary. Components never touch pixels: they return /// a list of these in their own local coordinate space (origin top-left), /// and the host/compositor translates, clips and rasterises them. variant draw-op { fill-rect(fill-rect-op), stroke-rect(stroke-rect-op), line(line-op), circle(circle-op), text(text-op), push-clip(rect), pop-clip, } variant input-event { pointer-move(point), pointer-down(point), pointer-up(point), pointer-leave, /// Sent to a popup owner when the user clicks outside its popup. focus-lost, /// A printable character ("a") or a named key ("Backspace", "Enter", "Escape"). key-down(string), } record datetime { year: u32, month: u8, day: u8, hour: u8, minute: u8, second: u8, /// 0 = Sunday .. 6 = Saturday weekday: u8, } record app-entry { id: string, name: string, comment: string, category: string, /// A short glyph (1-2 chars) standing in for an icon until the icon /// theme interface lands. glyph: string, } }