libghostty-vt 0.0.0
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
50
60typedef struct GhosttySelectionGestureImpl* GhosttySelectionGesture;
61
70typedef struct GhosttySelectionGestureEventImpl* GhosttySelectionGestureEvent;
71
118typedef struct {
121
124
131
142typedef struct {
146
148 size_t cap;
149
152 size_t len;
154
167typedef struct {
169 size_t size;
170
173
175 const uint32_t* boundary_codepoints;
176
180
193typedef struct {
195 size_t size;
196
199
202
204 const uint32_t* boundary_codepoints;
205
209
222typedef struct {
224 size_t size;
225
228
230 const uint32_t* whitespace;
231
234
238
248typedef enum GHOSTTY_ENUM_TYPED {
251
254
257
260
261 GHOSTTY_SELECTION_ORDER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
263
273typedef enum GHOSTTY_ENUM_TYPED {
276
279
285
291
294
297
303
309
312
315
316 GHOSTTY_SELECTION_ADJUST_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
318
324typedef enum GHOSTTY_ENUM_TYPED {
327
330
333
336
337 GHOSTTY_SELECTION_GESTURE_BEHAVIOR_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
339
345typedef struct {
348
351
355
361typedef struct {
363 uint32_t columns;
364
366 uint32_t cell_width;
367
369 uint32_t padding_left;
370
374
380typedef enum GHOSTTY_ENUM_TYPED {
383
386
389
390 GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
392
399typedef enum GHOSTTY_ENUM_TYPED {
406
409
412
415
418
427
428 GHOSTTY_SELECTION_GESTURE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
430
439typedef enum GHOSTTY_ENUM_TYPED {
442
445
448
451
454
455 GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
457
466typedef enum GHOSTTY_ENUM_TYPED {
473
481
488
491
499
502
512
519
522
525
528
529 GHOSTTY_SELECTION_GESTURE_EVENT_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
531
535
548 const GhosttyAllocator* allocator,
551
563
583 const void* value);
584
641 GhosttyTerminal terminal,
643 GhosttySelection* out_selection);
644
646
650
666 const GhosttyAllocator* allocator,
667 GhosttySelectionGesture* out_gesture);
668
691 GhosttyTerminal terminal);
692
707 GhosttyTerminal terminal);
708
730 GhosttyTerminal terminal,
732 void* value);
733
764 GhosttyTerminal terminal,
765 size_t count,
766 const GhosttySelectionGestureData* keys,
767 void** values,
768 size_t* out_written);
769
771
775
793 GhosttyTerminal terminal,
795 GhosttySelection* out_selection);
796
829 GhosttyTerminal terminal,
831 GhosttySelection* out_selection);
832
850 GhosttyTerminal terminal,
852 GhosttySelection* out_selection);
853
869 GhosttyTerminal terminal,
870 GhosttySelection* out_selection);
871
888 GhosttyTerminal terminal,
889 GhosttyGridRef ref,
890 GhosttySelection* out_selection);
891
893
897
924 GhosttyTerminal terminal,
925 GhosttySelection* selection,
926 GhosttySelectionAdjust adjustment);
927
948 GhosttyTerminal terminal,
949 const GhosttySelection* selection,
950 GhosttySelectionOrder* out_order);
951
979 GhosttyTerminal terminal,
980 const GhosttySelection* selection,
981 GhosttySelectionOrder desired,
982 GhosttySelection* out_selection);
983
1008 GhosttyTerminal terminal,
1009 const GhosttySelection* selection,
1010 GhosttyPoint point,
1011 bool* out_contains);
1012
1038 GhosttyTerminal terminal,
1039 const GhosttySelection* a,
1040 const GhosttySelection* b,
1041 bool* out_equal);
1042
1044
1046
1047#ifdef __cplusplus
1048}
1049#endif
1050
1051#endif /* GHOSTTY_VT_SELECTION_H */
GhosttyResult
Definition types.h:143
#define GHOSTTY_ENUM_TYPED
Definition types.h:124
GhosttySelectionOrder
Definition selection.h:248
GHOSTTY_API GhosttyResult ghostty_selection_gesture_event_new(const GhosttyAllocator *allocator, GhosttySelectionGestureEvent *out_event, GhosttySelectionGestureEventType type)
GhosttySelectionGestureBehavior
Definition selection.h:324
struct GhosttySelectionGestureImpl * GhosttySelectionGesture
Definition selection.h:60
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_select_output(GhosttyTerminal terminal, GhosttyGridRef ref, GhosttySelection *out_selection)
GhosttySelectionGestureAutoscroll
Definition selection.h:380
GHOSTTY_API GhosttyResult ghostty_terminal_selection_order(GhosttyTerminal terminal, const GhosttySelection *selection, GhosttySelectionOrder *out_order)
struct GhosttySelectionGestureEventImpl * GhosttySelectionGestureEvent
Definition selection.h:70
GHOSTTY_API GhosttyResult ghostty_selection_gesture_event_set(GhosttySelectionGestureEvent event, GhosttySelectionGestureEventOption option, const void *value)
GhosttySelectionGestureData
Definition selection.h:399
GHOSTTY_API GhosttyResult ghostty_terminal_selection_contains(GhosttyTerminal terminal, const GhosttySelection *selection, GhosttyPoint point, bool *out_contains)
GhosttySelectionAdjust
Definition selection.h:273
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_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:466
GHOSTTY_API void ghostty_selection_gesture_free(GhosttySelectionGesture gesture, GhosttyTerminal terminal)
GhosttySelectionGestureEventType
Definition selection.h:439
@ GHOSTTY_SELECTION_ORDER_MIRRORED_FORWARD
Definition selection.h:256
@ GHOSTTY_SELECTION_ORDER_MIRRORED_REVERSE
Definition selection.h:259
@ GHOSTTY_SELECTION_ORDER_FORWARD
Definition selection.h:250
@ GHOSTTY_SELECTION_ORDER_REVERSE
Definition selection.h:253
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_OUTPUT
Definition selection.h:335
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_CELL
Definition selection.h:326
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_WORD
Definition selection.h:329
@ GHOSTTY_SELECTION_GESTURE_BEHAVIOR_LINE
Definition selection.h:332
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_NONE
Definition selection.h:382
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_DOWN
Definition selection.h:388
@ GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_UP
Definition selection.h:385
@ GHOSTTY_SELECTION_GESTURE_DATA_DRAGGED
Definition selection.h:411
@ GHOSTTY_SELECTION_GESTURE_DATA_INVALID
Definition selection.h:405
@ GHOSTTY_SELECTION_GESTURE_DATA_AUTOSCROLL
Definition selection.h:414
@ GHOSTTY_SELECTION_GESTURE_DATA_BEHAVIOR
Definition selection.h:417
@ GHOSTTY_SELECTION_GESTURE_DATA_CLICK_COUNT
Definition selection.h:408
@ GHOSTTY_SELECTION_GESTURE_DATA_ANCHOR
Definition selection.h:426
@ GHOSTTY_SELECTION_ADJUST_END_OF_LINE
Definition selection.h:314
@ GHOSTTY_SELECTION_ADJUST_LEFT
Definition selection.h:275
@ GHOSTTY_SELECTION_ADJUST_BEGINNING_OF_LINE
Definition selection.h:311
@ GHOSTTY_SELECTION_ADJUST_PAGE_UP
Definition selection.h:302
@ GHOSTTY_SELECTION_ADJUST_PAGE_DOWN
Definition selection.h:308
@ GHOSTTY_SELECTION_ADJUST_UP
Definition selection.h:284
@ GHOSTTY_SELECTION_ADJUST_HOME
Definition selection.h:293
@ GHOSTTY_SELECTION_ADJUST_END
Definition selection.h:296
@ GHOSTTY_SELECTION_ADJUST_RIGHT
Definition selection.h:278
@ GHOSTTY_SELECTION_ADJUST_DOWN
Definition selection.h:290
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_WORD_BOUNDARY_CODEPOINTS
Definition selection.h:511
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_DISTANCE
Definition selection.h:490
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_INTERVAL_NS
Definition selection.h:501
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_GEOMETRY
Definition selection.h:524
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_TIME_NS
Definition selection.h:498
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REF
Definition selection.h:480
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_RECTANGLE
Definition selection.h:521
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_BEHAVIORS
Definition selection.h:518
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_POSITION
Definition selection.h:487
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_INVALID
Definition selection.h:472
@ GHOSTTY_SELECTION_GESTURE_EVENT_OPT_VIEWPORT
Definition selection.h:527
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_PRESS
Definition selection.h:441
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_AUTOSCROLL_TICK
Definition selection.h:450
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DEEP_PRESS
Definition selection.h:453
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_RELEASE
Definition selection.h:444
@ GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DRAG
Definition selection.h:447
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:196
GhosttySelection * ptr
Definition selection.h:145
GhosttySelectionGestureBehavior triple_click
Definition selection.h:353
GhosttySelectionGestureBehavior double_click
Definition selection.h:350
GhosttySelectionGestureBehavior single_click
Definition selection.h:347
GhosttyGridRef end
Definition selection.h:123
GhosttyGridRef start
Definition selection.h:120
const uint32_t * boundary_codepoints
Definition selection.h:175