diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-07-05 08:16:56 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-07-05 08:16:56 +0000 |
| commit | 1947d33868ce57f3d3851ef03ee28482c393f22d (patch) | |
| tree | 3e374a948c6c84aade855fd663850978f427500e /terminal.h | |
| parent | osc: implement change window title and icon (diff) | |
render: break out rendering functions to render.{c,h}
Diffstat (limited to 'terminal.h')
| -rw-r--r-- | terminal.h | 36 |
1 files changed, 27 insertions, 9 deletions
@@ -6,11 +6,25 @@ #include <threads.h> +#include <cairo.h> #include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon-keysyms.h> #include "tllist.h" +struct wayland { + struct wl_display *display; + struct wl_registry *registry; + struct wl_compositor *compositor; + struct wl_surface *surface; + struct wl_shm *shm; + struct wl_seat *seat; + struct wl_keyboard *keyboard; + struct xdg_wm_base *shell; + struct xdg_surface *xdg_surface; + struct xdg_toplevel *xdg_toplevel; +}; + struct rgba { double r, g, b, a; }; struct attributes { @@ -125,10 +139,6 @@ struct kbd { } repeat; }; -struct renderer { - struct xdg_toplevel *xdg_toplevel; /* TODO: this doesn't belong here */ -}; - enum decckm { DECCKM_CSI, DECCKM_SS3 }; enum keypad_mode { KEYPAD_NUMERICAL, KEYPAD_APPLICATION }; enum charset { CHARSET_ASCII, CHARSET_GRAPHIC }; @@ -136,6 +146,7 @@ enum charset { CHARSET_ASCII, CHARSET_GRAPHIC }; struct terminal { pid_t slave; int ptmx; + bool quit; enum decckm decckm; enum keypad_mode keypad_mode; @@ -149,12 +160,13 @@ struct terminal { struct vt vt; struct kbd kbd; - struct renderer renderer; - int cols; - int rows; - int cell_width; - int cell_height; + int width; /* pixels */ + int height; /* pixels */ + int cols; /* number of columns */ + int rows; /* number of rows */ + int cell_width; /* pixels per cell, x-wise */ + int cell_height; /* pixels per cell, y-wise */ bool print_needs_wrap; struct scroll_region scroll_region; @@ -169,6 +181,12 @@ struct terminal { struct grid normal; struct grid alt; struct grid *grid; + + cairo_scaled_font_t *fonts[4]; + cairo_font_extents_t fextents; + + struct wayland wl; + bool frame_is_scheduled; }; void term_damage_all(struct terminal *term); |
