mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
configure Chat_UI to register Chat_App Name with gam
This commit is contained in:
parent
34334cb80a
commit
e9f362907d
2 changed files with 6 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ pub struct Chat {
|
|||
|
||||
impl Chat {
|
||||
pub fn new(
|
||||
app_name: &str,
|
||||
app_cid: Option<CID>,
|
||||
opcode_post: Option<usize>,
|
||||
opcode_event: Option<usize>,
|
||||
|
|
@ -25,6 +26,7 @@ impl Chat {
|
|||
) -> Self {
|
||||
let chat_sid = xous::create_server().unwrap();
|
||||
let chat_cid = xous::connect(chat_sid).unwrap();
|
||||
let app_name = app_name.to_string();
|
||||
|
||||
log::info!("Starting chat UI server",);
|
||||
thread::spawn({
|
||||
|
|
@ -132,6 +134,7 @@ impl Chat {
|
|||
|
||||
pub fn server(
|
||||
sid: SID,
|
||||
app_name: &str,
|
||||
app_cid: Option<CID>,
|
||||
opcode_post: Option<usize>,
|
||||
opcode_event: Option<usize>,
|
||||
|
|
@ -146,7 +149,7 @@ pub fn server(
|
|||
// let mut opcode_event = opcode_event;
|
||||
// let mut opcode_rawkeys = opcode_rawkeys;
|
||||
|
||||
let mut ui = ui::Ui::new(sid, app_cid, opcode_event);
|
||||
let mut ui = ui::Ui::new(sid, app_name, app_cid, opcode_event);
|
||||
|
||||
let mut user_post = true;
|
||||
let mut allow_redraw = false;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ pub(crate) struct Ui {
|
|||
impl Ui {
|
||||
pub(crate) fn new(
|
||||
sid: xous::SID,
|
||||
app_name: &str,
|
||||
app_cid: Option<xous::CID>,
|
||||
opcode_event: Option<usize>,
|
||||
) -> Self {
|
||||
|
|
@ -64,7 +65,7 @@ impl Ui {
|
|||
|
||||
let token = gam
|
||||
.register_ux(UxRegistration {
|
||||
app_name: xous_ipc::String::<128>::from_str(SERVER_NAME_CHAT),
|
||||
app_name: xous_ipc::String::<128>::from_str(app_name),
|
||||
ux_type: gam::UxType::Chat,
|
||||
predictor: Some(xous_ipc::String::<64>::from_str(
|
||||
ime_plugin_shell::SERVER_NAME_IME_PLUGIN_SHELL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue