xous-core/services/gam/src/lib.rs

17 lines
526 B
Rust
Raw Normal View History

2021-01-17 13:58:02 +00:00
#![cfg_attr(target_os = "none", no_std)]
pub mod api;
use api::*;
use xous::ipc::*;
use core::fmt::Write;
2021-01-18 20:54:54 +00:00
use graphics_server::api::{TextOp, TextView};
2021-01-17 13:58:02 +00:00
pub fn draw_textview(gam_cid: xous::CID, tv: &mut TextView) -> Result<(), xous::Error> {
let mut sendable_tv = Sendable::new(tv).expect("can't create sendable textview");
sendable_tv.set_op(TextOp::Render);
sendable_tv.lend_mut(gam_cid, sendable_tv.get_op().into()).expect("draw_textview operation failure");
sendable_tv.set_op(TextOp::Nop);
Ok(())
}