0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-19 19:42:20 +02:00
This commit is contained in:
Patrick Goldinger 2024-07-08 19:51:47 +02:00 committed by lm41
parent be4cd4d897
commit ac162a8a91
No known key found for this signature in database
17 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,8 @@
plugins {
alias(libs.plugins.kotlin.jvm)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@ -0,0 +1,4 @@
package org.florisboard.lib.flyt
class MyClass {
}

View File

@ -0,0 +1,6 @@
package org.florisboard.lib.flyt.touch
sealed class TouchAction {
inner class Output(val ch: String)
inner class SwitchLayer(val to: String)
}

View File

@ -0,0 +1,7 @@
package org.florisboard.lib.flyt.touch
import org.florisboard.lib.flyt.xml.FlytKey
class TouchKey(val base: FlytKey) {
}

View File

@ -0,0 +1,9 @@
package org.florisboard.lib.flyt.touch
import org.florisboard.lib.flyt.xml.FlytKeyboard
class TouchKeyboard(val base: FlytKeyboard) {
private val layers = mutableMapOf<String, TouchLayer>()
fun compute(widthPx: Int, heightPx: Int) {}
}

View File

@ -0,0 +1,7 @@
package org.florisboard.lib.flyt.touch
import org.florisboard.lib.flyt.xml.FlytLayer
class TouchLayer(val base: FlytLayer) {
private val rows = mutableListOf<TouchLayer>()
}

View File

@ -0,0 +1,7 @@
package org.florisboard.lib.flyt.touch
import org.florisboard.lib.flyt.xml.FlytRow
class TouchRow(val base: FlytRow) {
private val keys = mutableListOf<TouchKey>()
}

View File

@ -0,0 +1,7 @@
package org.florisboard.lib.flyt.xml
data class FlytDisplay(
val output: String?,
val keyId: String?,
val display: String,
)

View File

@ -0,0 +1,5 @@
package org.florisboard.lib.flyt.xml
data class FlytDisplayOptions(
val baseCharacter: String,
)

View File

@ -0,0 +1,8 @@
package org.florisboard.lib.flyt.xml
data class FlytInfo(
val name: String,
val author: String?,
val layout: String?,
val indicator: String?,
)

View File

@ -0,0 +1,35 @@
package org.florisboard.lib.flyt.xml
/*
Not all keys need to be listed explicitly. The following two can be assumed to already exist:
<key id="gap" gap="true" width="1"/>
<key id="space" output=" " stretch="true" width="1"/>
In addition, these 62 keys, comprising 10 digit keys, 26 Latin lower-case keys, and 26 Latin upper-case keys, where the id is the same as the to, are assumed to exist:
<key id="0" output="0"/>
<key id="1" output="1"/>
<key id="2" output="2"/>
<key id="A" output="A"/>
<key id="B" output="B"/>
<key id="C" output="C"/>
<key id="a" output="a"/>
<key id="b" output="b"/>
<key id="c" output="c"/>
*/
data class FlytKey(
val id: String,
val flickId: String?,
val gap: Boolean,
val output: String,
val longPressKeyIds: List<String>,
val longPressDefaultKeyId: String?,
val multiTapKeyIds: List<String>,
val stretch: Boolean,
val layerId: String,
val width: Double,
)

View File

@ -0,0 +1,17 @@
package org.florisboard.lib.flyt.xml
import java.util.*
data class FlytKeyboard(
val conformsTo: Int, // >= 45
val primaryLocale: Locale,
val secondaryLocales: List<Locale>,
val version: String,
val info: FlytInfo,
val settings: FlytSettings,
val displays: List<FlytDisplay>,
val displayOptions: FlytDisplayOptions,
val keys: List<FlytKey>,
val layers: List<FlytLayer>,
val variables: List<FlytVariable<*>>
)

View File

@ -0,0 +1,7 @@
package org.florisboard.lib.flyt.xml
data class FlytLayer(
val id: String?,
val modifiers: String?,
val rows: List<FlytRow>,
)

View File

@ -0,0 +1,5 @@
package org.florisboard.lib.flyt.xml
data class FlytRow(
val keys: List<String>,
)

View File

@ -0,0 +1,5 @@
package org.florisboard.lib.flyt.xml
data class FlytSettings(
val normalization: Boolean,
)

View File

@ -0,0 +1,21 @@
package org.florisboard.lib.flyt.xml
sealed class FlytVariable<T> {
abstract val id: String
abstract val value: T
}
data class FlytStringVariable(
override val id: String,
override val value: String,
) : FlytVariable<String>()
data class FlytSetVariable(
override val id: String,
override val value: List<String>,
) : FlytVariable<List<String>>()
data class FlytUsetVariable(
override val id: String,
override val value: List<String>,
) : FlytVariable<List<String>>()

View File

@ -36,6 +36,7 @@ dependencyResolutionManagement {
include(":app") include(":app")
include(":benchmark") include(":benchmark")
include(":lib:android") include(":lib:android")
include(":lib:flyt")
include(":lib:kotlin") include(":lib:kotlin")
include(":lib:native") include(":lib:native")
include(":lib:snygg") include(":lib:snygg")