From be35c92c90d455739a6ff9d4beefa2b35d044852 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 21 Jun 2022 22:03:42 +0800 Subject: 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. --- src/pgtkselect.h | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/pgtkselect.h (limited to 'src/pgtkselect.h') diff --git a/src/pgtkselect.h b/src/pgtkselect.h deleted file mode 100644 index fd9910b2d18..00000000000 --- a/src/pgtkselect.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Definitions and headers for selection of pure Gtk+3. - Copyright (C) 1989, 1993, 2005, 2008-2022 Free Software Foundation, - Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -#include "dispextern.h" -#include "frame.h" - -#ifdef HAVE_PGTK - -#include - -extern void pgtk_selection_init (void); -extern void pgtk_selection_lost (GtkWidget *, GdkEventSelection *, gpointer); - -#endif /* HAVE_PGTK */ -- cgit v1.2.1