Skip to content

Commit

Permalink
doc: update the afrim public api documentation (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad authored Feb 16, 2024
1 parent 8cc3838 commit abe18da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
3 changes: 1 addition & 2 deletions service/src/convert.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![deny(missing_docs)]
//! Set of tools to convert external event keyboards to
//! generic keyboard events and vice versa.
//!
#![deny(missing_docs)]

use afrim_preprocessor::{Key, KeyState, KeyboardEvent};
use enigo::{self};
use rdev::{self};
Expand Down
23 changes: 11 additions & 12 deletions service/src/frontend.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
#![deny(missing_docs)]
//! API to develop a frontend interface for the afrim.
//!
#![deny(missing_docs)]

/// Trait that every afrim frontend should implement.
pub trait Frontend {
/// Update the frontenfrontend d size.
/// Updates the frontend screen size.
fn update_screen(&mut self, _screen: (u64, u64)) {}
/// Update the frontend position.
/// Updates the frontend position.
fn update_position(&mut self, _position: (f64, f64)) {}
/// Set the current sequential code to display.
/// Sets the current sequential code to display.
fn set_input(&mut self, _text: &str) {}
/// Set the maximun number of predicates to be display.
/// Sets the maximun number of predicates to be display.
fn set_page_size(&mut self, _size: usize) {}
/// Add a predicate in the list of predicates.
/// Adds a predicate in the list of predicates.
fn add_predicate(&mut self, _code: &str, _remaining_code: &str, _text: &str) {}
/// Refresh the display.
/// Refreshs the display.
fn display(&self) {}
/// Clear the list of predicates.
/// Clears the list of predicates.
fn clear_predicates(&mut self) {}
/// Select the previous predicate.
/// Selects the previous predicate.
fn previous_predicate(&mut self) {}
/// Select the next predicate.
/// Selects the next predicate.
fn next_predicate(&mut self) {}
/// Return the selected predicate.
/// Returns the selected predicate.
fn get_selected_predicate(&self) -> Option<&(String, String, String)> {
Option::None
}
Expand Down
2 changes: 1 addition & 1 deletion service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use frontend::Frontend;
use rdev::{self, EventType, Key as E_Key};
use std::{error, rc::Rc, sync::mpsc, thread};

/// Start the afrim.
/// Starts the afrim.
pub fn run(config: Config, mut frontend: impl Frontend) -> Result<(), Box<dyn error::Error>> {
let memory = utils::build_map(
config
Expand Down

0 comments on commit abe18da

Please sign in to comment.