/* Generic frame functions.
- Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2006,
+ 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <stdio.h>
#include "lisp.h"
-#include "charset.h"
+#include "character.h"
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
#endif
#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
/* The name we're using in resource queries. Most often "emacs". */
Lisp_Object Vx_resource_name;
#endif
f->size_hint_flags = 0;
f->win_gravity = 0;
+#ifdef USE_FONT_BACKEND
+ f->font_driver_list = NULL;
+#endif /* USE_FONT_BACKEND */
root_window = make_window ();
if (mini_p)
If MINIBUF is 0, include all visible and iconified frames.
Otherwise, include all frames. */
-Lisp_Object
+static Lisp_Object
next_frame (frame, minibuf)
Lisp_Object frame;
Lisp_Object minibuf;
If MINIBUF is 0, include all visible and iconified frames.
Otherwise, include all frames. */
-Lisp_Object
+static Lisp_Object
prev_frame (frame, minibuf)
Lisp_Object frame;
Lisp_Object minibuf;
a surrogate minibuffer frame when a frame doesn't have its own
minibuffer window.
-A frame's focus redirection can be changed by select-frame. If frame
+A frame's focus redirection can be changed by `select-frame'. If frame
FOO is selected, and then a different frame BAR is selected, any
frames redirecting their focus to FOO are shifted to redirect their
focus to BAR. This allows focus redirection to work properly when the
This means that a frame whose focus is redirected to itself is treated
differently from a frame whose focus is redirected to nil; the former
-is affected by select-frame, while the latter is not.
+is affected by `select-frame', while the latter is not.
The redirection lasts until `redirect-frame-focus' is called to change it. */)
(frame, focus_frame)
static int
frame_name_fnn_p (str, len)
char *str;
- int len;
+ EMACS_INT len;
{
if (len > 1 && str[0] == 'F')
{
/* Set the name of the terminal frame. Also used by MSDOS frames.
Modeled after x_set_name which is used for WINDOW frames. */
-void
+static void
set_term_frame_name (f, name)
struct frame *f;
Lisp_Object name;
Lisp_Object frame;
int old_fontset = FRAME_FONTSET(f);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ fontset_name = result = x_new_fontset2 (f, arg);
+ else
+ {
+#endif /* USE_FONT_BACKEND */
CHECK_STRING (arg);
fontset_name = Fquery_fontset (arg, Qnil);
BLOCK_INPUT;
result = (STRINGP (fontset_name)
- ? x_new_fontset (f, SDATA (fontset_name))
- : x_new_font (f, SDATA (arg)));
+ ? x_new_fontset (f, fontset_name)
+ : x_new_fontset (f, arg));
UNBLOCK_INPUT;
+#ifdef USE_FONT_BACKEND
+ }
+#endif
if (EQ (result, Qnil))
error ("Font `%s' is not defined", SDATA (arg));
else if (EQ (result, Qt))
- error ("The characters of the given font have varying widths");
+ error ("The default fontset can't be used for a frame font");
else if (STRINGP (result))
{
set_default_ascii_font (result);
if (old_fontset == FRAME_FONTSET (f))
return;
}
- else if (!NILP (Fequal (result, oldval)))
+ store_frame_param (f, Qfont, result);
+
+ if (!NILP (Fequal (result, oldval)))
return;
- store_frame_param (f, Qfont, result);
+ /* Recalculate toolbar height. */
+ f->n_tool_bar_rows = 0;
+ /* Ensure we redraw it. */
+ clear_current_matrices (f);
+
recompute_basic_faces (f);
}
else
#ifndef MAC_OS
if (FRAME_X_WINDOW (f) != 0)
- error ("Cannot change the border width of a window");
+ error ("Cannot change the border width of a frame");
#endif /* MAC_TODO */
f->border_width = XINT (arg);
register Lisp_Object tem;
tem = Fassq (param, alist);
- if (EQ (tem, Qnil))
+
+ if (!NILP (tem))
+ {
+ /* If we find this parm in ALIST, clear it out
+ so that it won't be "left over" at the end. */
+#ifndef WINDOWSNT /* w32fns.c has not yet been changed to cope with this. */
+ Lisp_Object tail;
+ XSETCAR (tem, Qnil);
+ /* In case the parameter appears more than once in the alist,
+ clear it out. */
+ for (tail = alist; CONSP (tail); tail = XCDR (tail))
+ if (CONSP (XCAR (tail))
+ && EQ (XCAR (XCAR (tail)), param))
+ XSETCAR (XCAR (tail), Qnil);
+#endif
+ }
+ else
tem = Fassq (param, Vdefault_frame_alist);
+
+ /* If it wasn't specified in ALIST or the Lisp-level defaults,
+ look in the X resources. */
if (EQ (tem, Qnil))
{
if (attribute)
value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param,
attribute, class, type);
- if (! NILP (value))
+ if (! NILP (value) && ! EQ (value, Qunbound))
store_frame_param (f, param, value);
return value;