aboutsummaryrefslogtreecommitdiffstats
path: root/src/display.h
blob: cbd65e5fdbfc341850c696ed7a36e80723a9563a (plain) (blame)
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
35
36
#ifndef _RUNES_DISPLAY_H
#define _RUNES_DISPLAY_H

#include <cairo.h>
#include <pango/pangocairo.h>
#include <vt100.h>

struct runes_display {
    cairo_t *cr;
    PangoLayout *layout;

    int row_visible_offset;

    int xpixel;
    int ypixel;
    int fontx;
    int fonty;

    struct vt100_loc selection_start;
    struct vt100_loc selection_end;

    char unfocused: 1;
    char has_selection: 1;
};

void runes_display_init(RunesTerm *t);
void runes_display_set_window_size(RunesTerm *t);
void runes_display_draw_screen(RunesTerm *t);
void runes_display_draw_cursor(RunesTerm *t, cairo_t *cr);
int runes_display_loc_is_selected(RunesTerm *t, struct vt100_loc loc);
int runes_display_loc_is_between(
    RunesTerm *t, struct vt100_loc loc,
    struct vt100_loc start, struct vt100_loc end);
void runes_display_cleanup(RunesTerm *t);

#endif