diff options
author | Po Lu <luangruo@yahoo.com> | 2022-06-21 22:03:42 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-06-21 22:05:21 +0800 |
commit | be35c92c90d455739a6ff9d4beefa2b35d044852 (patch) | |
tree | 19c5be6b9e09ccb45c58a5008f8f956f3ad92d57 /src/keyboard.h | |
parent | b1af8c2c00aefe6aa554a468e65b6e07c9f14722 (diff) | |
download | emacs-be35c92c90d455739a6ff9d4beefa2b35d044852.tar.gz emacs-be35c92c90d455739a6ff9d4beefa2b35d044852.tar.bz2 emacs-be35c92c90d455739a6ff9d4beefa2b35d044852.zip |
Rewrite PGTK selection code from scratch
* src/frame.c (delete_frame): Clear selections and swallow
special events.
* src/keyboard.c (kbd_buffer_get_event, process_special_events):
Also handle selection events on PGTK.
* src/keyboard.h (union buffered_input_event): Include selection
events on PGTK.
* src/pgtkselect.c (symbol_to_gtk_clipboard, LOCAL_SELECTION):
New functions and macros.
(selection_type_to_quarks, get_func, clear_func): Delete
functions.
(pgtk_selection_init, pgtk_selection_lost):
(pgtk_selection_usable): New functions.
(Fpgtk_own_selection_internal, Fpgtk_disown_selection_internal)
(Fpgtk_selection_exists_p, Fpgtk_selection_owner_p)
(Fpgtk_get_selection_internal): Complete rewrite.
(syms_of_pgtkselect): Update defsyms and add more hooks.
* src/pgtkselect.h: Delete file.
* src/pgtkterm.c (evq_enqueue): Set last user time based on the
event.
(pgtk_any_window_to_frame, button_event): Fix coding style.
(pgtk_set_event_handler): Add selection events.
(pgtk_find_selection_owner, pgtk_selection_event): New
functions.
(pgtk_term_init): Remove call to `pgtk_selection_init'.
* src/pgtkterm.h (struct pgtk_display_info): New field
`display'.
(enum selection_input_event): New struct. New macros for
accessing its fields.
Diffstat (limited to 'src/keyboard.h')
-rw-r--r-- | src/keyboard.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keyboard.h b/src/keyboard.h index 6ae2dc9c4c6..507d80c2975 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -27,6 +27,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ # include "xterm.h" /* for struct selection_input_event */ #endif +#ifdef HAVE_PGTK +#include "pgtkterm.h" /* for struct selection_input_event */ +#endif + INLINE_HEADER_BEGIN /* Most code should use this macro to access Lisp fields in struct kboard. */ @@ -226,7 +230,7 @@ union buffered_input_event { ENUM_BF (event_kind) kind : EVENT_KIND_WIDTH; struct input_event ie; -#ifdef HAVE_X11 +#if defined HAVE_X11 || defined HAVE_PGTK struct selection_input_event sie; #endif }; |