mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +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 {
|
impl Chat {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
app_name: &str,
|
||||||
app_cid: Option<CID>,
|
app_cid: Option<CID>,
|
||||||
opcode_post: Option<usize>,
|
opcode_post: Option<usize>,
|
||||||
opcode_event: Option<usize>,
|
opcode_event: Option<usize>,
|
||||||
|
|
@ -25,6 +26,7 @@ impl Chat {
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let chat_sid = xous::create_server().unwrap();
|
let chat_sid = xous::create_server().unwrap();
|
||||||
let chat_cid = xous::connect(chat_sid).unwrap();
|
let chat_cid = xous::connect(chat_sid).unwrap();
|
||||||
|
let app_name = app_name.to_string();
|
||||||
|
|
||||||
log::info!("Starting chat UI server",);
|
log::info!("Starting chat UI server",);
|
||||||
thread::spawn({
|
thread::spawn({
|
||||||
|
|
@ -132,6 +134,7 @@ impl Chat {
|
||||||
|
|
||||||
pub fn server(
|
pub fn server(
|
||||||
sid: SID,
|
sid: SID,
|
||||||
|
app_name: &str,
|
||||||
app_cid: Option<CID>,
|
app_cid: Option<CID>,
|
||||||
opcode_post: Option<usize>,
|
opcode_post: Option<usize>,
|
||||||
opcode_event: Option<usize>,
|
opcode_event: Option<usize>,
|
||||||
|
|
@ -146,7 +149,7 @@ pub fn server(
|
||||||
// let mut opcode_event = opcode_event;
|
// let mut opcode_event = opcode_event;
|
||||||
// let mut opcode_rawkeys = opcode_rawkeys;
|
// 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 user_post = true;
|
||||||
let mut allow_redraw = false;
|
let mut allow_redraw = false;
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ pub(crate) struct Ui {
|
||||||
impl Ui {
|
impl Ui {
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(
|
||||||
sid: xous::SID,
|
sid: xous::SID,
|
||||||
|
app_name: &str,
|
||||||
app_cid: Option<xous::CID>,
|
app_cid: Option<xous::CID>,
|
||||||
opcode_event: Option<usize>,
|
opcode_event: Option<usize>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
|
@ -64,7 +65,7 @@ impl Ui {
|
||||||
|
|
||||||
let token = gam
|
let token = gam
|
||||||
.register_ux(UxRegistration {
|
.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,
|
ux_type: gam::UxType::Chat,
|
||||||
predictor: Some(xous_ipc::String::<64>::from_str(
|
predictor: Some(xous_ipc::String::<64>::from_str(
|
||||||
ime_plugin_shell::SERVER_NAME_IME_PLUGIN_SHELL,
|
ime_plugin_shell::SERVER_NAME_IME_PLUGIN_SHELL,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue