aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2001-01-13 00:04:05 +0000
committerJason Rumney2001-01-13 00:04:05 +0000
commit8edb0a6fb70af8aa228ec8f526245982114dfbb9 (patch)
tree613a480a575e2183fa99f1ace1e107d5eec8bddc /src
parentd6ff54d52ff06a8bf18fa1e26261449ecb12ca0f (diff)
downloademacs-8edb0a6fb70af8aa228ec8f526245982114dfbb9.tar.gz
emacs-8edb0a6fb70af8aa228ec8f526245982114dfbb9.zip
(x_to_w32_color, x_set_icon_name, xlfd_strip_height)
(w32_list_synthesized_fonts, lookup_image, Fx_file_dialog) (Fw32_send_sys_command): Remove unused variables. (w32_msg_pump): Add parentheses. (Fimage_size, image_ascent, lookup_image) (IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, parse_image_spec) (xbm_format, xpm_format, pbm_format, png_format, jpeg_format) (tiff_format, gif_format, gs_format): Adapt to change of image margins.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog29
-rw-r--r--src/w32fns.c223
2 files changed, 179 insertions, 73 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d9432a3e88c..476f35b25c6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,32 @@
12001-01-13 Jason Rumney <jasonr@gnu.org>
2
3 * w32fns.c (Fimage_size, image_ascent, lookup_image)
4 (IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, parse_image_spec)
5 (xbm_format, xpm_format, pbm_format, png_format, jpeg_format)
6 (tiff_format, gif_format, gs_format): Adapt to change of image
7 margins.
8
9 * w32term.c (x_produce_image_glyph, x_draw_image_foreground)
10 (x_draw_image_relief, x_draw_image_foreground_1)
11 (x_draw_image_glyph_string): Adapt to change of image margins.
12
13 * w32.c (init_environment, sys_shutdown, sys_pipe): Remove unused
14 variables.
15
16 * w32bdf.c (search_file_line, get_cached_font_char)
17 (cache_char_offset, create_offscreen_bitmap): Remove unused variables.
18
19 * w32inevt.c (w32_console_toggle_lock_key): Add parentheses.
20
21 * w32fns.c (x_to_w32_color, x_set_icon_name, xlfd_strip_height)
22 (w32_list_synthesized_fonts, lookup_image, Fx_file_dialog)
23 (Fw32_send_sys_command): Remove unused variables.
24 (w32_msg_pump): Add parentheses.
25
26 * w32term.c (w32_fill_rect, w32_read_socket, x_bitmap_icon)
27 (x_new_fontset, x_calc_absolute_position, x_iconify_frame):
28 Add parentheses.
29
12001-01-12 Gerd Moellmann <gerd@gnu.org> 302001-01-12 Gerd Moellmann <gerd@gnu.org>
2 31
3 * xdisp.c (Vtool_bar_button_margin): Replaces tool_bar_button_margin. 32 * xdisp.c (Vtool_bar_button_margin): Replaces tool_bar_button_margin.
diff --git a/src/w32fns.c b/src/w32fns.c
index ab750acbac3..ae538ab5cd7 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1509,8 +1509,8 @@ COLORREF
1509x_to_w32_color (colorname) 1509x_to_w32_color (colorname)
1510 char * colorname; 1510 char * colorname;
1511{ 1511{
1512 register Lisp_Object tail, ret = Qnil; 1512 register Lisp_Object ret = Qnil;
1513 1513
1514 BLOCK_INPUT; 1514 BLOCK_INPUT;
1515 1515
1516 if (colorname[0] == '#') 1516 if (colorname[0] == '#')
@@ -2347,8 +2347,6 @@ x_set_icon_name (f, arg, oldval)
2347 struct frame *f; 2347 struct frame *f;
2348 Lisp_Object arg, oldval; 2348 Lisp_Object arg, oldval;
2349{ 2349{
2350 int result;
2351
2352 if (STRINGP (arg)) 2350 if (STRINGP (arg))
2353 { 2351 {
2354 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) 2352 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
@@ -3832,7 +3830,7 @@ w32_msg_pump (deferred_msg * msg_buf)
3832 immediate values. */ 3830 immediate values. */
3833 if (NILP (new_state) 3831 if (NILP (new_state)
3834 || (NUMBERP (new_state) 3832 || (NUMBERP (new_state)
3835 && (XUINT (new_state)) & 1 != cur_state)) 3833 && ((XUINT (new_state)) & 1) != cur_state))
3836 { 3834 {
3837 one_w32_display_info.faked_key = vk_code; 3835 one_w32_display_info.faked_key = vk_code;
3838 3836
@@ -5517,9 +5515,10 @@ char * xlfd_charset_of_font (char * fontname)
5517 5515
5518struct font_info *w32_load_bdf_font (struct frame *f, char *fontname, 5516struct font_info *w32_load_bdf_font (struct frame *f, char *fontname,
5519 int size, char* filename); 5517 int size, char* filename);
5518static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names);
5520BOOL w32_to_x_font (LOGFONT * lplf, char * lpxstr, int len, char * charset); 5519BOOL w32_to_x_font (LOGFONT * lplf, char * lpxstr, int len, char * charset);
5521 5520
5522struct font_info * 5521static struct font_info *
5523w32_load_system_font (f,fontname,size) 5522w32_load_system_font (f,fontname,size)
5524 struct frame *f; 5523 struct frame *f;
5525 char * fontname; 5524 char * fontname;
@@ -5729,7 +5728,7 @@ int size;
5729 Lisp_Object bdf_fonts; 5728 Lisp_Object bdf_fonts;
5730 struct font_info *retval = NULL; 5729 struct font_info *retval = NULL;
5731 5730
5732 bdf_fonts = w32_list_bdf_fonts (build_string (fontname)); 5731 bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1);
5733 5732
5734 while (!retval && CONSP (bdf_fonts)) 5733 while (!retval && CONSP (bdf_fonts))
5735 { 5734 {
@@ -5790,7 +5789,7 @@ w32_unload_font (dpyinfo, font)
5790 * ) 5789 * )
5791 */ 5790 */
5792 5791
5793LONG 5792static LONG
5794x_to_w32_weight (lpw) 5793x_to_w32_weight (lpw)
5795 char * lpw; 5794 char * lpw;
5796{ 5795{
@@ -5811,7 +5810,7 @@ x_to_w32_weight (lpw)
5811} 5810}
5812 5811
5813 5812
5814char * 5813static char *
5815w32_to_x_weight (fnweight) 5814w32_to_x_weight (fnweight)
5816 int fnweight; 5815 int fnweight;
5817{ 5816{
@@ -5828,7 +5827,7 @@ w32_to_x_weight (fnweight)
5828 return "*"; 5827 return "*";
5829} 5828}
5830 5829
5831LONG 5830static LONG
5832x_to_w32_charset (lpcs) 5831x_to_w32_charset (lpcs)
5833 char * lpcs; 5832 char * lpcs;
5834{ 5833{
@@ -5899,7 +5898,7 @@ x_to_w32_charset (lpcs)
5899} 5898}
5900 5899
5901 5900
5902char * 5901static char *
5903w32_to_x_charset (fncharset) 5902w32_to_x_charset (fncharset)
5904 int fncharset; 5903 int fncharset;
5905{ 5904{
@@ -6109,7 +6108,7 @@ w32_codepage_for_font (char *fontname)
6109} 6108}
6110 6109
6111 6110
6112BOOL 6111static BOOL
6113w32_to_x_font (lplogfont, lpxstr, len, specific_charset) 6112w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
6114 LOGFONT * lplogfont; 6113 LOGFONT * lplogfont;
6115 char * lpxstr; 6114 char * lpxstr;
@@ -6197,7 +6196,7 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
6197 return (TRUE); 6196 return (TRUE);
6198} 6197}
6199 6198
6200BOOL 6199static BOOL
6201x_to_w32_font (lpxstr, lplogfont) 6200x_to_w32_font (lpxstr, lplogfont)
6202 char * lpxstr; 6201 char * lpxstr;
6203 LOGFONT * lplogfont; 6202 LOGFONT * lplogfont;
@@ -6369,9 +6368,10 @@ x_to_w32_font (lpxstr, lplogfont)
6369 one from the point height, or if that isn't defined either, return 6368 one from the point height, or if that isn't defined either, return
6370 0 (which usually signifies a scalable font). 6369 0 (which usually signifies a scalable font).
6371*/ 6370*/
6372int xlfd_strip_height (char *fontname) 6371static int
6372xlfd_strip_height (char *fontname)
6373{ 6373{
6374 int pixel_height, point_height, dpi, field_number; 6374 int pixel_height, field_number;
6375 char *read_from, *write_to; 6375 char *read_from, *write_to;
6376 6376
6377 xassert (fontname); 6377 xassert (fontname);
@@ -6484,7 +6484,7 @@ int xlfd_strip_height (char *fontname)
6484} 6484}
6485 6485
6486/* Assume parameter 1 is fully qualified, no wildcards. */ 6486/* Assume parameter 1 is fully qualified, no wildcards. */
6487BOOL 6487static BOOL
6488w32_font_match (fontname, pattern) 6488w32_font_match (fontname, pattern)
6489 char * fontname; 6489 char * fontname;
6490 char * pattern; 6490 char * pattern;
@@ -6556,7 +6556,7 @@ typedef struct enumfont_t
6556 Lisp_Object *tail; 6556 Lisp_Object *tail;
6557} enumfont_t; 6557} enumfont_t;
6558 6558
6559int CALLBACK 6559static int CALLBACK
6560enum_font_cb2 (lplf, lptm, FontType, lpef) 6560enum_font_cb2 (lplf, lptm, FontType, lpef)
6561 ENUMLOGFONT * lplf; 6561 ENUMLOGFONT * lplf;
6562 NEWTEXTMETRIC * lptm; 6562 NEWTEXTMETRIC * lptm;
@@ -6630,7 +6630,7 @@ enum_font_cb2 (lplf, lptm, FontType, lpef)
6630 return (1); 6630 return (1);
6631} 6631}
6632 6632
6633int CALLBACK 6633static int CALLBACK
6634enum_font_cb1 (lplf, lptm, FontType, lpef) 6634enum_font_cb1 (lplf, lptm, FontType, lpef)
6635 ENUMLOGFONT * lplf; 6635 ENUMLOGFONT * lplf;
6636 NEWTEXTMETRIC * lptm; 6636 NEWTEXTMETRIC * lptm;
@@ -6644,7 +6644,7 @@ enum_font_cb1 (lplf, lptm, FontType, lpef)
6644} 6644}
6645 6645
6646 6646
6647int CALLBACK 6647static int CALLBACK
6648enum_fontex_cb2 (lplf, lptm, font_type, lpef) 6648enum_fontex_cb2 (lplf, lptm, font_type, lpef)
6649 ENUMLOGFONTEX * lplf; 6649 ENUMLOGFONTEX * lplf;
6650 NEWTEXTMETRICEX * lptm; 6650 NEWTEXTMETRICEX * lptm;
@@ -6658,7 +6658,7 @@ enum_fontex_cb2 (lplf, lptm, font_type, lpef)
6658 font_type, lpef); 6658 font_type, lpef);
6659} 6659}
6660 6660
6661int CALLBACK 6661static int CALLBACK
6662enum_fontex_cb1 (lplf, lptm, font_type, lpef) 6662enum_fontex_cb1 (lplf, lptm, font_type, lpef)
6663 ENUMLOGFONTEX * lplf; 6663 ENUMLOGFONTEX * lplf;
6664 NEWTEXTMETRICEX * lptm; 6664 NEWTEXTMETRICEX * lptm;
@@ -6681,7 +6681,7 @@ enum_fontex_cb1 (lplf, lptm, font_type, lpef)
6681/* Interface to fontset handler. (adapted from mw32font.c in Meadow 6681/* Interface to fontset handler. (adapted from mw32font.c in Meadow
6682 and xterm.c in Emacs 20.3) */ 6682 and xterm.c in Emacs 20.3) */
6683 6683
6684Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) 6684static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
6685{ 6685{
6686 char *fontname, *ptnstr; 6686 char *fontname, *ptnstr;
6687 Lisp_Object list, tem, newlist = Qnil; 6687 Lisp_Object list, tem, newlist = Qnil;
@@ -6712,8 +6712,9 @@ Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
6712 return newlist; 6712 return newlist;
6713} 6713}
6714 6714
6715Lisp_Object w32_list_synthesized_fonts (FRAME_PTR f, Lisp_Object pattern, 6715static Lisp_Object w32_list_synthesized_fonts (FRAME_PTR f,
6716 int size, int max_names); 6716 Lisp_Object pattern,
6717 int size, int max_names);
6717 6718
6718/* Return a list of names of available fonts matching PATTERN on frame 6719/* Return a list of names of available fonts matching PATTERN on frame
6719 F. If SIZE is not 0, it is the size (maximum bound width) of fonts 6720 F. If SIZE is not 0, it is the size (maximum bound width) of fonts
@@ -6920,7 +6921,7 @@ w32_list_fonts (FRAME_PTR f, Lisp_Object pattern, int size, int maxnames )
6920 return newlist; 6921 return newlist;
6921} 6922}
6922 6923
6923Lisp_Object 6924static Lisp_Object
6924w32_list_synthesized_fonts (f, pattern, size, max_names) 6925w32_list_synthesized_fonts (f, pattern, size, max_names)
6925 FRAME_PTR f; 6926 FRAME_PTR f;
6926 Lisp_Object pattern; 6927 Lisp_Object pattern;
@@ -6930,7 +6931,7 @@ w32_list_synthesized_fonts (f, pattern, size, max_names)
6930 int fields; 6931 int fields;
6931 char *full_pattn, *new_pattn, foundary[50], family[50], *pattn_part2; 6932 char *full_pattn, *new_pattn, foundary[50], family[50], *pattn_part2;
6932 char style[20], slant; 6933 char style[20], slant;
6933 Lisp_Object matches, match, tem, synthed_matches = Qnil; 6934 Lisp_Object matches, tem, synthed_matches = Qnil;
6934 6935
6935 full_pattn = XSTRING (pattern)->data; 6936 full_pattn = XSTRING (pattern)->data;
6936 6937
@@ -7032,6 +7033,29 @@ w32_find_ccl_program (fontp)
7032} 7033}
7033 7034
7034 7035
7036/* Find BDF files in a specified directory. (use GCPRO when calling,
7037 as this calls lisp to get a directory listing). */
7038static Lisp_Object
7039w32_find_bdf_fonts_in_dir (Lisp_Object directory)
7040{
7041 Lisp_Object filelist, list = Qnil;
7042 char fontname[100];
7043
7044 if (!STRINGP(directory))
7045 return Qnil;
7046
7047 filelist = Fdirectory_files (directory, Qt,
7048 build_string (".*\\.[bB][dD][fF]"), Qt);
7049
7050 for ( ; CONSP(filelist); filelist = XCDR (filelist))
7051 {
7052 Lisp_Object filename = XCAR (filelist);
7053 if (w32_BDF_to_x_font (XSTRING (filename)->data, fontname, 100))
7054 store_in_alist (&list, build_string (fontname), filename);
7055 }
7056 return list;
7057}
7058
7035DEFUN ("w32-find-bdf-fonts", Fw32_find_bdf_fonts, Sw32_find_bdf_fonts, 7059DEFUN ("w32-find-bdf-fonts", Fw32_find_bdf_fonts, Sw32_find_bdf_fonts,
7036 1, 1, 0, 7060 1, 1, 0,
7037 "Return a list of BDF fonts in DIR, suitable for appending to\n\ 7061 "Return a list of BDF fonts in DIR, suitable for appending to\n\
@@ -7059,28 +7083,6 @@ will not be included in the list. DIR may be a list of directories.")
7059 return list; 7083 return list;
7060} 7084}
7061 7085
7062/* Find BDF files in a specified directory. (use GCPRO when calling,
7063 as this calls lisp to get a directory listing). */
7064Lisp_Object w32_find_bdf_fonts_in_dir( Lisp_Object directory )
7065{
7066 Lisp_Object filelist, list = Qnil;
7067 char fontname[100];
7068
7069 if (!STRINGP(directory))
7070 return Qnil;
7071
7072 filelist = Fdirectory_files (directory, Qt,
7073 build_string (".*\\.[bB][dD][fF]"), Qt);
7074
7075 for ( ; CONSP(filelist); filelist = XCDR (filelist))
7076 {
7077 Lisp_Object filename = XCAR (filelist);
7078 if (w32_BDF_to_x_font (XSTRING (filename)->data, fontname, 100))
7079 store_in_alist (&list, build_string (fontname), filename);
7080 }
7081 return list;
7082}
7083
7084 7086
7085DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, 7087DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
7086 "Internal function called by `color-defined-p', which see.") 7088 "Internal function called by `color-defined-p', which see.")
@@ -7720,6 +7722,7 @@ enum image_value_type
7720 IMAGE_STRING_VALUE, 7722 IMAGE_STRING_VALUE,
7721 IMAGE_SYMBOL_VALUE, 7723 IMAGE_SYMBOL_VALUE,
7722 IMAGE_POSITIVE_INTEGER_VALUE, 7724 IMAGE_POSITIVE_INTEGER_VALUE,
7725 IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7723 IMAGE_NON_NEGATIVE_INTEGER_VALUE, 7726 IMAGE_NON_NEGATIVE_INTEGER_VALUE,
7724 IMAGE_ASCENT_VALUE, 7727 IMAGE_ASCENT_VALUE,
7725 IMAGE_INTEGER_VALUE, 7728 IMAGE_INTEGER_VALUE,
@@ -7824,6 +7827,15 @@ parse_image_spec (spec, keywords, nkeywords, type)
7824 return 0; 7827 return 0;
7825 break; 7828 break;
7826 7829
7830 case IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR:
7831 if (INTEGERP (value) && XINT (value) >= 0)
7832 break;
7833 if (CONSP (value)
7834 && INTEGERP (XCAR (value)) && INTEGERP (XCDR (value))
7835 && XINT (XCAR (value)) >= 0 && XINT (XCDR (value)) >= 0)
7836 break;
7837 return 0;
7838
7827 case IMAGE_ASCENT_VALUE: 7839 case IMAGE_ASCENT_VALUE:
7828 if (SYMBOLP (value) && EQ (value, Qcenter)) 7840 if (SYMBOLP (value) && EQ (value, Qcenter))
7829 break; 7841 break;
@@ -8003,7 +8015,7 @@ image_ascent (img, face)
8003 struct image *img; 8015 struct image *img;
8004 struct face *face; 8016 struct face *face;
8005{ 8017{
8006 int height = img->height + img->margin; 8018 int height = img->height + img->vmargin;
8007 int ascent; 8019 int ascent;
8008 8020
8009 if (img->ascent == CENTERED_IMAGE_ASCENT) 8021 if (img->ascent == CENTERED_IMAGE_ASCENT)
@@ -8268,10 +8280,10 @@ lookup_image (f, spec)
8268 /* If not found, create a new image and cache it. */ 8280 /* If not found, create a new image and cache it. */
8269 if (img == NULL) 8281 if (img == NULL)
8270 { 8282 {
8283 BLOCK_INPUT;
8271 img = make_image (spec, hash); 8284 img = make_image (spec, hash);
8272 cache_image (f, img); 8285 cache_image (f, img);
8273 img->load_failed_p = img->type->load (f, img) == 0; 8286 img->load_failed_p = img->type->load (f, img) == 0;
8274 xassert (!interrupt_input_blocked);
8275 8287
8276 /* If we can't load the image, and we don't have a width and 8288 /* If we can't load the image, and we don't have a width and
8277 height, use some arbitrary width and height so that we can 8289 height, use some arbitrary width and height so that we can
@@ -8291,8 +8303,7 @@ lookup_image (f, spec)
8291 { 8303 {
8292 /* Handle image type independent image attributes 8304 /* Handle image type independent image attributes
8293 `:ascent PERCENT', `:margin MARGIN', `:relief RELIEF'. */ 8305 `:ascent PERCENT', `:margin MARGIN', `:relief RELIEF'. */
8294 Lisp_Object ascent, margin, relief, algorithm, heuristic_mask; 8306 Lisp_Object ascent, margin, relief;
8295 Lisp_Object file;
8296 8307
8297 ascent = image_spec_value (spec, QCascent, NULL); 8308 ascent = image_spec_value (spec, QCascent, NULL);
8298 if (INTEGERP (ascent)) 8309 if (INTEGERP (ascent))
@@ -8302,25 +8313,94 @@ lookup_image (f, spec)
8302 8313
8303 margin = image_spec_value (spec, QCmargin, NULL); 8314 margin = image_spec_value (spec, QCmargin, NULL);
8304 if (INTEGERP (margin) && XINT (margin) >= 0) 8315 if (INTEGERP (margin) && XINT (margin) >= 0)
8305 img->margin = XFASTINT (margin); 8316 img->vmargin = img->hmargin = XFASTINT (margin);
8317 else if (CONSP (margin) && INTEGERP (XCAR (margin))
8318 && INTEGERP (XCDR (margin)))
8319 {
8320 if (XINT (XCAR (margin)) > 0)
8321 img->hmargin = XFASTINT (XCAR (margin));
8322 if (XINT (XCDR (margin)) > 0)
8323 img->vmargin = XFASTINT (XCDR (margin));
8324 }
8306 8325
8307 relief = image_spec_value (spec, QCrelief, NULL); 8326 relief = image_spec_value (spec, QCrelief, NULL);
8308 if (INTEGERP (relief)) 8327 if (INTEGERP (relief))
8309 { 8328 {
8310 img->relief = XINT (relief); 8329 img->relief = XINT (relief);
8311 img->margin += abs (img->relief); 8330 img->hmargin += abs (img->relief);
8331 img->vmargin += abs (img->relief);
8312 } 8332 }
8313 8333
8314 /* Should we apply a Laplace edge-detection algorithm? */ 8334#if 0 /* TODO: image mask and algorithm. */
8315 algorithm = image_spec_value (spec, QCalgorithm, NULL); 8335 /* Manipulation of the image's mask. */
8316 if (img->pixmap && EQ (algorithm, Qlaplace)) 8336 if (img->pixmap)
8317 x_laplace (f, img); 8337 {
8318 8338 /* `:heuristic-mask t'
8319 /* Should we built a mask heuristically? */ 8339 `:mask heuristic'
8320 heuristic_mask = image_spec_value (spec, QCheuristic_mask, NULL); 8340 means build a mask heuristically.
8321 if (img->pixmap && !img->mask && !NILP (heuristic_mask)) 8341 `:heuristic-mask (R G B)'
8322 x_build_heuristic_mask (f, img, heuristic_mask); 8342 `:mask (heuristic (R G B))'
8343 means build a mask from color (R G B) in the
8344 image.
8345 `:mask nil'
8346 means remove a mask, if any. */
8347
8348 Lisp_Object mask;
8349
8350 mask = image_spec_value (spec, QCheuristic_mask, NULL);
8351 if (!NILP (mask))
8352 x_build_heuristic_mask (f, img, mask);
8353 else
8354 {
8355 int found_p;
8356
8357 mask = image_spec_value (spec, QCmask, &found_p);
8358
8359 if (EQ (mask, Qheuristic))
8360 x_build_heuristic_mask (f, img, Qt);
8361 else if (CONSP (mask)
8362 && EQ (XCAR (mask), Qheuristic))
8363 {
8364 if (CONSP (XCDR (mask)))
8365 x_build_heuristic_mask (f, img, XCAR (XCDR (mask)));
8366 else
8367 x_build_heuristic_mask (f, img, XCDR (mask));
8368 }
8369 else if (NILP (mask) && found_p && img->mask)
8370 {
8371 XFreePixmap (FRAME_X_DISPLAY (f), img->mask);
8372 img->mask = None;
8373 }
8374 }
8375 }
8376
8377 /* Should we apply an image transformation algorithm? */
8378 if (img->pixmap)
8379 {
8380 Lisp_Object algorithm;
8381
8382 algorithm = image_spec_value (spec, QCalgorithm, NULL);
8383 if (EQ (algorithm, Qdisabled))
8384 x_disable_image (f, img);
8385 else if (EQ (algorithm, Qlaplace))
8386 x_laplace (f, img);
8387 else if (EQ (algorithm, Qemboss))
8388 x_emboss (f, img);
8389 else if (CONSP (algorithm)
8390 && EQ (XCAR (algorithm), Qedge_detection))
8391 {
8392 Lisp_Object tem;
8393 tem = XCDR (algorithm);
8394 if (CONSP (tem))
8395 x_edge_detection (f, img,
8396 Fplist_get (tem, QCmatrix),
8397 Fplist_get (tem, QCcolor_adjustment));
8398 }
8399 }
8400#endif /* TODO. */
8323 } 8401 }
8402 UNBLOCK_INPUT;
8403 xassert (!interrupt_input_blocked);
8324 } 8404 }
8325 8405
8326 /* We're using IMG, so set its timestamp to `now'. */ 8406 /* We're using IMG, so set its timestamp to `now'. */
@@ -8572,7 +8652,7 @@ static struct image_keyword xbm_format[XBM_LAST] =
8572 {":foreground", IMAGE_STRING_VALUE, 0}, 8652 {":foreground", IMAGE_STRING_VALUE, 0},
8573 {":background", IMAGE_STRING_VALUE, 0}, 8653 {":background", IMAGE_STRING_VALUE, 0},
8574 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 8654 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
8575 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 8655 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
8576 {":relief", IMAGE_INTEGER_VALUE, 0}, 8656 {":relief", IMAGE_INTEGER_VALUE, 0},
8577 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 8657 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
8578 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 8658 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -9162,7 +9242,7 @@ static struct image_keyword xpm_format[XPM_LAST] =
9162 {":file", IMAGE_STRING_VALUE, 0}, 9242 {":file", IMAGE_STRING_VALUE, 0},
9163 {":data", IMAGE_STRING_VALUE, 0}, 9243 {":data", IMAGE_STRING_VALUE, 0},
9164 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 9244 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
9165 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 9245 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
9166 {":relief", IMAGE_INTEGER_VALUE, 0}, 9246 {":relief", IMAGE_INTEGER_VALUE, 0},
9167 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 9247 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
9168 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 9248 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
@@ -9852,7 +9932,7 @@ static struct image_keyword pbm_format[PBM_LAST] =
9852 {":file", IMAGE_STRING_VALUE, 0}, 9932 {":file", IMAGE_STRING_VALUE, 0},
9853 {":data", IMAGE_STRING_VALUE, 0}, 9933 {":data", IMAGE_STRING_VALUE, 0},
9854 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 9934 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
9855 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 9935 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
9856 {":relief", IMAGE_INTEGER_VALUE, 0}, 9936 {":relief", IMAGE_INTEGER_VALUE, 0},
9857 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 9937 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
9858 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 9938 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -10208,7 +10288,7 @@ static struct image_keyword png_format[PNG_LAST] =
10208 {":data", IMAGE_STRING_VALUE, 0}, 10288 {":data", IMAGE_STRING_VALUE, 0},
10209 {":file", IMAGE_STRING_VALUE, 0}, 10289 {":file", IMAGE_STRING_VALUE, 0},
10210 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 10290 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
10211 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 10291 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
10212 {":relief", IMAGE_INTEGER_VALUE, 0}, 10292 {":relief", IMAGE_INTEGER_VALUE, 0},
10213 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 10293 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
10214 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 10294 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -10694,7 +10774,7 @@ static struct image_keyword jpeg_format[JPEG_LAST] =
10694 {":data", IMAGE_STRING_VALUE, 0}, 10774 {":data", IMAGE_STRING_VALUE, 0},
10695 {":file", IMAGE_STRING_VALUE, 0}, 10775 {":file", IMAGE_STRING_VALUE, 0},
10696 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 10776 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
10697 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 10777 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
10698 {":relief", IMAGE_INTEGER_VALUE, 0}, 10778 {":relief", IMAGE_INTEGER_VALUE, 0},
10699 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 10779 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
10700 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 10780 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -11057,7 +11137,7 @@ static struct image_keyword tiff_format[TIFF_LAST] =
11057 {":data", IMAGE_STRING_VALUE, 0}, 11137 {":data", IMAGE_STRING_VALUE, 0},
11058 {":file", IMAGE_STRING_VALUE, 0}, 11138 {":file", IMAGE_STRING_VALUE, 0},
11059 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 11139 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
11060 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 11140 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
11061 {":relief", IMAGE_INTEGER_VALUE, 0}, 11141 {":relief", IMAGE_INTEGER_VALUE, 0},
11062 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 11142 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
11063 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 11143 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -11376,7 +11456,7 @@ static struct image_keyword gif_format[GIF_LAST] =
11376 {":data", IMAGE_STRING_VALUE, 0}, 11456 {":data", IMAGE_STRING_VALUE, 0},
11377 {":file", IMAGE_STRING_VALUE, 0}, 11457 {":file", IMAGE_STRING_VALUE, 0},
11378 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 11458 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
11379 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 11459 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
11380 {":relief", IMAGE_INTEGER_VALUE, 0}, 11460 {":relief", IMAGE_INTEGER_VALUE, 0},
11381 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 11461 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
11382 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 11462 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
@@ -11691,7 +11771,7 @@ static struct image_keyword gs_format[GS_LAST] =
11691 {":loader", IMAGE_FUNCTION_VALUE, 0}, 11771 {":loader", IMAGE_FUNCTION_VALUE, 0},
11692 {":bounding-box", IMAGE_DONT_CHECK_VALUE_TYPE, 1}, 11772 {":bounding-box", IMAGE_DONT_CHECK_VALUE_TYPE, 1},
11693 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0}, 11773 {":ascent", IMAGE_NON_NEGATIVE_INTEGER_VALUE, 0},
11694 {":margin", IMAGE_POSITIVE_INTEGER_VALUE, 0}, 11774 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
11695 {":relief", IMAGE_INTEGER_VALUE, 0}, 11775 {":relief", IMAGE_INTEGER_VALUE, 0},
11696 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0}, 11776 {":algorithm", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
11697 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0} 11777 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
@@ -12772,7 +12852,6 @@ selection dialog's entry field, if MUSTMATCH is non-nil.")
12772 if (use_dialog_p) 12852 if (use_dialog_p)
12773 { 12853 {
12774 OPENFILENAME file_details; 12854 OPENFILENAME file_details;
12775 char *filename_file;
12776 12855
12777 /* Prevent redisplay. */ 12856 /* Prevent redisplay. */
12778 specbind (Qinhibit_redisplay, Qt); 12857 specbind (Qinhibit_redisplay, Qt);
@@ -12911,7 +12990,6 @@ If optional parameter FRAME is not specified, use selected frame.")
12911 (command, frame) 12990 (command, frame)
12912 Lisp_Object command, frame; 12991 Lisp_Object command, frame;
12913{ 12992{
12914 WPARAM code;
12915 FRAME_PTR f = check_x_frame (frame); 12993 FRAME_PTR f = check_x_frame (frame);
12916 12994
12917 CHECK_NUMBER (command, 0); 12995 CHECK_NUMBER (command, 0);
@@ -13164,7 +13242,6 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on.")
13164 Lisp_Object key, new_state; 13242 Lisp_Object key, new_state;
13165{ 13243{
13166 int vk_code; 13244 int vk_code;
13167 int cur_state;
13168 13245
13169 if (EQ (key, intern ("capslock"))) 13246 if (EQ (key, intern ("capslock")))
13170 vk_code = VK_CAPITAL; 13247 vk_code = VK_CAPITAL;