Improve TermMode bitflags initialization

This commit is contained in:
Dimitri Sabadie 2024-09-07 02:25:56 +02:00 committed by GitHub
parent b125b99dd3
commit 68f04024a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 24 deletions

View File

@ -54,30 +54,30 @@ bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct TermMode: u32 {
const NONE = 0;
const SHOW_CURSOR = 0b0000_0000_0000_0000_0000_0001;
const APP_CURSOR = 0b0000_0000_0000_0000_0000_0010;
const APP_KEYPAD = 0b0000_0000_0000_0000_0000_0100;
const MOUSE_REPORT_CLICK = 0b0000_0000_0000_0000_0000_1000;
const BRACKETED_PASTE = 0b0000_0000_0000_0000_0001_0000;
const SGR_MOUSE = 0b0000_0000_0000_0000_0010_0000;
const MOUSE_MOTION = 0b0000_0000_0000_0000_0100_0000;
const LINE_WRAP = 0b0000_0000_0000_0000_1000_0000;
const LINE_FEED_NEW_LINE = 0b0000_0000_0000_0001_0000_0000;
const ORIGIN = 0b0000_0000_0000_0010_0000_0000;
const INSERT = 0b0000_0000_0000_0100_0000_0000;
const FOCUS_IN_OUT = 0b0000_0000_0000_1000_0000_0000;
const ALT_SCREEN = 0b0000_0000_0001_0000_0000_0000;
const MOUSE_DRAG = 0b0000_0000_0010_0000_0000_0000;
const MOUSE_MODE = 0b0000_0000_0010_0000_0100_1000;
const UTF8_MOUSE = 0b0000_0000_0100_0000_0000_0000;
const ALTERNATE_SCROLL = 0b0000_0000_1000_0000_0000_0000;
const VI = 0b0000_0001_0000_0000_0000_0000;
const URGENCY_HINTS = 0b0000_0010_0000_0000_0000_0000;
const DISAMBIGUATE_ESC_CODES = 0b0000_0100_0000_0000_0000_0000;
const REPORT_EVENT_TYPES = 0b0000_1000_0000_0000_0000_0000;
const REPORT_ALTERNATE_KEYS = 0b0001_0000_0000_0000_0000_0000;
const REPORT_ALL_KEYS_AS_ESC = 0b0010_0000_0000_0000_0000_0000;
const REPORT_ASSOCIATED_TEXT = 0b0100_0000_0000_0000_0000_0000;
const SHOW_CURSOR = 1;
const APP_CURSOR = 1 << 1;
const APP_KEYPAD = 1 << 2;
const MOUSE_REPORT_CLICK = 1 << 3;
const BRACKETED_PASTE = 1 << 4;
const SGR_MOUSE = 1 << 5;
const MOUSE_MOTION = 1 << 6;
const LINE_WRAP = 1 << 7;
const LINE_FEED_NEW_LINE = 1 << 8;
const ORIGIN = 1 << 9;
const INSERT = 1 << 10;
const FOCUS_IN_OUT = 1 << 11;
const ALT_SCREEN = 1 << 12;
const MOUSE_DRAG = 1 << 13;
const UTF8_MOUSE = 1 << 14;
const ALTERNATE_SCROLL = 1 << 15;
const VI = 1 << 16;
const URGENCY_HINTS = 1 << 17;
const DISAMBIGUATE_ESC_CODES = 1 << 18;
const REPORT_EVENT_TYPES = 1 << 19;
const REPORT_ALTERNATE_KEYS = 1 << 20;
const REPORT_ALL_KEYS_AS_ESC = 1 << 21;
const REPORT_ASSOCIATED_TEXT = 1 << 22;
const MOUSE_MODE = Self::MOUSE_REPORT_CLICK.bits() | Self::MOUSE_MOTION.bits() | Self::MOUSE_DRAG.bits();
const KITTY_KEYBOARD_PROTOCOL = Self::DISAMBIGUATE_ESC_CODES.bits()
| Self::REPORT_EVENT_TYPES.bits()
| Self::REPORT_ALTERNATE_KEYS.bits()