io.termd.core.term.Capability Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of termd-core Show documentation
Show all versions of termd-core Show documentation
An open source terminal daemon library providing terminal handling in Java,
back ported to Alibaba by core engine team to support running on JDK 6+.
/*
* Copyright 2015 Julien Viet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.termd.core.term;
import java.util.HashMap;
import java.util.Map;
/**
* @author Julien Viet
*/
public class Capability {
private static final Map> values = new HashMap>();
private static class Enumerated extends Capability {
public Enumerated(Class type, String variable, String name, String cap, String description) {
super(type, variable, name, cap, description);
values.put(name, this);
}
}
public static Capability> getCapability(String name) {
return values.get(name);
}
public static Capability getCapability(String name, Class type) {
Capability> capability = values.get(name);
if (capability != null && capability.type.equals(type)) {
return (Capability) capability;
}
return null;
}
public static Capability auto_left_margin = new Enumerated(Boolean.class, "auto_left_margin", "bw", "bw", "cub1 wraps from column 0 to last column");
public static Capability auto_right_margin = new Enumerated(Boolean.class, "auto_right_margin", "am", "am", "Terminal has automatic margins");
public static Capability back_color_erase = new Enumerated(Boolean.class, "back_color_erase", "bce", "ut", "Screen erased with background colour");
public static Capability can_change = new Enumerated(Boolean.class, "can_change", "ccc", "cc", "Terminal can re-define existing colour");
public static Capability ceol_standout_glitch = new Enumerated(Boolean.class, "ceol_standout_glitch", "xhp", "xs", "Standout not erased by overwriting (hp)");
public static Capability col_addr_glitch = new Enumerated(Boolean.class, "col_addr_glitch", "xhpa", "YA", "Only positive motion for hpa/mhpa caps");
public static Capability cpi_changes_res = new Enumerated(Boolean.class, "cpi_changes_res", "cpix", "YF", "Changing character pitch changes resolution");
public static Capability cr_cancels_micro_mode = new Enumerated(Boolean.class, "cr_cancels_micro_mode", "crxm", "YB", "Using cr turns off micro mode");
public static Capability dest_tabs_magic_smso = new Enumerated(Boolean.class, "dest_tabs_magic_smso", "xt", "xt", "\"Destructive tabs");
public static Capability eat_newline_glitch = new Enumerated(Boolean.class, "eat_newline_glitch", "xenl", "xn", "Newline ignored after 80 columns (Concept)");
public static Capability erase_overstrike = new Enumerated(Boolean.class, "erase_overstrike", "eo", "eo", "Can erase overstrikes with a blank");
public static Capability generic_type = new Enumerated(Boolean.class, "generic_type", "gn", "gn", "\"Generic line type (e.g.");
public static Capability hard_copy = new Enumerated(Boolean.class, "hard_copy", "hc", "hc", "Hardcopy terminal");
public static Capability hard_cursor = new Enumerated(Boolean.class, "hard_cursor", "chts", "HC", "Cursor is hard to see");
public static Capability has_meta_key = new Enumerated(Boolean.class, "has_meta_key", "km", "km", "\"Has a meta key (shift");
public static Capability has_print_wheel = new Enumerated(Boolean.class, "has_print_wheel", "daisy", "YC", "Printer needs operator to change character set");
public static Capability has_status_line = new Enumerated(Boolean.class, "has_status_line", "hs", "hs", "\"Has extra \"\"status line\"\"\"");
public static Capability hue_lightness_saturation = new Enumerated(Boolean.class, "hue_lightness_saturation", "hls", "hl", "Terminal uses only HLS colour notation (Tektronix)");
public static Capability insert_null_glitch = new Enumerated(Boolean.class, "insert_null_glitch", "in", "in", "Insert mode distinguishes nulls");
public static Capability lpi_changes_res = new Enumerated(Boolean.class, "lpi_changes_res", "lpix", "YG", "Changing line pitch changes resolution");
public static Capability memory_above = new Enumerated(Boolean.class, "memory_above", "da", "da", "Display may be retained above the screen");
public static Capability memory_below = new Enumerated(Boolean.class, "memory_below", "db", "db", "Display may be retained below the screen");
public static Capability move_insert_mode = new Enumerated(Boolean.class, "move_insert_mode", "mir", "mi", "Safe to move while in insert mode");
public static Capability move_standout_mode = new Enumerated(Boolean.class, "move_standout_mode", "msgr", "ms", "Safe to move in standout modes");
public static Capability needs_xon_xoff = new Enumerated(Boolean.class, "needs_xon_xoff", "nxon", "nx", "\"Padding won't work");
public static Capability no_esc_ctlc = new Enumerated(Boolean.class, "no_esc_ctlc", "xsb", "xb", "\"Beehive (f1=escape");
public static Capability no_pad_char = new Enumerated(Boolean.class, "no_pad_char", "npc", "NP", "Pad character doesn't exist");
public static Capability non_dest_scroll_region = new Enumerated(Boolean.class, "non_dest_scroll_region", "ndscr", "ND", "Scrolling region is nondestructive");
public static Capability non_rev_rmcup = new Enumerated(Boolean.class, "non_rev_rmcup", "nrrmc", "NR", "smcup does not reverse rmcup");
public static Capability over_strike = new Enumerated(Boolean.class, "over_strike", "os", "os", "Terminal overstrikes on hard-copy terminal");
public static Capability prtr_silent = new Enumerated(Boolean.class, "prtr_silent", "mc5i", "5i", "Printer won't echo on screen");
public static Capability row_addr_glitch = new Enumerated(Boolean.class, "row_addr_glitch", "xvpa", "YD", "Only positive motion for vpa/mvpa caps");
public static Capability semi_auto_right_margin = new Enumerated(Boolean.class, "semi_auto_right_margin", "sam", "YE", "Printing in last column causes cr");
public static Capability status_line_esc_ok = new Enumerated(Boolean.class, "status_line_esc_ok", "eslok", "es", "Escape can be used on the status line");
public static Capability tilde_glitch = new Enumerated(Boolean.class, "tilde_glitch", "hz", "hz", "Hazeltine; can't print tilde (~)");
public static Capability transparent_underline = new Enumerated(Boolean.class, "transparent_underline", "ul", "ul", "Underline character overstrikes");
public static Capability xon_xoff = new Enumerated(Boolean.class, "xon_xoff", "xon", "xo", "Terminal uses xon/xoff handshaking");
public static Capability bit_image_entwining = new Enumerated(Integer.class, "bit_image_entwining", "bitwin", "Yo", "Number of passes for each bit-map row");
public static Capability bit_image_type = new Enumerated(Integer.class, "bit_image_type", "bitype", "Yp", "Type of bit image device");
public static Capability buffer_capacity = new Enumerated(Integer.class, "buffer_capacity", "bufsz", "Ya", "Number of bytes buffered before printing");
public static Capability buttons = new Enumerated(Integer.class, "buttons", "btns", "BT", "Number of buttons on the mouse");
public static Capability columns = new Enumerated(Integer.class, "columns", "cols", "co", "Number of columns in a line");
public static Capability dot_horz_spacing = new Enumerated(Integer.class, "dot_horz_spacing", "spinh", "Yc", "Spacing of dots horizontally in dots per inch");
public static Capability dot_vert_spacing = new Enumerated(Integer.class, "dot_vert_spacing", "spinv", "Yb", "Spacing of pins vertically in pins per inch");
public static Capability init_tabs = new Enumerated(Integer.class, "init_tabs", "it", "it", "Tabs initially every # spaces");
public static Capability label_height = new Enumerated(Integer.class, "label_height", "lh", "lh", "Number of rows in each label");
public static Capability label_width = new Enumerated(Integer.class, "label_width", "lw", "lw", "Number of columns in each label");
public static Capability lines = new Enumerated(Integer.class, "lines", "lines", "li", "Number of lines on a screen or a page");
public static Capability lines_of_memory = new Enumerated(Integer.class, "lines_of_memory", "lm", "lm", "Lines of memory if > lines; 0 means varies");
public static Capability max_attributes = new Enumerated(Integer.class, "max_attributes", "ma", "ma", "Maximum combined video attributes terminal can display");
public static Capability magic_cookie_glitch = new Enumerated(Integer.class, "magic_cookie_glitch", "xmc", "sg", "Number of blank characters left by smso or rmso");
public static Capability max_colors = new Enumerated(Integer.class, "max_colors", "colors", "Co", "Maximum number of colours on the screen");
public static Capability max_micro_address = new Enumerated(Integer.class, "max_micro_address", "maddr", "Yd", "Maximum value in micro_..._address");
public static Capability max_micro_jump = new Enumerated(Integer.class, "max_micro_jump", "mjump", "Ye", "Maximum value in parm_..._micro");
public static Capability max_pairs = new Enumerated(Integer.class, "max_pairs", "pairs", "pa", "Maximum number of colour-pairs on the screen");
public static Capability maximum_windows = new Enumerated(Integer.class, "maximum_windows", "wnum", "MW", "Maximum number of definable windows");
public static Capability micro_col_size = new Enumerated(Integer.class, "micro_col_size", "mcs", "Yf", "Character step size when in micro mode");
public static Capability micro_line_size = new Enumerated(Integer.class, "micro_line_size", "mls", "Yg", "Line step size when in micro mode");
public static Capability no_color_video = new Enumerated(Integer.class, "no_color_video", "ncv", "NC", "Video attributes that can't be used with colours");
public static Capability num_labels = new Enumerated(Integer.class, "num_labels", "nlab", "Nl", "Number of labels on screen (start at 1)");
public static Capability number_of_pins = new Enumerated(Integer.class, "number_of_pins", "npins", "Yh", "Number of pins in print-head");
public static Capability output_res_char = new Enumerated(Integer.class, "output_res_char", "orc", "Yi", "Horizontal resolution in units per character");
public static Capability output_res_line = new Enumerated(Integer.class, "output_res_line", "orl", "Yj", "Vertical resolution in units per line");
public static Capability output_res_horz_inch = new Enumerated(Integer.class, "output_res_horz_inch", "orhi", "Yk", "Horizontal resolution in units per inch");
public static Capability output_res_vert_inch = new Enumerated(Integer.class, "output_res_vert_inch", "orvi", "Yl", "Vertical resolution in units per inch");
public static Capability padding_baud_rate = new Enumerated(Integer.class, "padding_baud_rate", "pb", "pb", "Lowest baud rate where padding needed");
public static Capability print_rate = new Enumerated(Integer.class, "print_rate", "cps", "Ym", "Print rate in characters per second");
public static Capability virtual_terminal = new Enumerated(Integer.class, "virtual_terminal", "vt", "vt", "Virtual terminal number");
public static Capability wide_char_size = new Enumerated(Integer.class, "wide_char_size", "widcs", "Yn", "Character step size when in double-wide mode");
public static Capability width_status_line = new Enumerated(Integer.class, "width_status_line", "wsl", "ws", "Number of columns in status line");
public static Capability acs_chars = new Enumerated(Sequence.class, "acs_chars", "acsc", "ac", "Graphic charset pairs aAbBcC");
public static Capability alt_scancode_esc = new Enumerated(Sequence.class, "alt_scancode_esc", "scesa", "S8", "Alternate escape for scancode emulation (default is for VT100)");
public static Capability back_tab = new Enumerated(Sequence.class, "back_tab", "cbt", "bt", "Back tab");
public static Capability bell = new Enumerated(Sequence.class, "bell", "bel", "bl", "Audible signal (bell)");
public static Capability bit_image_carriage_return = new Enumerated(Sequence.class, "bit_image_carriage_return", "bicr", "Yv", "Move to beginning of same row");
public static Capability bit_image_newline = new Enumerated(Sequence.class, "bit_image_newline", "binel", "Zz", "Move to next row of the bit image");
public static Capability bit_image_repeat = new Enumerated(Sequence.class, "bit_image_repeat", "birep", "Xy", "Repeat bit-image cell #1 #2 times");
public static Capability carriage_return = new Enumerated(Sequence.class, "carriage_return", "cr", "cr", "Carriage return");
public static Capability change_char_pitch = new Enumerated(Sequence.class, "change_char_pitch", "cpi", "ZA", "Change number of characters per inch");
public static Capability change_line_pitch = new Enumerated(Sequence.class, "change_line_pitch", "lpi", "ZB", "Change number of lines per inch");
public static Capability change_res_horz = new Enumerated(Sequence.class, "change_res_horz", "chr", "ZC", "Change horizontal resolution");
public static Capability change_res_vert = new Enumerated(Sequence.class, "change_res_vert", "cvr", "ZD", "Change vertical resolution");
public static Capability change_scroll_region = new Enumerated(Sequence.class, "change_scroll_region", "csr", "cs", "Change to lines #1 through #2 (VT100)");
public static Capability char_padding = new Enumerated(Sequence.class, "char_padding", "rmp", "rP", "Like ip but when in replace mode");
public static Capability char_set_names = new Enumerated(Sequence.class, "char_set_names", "csnm", "Zy", "Returns a list of character set names");
public static Capability clear_all_tabs = new Enumerated(Sequence.class, "clear_all_tabs", "tbc", "ct", "Clear all tab stops");
public static Capability clear_margins = new Enumerated(Sequence.class, "clear_margins", "mgc", "MC", "\"Clear all margins (top");
public static Capability clear_screen = new Enumerated(Sequence.class, "clear_screen", "clear", "cl", "Clear screen and home cursor");
public static Capability clr_bol = new Enumerated(Sequence.class, "clr_bol", "el1", "cb", "\"Clear to beginning of line");
public static Capability clr_eol = new Enumerated(Sequence.class, "clr_eol", "el", "ce", "Clear to end of line");
public static Capability clr_eos = new Enumerated(Sequence.class, "clr_eos", "ed", "cd", "Clear to end of display");
public static Capability code_set_init = new Enumerated(Sequence.class, "code_set_init", "csin", "ci", "Init sequence for multiple codesets");
public static Capability color_names = new Enumerated(Sequence.class, "color_names", "colornm", "Yw", "Give name for colour #1");
public static Capability column_address = new Enumerated(Sequence.class, "column_address", "hpa", "ch", "Set horizontal position to absolute #1");
public static Capability command_character = new Enumerated(Sequence.class, "command_character", "cmdch", "CC", "Terminal settable cmd character in prototype");
public static Capability create_window = new Enumerated(Sequence.class, "create_window", "cwin", "", "\"Define win #1 to go from #2");
public static Capability cursor_address = new Enumerated(Sequence.class, "cursor_address", "cup", "cm", "Move to row #1 col #2");
public static Capability cursor_down = new Enumerated(Sequence.class, "cursor_down", "cud1", "do", "Down one line");
public static Capability cursor_home = new Enumerated(Sequence.class, "cursor_home", "home", "ho", "Home cursor (if no cup)");
public static Capability cursor_invisible = new Enumerated(Sequence.class, "cursor_invisible", "civis", "vi", "Make cursor invisible");
public static Capability cursor_left = new Enumerated(Sequence.class, "cursor_left", "cub1", "le", "Move left one space.");
public static Capability cursor_mem_address = new Enumerated(Sequence.class, "cursor_mem_address", "mrcup", "CM", "Memory relative cursor addressing");
public static Capability cursor_normal = new Enumerated(Sequence.class, "cursor_normal", "cnorm", "ve", "Make cursor appear normal (undo vs/vi)");
public static Capability cursor_right = new Enumerated(Sequence.class, "cursor_right", "cuf1", "nd", "Non-destructive space (cursor or carriage right)");
public static Capability cursor_to_ll = new Enumerated(Sequence.class, "cursor_to_ll", "ll", "ll", "\"Last line");
public static Capability cursor_up = new Enumerated(Sequence.class, "cursor_up", "cuu1", "up", "Upline (cursor up)");
public static Capability cursor_visible = new Enumerated(Sequence.class, "cursor_visible", "cvvis", "vs", "Make cursor very visible");
public static Capability define_bit_image_region = new Enumerated(Sequence.class, "define_bit_image_region", "defbi", "Yx", "Define rectangular bit-image region");
public static Capability define_char = new Enumerated(Sequence.class, "define_char", "defc", "ZE", "Define a character in a character set");
public static Capability delete_character = new Enumerated(Sequence.class, "delete_character", "dch1", "dc", "Delete character");
public static Capability delete_line = new Enumerated(Sequence.class, "delete_line", "dl1", "dl", "Delete line");
public static Capability device_type = new Enumerated(Sequence.class, "device_type", "devt", "dv", "Indicate language/codeset support");
public static Capability dial_phone = new Enumerated(Sequence.class, "dial_phone", "dial", "DI", "Dial phone number #1");
public static Capability dis_status_line = new Enumerated(Sequence.class, "dis_status_line", "dsl", "ds", "Disable status line");
public static Capability display_clock = new Enumerated(Sequence.class, "display_clock", "dclk", "DK", "Display time-of-day clock");
public static Capability display_pc_char = new Enumerated(Sequence.class, "display_pc_char", "dispc", "S1", "Display PC character");
public static Capability down_half_line = new Enumerated(Sequence.class, "down_half_line", "hd", "hd", "Half-line down (forward 1/2 linefeed)");
public static Capability ena_acs = new Enumerated(Sequence.class, "ena_acs", "enacs", "eA", "Enable alternate character set");
public static Capability end_bit_image_region = new Enumerated(Sequence.class, "end_bit_image_region", "endbi", "Yy", "End a bit-image region");
public static Capability enter_alt_charset_mode = new Enumerated(Sequence.class, "enter_alt_charset_mode", "smacs", "as", "Start alternate character set");
public static Capability enter_am_mode = new Enumerated