From 1d64032f63e8b18353edbd27b0547c40b9fc2bcb Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 26 Feb 2024 19:43:37 +0300 Subject: [PATCH] Organize app colors --- src/nativeMain/kotlin/Main.kt | 4 +- src/nativeMain/kotlin/ui/AppPresenter.kt | 20 ++--- src/nativeMain/kotlin/ui/AppView.kt | 45 ++++------ src/nativeMain/kotlin/ui/ColorMap.kt | 89 ------------------- src/nativeMain/kotlin/ui/CommonColors.kt | 23 +++++ .../kotlin/ui/logLines/LogLineExtensions.kt | 13 +-- .../kotlin/ui/logLines/LogLinesPresenter.kt | 17 ++-- .../kotlin/ui/logLines/TagExtensions.kt | 71 ++++++++++++--- src/nativeMain/kotlin/ui/status/StatusView.kt | 39 ++++---- src/nativeMain/kotlin/userInput/Input.kt | 2 +- src/nativeMain/kotlin/userInput/Keymap.kt | 84 ++++++++--------- 11 files changed, 188 insertions(+), 219 deletions(-) delete mode 100644 src/nativeMain/kotlin/ui/ColorMap.kt create mode 100644 src/nativeMain/kotlin/ui/CommonColors.kt diff --git a/src/nativeMain/kotlin/Main.kt b/src/nativeMain/kotlin/Main.kt index ca37433..dd50804 100644 --- a/src/nativeMain/kotlin/Main.kt +++ b/src/nativeMain/kotlin/Main.kt @@ -35,7 +35,7 @@ fun main(args: Array) { input .keypresses .filter { - Keymap.bindings[it] == Actions.Quit + Keymap.bindings[it] == Actions.QUIT } .onEach { Logger.d("${context()} Cancel scope") @@ -49,6 +49,8 @@ fun main(args: Array) { appJob.join() } ui.close() + //close presenter + //exit with nonzero upon exception Logger.d("Exit!") Logger.close() diff --git a/src/nativeMain/kotlin/ui/AppPresenter.kt b/src/nativeMain/kotlin/ui/AppPresenter.kt index 9656770..a657dda 100644 --- a/src/nativeMain/kotlin/ui/AppPresenter.kt +++ b/src/nativeMain/kotlin/ui/AppPresenter.kt @@ -94,15 +94,15 @@ class AppPresenter( private suspend fun handleKeypress(keyCode: Int) { when (Keymap.bindings[keyCode]) { - Autoscroll -> { + AUTOSCROLL -> { appState.autoscroll(!appState.state.value.autoscroll) } - ClearLogs -> { + CLEAR_LOGS -> { dogcat(ClearLogSource) } - ToggleFilterByPackage -> { + TOGGLE_FILTER_BY_PACKAGE -> { val f = appState.state.value.packageFilter if (f.second) { @@ -116,31 +116,31 @@ class AppPresenter( } } - ResetFilterBySubstring -> { + RESET_FILTER_BY_SUBSTRING -> { dogcat(ResetFilter(Substring::class)) } - ResetFilterByMinLogLevel -> { + RESET_FILTER_BY_MIN_LOG_LEVEL -> { dogcat(ResetFilter(MinLogLevel::class)) } - MinLogLevelV -> { + MIN_LOG_LEVEL_V -> { dogcat(FilterBy(MinLogLevel(V))) } - MinLogLevelD -> { + MIN_LOG_LEVEL_D -> { dogcat(FilterBy(MinLogLevel(D))) } - MinLogLevelI -> { + MIN_LOG_LEVEL_I -> { dogcat(FilterBy(MinLogLevel(I))) } - MinLogLevelW -> { + MIN_LOG_LEVEL_W -> { dogcat(FilterBy(MinLogLevel(W))) } - MinLogLevelE -> { + MIN_LOG_LEVEL_E -> { dogcat(FilterBy(MinLogLevel(E))) } diff --git a/src/nativeMain/kotlin/ui/AppView.kt b/src/nativeMain/kotlin/ui/AppView.kt index b2341c2..4af4419 100644 --- a/src/nativeMain/kotlin/ui/AppView.kt +++ b/src/nativeMain/kotlin/ui/AppView.kt @@ -1,5 +1,6 @@ package ui +import dogcat.DogcatException import kotlinx.cinterop.ExperimentalForeignApi import ncurses.* import platform.posix.LC_ALL @@ -8,53 +9,37 @@ import platform.posix.printf import platform.posix.setlocale @OptIn(ExperimentalForeignApi::class) -class AppView { +class AppView : HasLifecycle { - fun start() { - setlocale(LC_ALL, "en_US.UTF-8") // should be before initscr() + override suspend fun start() { + setlocale(LC_ALL, "en_US.UTF-8") initscr() - //The keypad function enables the reading of function keys like arrow keys, Home, End, and so on. keypad(stdscr, true); noecho(); - //intrflush(stdscr, false) - - //nonl() - - //nl() - //Use the ncurses functions for output. My guess is that initscr changes terminal settings such that \n only performs a line feed, not a carriage return. – - //melpomene - - nodelay(stdscr, true) //The nodelay option causes getch to be a non-blocking call. If no input is ready, getch returns ERR. If disabled (bf is FALSE), getch waits until a key is pressed - + // The nodelay option causes getch to be a non-blocking call. If no input is ready, getch returns ERR. + // If disabled (bf is FALSE), getch waits until a key is pressed + nodelay(stdscr, true) //cbreak or raw, to make wgetch read unbuffered data, i.e., not waiting for '\n'. - //nodelay or timeout, to control the amount of time wgetch spends waiting for input. - - //??? enable - //cbreak() //making getch() work without a buffer I.E. raw characters if (!has_colors()) { endwin() - printf("Your terminal does not support color\n") + + throw DogcatException("Your terminal does not support color") + //printf("Your terminal does not support color\n") exit(1) } - //idlok¶ - use_default_colors() start_color() - init_pair(1, COLOR_RED.toShort(), -1) - init_pair(2, COLOR_GREEN.toShort(), -1)//COLOR_BLACK.toShort()) - init_pair(3, COLOR_YELLOW.toShort(), -1) - //init_pair(4, COLOR_CYAN.toShort(), COLOR_BLACK.toShort()) - - init_pair(11, COLOR_BLACK.toShort(), COLOR_RED.toShort()) - init_pair(12, COLOR_BLACK.toShort(), COLOR_WHITE.toShort()) - init_pair(6, COLOR_BLACK.toShort(), COLOR_YELLOW.toShort()) + + CommonColors.entries.forEach { + init_pair(it.colorPairCode.toShort(), it.foregroundColor, it.backgroundColor) + } } - fun stop() { + override suspend fun stop() { endwin() } } diff --git a/src/nativeMain/kotlin/ui/ColorMap.kt b/src/nativeMain/kotlin/ui/ColorMap.kt deleted file mode 100644 index 42ddc08..0000000 --- a/src/nativeMain/kotlin/ui/ColorMap.kt +++ /dev/null @@ -1,89 +0,0 @@ -package ui - -import kotlinx.cinterop.ExperimentalForeignApi -import ncurses.* -import ui.ColorMap.ColorPairs.* - -@OptIn(ExperimentalForeignApi::class) -object ColorMap { - - fun allocateColor(tag: String): Int { - if (!KNOWN_TAGS.containsKey(tag)) { - KNOWN_TAGS[tag] = LAST_USED[0] - } - val color = KNOWN_TAGS[tag]!! - - if (LAST_USED.contains(color)) { - LAST_USED.remove(color) - LAST_USED.add(color) - } - - return color - } - - - private val LAST_USED = mutableListOf( - /*COLOR_RED,*/ - COLOR_GREEN, - /*COLOR_YELLOW,*/ - COLOR_BLUE, - COLOR_MAGENTA, - COLOR_CYAN - ) - - private val KNOWN_TAGS = mutableMapOf( - "dalvikvm" to COLOR_WHITE, - "Process" to COLOR_WHITE, - "ActivityManager" to COLOR_WHITE, - "ActivityThread" to COLOR_WHITE, - "AndroidRuntime" to COLOR_CYAN, - "jdwp" to COLOR_WHITE, - "StrictMode" to COLOR_WHITE, - "DEBUG" to COLOR_YELLOW, - ) - - val COLOR_MAP = (LAST_USED + KNOWN_TAGS.values) - .associateWith { - init_pair((100 + it).toShort(), it.toShort(), -1) - (100 + it) - } - - - - val COLOR_PAIRS = listOf( - COLOR_RED.toShort() to -1, - COLOR_GREEN.toShort() to -1, - COLOR_YELLOW.toShort() to -1, - ) - - - enum class ColorPairs(val assignedCode: Int) { - Red(1), Green(2), Yellow(3) - } - - - val m = - mapOf( - Red to (COLOR_RED.toShort() to -1), - Green to (COLOR_GREEN.toShort() to -1), - Yellow to (COLOR_YELLOW.toShort() to -1) - - ) -/* - enum class ColorPair(val id: Int, val foreground: Short, val background: Short) { - RED_BLACK(1, COLOR_RED.toShort(), -1), - GREEN_BLACK(2, COLOR_GREEN.toShort(), -1), - YELLOW_BLACK(3, COLOR_YELLOW.toShort(), -1), - CYAN_BLACK(4, COLOR_CYAN.toShort(), COLOR_BLACK.toShort()), - BLACK_RED(11, COLOR_BLACK.toShort(), COLOR_RED.toShort()), - BLACK_WHITE(12, COLOR_BLACK.toShort(), COLOR_WHITE.toShort()), - BLACK_YELLOW(6, COLOR_BLACK.toShort(), COLOR_YELLOW.toShort()); - - fun init() { - init_pair(id, foreground, background) - } - } - -// Initialize color pairs - ColorPair.values().forEach { it.init() }*/ -} diff --git a/src/nativeMain/kotlin/ui/CommonColors.kt b/src/nativeMain/kotlin/ui/CommonColors.kt new file mode 100644 index 0000000..5a67da5 --- /dev/null +++ b/src/nativeMain/kotlin/ui/CommonColors.kt @@ -0,0 +1,23 @@ +package ui + +import kotlinx.cinterop.ExperimentalForeignApi +import ncurses.* + +@ExperimentalForeignApi +enum class CommonColors( + val colorPairCode: Int, + val foregroundColor: Short, + val backgroundColor: Short +) { + + RED_ON_BG(1, COLOR_RED.toShort(), -1), + GREEN_ON_BG(2, COLOR_GREEN.toShort(), -1), + YELLOW_ON_BG(3, COLOR_YELLOW.toShort(), -1), + + RED_ON_WHITE(4, COLOR_RED.toShort(), COLOR_WHITE.toShort()), + GREEN_ON_WHITE(5, COLOR_GREEN.toShort(), COLOR_WHITE.toShort()), + + BLACK_ON_WHITE(6, COLOR_BLACK.toShort(), COLOR_WHITE.toShort()), + BLACK_ON_RED(7, COLOR_BLACK.toShort(), COLOR_RED.toShort()), + BLACK_ON_YELLOW(8, COLOR_BLACK.toShort(), COLOR_YELLOW.toShort()) +} diff --git a/src/nativeMain/kotlin/ui/logLines/LogLineExtensions.kt b/src/nativeMain/kotlin/ui/logLines/LogLineExtensions.kt index 4ba1547..493ec57 100644 --- a/src/nativeMain/kotlin/ui/logLines/LogLineExtensions.kt +++ b/src/nativeMain/kotlin/ui/logLines/LogLineExtensions.kt @@ -10,6 +10,8 @@ import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.coroutines.yield import logger.Logger import ncurses.* +import ui.CommonColors +import ui.CommonColors.* import kotlin.math.min @OptIn(ExperimentalForeignApi::class) @@ -33,19 +35,18 @@ suspend fun LogLinesView.processLogLine( val wrapped = wrappedLine.first recordLine(wrappedLine.second) - val level = logLine.level - when (level) { + when (val level = logLine.level) { W -> { - printLevelAndMessage(level.name, 6, wrapped, COLOR_PAIR(3)) + printLevelAndMessage(level.name, BLACK_ON_YELLOW.colorPairCode, wrapped, COLOR_PAIR(YELLOW_ON_BG.colorPairCode)) } E, F -> { - printLevelAndMessage(level.name, 11, wrapped, COLOR_PAIR(1)) + printLevelAndMessage(level.name, BLACK_ON_RED.colorPairCode, wrapped, COLOR_PAIR(RED_ON_BG.colorPairCode)) } I -> { - printLevelAndMessage(level.name, 12, wrapped, A_BOLD.toInt()) + printLevelAndMessage(level.name, BLACK_ON_WHITE.colorPairCode, wrapped, A_BOLD.toInt()) } else -> { - printLevelAndMessage(level.name, 12, wrapped, 0) + printLevelAndMessage(level.name, BLACK_ON_WHITE.colorPairCode, wrapped, 0) } } diff --git a/src/nativeMain/kotlin/ui/logLines/LogLinesPresenter.kt b/src/nativeMain/kotlin/ui/logLines/LogLinesPresenter.kt index 26de96b..b0c9403 100644 --- a/src/nativeMain/kotlin/ui/logLines/LogLinesPresenter.kt +++ b/src/nativeMain/kotlin/ui/logLines/LogLinesPresenter.kt @@ -112,38 +112,33 @@ class LogLinesPresenter( .keypresses .collect { when (Keymap.bindings[it]) { - Home -> { + HOME -> { appState.autoscroll(false) - //view.state = view.state.copy(autoscroll = false) view.home() } - End -> { + END -> { appState.autoscroll(true) - //view.state = view.state.copy(autoscroll = true) view.end() } - LineUp -> { + LINE_UP -> { appState.autoscroll(false) - //view.state = view.state.copy(autoscroll = false) view.lineUp() } - LineDown -> { + LINE_DOWN -> { appState.autoscroll(false) - //view.state = view.state.copy(autoscroll = false) view.lineDown(1) } - PageDown -> { + PAGE_DOWN -> { appState.autoscroll(false) view.pageDown() } - PageUp -> { + PAGE_UP -> { appState.autoscroll(false) - //view.state = view.state.copy(autoscroll = false) view.pageUp() } diff --git a/src/nativeMain/kotlin/ui/logLines/TagExtensions.kt b/src/nativeMain/kotlin/ui/logLines/TagExtensions.kt index a9218db..3900aac 100644 --- a/src/nativeMain/kotlin/ui/logLines/TagExtensions.kt +++ b/src/nativeMain/kotlin/ui/logLines/TagExtensions.kt @@ -2,29 +2,72 @@ package ui.logLines import AppConfig.DEFAULT_TAG_WIDTH import kotlinx.cinterop.ExperimentalForeignApi -import ncurses.COLOR_PAIR -import ncurses.waddstr -import ncurses.wattroff -import ncurses.wattron -import ui.ColorMap.allocateColor -import ui.ColorMap.COLOR_MAP +import ncurses.* @OptIn(ExperimentalForeignApi::class) internal fun LogLinesView.printTag(tag: String) { val color = allocateColor(tag) - wattron(pad, COLOR_PAIR(COLOR_MAP[color]!!)) - waddstr(pad, tag.procrustes()) - wattroff(pad, COLOR_PAIR(COLOR_MAP[color]!!)) + wattron(pad, COLOR_PAIR(TAG_COLOR_MAP[color]!!)) + waddstr(pad, procrustes(tag)) + wattroff(pad, COLOR_PAIR(TAG_COLOR_MAP[color]!!)) } -private fun String.procrustes() = - if (length > DEFAULT_TAG_WIDTH) { +private fun procrustes(tag: String) = + if (tag.length > DEFAULT_TAG_WIDTH) { val excess = 1 - DEFAULT_TAG_WIDTH % 2 - take(DEFAULT_TAG_WIDTH / 2 - excess) + + tag.take(DEFAULT_TAG_WIDTH / 2 - excess) + Typography.ellipsis + - takeLast(DEFAULT_TAG_WIDTH / 2) + tag.takeLast(DEFAULT_TAG_WIDTH / 2) } else { - trim().padStart(DEFAULT_TAG_WIDTH) + tag.trim().padStart(DEFAULT_TAG_WIDTH) + } + +private fun allocateColor(tag: String): Int { + if (!KNOWN_TAG_COLORS.containsKey(tag)) { + KNOWN_TAG_COLORS[tag] = LAST_USED_TAG_COLORS[0] + } + val color = KNOWN_TAG_COLORS[tag]!! + + if (LAST_USED_TAG_COLORS.contains(color)) { + LAST_USED_TAG_COLORS.remove(color) + LAST_USED_TAG_COLORS.add(color) + } + + return color +} + +@OptIn(ExperimentalForeignApi::class) +private val LAST_USED_TAG_COLORS = mutableListOf( + COLOR_GREEN, + COLOR_BLUE, + COLOR_MAGENTA, + COLOR_CYAN +) + +// need this? +@OptIn(ExperimentalForeignApi::class) +private val KNOWN_TAG_COLORS = mutableMapOf( + "EGL_emulation" to COLOR_WHITE, + + "dalvikvm" to COLOR_WHITE, + "Process" to COLOR_WHITE, + "ActivityManager" to COLOR_WHITE, + "ActivityThread" to COLOR_WHITE, + "AndroidRuntime" to COLOR_CYAN, + "jdwp" to COLOR_WHITE, + "StrictMode" to COLOR_WHITE, + "DEBUG" to COLOR_YELLOW, +) + +private const val TAG_COLOR_PAIR_OFFSET = 100 + +@OptIn(ExperimentalForeignApi::class) +private val TAG_COLOR_MAP = (LAST_USED_TAG_COLORS + KNOWN_TAG_COLORS.values) + .associateWith { + val nextColorPair = TAG_COLOR_PAIR_OFFSET + it + init_pair(nextColorPair.toShort(), it.toShort(), -1) + + nextColorPair } diff --git a/src/nativeMain/kotlin/ui/status/StatusView.kt b/src/nativeMain/kotlin/ui/status/StatusView.kt index 0623935..f5ce3c4 100644 --- a/src/nativeMain/kotlin/ui/status/StatusView.kt +++ b/src/nativeMain/kotlin/ui/status/StatusView.kt @@ -5,8 +5,8 @@ import dogcat.LogFilter.* import dogcat.state.AppliedFilters import kotlinx.cinterop.CPointer import kotlinx.cinterop.ExperimentalForeignApi -import logger.Logger import ncurses.* +import ui.CommonColors.* import kotlin.properties.Delegates @OptIn(ExperimentalForeignApi::class) @@ -60,9 +60,9 @@ class StatusView { private fun updateBackground() { val sx = getmaxx(stdscr) wmove(window, 0, 0) - wattron(window, COLOR_PAIR(12)) + wattron(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) waddstr(window, " ".repeat(sx)) - wattroff(window, COLOR_PAIR(12)) + wattroff(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) } private fun updateFilters(filters: AppliedFilters) { @@ -72,19 +72,18 @@ class StatusView { val fs = (it.value as Substring).substring if (!state.isCursorHeld) { - wattroff(window, COLOR_PAIR(12)) + wattroff(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) mvwprintw(window, 1, AppConfig.INPUT_FILTER_PREFIX.length, fs) - //TODO don't clear to end, there is device info wclrtoeol(window) - wattron(window, COLOR_PAIR(12)) + wattron(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) } } MinLogLevel::class -> { - wattron(window, COLOR_PAIR(12)) + wattron(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) mvwprintw(window, 0, 0, " Log: ${(it.value as MinLogLevel).logLevel.readable.uppercase()}") - wattroff(window, COLOR_PAIR(12)) + wattroff(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) } ByPackage::class -> { @@ -96,31 +95,41 @@ class StatusView { } private fun updateAutoscroll(autoscroll: Boolean) { - wattron(window, COLOR_PAIR(12)) + wattron(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) //extract strings val a = if (autoscroll) "| Autoscroll" else "| No autoscroll" mvwprintw(window, 0, 15, a) - wattroff(window, COLOR_PAIR(12)) + wattroff(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) } private fun updateDevice(device: String?, running: Boolean) { device?.let { curs_set(0) - val cp = if (running) 2 else 1 + val colorPairCode = + if (running) BLACK_ON_WHITE.colorPairCode + else RED_ON_WHITE.colorPairCode + + wattron(window, COLOR_PAIR(colorPairCode)) + if (!running) { + wattron(window, A_BOLD.toInt()) + } - wattron(window, COLOR_PAIR(cp)) mvwprintw(window, 0, getmaxx(window) - device.length - 1, device) - wattroff(window, COLOR_PAIR(cp)) + wattroff(window, COLOR_PAIR(colorPairCode)) + + if (!running) { + wattroff(window, A_BOLD.toInt()) + } } } private fun updatePackageName(packageName: String) { - wattron(window, COLOR_PAIR(12)) + wattron(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) val s = if (packageName.isNotEmpty()) "$packageName | " else "All apps | " mvwprintw(window, 0, getmaxx(window) - s.length - 1 - 15, s) - wattroff(window, COLOR_PAIR(12)) + wattroff(window, COLOR_PAIR(BLACK_ON_WHITE.colorPairCode)) } } diff --git a/src/nativeMain/kotlin/userInput/Input.kt b/src/nativeMain/kotlin/userInput/Input.kt index 8d9f54b..8f1997f 100644 --- a/src/nativeMain/kotlin/userInput/Input.kt +++ b/src/nativeMain/kotlin/userInput/Input.kt @@ -58,7 +58,7 @@ class DefaultInput( continue } - if (Keymap.bindings[key] == Keymap.Actions.InputFilterBySubstring && !inputMode) { + if (Keymap.bindings[key] == Keymap.Actions.INPUT_FILTER_BY_SUBSTRING && !inputMode) { appState.holdCursor(true) inputMode = true diff --git a/src/nativeMain/kotlin/userInput/Keymap.kt b/src/nativeMain/kotlin/userInput/Keymap.kt index 948b206..5e4827e 100644 --- a/src/nativeMain/kotlin/userInput/Keymap.kt +++ b/src/nativeMain/kotlin/userInput/Keymap.kt @@ -8,60 +8,60 @@ object Keymap { @OptIn(ExperimentalForeignApi::class) val bindings = mapOf( - 'p'.code to Autoscroll, - 'q'.code to Quit, + 'p'.code to AUTOSCROLL, + 'q'.code to QUIT, //add escape to cancel filter - 'f'.code to InputFilterBySubstring, + 'f'.code to INPUT_FILTER_BY_SUBSTRING, - 'a'.code to Home, - KEY_HOME to Home, - 'z'.code to End, - KEY_END to End, - 'w'.code to LineUp, - KEY_UP to LineUp, - 's'.code to LineDown, - KEY_DOWN to LineDown, - 'd'.code to PageDown, - KEY_NPAGE to PageDown, - 'e'.code to PageUp, - KEY_PPAGE to PageUp, + 'a'.code to HOME, + KEY_HOME to HOME, + 'z'.code to END, + KEY_END to END, + 'w'.code to LINE_UP, + KEY_UP to LINE_UP, + 's'.code to LINE_DOWN, + KEY_DOWN to LINE_DOWN, + 'd'.code to PAGE_DOWN, + KEY_NPAGE to PAGE_DOWN, + 'e'.code to PAGE_UP, + KEY_PPAGE to PAGE_UP, - 'c'.code to ClearLogs, + 'c'.code to CLEAR_LOGS, - '3'.code to ToggleFilterByPackage, - '4'.code to ResetFilterBySubstring, - '5'.code to ResetFilterByMinLogLevel, + '6'.code to TOGGLE_FILTER_BY_PACKAGE, + '7'.code to RESET_FILTER_BY_SUBSTRING, + '8'.code to RESET_FILTER_BY_MIN_LOG_LEVEL, - '6'.code to MinLogLevelV, - '7'.code to MinLogLevelD, - '8'.code to MinLogLevelI, - '9'.code to MinLogLevelW, - '0'.code to MinLogLevelE, + '1'.code to MIN_LOG_LEVEL_V, + '2'.code to MIN_LOG_LEVEL_D, + '3'.code to MIN_LOG_LEVEL_I, + '4'.code to MIN_LOG_LEVEL_W, + '5'.code to MIN_LOG_LEVEL_E, ) enum class Actions { - Autoscroll, - ClearLogs, - InputFilterBySubstring, + AUTOSCROLL, + CLEAR_LOGS, + INPUT_FILTER_BY_SUBSTRING, - Home, - End, - PageUp, - PageDown, - LineUp, - LineDown, + HOME, + END, + PAGE_UP, + PAGE_DOWN, + LINE_UP, + LINE_DOWN, - ToggleFilterByPackage, - ResetFilterBySubstring, - ResetFilterByMinLogLevel, + TOGGLE_FILTER_BY_PACKAGE, + RESET_FILTER_BY_SUBSTRING, + RESET_FILTER_BY_MIN_LOG_LEVEL, - MinLogLevelV, - MinLogLevelD, - MinLogLevelI, - MinLogLevelW, - MinLogLevelE, + MIN_LOG_LEVEL_V, + MIN_LOG_LEVEL_D, + MIN_LOG_LEVEL_I, + MIN_LOG_LEVEL_W, + MIN_LOG_LEVEL_E, - Quit + QUIT } }