hyx

Minimalist but powerful terminal hex editor
git clone https://git.sinitax.com/yx7/hyx
Log | Files | Refs | sfeed.txt

view.h (1129B)


      1#ifndef VIEW_H
      2#define VIEW_H
      3
      4#include "blob.h"
      5
      6#include <termios.h>
      7#include <sys/ioctl.h>
      8
      9struct input;
     10struct view {
     11    bool initialized;
     12
     13    struct blob *blob;
     14    struct input *input; /* FIXME hack */
     15
     16    size_t start;
     17
     18    uint8_t *dirty;
     19    signed scroll;
     20
     21    bool cols_fixed;
     22    unsigned rows, cols;
     23    unsigned pos_digits;
     24    bool color;
     25    bool winch;
     26    bool tstp, cont;
     27
     28    struct termios term;
     29};
     30
     31void view_init(struct view *view, struct blob *blob, struct input *input);
     32void view_text(struct view *view, bool leave_alternate);
     33void view_visual(struct view *view);
     34void view_recompute(struct view *view, bool winch);
     35void view_set_cols(struct view *view, bool relative, int cols);
     36void view_free(struct view *view);
     37
     38void view_message(struct view *view, char const *msg, char const *color);
     39void view_error(struct view *view, char const *msg);
     40
     41void view_update(struct view *view);
     42
     43void view_dirty_at(struct view *view, size_t pos);
     44void view_dirty_from(struct view *view, size_t from);
     45void view_dirty_fromto(struct view *view, size_t from, size_t to);
     46void view_adjust(struct view *view);
     47
     48#endif