diff options
author | Po Lu <luangruo@yahoo.com> | 2022-03-27 13:36:45 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-03-27 13:36:45 +0000 |
commit | be21c95842f37e164606a6b392f5396d91506f61 (patch) | |
tree | 5d25c80461c213a2c683565233e7016782fba8ee /src/haiku_select.cc | |
parent | 46863b7dfa210e73244af9bc790222dd66d5051d (diff) | |
download | emacs-be21c95842f37e164606a6b392f5396d91506f61.tar.gz emacs-be21c95842f37e164606a6b392f5396d91506f61.tar.bz2 emacs-be21c95842f37e164606a6b392f5396d91506f61.zip |
Store latin-1 content into the Haiku clipboard as well
* lisp/term/haiku-win.el (haiku-normal-selection-encoders): New
variable.
(haiku-select-encode-utf-8-string, haiku-select-encode-xstring):
New functions.
(gui-backend-set-selection): Use new selection encoder functions
instead of hard-coding UTF-8.
(haiku-dnd-handle-drag-n-drop-event): Rename to
`haiku-drag-and-drop'.
* src/haiku_select.cc (be_lock_clipboard_message): Accept new
argument `clear'.
(be_unlock_clipboard): Accept new argument `discard'.
* src/haikuselect.c (Fhaiku_selection_data): Change calls to
`be_lock_clipboard_message' and `be_unlock_clipboard'.
(haiku_unwind_clipboard_lock): New function.
(Fhaiku_selection_put): Accept new meaning of `name' which means
to set the selection message.
* src/haikuselect.h: Update prototypes.
Diffstat (limited to 'src/haiku_select.cc')
-rw-r--r-- | src/haiku_select.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/haiku_select.cc b/src/haiku_select.cc index 373ad321c4b..e047b9b5139 100644 --- a/src/haiku_select.cc +++ b/src/haiku_select.cc @@ -413,7 +413,7 @@ be_add_message_message (void *message, const char *name, int be_lock_clipboard_message (enum haiku_clipboard clipboard, - void **message_return) + void **message_return, bool clear) { BClipboard *board; @@ -427,12 +427,15 @@ be_lock_clipboard_message (enum haiku_clipboard clipboard, if (!board->Lock ()) return 1; + if (clear) + board->Clear (); + *message_return = board->Data (); return 0; } void -be_unlock_clipboard (enum haiku_clipboard clipboard) +be_unlock_clipboard (enum haiku_clipboard clipboard, bool discard) { BClipboard *board; @@ -443,5 +446,10 @@ be_unlock_clipboard (enum haiku_clipboard clipboard) else board = system_clipboard; + if (discard) + board->Revert (); + else + board->Commit (); + board->Unlock (); } |