diff options
| author | Andrew Choi | 2001-01-28 11:23:07 +0000 |
|---|---|---|
| committer | Andrew Choi | 2001-01-28 11:23:07 +0000 |
| commit | 83a96b4d5479a91a4b53d6a6eb348497bba93179 (patch) | |
| tree | 7526b98d17d7af14439557d1ed8781a43dd9ae28 /mac/src | |
| parent | 847285704da07e3bf5526b6bd373ba1fe193ec35 (diff) | |
| download | emacs-83a96b4d5479a91a4b53d6a6eb348497bba93179.tar.gz emacs-83a96b4d5479a91a4b53d6a6eb348497bba93179.zip | |
* 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.
Diffstat (limited to 'mac/src')
| -rw-r--r-- | mac/src/macfns.c | 34 | ||||
| -rw-r--r-- | mac/src/macterm.c | 39 |
2 files changed, 31 insertions, 42 deletions
diff --git a/mac/src/macfns.c b/mac/src/macfns.c index 490da7979fe..7bf97d88cc2 100644 --- a/mac/src/macfns.c +++ b/mac/src/macfns.c | |||
| @@ -4365,7 +4365,7 @@ Lisp_Object Qxbm; | |||
| 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. */ |
| @@ -4756,7 +4756,7 @@ 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) |
| @@ -5044,8 +5044,7 @@ lookup_image (f, spec) | |||
| 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)) |
| @@ -5055,24 +5054,23 @@ lookup_image (f, spec) | |||
| 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 | ||
| @@ -9785,8 +9783,8 @@ meaning don't clear the cache."); | |||
| 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"); |
diff --git a/mac/src/macterm.c b/mac/src/macterm.c index 0676e47864e..ed9280e42eb 100644 --- a/mac/src/macterm.c +++ b/mac/src/macterm.c | |||
| @@ -2051,8 +2051,8 @@ x_produce_image_glyph (it) | |||
| 2051 | prepare_image_for_display (it->f, img); | 2051 | prepare_image_for_display (it->f, img); |
| 2052 | 2052 | ||
| 2053 | it->ascent = it->phys_ascent = image_ascent (img, face); | 2053 | it->ascent = it->phys_ascent = image_ascent (img, face); |
| 2054 | it->descent = it->phys_descent = img->height + 2 * img->margin - it->ascent; | 2054 | it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; |
| 2055 | it->pixel_width = img->width + 2 * img->margin; | 2055 | it->pixel_width = img->width + 2 * img->hmargin; |
| 2056 | 2056 | ||
| 2057 | it->nglyphs = 1; | 2057 | it->nglyphs = 1; |
| 2058 | 2058 | ||
| @@ -4190,11 +4190,8 @@ x_draw_image_foreground (s) | |||
| 4190 | 4190 | ||
| 4191 | /* If there is a margin around the image, adjust x- and y-position | 4191 | /* If there is a margin around the image, adjust x- and y-position |
| 4192 | by that margin. */ | 4192 | by that margin. */ |
| 4193 | if (s->img->margin) | 4193 | x += s->img->hmargin; |
| 4194 | { | 4194 | y += s->img->vmargin; |
| 4195 | x += s->img->margin; | ||
| 4196 | y += s->img->margin; | ||
| 4197 | } | ||
| 4198 | 4195 | ||
| 4199 | if (s->img->pixmap) | 4196 | if (s->img->pixmap) |
| 4200 | { | 4197 | { |
| @@ -4271,11 +4268,8 @@ x_draw_image_relief (s) | |||
| 4271 | 4268 | ||
| 4272 | /* If there is a margin around the image, adjust x- and y-position | 4269 | /* If there is a margin around the image, adjust x- and y-position |
| 4273 | by that margin. */ | 4270 | by that margin. */ |
| 4274 | if (s->img->margin) | 4271 | x += s->img->hmargin; |
| 4275 | { | 4272 | y += s->img->vmargin; |
| 4276 | x += s->img->margin; | ||
| 4277 | y += s->img->margin; | ||
| 4278 | } | ||
| 4279 | 4273 | ||
| 4280 | if (s->hl == DRAW_IMAGE_SUNKEN | 4274 | if (s->hl == DRAW_IMAGE_SUNKEN |
| 4281 | || s->hl == DRAW_IMAGE_RAISED) | 4275 | || s->hl == DRAW_IMAGE_RAISED) |
| @@ -4320,11 +4314,8 @@ x_draw_image_foreground_1 (s, pixmap) | |||
| 4320 | 4314 | ||
| 4321 | /* If there is a margin around the image, adjust x- and y-position | 4315 | /* If there is a margin around the image, adjust x- and y-position |
| 4322 | by that margin. */ | 4316 | by that margin. */ |
| 4323 | if (s->img->margin) | 4317 | x += s->img->hmargin; |
| 4324 | { | 4318 | y += s->img->vmargin; |
| 4325 | x += s->img->margin; | ||
| 4326 | y += s->img->margin; | ||
| 4327 | } | ||
| 4328 | 4319 | ||
| 4329 | if (s->img->pixmap) | 4320 | if (s->img->pixmap) |
| 4330 | { | 4321 | { |
| @@ -4403,7 +4394,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h) | |||
| 4403 | | s->face->box | 4394 | | s->face->box |
| 4404 | | | 4395 | | |
| 4405 | | +------------------------- | 4396 | | +------------------------- |
| 4406 | | | s->img->margin | 4397 | | | s->img->vmargin |
| 4407 | | | | 4398 | | | |
| 4408 | | | +------------------- | 4399 | | | +------------------- |
| 4409 | | | | the image | 4400 | | | | the image |
| @@ -4416,7 +4407,6 @@ x_draw_image_glyph_string (s) | |||
| 4416 | { | 4407 | { |
| 4417 | int x, y; | 4408 | int x, y; |
| 4418 | int box_line_width = s->face->box_line_width; | 4409 | int box_line_width = s->face->box_line_width; |
| 4419 | int margin = s->img->margin; | ||
| 4420 | int height; | 4410 | int height; |
| 4421 | Pixmap pixmap = 0; | 4411 | Pixmap pixmap = 0; |
| 4422 | 4412 | ||
| @@ -4427,7 +4417,8 @@ x_draw_image_glyph_string (s) | |||
| 4427 | flickering. */ | 4417 | flickering. */ |
| 4428 | s->stippled_p = s->face->stipple != 0; | 4418 | s->stippled_p = s->face->stipple != 0; |
| 4429 | if (height > s->img->height | 4419 | if (height > s->img->height |
| 4430 | || margin | 4420 | || s->img->vmargin |
| 4421 | || s->img->hmargin | ||
| 4431 | #if 0 /* MAC_TODO: image mask */ | 4422 | #if 0 /* MAC_TODO: image mask */ |
| 4432 | || s->img->mask | 4423 | || s->img->mask |
| 4433 | #endif | 4424 | #endif |
| @@ -10278,13 +10269,13 @@ mac_to_x_fontname (char *name, int size, Style style, short scriptcode) | |||
| 10278 | strcpy(cs, "big5-0"); | 10269 | strcpy(cs, "big5-0"); |
| 10279 | break; | 10270 | break; |
| 10280 | case smSimpChinese: | 10271 | case smSimpChinese: |
| 10281 | strcpy(cs, "gb2312-0"); | 10272 | strcpy(cs, "gb2312.1980-0"); |
| 10282 | break; | 10273 | break; |
| 10283 | case smJapanese: | 10274 | case smJapanese: |
| 10284 | strcpy(cs, "jisx0208.1983-sjis"); | 10275 | strcpy(cs, "jisx0208.1983-sjis"); |
| 10285 | break; | 10276 | break; |
| 10286 | case smKorean: | 10277 | case smKorean: |
| 10287 | strcpy(cs, "ksc5601-0"); | 10278 | strcpy(cs, "ksc5601.1989-0"); |
| 10288 | break; | 10279 | break; |
| 10289 | default: | 10280 | default: |
| 10290 | strcpy(cs, "mac-roman"); | 10281 | strcpy(cs, "mac-roman"); |
| @@ -10324,9 +10315,9 @@ x_font_name_to_mac_font_name (char *xf, char *mf) | |||
| 10324 | foundry, family, weight, slant, cs) != 5) | 10315 | foundry, family, weight, slant, cs) != 5) |
| 10325 | return; | 10316 | return; |
| 10326 | 10317 | ||
| 10327 | if (strcmp (cs, "big5-0") == 0 || strcmp (cs, "gb2312-0") == 0 | 10318 | if (strcmp (cs, "big5-0") == 0 || strcmp (cs, "gb2312.1980-0") == 0 |
| 10328 | || strcmp (cs, "jisx0208.1983-sjis") == 0 | 10319 | || strcmp (cs, "jisx0208.1983-sjis") == 0 |
| 10329 | || strcmp (cs, "ksc5601-0") == 0 || strcmp (cs, "mac-roman") == 0) | 10320 | || strcmp (cs, "ksc5601.1989-0") == 0 || strcmp (cs, "mac-roman") == 0) |
| 10330 | strcpy(mf, family); | 10321 | strcpy(mf, family); |
| 10331 | else | 10322 | else |
| 10332 | sprintf(mf, "%s-%s-%s", foundry, family, cs); | 10323 | sprintf(mf, "%s-%s-%s", foundry, family, cs); |