/* Definitions and headers for communication with pure Gtk+3. Copyright (C) 1989, 1993, 2005, 2008-2018 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 "config.h" #include "dispextern.h" #include "frame.h" #include "character.h" #include "font.h" #include "sysselect.h" #include "keyboard.h" #include "atimer.h" #ifndef __PGTKTERM_H #define __PGTKTERM_H #ifdef HAVE_PGTK #include #ifdef PGTK_DEBUG extern void pgtk_log(const char *file, int lineno, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF (3, 4); #define PGTK_TRACE(fmt, ...) pgtk_log(__FILE__, __LINE__, fmt, ## __VA_ARGS__) extern void pgtk_backtrace(const char *file, int lineno); #define PGTK_BACKTRACE() pgtk_backtrace(__FILE__, __LINE__) #else #define PGTK_TRACE(fmt, ...) ((void) 0) #define PGTK_BACKTRACE() ((void) 0) #endif #ifdef HAVE_GTK4 #include "pgtkdnd.h" #endif #if (defined (HAVE_GTK3) && GTK_CHECK_VERSION (2, 14, 0)) || defined (HAVE_GTK4) #define HAVE_GTK_EVENT_CONTROLLER #endif /* The GtkTooltip API came in 2.12, but gtk-enable-tooltips in 2.14. */ #if GTK_CHECK_VERSION (2, 14, 0) #define USE_GTK_TOOLTIP #endif #ifdef HAVE_GTK3 #include "pgtkevent.h" #endif /* could use list to store these, but rest of emacs has a big infrastructure for managing a table of bitmap "records" */ struct pgtk_bitmap_record { void *img; char *file; int refcount; int height, width, depth; cairo_pattern_t *pattern; }; #define RGB_TO_ULONG(r, g, b) (((r) << 16) | ((g) << 8) | (b)) #define ARGB_TO_ULONG(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #define ALPHA_FROM_ULONG(color) ((color) >> 24) #define RED_FROM_ULONG(color) (((color) >> 16) & 0xff) #define GREEN_FROM_ULONG(color) (((color) >> 8) & 0xff) #define BLUE_FROM_ULONG(color) ((color) & 0xff) struct scroll_bar { /* These fields are shared by all vectors. */ union vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; /* The next and previous in the chain of scroll bars in this frame. */ Lisp_Object next, prev; /* Fields from `x_window' down will not be traced by the GC. */ /* The X window representing this scroll bar. */ GWindow x_window; /* The position and size of the scroll bar in pixels, relative to the frame. */ int top, left, width, height; /* The starting and ending positions of the handle, relative to the handle area (i.e. zero is the top position, not SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle hasn't been drawn yet. These are not actually the locations where the beginning and end are drawn; in order to keep handles from becoming invisible when editing large files, we establish a minimum height by always drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below where they would be normally; the bottom and top are in a different co-ordinate system. */ int start, end; /* If the scroll bar handle is currently being dragged by the user, this is the number of pixels from the top of the handle to the place where the user grabbed it. If the handle isn't currently being dragged, this is -1. */ int dragging; #if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID) /* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback. */ enum scroll_bar_part last_seen_part; #endif #if defined (USE_TOOLKIT_SCROLL_BARS) && !defined (USE_GTK) /* Last value of whole for horizontal scrollbars. */ int whole; #endif /* True if the scroll bar is horizontal. */ bool horizontal; }; /* init'd in pgtk_initialize_display_info () */ struct pgtk_display_info { /* Chain of all pgtk_display_info structures. */ struct pgtk_display_info *next; /* The generic display parameters corresponding to this PGTK display. */ struct terminal *terminal; /* This says how to access this display in Gdk. */ GdkDisplay *gdpy; GdkEvent *last_event; int connection; /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */ Lisp_Object name_list_element; /* Number of frames that are on this display. */ int reference_count; /* Logical identifier of this display. */ unsigned x_id; /* Default name for all frames on this display. */ char *x_id_name; /* The number of fonts loaded. */ int n_fonts; /* Minimum width over all characters in all fonts in font_table. */ int smallest_char_width; /* Minimum font height over all fonts in font_table. */ int smallest_font_height; struct pgtk_bitmap_record *bitmaps; ptrdiff_t bitmaps_size; ptrdiff_t bitmaps_last; /* DPI resolution of this screen */ double resx, resy; /* Mask of things that cause the mouse to be grabbed */ int grabbed; int n_planes; int color_p; GWindow root_window; /* Xism */ XrmDatabase rdb; /* The cursor to use for vertical scroll bars. */ Emacs_Cursor vertical_scroll_bar_cursor; /* The cursor to use for horizontal scroll bars. */ Emacs_Cursor horizontal_scroll_bar_cursor; /* Information about the range of text currently shown in mouse-face. */ Mouse_HLInfo mouse_highlight; struct frame *highlight_frame; struct frame *x_focus_frame; /* The last frame mentioned in a FocusIn or FocusOut event. This is separate from x_focus_frame, because whether or not LeaveNotify events cause us to lose focus depends on whether or not we have received a FocusIn event for it. */ struct frame *x_focus_event_frame; /* The frame where the mouse was last time we reported a mouse event. */ struct frame *last_mouse_frame; /* The frame where the mouse was last time we reported a mouse motion. */ struct frame *last_mouse_motion_frame; /* Position where the mouse was last time we reported a motion. This is a position on last_mouse_motion_frame. */ int last_mouse_motion_x; int last_mouse_motion_y; /* Where the mouse was last time we reported a mouse position. */ NativeRectangle last_mouse_glyph; /* Time of last mouse movement. */ Time last_mouse_movement_time; /* The scroll bar in which the last motion event occurred. */ void *last_mouse_scroll_bar; /* The invisible cursor used for pointer blanking. Unused if this display supports Xfixes extension. */ Emacs_Cursor invisible_cursor; /* Function used to toggle pointer visibility on this display. */ void (*toggle_visible_pointer) (struct frame *, bool); /* The GDK cursor for scroll bars and popup menus. */ GdkCursor *xg_cursor; /* The frame where the mouse was last time we reported a mouse position. */ struct frame *last_mouse_glyph_frame; /* Modifier masks in gdk */ int meta_mod_mask, alt_mod_mask; /* whether to use Gtk's IM context. */ /* input method */ struct { GtkIMContext *context; struct frame *focused_frame; } im; }; /* This is a chain of structures for all the PGTK displays currently in use. */ extern struct pgtk_display_info *x_display_list; struct pgtk_output { #ifdef HAVE_GTK4 bool_bf ts_up_flag; #endif unsigned long foreground_color; unsigned long background_color; void *toolbar; /* Cursors */ Emacs_Cursor current_cursor; Emacs_Cursor text_cursor; Emacs_Cursor nontext_cursor; Emacs_Cursor modeline_cursor; Emacs_Cursor hand_cursor; Emacs_Cursor hourglass_cursor; Emacs_Cursor horizontal_drag_cursor; Emacs_Cursor vertical_drag_cursor; Emacs_Cursor left_edge_cursor; Emacs_Cursor top_left_corner_cursor; Emacs_Cursor top_edge_cursor; Emacs_Cursor top_right_corner_cursor; Emacs_Cursor right_edge_cursor; Emacs_Cursor bottom_right_corner_cursor; Emacs_Cursor bottom_edge_cursor; Emacs_Cursor bottom_left_corner_cursor; /* PGTK-specific */ Emacs_Cursor current_pointer; #ifdef HAVE_GTK3 /* border color */ unsigned long border_pixel; GtkCssProvider *border_color_css_provider; /* scrollbar color */ GtkCssProvider *scrollbar_foreground_css_provider; GtkCssProvider *scrollbar_background_css_provider; #endif /* Widget whose cursor is hourglass_cursor. This widget is temporarily mapped to display an hourglass cursor. */ GtkWidget *hourglass_widget; Emacs_GC cursor_xgcv; /* lord knows why Emacs needs to know about our Window ids.. */ GWindow window_desc, parent_desc; char explicit_parent; struct font *font; int baseline_offset; /* If a fontset is specified for this frame instead of font, this value contains an ID of the fontset, else -1. */ int fontset; /* only used with font_backend */ unsigned long mouse_color; unsigned long cursor_color; unsigned long cursor_foreground_color; int icon_top; int icon_left; /* The size of the extra width currently allotted for vertical scroll bars, in pixels. */ int vertical_scroll_bar_extra; /* The height of the titlebar decoration (included in PGTKWindow's frame). */ int titlebar_height; /* The height of the toolbar if displayed, else 0. */ int toolbar_height; /* This is the Emacs structure for the PGTK display this frame is on. */ struct pgtk_display_info *display_info; /* Non-zero if we are zooming (maximizing) the frame. */ int zooming; /* Non-zero if we are doing an animation, e.g. toggling the tool bar. */ int in_animation; /* The last size hints set. */ #ifndef HAVE_GTK4 GdkGeometry size_hints; #endif #ifdef HAVE_GTK4 bool bar_focus_out_events; bool bar_focus_in_events; struct frame *last_focus_child_frame; #endif long hint_flags; int preferred_width, preferred_height; /* The widget of this screen. This is the window of a top widget. */ GtkWidget *widget; #ifdef HAVE_GTK3 GtkHeaderBar *header_bar; #endif #ifdef HAVE_GTK4 GSList *child_frame_order; struct frame *keep_above; #endif #ifdef HAVE_GTK4 struct atimer *mbar_deep_atimer; bool visible_bell_end_time; #endif #ifdef HAVE_GTK_EVENT_CONTROLLER EmacsGtkEventHandler *event_handler; EmacsGtkEventHandler *event_subhandler; #endif /* The widget of the edit portion of this screen; the window in "window_desc" is inside of this. */ GtkWidget *edit_widget; /* The widget used for laying out widgets vertically. */ #ifndef HAVE_GTK4 GtkWidget *vbox_widget; /* The widget used for laying out widgets horizontally. */ GtkWidget *hbox_widget; /* The menubar in this frame. */ GtkWidget *menubar_widget; /* The tool bar in this frame */ GtkWidget *toolbar_widget; /* True if tool bar is packed into the hbox widget (i.e. vertical). */ bool_bf toolbar_in_hbox : 1; bool_bf toolbar_is_packed : 1; #else GtkOverlay *decor_overlay; GtkOverlay *overlay; GtkBox *box; GtkBox *mbbox; GtkBox *tbbox; GtkWidget *menu_bar; GtkWidget *toolbar_widget; Lisp_Object lmme; #endif #ifdef USE_GTK_TOOLTIP #ifndef HAVE_GTK4 GtkTooltip *ttip_widget; GtkWidget *ttip_lbl; GtkWindow *ttip_window; #else GtkPopover *ttip_popover; Lisp_Object ttip_label; #endif #endif /* USE_GTK_TOOLTIP */ /* Height of menu bar widget, in pixels. This value is not meaningful if the menubar is turned off. */ int menubar_height; /* Height of tool bar widget, in pixels. top_height is used if tool bar at top, bottom_height if tool bar is at the bottom. Zero if not using an external tool bar or if tool bar is vertical. */ int toolbar_top_height, toolbar_bottom_height; /* Width of tool bar widget, in pixels. left_width is used if tool bar at left, right_width if tool bar is at the right. Zero if not using an external tool bar or if tool bar is horizontal. */ int toolbar_left_width, toolbar_right_width; /* Cairo drawing context. */ cairo_t *cr_context; cairo_t *cr_flip_context; int cr_surface_desired_width, cr_surface_desired_height; /* Cairo surface for double buffering */ cairo_surface_t *cr_surface; cairo_surface_t *flip_buf; cairo_surface_t *cr_surface_visible_bell; int clip_count; bool want_flip; struct atimer *atimer_visible_bell; int has_been_visible; #ifdef HAVE_GTK4 bool child_map_flag; #endif /* Relief GCs, colors etc. */ struct relief { Emacs_GC xgcv; unsigned long pixel; } black_relief, white_relief; /* The background for which the above relief GCs were set up. They are changed only when a different background is involved. */ unsigned long relief_background; /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this frame, or IMPLICIT if we received an EnterNotify. FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ int focus_state; #ifdef HAVE_GTK4 struct dnd_info di; #endif int menubar_or_popup_count; #ifdef HAVE_GTK4 bool_bf hyper_flag : 1; #endif }; /* this dummy decl needed to support TTYs */ struct x_output { int unused; }; enum { /* Values for focus_state, used as bit mask. EXPLICIT means we received a FocusIn for the frame and know it has the focus. IMPLICIT means we received an EnterNotify and the frame may have the focus if no window manager is running. FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ FOCUS_NONE = 0, FOCUS_IMPLICIT = 1, FOCUS_EXPLICIT = 2 }; /* This gives the pgtk_display_info structure for the display F is on. */ #define FRAME_X_OUTPUT(f) ((f)->output_data.pgtk) #define FRAME_OUTPUT_DATA(f) FRAME_X_OUTPUT (f) #define FRAME_DISPLAY_INFO(f) (FRAME_X_OUTPUT (f)->display_info) #define FRAME_FOREGROUND_COLOR(f) (FRAME_X_OUTPUT (f)->foreground_color) #define FRAME_BACKGROUND_COLOR(f) (FRAME_X_OUTPUT (f)->background_color) #define FRAME_CURSOR_COLOR(f) (FRAME_X_OUTPUT (f)->cursor_color) #define FRAME_POINTER_TYPE(f) (FRAME_X_OUTPUT (f)->current_pointer) #define FRAME_FONT(f) (FRAME_X_OUTPUT (f)->font) #define FRAME_GTK_OUTER_WIDGET(f) (FRAME_X_OUTPUT (f)->widget) #define FRAME_GTK_WIDGET(f) (FRAME_X_OUTPUT (f)->edit_widget) #ifdef HAVE_GTK4 #define FRAME_DECOR_OVERLAY(f) (FRAME_X_OUTPUT (f)->decor_overlay) #define FRAME_OVERLAY(f) (FRAME_X_OUTPUT (f)->overlay) #define FRAME_BOX(f) (FRAME_X_OUTPUT (f)->box) #define FRAME_MB_BOX(f) (FRAME_X_OUTPUT (f)->mbbox) #define FRAME_TB_BOX(f) (FRAME_X_OUTPUT (f)->tbbox) #define FRAME_TOOL_BAR(f) (FRAME_X_OUTPUT (f)->toolbar_widget) #define FRAME_MENU_BAR(f) (FRAME_X_OUTPUT (f)->menu_bar) #endif #ifdef HAVE_GTK_EVENT_CONTROLLER #define FRAME_GTK_HEADER_BAR(f) ((f)->output_data.pgtk->header_bar) #define FRAME_GTK_EV_HANDLER(f) ((f)->output_data.pgtk->event_handler) #define FRAME_GTK_ES_HANDLER(f) ((f)->output_data.pgtk->event_subhandler) #endif /* aliases */ #define FRAME_PGTK_VIEW(f) FRAME_GTK_WIDGET(f) #define FRAME_X_WINDOW(f) FRAME_GTK_WIDGET(f) #define FRAME_NATIVE_WINDOW(f) FRAME_GTK_WIDGET(f) #define FRAME_X_DISPLAY(f) (FRAME_DISPLAY_INFO(f)->gdpy) #define DEFAULT_GDK_DISPLAY() gdk_display_get_default() /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) #define PGTK_FACE_FOREGROUND(f) ((f)->foreground) #define PGTK_FACE_BACKGROUND(f) ((f)->background) #define FRAME_DEFAULT_FACE(f) FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID) /* Compute pixel size for vertical scroll bars */ #define PGTK_SCROLL_BAR_WIDTH(f) \ (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ ? rint (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0 \ ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \ : (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))) \ : 0) /* Compute pixel size for horizontal scroll bars */ #define PGTK_SCROLL_BAR_HEIGHT(f) \ (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \ ? rint (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0 \ ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) \ : (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f))) \ : 0) /* Difference btwn char-column-calculated and actual SB widths. This is only a concern for rendering when SB on left. */ #define PGTK_SCROLL_BAR_ADJUST(w, f) \ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) ? \ (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f) \ - PGTK_SCROLL_BAR_WIDTH (f)) : 0) /* Difference btwn char-line-calculated and actual SB heights. This is only a concern for rendering when SB on top. */ #define PGTK_SCROLL_BAR_ADJUST_HORIZONTALLY(w, f) \ (WINDOW_HAS_HORIZONTAL_SCROLL_BARS (w) ? \ (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f) \ - PGTK_SCROLL_BAR_HEIGHT (f)) : 0) #define FRAME_MENUBAR_HEIGHT(f) (FRAME_X_OUTPUT(f)->menubar_height) /* Calculate system coordinates of the left and top of the parent window or, if there is no parent window, the screen. */ #define PGTK_PARENT_WINDOW_LEFT_POS(f) \ (FRAME_PARENT_FRAME (f) != NULL \ ? [[FRAME_PGTK_VIEW (f) window] parentWindow].frame.origin.x : 0) #define PGTK_PARENT_WINDOW_TOP_POS(f) \ (FRAME_PARENT_FRAME (f) != NULL \ ? ([[FRAME_PGTK_VIEW (f) window] parentWindow].frame.origin.y \ + [[FRAME_PGTK_VIEW (f) window] parentWindow].frame.size.height \ - FRAME_PGTK_TITLEBAR_HEIGHT (FRAME_PARENT_FRAME (f))) \ : [[[PGTKScreen screepgtk] objectAtIndex: 0] frame].size.height) #define FRAME_PGTK_FONT_TABLE(f) (FRAME_DISPLAY_INFO (f)->font_table) #define FRAME_TOOLBAR_TOP_HEIGHT(f) ((f)->output_data.pgtk->toolbar_top_height) #define FRAME_TOOLBAR_BOTTOM_HEIGHT(f) \ ((f)->output_data.pgtk->toolbar_bottom_height) #define FRAME_TOOLBAR_HEIGHT(f) \ (FRAME_TOOLBAR_TOP_HEIGHT (f) + FRAME_TOOLBAR_BOTTOM_HEIGHT (f)) #define FRAME_TOOLBAR_LEFT_WIDTH(f) ((f)->output_data.pgtk->toolbar_left_width) #define FRAME_TOOLBAR_RIGHT_WIDTH(f) ((f)->output_data.pgtk->toolbar_right_width) #define FRAME_TOOLBAR_WIDTH(f) \ (FRAME_TOOLBAR_LEFT_WIDTH (f) + FRAME_TOOLBAR_RIGHT_WIDTH (f)) #define FRAME_FONTSET(f) (FRAME_X_OUTPUT(f)->fontset) #define FRAME_BASELINE_OFFSET(f) (FRAME_X_OUTPUT(f)->baseline_offset) #define BLACK_PIX_DEFAULT(f) 0x000000 #define WHITE_PIX_DEFAULT(f) 0xFFFFFF /* First position where characters can be shown (instead of scrollbar, if it is on left. */ #define FIRST_CHAR_POSITION(f) \ (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \ : FRAME_SCROLL_BAR_COLS (f)) /* Display init/shutdown functions implemented in pgtkterm.c */ extern struct pgtk_display_info *pgtk_term_init (Lisp_Object display_name, char *resource_name); extern void pgtk_term_shutdown (int sig); /* Implemented in pgtkterm, published in or needed from pgtkfns. */ extern void pgtk_clear_frame (struct frame *f); extern char *pgtk_xlfd_to_fontname (const char *xlfd); /* Implemented in pgtkfns. */ extern void pgtk_set_doc_edited (void); extern const char *pgtk_get_defaults_value (const char *key); extern const char *pgtk_get_string_resource (XrmDatabase rdb, const char *name, const char *class); extern void pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval); extern void pgtk_set_inhibit_double_buffering (struct frame *f, Lisp_Object new_value, Lisp_Object old_value); /* Color management implemented in pgtkterm. */ extern bool pgtk_defined_color (struct frame *f, const char *name, Emacs_Color *color_def, bool alloc, bool makeIndex); extern void pgtk_query_color (struct frame *f, Emacs_Color *color); extern void pgtk_query_colors (struct frame *f, Emacs_Color *colors, int ncolors); extern int pgtk_parse_color (const char *color_name, Emacs_Color *color); extern int pgtk_lisp_to_color (Lisp_Object color, Emacs_Color *col); /* Implemented in pgtkterm.c */ extern void pgtk_clear_area (struct frame *f, int x, int y, int width, int height); extern int pgtk_gtk_to_emacs_modifiers (struct pgtk_display_info *dpyinfo, int state); extern void pgtk_clear_under_internal_border (struct frame *f); extern void pgtk_set_event_handler(struct frame *f); /* Implemented in pgtkterm.c */ extern int x_display_pixel_height (struct pgtk_display_info *); extern int x_display_pixel_width (struct pgtk_display_info *); /* Implemented in pgtkterm.c */ extern void x_destroy_window (struct frame *f); extern void x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_value); extern void x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value); extern void x_set_no_accept_focus (struct frame *f, Lisp_Object new_value, Lisp_Object old_value); extern void x_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value); extern int pgtk_select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timespec *timeout, sigset_t *sigmask); /* Cairo related functions implemented in pgtkterm.c */ extern void pgtk_cr_update_surface_desired_size (struct frame *, int, int); extern cairo_t *pgtk_begin_cr_clip (struct frame *f); extern void pgtk_end_cr_clip (struct frame *f); extern void pgtk_set_cr_source_with_gc_foreground (struct frame *f, Emacs_GC *gc); extern void pgtk_set_cr_source_with_gc_background (struct frame *f, Emacs_GC *gc); extern void pgtk_set_cr_source_with_color (struct frame *f, unsigned long color); extern void pgtk_cr_draw_frame (cairo_t *cr, struct frame *f); extern void pgtk_cr_destroy_surface(struct frame *f); /* Defined in pgtkmenu.c */ extern Lisp_Object pgtk_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents); extern Lisp_Object pgtk_dialog_show (struct frame *f, Lisp_Object title, Lisp_Object header, const char **error); extern void initialize_frame_menubar (struct frame *); /* Symbol initializations implemented in each pgtk sources. */ extern void syms_of_pgtkterm (void); extern void syms_of_pgtkfns (void); extern void syms_of_pgtkmenu (void); extern void syms_of_pgtkselect (void); extern void syms_of_pgtkim (void); /* Implemented in pgtkselect. */ extern void nxatoms_of_pgtkselect (void); /* Initialization and marking implemented in pgtkterm.c */ extern void init_pgtkterm (void); extern void mark_pgtkterm(void); extern void pgtk_delete_terminal (struct terminal *terminal); extern void pgtk_make_frame_visible (struct frame *f); extern void pgtk_make_frame_invisible (struct frame *f); extern void x_wm_set_size_hint (struct frame *, long, bool); extern void x_free_frame_resources (struct frame *); extern void pgtk_iconify_frame (struct frame *f); extern void pgtk_focus_frame (struct frame *f, bool noactivate); extern void pgtk_set_scroll_bar_default_width (struct frame *f); extern void pgtk_set_scroll_bar_default_height (struct frame *f); extern Lisp_Object x_get_focus_frame (struct frame *frame); extern void pgtk_frame_rehighlight (struct pgtk_display_info *dpyinfo); extern void x_change_tab_bar_height (struct frame *, int); extern struct pgtk_display_info *check_pgtk_display_info (Lisp_Object object); extern void pgtk_enqueue_string(struct frame *f, gchar *str); extern void pgtk_enqueue_preedit(struct frame *f, Lisp_Object image_data); extern void pgtk_im_init(struct pgtk_display_info *dpyinfo); extern void pgtk_im_finish(struct pgtk_display_info *dpyinfo); /* Utility functions for child frames defined in pgtkterm.c */ extern void pgtk_child_frame_reposition (struct frame *child_frame, gpointer ignored); extern void pgtk_child_frame_flush (struct frame *parent); extern void pgtk_child_frame_flush_2 (gpointer child, gpointer userdata); extern void pgtk_clear_child_occourences (struct frame *child); extern int pgtk_get_window_inside_decor_height (struct frame *f); extern int pgtk_get_window_decoration_width (struct frame *f); /* Utility functions */ extern int pgtk_get_title_bar_height (struct frame *f); extern void evq_enqueue (union buffered_input_event *ev); extern void pgtk_m_px_pos (struct frame *f, double *_x, double *_y); #ifdef HAVE_GTK4 extern gboolean key_press_event (GtkWidget *widget, GdkEvent *event, struct frame *f); #endif extern void pgtk_vpixoffset_scroll (int pixels, struct window *window); extern int pgtk_lisp_to_color_with_frame (Lisp_Object color, Emacs_Color *col, struct frame *f); #endif /* HAVE_PGTK */ #endif /* __PGTKTERM_H */