mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-11 22:35:30 +02:00
Add/update more files
This commit is contained in:
parent
3307231b65
commit
0769592a1b
44 changed files with 4188 additions and 362 deletions
39
addons/godot_xterm/services/buffer_service.gd
Normal file
39
addons/godot_xterm/services/buffer_service.gd
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
# Ported to GDScript by the GodotXterm authors.
|
||||
# License MIT
|
||||
extends Reference
|
||||
|
||||
signal buffer_activated(active_buffer, inactive_buffer)
|
||||
signal resized
|
||||
|
||||
const BufferSet = preload("res://addons/godot_xterm/buffer/buffer_set.gd")
|
||||
|
||||
const MINIMUM_COLS = 2 # Less than 2 can mess with wide chars
|
||||
const MINIMUM_ROWS = 1
|
||||
|
||||
var service_brand
|
||||
|
||||
var cols: int
|
||||
var rows: int
|
||||
var buffers
|
||||
# Whether the user is scrolling (locks the scroll position)
|
||||
var is_user_scrolling: bool = false
|
||||
var _options_service
|
||||
|
||||
var buffer setget ,_get_buffer
|
||||
|
||||
|
||||
func _get_buffer():
|
||||
return buffers.active if buffers else null
|
||||
|
||||
|
||||
func _init(options_service):
|
||||
_options_service = options_service
|
||||
cols = max(_options_service.options.cols, MINIMUM_COLS)
|
||||
rows = max(_options_service.options.rows, MINIMUM_ROWS)
|
||||
buffers = BufferSet.new(_options_service, self)
|
||||
buffers.connect("buffer_activated", self, "_buffer_activated")
|
||||
|
||||
|
||||
func _buffer_activated(active_buffer, inactive_buffer):
|
||||
emit_signal("buffer_activated", active_buffer, inactive_buffer)
|
30
addons/godot_xterm/services/charset_service.gd
Normal file
30
addons/godot_xterm/services/charset_service.gd
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
# Ported to GDScript by the GodotXterm authors.
|
||||
# License MIT
|
||||
extends Reference
|
||||
|
||||
|
||||
var service_brand
|
||||
var charset = null
|
||||
var glevel: int = 0
|
||||
|
||||
var _charsets = []
|
||||
|
||||
|
||||
func reset() -> void:
|
||||
charset = null
|
||||
_charsets = []
|
||||
glevel = 0
|
||||
|
||||
|
||||
func set_glevel(g: int) -> void:
|
||||
glevel = g
|
||||
charset = _charsets[g]
|
||||
|
||||
|
||||
func set_gcharset(g: int, charset = null) -> void:
|
||||
if _charsets.size() < g + 1:
|
||||
_charsets.resize(g + 1)
|
||||
_charsets[g] = charset
|
||||
if glevel == g:
|
||||
charset = charset
|
27
addons/godot_xterm/services/core_service.gd
Normal file
27
addons/godot_xterm/services/core_service.gd
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
# Ported to GDScript by the GodotXterm authors.
|
||||
# License MIT
|
||||
extends Reference
|
||||
|
||||
|
||||
var DEFAULT_MODES = {
|
||||
"insert_mode": false,
|
||||
}
|
||||
|
||||
var DEFAULT_DEC_PRIVATE_MODES = {
|
||||
"application_cursor_keys": false,
|
||||
"application_keypad": false,
|
||||
"bracketed_paste_mode": false,
|
||||
"origin": false,
|
||||
"reverse_wraparound": false, # defaults: xterm -true, vt100 - false
|
||||
}
|
||||
|
||||
var modes = DEFAULT_MODES.duplicate()
|
||||
var dec_private_modes = DEFAULT_DEC_PRIVATE_MODES.duplicate()
|
||||
var is_cursor_hidden = false
|
||||
var is_cursor_initialized = true
|
||||
|
||||
|
||||
func reset():
|
||||
modes = DEFAULT_MODES.duplicate()
|
||||
dec_private_modes.duplicate()
|
53
addons/godot_xterm/services/options_service.gd
Normal file
53
addons/godot_xterm/services/options_service.gd
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
# Ported to GDScript by the GodotXterm authors.
|
||||
# License MIT
|
||||
extends Reference
|
||||
|
||||
|
||||
class TerminalOptions:
|
||||
var cols: int
|
||||
var rows: int
|
||||
var cursor_blink: bool
|
||||
var cursor_style
|
||||
var cursor_width: int
|
||||
var bell_sound
|
||||
var bell_style
|
||||
var draw_bold_text_in_bright_colors: bool
|
||||
var fast_scroll_modifier
|
||||
var fast_scroll_sensitivity: int
|
||||
var font_family: Dictionary
|
||||
var font_size: int
|
||||
var font_weight: String
|
||||
var font_weight_bold: String
|
||||
var line_height: float
|
||||
var link_tooltip_hover_duration: int
|
||||
var letter_spacing: float
|
||||
var log_level
|
||||
var scrollback: int
|
||||
var scroll_sensitivity: int
|
||||
var screen_reader_mode: bool
|
||||
var mac_option_is_meta: bool
|
||||
var mac_option_click_forces_selection: bool
|
||||
var minimum_contrast_ratio: float
|
||||
var disable_stdin: bool
|
||||
var allow_proposed_api: bool
|
||||
var allow_transparency: bool
|
||||
var tab_stop_width: int
|
||||
var colors: Dictionary
|
||||
var right_click_selects_word
|
||||
var renderer_type
|
||||
var window_options: Dictionary
|
||||
var windows_mode: bool
|
||||
var word_separator: String
|
||||
var convert_eol: bool
|
||||
var term_name: String
|
||||
var cancel_events: bool
|
||||
|
||||
|
||||
signal option_changed
|
||||
|
||||
var options
|
||||
|
||||
|
||||
func _init(options):
|
||||
self.options = options
|
Loading…
Add table
Add a link
Reference in a new issue