libghostty
Loading...
Searching...
No Matches
selection.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_SELECTION_H
8#define GHOSTTY_VT_SELECTION_H
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
14#include <ghostty/vt/grid_ref.h>
15#include <ghostty/vt/point.h>
16#include <ghostty/vt/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
51
61typedef struct GhosttySelectionGestureImpl* GhosttySelectionGesture;
62
71typedef struct GhosttySelectionGestureEventImpl* GhosttySelectionGestureEvent;
72
92typedef struct {
94 size_t size;
95
103
111
118
129typedef struct {
131 size_t size;
132
135
137 const uint32_t* boundary_codepoints;
138
142
153typedef struct {
155 size_t size;
156
159
162
164 const uint32_t* boundary_codepoints;
165
169
180typedef struct {
182 size_t size;
183
186
188 const uint32_t* whitespace;
189
192
196
212typedef struct {
214 size_t size;
215
218
220 bool unwrap;
221
223 bool trim;
224
236
246typedef enum GHOSTTY_ENUM_TYPED {
249
252
255
258
259 GHOSTTY_SELECTION_ORDER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
261
271typedef enum GHOSTTY_ENUM_TYPED {
274
277
283
289
292
295
301
307
310
313
314 GHOSTTY_SELECTION_ADJUST_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
316
322typedef enum GHOSTTY_ENUM_TYPED {
325
328
331
334
335 GHOSTTY_SELECTION_GESTURE_BEHAVIOR_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
337
343typedef struct {
346
349
353
359typedef struct {
361 uint32_t columns;
362
364 uint32_t cell_width;
365
367 uint32_t padding_left;
368
372
378typedef enum GHOSTTY_ENUM_TYPED {
381
384
387
388 GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
390
397typedef enum GHOSTTY_ENUM_TYPED {
400
403
406
409
418
419 GHOSTTY_SELECTION_GESTURE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
421
430typedef enum GHOSTTY_ENUM_TYPED {
433
436
439
442
445
446 GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
448
457typedef enum GHOSTTY_ENUM_TYPED {
465
472
475
483
486
496
503
506
509
512
513 GHOSTTY_SELECTION_GESTURE_EVENT_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
515
528 const GhosttyAllocator* allocator,
531
543
562 const void* value);
563
611 GhosttyTerminal terminal,
613 GhosttySelection* out_selection);
614
630 const GhosttyAllocator* allocator,
631 GhosttySelectionGesture* out_gesture);
632
655 GhosttyTerminal terminal);
656
671 GhosttyTerminal terminal);
672
693 GhosttyTerminal terminal,
695 void* value);
696
722 GhosttyTerminal terminal,
723 size_t count,
724 const GhosttySelectionGestureData* keys,
725 void** values,
726 size_t* out_written);
727
745 GhosttyTerminal terminal,
747 GhosttySelection* out_selection);
748
779 GhosttyTerminal terminal,
781 GhosttySelection* out_selection);
782
800 GhosttyTerminal terminal,
802 GhosttySelection* out_selection);
803
819 GhosttyTerminal terminal,
820 GhosttySelection* out_selection);
821
838 GhosttyTerminal terminal,
839 GhosttyGridRef ref,
840 GhosttySelection* out_selection);
841
871 GhosttyTerminal terminal,
873 uint8_t* buf,
874 size_t buf_len,
875 size_t* out_written);
876
904 GhosttyTerminal terminal,
905 const GhosttyAllocator* allocator,
907 uint8_t** out_ptr,
908 size_t* out_len);
909
936 GhosttyTerminal terminal,
937 GhosttySelection* selection,
938 GhosttySelectionAdjust adjustment);
939
960 GhosttyTerminal terminal,
961 const GhosttySelection* selection,
962 GhosttySelectionOrder* out_order);
963
991 GhosttyTerminal terminal,
992 const GhosttySelection* selection,
993 GhosttySelectionOrder desired,
994 GhosttySelection* out_selection);
995
1020 GhosttyTerminal terminal,
1021 const GhosttySelection* selection,
1022 GhosttyPoint point,
1023 bool* out_contains);
1024
1050 GhosttyTerminal terminal,
1051 const GhosttySelection* a,
1052 const GhosttySelection* b,
1053 bool* out_equal);
1054
1056
1057#ifdef __cplusplus
1058}
1059#endif
1060
1061#endif /* GHOSTTY_VT_SELECTION_H */
GhosttyFormatterFormat
Definition types.h:204
GhosttySelectionOrder
Definition selection.h:246
GHOSTTY_API GhosttyResult ghostty_selection_gesture_event_new(const GhosttyAllocator *allocator, GhosttySelectionGestureEvent *out_event, GhosttySelectionGestureEventType type)
GhosttySelectionGestureBehavior
Definition selection.h:322
struct GhosttySelectionGestureImpl * GhosttySelectionGesture
Definition selection.h:61
GHOSTTY_API GhosttyResult ghostty_terminal_selection_equal(GhosttyTerminal terminal, const GhosttySelection *a, const GhosttySelection *b, bool *out_equal)
GHOSTTY_API GhosttyResult ghostty_selection_gesture_event(GhosttySelectionGesture gesture, GhosttyTerminal terminal, GhosttySelectionGestureEvent event, GhosttySelection *out_selection)
GHOSTTY_API GhosttyResult ghostty_terminal_select_all(GhosttyTerminal terminal, GhosttySelection *out_selection)
GHOSTTY_API GhosttyResult ghostty_selection_gesture_get(GhosttySelectionGesture gesture, GhosttyTerminal terminal, GhosttySelectionGestureData data, void *value)
GHOSTTY_API GhosttyResult ghostty_selection_gesture_get_multi(GhosttySelectionGesture gesture, GhosttyTerminal terminal, size_t count, const GhosttySelectionGestureData *keys, void **values, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_terminal_selection_format_buf(GhosttyTerminal terminal, GhosttyTerminalSelectionFormatOptions options, uint8_t *buf, size_t buf_len, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_terminal_select_output(GhosttyTerminal terminal, GhosttyGridRef ref, GhosttySelection *out_selection)
GhosttySelectionGestureAutoscroll
Definition selection.h:378
GHOSTTY_API GhosttyResult ghostty_terminal_selection_order(GhosttyTerminal terminal, const GhosttySelection *selection, GhosttySelectionOrder *out_order)
struct GhosttySelectionGestureEventImpl * GhosttySelectionGestureEvent
Definition selection.h:71
GHOSTTY_API GhosttyResult ghostty_selection_gesture_event_set(GhosttySelectionGestureEvent event, GhosttySelectionGestureEventOption option, const void *value)
GhosttySelectionGestureData
Definition selection.h:397
GHOSTTY_API GhosttyResult ghostty_terminal_selection_contains(GhosttyTerminal terminal, const GhosttySelection *selection, GhosttyPoint point, bool *out_contains)
GhosttySelectionAdjust
Definition selection.h:271
GHOSTTY_API void ghostty_selection_gesture_event_free(GhosttySelectionGestureEvent event)
GHOSTTY_API GhosttyResult ghostty_terminal_select_word_between(GhosttyTerminal terminal, const GhosttyTerminalSelectWordBetweenOptions *options, GhosttySelection *out_selection)
GHOSTTY_API GhosttyResult ghostty_terminal_selection_format_alloc(GhosttyTerminal terminal, const GhosttyAllocator *allocator, GhosttyTerminalSelectionFormatOptions options, uint8_t **out_ptr, size_t *out_len)
GHOSTTY_API GhosttyResult ghostty_terminal_select_line(GhosttyTerminal terminal, const GhosttyTerminalSelectLineOptions *options, GhosttySelection *out_selection)
GHOSTTY_API GhosttyResult ghostty_selection_gesture_new(const GhosttyAllocator *allocator, GhosttySelectionGesture *out_gesture)
GHOSTTY_API void ghostty_selection_gesture_reset(GhosttySelectionGesture gesture, GhosttyTerminal terminal)
GHOSTTY_API GhosttyResult ghostty_terminal_selection_ordered(GhosttyTerminal terminal, const GhosttySelection *selection, GhosttySelectionOrder desired, GhosttySelection *out_selection)
GHOSTTY_API GhosttyResult ghostty_terminal_selection_adjust(GhosttyTerminal terminal, GhosttySelection *selection, GhosttySelectionAdjust adjustment)
GHOSTTY_API GhosttyResult ghostty_terminal_select_word(GhosttyTerminal terminal, const GhosttyTerminalSelectWordOptions *options, GhosttySelection *out_selection)
GhosttySelectionGestureEventOption
Definition selection.h:457
GHOSTTY_API void ghostty_selection_gesture_free(GhosttySelectionGesture gesture, GhosttyTerminal terminal)
GhosttySelectionGestureEventType
Definition selection.h:430
@ GHOSTTY_SELECTION_ORDER_MIRRORED_FORWARD
Definition selection.h:254
@ GHOSTTY_SELECTION_ORDER_MIRRORED_REVERSE
Definition selection.h:257
@ GHOSTTY_SELECTION_ORDER_FORWARD
Definition selection.h:248
@ GHOSTTY_SELECTION_ORDER_REVERSE
Definition selection.h:251
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_OUTPUT
Definition selection.h:333
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_CELL
Definition selection.h:324
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_WORD
Definition selection.h:327
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_LINE
Definition selection.h:330
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_NONE
Definition selection.h:380
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_DOWN
Definition selection.h:386
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_UP
Definition selection.h:383
@ GHOSTTY_SELECTION_GESTURE_DATA_DRAGGED
Definition selection.h:402
@ GHOSTTY_SELECTION_GESTURE_DATA_AUTOSCROLL
Definition selection.h:405
@ GHOSTTY_SELECTION_GESTURE_DATA_BEHAVIOR
Definition selection.h:408
@ GHOSTTY_SELECTION_GESTURE_DATA_CLICK_COUNT
Definition selection.h:399
@ GHOSTTY_SELECTION_GESTURE_DATA_ANCHOR
Definition selection.h:417
@ GHOSTTY_SELECTION_ADJUST_END_OF_LINE
Definition selection.h:312
@ GHOSTTY_SELECTION_ADJUST_LEFT
Definition selection.h:273
@ GHOSTTY_SELECTION_ADJUST_BEGINNING_OF_LINE
Definition selection.h:309
@ GHOSTTY_SELECTION_ADJUST_PAGE_UP
Definition selection.h:300
@ GHOSTTY_SELECTION_ADJUST_PAGE_DOWN
Definition selection.h:306
@ GHOSTTY_SELECTION_ADJUST_UP
Definition selection.h:282
@ GHOSTTY_SELECTION_ADJUST_HOME
Definition selection.h:291
@ GHOSTTY_SELECTION_ADJUST_END
Definition selection.h:294
@ GHOSTTY_SELECTION_ADJUST_RIGHT
Definition selection.h:276
@ GHOSTTY_SELECTION_ADJUST_DOWN
Definition selection.h:288
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_WORD_BOUNDARY_CODEPOINTS
Definition selection.h:495
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_DISTANCE
Definition selection.h:474
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_INTERVAL_NS
Definition selection.h:485
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_GEOMETRY
Definition selection.h:508
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_TIME_NS
Definition selection.h:482
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REF
Definition selection.h:464
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_RECTANGLE
Definition selection.h:505
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_BEHAVIORS
Definition selection.h:502
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_POSITION
Definition selection.h:471
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_VIEWPORT
Definition selection.h:511
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_PRESS
Definition selection.h:432
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_AUTOSCROLL_TICK
Definition selection.h:441
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DEEP_PRESS
Definition selection.h:444
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_RELEASE
Definition selection.h:435
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DRAG
Definition selection.h:438
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttySelectionGestureBehavior triple_click
Definition selection.h:351
GhosttySelectionGestureBehavior double_click
Definition selection.h:348
GhosttySelectionGestureBehavior single_click
Definition selection.h:345
GhosttyGridRef end
Definition selection.h:110
GhosttyGridRef start
Definition selection.h:102
const uint32_t * boundary_codepoints
Definition selection.h:137
const GhosttySelection * selection
Definition selection.h:234
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67