This repository has been archived on 2021-04-22. You can view files and clone it, but cannot push or open issues/pull-requests.
stj/src/st/selection.h

37 lines
886 B
C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef SELECTION_H
#define SELECTION_H
enum selection_mode { SEL_IDLE = 0, SEL_EMPTY = 1, SEL_READY = 2 };
enum selection_type { SEL_REGULAR = 1, SEL_RECTANGULAR = 2 };
enum selection_snap { SNAP_WORD = 1, SNAP_LINE = 2 };
typedef struct {
int mode;
int type;
int snap;
/*
* Selection variables:
* nb normalized coordinates of the beginning of the selection
* ne normalized coordinates of the end of the selection
* ob original coordinates of the beginning of the selection
* oe original coordinates of the end of the selection
*/
struct {
int x, y;
} nb, ne, ob, oe;
int alt;
} Selection;
void selinit(void);
void selstart(int, int, int);
void selnormalize();
void selscroll(int, int);
void selsnap(int *, int *, int);
void selclear(void);
// Global variable for now
static Selection sel;
#endif