forked from iced-rs/iced
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iced-rs#2 from t18b219k/ime_support
Move IME candidate window . sorry for big change
- Loading branch information
Showing
38 changed files
with
268 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//! Access the IME. | ||
use std::fmt; | ||
|
||
/// | ||
pub trait IME { | ||
/// | ||
fn set_ime_allowed(&self, allowed: bool); | ||
|
||
/// | ||
fn set_ime_position(&self, x: i32, y: i32); | ||
} | ||
|
||
/// A null implementation of the [`IME`] trait. | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct Null; | ||
|
||
impl IME for Null { | ||
fn set_ime_allowed(&self, _allowed: bool) {} | ||
|
||
fn set_ime_position(&self, _x: i32, _y: i32) {} | ||
} | ||
|
||
/// A IME action to be performed by some [`Command`]. | ||
/// | ||
/// [`Command`]: crate::Command | ||
pub enum Action { | ||
/// | ||
Allow(bool), | ||
|
||
/// | ||
Position(i32, i32), | ||
} | ||
|
||
impl fmt::Debug for Action { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
Action::Allow(_) => { | ||
write!(f, "Action::Allow") | ||
} | ||
Action::Position(_, _) => write!(f, "Action::SetPosition"), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.