-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native] Start porting all jni code to rust #8
The first parts of ProximityInfo have been fully ported.
- Loading branch information
1 parent
dbd0434
commit c354650
Showing
9 changed files
with
621 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// TODO: move constants to more reasonable locations in the future | ||
// constants from defines.h | ||
|
||
/// The max number of the keys in one keyboard layout | ||
pub const MAX_KEY_COUNT_IN_A_KEYBOARD: usize = 64; | ||
|
||
pub const KEYCODE_SPACE: char = ' '; | ||
pub const KEYCODE_SINGLE_QUOTE: char = '\''; | ||
pub const KEYCODE_HYPHEN_MINUS: char = '-'; |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
mod defines; | ||
mod emojisearch; | ||
mod expect_droid; | ||
mod log; | ||
mod math; | ||
mod suggest; |
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,14 @@ | ||
#[inline] | ||
pub fn square_float(x: f32) -> f32 { | ||
x * x | ||
} | ||
|
||
#[inline] | ||
pub fn get_distance_int(x1: i32, y1: i32, x2: i32, y2: i32) -> i32 { | ||
((x1 - x2) as f32).hypot((y1 - y2) as f32) as i32 | ||
} | ||
|
||
#[inline] | ||
pub fn get_distance(x1: f32, y1: f32, x2: f32, y2: f32) -> i32 { | ||
(x1 - x2).hypot(y1 - y2) as i32 | ||
} |
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,2 @@ | ||
mod core; | ||
mod entrypoints; |
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 @@ | ||
pub(crate) mod layout; |
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,2 @@ | ||
pub(crate) mod proximity_info; | ||
mod proximity_info_params; |
Oops, something went wrong.