Files
breeze/tests/android_text_input_host.zi
T
waozi a687881c94 Habits and Practices draw their screens in their own packages
Habits' list with each habit's week and calendar, its day with the entry
dialog, the editor and the statistics now come from the Habits package, and
Practices' home, the Wim Hof, Meditation, Patterns and Astral Projection
manuals, Meditation's and Astral Projection's Customize pages and the
results after a practice come from the Practices package, so they can change
without an app update. The host keeps the data, the rules and the storage,
gives each page its frame and does what the page asks. The pages draw
exactly as before.

Kryon now hosts segmented controls, form sections, toggle sizes, lines,
circles, rings, triangles, sliders and progress bars for bundles and lets a
bundle import up to 256 host calls; plot hosts its band chart. Host
interface 30; Habits 1.3.0 and Practices 1.4.0.
2026-10-24 23:17:45 -03:00

119 lines
2.5 KiB
Ziran

// Host functions for Android tests that draw nothing: the input transport
// test and the JNI test, whose Kryon device module brings text menu widgets.
#import "drawing_props"
#import "geometry"
labels: s32;
#program_export
MeasureGlyphWidth :: (value: string, font: s32, typeface: string) -> s32 {
unused typeface
return (cast(s32)value.count) * font / 2
}
#program_export
MeasureGlyphLineHeight :: (font: s32, typeface: string) -> s32 {
unused typeface
return font
}
#program_export
RasterRoundedRectangle :: (bounds: Rectangle, radius: float32,
segments: s32, color: Color) {
unused bounds
unused radius
unused segments
unused color
}
#program_export
RasterRoundedRectangleOutline :: (bounds: Rectangle, radius: float32,
segments: s32, width: float32, color: Color) {
unused bounds
unused radius
unused segments
unused width
unused color
}
#program_export
RasterLine :: (bounds: Rectangle, color: Color) {
unused bounds
unused color
}
#program_export
RasterTriangles :: (points: []Vector2, color: Color) {
unused points
unused color
}
#program_export
RasterText :: (value: string, x: s32, y: s32, font: s32, color: Color) {
unused value
unused x
unused y
unused font
unused color
labels += 1
}
#program_export
RasterTextClipped :: (value: string, x: s32, y: s32, font: s32,
color: Color, clip: Rectangle) {
unused value
unused x
unused y
unused font
unused color
unused clip
labels += 1
}
#program_export
RasterImage :: (path: string, texture_id: u32, source: Rectangle,
destination: Rectangle, clip: Rectangle, origin: Vector2,
rotation: float32, radius: float32, tint: Color) {
unused path
unused texture_id
unused source
unused destination
unused clip
unused origin
unused rotation
unused radius
unused tint
}
#program_export
RasterImageMesh :: (path: string, texture_id: u32, source: Rectangle,
points: []Vector2, columns: s32, rows: s32, clip: Rectangle,
tint: Color) {
unused path
unused texture_id
unused source
unused points
unused columns
unused rows
unused clip
unused tint
}
#program_export
ContextMenuLabelCount :: () -> s32 { return labels }
#program_export
SystemClipboardOpenHost :: () -> s32 {
return -1
}
#program_export
SystemClipboardByteHost :: (index: s32) -> s32 {
unused index
return -1
}
#program_export
SystemClipboardWriteHost :: (text: string) -> bool {
unused text
return false
}