Commit da5a83f3 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

action: Rename file to action.rs

parent ef38fd3e
......@@ -384,7 +384,7 @@ fn create_action(
button_info: &HashMap<String, ButtonMeta>,
name: &str,
view_names: Vec<&String>,
) -> ::symbol::Action {
) -> ::action::Action {
let default_meta = ButtonMeta::default();
let symbol_meta = button_info.get(name)
.unwrap_or(&default_meta);
......@@ -440,12 +440,12 @@ fn create_action(
};
match &symbol_meta.action {
Some(Action::SetView(view_name)) => ::symbol::Action::SetLevel(
Some(Action::SetView(view_name)) => ::action::Action::SetLevel(
filter_view_name(name, view_name.clone(), &view_names)
),
Some(Action::Locking {
lock_view, unlock_view
}) => ::symbol::Action::LockLevel {
}) => ::action::Action::LockLevel {
lock: filter_view_name(name, lock_view.clone(), &view_names),
unlock: filter_view_name(
name,
......@@ -453,14 +453,14 @@ fn create_action(
&view_names
),
},
Some(Action::ShowPrefs) => ::symbol::Action::Submit {
Some(Action::ShowPrefs) => ::action::Action::Submit {
text: None,
keys: Vec::new(),
},
None => ::symbol::Action::Submit {
None => ::action::Action::Submit {
text: None,
keys: vec!(
::symbol::KeySym(keysym.unwrap()),
::action::KeySym(keysym.unwrap()),
),
},
}
......@@ -681,9 +681,9 @@ mod tests {
".",
Vec::new()
),
::symbol::Action::Submit {
::action::Action::Submit {
text: None,
keys: vec!(::symbol::KeySym("U002E".into())),
keys: vec!(::action::KeySym("U002E".into())),
}
);
}
......
......@@ -7,7 +7,7 @@ use std::io;
use std::rc::Rc;
use std::string::FromUtf8Error;
use ::symbol::Action;
use ::action::Action;
use std::io::Write;
use std::iter::{ FromIterator, IntoIterator };
......@@ -125,7 +125,7 @@ pub fn generate_keymap(
for (name, state) in keystates.iter() {
let state = state.borrow();
if let ::symbol::Action::Submit { text: _, keys } = &state.action {
if let Action::Submit { text: _, keys } = &state.action {
match keys.len() {
0 => eprintln!("Key {} has no keysyms", name),
a => {
......@@ -157,7 +157,7 @@ pub fn generate_keymap(
)?;
for (name, state) in keystates.iter() {
if let ::symbol::Action::Submit { text: _, keys } = &state.borrow().action {
if let Action::Submit { text: _, keys } = &state.borrow().action {
if let Some(keysym) = keys.iter().next() {
write!(
buf,
......
......@@ -23,9 +23,9 @@ use std::ffi::CString;
use std::rc::Rc;
use std::vec::Vec;
use ::keyboard::*;
use ::action::Action;
use ::float_ord::FloatOrd;
use ::symbol::*;
use ::keyboard::*;
/// Gathers stuff defined in C or called by C
pub mod c {
......@@ -269,10 +269,10 @@ pub mod c {
let layout = unsafe { &mut *layout };
let view_name = match key.to_owned().action {
::symbol::Action::SetLevel(name) => {
Action::SetLevel(name) => {
Some(name.clone())
},
::symbol::Action::LockLevel { lock, unlock } => {
Action::LockLevel { lock, unlock } => {
let locked = {
let key = key.clone_ref();
let mut key = key.borrow_mut();
......@@ -309,9 +309,7 @@ pub mod c {
/// Sets button and row sizes according to their contents.
#[no_mangle]
pub extern "C"
fn squeek_layout_place_contents(
layout: *mut Layout,
) {
fn squeek_layout_place_contents(layout: *mut Layout) {
let layout = unsafe { &mut *layout };
for view in layout.views.values_mut() {
let sizes: Vec<Vec<Bounds>> = view.rows.iter().map(|row| {
......
......@@ -11,6 +11,6 @@ pub mod imservice;
mod keyboard;
mod layout;
mod resources;
mod symbol;
mod action;
mod util;
mod xdg;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment