aboutsummaryrefslogtreecommitdiffstats
path: root/src/display.h
blob: 5f79948884464c5fa77293ebcc8e267ac496ed14 (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
37
38
39
#ifndef _RUNES_DISPLAY_H
#define _RUNES_DISPLAY_H

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

struct runes_display {
    cairo_t *cr;
    cairo_pattern_t *buffer;
    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 *selection_contents;
    size_t selection_len;

    unsigned int unfocused: 1;
    unsigned int has_selection: 1;
    unsigned int dirty: 1;
};

RunesDisplay *runes_display_new(char *font_name);
void runes_display_set_context(RunesTerm *t, cairo_t *cr);
void runes_display_draw_screen(RunesTerm *t);
void runes_display_draw_cursor(RunesTerm *t);
void runes_display_set_selection(
    RunesTerm *t, struct vt100_loc *start, struct vt100_loc *end);
void runes_display_maybe_clear_selection(RunesTerm *t);
void runes_display_delete(RunesDisplay *display);

#endif