#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