ime-frontend: use platform-neutral ux-api instead of graphics-server

This commit is contained in:
bunnie 2025-02-21 17:49:13 +08:00
parent 5864d0fbeb
commit c8d00e890b
2 changed files with 5 additions and 4 deletions

View file

@ -8,7 +8,7 @@ version = "0.1.0"
# Dependency versions enforced by Cargo.lock.
[dependencies]
gam = { path = "../gam" }
graphics-server = { path = "../graphics-server" }
ux-api = { path = "../../libs/ux-api" }
ime-plugin-api = { path = "../ime-plugin-api" }
keyboard = { path = "../keyboard" }
log = "0.4.14"

View file

@ -6,7 +6,6 @@ use core::fmt::Write;
use emoji::*;
use gam::api::SetCanvasBoundsRequest;
use graphics_server::{DrawStyle, Gid, Line, PixelColor, Point, Rectangle, TextBounds, TextView};
use ime_plugin_api::{ApiToken, PredictionApi, PredictionPlugin, PredictionTriggers};
use ime_plugin_api::{ImefCallback, ImefDescriptor, ImefOpcode};
use locales::t;
@ -14,6 +13,8 @@ use log::{error, info};
use num_traits::{FromPrimitive, ToPrimitive};
#[cfg(feature = "tts")]
use tts_frontend::*;
use ux_api::minigfx::*;
use ux_api::service::api::*;
use xous::{CID, msg_scalar_unpack};
use xous_ipc::Buffer;
@ -644,7 +645,7 @@ impl InputTracker {
31 // a default value to grow in case we don't have a valid last height
};
let mut req = SetCanvasBoundsRequest {
requested: Point::new(0, ic_bounds.y + delta as i16),
requested: Point::new(0, ic_bounds.y + delta as isize),
granted: None,
token_type: gam::TokenType::Gam,
token: self.gam_token.unwrap(),
@ -746,7 +747,7 @@ impl InputTracker {
info!("valid_predictions: {}", valid_predictions);
}
// OK, let's start initially with just a naive, split-by-N layout of the prediction area
let approx_width = pc_bounds.x / valid_predictions as i16;
let approx_width = pc_bounds.x / valid_predictions as isize;
let mut i = 0;
for p in self.pred_options.iter() {