mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add ux-api acquisition features
This commit is contained in:
parent
fbb04d96ab
commit
74134bfac2
3 changed files with 34 additions and 9 deletions
|
|
@ -201,15 +201,19 @@ impl<'a> Menu<'a> {
|
|||
DrawStyle::new(PixelColor::Light, PixelColor::Light, 3),
|
||||
))
|
||||
.ok();
|
||||
self.list.draw(
|
||||
self.title_tv
|
||||
.bounds_computed
|
||||
.unwrap_or(Rectangle::new(
|
||||
Point::new(0, 0),
|
||||
Point::new(crate::platform::WIDTH as isize, self.list.row_height() as isize),
|
||||
))
|
||||
.height() as isize,
|
||||
);
|
||||
let title_height = self
|
||||
.title_tv
|
||||
.bounds_computed
|
||||
.unwrap_or(Rectangle::new(
|
||||
Point::new(0, 0),
|
||||
Point::new(crate::platform::WIDTH as isize, self.list.row_height() as isize),
|
||||
))
|
||||
.height() as isize;
|
||||
self.list.pane_size(Rectangle::new(
|
||||
Point::new(0, 0),
|
||||
Point::new(crate::platform::WIDTH, crate::platform::HEIGHT as isize - title_height),
|
||||
));
|
||||
self.list.draw(title_height);
|
||||
}
|
||||
|
||||
pub fn key_event(&mut self, keys: [char; 4]) {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ pub enum GfxOpcode {
|
|||
/// V2 API for fast drawing of multiple objects
|
||||
UnclippedObjectList,
|
||||
|
||||
#[cfg(feature = "board-baosec")]
|
||||
AcquireQr,
|
||||
#[cfg(feature = "board-baosec")]
|
||||
KeyPress,
|
||||
|
||||
/// Gutter for invalid calls
|
||||
InvalidCall,
|
||||
|
||||
|
|
@ -123,3 +128,10 @@ pub struct BulkRead {
|
|||
impl BulkRead {
|
||||
pub fn default() -> BulkRead { BulkRead { buf: [0; 7936], from_offset: 0, len: 7936 } }
|
||||
}
|
||||
|
||||
#[cfg(feature = "board-baosec")]
|
||||
#[derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
|
||||
pub struct QrAcquisition {
|
||||
pub content: Option<String>,
|
||||
pub meta: Option<String>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -728,6 +728,15 @@ impl Gfx {
|
|||
};
|
||||
buf.lend(self.conn, GfxOpcode::UnclippedObjectList.to_u32().unwrap()).map(|_| ())
|
||||
}
|
||||
|
||||
#[cfg(feature = "board-baosec")]
|
||||
pub fn acquire_qr(&self) -> Result<QrAcquisition, xous::Error> {
|
||||
let acquisition = QrAcquisition { content: None, meta: None };
|
||||
let mut buf = Buffer::into_buf(acquisition).unwrap();
|
||||
buf.lend_mut(self.conn, GfxOpcode::AcquireQr.to_u32().unwrap())?;
|
||||
let response: QrAcquisition = buf.to_original()?;
|
||||
Ok(response)
|
||||
}
|
||||
}
|
||||
|
||||
use core::sync::atomic::{AtomicU32, Ordering};
|
||||
|
|
|
|||
Loading…
Reference in a new issue