From: Yuuki Harano Date: Fri, 3 May 2019 08:20:47 +0000 (+0900) Subject: Cleanup x_* to gui_ to match upstream work X-Git-Tag: emacs-29.0.90~3851 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=12cc104cd54dd80a9bc1d391a256de49f4b77077;p=emacs.git Cleanup x_* to gui_ to match upstream work * ../src/pgtkterm.h (struct pgtk_display_info): * ../src/pgtkterm.c (mark_pgtkterm, x_free_frame_resources) (pgtk_update_window_end, pgtk_mouse_position) (pgtk_redisplay_interface, pgtk_query_frame_background_color) (pgtk_delete_terminal, pgtk_create_terminal) (pgtk_query_frame_background_color, frame_highlight) (motion_notify_event, button_event, scroll_event): * ../src/pgtkfns.c (x_set_cursor_color, x_icon) (pgtk_frame_parm_handlers, x_default_font_parameter) (Fx_create_frame): "for the time being, commit" -- rename x->gui, frame_X_X(f) macros ひとまず commit。 --- diff --git a/src/pgtkfns.c b/src/pgtkfns.c index dd450a40bf9..ce702028348 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -234,8 +234,8 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (FRAME_VISIBLE_P (f)) { - x_update_cursor (f, false); - x_update_cursor (f, true); + gui_update_cursor (f, false); + gui_update_cursor (f, true); } } @@ -349,7 +349,7 @@ x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) name; names set this way will never override names set by the user's lisp code. */ void -x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) +pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { PGTK_TRACE ("x_implicitly_set_name"); @@ -643,8 +643,8 @@ x_icon (struct frame *f, Lisp_Object parms) FRAME_X_OUTPUT(f)->icon_left = -1; /* Set the position of the icon. */ - icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); - icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); + icon_x = gui_display_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); + icon_y = gui_display_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) { CHECK_NUMBER (icon_x); @@ -715,11 +715,11 @@ x_set_override_redirect (struct frame *f, Lisp_Object new_value, Lisp_Object old { /* Here (xfwm) override_redirect can be changed for invisible frames only. */ - x_make_frame_invisible (f); + pgtk_make_frame_invisible (f); xg_set_override_redirect (f, new_value); - x_make_frame_visible (f); + pgtk_make_frame_visible (f); FRAME_OVERRIDE_REDIRECT (f) = !NILP (new_value); } } @@ -727,41 +727,41 @@ x_set_override_redirect (struct frame *f, Lisp_Object new_value, Lisp_Object old /* Note: see frame.c for template, also where generic functions are impl */ frame_parm_handler pgtk_frame_parm_handlers[] = { - x_set_autoraise, /* generic OK */ - x_set_autolower, /* generic OK */ + gui_set_autoraise, /* generic OK */ + gui_set_autolower, /* generic OK */ x_set_background_color, 0, /* x_set_border_color, may be impossible under Nextstep */ 0, /* x_set_border_width, may be impossible under Nextstep */ x_set_cursor_color, x_set_cursor_type, - x_set_font, /* generic OK */ + gui_set_font, /* generic OK */ x_set_foreground_color, x_set_icon_name, x_set_icon_type, x_set_internal_border_width, /* generic OK */ - x_set_right_divider_width, - x_set_bottom_divider_width, + gui_set_right_divider_width, + gui_set_bottom_divider_width, x_set_menu_bar_lines, x_set_mouse_color, x_explicitly_set_name, - x_set_scroll_bar_width, /* generic OK */ - x_set_scroll_bar_height, /* generic OK */ + gui_set_scroll_bar_width, /* generic OK */ + gui_set_scroll_bar_height, /* generic OK */ x_set_title, - x_set_unsplittable, /* generic OK */ - x_set_vertical_scroll_bars, /* generic OK */ - x_set_horizontal_scroll_bars, /* generic OK */ - x_set_visibility, /* generic OK */ + gui_set_unsplittable, /* generic OK */ + gui_set_vertical_scroll_bars, /* generic OK */ + gui_set_horizontal_scroll_bars, /* generic OK */ + gui_set_visibility, /* generic OK */ x_set_tool_bar_lines, 0, /* x_set_scroll_bar_foreground, will ignore (not possible on NS) */ 0, /* x_set_scroll_bar_background, will ignore (not possible on NS) */ - x_set_screen_gamma, /* generic OK */ - x_set_line_spacing, /* generic OK, sets f->extra_line_spacing to int */ - x_set_left_fringe, /* generic OK */ - x_set_right_fringe, /* generic OK */ + gui_set_screen_gamma, /* generic OK */ + gui_set_line_spacing, /* generic OK, sets f->extra_line_spacing to int */ + gui_set_left_fringe, /* generic OK */ + gui_set_right_fringe, /* generic OK */ 0, /* x_set_wait_for_wm, will ignore */ - x_set_fullscreen, /* generic OK */ - x_set_font_backend, /* generic OK */ - x_set_alpha, + gui_set_fullscreen, /* generic OK */ + gui_set_font_backend, /* generic OK */ + gui_set_alpha, 0, /* x_set_sticky */ 0, /* x_set_tool_bar_position */ 0, /* x_set_inhibit_double_buffering */ @@ -772,7 +772,7 @@ frame_parm_handler pgtk_frame_parm_handlers[] = x_set_no_accept_focus, x_set_z_group, x_set_override_redirect, - x_set_no_special_glyphs, + gui_set_no_special_glyphs, }; @@ -846,7 +846,7 @@ static void x_default_font_parameter (struct frame *f, Lisp_Object parms) { struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); - Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, + Lisp_Object font_param = gui_display_get_arg (dpyinfo, parms, Qfont, NULL, NULL, RES_TYPE_STRING); Lisp_Object font = Qnil; if (EQ (font_param, Qunbound)) @@ -864,7 +864,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) if (NILP (font)) font = !NILP (font_param) ? font_param - : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); + : gui_display_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); if (! FONTP (font) && ! STRINGP (font)) { @@ -898,11 +898,11 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) /* Remember the explicit font parameter, so we can re-apply it after we've applied the `default' face settings. */ AUTO_FRAME_ARG (arg, Qfont_parameter, font_param); - x_set_frame_parameters (f, arg); + gui_set_frame_parameters (f, arg); } /* This call will make X resources override any system font setting. */ - x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); + gui_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); } /* ========================================================================== @@ -942,9 +942,9 @@ This function is an internal primitive--use `make-frame' instead. */) until we know if this frame has a specified name. */ Vx_resource_name = Vinvocation_name; - display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER); + display = gui_display_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER); if (EQ (display, Qunbound)) - display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING); + display = gui_display_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING); if (EQ (display, Qunbound)) display = Qnil; dpyinfo = check_pgtk_display_info (display); @@ -953,7 +953,7 @@ This function is an internal primitive--use `make-frame' instead. */) if (!dpyinfo->terminal->name) error ("Terminal is not live, can't create new frames on it"); - name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); + name = gui_display_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); if (!STRINGP (name) && ! EQ (name, Qunbound) && ! NILP (name)) @@ -963,14 +963,14 @@ This function is an internal primitive--use `make-frame' instead. */) Vx_resource_name = name; /* See if parent window is specified. */ - parent = x_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); + parent = gui_display_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); if (EQ (parent, Qunbound)) parent = Qnil; if (! NILP (parent)) CHECK_NUMBER (parent); frame = Qnil; - tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", + tem = gui_display_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", RES_TYPE_SYMBOL); if (EQ (tem, Qnone) || NILP (tem)) f = make_frame_without_minibuffer (Qnil, kb, display); @@ -984,7 +984,7 @@ This function is an internal primitive--use `make-frame' instead. */) else f = make_frame (true); - parent_frame = x_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL, + parent_frame = gui_display_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL, RES_TYPE_SYMBOL); /* Accept parent-frame iff parent-id was not specified. */ if (!NILP (parent) @@ -998,7 +998,7 @@ This function is an internal primitive--use `make-frame' instead. */) fset_parent_frame (f, parent_frame); store_frame_param (f, Qparent_frame, parent_frame); - if (!NILP (tem = (x_get_arg (dpyinfo, parms, Qundecorated, NULL, NULL, + if (!NILP (tem = (gui_display_get_arg (dpyinfo, parms, Qundecorated, NULL, NULL, RES_TYPE_BOOLEAN))) && !(EQ (tem, Qunbound))) undecorated = true; @@ -1006,7 +1006,7 @@ This function is an internal primitive--use `make-frame' instead. */) FRAME_UNDECORATED (f) = undecorated; store_frame_param (f, Qundecorated, undecorated ? Qt : Qnil); - if (!NILP (tem = (x_get_arg (dpyinfo, parms, Qoverride_redirect, NULL, NULL, + if (!NILP (tem = (gui_display_get_arg (dpyinfo, parms, Qoverride_redirect, NULL, NULL, RES_TYPE_BOOLEAN))) && !(EQ (tem, Qunbound))) override_redirect = true; @@ -1032,7 +1032,7 @@ This function is an internal primitive--use `make-frame' instead. */) FRAME_X_OUTPUT(f)->black_relief.pixel = -1; fset_icon_name (f, - x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", + gui_display_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING)); if (! STRINGP (f->icon_name)) fset_icon_name (f, Qnil); @@ -1113,7 +1113,7 @@ This function is an internal primitive--use `make-frame' instead. */) #endif /* GLYPH_DEBUG */ #endif - x_default_parameter (f, parms, Qfont_backend, Qnil, + gui_default_parameter (f, parms, Qfont_backend, Qnil, "fontBackend", "FontBackend", RES_TYPE_STRING); /* Extract the window parameters from the supplied values @@ -1129,7 +1129,7 @@ This function is an internal primitive--use `make-frame' instead. */) #if 0 if (! FRAME_X_EMBEDDED_P (f)) #endif - x_default_parameter (f, parms, Qborder_width, make_fixnum (0), + gui_default_parameter (f, parms, Qborder_width, make_fixnum (0), "borderWidth", "BorderWidth", RES_TYPE_NUMBER); /* This defaults to 1 in order to match xterm. We recognize either @@ -1139,45 +1139,45 @@ This function is an internal primitive--use `make-frame' instead. */) { Lisp_Object value; - value = x_get_arg (dpyinfo, parms, Qinternal_border_width, + value = gui_display_get_arg (dpyinfo, parms, Qinternal_border_width, "internalBorder", "internalBorder", RES_TYPE_NUMBER); if (! EQ (value, Qunbound)) parms = Fcons (Fcons (Qinternal_border_width, value), parms); } - x_default_parameter (f, parms, Qinternal_border_width, + gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (0), "internalBorderWidth", "internalBorderWidth", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qright_divider_width, make_fixnum (0), + gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0), NULL, NULL, RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0), + gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0), NULL, NULL, RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qvertical_scroll_bars, + gui_default_parameter (f, parms, Qvertical_scroll_bars, Qright, "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil, + gui_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil, "horizontalScrollBars", "ScrollBars", RES_TYPE_SYMBOL); /* Also do the stuff which must be set before the window exists. */ - x_default_parameter (f, parms, Qforeground_color, build_string ("black"), + gui_default_parameter (f, parms, Qforeground_color, build_string ("black"), "foreground", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qbackground_color, build_string ("white"), + gui_default_parameter (f, parms, Qbackground_color, build_string ("white"), "background", "Background", RES_TYPE_STRING); - x_default_parameter (f, parms, Qmouse_color, build_string ("black"), + gui_default_parameter (f, parms, Qmouse_color, build_string ("black"), "pointerColor", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qborder_color, build_string ("black"), + gui_default_parameter (f, parms, Qborder_color, build_string ("black"), "borderColor", "BorderColor", RES_TYPE_STRING); - x_default_parameter (f, parms, Qscreen_gamma, Qnil, + gui_default_parameter (f, parms, Qscreen_gamma, Qnil, "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); - x_default_parameter (f, parms, Qline_spacing, Qnil, + gui_default_parameter (f, parms, Qline_spacing, Qnil, "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qleft_fringe, Qnil, + gui_default_parameter (f, parms, Qleft_fringe, Qnil, "leftFringe", "LeftFringe", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qright_fringe, Qnil, + gui_default_parameter (f, parms, Qright_fringe, Qnil, "rightFringe", "RightFringe", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qno_special_glyphs, Qnil, + gui_default_parameter (f, parms, Qno_special_glyphs, Qnil, NULL, NULL, RES_TYPE_BOOLEAN); #if 0 @@ -1189,7 +1189,7 @@ This function is an internal primitive--use `make-frame' instead. */) "ScrollBarBackground", false); #endif - /* Init faces before x_default_parameter is called for the + /* Init faces before gui_default_parameter is called for the scroll-bar-width parameter because otherwise we end up in init_iterator with a null face cache, which should not happen. */ init_frame_faces (f); @@ -1206,10 +1206,10 @@ This function is an internal primitive--use `make-frame' instead. */) Also process `min-width' and `min-height' parameters right here because `frame-windows-min-size' needs them. */ - tem = x_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL, RES_TYPE_NUMBER); + tem = gui_display_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL, RES_TYPE_NUMBER); if (NUMBERP (tem)) store_frame_param (f, Qmin_width, tem); - tem = x_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL, RES_TYPE_NUMBER); + tem = gui_display_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL, RES_TYPE_NUMBER); if (NUMBERP (tem)) store_frame_param (f, Qmin_height, tem); adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f), @@ -1221,32 +1221,32 @@ This function is an internal primitive--use `make-frame' instead. */) here; they are processed specially at startup, and reflected in the values of the mode variables. */ - x_default_parameter (f, parms, Qmenu_bar_lines, + gui_default_parameter (f, parms, Qmenu_bar_lines, NILP (Vmenu_bar_mode) ? make_fixnum (0) : make_fixnum (1), NULL, NULL, RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qtool_bar_lines, + gui_default_parameter (f, parms, Qtool_bar_lines, NILP (Vtool_bar_mode) ? make_fixnum (0) : make_fixnum (1), NULL, NULL, RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qbuffer_predicate, Qnil, + gui_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qtitle, Qnil, + gui_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", RES_TYPE_STRING); - x_default_parameter (f, parms, Qwait_for_wm, Qt, + gui_default_parameter (f, parms, Qwait_for_wm, Qt, "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qtool_bar_position, + gui_default_parameter (f, parms, Qtool_bar_position, FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qinhibit_double_buffering, Qnil, + gui_default_parameter (f, parms, Qinhibit_double_buffering, Qnil, "inhibitDoubleBuffering", "InhibitDoubleBuffering", RES_TYPE_BOOLEAN); /* Compute the size of the X window. */ - window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height); + window_prompting = gui_figure_window_size (f, parms, true, &x_width, &x_height); - tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); + tem = gui_display_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); f->no_split = minibuffer_only || EQ (tem, Qt); #if 0 @@ -1292,22 +1292,22 @@ This function is an internal primitive--use `make-frame' instead. */) /* We need to do this after creating the X window, so that the icon-creation functions can say whose icon they're describing. */ - x_default_parameter (f, parms, Qicon_type, Qt, + gui_default_parameter (f, parms, Qicon_type, Qt, "bitmapIcon", "BitmapIcon", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qauto_raise, Qnil, + gui_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qauto_lower, Qnil, + gui_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qcursor_type, Qbox, + gui_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qscroll_bar_width, Qnil, + gui_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qscroll_bar_height, Qnil, + gui_default_parameter (f, parms, Qscroll_bar_height, Qnil, "scrollBarHeight", "ScrollBarHeight", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qalpha, Qnil, + gui_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", RES_TYPE_NUMBER); #if 0 @@ -1322,9 +1322,9 @@ This function is an internal primitive--use `make-frame' instead. */) } #endif - x_default_parameter (f, parms, Qno_focus_on_map, Qnil, + gui_default_parameter (f, parms, Qno_focus_on_map, Qnil, NULL, NULL, RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qno_accept_focus, Qnil, + gui_default_parameter (f, parms, Qno_accept_focus, Qnil, NULL, NULL, RES_TYPE_BOOLEAN); #if defined (USE_X_TOOLKIT) || defined (USE_GTK) @@ -1348,7 +1348,7 @@ This function is an internal primitive--use `make-frame' instead. */) #endif /* USE_X_TOOLKIT || USE_GTK */ /* Consider frame official, now. */ - f->can_x_set_window_size = true; + f->can_set_window_size = true; if (x_width > 0) SET_FRAME_WIDTH (f, x_width); @@ -1368,7 +1368,7 @@ This function is an internal primitive--use `make-frame' instead. */) /* Process fullscreen parameter here in the hope that normalizing a fullheight/fullwidth frame will produce the size set by the last adjust_frame_size call. */ - x_default_parameter (f, parms, Qfullscreen, Qnil, + gui_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); /* Make the window appear on the frame and enable display, unless @@ -1377,27 +1377,27 @@ This function is an internal primitive--use `make-frame' instead. */) if (!FRAME_X_OUTPUT(f)->explicit_parent) { Lisp_Object visibility - = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); + = gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); if (EQ (visibility, Qicon)) - x_iconify_frame (f); + pgtk_iconify_frame (f); else { if (EQ (visibility, Qunbound)) visibility = Qt; if (!NILP (visibility)) - x_make_frame_visible (f); + pgtk_make_frame_visible (f); } store_frame_param (f, Qvisibility, visibility); } /* Works iff frame has been already mapped. */ - x_default_parameter (f, parms, Qskip_taskbar, Qnil, + gui_default_parameter (f, parms, Qskip_taskbar, Qnil, NULL, NULL, RES_TYPE_BOOLEAN); /* The `z-group' parameter works only for visible frames. */ - x_default_parameter (f, parms, Qz_group, Qnil, + gui_default_parameter (f, parms, Qz_group, Qnil, NULL, NULL, RES_TYPE_SYMBOL); /* Initialize `default-minibuffer-frame' in case this is the first @@ -1408,7 +1408,7 @@ This function is an internal primitive--use `make-frame' instead. */) kset_default_minibuffer_frame (kb, frame); /* All remaining specified parameters, which have not been "used" - by x_get_arg and friends, now go in the misc. alist of the frame. */ + by gui_display_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) fset_param_alist (f, Fcons (XCAR (tem), f->param_alist)); @@ -1809,7 +1809,7 @@ check_x_display_info (Lisp_Object frame) void -x_set_scroll_bar_default_width (struct frame *f) +pgtk_set_scroll_bar_default_width (struct frame *f) { int unit = FRAME_COLUMN_WIDTH (f); int minw = xg_get_default_scrollbar_width (f); @@ -1819,7 +1819,7 @@ x_set_scroll_bar_default_width (struct frame *f) } void -x_set_scroll_bar_default_height (struct frame *f) +pgtk_set_scroll_bar_default_height (struct frame *f) { int height = FRAME_LINE_HEIGHT (f); int min_height = xg_get_default_scrollbar_height (f); @@ -1829,8 +1829,8 @@ x_set_scroll_bar_default_height (struct frame *f) } /* terms impl this instead of x-get-resource directly */ -char * -x_get_string_resource (XrmDatabase rdb, const char *name, const char *class) +const char * +pgtk_get_string_resource (XrmDatabase rdb, const char *name, const char *class) { /* remove appname prefix; TODO: allow for !="Emacs" */ const char *res, *toCheck = class + (!strncmp (class, "Emacs.", 6) ? 6 : 0); @@ -2239,7 +2239,7 @@ x_hide_tip (bool delete) tip_frame = Qnil; } else - x_make_frame_invisible (XFRAME (tip_frame)); + pgtk_make_frame_invisible (XFRAME (tip_frame)); was_open = Qt; } diff --git a/src/pgtkgui.h b/src/pgtkgui.h index 78e1da77d8e..27e94b213d7 100644 --- a/src/pgtkgui.h +++ b/src/pgtkgui.h @@ -69,7 +69,7 @@ typedef int Window; typedef struct _GdkDisplay Display; /* Xism */ -typedef Lisp_Object XrmDatabase; +typedef void *XrmDatabase; /* some sort of attempt to normalize rectangle handling.. seems a bit much diff --git a/src/pgtkterm.c b/src/pgtkterm.c index d84e3b1ae54..a380c11eb15 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -134,12 +134,12 @@ mark_pgtkterm(void) #if false /* marked in alloc.c:compact_font_caches() */ mark_object (dpyinfo->name_list_element); #endif - mark_object (dpyinfo->xrdb); + mark_object (dpyinfo->rdb); } } char * -x_get_keysym_name (int keysym) +get_keysym_name (int keysym) /* -------------------------------------------------------------------------- Called by keyboard.c. Not sure if the return val is important, except that it be unique. @@ -181,7 +181,7 @@ x_free_frame_resources (struct frame *f) do { if (f == dpyinfo->FIELD) dpyinfo->FIELD = 0; } while (false) CLEAR_IF_EQ(x_focus_frame); - CLEAR_IF_EQ(x_highlight_frame); + CLEAR_IF_EQ(highlight_frame); CLEAR_IF_EQ(x_focus_event_frame); CLEAR_IF_EQ(last_mouse_frame); CLEAR_IF_EQ(last_mouse_motion_frame); @@ -407,16 +407,16 @@ pgtk_set_window_size (struct frame *f, } void -x_iconify_frame (struct frame *f) +pgtk_iconify_frame (struct frame *f) /* -------------------------------------------------------------------------- External: Iconify window -------------------------------------------------------------------------- */ { - PGTK_TRACE("x_iconify_frame"); + PGTK_TRACE("pgtk_iconify_frame"); /* Don't keep the highlight on an invisible frame. */ - if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f) - FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0; + if (FRAME_DISPLAY_INFO (f)->highlight_frame == f) + FRAME_DISPLAY_INFO (f)->highlight_frame = 0; if (FRAME_ICONIFIED_P (f)) return; @@ -469,12 +469,12 @@ x_iconify_frame (struct frame *f) } void -x_make_frame_visible (struct frame *f) +pgtk_make_frame_visible (struct frame *f) /* -------------------------------------------------------------------------- External: Show the window (X11 semantics) -------------------------------------------------------------------------- */ { - PGTK_TRACE("x_make_frame_visible"); + PGTK_TRACE("pgtk_make_frame_visible"); #if 0 NSTRACE ("x_make_frame_visible"); /* XXX: at some points in past this was not needed, as the only place that @@ -523,12 +523,12 @@ x_make_frame_visible (struct frame *f) void -x_make_frame_invisible (struct frame *f) +pgtk_make_frame_invisible (struct frame *f) /* -------------------------------------------------------------------------- External: Hide the window (X11 semantics) -------------------------------------------------------------------------- */ { - PGTK_TRACE("x_make_frame_invisible"); + PGTK_TRACE("pgtk_make_frame_invisible"); #if 0 NSView *view; NSTRACE ("x_make_frame_invisible"); @@ -541,9 +541,9 @@ x_make_frame_invisible (struct frame *f) } static Lisp_Object -x_new_font (struct frame *f, Lisp_Object font_object, int fontset) +pgtk_new_font (struct frame *f, Lisp_Object font_object, int fontset) { - PGTK_TRACE("x_new_font"); + PGTK_TRACE("pgtk_new_font"); struct font *font = XFONT_OBJECT (font_object); int font_ascent, font_descent; @@ -730,7 +730,7 @@ pgtk_initialize_display_info (struct pgtk_display_info *dpyinfo) dpyinfo->color_p = 1; dpyinfo->n_planes = 32; dpyinfo->root_window = 42; /* a placeholder.. */ - dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL; + dpyinfo->highlight_frame = dpyinfo->x_focus_frame = NULL; dpyinfo->n_fonts = 0; dpyinfo->smallest_font_height = 1; dpyinfo->smallest_char_width = 1; @@ -2606,6 +2606,7 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, PGTK_TRACE("draw_window_cursor: %d, %d, %d, %d, %d, %d.", x, y, cursor_type, cursor_width, on_p, active_p); struct frame *f = XFRAME (WINDOW_FRAME (w)); + PGTK_TRACE("%p\n", f->output_data.pgtk); if (on_p) { @@ -2735,7 +2736,7 @@ pgtk_scroll_run (struct window *w, struct run *run) block_input (); /* Cursor off. Will be switched on again in x_update_window_end. */ - x_clear_cursor (w); + gui_clear_cursor (w); { cairo_rectangle_t src_rect = { x, from_y, width, height }; @@ -2913,9 +2914,9 @@ pgtk_update_window_end (struct window *w, bool cursor_on_p, if (draw_window_fringes (w, true)) { if (WINDOW_RIGHT_DIVIDER_WIDTH (w)) - x_draw_right_divider (w); + gui_draw_right_divider (w); else - x_draw_vertical_border (w); + gui_draw_vertical_border (w); } unblock_input (); @@ -2989,7 +2990,7 @@ pgtk_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, seat = gdk_display_get_default_seat(dpyinfo->gdpy); device = gdk_seat_get_pointer(seat); - if (x_mouse_grabbed (dpyinfo)) { + if (gui_mouse_grabbed (dpyinfo)) { GdkWindow *win; GdkModifierType mask; /* get x, y relative to edit window of f1. */ @@ -3279,18 +3280,18 @@ extern frame_parm_handler pgtk_frame_parm_handlers[]; static struct redisplay_interface pgtk_redisplay_interface = { pgtk_frame_parm_handlers, - x_produce_glyphs, - x_write_glyphs, - x_insert_glyphs, - x_clear_end_of_line, + gui_produce_glyphs, + gui_write_glyphs, + gui_insert_glyphs, + gui_clear_end_of_line, pgtk_scroll_run, pgtk_after_update_window_line, pgtk_update_window_begin, pgtk_update_window_end, pgtk_flush_display, - x_clear_window_mouse_face, - x_get_glyph_overhangs, - x_fix_overlapping_area, + gui_clear_window_mouse_face, + gui_get_glyph_overhangs, + gui_fix_overlapping_area, pgtk_draw_fringe_bitmap, pgtk_define_fringe_bitmap, pgtk_destroy_fringe_bitmap, @@ -3298,6 +3299,7 @@ static struct redisplay_interface pgtk_redisplay_interface = pgtk_draw_glyph_string, pgtk_define_frame_cursor, pgtk_clear_frame_area, + pgtk_clear_under_internal_border, pgtk_draw_window_cursor, pgtk_draw_vertical_window_border, pgtk_draw_window_divider, @@ -4275,7 +4277,7 @@ pgtk_delete_terminal (struct terminal *terminal) /* Normally, the display is available... */ if (dpyinfo->gdpy) { - x_destroy_all_bitmaps (dpyinfo); + image_destroy_all_bitmaps (dpyinfo); xg_display_close (dpyinfo->gdpy); @@ -4336,8 +4338,16 @@ pgtk_create_terminal (struct pgtk_display_info *dpyinfo) terminal->condemn_scroll_bars_hook = pgtk_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = pgtk_redeem_scroll_bar; terminal->judge_scroll_bars_hook = pgtk_judge_scroll_bars; + terminal->get_string_resource_hook = pgtk_get_string_resource; terminal->delete_frame_hook = x_destroy_window; terminal->delete_terminal_hook = pgtk_delete_terminal; + terminal->query_frame_background_color = pgtk_query_frame_background_color; + terminal->defined_color_hook = pgtk_defined_color; + terminal->set_new_font_hook = pgtk_new_font; + terminal->implicit_set_name_hook = pgtk_implicitly_set_name; + terminal->iconify_frame_hook = pgtk_iconify_frame; + terminal->set_scroll_bar_default_width_hook = pgtk_set_scroll_bar_default_width; + terminal->set_scroll_bar_default_height_hook = pgtk_set_scroll_bar_default_height; terminal->set_window_size_hook = pgtk_set_window_size; terminal->query_colors = pgtk_query_colors; terminal->get_focus_frame = x_get_focus_frame; @@ -5075,7 +5085,7 @@ frame_highlight (struct frame *f) x_uncatch_errors (); #endif unblock_input (); - x_update_cursor (f, true); + gui_update_cursor (f, true); #if 0 x_set_frame_alpha (f); #endif @@ -5097,7 +5107,7 @@ frame_unhighlight (struct frame *f) x_uncatch_errors (); #endif unblock_input (); - x_update_cursor (f, true); + gui_update_cursor (f, true); #if 0 x_set_frame_alpha (f); #endif @@ -5107,29 +5117,29 @@ frame_unhighlight (struct frame *f) static void x_frame_rehighlight (struct pgtk_display_info *dpyinfo) { - struct frame *old_highlight = dpyinfo->x_highlight_frame; + struct frame *old_highlight = dpyinfo->highlight_frame; if (dpyinfo->x_focus_frame) { - dpyinfo->x_highlight_frame + dpyinfo->highlight_frame = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))) ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)) : dpyinfo->x_focus_frame); - if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) + if (! FRAME_LIVE_P (dpyinfo->highlight_frame)) { fset_focus_frame (dpyinfo->x_focus_frame, Qnil); - dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame; + dpyinfo->highlight_frame = dpyinfo->x_focus_frame; } } else - dpyinfo->x_highlight_frame = 0; + dpyinfo->highlight_frame = 0; - if (dpyinfo->x_highlight_frame != old_highlight) + if (dpyinfo->highlight_frame != old_highlight) { if (old_highlight) frame_unhighlight (old_highlight); - if (dpyinfo->x_highlight_frame) - frame_highlight (dpyinfo->x_highlight_frame); + if (dpyinfo->highlight_frame) + frame_highlight (dpyinfo->highlight_frame); } } @@ -5376,7 +5386,7 @@ motion_notify_event(GtkWidget *widget, GdkEvent *event, gpointer *user_data) frame = pgtk_any_window_to_frame(gtk_widget_get_window(widget)); dpyinfo = FRAME_DISPLAY_INFO (frame); - f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame + f = (gui_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame : pgtk_any_window_to_frame(gtk_widget_get_window(widget))); hlinfo = MOUSE_HL_INFO (f); @@ -5545,7 +5555,7 @@ button_event(GtkWidget *widget, GdkEvent *event, gpointer *user_data) x_display_set_last_user_time (dpyinfo, event->button.time); #endif - if (x_mouse_grabbed (dpyinfo)) + if (gui_mouse_grabbed (dpyinfo)) f = dpyinfo->last_mouse_frame; else { @@ -5558,7 +5568,7 @@ button_event(GtkWidget *widget, GdkEvent *event, gpointer *user_data) into a parent frame with the child frame selected and `no-accept-focus' is not set, select the clicked frame. */ - struct frame *hf = dpyinfo->x_highlight_frame; + struct frame *hf = dpyinfo->highlight_frame; if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) { @@ -5635,7 +5645,7 @@ scroll_event(GtkWidget *widget, GdkEvent *event, gpointer *user_data) frame = pgtk_any_window_to_frame(gtk_widget_get_window(widget)); dpyinfo = FRAME_DISPLAY_INFO (frame); - if (x_mouse_grabbed (dpyinfo)) + if (gui_mouse_grabbed (dpyinfo)) f = dpyinfo->last_mouse_frame; else f = pgtk_any_window_to_frame(gtk_widget_get_window(widget)); diff --git a/src/pgtkterm.h b/src/pgtkterm.h index 6cd6da4ccb3..d14525e740c 100644 --- a/src/pgtkterm.h +++ b/src/pgtkterm.h @@ -168,7 +168,7 @@ struct pgtk_display_info Window root_window; /* Xism */ - XrmDatabase xrdb; + XrmDatabase rdb; /* The cursor to use for vertical scroll bars. */ Emacs_Cursor vertical_scroll_bar_cursor; @@ -180,7 +180,7 @@ struct pgtk_display_info mouse-face. */ Mouse_HLInfo mouse_highlight; - struct frame *x_highlight_frame; + struct frame *highlight_frame; struct frame *x_focus_frame; /* The last frame mentioned in a FocusIn or FocusOut event. This is @@ -384,6 +384,7 @@ enum /* 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) @@ -397,6 +398,7 @@ enum /* 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) @@ -500,6 +502,8 @@ 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); /* Color management implemented in pgtkterm. */ extern bool pgtk_defined_color (struct frame *f,