mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-11 05:33:55 -04:00
selection: add selection_<type>_has_data()
Returns true when there is data available for paste in the clipboard/primary selection.
This commit is contained in:
parent
c3cacb4704
commit
dec6f963cb
2 changed files with 15 additions and 0 deletions
12
selection.c
12
selection.c
|
|
@ -661,6 +661,18 @@ selection_cancel(struct terminal *term)
|
||||||
term->selection.ongoing = false;
|
term->selection.ongoing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
selection_clipboard_has_data(const struct seat *seat)
|
||||||
|
{
|
||||||
|
return seat->clipboard.data_offer != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
selection_primary_has_data(const struct seat *seat)
|
||||||
|
{
|
||||||
|
return seat->primary.data_offer != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
selection_clipboard_unset(struct seat *seat)
|
selection_clipboard_unset(struct seat *seat)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ void selection_mark_row(
|
||||||
void selection_clipboard_unset(struct seat *seat);
|
void selection_clipboard_unset(struct seat *seat);
|
||||||
void selection_primary_unset(struct seat *seat);
|
void selection_primary_unset(struct seat *seat);
|
||||||
|
|
||||||
|
bool selection_clipboard_has_data(const struct seat *seat);
|
||||||
|
bool selection_primary_has_data(const struct seat *seat);
|
||||||
|
|
||||||
char *selection_to_text(const struct terminal *term);
|
char *selection_to_text(const struct terminal *term);
|
||||||
void selection_to_clipboard(
|
void selection_to_clipboard(
|
||||||
struct seat *seat, struct terminal *term, uint32_t serial);
|
struct seat *seat, struct terminal *term, uint32_t serial);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue