diff options
| author | Po Lu | 2022-03-23 14:15:22 +0000 |
|---|---|---|
| committer | Po Lu | 2022-03-23 14:16:15 +0000 |
| commit | 7fa5d6c87d43926008c15a7f7ddc924bbf8d2e76 (patch) | |
| tree | 10291262a55f8d78e81c7e1f2d98b754cbe4cc71 /lisp | |
| parent | 36810a8164db12766f532f268f322afe1e601b6a (diff) | |
| download | emacs-7fa5d6c87d43926008c15a7f7ddc924bbf8d2e76.tar.gz emacs-7fa5d6c87d43926008c15a7f7ddc924bbf8d2e76.zip | |
Improvements to Haiku selection handling
* lisp/term/haiku-win.el (haiku-selection-targets): Implement in Lisp.
* src/haiku_select.cc (be_get_message_type):
(be_set_message_type):
(be_get_message_message):
(be_add_message_message): New functions.
* src/haiku_support.cc (MessageReceived): Fix typo.
* src/haikuselect.c (haiku_selection_data_1)
(Fhaiku_selection_targets): Delete functions.
(haiku_message_to_lisp, lisp_to_type_code)
(haiku_lisp_to_message): Correctly decode and encode nested
messages, and fix encoding specially decoded types via numeric
names. Also store and decode message types inside Lisp
messages.
(Fhaiku_drag_message): Update doc string.
(syms_of_haikuselect): Update subrs.
* src/haikuselect.h: Update prototypes.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/term/haiku-win.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el index 632177f843e..8ec959a7584 100644 --- a/lisp/term/haiku-win.el +++ b/lisp/term/haiku-win.el | |||
| @@ -79,7 +79,6 @@ VALUE as a unibyte string, or nil if VALUE was not a string." | |||
| 79 | (declare-function x-handle-args "common-win") | 79 | (declare-function x-handle-args "common-win") |
| 80 | (declare-function haiku-selection-data "haikuselect.c") | 80 | (declare-function haiku-selection-data "haikuselect.c") |
| 81 | (declare-function haiku-selection-put "haikuselect.c") | 81 | (declare-function haiku-selection-put "haikuselect.c") |
| 82 | (declare-function haiku-selection-targets "haikuselect.c") | ||
| 83 | (declare-function haiku-selection-owner-p "haikuselect.c") | 82 | (declare-function haiku-selection-owner-p "haikuselect.c") |
| 84 | (declare-function haiku-put-resource "haikufns.c") | 83 | (declare-function haiku-put-resource "haikufns.c") |
| 85 | (declare-function haiku-drag-message "haikuselect.c") | 84 | (declare-function haiku-drag-message "haikuselect.c") |
| @@ -123,6 +122,12 @@ If TYPE is nil, return \"text/plain\"." | |||
| 123 | ((symbolp type) (symbol-name type)) | 122 | ((symbolp type) (symbol-name type)) |
| 124 | (t "text/plain"))) | 123 | (t "text/plain"))) |
| 125 | 124 | ||
| 125 | (defun haiku-selection-targets (clipboard) | ||
| 126 | "Find the types of data available from CLIPBOARD. | ||
| 127 | CLIPBOARD should be the symbol `PRIMARY', `SECONDARY' or | ||
| 128 | `CLIPBOARD'. Return the available types as a list of strings." | ||
| 129 | (mapcar #'car (haiku-selection-data clipboard nil))) | ||
| 130 | |||
| 126 | (cl-defmethod gui-backend-get-selection (type data-type | 131 | (cl-defmethod gui-backend-get-selection (type data-type |
| 127 | &context (window-system haiku)) | 132 | &context (window-system haiku)) |
| 128 | (if (eq data-type 'TARGETS) | 133 | (if (eq data-type 'TARGETS) |