mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +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),
|
DrawStyle::new(PixelColor::Light, PixelColor::Light, 3),
|
||||||
))
|
))
|
||||||
.ok();
|
.ok();
|
||||||
self.list.draw(
|
let title_height = self
|
||||||
self.title_tv
|
.title_tv
|
||||||
.bounds_computed
|
.bounds_computed
|
||||||
.unwrap_or(Rectangle::new(
|
.unwrap_or(Rectangle::new(
|
||||||
Point::new(0, 0),
|
Point::new(0, 0),
|
||||||
Point::new(crate::platform::WIDTH as isize, self.list.row_height() as isize),
|
Point::new(crate::platform::WIDTH as isize, self.list.row_height() as isize),
|
||||||
))
|
))
|
||||||
.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]) {
|
pub fn key_event(&mut self, keys: [char; 4]) {
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,11 @@ pub enum GfxOpcode {
|
||||||
/// V2 API for fast drawing of multiple objects
|
/// V2 API for fast drawing of multiple objects
|
||||||
UnclippedObjectList,
|
UnclippedObjectList,
|
||||||
|
|
||||||
|
#[cfg(feature = "board-baosec")]
|
||||||
|
AcquireQr,
|
||||||
|
#[cfg(feature = "board-baosec")]
|
||||||
|
KeyPress,
|
||||||
|
|
||||||
/// Gutter for invalid calls
|
/// Gutter for invalid calls
|
||||||
InvalidCall,
|
InvalidCall,
|
||||||
|
|
||||||
|
|
@ -123,3 +128,10 @@ pub struct BulkRead {
|
||||||
impl BulkRead {
|
impl BulkRead {
|
||||||
pub fn default() -> BulkRead { BulkRead { buf: [0; 7936], from_offset: 0, len: 7936 } }
|
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(|_| ())
|
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};
|
use core::sync::atomic::{AtomicU32, Ordering};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue