diff options
| author | Jason Rumney | 2002-05-22 19:35:48 +0000 |
|---|---|---|
| committer | Jason Rumney | 2002-05-22 19:35:48 +0000 |
| commit | 23afac8fab209cf0a50fae138d7cbd98555398c0 (patch) | |
| tree | 43b6544a1dcdadc3a89a36eb33a378d8cef7b0f3 /src | |
| parent | 232dbe4f66c1cf38a9c42f4d598412cc6dc02fc0 (diff) | |
| download | emacs-23afac8fab209cf0a50fae138d7cbd98555398c0.tar.gz emacs-23afac8fab209cf0a50fae138d7cbd98555398c0.zip | |
* w32fns.c (enumfont_t): Remove tail, make pattern a normal
Lisp_Object.
(enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts):
Use modified enumfont_t struct.
* w32fns.c (Qhbar): New variable.
(x_specified_cursor_type): Use it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 6053e1d4ca3..95ecc1b401c 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -201,7 +201,7 @@ Lisp_Object Vw32_charset_info_alist; | |||
| 201 | 201 | ||
| 202 | Lisp_Object Qauto_raise; | 202 | Lisp_Object Qauto_raise; |
| 203 | Lisp_Object Qauto_lower; | 203 | Lisp_Object Qauto_lower; |
| 204 | Lisp_Object Qbar; | 204 | Lisp_Object Qbar, Qhbar; |
| 205 | Lisp_Object Qborder_color; | 205 | Lisp_Object Qborder_color; |
| 206 | Lisp_Object Qborder_width; | 206 | Lisp_Object Qborder_width; |
| 207 | Lisp_Object Qbox; | 207 | Lisp_Object Qbox; |
| @@ -2368,6 +2368,19 @@ x_specified_cursor_type (arg, width) | |||
| 2368 | type = BAR_CURSOR; | 2368 | type = BAR_CURSOR; |
| 2369 | *width = XINT (XCDR (arg)); | 2369 | *width = XINT (XCDR (arg)); |
| 2370 | } | 2370 | } |
| 2371 | else if (EQ (arg, Qhbar)) | ||
| 2372 | { | ||
| 2373 | type = HBAR_CURSOR; | ||
| 2374 | *width = 2; | ||
| 2375 | } | ||
| 2376 | else if (CONSP (arg) | ||
| 2377 | && EQ (XCAR (arg), Qhbar) | ||
| 2378 | && INTEGERP (XCDR (arg)) | ||
| 2379 | && XINT (XCDR (arg)) >= 0) | ||
| 2380 | { | ||
| 2381 | type = HBAR_CURSOR; | ||
| 2382 | *width = XINT (XCDR (arg)); | ||
| 2383 | } | ||
| 2371 | else if (NILP (arg)) | 2384 | else if (NILP (arg)) |
| 2372 | type = NO_CURSOR; | 2385 | type = NO_CURSOR; |
| 2373 | else | 2386 | else |
| @@ -7093,9 +7106,8 @@ typedef struct enumfont_t | |||
| 7093 | int numFonts; | 7106 | int numFonts; |
| 7094 | LOGFONT logfont; | 7107 | LOGFONT logfont; |
| 7095 | XFontStruct *size_ref; | 7108 | XFontStruct *size_ref; |
| 7096 | Lisp_Object *pattern; | 7109 | Lisp_Object pattern; |
| 7097 | Lisp_Object list; | 7110 | Lisp_Object list; |
| 7098 | Lisp_Object *tail; | ||
| 7099 | } enumfont_t; | 7111 | } enumfont_t; |
| 7100 | 7112 | ||
| 7101 | 7113 | ||
| @@ -7151,7 +7163,7 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 7151 | /* Truetype fonts do not report their true metrics until loaded */ | 7163 | /* Truetype fonts do not report their true metrics until loaded */ |
| 7152 | if (FontType != RASTER_FONTTYPE) | 7164 | if (FontType != RASTER_FONTTYPE) |
| 7153 | { | 7165 | { |
| 7154 | if (!NILP (*(lpef->pattern))) | 7166 | if (!NILP (lpef->pattern)) |
| 7155 | { | 7167 | { |
| 7156 | /* Scalable fonts are as big as you want them to be. */ | 7168 | /* Scalable fonts are as big as you want them to be. */ |
| 7157 | lplf->elfLogFont.lfHeight = lpef->logfont.lfHeight; | 7169 | lplf->elfLogFont.lfHeight = lpef->logfont.lfHeight; |
| @@ -7176,9 +7188,9 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 7176 | lplf->elfLogFont.lfHeight = -lplf->elfLogFont.lfHeight; | 7188 | lplf->elfLogFont.lfHeight = -lplf->elfLogFont.lfHeight; |
| 7177 | } | 7189 | } |
| 7178 | 7190 | ||
| 7179 | if (!NILP (*(lpef->pattern))) | 7191 | if (!NILP (lpef->pattern)) |
| 7180 | { | 7192 | { |
| 7181 | charset = xlfd_charset_of_font (XSTRING(*(lpef->pattern))->data); | 7193 | charset = xlfd_charset_of_font (XSTRING(lpef->pattern)->data); |
| 7182 | 7194 | ||
| 7183 | /* We already checked charsets above, but DEFAULT_CHARSET | 7195 | /* We already checked charsets above, but DEFAULT_CHARSET |
| 7184 | slipped through. So only allow exact matches for DEFAULT_CHARSET. */ | 7196 | slipped through. So only allow exact matches for DEFAULT_CHARSET. */ |
| @@ -7242,8 +7254,8 @@ enum_font_maybe_add_to_list (lpef, logfont, match_charset, width) | |||
| 7242 | if (!w32_to_x_font (logfont, buf, 100, match_charset)) | 7254 | if (!w32_to_x_font (logfont, buf, 100, match_charset)) |
| 7243 | return; | 7255 | return; |
| 7244 | 7256 | ||
| 7245 | if (NILP (*(lpef->pattern)) | 7257 | if (NILP (lpef->pattern) |
| 7246 | || w32_font_match (buf, XSTRING (*(lpef->pattern))->data)) | 7258 | || w32_font_match (buf, XSTRING (lpef->pattern)->data)) |
| 7247 | { | 7259 | { |
| 7248 | /* Check if we already listed this font. This may happen if | 7260 | /* Check if we already listed this font. This may happen if |
| 7249 | w32_enable_synthesized_fonts is non-nil, and there are real | 7261 | w32_enable_synthesized_fonts is non-nil, and there are real |
| @@ -7251,8 +7263,8 @@ enum_font_maybe_add_to_list (lpef, logfont, match_charset, width) | |||
| 7251 | Lisp_Object font_name = build_string (buf); | 7263 | Lisp_Object font_name = build_string (buf); |
| 7252 | if (NILP (Fmember (font_name, lpef->list))) | 7264 | if (NILP (Fmember (font_name, lpef->list))) |
| 7253 | { | 7265 | { |
| 7254 | *lpef->tail = Fcons (Fcons (build_string (buf), width), Qnil); | 7266 | Lisp_Object entry = Fcons (font_name, width); |
| 7255 | lpef->tail = &(XCDR_AS_LVALUE (*lpef->tail)); | 7267 | lpef->list = Fcons (entry, lpef->list); |
| 7256 | lpef->numFonts++; | 7268 | lpef->numFonts++; |
| 7257 | } | 7269 | } |
| 7258 | } | 7270 | } |
| @@ -7397,10 +7409,8 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7397 | 7409 | ||
| 7398 | BLOCK_INPUT; | 7410 | BLOCK_INPUT; |
| 7399 | /* At first, put PATTERN in the cache. */ | 7411 | /* At first, put PATTERN in the cache. */ |
| 7400 | list = Qnil; | 7412 | ef.pattern = tpat; |
| 7401 | ef.pattern = &tpat; | 7413 | ef.list = Qnil; |
| 7402 | ef.list = list; | ||
| 7403 | ef.tail = &list; | ||
| 7404 | ef.numFonts = 0; | 7414 | ef.numFonts = 0; |
| 7405 | 7415 | ||
| 7406 | /* Use EnumFontFamiliesEx where it is available, as it knows | 7416 | /* Use EnumFontFamiliesEx where it is available, as it knows |
| @@ -7435,6 +7445,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7435 | } | 7445 | } |
| 7436 | 7446 | ||
| 7437 | UNBLOCK_INPUT; | 7447 | UNBLOCK_INPUT; |
| 7448 | list = ef.list; | ||
| 7438 | 7449 | ||
| 7439 | /* Make a list of the fonts we got back. | 7450 | /* Make a list of the fonts we got back. |
| 7440 | Store that in the font cache for the display. */ | 7451 | Store that in the font cache for the display. */ |
| @@ -14812,6 +14823,8 @@ syms_of_w32fns () | |||
| 14812 | staticpro (&Qauto_lower); | 14823 | staticpro (&Qauto_lower); |
| 14813 | Qbar = intern ("bar"); | 14824 | Qbar = intern ("bar"); |
| 14814 | staticpro (&Qbar); | 14825 | staticpro (&Qbar); |
| 14826 | Qhbar = intern ("hbar"); | ||
| 14827 | staticpro (&Qhbar); | ||
| 14815 | Qborder_color = intern ("border-color"); | 14828 | Qborder_color = intern ("border-color"); |
| 14816 | staticpro (&Qborder_color); | 14829 | staticpro (&Qborder_color); |
| 14817 | Qborder_width = intern ("border-width"); | 14830 | Qborder_width = intern ("border-width"); |