From 9cbe4a97213c8bafc062771a736a13c89272fd9f Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 21 Feb 2025 17:48:38 +0800 Subject: [PATCH] shellchat: use platform-neutral ux-api instead of graphics-server --- services/shellchat/Cargo.toml | 2 +- services/shellchat/src/cmds/net_cmd.rs | 6 +++--- services/shellchat/src/main.rs | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/services/shellchat/Cargo.toml b/services/shellchat/Cargo.toml index 9e67e946b..002eb9b3c 100644 --- a/services/shellchat/Cargo.toml +++ b/services/shellchat/Cargo.toml @@ -11,7 +11,7 @@ com = { path = "../com" } content-plugin-api = { path = "../content-plugin-api" } # all content canvas providers must provide this API gam = { path = "../gam" } blitstr2 = { path = "../../libs/blitstr2" } -graphics-server = { path = "../graphics-server" } +ux-api = { path = "../../libs/ux-api" } ime-plugin-api = { path = "../ime-plugin-api" } ime-plugin-shell = { path = "../ime-plugin-shell" } ime-plugin-tts = { path = "../ime-plugin-tts" } diff --git a/services/shellchat/src/cmds/net_cmd.rs b/services/shellchat/src/cmds/net_cmd.rs index c4e6803cf..1c7622a93 100644 --- a/services/shellchat/src/cmds/net_cmd.rs +++ b/services/shellchat/src/cmds/net_cmd.rs @@ -457,9 +457,9 @@ impl<'a> ShellCmdApi<'a> for NetCmd { log::info!("heap size: {}", heap_usage()); let mut png = DecodePng::new(reader).expect("png decode failed"); const BORDER: u32 = 3; - let modal_size = gam::Point::new( - (gam::IMG_MODAL_WIDTH - 2 * BORDER) as i16, - (gam::IMG_MODAL_HEIGHT - 2 * BORDER) as i16, + let modal_size = ux_api::minigfx::Point::new( + (gam::IMG_MODAL_WIDTH - 2 * BORDER) as isize, + (gam::IMG_MODAL_HEIGHT - 2 * BORDER) as isize, ); let bm = gam::Bitmap::from_png(&mut png, Some(modal_size)); diff --git a/services/shellchat/src/main.rs b/services/shellchat/src/main.rs index 35ae3cacb..efd16951e 100644 --- a/services/shellchat/src/main.rs +++ b/services/shellchat/src/main.rs @@ -35,8 +35,9 @@ use std::sync::Arc; use std::thread; use gam::UxRegistration; -use graphics_server::{DrawStyle, Gid, PixelColor, Point, Rectangle, TextBounds, TextView}; use log::info; +use ux_api::minigfx::*; +use ux_api::service::api::*; use xous::MessageEnvelope; use xous_ipc::Buffer; @@ -138,7 +139,7 @@ struct Repl { margin: Point, // margin to edge of canvas bubble_margin: Point, // margin of text in bubbles bubble_radius: u16, - bubble_space: i16, // spacing between text bubbles + bubble_space: isize, // spacing between text bubbles // command environment env: CmdEnv,