42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
#ifndef LINE_ED_HL_RANGE_H_
|
|
#define LINE_ED_HL_RANGE_H_
|
|
|
|
#include "tty.h"
|
|
|
|
#include <blue/core/queue.h>
|
|
|
|
struct line_ed;
|
|
|
|
enum hl_range_comparison {
|
|
HL_RANGE_LESS,
|
|
HL_RANGE_LESS_OVERLAP,
|
|
HL_RANGE_EQUAL,
|
|
HL_RANGE_A_IN_B,
|
|
HL_RANGE_B_IN_A,
|
|
HL_RANGE_GREATER_OVERLAP,
|
|
HL_RANGE_GREATER,
|
|
};
|
|
|
|
struct hl_range {
|
|
unsigned int h_start_x, h_start_y;
|
|
unsigned int h_end_x, h_end_y;
|
|
struct s_tty_vmode h_vmode;
|
|
b_queue_entry h_entry;
|
|
};
|
|
|
|
extern int compare_coords(
|
|
unsigned int ax, unsigned int ay, unsigned int bx, unsigned int by);
|
|
extern struct hl_range *get_hl_range(
|
|
struct line_ed *ed, unsigned int x, unsigned int y);
|
|
extern struct hl_range *get_next_hl_range(struct hl_range *range);
|
|
extern int apply_hl_range(
|
|
struct hl_range *range, struct s_tty *tty, unsigned int x, unsigned int y);
|
|
|
|
extern struct hl_range *create_highlight(
|
|
unsigned long start_x, unsigned long start_y, unsigned long end_x,
|
|
unsigned long end_y, const struct s_tty_vmode *vmode);
|
|
extern enum hl_range_comparison compare_hl_ranges(
|
|
const struct hl_range *a, const struct hl_range *b);
|
|
|
|
#endif
|