M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s
CI / test (push) Successful in 19s
This commit was merged in pull request #1.
This commit is contained in:
1 parent
e5548fc067
commit
880ecd4102
141 files changed
+9681
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package moonplasma:desktop@0.1.0;
|
||||
|
||||
/// The widget (plasmoid) contract.
|
||||
interface plasmoid {
|
||||
use types.{size, draw-op, input-event};
|
||||
|
||||
record plasmoid-info {
|
||||
/// Stable machine id, e.g. "org.moonplasma.clock.digital".
|
||||
id: string,
|
||||
name: string,
|
||||
preferred: size,
|
||||
min-width: u32,
|
||||
/// Whether the panel may grow this widget beyond `preferred`.
|
||||
stretch: bool,
|
||||
}
|
||||
|
||||
record popup-surface {
|
||||
size: size,
|
||||
ops: list<draw-op>,
|
||||
}
|
||||
|
||||
enum surface { widget, popup }
|
||||
|
||||
info: func() -> plasmoid-info;
|
||||
/// Draw the widget into a `size` box (local coordinates).
|
||||
render: func(size: size) -> list<draw-op>;
|
||||
/// Present when the widget wants a popup surface (e.g. a launcher menu).
|
||||
popup: func() -> option<popup-surface>;
|
||||
/// Returns true when the widget's visuals changed and a redraw is needed.
|
||||
on-event: func(target: surface, event: input-event) -> bool;
|
||||
}
|
||||
Reference in new issue
Block a user