Add cmdline_pos processing

This commit is contained in:
daa 2018-02-10 12:51:47 +03:00
parent 18843eaba2
commit 89499763ec
3 changed files with 12 additions and 0 deletions

View File

@ -337,6 +337,10 @@ impl CmdLine {
pub fn block_hide(&mut self) {
self.state.borrow_mut().block = None;
}
pub fn pos(&mut self, pos: u64, level: u64) {
//TODO: move cursor
}
}
fn gtk_draw(ctx: &cairo::Context, state: &Arc<UiMutex<State>>) -> Inhibit {

View File

@ -90,6 +90,8 @@ pub trait RedrawEvents {
) -> RepaintMode;
fn cmdline_block_hide(&mut self) -> RepaintMode;
fn cmdline_pos(&mut self, pos: u64, level: u64) -> RepaintMode;
}
pub trait GuiApi {
@ -274,6 +276,7 @@ pub fn call(
"cmdline_block_append" => call!(ui->cmdline_block_append(args: ext)),
"cmdline_hide" => call!(ui->cmdline_hide(args: uint)),
"cmdline_block_hide" => ui.cmdline_block_hide(),
"cmdline_pos" => call!(ui->cmdline_pos(args: uint, uint)),
_ => {
println!("Event {}({:?})", method, args);
RepaintMode::Nothing

View File

@ -1238,6 +1238,11 @@ impl RedrawEvents for State {
self.cmd_line.block_hide();
RepaintMode::Nothing
}
fn cmdline_pos(&mut self, pos: u64, level: u64) -> RepaintMode {
self.cmd_line.pos(pos, level);
RepaintMode::Nothing
}
}
impl CursorRedrawCb for State {