diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xfns.c | 26 |
2 files changed, 24 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 26ee254877a..86932ba4e9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2001-05-30 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-05-30 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xfns.c (enum image_value_type): New enumerator | ||
| 4 | IMAGE_STRING_OR_NIL_VALUE. | ||
| 5 | (parse_image_spec): Handle it. | ||
| 6 | (xbm_format, pbm_format): Use it for :foreground and :background. | ||
| 7 | (xbm_load, pbm_load): Check for nil color names. | ||
| 8 | |||
| 3 | * xterm.c (note_mouse_highlight): If an overlapping overlay | 9 | * xterm.c (note_mouse_highlight): If an overlapping overlay |
| 4 | exists, but we find that we highlight the same overlay as before, | 10 | exists, but we find that we highlight the same overlay as before, |
| 5 | don't do the highlighting again. | 11 | don't do the highlighting again. |
diff --git a/src/xfns.c b/src/xfns.c index 485a2f9b4c7..53e7f090ef6 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5324,6 +5324,7 @@ enum image_value_type | |||
| 5324 | { | 5324 | { |
| 5325 | IMAGE_DONT_CHECK_VALUE_TYPE, | 5325 | IMAGE_DONT_CHECK_VALUE_TYPE, |
| 5326 | IMAGE_STRING_VALUE, | 5326 | IMAGE_STRING_VALUE, |
| 5327 | IMAGE_STRING_OR_NIL_VALUE, | ||
| 5327 | IMAGE_SYMBOL_VALUE, | 5328 | IMAGE_SYMBOL_VALUE, |
| 5328 | IMAGE_POSITIVE_INTEGER_VALUE, | 5329 | IMAGE_POSITIVE_INTEGER_VALUE, |
| 5329 | IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, | 5330 | IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, |
| @@ -5421,6 +5422,11 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 5421 | return 0; | 5422 | return 0; |
| 5422 | break; | 5423 | break; |
| 5423 | 5424 | ||
| 5425 | case IMAGE_STRING_OR_NIL_VALUE: | ||
| 5426 | if (!STRINGP (value) && !NILP (value)) | ||
| 5427 | return 0; | ||
| 5428 | break; | ||
| 5429 | |||
| 5424 | case IMAGE_SYMBOL_VALUE: | 5430 | case IMAGE_SYMBOL_VALUE: |
| 5425 | if (!SYMBOLP (value)) | 5431 | if (!SYMBOLP (value)) |
| 5426 | return 0; | 5432 | return 0; |
| @@ -6384,8 +6390,8 @@ static struct image_keyword xbm_format[XBM_LAST] = | |||
| 6384 | {":width", IMAGE_POSITIVE_INTEGER_VALUE, 0}, | 6390 | {":width", IMAGE_POSITIVE_INTEGER_VALUE, 0}, |
| 6385 | {":height", IMAGE_POSITIVE_INTEGER_VALUE, 0}, | 6391 | {":height", IMAGE_POSITIVE_INTEGER_VALUE, 0}, |
| 6386 | {":data", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, | 6392 | {":data", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, |
| 6387 | {":foreground", IMAGE_STRING_VALUE, 0}, | 6393 | {":foreground", IMAGE_STRING_OR_NIL_VALUE, 0}, |
| 6388 | {":background", IMAGE_STRING_VALUE, 0}, | 6394 | {":background", IMAGE_STRING_OR_NIL_VALUE, 0}, |
| 6389 | {":ascent", IMAGE_ASCENT_VALUE, 0}, | 6395 | {":ascent", IMAGE_ASCENT_VALUE, 0}, |
| 6390 | {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0}, | 6396 | {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0}, |
| 6391 | {":relief", IMAGE_INTEGER_VALUE, 0}, | 6397 | {":relief", IMAGE_INTEGER_VALUE, 0}, |
| @@ -6919,10 +6925,12 @@ xbm_load (f, img) | |||
| 6919 | } | 6925 | } |
| 6920 | 6926 | ||
| 6921 | /* Get foreground and background colors, maybe allocate colors. */ | 6927 | /* Get foreground and background colors, maybe allocate colors. */ |
| 6922 | if (fmt[XBM_FOREGROUND].count) | 6928 | if (fmt[XBM_FOREGROUND].count |
| 6929 | && STRINGP (fmt[XBM_FOREGROUND].value)) | ||
| 6923 | foreground = x_alloc_image_color (f, img, fmt[XBM_FOREGROUND].value, | 6930 | foreground = x_alloc_image_color (f, img, fmt[XBM_FOREGROUND].value, |
| 6924 | foreground); | 6931 | foreground); |
| 6925 | if (fmt[XBM_BACKGROUND].count) | 6932 | if (fmt[XBM_BACKGROUND].count |
| 6933 | && STRINGP (fmt[XBM_BACKGROUND].value)) | ||
| 6926 | background = x_alloc_image_color (f, img, fmt[XBM_BACKGROUND].value, | 6934 | background = x_alloc_image_color (f, img, fmt[XBM_BACKGROUND].value, |
| 6927 | background); | 6935 | background); |
| 6928 | 6936 | ||
| @@ -8110,8 +8118,8 @@ static struct image_keyword pbm_format[PBM_LAST] = | |||
| 8110 | {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, | 8118 | {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, |
| 8111 | {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, | 8119 | {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, |
| 8112 | {":mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, | 8120 | {":mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, |
| 8113 | {":foreground", IMAGE_STRING_VALUE, 0}, | 8121 | {":foreground", IMAGE_STRING_OR_NIL_VALUE, 0}, |
| 8114 | {":background", IMAGE_STRING_VALUE, 0} | 8122 | {":background", IMAGE_STRING_OR_NIL_VALUE, 0} |
| 8115 | }; | 8123 | }; |
| 8116 | 8124 | ||
| 8117 | /* Structure describing the image type `pbm'. */ | 8125 | /* Structure describing the image type `pbm'. */ |
| @@ -8309,9 +8317,11 @@ pbm_load (f, img) | |||
| 8309 | parse_image_spec (img->spec, fmt, PBM_LAST, Qpbm); | 8317 | parse_image_spec (img->spec, fmt, PBM_LAST, Qpbm); |
| 8310 | 8318 | ||
| 8311 | /* Get foreground and background colors, maybe allocate colors. */ | 8319 | /* Get foreground and background colors, maybe allocate colors. */ |
| 8312 | if (fmt[PBM_FOREGROUND].count) | 8320 | if (fmt[PBM_FOREGROUND].count |
| 8321 | && STRINGP (fmt[PBM_FOREGROUND].value)) | ||
| 8313 | fg = x_alloc_image_color (f, img, fmt[PBM_FOREGROUND].value, fg); | 8322 | fg = x_alloc_image_color (f, img, fmt[PBM_FOREGROUND].value, fg); |
| 8314 | if (fmt[PBM_BACKGROUND].count) | 8323 | if (fmt[PBM_BACKGROUND].count |
| 8324 | && STRINGP (fmt[PBM_BACKGROUND].value)) | ||
| 8315 | bg = x_alloc_image_color (f, img, fmt[PBM_BACKGROUND].value, bg); | 8325 | bg = x_alloc_image_color (f, img, fmt[PBM_BACKGROUND].value, bg); |
| 8316 | 8326 | ||
| 8317 | for (y = 0; y < height; ++y) | 8327 | for (y = 0; y < height; ++y) |