summaryrefslogtreecommitdiff
path: root/src/user/app/vterm/vterm.h
blob: b006ede27e50ccc0cb333c8e2b1a969dbd37dc82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <camellia/types.h>
#include <stdint.h>
#include <stdio.h>
#include <user/lib/draw/draw.h>

#define eprintf(fmt, ...) fprintf(stderr, "vterm: "fmt"\n" __VA_OPT__(,) __VA_ARGS__)


struct psf {
    uint32_t magic;
    uint32_t version;
    uint32_t glyph_offset;
    uint32_t flags;
    uint32_t glyph_amt;
    uint32_t glyph_size;
    uint32_t h;
    uint32_t w;
} __attribute__((packed));
extern struct psf font;
extern void *font_data;
void font_load(const char *path);
void font_blit(uint32_t glyph, int x, int y);

extern struct framebuf fb;

extern struct rect dirty;
void vdirty_mark(uint32_t x, uint32_t y);
void flush(void);
void scroll(void);

struct point {uint32_t x, y;};
extern struct point cursor;
void in_char(char c);