Rewrite terminal.cpp

Rewrites the Terminal class as a GDExtension to be used directly in
Godot without a terminal.gd proxy.

Breaks a lot of things in its current state (e.g. signals and other
functions have not be implemented yet), but does add support for
transparent colors and true color inversion. It also seems to
be about 4x faster (FPS-wise) than the old version with some basic
stress testing.

Old source code has been moved to a different directory to be copied
over and/or rewritten piece by piece.
This commit is contained in:
Leroy Hopson 2024-02-07 00:01:14 +13:00
parent 7d2e22530e
commit a849423096
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
29 changed files with 1431 additions and 857 deletions

View file

@ -0,0 +1,47 @@
// SPDX-FileCopyrightText: 2021-2022 Leroy Hopson <godot-xterm@leroy.geek.nz>
// SPDX-License-Identifier: MIT
#ifndef GODOT_XTERM_PIPE_H
#define GODOT_XTERM_PIPE_H
#include <godot_cpp/classes/ref_counted.hpp>
#include <godot_cpp/variant/packed_byte_array.hpp>
#include <uv.h>
namespace godot {
class Pipe : public RefCounted {
GDCLASS(Pipe, RefCounted)
public:
uv_pipe_t handle;
Pipe();
~Pipe();
void _init();
Error open(int fd, bool ipc);
void close();
int get_status();
Error write(PackedByteArray data);
void pause();
void resume();
public:
int status;
protected:
static void _bind_methods();
private:
void _poll_connection();
static Error _translate_error(int err);
};
} // namespace godot
#endif // GODOT_XTERM_PIPE_H