diff --git a/services/graphics-server/Cargo.toml b/services/graphics-server/Cargo.toml index b7e5522e4..913c09650 100644 --- a/services/graphics-server/Cargo.toml +++ b/services/graphics-server/Cargo.toml @@ -19,8 +19,9 @@ xous-ipc = "0.9.63" xous-names = { package = "xous-api-names", version = "0.9.61" } num-derive = { version = "0.3.3", default-features = false } num-traits = { version = "0.2.14", default-features = false } -rkyv = { version = "0.4.3", default-features = false, features = [ - "const_generics", +rkyv = { version = "0.8.8", default-features = false, features = [ + "std", + "alloc", ] } utralib = { version = "0.1.24", optional = true, default-features = false } diff --git a/services/graphics-server/src/api.rs b/services/graphics-server/src/api.rs index 635fc1f92..06a8ed030 100644 --- a/services/graphics-server/src/api.rs +++ b/services/graphics-server/src/api.rs @@ -162,10 +162,10 @@ impl ClipObjectList { } } -#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone)] +#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Clone)] pub struct TokenClaim { pub token: Option<[u32; 4]>, - pub name: xous_ipc::String<128>, + pub name: String, } /// the buffer length of this equal to the internal length passed by the diff --git a/services/graphics-server/src/api/text.rs b/services/graphics-server/src/api/text.rs index f1a725d11..b616b28bd 100644 --- a/services/graphics-server/src/api/text.rs +++ b/services/graphics-server/src/api/text.rs @@ -1,6 +1,6 @@ use core::ops::Add; -use xous_ipc::String; +use String; use crate::api::{Cursor, Gid, GlyphStyle, Point, Rectangle}; @@ -75,7 +75,7 @@ impl From for TextOp { const TEXTVIEW_LEN: usize = 3072; pub const TEXTVIEW_DEFAULT_STYLE: GlyphStyle = GlyphStyle::Regular; -#[derive(Copy, Clone, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)] +#[derive(Clone, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)] pub struct TextView { // this is the operation as specified for the GAM. Note this is different from the "op" when sent to // graphics-server only the GAM should be sending TextViews to the graphics-server, and a different @@ -116,7 +116,7 @@ pub struct TextView { // this field tracks the state of a busy animation, if `Some` pub busy_animation_state: Option, - pub text: String<3072>, + pub text: String, } impl TextView { pub fn new(canvas: Gid, bounds_hint: TextBounds) -> Self { @@ -130,7 +130,7 @@ impl TextView { bounds_hint, bounds_computed: None, style: TEXTVIEW_DEFAULT_STYLE, - text: String::<3072>::new(), + text: String::new(), cursor: Cursor::new(0, 0, 0), insertion: None, ellipsis: false, @@ -156,7 +156,7 @@ impl TextView { pub fn get_canvas_gid(&self) -> Gid { self.canvas } - pub fn to_str(&self) -> &str { self.text.as_str().unwrap() } + pub fn to_str(&self) -> &str { self.text.as_str() } pub fn clear_str(&mut self) { self.text.clear() } @@ -169,7 +169,7 @@ impl TextView { self.bounds_hint = t.bounds_hint; self.bounds_computed = t.bounds_computed; self.style = t.style; - self.text = t.text; + self.text = t.text.clone(); self.cursor = t.cursor; self.draw_border = t.draw_border; self.clear_area = t.clear_area; diff --git a/services/graphics-server/src/lib.rs b/services/graphics-server/src/lib.rs index 6b54027fb..cab7d79ec 100644 --- a/services/graphics-server/src/lib.rs +++ b/services/graphics-server/src/lib.rs @@ -135,7 +135,7 @@ impl Gfx { } pub fn draw_textview(&self, tv: &mut TextView) -> Result<(), xous::Error> { - let mut buf = Buffer::into_buf(*tv).or(Err(xous::Error::InternalError))?; + let mut buf = Buffer::into_buf(tv.clone()).or(Err(xous::Error::InternalError))?; buf.lend_mut(self.conn, Opcode::DrawTextView.to_u32().unwrap()) .or(Err(xous::Error::InternalError))?; diff --git a/services/keyboard/Cargo.toml b/services/keyboard/Cargo.toml index db1ded1bc..d2a84191b 100644 --- a/services/keyboard/Cargo.toml +++ b/services/keyboard/Cargo.toml @@ -22,8 +22,9 @@ spinor = { path = "../spinor" } num-derive = { version = "0.3.3", default-features = false } num-traits = { version = "0.2.14", default-features = false } -rkyv = { version = "0.4.3", default-features = false, features = [ - "const_generics", +rkyv = { version = "0.8.8", default-features = false, features = [ + "std", + "alloc", ] } utralib = { version = "0.1.24", optional = true, default-features = false } diff --git a/services/keyboard/src/api.rs b/services/keyboard/src/api.rs index 6aae7ef49..3abf7293d 100644 --- a/services/keyboard/src/api.rs +++ b/services/keyboard/src/api.rs @@ -107,9 +107,9 @@ pub(crate) enum Opcode { // this structure is used to register a keyboard listener. Currently, we only accept // one trusted listener (enforced by name server and structurally in the code), // which is the GAM. -#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone)] +#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Clone)] pub(crate) struct KeyboardRegistration { - pub server_name: xous_ipc::String<64>, + pub server_name: String, pub listener_op_id: usize, } diff --git a/services/keyboard/src/lib.rs b/services/keyboard/src/lib.rs index 0fb917b2b..cf18926f3 100644 --- a/services/keyboard/src/lib.rs +++ b/services/keyboard/src/lib.rs @@ -6,7 +6,7 @@ pub mod api; pub use api::*; use xous::{send_message, Message}; -use xous_ipc::{Buffer, String}; +use xous_ipc::Buffer; #[derive(Debug)] pub struct Keyboard { @@ -21,7 +21,7 @@ impl Keyboard { pub fn register_listener(&self, server_name: &str, action_opcode: usize) { let kr = KeyboardRegistration { - server_name: String::<64>::from_str(server_name), + server_name: String::from(server_name), listener_op_id: action_opcode, }; let buf = Buffer::into_buf(kr).unwrap(); @@ -30,7 +30,7 @@ impl Keyboard { pub fn register_raw_listener(&self, server_name: &str, action_opcode: usize) { let kr = KeyboardRegistration { - server_name: String::<64>::from_str(server_name), + server_name: String::from(server_name), listener_op_id: action_opcode, }; let buf = Buffer::into_buf(kr).unwrap(); @@ -40,7 +40,7 @@ impl Keyboard { pub fn register_observer(&self, server_name: &str, action_opcode: usize) { let kr = KeyboardRegistration { - server_name: String::<64>::from_str(server_name), + server_name: String::from(server_name), listener_op_id: action_opcode, }; let buf = Buffer::into_buf(kr).unwrap();