Files
breeze/tests/android_text_input_host.zi
waozi dc1d003cd8 Merge pending Breeze work: Photos as its own app, Opus voice packs, 2.1.63 notes
Photos downloads from Apps instead of shipping in Breeze, practice and
guide voice clips move to Ogg Opus, dependencies update (Ziran, Kryon,
Apps, Arcade, practices), and the 2.1.63 version and store notes are
prepared. The Practice tab note is translated in every locale.
2026-11-06 21:58:14 -03:00

138 lines
3.0 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
RasterTextRotated :: (value: string, x: s32, y: s32, font: s32,
color: Color, clip: Rectangle, origin: Vector2, rotation: float32,
outer_clip: Rectangle, outer_clipped: bool, emphasis: bool, italic: bool) {
unused value
unused x
unused y
unused font
unused color
unused clip
unused origin
unused rotation
unused outer_clip
unused outer_clipped
unused emphasis
unused italic
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
}