LF OS
Hobby operating system for amd64 with high ambitions
|
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <sys/syscalls.h>
#include "main.h"
#include "keyboard.h"
#include "font.h"
Go to the source code of this file.
Macros | |
#define | FONT_WIDTH (terminal_font.bbox.width) |
#define | FONT_HEIGHT (terminal_font.bbox.height) |
Functions | |
static void | lfos_framebuffer_init (lfos_framebuffer *this) |
static uint32_t | get_color (lfos_term_state *state, VTermColor *color) |
static struct glyph * | find_glyph (uint32_t codepoint) |
static void | render_cell (lfos_term_state *state, int row, int col, VTermScreenCell *cell) |
static void | vterm_render_cell (lfos_term_state *state, int row, int col) |
static int | vterm_damage (VTermRect rect, void *user) |
static int | vterm_movecursor (VTermPos pos, VTermPos oldpos, int visible, void *user) |
static void | vterm_output_callback (const char *s, size_t len, void *user) |
int | read_lfos (int file, char *ptr, int len) |
int | write_lfos (int file, char *ptr, int len) |
int | klsh_main () |
int | main (int argc, char *argv[]) |
Variables | |
struct font | terminal_font |
lfos_term_state | state |
#define FONT_HEIGHT (terminal_font.bbox.height) |
#define FONT_WIDTH (terminal_font.bbox.width) |
Definition at line 34 of file main.c.
References glyph::encoding, find_glyph(), font::glyphs, font::num_glyphs, and terminal_font.
|
static |
Definition at line 24 of file main.c.
References VTermColor::rgb, state, VTERM_COLOR_IS_RGB, vterm_screen_convert_color_to_rgb(), and lfos_term_state::vtermScreen.
int klsh_main | ( | ) |
Definition at line 237 of file shell.c.
References add_hist_entry(), assign_variable(), built_in_exec(), free(), get_raw_buffer(), hist_push(), memset(), shell_variable::name, parse_argv(), prog_in_path(), shell_variable_add(), shell_variable_get(), strlen(), and shell_variable::value.
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 162 of file main.c.
References cols, VTermScreenCallbacks::damage, lfos_term_state::fb, FONT_HEIGHT, FONT_WIDTH, lfos_framebuffer::height, kbd_init(), klsh_main(), lfos_framebuffer_init(), VTermScreenCallbacks::movecursor, rows, state, lfos_term_state::vterm, vterm_damage(), vterm_movecursor(), vterm_new(), vterm_obtain_screen(), vterm_output_callback(), vterm_output_set_callback(), vterm_screen_reset(), vterm_screen_set_callbacks(), vterm_set_utf8(), lfos_term_state::vtermScreen, and lfos_framebuffer::width.
int read_lfos | ( | int | file, |
char * | ptr, | ||
int | len | ||
) |
Definition at line 135 of file main.c.
References lfos_term_state::input_buffer_current, lfos_term_state::input_buffer_len, kbd_read(), memcpy(), and state.
|
static |
Definition at line 50 of file main.c.
References VTermScreenCell::attrs, VTermScreenCell::bg, glyph::bitmap, VTermScreenCell::chars, VTermPos::col, lfos_term_state::cursor_pos, lfos_framebuffer::fb, lfos_term_state::fb, VTermScreenCell::fg, find_glyph(), FONT_HEIGHT, FONT_WIDTH, get_color(), lfos_framebuffer::height, VTermScreenCellAttrs::reverse, VTermPos::row, state, lfos_framebuffer::stride, VTermScreenCellAttrs::underline, and lfos_framebuffer::width.
|
static |
Definition at line 98 of file main.c.
References VTermRect::end_col, VTermRect::end_row, VTermRect::start_col, VTermRect::start_row, state, and vterm_render_cell().
Definition at line 110 of file main.c.
References VTermPos::col, lfos_term_state::cursor_pos, VTermPos::row, state, and vterm_render_cell().
|
static |
Definition at line 119 of file main.c.
References free(), lfos_term_state::input_buffer, lfos_term_state::input_buffer_current, lfos_term_state::input_buffer_len, malloc(), memcpy(), and state.
|
static |
Definition at line 92 of file main.c.
References render_cell(), state, vterm_screen_get_cell(), and lfos_term_state::vtermScreen.
int write_lfos | ( | int | file, |
char * | ptr, | ||
int | len | ||
) |
Definition at line 154 of file main.c.
References state, lfos_term_state::vterm, and vterm_input_write().
lfos_term_state state |
|
extern |