#include "dosfns.h"
#endif
+#ifdef WINDOWSNT
+#include "w32term.h"
+#include "fontset.h"
+/* Redefine X specifics to W32 equivalents to avoid cluttering the
+ code with #ifdef blocks. */
+#define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO
+#define x_display_info w32_display_info
+#define FRAME_X_FONT_TABLE FRAME_W32_FONT_TABLE
+#define check_x check_w32
+#define x_list_fonts w32_list_fonts
+#define GCGraphicsExposures 0
+/* For historic reasons, FONT_WIDTH refers to average width on W32,
+ not maximum as on X. Redefine here. */
+#define FONT_WIDTH FONT_MAX_WIDTH
+#endif
+
#include "buffer.h"
#include "dispextern.h"
#include "blockinput.h"
static struct table_entry *xlfd_lookup_field_contents P_ ((struct table_entry *, int,
struct font_name *, int));
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
static int split_font_name P_ ((struct frame *, struct font_name *, int));
static int xlfd_point_size P_ ((struct frame *, struct font_name *));
static void x_free_gc P_ ((struct frame *, GC));
static void clear_font_table P_ ((struct frame *));
-#endif /* HAVE_X_WINDOWS */
+#ifdef WINDOWSNT
+extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
+#endif /* WINDOWSNT */
+
+#endif /* HAVE_WINDOW_SYSTEM */
\f
/***********************************************************************
#endif /* HAVE_X_WINDOWS */
+#ifdef WINDOWSNT
+/* W32 emulation of GCs */
+
+static INLINE GC
+x_create_gc (f, mask, xgcv)
+ struct frame *f;
+ unsigned long mask;
+ XGCValues *xgcv;
+{
+ GC gc;
+ BLOCK_INPUT;
+ gc = XCreateGC (NULL, FRAME_W32_WINDOW (f), mask, xgcv);
+ UNBLOCK_INPUT;
+ IF_DEBUG (++ngcs);
+ return gc;
+}
+
+
+/* Free GC which was used on frame F. */
+
+static INLINE void
+x_free_gc (f, gc)
+ struct frame *f;
+ GC gc;
+{
+ BLOCK_INPUT;
+ xassert (--ngcs >= 0);
+ xfree (gc);
+ UNBLOCK_INPUT;
+}
+
+#endif /* WINDOWSNT */
/* Like strdup, but uses xmalloc. */
if (FRAME_FACE_CACHE (f) == NULL)
FRAME_FACE_CACHE (f) = make_face_cache (f);
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Make the image cache. */
- if (FRAME_X_P (f))
+ if (FRAME_WINDOW_P (f))
{
if (FRAME_X_IMAGE_CACHE (f) == NULL)
FRAME_X_IMAGE_CACHE (f) = make_image_cache ();
++FRAME_X_IMAGE_CACHE (f)->refcount;
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
/* Realize basic faces. Must have enough information in frame
parameters to realize basic faces at this point. */
#ifdef HAVE_X_WINDOWS
if (!FRAME_X_P (f) || FRAME_X_WINDOW (f))
+#endif
+#ifdef WINDOWSNT
+ if (!FRAME_WINDOW_P (f) || FRAME_W32_WINDOW (f))
#endif
if (!realize_basic_faces (f))
abort ();
FRAME_FACE_CACHE (f) = NULL;
}
-#ifdef HAVE_X_WINDOWS
- if (FRAME_X_P (f))
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_WINDOW_P (f))
{
struct image_cache *image_cache = FRAME_X_IMAGE_CACHE (f);
if (image_cache)
free_image_cache (f);
}
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}
clear_face_cache (clear_fonts_p)
int clear_fonts_p;
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
Lisp_Object tail, frame;
struct frame *f;
FOR_EACH_FRAME (tail, frame)
{
f = XFRAME (frame);
- if (FRAME_X_P (f)
+ if (FRAME_WINDOW_P (f)
&& FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS)
{
free_all_realized_faces (frame);
FOR_EACH_FRAME (tail, frame)
{
f = XFRAME (frame);
- if (FRAME_X_P (f))
+ if (FRAME_WINDOW_P (f))
{
clear_face_gcs (FRAME_FACE_CACHE (f));
clear_image_cache (f, 0);
}
}
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Remove those fonts from the font table of frame F that are not used
Lisp_Object rest, frame;
int i;
- xassert (FRAME_X_P (f));
+ xassert (FRAME_WINDOW_P (f));
used = (char *) alloca (dpyinfo->n_fonts * sizeof *used);
bzero (used, dpyinfo->n_fonts * sizeof *used);
/* Free the font. */
BLOCK_INPUT;
+#ifdef HAVE_X_WINDOWS
XFreeFont (dpyinfo->display, font_info->font);
+#endif
+#ifdef WINDOWSNT
+ w32_unload_font (dpyinfo, font_info->font);
+#endif
UNBLOCK_INPUT;
/* Mark font table slot free. */
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
X Pixmaps
***********************************************************************/
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
DEFUN ("bitmap-spec-p", Fbitmap_spec_p, Sbitmap_spec_p, 1, 1, 0,
"Value is non-nil if OBJECT is a valid bitmap specification.\n\
return bitmap_id;
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
Minimum font bounds
***********************************************************************/
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Update the line_height of frame F. Return non-zero if line height
changes. */
{
int fontset, line_height, changed_p;
- fontset = f->output_data.x->fontset;
+ fontset = FRAME_FONTSET (f);
if (fontset > 0)
line_height = FRAME_FONTSET_DATA (f)->fontset_table[fontset]->height;
else
- line_height = FONT_HEIGHT (f->output_data.x->font);
+ line_height = FONT_HEIGHT (FRAME_FONT (f));
- changed_p = line_height != f->output_data.x->line_height;
- f->output_data.x->line_height = line_height;
+ changed_p = line_height != FRAME_LINE_HEIGHT (f);
+ FRAME_LINE_HEIGHT (f) = line_height;
return changed_p;
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
/***********************************************************************
Fonts
***********************************************************************/
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Load font or fontset of face FACE which is used on frame F.
FONTSET is the fontset FACE should use or -1, if FACE doesn't use a
build_string (font_name), Qnil);
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
#endif
#ifdef WINDOWSNT
else if (FRAME_W32_P (f))
- /* FIXME: w32_defined_color doesn't exist! w32fns.c defines
- defined_color which needs to be renamed, and the declaration
- of color_def therein should be changed. */
return w32_defined_color (f, color_name, color_def, alloc);
#endif
#ifdef macintosh
return msdos_stdcolor_name (idx);
#endif
-#ifdef WINDOWSNT
- /* FIXME: When/if w32 supports colors in non-window mode, there should
- be a call here to a w32-specific function that returns the color
- by index using the default color mapping on a Windows console. */
-#endif
-
if (idx == FACE_TTY_DEFAULT_FG_COLOR)
return build_string (unspecified_fg);
if (idx == FACE_TTY_DEFAULT_BG_COLOR)
return build_string (unspecified_bg);
+
+#ifdef WINDOWSNT
+ return vga_stdcolor_name (idx);
+#endif
+
return Qunspecified;
}
return color.pixel;
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Load colors for face FACE which is used on frame F. Colors are
specified by slots LFACE_BACKGROUND_INDEX and LFACE_FOREGROUND_INDEX
struct frame *f;
unsigned long pixel;
{
+#ifdef HAVE_X_WINDOWS
BLOCK_INPUT;
x_free_colors (f, &pixel, 1);
UNBLOCK_INPUT;
+#endif
}
struct frame *f;
struct face *face;
{
+#ifdef HAVE_X_WINDOWS
int class = FRAME_X_DISPLAY_INFO (f)->visual->class;
/* If display has an immutable color map, freeing colors is not
UNBLOCK_INPUT;
}
-}
#endif /* HAVE_X_WINDOWS */
+}
+#endif /* HAVE_WINDOW_SYSTEM */
\f
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Return non-zero if FONT is the name of a fixed-pitch font. */
int nfonts, try_alternatives_p;
int scalable_fonts_p;
{
- Display *dpy = f ? FRAME_X_DISPLAY (f) : x_display_list->display;
int n, i, j;
char **names;
+#ifdef HAVE_X_WINDOWS
+ Display *dpy = f ? FRAME_X_DISPLAY (f) : x_display_list->display;
/* Get the list of fonts matching PATTERN from the X server. */
BLOCK_INPUT;
names = XListFonts (dpy, pattern, nfonts, &n);
UNBLOCK_INPUT;
+#endif
+#ifdef WINDOWSNT
+ /* NTEMACS_TODO : currently this uses w32_list_fonts, but it may be
+ better to do it the other way around. */
+ Lisp_Object lfonts;
+ Lisp_Object lpattern, tem;
+
+ n = 0;
+ names = NULL;
+
+ lpattern = build_string (pattern);
+
+ /* Get the list of fonts matching PATTERN. */
+ BLOCK_INPUT;
+ lfonts = w32_list_fonts (f, lpattern, 0, nfonts);
+ UNBLOCK_INPUT;
+
+ /* Count fonts returned */
+ for (tem = lfonts; CONSP (tem); tem = XCDR (tem))
+ n++;
+
+ /* Allocate array. */
+ if (n)
+ names = (char **) xmalloc (n * sizeof (char *));
+
+ /* Extract font names into char * array. */
+ tem = lfonts;
+ for (i = 0; i < n; i++)
+ {
+ names[i] = XSTRING (XCAR (tem))->data;
+ tem = XCDR (tem);
+ }
+#endif
if (names)
{
n = j;
+#ifdef HAVE_X_WINDOWS
/* Free font names. */
BLOCK_INPUT;
XFreeFontNames (names);
UNBLOCK_INPUT;
+#endif
}
/* We can't simply call check_x_frame because this function may be
called before any frame is created. */
f = frame_or_selected_frame (frame, 2);
- if (!FRAME_X_P (f))
+ if (!FRAME_WINDOW_P (f))
{
/* Perhaps we have not yet created any frame. */
f = NULL;
struct face *face = FACE_FROM_ID (f, face_id);
if (face->font)
- size = face->font->max_bounds.width;
+ size = FONT_WIDTH (face->font);
else
- size = FRAME_FONT (f)->max_bounds.width;
+ size = FONT_WIDTH (FRAME_FONT (f));
if (!NILP (width))
size *= XINT (width);
}
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
return i == LFACE_VECTOR_SIZE;
}
-
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Set font-related attributes of Lisp face LFACE from XLFD font name
FONT_NAME. If FORCE_P is zero, set only unspecified attributes of
{
if (may_fail_p)
return 0;
+#ifdef HAVE_X_WINDOWS
else if (first_font_matching (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
&font)
|| first_font_matching (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
|| first_font_matching (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
&font)
|| first_font_matching (f, "fixed", &font))
+#endif
+#ifdef WINDOWSNT
+ else if (first_font_matching (f, "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1",
+ &font)
+ || first_font_matching (f, "-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1",
+ &font)
+ || first_font_matching (f, "-*-FixedSys-normal-r-*-*-12-*-*-*-c-*-iso8859-1",
+ &font)
+ || first_font_matching (f, "-*-*-normal-r-*-*-*-*-*-*-c-*-iso8859-1",
+ &font)
+ || first_font_matching (f, "FixedSys",
+ &font))
+#endif
free_font_name_p = 1;
else
abort ();
return 1;
}
-
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
/* Merge two Lisp face attribute vectors FROM and TO and store the
}
else if (EQ (attr, QCfont))
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Set font-related attributes of the Lisp face from an
XLFD font name. */
struct frame *f;
signal_error ("Invalid font name", value);
font_related_attr_p = 1;
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}
else if (EQ (attr, QCbold))
{
++windows_or_buffers_changed;
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
if (!EQ (frame, Qt)
&& !UNSPECIFIEDP (value)
else if (EQ (attr, QCbackground))
param = Qbackground_color;
}
+#ifndef WINDOWSNT
else if (EQ (face, Qscroll_bar))
{
/* Changing the colors of `scroll-bar' sets frame parameters
else if (EQ (attr, QCbackground))
param = Qscroll_bar_background;
}
+#endif
else if (EQ (face, Qborder))
{
/* Changing background color of `border' sets frame parameter
Fmodify_frame_parameters (frame, Fcons (Fcons (param, value), Qnil));
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
return face;
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Set the `font' frame parameter of FRAME according to `default' face
attributes LFACE. */
(resource, class, frame)
Lisp_Object resource, class, frame;
{
- Lisp_Object value;
+ Lisp_Object value = Qnil;
+#ifndef WINDOWSNT
CHECK_STRING (resource, 0);
CHECK_STRING (class, 1);
CHECK_LIVE_FRAME (frame, 2);
value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)),
resource, class, Qnil, Qnil);
UNBLOCK_INPUT;
+#endif
return value;
}
return Finternal_set_lisp_face_attribute (face, attr, value, frame);
}
+#endif /* HAVE_WINDOW_SYSTEM */
\f
+#ifdef HAVE_X_WINDOWS
/***********************************************************************
Menu face
***********************************************************************/
{
if (face)
{
-#ifdef HAVE_X_WINDOWS
- if (FRAME_X_P (f))
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_WINDOW_P (f))
{
if (face->gc)
{
free_face_colors (f, face);
x_destroy_bitmap (f, face->stipple);
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
xfree (face);
}
struct frame *f;
struct face *face;
{
-#ifdef HAVE_X_WINDOWS
- xassert (FRAME_X_P (f));
+#ifdef HAVE_WINDOW_SYSTEM
+ xassert (FRAME_WINDOW_P (f));
if (face->gc == 0)
{
xgcv.foreground = face->foreground;
xgcv.background = face->background;
+#ifdef HAVE_X_WINDOWS
xgcv.graphics_exposures = False;
-
+#endif
/* The font of FACE may be null if we couldn't load it. */
if (face->font)
{
+#ifdef HAVE_X_WINDOWS
xgcv.font = face->font->fid;
+#endif
+#ifdef WINDOWSNT
+ xgcv.font = face->font;
+#endif
mask |= GCFont;
}
BLOCK_INPUT;
+#ifdef HAVE_X_WINDOWS
if (face->stipple)
{
xgcv.fill_style = FillOpaqueStippled;
xgcv.stipple = x_bitmap_pixmap (f, face->stipple);
mask |= GCFillStyle | GCStipple;
}
-
+#endif
face->gc = x_create_gc (f, mask, &xgcv);
UNBLOCK_INPUT;
}
-#endif
+#endif /* HAVE_WINDOW_SYSTEM */
}
clear_face_gcs (c)
struct face_cache *c;
{
- if (c && FRAME_X_P (c->f))
+ if (c && FRAME_WINDOW_P (c->f))
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
int i;
for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i)
{
face->gc = 0;
}
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}
}
#if GLYPH_DEBUG
xassert (face == FACE_FROM_ID (f, face->id));
- if (FRAME_X_P (f))
+ if (FRAME_WINDOW_P (f))
xassert (charset < 0 || FACE_SUITABLE_FOR_CHARSET_P (face, charset));
#endif /* GLYPH_DEBUG */
struct frame *f;
int face_id, steps;
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
struct face *face;
Lisp_Object attrs[LFACE_VECTOR_SIZE];
int pt, last_pt, last_height;
return new_face_id;
-#else /* not HAVE_X_WINDOWS */
+#else /* not HAVE_WINDOW_SYSTEM */
return face_id;
-#endif /* not HAVE_X_WINDOWS */
+#endif /* not HAVE_WINDOW_SYSTEM */
}
int face_id;
int height;
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
struct face *face;
Lisp_Object attrs[LFACE_VECTOR_SIZE];
bcopy (face->lface, attrs, sizeof attrs);
attrs[LFACE_HEIGHT_INDEX] = make_number (height);
face_id = lookup_face (f, attrs, CHARSET_ASCII);
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
return face_id;
}
}
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
/* Return the X registry and encoding of font name FONT_NAME on frame F.
Value is nil if not successful. */
struct font_name *font;
{
char *s = font->fields[XLFD_AVGWIDTH];
- return *s == '0' && *(s + 1) == '\0';
+ return (*s == '0' && *(s + 1) == '\0')
+#ifdef WINDOWSNT
+ /* Windows implementation of XLFD is slightly broken for backward
+ compatibility with previous broken versions, so test for
+ wildcards as well as 0. */
+ || *s == '*'
+#endif
+ ;
}
return font_name;
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
\f
lface = Finternal_make_lisp_face (Qdefault, frame);
}
-#ifdef HAVE_X_WINDOWS
- if (FRAME_X_P (f))
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_WINDOW_P (f))
{
/* Set frame_font to the value of the `font' frame parameter. */
frame_font = Fassq (Qfont, f->param_alist);
Vface_default_registry = build_string ("iso8859-1");
}
}
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
if (!FRAME_WINDOW_P (f))
{
if (CONSP (color) && STRINGP (XCDR (color)))
LFACE_FOREGROUND (lface) = XCDR (color);
- else if (FRAME_X_P (f))
+ else if (FRAME_WINDOW_P (f))
return 0;
else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
LFACE_FOREGROUND (lface) = build_string (unspecified_fg);
Lisp_Object color = Fassq (Qbackground_color, f->param_alist);
if (CONSP (color) && STRINGP (XCDR (color)))
LFACE_BACKGROUND (lface) = XCDR (color);
- else if (FRAME_X_P (f))
+ else if (FRAME_WINDOW_P (f))
return 0;
else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
LFACE_BACKGROUND (lface) = build_string (unspecified_bg);
xassert (c != NULL);
check_lface_attrs (attrs);
- if (FRAME_X_P (c->f))
+ if (FRAME_WINDOW_P (c->f))
face = realize_x_face (c, attrs, charset);
else if (FRAME_TERMCAP_P (c->f) || FRAME_MSDOS_P (c->f))
face = realize_tty_face (c, attrs, charset);
Lisp_Object *attrs;
int charset;
{
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
struct face *face, *default_face;
struct frame *f;
Lisp_Object stipple, overline, strike_through, box;
Lisp_Object unibyte_registry;
struct gcpro gcpro1;
- xassert (FRAME_X_P (c->f));
+ xassert (FRAME_WINDOW_P (c->f));
/* If realizing a face for use in unibyte text, get the X registry
and encoding to use from Vface_default_registry. */
xassert (face->fontset < 0);
xassert (FACE_SUITABLE_FOR_CHARSET_P (face, charset));
return face;
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}
face->foreground = load_color (c->f, face,
attrs[LFACE_FOREGROUND_INDEX],
LFACE_FOREGROUND_INDEX);
-#ifdef MSDOS
+
+#if defined (MSDOS) || defined (WINDOWSNT)
/* If the foreground of the default face is the default color,
use the foreground color defined by the frame. */
+#ifdef MSDOS
if (FRAME_MSDOS_P (c->f))
{
+#endif /* MSDOS */
+
if (face->foreground == FACE_TTY_DEFAULT_FG_COLOR
|| face->foreground == FACE_TTY_DEFAULT_COLOR)
{
- face->foreground = FRAME_FOREGROUND_PIXEL (f);
+ face->foreground = FRAME_FOREGROUND_PIXEL (c->f);
attrs[LFACE_FOREGROUND_INDEX] =
- msdos_stdcolor_name (face->foreground);
+ tty_color_name (c->f, face->foreground);
face_colors_defaulted = 1;
}
else if (face->foreground == FACE_TTY_DEFAULT_BG_COLOR)
{
- face->foreground = FRAME_BACKGROUND_PIXEL (f);
+ face->foreground = FRAME_BACKGROUND_PIXEL (c->f);
attrs[LFACE_FOREGROUND_INDEX] =
- msdos_stdcolor_name (face->foreground);
+ tty_color_name (c->f, face->foreground);
face_colors_defaulted = 1;
}
+#ifdef MSDOS
}
#endif
+#endif /* MSDOS or WINDOWSNT */
}
color = attrs[LFACE_BACKGROUND_INDEX];
face->background = load_color (c->f, face,
attrs[LFACE_BACKGROUND_INDEX],
LFACE_BACKGROUND_INDEX);
-#ifdef MSDOS
+#if defined (MSDOS) || defined (WINDOWSNT)
/* If the background of the default face is the default color,
use the background color defined by the frame. */
+#ifdef MSDOS
if (FRAME_MSDOS_P (c->f))
{
+#endif /* MSDOS */
+
if (face->background == FACE_TTY_DEFAULT_BG_COLOR
|| face->background == FACE_TTY_DEFAULT_COLOR)
{
- face->background = FRAME_BACKGROUND_PIXEL (f);
+ face->background = FRAME_BACKGROUND_PIXEL (c->f);
attrs[LFACE_BACKGROUND_INDEX] =
- msdos_stdcolor_name (face->background);
+ tty_color_name (c->f, face->background);
face_colors_defaulted = 1;
}
else if (face->background == FACE_TTY_DEFAULT_FG_COLOR)
{
- face->background = FRAME_FOREGROUND_PIXEL (f);
+ face->background = FRAME_FOREGROUND_PIXEL (c->f);
attrs[LFACE_BACKGROUND_INDEX] =
- msdos_stdcolor_name (face->background);
+ tty_color_name (c->f, face->background);
face_colors_defaulted = 1;
}
+#ifdef MSDOS
}
#endif
+#endif /* MSDOS or WINDOWSNT */
}
/* Swap colors if face is inverse-video. If the colors are taken
defsubr (&Sinternal_make_lisp_face);
defsubr (&Sinternal_lisp_face_p);
defsubr (&Sinternal_set_lisp_face_attribute);
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sinternal_set_lisp_face_attribute_from_resource);
#endif
defsubr (&Scolor_gray_p);
A value of t means allow any scalable font.\n\
Otherwise, value must be a list of regular expressions. A font may be\n\
scaled if its name matches a regular expression in the list.");
+#ifdef WINDOWSNT
+ /* Windows uses mainly truetype fonts, so disallowing scalable fonts
+ by default limits the fonts available severely. */
+ Vscalable_fonts_allowed = Qt;
+#else
Vscalable_fonts_allowed = Qnil;
-
+#endif
#endif /* SCALABLE_FONTS */
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sbitmap_spec_p);
defsubr (&Sx_list_fonts);
defsubr (&Sinternal_face_x_get_resource);
defsubr (&Sx_family_fonts);
defsubr (&Sx_font_family_list);
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
}