#[repr(C)]pub struct msime_engine_state {Show 13 fields
pub struct_size: u32,
pub scheme: u32,
pub revision: u64,
pub candidate_count: u32,
pub flags: u32,
pub local_mode: u32,
pub caret_byte: u32,
pub conversion_focus_start_scalar: u32,
pub conversion_focus_end_scalar: u32,
pub preedit: msime_engine_str,
pub editing_text: msime_engine_str,
pub conversion: msime_engine_str,
pub spelling_symbols: msime_engine_str,
}Expand description
组字状态(ABI 1.0),msime_engine_state_get 填写,收发规则同 msime_engine_result。字符串借自会话按修订号缓存的快照,msime_engine_state_get、msime_engine_candidate_get 这类只读调用不让它们失效。
Fields§
§struct_size: u32§scheme: u32当前方案,MSIME_ENGINE_SCHEME_*。
revision: u64候选修订号:每次可能改变候选的调用都让它变,从 0 起只增不减。按下标选择和取候选时原样交回。
candidate_count: u32§flags: u32MSIME_ENGINE_STATE_* 的组合。
local_mode: u32MSIME_ENGINE_LOCAL_MODE_*。
caret_byte: u32组字光标在 editing_text 里的字节偏移。
conversion_focus_start_scalar: u32整句改字的光标,按 conversion 的字(Unicode 标量)计:光标在第 conversion_focus_start_scalar 个字之前,[start, end) 是候选替换的那一段;不在改字时两者都是 0。
conversion_focus_end_scalar: u32§preedit: msime_engine_str给用户看的组字:全拼按音节分开(ni'hao),双拼默认是按键原文,本地模式与专用英文是按键原文。
editing_text: msime_engine_str按键原文(ASCII),caret_byte 指向它;为空就是没有在组字。
conversion: msime_engine_str整句改字时改好的整句,宿主在它非空时把它画在行内代替拼音。
spelling_symbols: msime_engine_str此刻要按字符(msime_engine_key_char)而不是按标点交来的非字母键,见 README 的按键路由。
Trait Implementations§
Source§impl Clone for msime_engine_state
impl Clone for msime_engine_state
impl Copy for msime_engine_state
Auto Trait Implementations§
impl !Send for msime_engine_state
impl !Sync for msime_engine_state
impl Freeze for msime_engine_state
impl RefUnwindSafe for msime_engine_state
impl Unpin for msime_engine_state
impl UnsafeUnpin for msime_engine_state
impl UnwindSafe for msime_engine_state
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more