diff options
| author | Paul Eggert | 2011-04-15 00:48:51 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-15 00:48:51 -0700 |
| commit | 4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9 (patch) | |
| tree | e993b231bb5555c9c961f5d0b20d90ac76f77bbd /src/xfaces.c | |
| parent | 1963a2e0bb07cc8dee6d27f972f93d9cfd7c6b2d (diff) | |
| parent | 49093f601b69d91126aefd328ee8f6bfeb797407 (diff) | |
| download | emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.tar.gz emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.zip | |
Merge from mainline.
Diffstat (limited to 'src/xfaces.c')
| -rw-r--r-- | src/xfaces.c | 101 |
1 files changed, 47 insertions, 54 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 8a64855bd8f..5cfe99d1285 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -304,25 +304,33 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 304 | 304 | ||
| 305 | /* Keyword symbols used for face attribute names. */ | 305 | /* Keyword symbols used for face attribute names. */ |
| 306 | 306 | ||
| 307 | Lisp_Object QCfamily, QCheight, QCweight, QCslant, QCunderline; | 307 | Lisp_Object QCfamily, QCheight, QCweight, QCslant; |
| 308 | Lisp_Object QCinverse_video, QCforeground, QCbackground, QCstipple; | 308 | static Lisp_Object QCunderline; |
| 309 | Lisp_Object QCwidth, QCfont, QCbold, QCitalic; | 309 | static Lisp_Object QCinverse_video, QCstipple; |
| 310 | Lisp_Object QCreverse_video; | 310 | Lisp_Object QCforeground, QCbackground; |
| 311 | Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit; | 311 | Lisp_Object QCwidth; |
| 312 | Lisp_Object QCfontset; | 312 | static Lisp_Object QCfont, QCbold, QCitalic; |
| 313 | static Lisp_Object QCreverse_video; | ||
| 314 | static Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit; | ||
| 315 | static Lisp_Object QCfontset; | ||
| 313 | 316 | ||
| 314 | /* Symbols used for attribute values. */ | 317 | /* Symbols used for attribute values. */ |
| 315 | 318 | ||
| 316 | Lisp_Object Qnormal, Qbold, Qultra_light, Qextra_light, Qlight; | 319 | Lisp_Object Qnormal; |
| 317 | Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold; | 320 | Lisp_Object Qbold; |
| 318 | Lisp_Object Qoblique, Qitalic, Qreverse_oblique, Qreverse_italic; | 321 | static Lisp_Object Qultra_light, Qextra_light, Qlight; |
| 319 | Lisp_Object Qultra_condensed, Qextra_condensed, Qcondensed; | 322 | static Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold; |
| 320 | Lisp_Object Qsemi_condensed, Qsemi_expanded, Qexpanded, Qextra_expanded; | 323 | static Lisp_Object Qoblique, Qreverse_oblique, Qreverse_italic; |
| 321 | Lisp_Object Qultra_expanded; | 324 | Lisp_Object Qitalic; |
| 322 | Lisp_Object Qreleased_button, Qpressed_button; | 325 | static Lisp_Object Qultra_condensed, Qextra_condensed; |
| 323 | Lisp_Object QCstyle, QCcolor, QCline_width; | 326 | Lisp_Object Qcondensed; |
| 324 | Lisp_Object Qunspecified; | 327 | static Lisp_Object Qsemi_condensed, Qsemi_expanded, Qextra_expanded; |
| 325 | Lisp_Object Qignore_defface; | 328 | Lisp_Object Qexpanded; |
| 329 | static Lisp_Object Qultra_expanded; | ||
| 330 | static Lisp_Object Qreleased_button, Qpressed_button; | ||
| 331 | static Lisp_Object QCstyle, QCcolor, QCline_width; | ||
| 332 | static Lisp_Object Qunspecified; | ||
| 333 | static Lisp_Object Qignore_defface; | ||
| 326 | 334 | ||
| 327 | char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg"; | 335 | char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg"; |
| 328 | 336 | ||
| @@ -333,15 +341,18 @@ Lisp_Object Qframe_set_background_mode; | |||
| 333 | 341 | ||
| 334 | /* Names of basic faces. */ | 342 | /* Names of basic faces. */ |
| 335 | 343 | ||
| 336 | Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe; | 344 | Lisp_Object Qdefault, Qtool_bar, Qfringe; |
| 337 | Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu; | 345 | static Lisp_Object Qregion; |
| 338 | Lisp_Object Qmode_line_inactive, Qvertical_border; | 346 | Lisp_Object Qheader_line, Qscroll_bar, Qcursor; |
| 347 | static Lisp_Object Qborder, Qmouse, Qmenu; | ||
| 348 | Lisp_Object Qmode_line_inactive; | ||
| 349 | static Lisp_Object Qvertical_border; | ||
| 339 | 350 | ||
| 340 | /* The symbol `face-alias'. A symbols having that property is an | 351 | /* The symbol `face-alias'. A symbols having that property is an |
| 341 | alias for another face. Value of the property is the name of | 352 | alias for another face. Value of the property is the name of |
| 342 | the aliased face. */ | 353 | the aliased face. */ |
| 343 | 354 | ||
| 344 | Lisp_Object Qface_alias; | 355 | static Lisp_Object Qface_alias; |
| 345 | 356 | ||
| 346 | /* Alist of alternative font families. Each element is of the form | 357 | /* Alist of alternative font families. Each element is of the form |
| 347 | (FAMILY FAMILY1 FAMILY2 ...). If fonts of FAMILY can't be loaded, | 358 | (FAMILY FAMILY1 FAMILY2 ...). If fonts of FAMILY can't be loaded, |
| @@ -361,7 +372,7 @@ Lisp_Object Vface_alternative_font_registry_alist; | |||
| 361 | font may be scaled if its name matches a regular expression in the | 372 | font may be scaled if its name matches a regular expression in the |
| 362 | list. */ | 373 | list. */ |
| 363 | 374 | ||
| 364 | Lisp_Object Qscalable_fonts_allowed; | 375 | static Lisp_Object Qscalable_fonts_allowed; |
| 365 | 376 | ||
| 366 | #define DEFAULT_FONT_LIST_LIMIT 100 | 377 | #define DEFAULT_FONT_LIST_LIMIT 100 |
| 367 | 378 | ||
| @@ -377,11 +388,11 @@ Lisp_Object Qface; | |||
| 377 | 388 | ||
| 378 | /* Property for basic faces which other faces cannot inherit. */ | 389 | /* Property for basic faces which other faces cannot inherit. */ |
| 379 | 390 | ||
| 380 | Lisp_Object Qface_no_inherit; | 391 | static Lisp_Object Qface_no_inherit; |
| 381 | 392 | ||
| 382 | /* Error symbol for wrong_type_argument in load_pixmap. */ | 393 | /* Error symbol for wrong_type_argument in load_pixmap. */ |
| 383 | 394 | ||
| 384 | Lisp_Object Qbitmap_spec_p; | 395 | static Lisp_Object Qbitmap_spec_p; |
| 385 | 396 | ||
| 386 | /* The next ID to assign to Lisp faces. */ | 397 | /* The next ID to assign to Lisp faces. */ |
| 387 | 398 | ||
| @@ -394,11 +405,11 @@ static int lface_id_to_name_size; | |||
| 394 | 405 | ||
| 395 | /* TTY color-related functions (defined in tty-colors.el). */ | 406 | /* TTY color-related functions (defined in tty-colors.el). */ |
| 396 | 407 | ||
| 397 | Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values; | 408 | static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values; |
| 398 | 409 | ||
| 399 | /* The name of the function used to compute colors on TTYs. */ | 410 | /* The name of the function used to compute colors on TTYs. */ |
| 400 | 411 | ||
| 401 | Lisp_Object Qtty_color_alist; | 412 | static Lisp_Object Qtty_color_alist; |
| 402 | 413 | ||
| 403 | /* Counter for calls to clear_face_cache. If this counter reaches | 414 | /* Counter for calls to clear_face_cache. If this counter reaches |
| 404 | CLEAR_FONT_TABLE_COUNT, and a frame has more than | 415 | CLEAR_FONT_TABLE_COUNT, and a frame has more than |
| @@ -418,7 +429,7 @@ int face_change_count; | |||
| 418 | display. This is a kluge to suppress `bold black' foreground text | 429 | display. This is a kluge to suppress `bold black' foreground text |
| 419 | which is hard to read on an LCD monitor. */ | 430 | which is hard to read on an LCD monitor. */ |
| 420 | 431 | ||
| 421 | int tty_suppress_bold_inverse_default_colors_p; | 432 | static int tty_suppress_bold_inverse_default_colors_p; |
| 422 | 433 | ||
| 423 | /* A list of the form `((x . y))' used to avoid consing in | 434 | /* A list of the form `((x . y))' used to avoid consing in |
| 424 | Finternal_set_lisp_face_attribute. */ | 435 | Finternal_set_lisp_face_attribute. */ |
| @@ -436,7 +447,7 @@ static int ngcs; | |||
| 436 | /* Non-zero means the definition of the `menu' face for new frames has | 447 | /* Non-zero means the definition of the `menu' face for new frames has |
| 437 | been changed. */ | 448 | been changed. */ |
| 438 | 449 | ||
| 439 | int menu_face_changed_default; | 450 | static int menu_face_changed_default; |
| 440 | 451 | ||
| 441 | 452 | ||
| 442 | /* Function prototypes. */ | 453 | /* Function prototypes. */ |
| @@ -606,6 +617,8 @@ x_free_colors (struct frame *f, long unsigned int *pixels, int npixels) | |||
| 606 | } | 617 | } |
| 607 | 618 | ||
| 608 | 619 | ||
| 620 | #ifdef USE_X_TOOLKIT | ||
| 621 | |||
| 609 | /* Free colors used on frame F. PIXELS is an array of NPIXELS pixel | 622 | /* Free colors used on frame F. PIXELS is an array of NPIXELS pixel |
| 610 | color values. Interrupt input must be blocked when this function | 623 | color values. Interrupt input must be blocked when this function |
| 611 | is called. */ | 624 | is called. */ |
| @@ -626,7 +639,7 @@ x_free_dpy_colors (Display *dpy, Screen *screen, Colormap cmap, long unsigned in | |||
| 626 | XFreeColors (dpy, cmap, pixels, npixels, 0); | 639 | XFreeColors (dpy, cmap, pixels, npixels, 0); |
| 627 | } | 640 | } |
| 628 | } | 641 | } |
| 629 | 642 | #endif /* USE_X_TOOLKIT */ | |
| 630 | 643 | ||
| 631 | /* Create and return a GC for use on frame F. GC values and mask | 644 | /* Create and return a GC for use on frame F. GC values and mask |
| 632 | are given by XGCV and MASK. */ | 645 | are given by XGCV and MASK. */ |
| @@ -1138,7 +1151,7 @@ tty_defined_color (struct frame *f, const char *color_name, | |||
| 1138 | 1151 | ||
| 1139 | This does the right thing for any type of frame. */ | 1152 | This does the right thing for any type of frame. */ |
| 1140 | 1153 | ||
| 1141 | int | 1154 | static int |
| 1142 | defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc) | 1155 | defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc) |
| 1143 | { | 1156 | { |
| 1144 | if (!FRAME_WINDOW_P (f)) | 1157 | if (!FRAME_WINDOW_P (f)) |
| @@ -1786,7 +1799,7 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 1786 | { | 1799 | { |
| 1787 | /* This is a scalable font. For backward compatibility, | 1800 | /* This is a scalable font. For backward compatibility, |
| 1788 | we set the specified size. */ | 1801 | we set the specified size. */ |
| 1789 | font_entity = Fcopy_font_spec (font_entity); | 1802 | font_entity = copy_font_spec (font_entity); |
| 1790 | ASET (font_entity, FONT_SIZE_INDEX, | 1803 | ASET (font_entity, FONT_SIZE_INDEX, |
| 1791 | AREF (font_spec, FONT_SIZE_INDEX)); | 1804 | AREF (font_spec, FONT_SIZE_INDEX)); |
| 1792 | } | 1805 | } |
| @@ -2310,9 +2323,9 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, struct | |||
| 2310 | if (!UNSPECIFIEDP (from[i])) | 2323 | if (!UNSPECIFIEDP (from[i])) |
| 2311 | { | 2324 | { |
| 2312 | if (!UNSPECIFIEDP (to[i])) | 2325 | if (!UNSPECIFIEDP (to[i])) |
| 2313 | to[i] = Fmerge_font_spec (from[i], to[i]); | 2326 | to[i] = merge_font_spec (from[i], to[i]); |
| 2314 | else | 2327 | else |
| 2315 | to[i] = Fcopy_font_spec (from[i]); | 2328 | to[i] = copy_font_spec (from[i]); |
| 2316 | if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) | 2329 | if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) |
| 2317 | to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX)); | 2330 | to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX)); |
| 2318 | if (! NILP (AREF (to[i], FONT_FAMILY_INDEX))) | 2331 | if (! NILP (AREF (to[i], FONT_FAMILY_INDEX))) |
| @@ -4084,7 +4097,7 @@ make_realized_face (Lisp_Object *attr) | |||
| 4084 | /* Free realized face FACE, including its X resources. FACE may | 4097 | /* Free realized face FACE, including its X resources. FACE may |
| 4085 | be null. */ | 4098 | be null. */ |
| 4086 | 4099 | ||
| 4087 | void | 4100 | static void |
| 4088 | free_realized_face (struct frame *f, struct face *face) | 4101 | free_realized_face (struct frame *f, struct face *face) |
| 4089 | { | 4102 | { |
| 4090 | if (face) | 4103 | if (face) |
| @@ -4602,26 +4615,6 @@ lookup_basic_face (struct frame *f, int face_id) | |||
| 4602 | } | 4615 | } |
| 4603 | 4616 | ||
| 4604 | 4617 | ||
| 4605 | /* Return the ID of the realized ASCII face of Lisp face with ID | ||
| 4606 | LFACE_ID on frame F. Value is -1 if LFACE_ID isn't valid. */ | ||
| 4607 | |||
| 4608 | int | ||
| 4609 | ascii_face_of_lisp_face (struct frame *f, int lface_id) | ||
| 4610 | { | ||
| 4611 | int face_id; | ||
| 4612 | |||
| 4613 | if (lface_id >= 0 && lface_id < lface_id_to_name_size) | ||
| 4614 | { | ||
| 4615 | Lisp_Object face_name = lface_id_to_name[lface_id]; | ||
| 4616 | face_id = lookup_named_face (f, face_name, 1); | ||
| 4617 | } | ||
| 4618 | else | ||
| 4619 | face_id = -1; | ||
| 4620 | |||
| 4621 | return face_id; | ||
| 4622 | } | ||
| 4623 | |||
| 4624 | |||
| 4625 | /* Return a face for charset ASCII that is like the face with id | 4618 | /* Return a face for charset ASCII that is like the face with id |
| 4626 | FACE_ID on frame F, but has a font that is STEPS steps smaller. | 4619 | FACE_ID on frame F, but has a font that is STEPS steps smaller. |
| 4627 | STEPS < 0 means larger. Value is the id of the face. */ | 4620 | STEPS < 0 means larger. Value is the id of the face. */ |
| @@ -6190,7 +6183,7 @@ face_at_string_position (struct window *w, Lisp_Object string, | |||
| 6190 | if we don't have fonts, so we can stop here if not working | 6183 | if we don't have fonts, so we can stop here if not working |
| 6191 | on a window-system frame. */ | 6184 | on a window-system frame. */ |
| 6192 | || !FRAME_WINDOW_P (f) | 6185 | || !FRAME_WINDOW_P (f) |
| 6193 | || FACE_SUITABLE_FOR_CHAR_P (base_face, 0))) | 6186 | || FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face, 0))) |
| 6194 | return base_face->id; | 6187 | return base_face->id; |
| 6195 | 6188 | ||
| 6196 | /* Begin with attributes from the base face. */ | 6189 | /* Begin with attributes from the base face. */ |