summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c474
1 files changed, 226 insertions, 248 deletions
diff --git a/src/xfns.c b/src/xfns.c
index ee3266e223d..c4bdb3f5cfb 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -978,7 +978,7 @@ xg_set_icon (struct frame *f, Lisp_Object file)
bool result = false;
Lisp_Object found;
- found = x_find_image_file (file);
+ found = image_find_image_file (file);
if (! NILP (found))
{
@@ -1021,7 +1021,7 @@ xg_set_icon_from_xpm_data (struct frame *f, const char **data)
#endif /* USE_GTK */
-/* Functions called only from `x_set_frame_param'
+/* Functions called only from `gui_set_frame_parameters'
to set individual parameters.
If FRAME_X_WINDOW (f) is 0,
@@ -1466,7 +1466,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
? f->icon_name
: f->name)));
else
- result = x_bitmap_icon (f, arg);
+ result = FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, arg);
if (result)
{
@@ -2115,7 +2115,8 @@ x_default_scroll_bar_color_parameter (struct frame *f,
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
Lisp_Object tem;
- tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING);
+ tem = gui_display_get_arg (dpyinfo, alist, prop, xprop, xclass,
+ RES_TYPE_STRING);
if (EQ (tem, Qunbound))
{
#ifdef USE_TOOLKIT_SCROLL_BARS
@@ -2125,7 +2126,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
AUTO_STRING (foreground, "foreground");
AUTO_STRING (background, "foreground");
AUTO_STRING (verticalScrollBar, "verticalScrollBar");
- tem = (display_x_get_resource
+ tem = (gui_display_get_resource
(dpyinfo, foreground_p ? foreground : background,
empty_unibyte_string,
verticalScrollBar,
@@ -2148,7 +2149,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
}
AUTO_FRAME_ARG (arg, prop, tem);
- x_set_frame_parameters (f, arg);
+ gui_set_frame_parameters (f, arg);
return tem;
}
@@ -3257,8 +3258,8 @@ x_icon_verify (struct frame *f, Lisp_Object parms)
/* Set the position of the icon. Note that twm groups all
icons in an icon window. */
- icon_x = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
- icon_y = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ icon_x = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
+ icon_y = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_FIXNUM (icon_x);
@@ -3278,9 +3279,9 @@ x_icon (struct frame *f, Lisp_Object parms)
/* Set the position of the icon. Note that twm groups all
icons in an icon window. */
Lisp_Object icon_x
- = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
+ = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
Lisp_Object icon_y
- = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_TYPE_RANGED_INTEGER (int, icon_x);
@@ -3294,12 +3295,13 @@ x_icon (struct frame *f, Lisp_Object parms)
if (! EQ (icon_x, Qunbound))
x_wm_set_icon_position (f, XFIXNUM (icon_x), XFIXNUM (icon_y));
-#if false /* x_get_arg removes the visibility parameter as a side effect,
- but x_create_frame still needs it. */
+#if false /* gui_display_get_arg removes the visibility parameter as a
+ side effect, but x_create_frame still needs it. */
/* Start up iconic or window? */
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
x_wm_set_window_state
- (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL),
+ (f, (EQ (gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL),
Qicon)
? IconicState
: NormalState));
@@ -3407,7 +3409,7 @@ x_free_gcs (struct frame *f)
/* Handler for signals raised during x_create_frame and
- x_create_tip_frame. FRAME is the frame which is partially
+ Fx_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
@@ -3417,7 +3419,7 @@ unwind_create_frame (Lisp_Object frame)
/* If frame is already dead, nothing to do. This can happen if the
display is disconnected after the frame has become official, but
- before x_create_frame removes the unwind protect. */
+ before Fx_create_frame removes the unwind protect. */
if (!FRAME_LIVE_P (f))
return Qnil;
@@ -3463,8 +3465,8 @@ static void
x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
- RES_TYPE_STRING);
+ 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))
font_param = Qnil;
@@ -3481,7 +3483,8 @@ 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))
{
@@ -3518,11 +3521,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);
}
@@ -3592,9 +3595,11 @@ 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_x_display_info (display);
@@ -3603,7 +3608,8 @@ 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))
@@ -3613,15 +3619,17 @@ 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_FIXNUM (parent);
frame = Qnil;
- tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer",
- RES_TYPE_SYMBOL);
+ 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);
else if (EQ (tem, Qonly))
@@ -3634,8 +3642,12 @@ 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,
- RES_TYPE_SYMBOL);
+ 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)
|| EQ (parent_frame, Qunbound)
@@ -3648,16 +3660,24 @@ 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,
- RES_TYPE_BOOLEAN)))
+ if (!NILP (tem = (gui_display_get_arg (dpyinfo,
+ parms,
+ Qundecorated,
+ NULL,
+ NULL,
+ RES_TYPE_BOOLEAN)))
&& !(EQ (tem, Qunbound)))
undecorated = true;
FRAME_UNDECORATED (f) = undecorated;
store_frame_param (f, Qundecorated, undecorated ? Qt : Qnil);
- if (!NILP (tem = (x_get_arg (dpyinfo, parms, Qoverride_redirect, NULL, NULL,
- RES_TYPE_BOOLEAN)))
+ if (!NILP (tem = (gui_display_get_arg (dpyinfo,
+ parms,
+ Qoverride_redirect,
+ NULL,
+ NULL,
+ RES_TYPE_BOOLEAN)))
&& !(EQ (tem, Qunbound)))
override_redirect = true;
@@ -3681,9 +3701,12 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.x->white_relief.pixel = -1;
f->output_data.x->black_relief.pixel = -1;
- fset_icon_name (f,
- x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
- RES_TYPE_STRING));
+ fset_icon_name (f, gui_display_get_arg (dpyinfo,
+ parms,
+ Qicon_name,
+ "iconName",
+ "Title",
+ RES_TYPE_STRING));
if (! STRINGP (f->icon_name))
fset_icon_name (f, Qnil);
@@ -3768,8 +3791,8 @@ This function is an internal primitive--use `make-frame' instead. */)
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
@@ -3782,8 +3805,8 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Frame contents get displaced if an embedded X window has a border. */
if (! FRAME_X_EMBEDDED_P (f))
- x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ 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
internalBorderWidth or internalBorder (which is what xterm calls
@@ -3792,54 +3815,55 @@ This function is an internal primitive--use `make-frame' instead. */)
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
- "internalBorder", "internalBorder", RES_TYPE_NUMBER);
+ 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,
#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
- make_fixnum (0),
+ make_fixnum (0),
#else
- make_fixnum (1),
+ make_fixnum (1),
#endif
- "internalBorderWidth", "internalBorderWidth",
- RES_TYPE_NUMBER);
- x_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),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qvertical_scroll_bars,
+ "internalBorderWidth", "internalBorderWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qvertical_scroll_bars,
#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
- Qright,
+ Qright,
#else
- Qleft,
+ Qleft,
#endif
- "verticalScrollBars", "ScrollBars",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
- "horizontalScrollBars", "ScrollBars",
- RES_TYPE_SYMBOL);
+ "verticalScrollBars", "ScrollBars",
+ RES_TYPE_SYMBOL);
+ 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"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qscreen_gamma, Qnil,
- "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
- x_default_parameter (f, parms, Qline_spacing, Qnil,
- "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qleft_fringe, Qnil,
- "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_fringe, Qnil,
- "rightFringe", "RightFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qscreen_gamma, Qnil,
+ "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
+ gui_default_parameter (f, parms, Qline_spacing, Qnil,
+ "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qleft_fringe, Qnil,
+ "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_fringe, Qnil,
+ "rightFringe", "RightFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
x_default_scroll_bar_color_parameter (f, parms, Qscroll_bar_foreground,
"scrollBarForeground",
@@ -3848,7 +3872,7 @@ This function is an internal primitive--use `make-frame' instead. */)
"scrollBarBackground",
"ScrollBarBackground", false);
- /* 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);
@@ -3865,10 +3889,12 @@ 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 (FIXNUMP (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 (FIXNUMP (tem))
store_frame_param (f, Qmin_height, tem);
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
@@ -3880,32 +3906,34 @@ 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,
- NILP (Vmenu_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
- x_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,
- "bufferPredicate", "BufferPredicate",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qtitle, Qnil,
- "title", "Title", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qwait_for_wm, Qt,
- "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
- x_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,
- "inhibitDoubleBuffering", "InhibitDoubleBuffering",
- RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
+ gui_default_parameter (f, parms, Qbuffer_predicate, Qnil,
+ "bufferPredicate", "BufferPredicate",
+ RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qtitle, Qnil,
+ "title", "Title", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qwait_for_wm, Qt,
+ "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qtool_bar_position,
+ FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL);
+ 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);
x_icon_verify (f, parms);
@@ -3927,23 +3955,23 @@ 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,
- "bitmapIcon", "BitmapIcon", RES_TYPE_BOOLEAN);
-
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
- "scrollBarWidth", "ScrollBarWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qscroll_bar_height, Qnil,
- "scrollBarHeight", "ScrollBarHeight",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qicon_type, Qt,
+ "bitmapIcon", "BitmapIcon", RES_TYPE_BOOLEAN);
+
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qscroll_bar_height, Qnil,
+ "scrollBarHeight", "ScrollBarHeight",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
if (!NILP (parent_frame))
{
@@ -3955,10 +3983,10 @@ This function is an internal primitive--use `make-frame' instead. */)
unblock_input ();
}
- x_default_parameter (f, parms, Qno_focus_on_map, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qno_accept_focus, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qno_focus_on_map, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qno_accept_focus, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
/* Create the menu bar. */
@@ -3979,7 +4007,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);
@@ -3999,8 +4027,8 @@ 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,
- "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qfullscreen, Qnil,
+ "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
/* Make the window appear on the frame and enable display, unless
the caller says not to. However, with explicit parent, Emacs
@@ -4008,7 +4036,8 @@ This function is an internal primitive--use `make-frame' instead. */)
if (!f->output_data.x->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);
@@ -4043,11 +4072,11 @@ This function is an internal primitive--use `make-frame' instead. */)
unblock_input ();
/* Works iff frame has been already mapped. */
- x_default_parameter (f, parms, Qskip_taskbar, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ 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,
- NULL, NULL, RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qz_group, Qnil,
+ NULL, NULL, RES_TYPE_SYMBOL);
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
@@ -4056,8 +4085,9 @@ This function is an internal primitive--use `make-frame' instead. */)
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
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. */
+ /* All remaining specified parameters, which have not been "used" 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));
@@ -4069,60 +4099,6 @@ This function is an internal primitive--use `make-frame' instead. */)
return unbind_to (count, frame);
}
-
-/* FRAME is used only to get a handle on the X display. We don't pass the
- display info directly because we're called from frame.c, which doesn't
- know about that structure. */
-
-Lisp_Object
-x_get_focus_frame (struct frame *frame)
-{
- struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
- Lisp_Object xfocus;
- if (! dpyinfo->x_focus_frame)
- return Qnil;
-
- XSETFRAME (xfocus, dpyinfo->x_focus_frame);
- return xfocus;
-}
-
-
-/* In certain situations, when the window manager follows a
- click-to-focus policy, there seems to be no way around calling
- XSetInputFocus to give another frame the input focus .
-
- In an ideal world, XSetInputFocus should generally be avoided so
- that applications don't interfere with the window manager's focus
- policy. But I think it's okay to use when it's clearly done
- following a user-command. */
-
-void
-x_focus_frame (struct frame *f, bool noactivate)
-{
- Display *dpy = FRAME_X_DISPLAY (f);
-
- block_input ();
- x_catch_errors (dpy);
-
- if (FRAME_X_EMBEDDED_P (f))
- {
- /* For Xembedded frames, normally the embedder forwards key
- events. See XEmbed Protocol Specification at
- http://freedesktop.org/wiki/Specifications/xembed-spec */
- xembed_request_focus (f);
- }
- else
- {
- XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- RevertToParent, CurrentTime);
- if (!noactivate)
- x_ewmh_activate_frame (f);
- }
-
- x_uncatch_errors ();
- unblock_input ();
-}
-
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p'.
@@ -5529,8 +5505,8 @@ select_visual (struct x_display_info *dpyinfo)
/* See if a visual is specified. */
AUTO_STRING (visualClass, "visualClass");
AUTO_STRING (VisualClass, "VisualClass");
- Lisp_Object value = display_x_get_resource (dpyinfo, visualClass,
- VisualClass, Qnil, Qnil);
+ Lisp_Object value = gui_display_get_resource (dpyinfo, visualClass,
+ VisualClass, Qnil, Qnil);
if (STRINGP (value))
{
@@ -6116,7 +6092,7 @@ unwind_create_tip_frame (Lisp_Object frame)
PARMS is a list of frame parameters. TEXT is the string to
display in the tip frame. Value is the frame.
- Note that functions called here, esp. x_default_parameter can
+ Note that functions called here, esp. gui_default_parameter can
signal errors, for instance when a specified color name is
undefined. We have to make sure that we're in a consistent state
when this happens. */
@@ -6138,7 +6114,8 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
parms = Fcopy_alist (parms);
/* Get the name of the frame to use for resource lookup. */
- 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))
@@ -6239,15 +6216,15 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values that are
needed to determine window geometry. */
x_default_font_parameter (f, parms);
- x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
+ "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 2 in order to match xterm. We recognize either
internalBorderWidth or internalBorder (which is what xterm calls
@@ -6256,43 +6233,44 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
- "internalBorder", "internalBorder", RES_TYPE_NUMBER);
+ 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, make_fixnum (1),
- "internalBorderWidth", "internalBorderWidth",
- RES_TYPE_NUMBER);
- x_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),
- NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (1),
+ "internalBorderWidth", "internalBorderWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
/* Also do the stuff which must be set before the window exists. */
- x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
- "cursorColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
-
- /* Init faces before x_default_parameter is called for the
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qcursor_color, build_string ("black"),
+ "cursorColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+
+ /* 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);
f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
- x_figure_window_size (f, parms, false, &x_width, &x_height);
+ gui_figure_window_size (f, parms, false, &x_width, &x_height);
{
XSetWindowAttributes attrs;
@@ -6335,14 +6313,14 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
x_make_gc (f);
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
/* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
@@ -6413,7 +6391,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
and similar will set face_change, which leads to the clearing of
@@ -7599,41 +7577,41 @@ visible. */)
frame_parm_handler x_frame_parm_handlers[] =
{
- x_set_autoraise,
- x_set_autolower,
+ gui_set_autoraise,
+ gui_set_autolower,
x_set_background_color,
x_set_border_color,
- x_set_border_width,
+ gui_set_border_width,
x_set_cursor_color,
x_set_cursor_type,
- x_set_font,
+ gui_set_font,
x_set_foreground_color,
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width,
- 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,
- x_set_scroll_bar_height,
+ gui_set_scroll_bar_width,
+ gui_set_scroll_bar_height,
x_set_title,
- x_set_unsplittable,
- x_set_vertical_scroll_bars,
- x_set_horizontal_scroll_bars,
- x_set_visibility,
+ gui_set_unsplittable,
+ gui_set_vertical_scroll_bars,
+ gui_set_horizontal_scroll_bars,
+ gui_set_visibility,
x_set_tool_bar_lines,
x_set_scroll_bar_foreground,
x_set_scroll_bar_background,
- x_set_screen_gamma,
- x_set_line_spacing,
- x_set_left_fringe,
- x_set_right_fringe,
+ gui_set_screen_gamma,
+ gui_set_line_spacing,
+ gui_set_left_fringe,
+ gui_set_right_fringe,
x_set_wait_for_wm,
- x_set_fullscreen,
- x_set_font_backend,
- x_set_alpha,
+ gui_set_fullscreen,
+ gui_set_font_backend,
+ gui_set_alpha,
x_set_sticky,
x_set_tool_bar_position,
x_set_inhibit_double_buffering,
@@ -7644,7 +7622,7 @@ frame_parm_handler x_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,
};
void