Mercurial > emacs
comparison mac/src/macfns.c @ 35660:b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
only if current_sblock has been initialized.
* frame.c (Fdelete_frame) [macintosh]: Allow deletion of initial
terminal frame even if it is the only visible frame.
* src/macfns.c (QCconversion): Replaces QCalgorithm.
* src/macfns.c (image_ascent, lookup_image): Adapt to change of
image margins.
* src/macterm.c (x_produce_image_glyph, x_draw_image_foreground)
(x_draw_image_relief, x_draw_image_foreground_1)
(x_draw_image_glyph_string): Adapt to change of image margins.
* src/macterm.c (mac_to_x_fontname): Change charset name of
Simplify Chinese fonts from gb2312 to gb2312.1980 and Korean fonts
from ksc5601 to ksc5601.1989.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Sun, 28 Jan 2001 11:23:07 +0000 |
parents | 94435b0ce7fd |
children | 350e6092a4c4 |
comparison
equal
deleted
inserted
replaced
35659:aa45cec8f927 | 35660:b9366f467430 |
---|---|
4363 /* Keywords. */ | 4363 /* Keywords. */ |
4364 | 4364 |
4365 extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; | 4365 extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; |
4366 extern Lisp_Object QCdata; | 4366 extern Lisp_Object QCdata; |
4367 Lisp_Object QCtype, QCascent, QCmargin, QCrelief; | 4367 Lisp_Object QCtype, QCascent, QCmargin, QCrelief; |
4368 Lisp_Object QCalgorithm, QCcolor_symbols, QCheuristic_mask; | 4368 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; |
4369 Lisp_Object QCindex; | 4369 Lisp_Object QCindex; |
4370 | 4370 |
4371 /* Other symbols. */ | 4371 /* Other symbols. */ |
4372 | 4372 |
4373 Lisp_Object Qlaplace; | 4373 Lisp_Object Qlaplace; |
4754 int | 4754 int |
4755 image_ascent (img, face) | 4755 image_ascent (img, face) |
4756 struct image *img; | 4756 struct image *img; |
4757 struct face *face; | 4757 struct face *face; |
4758 { | 4758 { |
4759 int height = img->height + img->margin; | 4759 int height = img->height + img->vmargin; |
4760 int ascent; | 4760 int ascent; |
4761 | 4761 |
4762 if (img->ascent == CENTERED_IMAGE_ASCENT) | 4762 if (img->ascent == CENTERED_IMAGE_ASCENT) |
4763 { | 4763 { |
4764 if (face->font) | 4764 if (face->font) |
5042 } | 5042 } |
5043 else | 5043 else |
5044 { | 5044 { |
5045 /* Handle image type independent image attributes | 5045 /* Handle image type independent image attributes |
5046 `:ascent PERCENT', `:margin MARGIN', `:relief RELIEF'. */ | 5046 `:ascent PERCENT', `:margin MARGIN', `:relief RELIEF'. */ |
5047 Lisp_Object ascent, margin, relief, algorithm, heuristic_mask; | 5047 Lisp_Object ascent, margin, relief; |
5048 Lisp_Object file; | |
5049 | 5048 |
5050 ascent = image_spec_value (spec, QCascent, NULL); | 5049 ascent = image_spec_value (spec, QCascent, NULL); |
5051 if (INTEGERP (ascent)) | 5050 if (INTEGERP (ascent)) |
5052 img->ascent = XFASTINT (ascent); | 5051 img->ascent = XFASTINT (ascent); |
5053 else if (EQ (ascent, Qcenter)) | 5052 else if (EQ (ascent, Qcenter)) |
5054 img->ascent = CENTERED_IMAGE_ASCENT; | 5053 img->ascent = CENTERED_IMAGE_ASCENT; |
5055 | 5054 |
5056 margin = image_spec_value (spec, QCmargin, NULL); | 5055 margin = image_spec_value (spec, QCmargin, NULL); |
5057 if (INTEGERP (margin) && XINT (margin) >= 0) | 5056 if (INTEGERP (margin) && XINT (margin) >= 0) |
5058 img->margin = XFASTINT (margin); | 5057 img->vmargin = img->hmargin = XFASTINT (margin); |
5058 else if (CONSP (margin) && INTEGERP (XCAR (margin)) | |
5059 && INTEGERP (XCDR (margin))) | |
5060 { | |
5061 if (XINT (XCAR (margin)) > 0) | |
5062 img->hmargin = XFASTINT (XCAR (margin)); | |
5063 if (XINT (XCDR (margin)) > 0) | |
5064 img->vmargin = XFASTINT (XCDR (margin)); | |
5065 } | |
5059 | 5066 |
5060 relief = image_spec_value (spec, QCrelief, NULL); | 5067 relief = image_spec_value (spec, QCrelief, NULL); |
5061 if (INTEGERP (relief)) | 5068 if (INTEGERP (relief)) |
5062 { | 5069 { |
5063 img->relief = XINT (relief); | 5070 img->relief = XINT (relief); |
5064 img->margin += abs (img->relief); | 5071 img->hmargin += abs (img->relief); |
5072 img->vmargin += abs (img->relief); | |
5065 } | 5073 } |
5066 | |
5067 /* Should we apply a Laplace edge-detection algorithm? */ | |
5068 algorithm = image_spec_value (spec, QCalgorithm, NULL); | |
5069 if (img->pixmap && EQ (algorithm, Qlaplace)) | |
5070 x_laplace (f, img); | |
5071 | |
5072 /* Should we built a mask heuristically? */ | |
5073 heuristic_mask = image_spec_value (spec, QCheuristic_mask, NULL); | |
5074 if (img->pixmap && !img->mask && !NILP (heuristic_mask)) | |
5075 x_build_heuristic_mask (f, img, heuristic_mask); | |
5076 } | 5074 } |
5077 } | 5075 } |
5078 | 5076 |
5079 /* We're using IMG, so set its timestamp to `now'. */ | 5077 /* We're using IMG, so set its timestamp to `now'. */ |
5080 EMACS_GET_TIME (now); | 5078 EMACS_GET_TIME (now); |
9783 #if 0 /* MAC_TODO: Image support for Mac Images. */ | 9781 #if 0 /* MAC_TODO: Image support for Mac Images. */ |
9784 Qxbm = intern ("xbm"); | 9782 Qxbm = intern ("xbm"); |
9785 staticpro (&Qxbm); | 9783 staticpro (&Qxbm); |
9786 QCtype = intern (":type"); | 9784 QCtype = intern (":type"); |
9787 staticpro (&QCtype); | 9785 staticpro (&QCtype); |
9788 QCalgorithm = intern (":algorithm"); | 9786 QCconversion = intern (":conversion"); |
9789 staticpro (&QCalgorithm); | 9787 staticpro (&QCconversion); |
9790 QCheuristic_mask = intern (":heuristic-mask"); | 9788 QCheuristic_mask = intern (":heuristic-mask"); |
9791 staticpro (&QCheuristic_mask); | 9789 staticpro (&QCheuristic_mask); |
9792 QCcolor_symbols = intern (":color-symbols"); | 9790 QCcolor_symbols = intern (":color-symbols"); |
9793 staticpro (&QCcolor_symbols); | 9791 staticpro (&QCcolor_symbols); |
9794 QCascent = intern (":ascent"); | 9792 QCascent = intern (":ascent"); |