blob: 9f878fadcb301f51ab6cb95d99b069933065643c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/**
* @file selection.h
*
* Selection range type for specifying a region of terminal content.
*/
#ifndef GHOSTTY_VT_SELECTION_H
#define GHOSTTY_VT_SELECTION_H
#include <stdbool.h>
#include <stddef.h>
#include <ghostty/vt/grid_ref.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @defgroup selection Selection
*
* A selection range defined by two grid references that identifies a
* contiguous or rectangular region of terminal content.
*
* @{
*/
/**
* A selection range defined by two grid references.
*
* This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.
*
* @ingroup selection
*/
typedef struct {
/** Size of this struct in bytes. Must be set to sizeof(GhosttySelection). */
size_t size;
/** Start of the selection range (inclusive). */
GhosttyGridRef start;
/** End of the selection range (inclusive). */
GhosttyGridRef end;
/** Whether the selection is rectangular (block) rather than linear. */
bool rectangle;
} GhosttySelection;
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* GHOSTTY_VT_SELECTION_H */
|