layout: Split out static data
This will make it possible later to cache this data or compare for best size selection without hassle.
This commit is contained in:
		@ -192,7 +192,7 @@ fn iter_layout_sources(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn load_layout_data(source: DataSource)
 | 
			
		||||
    -> Result<::layout::LayoutData, LoadError>
 | 
			
		||||
    -> Result<::layout::LayoutParseData, LoadError>
 | 
			
		||||
{
 | 
			
		||||
    let handler = logging::Print {};
 | 
			
		||||
    match source {
 | 
			
		||||
@ -217,7 +217,7 @@ fn load_layout_data_with_fallback(
 | 
			
		||||
    kind: ArrangementKind,
 | 
			
		||||
    purpose: ContentPurpose,
 | 
			
		||||
    overlay: Option<&str>,
 | 
			
		||||
) -> (ArrangementKind, layout::LayoutData) {
 | 
			
		||||
) -> (ArrangementKind, layout::LayoutParseData) {
 | 
			
		||||
 | 
			
		||||
    // Build the path to the right keyboard layout subdirectory
 | 
			
		||||
    let path = env::var_os("SQUEEKBOARD_KEYBOARDSDIR")
 | 
			
		||||
 | 
			
		||||
@ -157,7 +157,7 @@ impl Layout {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pub fn build<H: logging::Handler>(self, mut warning_handler: H)
 | 
			
		||||
        -> (Result<::layout::LayoutData, FormattingError>, H)
 | 
			
		||||
        -> (Result<::layout::LayoutParseData, FormattingError>, H)
 | 
			
		||||
    {
 | 
			
		||||
        let button_names = self.views.values()
 | 
			
		||||
            .flat_map(|rows| {
 | 
			
		||||
@ -279,7 +279,7 @@ impl Layout {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        (
 | 
			
		||||
            Ok(::layout::LayoutData {
 | 
			
		||||
            Ok(layout::LayoutParseData {
 | 
			
		||||
                views: views,
 | 
			
		||||
                keymaps: keymaps.into_iter().map(|keymap_str|
 | 
			
		||||
                    CString::new(keymap_str)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user