diff options
| author | Juanma Barranquero | 2002-09-06 09:04:22 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2002-09-06 09:04:22 +0000 |
| commit | b6f96a7e3be7c565fc40a14a4d9615ef4f753fe6 (patch) | |
| tree | 05cfb65c60d4a96ca4e209440d868a37bcf32bfb | |
| parent | f83d92b2f830faad6ebad8ec99d161535070971f (diff) | |
| download | emacs-b6f96a7e3be7c565fc40a14a4d9615ef4f753fe6.tar.gz emacs-b6f96a7e3be7c565fc40a14a4d9615ef4f753fe6.zip | |
(Fx_server_max_request_size): Fix spacing.
| -rw-r--r-- | src/macfns.c | 482 |
1 files changed, 241 insertions, 241 deletions
diff --git a/src/macfns.c b/src/macfns.c index 49f42e9270f..49e4aad78ca 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -194,7 +194,7 @@ Lisp_Object Vx_pixel_size_width_font_regexp; | |||
| 194 | (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) | 194 | (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) |
| 195 | (setq symbol-list (cdr symbol-list))))) | 195 | (setq symbol-list (cdr symbol-list))))) |
| 196 | 196 | ||
| 197 | */ | 197 | */ |
| 198 | 198 | ||
| 199 | /*&&& symbols declared here &&&*/ | 199 | /*&&& symbols declared here &&&*/ |
| 200 | Lisp_Object Qauto_raise; | 200 | Lisp_Object Qauto_raise; |
| @@ -301,7 +301,7 @@ check_mac () | |||
| 301 | 301 | ||
| 302 | /* Nonzero if we can use mouse menus. | 302 | /* Nonzero if we can use mouse menus. |
| 303 | You should not call this unless HAVE_MENUS is defined. */ | 303 | You should not call this unless HAVE_MENUS is defined. */ |
| 304 | 304 | ||
| 305 | int | 305 | int |
| 306 | have_menus_p () | 306 | have_menus_p () |
| 307 | { | 307 | { |
| @@ -343,7 +343,7 @@ check_x_display_info (frame) | |||
| 343 | if (NILP (frame)) | 343 | if (NILP (frame)) |
| 344 | { | 344 | { |
| 345 | struct frame *sf = XFRAME (selected_frame); | 345 | struct frame *sf = XFRAME (selected_frame); |
| 346 | 346 | ||
| 347 | if (FRAME_MAC_P (sf) && FRAME_LIVE_P (sf)) | 347 | if (FRAME_MAC_P (sf) && FRAME_LIVE_P (sf)) |
| 348 | return FRAME_MAC_DISPLAY_INFO (sf); | 348 | return FRAME_MAC_DISPLAY_INFO (sf); |
| 349 | else | 349 | else |
| @@ -494,7 +494,7 @@ x_create_bitmap_from_data (f, bits, width, height) | |||
| 494 | /* MAC_TODO: for now fail if width is not mod 16 (toolbox requires it) */ | 494 | /* MAC_TODO: for now fail if width is not mod 16 (toolbox requires it) */ |
| 495 | 495 | ||
| 496 | id = x_allocate_bitmap_record (f); | 496 | id = x_allocate_bitmap_record (f); |
| 497 | 497 | ||
| 498 | if (width % 16 != 0) | 498 | if (width % 16 != 0) |
| 499 | return -1; | 499 | return -1; |
| 500 | 500 | ||
| @@ -557,7 +557,7 @@ x_create_bitmap_from_file (f, file) | |||
| 557 | if (hinst == NULL) | 557 | if (hinst == NULL) |
| 558 | return -1; | 558 | return -1; |
| 559 | 559 | ||
| 560 | 560 | ||
| 561 | result = XReadBitmapFile (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 561 | result = XReadBitmapFile (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 562 | filename, &width, &height, &bitmap, &xhot, &yhot); | 562 | filename, &width, &height, &bitmap, &xhot, &yhot); |
| 563 | if (result != BitmapSuccess) | 563 | if (result != BitmapSuccess) |
| @@ -780,7 +780,7 @@ x_set_frame_parameters (f, alist) | |||
| 780 | /* Process foreground_color and background_color before anything else. | 780 | /* Process foreground_color and background_color before anything else. |
| 781 | They are independent of other properties, but other properties (e.g., | 781 | They are independent of other properties, but other properties (e.g., |
| 782 | cursor_color) are dependent upon them. */ | 782 | cursor_color) are dependent upon them. */ |
| 783 | for (p = 0; p < i; p++) | 783 | for (p = 0; p < i; p++) |
| 784 | { | 784 | { |
| 785 | Lisp_Object prop, val; | 785 | Lisp_Object prop, val; |
| 786 | 786 | ||
| @@ -982,7 +982,7 @@ x_real_positions (f, xptr, yptr) | |||
| 982 | #ifdef TARGET_API_MAC_CARBON | 982 | #ifdef TARGET_API_MAC_CARBON |
| 983 | { | 983 | { |
| 984 | Rect r; | 984 | Rect r; |
| 985 | 985 | ||
| 986 | GetWindowPortBounds (f->output_data.mac->mWP, &r); | 986 | GetWindowPortBounds (f->output_data.mac->mWP, &r); |
| 987 | SetPt (&pt, r.left, r.top); | 987 | SetPt (&pt, r.left, r.top); |
| 988 | } | 988 | } |
| @@ -994,7 +994,7 @@ x_real_positions (f, xptr, yptr) | |||
| 994 | GetPort (&oldport); | 994 | GetPort (&oldport); |
| 995 | LocalToGlobal (&pt); | 995 | LocalToGlobal (&pt); |
| 996 | SetPort (oldport); | 996 | SetPort (oldport); |
| 997 | 997 | ||
| 998 | *xptr = pt.h; | 998 | *xptr = pt.h; |
| 999 | *yptr = pt.v; | 999 | *yptr = pt.v; |
| 1000 | } | 1000 | } |
| @@ -1044,13 +1044,13 @@ x_report_frame_params (f, alistptr) | |||
| 1044 | } | 1044 | } |
| 1045 | 1045 | ||
| 1046 | /* The default colors for the Mac color map */ | 1046 | /* The default colors for the Mac color map */ |
| 1047 | typedef struct colormap_t | 1047 | typedef struct colormap_t |
| 1048 | { | 1048 | { |
| 1049 | unsigned long color; | 1049 | unsigned long color; |
| 1050 | char *name; | 1050 | char *name; |
| 1051 | } colormap_t; | 1051 | } colormap_t; |
| 1052 | 1052 | ||
| 1053 | colormap_t mac_color_map[] = | 1053 | colormap_t mac_color_map[] = |
| 1054 | { | 1054 | { |
| 1055 | { RGB_TO_ULONG(255, 250, 250), "snow" }, | 1055 | { RGB_TO_ULONG(255, 250, 250), "snow" }, |
| 1056 | { RGB_TO_ULONG(248, 248, 255), "ghost white" }, | 1056 | { RGB_TO_ULONG(248, 248, 255), "ghost white" }, |
| @@ -1405,7 +1405,7 @@ colormap_t mac_color_map[] = | |||
| 1405 | { RGB_TO_ULONG(155, 205, 155), "DarkSeaGreen3" }, | 1405 | { RGB_TO_ULONG(155, 205, 155), "DarkSeaGreen3" }, |
| 1406 | { RGB_TO_ULONG(105, 139, 105), "DarkSeaGreen4" }, | 1406 | { RGB_TO_ULONG(105, 139, 105), "DarkSeaGreen4" }, |
| 1407 | { RGB_TO_ULONG(84 , 255, 159), "SeaGreen1" }, | 1407 | { RGB_TO_ULONG(84 , 255, 159), "SeaGreen1" }, |
| 1408 | { RGB_TO_ULONG(78 , 238, 148), "SeaGreen2" }, | 1408 | { RGB_TO_ULONG(78 , 238, 148), "SeaGreen2" }, |
| 1409 | { RGB_TO_ULONG(67 , 205, 128), "SeaGreen3" }, | 1409 | { RGB_TO_ULONG(67 , 205, 128), "SeaGreen3" }, |
| 1410 | { RGB_TO_ULONG(46 , 139, 87 ), "SeaGreen4" }, | 1410 | { RGB_TO_ULONG(46 , 139, 87 ), "SeaGreen4" }, |
| 1411 | { RGB_TO_ULONG(154, 255, 154), "PaleGreen1" }, | 1411 | { RGB_TO_ULONG(154, 255, 154), "PaleGreen1" }, |
| @@ -1814,7 +1814,7 @@ mac_color_map_lookup (colorname) | |||
| 1814 | int i; | 1814 | int i; |
| 1815 | 1815 | ||
| 1816 | BLOCK_INPUT; | 1816 | BLOCK_INPUT; |
| 1817 | 1817 | ||
| 1818 | for (i = 0; i < sizeof (mac_color_map) / sizeof (mac_color_map[0]); i++) | 1818 | for (i = 0; i < sizeof (mac_color_map) / sizeof (mac_color_map[0]); i++) |
| 1819 | if (stricmp (colorname, mac_color_map[i].name) == 0) | 1819 | if (stricmp (colorname, mac_color_map[i].name) == 0) |
| 1820 | { | 1820 | { |
| @@ -1827,12 +1827,12 @@ mac_color_map_lookup (colorname) | |||
| 1827 | return ret; | 1827 | return ret; |
| 1828 | } | 1828 | } |
| 1829 | 1829 | ||
| 1830 | Lisp_Object | 1830 | Lisp_Object |
| 1831 | x_to_mac_color (colorname) | 1831 | x_to_mac_color (colorname) |
| 1832 | char * colorname; | 1832 | char * colorname; |
| 1833 | { | 1833 | { |
| 1834 | register Lisp_Object tail, ret = Qnil; | 1834 | register Lisp_Object tail, ret = Qnil; |
| 1835 | 1835 | ||
| 1836 | BLOCK_INPUT; | 1836 | BLOCK_INPUT; |
| 1837 | 1837 | ||
| 1838 | if (colorname[0] == '#') | 1838 | if (colorname[0] == '#') |
| @@ -1841,7 +1841,7 @@ x_to_mac_color (colorname) | |||
| 1841 | char *color; | 1841 | char *color; |
| 1842 | int size; | 1842 | int size; |
| 1843 | color = colorname + 1; | 1843 | color = colorname + 1; |
| 1844 | 1844 | ||
| 1845 | size = strlen(color); | 1845 | size = strlen(color); |
| 1846 | if (size == 3 || size == 6 || size == 9 || size == 12) | 1846 | if (size == 3 || size == 6 || size == 9 || size == 12) |
| 1847 | { | 1847 | { |
| @@ -1850,7 +1850,7 @@ x_to_mac_color (colorname) | |||
| 1850 | pos = 0; | 1850 | pos = 0; |
| 1851 | size /= 3; | 1851 | size /= 3; |
| 1852 | colorval = 0; | 1852 | colorval = 0; |
| 1853 | 1853 | ||
| 1854 | for (i = 0; i < 3; i++) | 1854 | for (i = 0; i < 3; i++) |
| 1855 | { | 1855 | { |
| 1856 | char *end; | 1856 | char *end; |
| @@ -1906,7 +1906,7 @@ x_to_mac_color (colorname) | |||
| 1906 | { | 1906 | { |
| 1907 | char *end; | 1907 | char *end; |
| 1908 | unsigned long value; | 1908 | unsigned long value; |
| 1909 | 1909 | ||
| 1910 | /* The check for 'x' in the following conditional takes into | 1910 | /* The check for 'x' in the following conditional takes into |
| 1911 | account the fact that strtol allows a "0x" in front of | 1911 | account the fact that strtol allows a "0x" in front of |
| 1912 | our numbers, and we don't. */ | 1912 | our numbers, and we don't. */ |
| @@ -1990,7 +1990,7 @@ x_to_mac_color (colorname) | |||
| 1990 | } | 1990 | } |
| 1991 | 1991 | ||
| 1992 | ret = mac_color_map_lookup (colorname); | 1992 | ret = mac_color_map_lookup (colorname); |
| 1993 | 1993 | ||
| 1994 | UNBLOCK_INPUT; | 1994 | UNBLOCK_INPUT; |
| 1995 | return ret; | 1995 | return ret; |
| 1996 | } | 1996 | } |
| @@ -2029,7 +2029,7 @@ mac_defined_color (f, color, color_def, alloc) | |||
| 2029 | 2029 | ||
| 2030 | tem = x_to_mac_color (color); | 2030 | tem = x_to_mac_color (color); |
| 2031 | 2031 | ||
| 2032 | if (!NILP (tem)) | 2032 | if (!NILP (tem)) |
| 2033 | { | 2033 | { |
| 2034 | if (f) | 2034 | if (f) |
| 2035 | { | 2035 | { |
| @@ -2046,7 +2046,7 @@ mac_defined_color (f, color, color_def, alloc) | |||
| 2046 | 2046 | ||
| 2047 | return 1; | 2047 | return 1; |
| 2048 | } | 2048 | } |
| 2049 | else | 2049 | else |
| 2050 | { | 2050 | { |
| 2051 | return 0; | 2051 | return 0; |
| 2052 | } | 2052 | } |
| @@ -2220,7 +2220,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 2220 | else | 2220 | else |
| 2221 | hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch); | 2221 | hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch); |
| 2222 | x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s"); | 2222 | x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s"); |
| 2223 | 2223 | ||
| 2224 | x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); | 2224 | x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); |
| 2225 | if (!EQ (Qnil, Vx_mode_pointer_shape)) | 2225 | if (!EQ (Qnil, Vx_mode_pointer_shape)) |
| 2226 | { | 2226 | { |
| @@ -2303,7 +2303,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 2303 | && f->output_data.w32->modeline_cursor != 0) | 2303 | && f->output_data.w32->modeline_cursor != 0) |
| 2304 | XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor); | 2304 | XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor); |
| 2305 | f->output_data.w32->modeline_cursor = mode_cursor; | 2305 | f->output_data.w32->modeline_cursor = mode_cursor; |
| 2306 | 2306 | ||
| 2307 | if (cross_cursor != f->output_data.w32->cross_cursor | 2307 | if (cross_cursor != f->output_data.w32->cross_cursor |
| 2308 | && f->output_data.w32->cross_cursor != 0) | 2308 | && f->output_data.w32->cross_cursor != 0) |
| 2309 | XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->cross_cursor); | 2309 | XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->cross_cursor); |
| @@ -2329,7 +2329,7 @@ x_set_cursor_color (f, arg, oldval) | |||
| 2329 | else | 2329 | else |
| 2330 | fore_pixel = FRAME_BACKGROUND_PIXEL (f); | 2330 | fore_pixel = FRAME_BACKGROUND_PIXEL (f); |
| 2331 | f->output_data.mac->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 2331 | f->output_data.mac->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 2332 | 2332 | ||
| 2333 | /* Make sure that the cursor color differs from the background color. */ | 2333 | /* Make sure that the cursor color differs from the background color. */ |
| 2334 | if (f->output_data.mac->cursor_pixel == FRAME_BACKGROUND_PIXEL (f)) | 2334 | if (f->output_data.mac->cursor_pixel == FRAME_BACKGROUND_PIXEL (f)) |
| 2335 | { | 2335 | { |
| @@ -2412,7 +2412,7 @@ x_set_icon_type (f, arg, oldval) | |||
| 2412 | if (NILP (arg) && NILP (oldval)) | 2412 | if (NILP (arg) && NILP (oldval)) |
| 2413 | return; | 2413 | return; |
| 2414 | 2414 | ||
| 2415 | if (STRINGP (arg) && STRINGP (oldval) | 2415 | if (STRINGP (arg) && STRINGP (oldval) |
| 2416 | && EQ (Fstring_equal (oldval, arg), Qt)) | 2416 | && EQ (Fstring_equal (oldval, arg), Qt)) |
| 2417 | return; | 2417 | return; |
| 2418 | 2418 | ||
| @@ -2520,7 +2520,7 @@ x_set_font (f, arg, oldval) | |||
| 2520 | ? x_new_fontset (f, SDATA (fontset_name)) | 2520 | ? x_new_fontset (f, SDATA (fontset_name)) |
| 2521 | : x_new_font (f, SDATA (arg))); | 2521 | : x_new_font (f, SDATA (arg))); |
| 2522 | UNBLOCK_INPUT; | 2522 | UNBLOCK_INPUT; |
| 2523 | 2523 | ||
| 2524 | if (EQ (result, Qnil)) | 2524 | if (EQ (result, Qnil)) |
| 2525 | error ("Font `%s' is not defined", SDATA (arg)); | 2525 | error ("Font `%s' is not defined", SDATA (arg)); |
| 2526 | else if (EQ (result, Qt)) | 2526 | else if (EQ (result, Qt)) |
| @@ -2778,7 +2778,7 @@ x_set_name (f, name, explicit) | |||
| 2778 | Lisp_Object name; | 2778 | Lisp_Object name; |
| 2779 | int explicit; | 2779 | int explicit; |
| 2780 | { | 2780 | { |
| 2781 | /* Make sure that requests from lisp code override requests from | 2781 | /* Make sure that requests from lisp code override requests from |
| 2782 | Emacs redisplay code. */ | 2782 | Emacs redisplay code. */ |
| 2783 | if (explicit) | 2783 | if (explicit) |
| 2784 | { | 2784 | { |
| @@ -2826,7 +2826,7 @@ x_set_name (f, name, explicit) | |||
| 2826 | #endif | 2826 | #endif |
| 2827 | 2827 | ||
| 2828 | BLOCK_INPUT; | 2828 | BLOCK_INPUT; |
| 2829 | 2829 | ||
| 2830 | { | 2830 | { |
| 2831 | Str255 windowTitle; | 2831 | Str255 windowTitle; |
| 2832 | if (strlen (SDATA (name)) < 255) | 2832 | if (strlen (SDATA (name)) < 255) |
| @@ -2953,7 +2953,7 @@ x_set_vertical_scroll_bars (f, arg, oldval) | |||
| 2953 | = (NILP (arg) | 2953 | = (NILP (arg) |
| 2954 | ? vertical_scroll_bar_none | 2954 | ? vertical_scroll_bar_none |
| 2955 | : EQ (Qright, arg) | 2955 | : EQ (Qright, arg) |
| 2956 | ? vertical_scroll_bar_right | 2956 | ? vertical_scroll_bar_right |
| 2957 | : vertical_scroll_bar_left); | 2957 | : vertical_scroll_bar_left); |
| 2958 | 2958 | ||
| 2959 | /* We set this parameter before creating the window for the | 2959 | /* We set this parameter before creating the window for the |
| @@ -2985,7 +2985,7 @@ x_set_scroll_bar_width (f, arg, oldval) | |||
| 2985 | /* Make the actual width at least 14 pixels and a multiple of a | 2985 | /* Make the actual width at least 14 pixels and a multiple of a |
| 2986 | character width. */ | 2986 | character width. */ |
| 2987 | FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; | 2987 | FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; |
| 2988 | 2988 | ||
| 2989 | /* Use all of that space (aside from required margins) for the | 2989 | /* Use all of that space (aside from required margins) for the |
| 2990 | scroll bar. */ | 2990 | scroll bar. */ |
| 2991 | FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; | 2991 | FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; |
| @@ -3008,7 +3008,7 @@ x_set_scroll_bar_width (f, arg, oldval) | |||
| 3008 | } | 3008 | } |
| 3009 | change_frame_size (f, 0, FRAME_WIDTH (f), 0, 0, 0); | 3009 | change_frame_size (f, 0, FRAME_WIDTH (f), 0, 0, 0); |
| 3010 | XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0; | 3010 | XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0; |
| 3011 | XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; | 3011 | XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; |
| 3012 | } | 3012 | } |
| 3013 | 3013 | ||
| 3014 | /* Subroutines of creating an frame. */ | 3014 | /* Subroutines of creating an frame. */ |
| @@ -3241,7 +3241,7 @@ mac_get_arg (alist, param, attribute, class, type) | |||
| 3241 | if (!strcmp (SDATA (tem), "on") | 3241 | if (!strcmp (SDATA (tem), "on") |
| 3242 | || !strcmp (SDATA (tem), "true")) | 3242 | || !strcmp (SDATA (tem), "true")) |
| 3243 | return Qt; | 3243 | return Qt; |
| 3244 | else | 3244 | else |
| 3245 | return Qnil; | 3245 | return Qnil; |
| 3246 | 3246 | ||
| 3247 | case RES_TYPE_STRING: | 3247 | case RES_TYPE_STRING: |
| @@ -3310,7 +3310,7 @@ x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) | |||
| 3310 | * It returns a bitmask that indicates which of the four values | 3310 | * It returns a bitmask that indicates which of the four values |
| 3311 | * were actually found in the string. For each value found, | 3311 | * were actually found in the string. For each value found, |
| 3312 | * the corresponding argument is updated; for each value | 3312 | * the corresponding argument is updated; for each value |
| 3313 | * not found, the corresponding argument is left unchanged. | 3313 | * not found, the corresponding argument is left unchanged. |
| 3314 | */ | 3314 | */ |
| 3315 | 3315 | ||
| 3316 | static int | 3316 | static int |
| @@ -3320,7 +3320,7 @@ read_integer (string, NextString) | |||
| 3320 | { | 3320 | { |
| 3321 | register int Result = 0; | 3321 | register int Result = 0; |
| 3322 | int Sign = 1; | 3322 | int Sign = 1; |
| 3323 | 3323 | ||
| 3324 | if (*string == '+') | 3324 | if (*string == '+') |
| 3325 | string++; | 3325 | string++; |
| 3326 | else if (*string == '-') | 3326 | else if (*string == '-') |
| @@ -3339,7 +3339,7 @@ read_integer (string, NextString) | |||
| 3339 | return (-Result); | 3339 | return (-Result); |
| 3340 | } | 3340 | } |
| 3341 | 3341 | ||
| 3342 | int | 3342 | int |
| 3343 | XParseGeometry (string, x, y, width, height) | 3343 | XParseGeometry (string, x, y, width, height) |
| 3344 | char *string; | 3344 | char *string; |
| 3345 | int *x, *y; | 3345 | int *x, *y; |
| @@ -3350,23 +3350,23 @@ XParseGeometry (string, x, y, width, height) | |||
| 3350 | unsigned int tempWidth, tempHeight; | 3350 | unsigned int tempWidth, tempHeight; |
| 3351 | int tempX, tempY; | 3351 | int tempX, tempY; |
| 3352 | char *nextCharacter; | 3352 | char *nextCharacter; |
| 3353 | 3353 | ||
| 3354 | if ((string == NULL) || (*string == '\0')) return (mask); | 3354 | if ((string == NULL) || (*string == '\0')) return (mask); |
| 3355 | if (*string == '=') | 3355 | if (*string == '=') |
| 3356 | string++; /* ignore possible '=' at beg of geometry spec */ | 3356 | string++; /* ignore possible '=' at beg of geometry spec */ |
| 3357 | 3357 | ||
| 3358 | strind = (char *)string; | 3358 | strind = (char *)string; |
| 3359 | if (*strind != '+' && *strind != '-' && *strind != 'x') | 3359 | if (*strind != '+' && *strind != '-' && *strind != 'x') |
| 3360 | { | 3360 | { |
| 3361 | tempWidth = read_integer (strind, &nextCharacter); | 3361 | tempWidth = read_integer (strind, &nextCharacter); |
| 3362 | if (strind == nextCharacter) | 3362 | if (strind == nextCharacter) |
| 3363 | return (0); | 3363 | return (0); |
| 3364 | strind = nextCharacter; | 3364 | strind = nextCharacter; |
| 3365 | mask |= WidthValue; | 3365 | mask |= WidthValue; |
| 3366 | } | 3366 | } |
| 3367 | 3367 | ||
| 3368 | if (*strind == 'x' || *strind == 'X') | 3368 | if (*strind == 'x' || *strind == 'X') |
| 3369 | { | 3369 | { |
| 3370 | strind++; | 3370 | strind++; |
| 3371 | tempHeight = read_integer (strind, &nextCharacter); | 3371 | tempHeight = read_integer (strind, &nextCharacter); |
| 3372 | if (strind == nextCharacter) | 3372 | if (strind == nextCharacter) |
| @@ -3374,10 +3374,10 @@ XParseGeometry (string, x, y, width, height) | |||
| 3374 | strind = nextCharacter; | 3374 | strind = nextCharacter; |
| 3375 | mask |= HeightValue; | 3375 | mask |= HeightValue; |
| 3376 | } | 3376 | } |
| 3377 | 3377 | ||
| 3378 | if ((*strind == '+') || (*strind == '-')) | 3378 | if ((*strind == '+') || (*strind == '-')) |
| 3379 | { | 3379 | { |
| 3380 | if (*strind == '-') | 3380 | if (*strind == '-') |
| 3381 | { | 3381 | { |
| 3382 | strind++; | 3382 | strind++; |
| 3383 | tempX = -read_integer (strind, &nextCharacter); | 3383 | tempX = -read_integer (strind, &nextCharacter); |
| @@ -3388,7 +3388,7 @@ XParseGeometry (string, x, y, width, height) | |||
| 3388 | 3388 | ||
| 3389 | } | 3389 | } |
| 3390 | else | 3390 | else |
| 3391 | { | 3391 | { |
| 3392 | strind++; | 3392 | strind++; |
| 3393 | tempX = read_integer (strind, &nextCharacter); | 3393 | tempX = read_integer (strind, &nextCharacter); |
| 3394 | if (strind == nextCharacter) | 3394 | if (strind == nextCharacter) |
| @@ -3396,9 +3396,9 @@ XParseGeometry (string, x, y, width, height) | |||
| 3396 | strind = nextCharacter; | 3396 | strind = nextCharacter; |
| 3397 | } | 3397 | } |
| 3398 | mask |= XValue; | 3398 | mask |= XValue; |
| 3399 | if ((*strind == '+') || (*strind == '-')) | 3399 | if ((*strind == '+') || (*strind == '-')) |
| 3400 | { | 3400 | { |
| 3401 | if (*strind == '-') | 3401 | if (*strind == '-') |
| 3402 | { | 3402 | { |
| 3403 | strind++; | 3403 | strind++; |
| 3404 | tempY = -read_integer (strind, &nextCharacter); | 3404 | tempY = -read_integer (strind, &nextCharacter); |
| @@ -3419,12 +3419,12 @@ XParseGeometry (string, x, y, width, height) | |||
| 3419 | mask |= YValue; | 3419 | mask |= YValue; |
| 3420 | } | 3420 | } |
| 3421 | } | 3421 | } |
| 3422 | 3422 | ||
| 3423 | /* If strind isn't at the end of the string the it's an invalid | 3423 | /* If strind isn't at the end of the string the it's an invalid |
| 3424 | geometry specification. */ | 3424 | geometry specification. */ |
| 3425 | 3425 | ||
| 3426 | if (*strind != '\0') return (0); | 3426 | if (*strind != '\0') return (0); |
| 3427 | 3427 | ||
| 3428 | if (mask & XValue) | 3428 | if (mask & XValue) |
| 3429 | *x = tempX; | 3429 | *x = tempX; |
| 3430 | if (mask & YValue) | 3430 | if (mask & YValue) |
| @@ -3638,7 +3638,7 @@ mac_window (f, window_prompting, minibuffer_only) | |||
| 3638 | for the window manager, so GC relocation won't bother it. | 3638 | for the window manager, so GC relocation won't bother it. |
| 3639 | 3639 | ||
| 3640 | Elsewhere we specify the window name for the window manager. */ | 3640 | Elsewhere we specify the window name for the window manager. */ |
| 3641 | 3641 | ||
| 3642 | { | 3642 | { |
| 3643 | char *str = (char *) SDATA (Vx_resource_name); | 3643 | char *str = (char *) SDATA (Vx_resource_name); |
| 3644 | f->namebuf = (char *) xmalloc (strlen (str) + 1); | 3644 | f->namebuf = (char *) xmalloc (strlen (str) + 1); |
| @@ -3942,7 +3942,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3942 | error ("Cannot find any usable font"); | 3942 | error ("Cannot find any usable font"); |
| 3943 | UNBLOCK_INPUT; | 3943 | UNBLOCK_INPUT; |
| 3944 | 3944 | ||
| 3945 | x_default_parameter (f, parms, Qfont, font, | 3945 | x_default_parameter (f, parms, Qfont, font, |
| 3946 | "font", "Font", RES_TYPE_STRING); | 3946 | "font", "Font", RES_TYPE_STRING); |
| 3947 | } | 3947 | } |
| 3948 | 3948 | ||
| @@ -3995,7 +3995,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3995 | end up in init_iterator with a null face cache, which should not | 3995 | end up in init_iterator with a null face cache, which should not |
| 3996 | happen. */ | 3996 | happen. */ |
| 3997 | init_frame_faces (f); | 3997 | init_frame_faces (f); |
| 3998 | 3998 | ||
| 3999 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), | 3999 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), |
| 4000 | "menuBar", "MenuBar", RES_TYPE_NUMBER); | 4000 | "menuBar", "MenuBar", RES_TYPE_NUMBER); |
| 4001 | x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), | 4001 | x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), |
| @@ -4106,11 +4106,11 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4106 | ; | 4106 | ; |
| 4107 | } | 4107 | } |
| 4108 | UNGCPRO; | 4108 | UNGCPRO; |
| 4109 | 4109 | ||
| 4110 | /* Make sure windows on this frame appear in calls to next-window | 4110 | /* Make sure windows on this frame appear in calls to next-window |
| 4111 | and similar functions. */ | 4111 | and similar functions. */ |
| 4112 | Vwindow_list = Qnil; | 4112 | Vwindow_list = Qnil; |
| 4113 | 4113 | ||
| 4114 | return unbind_to (count, frame); | 4114 | return unbind_to (count, frame); |
| 4115 | } | 4115 | } |
| 4116 | 4116 | ||
| @@ -4255,7 +4255,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 4255 | Lisp_Object display; | 4255 | Lisp_Object display; |
| 4256 | { | 4256 | { |
| 4257 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 4257 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 4258 | 4258 | ||
| 4259 | /* MAC_TODO: check whether this is right */ | 4259 | /* MAC_TODO: check whether this is right */ |
| 4260 | return make_number ((unsigned long) (pow (2, dpyinfo->n_cbits))); | 4260 | return make_number ((unsigned long) (pow (2, dpyinfo->n_cbits))); |
| 4261 | } | 4261 | } |
| @@ -4266,7 +4266,7 @@ DEFUN ("x-server-max-request-size", Fx_server_max_request_size, | |||
| 4266 | doc: /* Returns the maximum request size of the server of display DISPLAY. | 4266 | doc: /* Returns the maximum request size of the server of display DISPLAY. |
| 4267 | The optional argument DISPLAY specifies which display to ask about. | 4267 | The optional argument DISPLAY specifies which display to ask about. |
| 4268 | DISPLAY should be either a frame or a display name (a string). | 4268 | DISPLAY should be either a frame or a display name (a string). |
| 4269 | If omitted or nil, that stands for the selected frame's display. */) | 4269 | If omitted or nil, that stands for the selected frame's display. */) |
| 4270 | (display) | 4270 | (display) |
| 4271 | Lisp_Object display; | 4271 | Lisp_Object display; |
| 4272 | { | 4272 | { |
| @@ -4303,7 +4303,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 4303 | 4303 | ||
| 4304 | if (Gestalt (gestaltSystemVersion, &response) != noErr) | 4304 | if (Gestalt (gestaltSystemVersion, &response) != noErr) |
| 4305 | error ("Cannot get Mac OS version"); | 4305 | error ("Cannot get Mac OS version"); |
| 4306 | 4306 | ||
| 4307 | mac_major_version = (response >> 8) & 0xf; | 4307 | mac_major_version = (response >> 8) & 0xf; |
| 4308 | mac_minor_version = (response >> 4) & 0xf; | 4308 | mac_minor_version = (response >> 4) & 0xf; |
| 4309 | 4309 | ||
| @@ -4330,13 +4330,13 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 4330 | (display) | 4330 | (display) |
| 4331 | Lisp_Object display; | 4331 | Lisp_Object display; |
| 4332 | { | 4332 | { |
| 4333 | /* MAC_TODO: this is an approximation, and only of the main display */ | 4333 | /* MAC_TODO: this is an approximation, and only of the main display */ |
| 4334 | 4334 | ||
| 4335 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 4335 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 4336 | short h, v; | 4336 | short h, v; |
| 4337 | 4337 | ||
| 4338 | ScreenRes (&h, &v); | 4338 | ScreenRes (&h, &v); |
| 4339 | 4339 | ||
| 4340 | return make_number ((int) (v / 72.0 * 25.4)); | 4340 | return make_number ((int) (v / 72.0 * 25.4)); |
| 4341 | } | 4341 | } |
| 4342 | 4342 | ||
| @@ -4348,13 +4348,13 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 4348 | (display) | 4348 | (display) |
| 4349 | Lisp_Object display; | 4349 | Lisp_Object display; |
| 4350 | { | 4350 | { |
| 4351 | /* MAC_TODO: this is an approximation, and only of the main display */ | 4351 | /* MAC_TODO: this is an approximation, and only of the main display */ |
| 4352 | 4352 | ||
| 4353 | struct mac_display_info *dpyinfo = check_x_display_info (display); | 4353 | struct mac_display_info *dpyinfo = check_x_display_info (display); |
| 4354 | short h, v; | 4354 | short h, v; |
| 4355 | 4355 | ||
| 4356 | ScreenRes (&h, &v); | 4356 | ScreenRes (&h, &v); |
| 4357 | 4357 | ||
| 4358 | return make_number ((int) (h / 72.0 * 25.4)); | 4358 | return make_number ((int) (h / 72.0 * 25.4)); |
| 4359 | } | 4359 | } |
| 4360 | 4360 | ||
| @@ -4691,12 +4691,12 @@ valid_image_p (object) | |||
| 4691 | Lisp_Object object; | 4691 | Lisp_Object object; |
| 4692 | { | 4692 | { |
| 4693 | int valid_p = 0; | 4693 | int valid_p = 0; |
| 4694 | 4694 | ||
| 4695 | if (CONSP (object) && EQ (XCAR (object), Qimage)) | 4695 | if (CONSP (object) && EQ (XCAR (object), Qimage)) |
| 4696 | { | 4696 | { |
| 4697 | Lisp_Object symbol = Fplist_get (XCDR (object), QCtype); | 4697 | Lisp_Object symbol = Fplist_get (XCDR (object), QCtype); |
| 4698 | struct image_type *type = lookup_image_type (symbol); | 4698 | struct image_type *type = lookup_image_type (symbol); |
| 4699 | 4699 | ||
| 4700 | if (type) | 4700 | if (type) |
| 4701 | valid_p = type->valid_p (object); | 4701 | valid_p = type->valid_p (object); |
| 4702 | } | 4702 | } |
| @@ -4814,7 +4814,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 4814 | was found more than once, it's an error. */ | 4814 | was found more than once, it's an error. */ |
| 4815 | keywords[i].value = value; | 4815 | keywords[i].value = value; |
| 4816 | ++keywords[i].count; | 4816 | ++keywords[i].count; |
| 4817 | 4817 | ||
| 4818 | if (keywords[i].count > 1) | 4818 | if (keywords[i].count > 1) |
| 4819 | return 0; | 4819 | return 0; |
| 4820 | 4820 | ||
| @@ -4864,7 +4864,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 4864 | 4864 | ||
| 4865 | case IMAGE_FUNCTION_VALUE: | 4865 | case IMAGE_FUNCTION_VALUE: |
| 4866 | value = indirect_function (value); | 4866 | value = indirect_function (value); |
| 4867 | if (SUBRP (value) | 4867 | if (SUBRP (value) |
| 4868 | || COMPILEDP (value) | 4868 | || COMPILEDP (value) |
| 4869 | || (CONSP (value) && EQ (XCAR (value), Qlambda))) | 4869 | || (CONSP (value) && EQ (XCAR (value), Qlambda))) |
| 4870 | break; | 4870 | break; |
| @@ -4913,7 +4913,7 @@ image_spec_value (spec, key, found) | |||
| 4913 | int *found; | 4913 | int *found; |
| 4914 | { | 4914 | { |
| 4915 | Lisp_Object tail; | 4915 | Lisp_Object tail; |
| 4916 | 4916 | ||
| 4917 | xassert (valid_image_p (spec)); | 4917 | xassert (valid_image_p (spec)); |
| 4918 | 4918 | ||
| 4919 | for (tail = XCDR (spec); | 4919 | for (tail = XCDR (spec); |
| @@ -4927,12 +4927,12 @@ image_spec_value (spec, key, found) | |||
| 4927 | return XCAR (XCDR (tail)); | 4927 | return XCAR (XCDR (tail)); |
| 4928 | } | 4928 | } |
| 4929 | } | 4929 | } |
| 4930 | 4930 | ||
| 4931 | if (found) | 4931 | if (found) |
| 4932 | *found = 0; | 4932 | *found = 0; |
| 4933 | return Qnil; | 4933 | return Qnil; |
| 4934 | } | 4934 | } |
| 4935 | 4935 | ||
| 4936 | 4936 | ||
| 4937 | 4937 | ||
| 4938 | 4938 | ||
| @@ -4953,7 +4953,7 @@ make_image (spec, hash) | |||
| 4953 | unsigned hash; | 4953 | unsigned hash; |
| 4954 | { | 4954 | { |
| 4955 | struct image *img = (struct image *) xmalloc (sizeof *img); | 4955 | struct image *img = (struct image *) xmalloc (sizeof *img); |
| 4956 | 4956 | ||
| 4957 | xassert (valid_image_p (spec)); | 4957 | xassert (valid_image_p (spec)); |
| 4958 | bzero (img, sizeof *img); | 4958 | bzero (img, sizeof *img); |
| 4959 | img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); | 4959 | img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); |
| @@ -5014,7 +5014,7 @@ prepare_image_for_display (f, img) | |||
| 5014 | if (img->pixmap == 0 && !img->load_failed_p) | 5014 | if (img->pixmap == 0 && !img->load_failed_p) |
| 5015 | img->load_failed_p = img->type->load (f, img) == 0; | 5015 | img->load_failed_p = img->type->load (f, img) == 0; |
| 5016 | } | 5016 | } |
| 5017 | 5017 | ||
| 5018 | 5018 | ||
| 5019 | /* Value is the number of pixels for the ascent of image IMG when | 5019 | /* Value is the number of pixels for the ascent of image IMG when |
| 5020 | drawn in face FACE. */ | 5020 | drawn in face FACE. */ |
| @@ -5073,7 +5073,7 @@ x_clear_image (f, img) | |||
| 5073 | if (img->ncolors) | 5073 | if (img->ncolors) |
| 5074 | { | 5074 | { |
| 5075 | int class = FRAME_W32_DISPLAY_INFO (f)->visual->class; | 5075 | int class = FRAME_W32_DISPLAY_INFO (f)->visual->class; |
| 5076 | 5076 | ||
| 5077 | /* If display has an immutable color map, freeing colors is not | 5077 | /* If display has an immutable color map, freeing colors is not |
| 5078 | necessary and some servers don't allow it. So don't do it. */ | 5078 | necessary and some servers don't allow it. So don't do it. */ |
| 5079 | if (class != StaticColor | 5079 | if (class != StaticColor |
| @@ -5087,7 +5087,7 @@ x_clear_image (f, img) | |||
| 5087 | img->ncolors, 0); | 5087 | img->ncolors, 0); |
| 5088 | UNBLOCK_INPUT; | 5088 | UNBLOCK_INPUT; |
| 5089 | } | 5089 | } |
| 5090 | 5090 | ||
| 5091 | xfree (img->colors); | 5091 | xfree (img->colors); |
| 5092 | img->colors = NULL; | 5092 | img->colors = NULL; |
| 5093 | img->ncolors = 0; | 5093 | img->ncolors = 0; |
| @@ -5149,7 +5149,7 @@ make_image_cache () | |||
| 5149 | { | 5149 | { |
| 5150 | struct image_cache *c = (struct image_cache *) xmalloc (sizeof *c); | 5150 | struct image_cache *c = (struct image_cache *) xmalloc (sizeof *c); |
| 5151 | int size; | 5151 | int size; |
| 5152 | 5152 | ||
| 5153 | bzero (c, sizeof *c); | 5153 | bzero (c, sizeof *c); |
| 5154 | c->size = 50; | 5154 | c->size = 50; |
| 5155 | c->images = (struct image **) xmalloc (c->size * sizeof *c->images); | 5155 | c->images = (struct image **) xmalloc (c->size * sizeof *c->images); |
| @@ -5174,7 +5174,7 @@ free_image_cache (f) | |||
| 5174 | 5174 | ||
| 5175 | /* Cache should not be referenced by any frame when freed. */ | 5175 | /* Cache should not be referenced by any frame when freed. */ |
| 5176 | xassert (c->refcount == 0); | 5176 | xassert (c->refcount == 0); |
| 5177 | 5177 | ||
| 5178 | for (i = 0; i < c->used; ++i) | 5178 | for (i = 0; i < c->used; ++i) |
| 5179 | free_image (f, c->images[i]); | 5179 | free_image (f, c->images[i]); |
| 5180 | xfree (c->images); | 5180 | xfree (c->images); |
| @@ -5207,7 +5207,7 @@ clear_image_cache (f, force_p) | |||
| 5207 | 5207 | ||
| 5208 | EMACS_GET_TIME (t); | 5208 | EMACS_GET_TIME (t); |
| 5209 | old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay); | 5209 | old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay); |
| 5210 | 5210 | ||
| 5211 | for (i = 0; i < c->used; ++i) | 5211 | for (i = 0; i < c->used; ++i) |
| 5212 | { | 5212 | { |
| 5213 | struct image *img = c->images[i]; | 5213 | struct image *img = c->images[i]; |
| @@ -5244,7 +5244,7 @@ FRAME t means clear the image caches of all frames. */) | |||
| 5244 | if (EQ (frame, Qt)) | 5244 | if (EQ (frame, Qt)) |
| 5245 | { | 5245 | { |
| 5246 | Lisp_Object tail; | 5246 | Lisp_Object tail; |
| 5247 | 5247 | ||
| 5248 | FOR_EACH_FRAME (tail, frame) | 5248 | FOR_EACH_FRAME (tail, frame) |
| 5249 | if (FRAME_MAC_P (XFRAME (frame))) | 5249 | if (FRAME_MAC_P (XFRAME (frame))) |
| 5250 | clear_image_cache (XFRAME (frame), 1); | 5250 | clear_image_cache (XFRAME (frame), 1); |
| @@ -5275,7 +5275,7 @@ lookup_image (f, spec) | |||
| 5275 | specification. */ | 5275 | specification. */ |
| 5276 | xassert (FRAME_WINDOW_P (f)); | 5276 | xassert (FRAME_WINDOW_P (f)); |
| 5277 | xassert (valid_image_p (spec)); | 5277 | xassert (valid_image_p (spec)); |
| 5278 | 5278 | ||
| 5279 | GCPRO1 (spec); | 5279 | GCPRO1 (spec); |
| 5280 | 5280 | ||
| 5281 | /* Look up SPEC in the hash table of the image cache. */ | 5281 | /* Look up SPEC in the hash table of the image cache. */ |
| @@ -5332,7 +5332,7 @@ lookup_image (f, spec) | |||
| 5332 | if (XINT (XCDR (margin)) > 0) | 5332 | if (XINT (XCDR (margin)) > 0) |
| 5333 | img->vmargin = XFASTINT (XCDR (margin)); | 5333 | img->vmargin = XFASTINT (XCDR (margin)); |
| 5334 | } | 5334 | } |
| 5335 | 5335 | ||
| 5336 | relief = image_spec_value (spec, QCrelief, NULL); | 5336 | relief = image_spec_value (spec, QCrelief, NULL); |
| 5337 | if (INTEGERP (relief)) | 5337 | if (INTEGERP (relief)) |
| 5338 | { | 5338 | { |
| @@ -5346,9 +5346,9 @@ lookup_image (f, spec) | |||
| 5346 | /* We're using IMG, so set its timestamp to `now'. */ | 5346 | /* We're using IMG, so set its timestamp to `now'. */ |
| 5347 | EMACS_GET_TIME (now); | 5347 | EMACS_GET_TIME (now); |
| 5348 | img->timestamp = EMACS_SECS (now); | 5348 | img->timestamp = EMACS_SECS (now); |
| 5349 | 5349 | ||
| 5350 | UNGCPRO; | 5350 | UNGCPRO; |
| 5351 | 5351 | ||
| 5352 | /* Value is the image id. */ | 5352 | /* Value is the image id. */ |
| 5353 | return img->id; | 5353 | return img->id; |
| 5354 | } | 5354 | } |
| @@ -5502,7 +5502,7 @@ x_put_x_image (f, ximg, pixmap, width, height) | |||
| 5502 | Pixmap pixmap; | 5502 | Pixmap pixmap; |
| 5503 | { | 5503 | { |
| 5504 | GC gc; | 5504 | GC gc; |
| 5505 | 5505 | ||
| 5506 | xassert (interrupt_input_blocked); | 5506 | xassert (interrupt_input_blocked); |
| 5507 | gc = XCreateGC (NULL, pixmap, 0, NULL); | 5507 | gc = XCreateGC (NULL, pixmap, 0, NULL); |
| 5508 | XPutImage (NULL, pixmap, gc, ximg, 0, 0, 0, 0, width, height); | 5508 | XPutImage (NULL, pixmap, gc, ximg, 0, 0, 0, 0, width, height); |
| @@ -5536,7 +5536,7 @@ x_find_image_file (file) | |||
| 5536 | 5536 | ||
| 5537 | /* Try to find FILE in data-directory, then x-bitmap-file-path. */ | 5537 | /* Try to find FILE in data-directory, then x-bitmap-file-path. */ |
| 5538 | fd = openp (search_path, file, Qnil, &file_found, Qnil); | 5538 | fd = openp (search_path, file, Qnil, &file_found, Qnil); |
| 5539 | 5539 | ||
| 5540 | if (fd < 0) | 5540 | if (fd < 0) |
| 5541 | file_found = Qnil; | 5541 | file_found = Qnil; |
| 5542 | else | 5542 | else |
| @@ -5616,7 +5616,7 @@ enum xbm_token | |||
| 5616 | XBM_TK_NUMBER | 5616 | XBM_TK_NUMBER |
| 5617 | }; | 5617 | }; |
| 5618 | 5618 | ||
| 5619 | 5619 | ||
| 5620 | /* Return non-zero if OBJECT is a valid XBM-type image specification. | 5620 | /* Return non-zero if OBJECT is a valid XBM-type image specification. |
| 5621 | A valid specification is a list starting with the symbol `image' | 5621 | A valid specification is a list starting with the symbol `image' |
| 5622 | The rest of the list is a property list which must contain an | 5622 | The rest of the list is a property list which must contain an |
| @@ -5647,7 +5647,7 @@ xbm_image_p (object) | |||
| 5647 | Lisp_Object object; | 5647 | Lisp_Object object; |
| 5648 | { | 5648 | { |
| 5649 | struct image_keyword kw[XBM_LAST]; | 5649 | struct image_keyword kw[XBM_LAST]; |
| 5650 | 5650 | ||
| 5651 | bcopy (xbm_format, kw, sizeof kw); | 5651 | bcopy (xbm_format, kw, sizeof kw); |
| 5652 | if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) | 5652 | if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) |
| 5653 | return 0; | 5653 | return 0; |
| @@ -5673,13 +5673,13 @@ xbm_image_p (object) | |||
| 5673 | data = kw[XBM_DATA].value; | 5673 | data = kw[XBM_DATA].value; |
| 5674 | width = XFASTINT (kw[XBM_WIDTH].value); | 5674 | width = XFASTINT (kw[XBM_WIDTH].value); |
| 5675 | height = XFASTINT (kw[XBM_HEIGHT].value); | 5675 | height = XFASTINT (kw[XBM_HEIGHT].value); |
| 5676 | 5676 | ||
| 5677 | /* Check type of data, and width and height against contents of | 5677 | /* Check type of data, and width and height against contents of |
| 5678 | data. */ | 5678 | data. */ |
| 5679 | if (VECTORP (data)) | 5679 | if (VECTORP (data)) |
| 5680 | { | 5680 | { |
| 5681 | int i; | 5681 | int i; |
| 5682 | 5682 | ||
| 5683 | /* Number of elements of the vector must be >= height. */ | 5683 | /* Number of elements of the vector must be >= height. */ |
| 5684 | if (XVECTOR (data)->size < height) | 5684 | if (XVECTOR (data)->size < height) |
| 5685 | return 0; | 5685 | return 0; |
| @@ -5724,7 +5724,7 @@ xbm_image_p (object) | |||
| 5724 | if (kw[XBM_ASCENT].count | 5724 | if (kw[XBM_ASCENT].count |
| 5725 | && XFASTINT (kw[XBM_ASCENT].value) > 100) | 5725 | && XFASTINT (kw[XBM_ASCENT].value) > 100) |
| 5726 | return 0; | 5726 | return 0; |
| 5727 | 5727 | ||
| 5728 | return 1; | 5728 | return 1; |
| 5729 | } | 5729 | } |
| 5730 | 5730 | ||
| @@ -5742,7 +5742,7 @@ xbm_scan (fp, sval, ival) | |||
| 5742 | int *ival; | 5742 | int *ival; |
| 5743 | { | 5743 | { |
| 5744 | int c; | 5744 | int c; |
| 5745 | 5745 | ||
| 5746 | /* Skip white space. */ | 5746 | /* Skip white space. */ |
| 5747 | while ((c = fgetc (fp)) != EOF && isspace (c)) | 5747 | while ((c = fgetc (fp)) != EOF && isspace (c)) |
| 5748 | ; | 5748 | ; |
| @@ -5752,7 +5752,7 @@ xbm_scan (fp, sval, ival) | |||
| 5752 | else if (isdigit (c)) | 5752 | else if (isdigit (c)) |
| 5753 | { | 5753 | { |
| 5754 | int value = 0, digit; | 5754 | int value = 0, digit; |
| 5755 | 5755 | ||
| 5756 | if (c == '0') | 5756 | if (c == '0') |
| 5757 | { | 5757 | { |
| 5758 | c = fgetc (fp); | 5758 | c = fgetc (fp); |
| @@ -5836,7 +5836,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5836 | if (LA1 != (TOKEN)) \ | 5836 | if (LA1 != (TOKEN)) \ |
| 5837 | goto failure; \ | 5837 | goto failure; \ |
| 5838 | else \ | 5838 | else \ |
| 5839 | match () | 5839 | match () |
| 5840 | 5840 | ||
| 5841 | #define expect_ident(IDENT) \ | 5841 | #define expect_ident(IDENT) \ |
| 5842 | if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \ | 5842 | if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \ |
| @@ -5880,7 +5880,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5880 | { | 5880 | { |
| 5881 | if (strcmp (buffer, "unsigned") == 0) | 5881 | if (strcmp (buffer, "unsigned") == 0) |
| 5882 | { | 5882 | { |
| 5883 | match (); | 5883 | match (); |
| 5884 | expect_ident ("char"); | 5884 | expect_ident ("char"); |
| 5885 | } | 5885 | } |
| 5886 | else if (strcmp (buffer, "short") == 0) | 5886 | else if (strcmp (buffer, "short") == 0) |
| @@ -5895,7 +5895,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5895 | else | 5895 | else |
| 5896 | goto failure; | 5896 | goto failure; |
| 5897 | } | 5897 | } |
| 5898 | else | 5898 | else |
| 5899 | goto failure; | 5899 | goto failure; |
| 5900 | 5900 | ||
| 5901 | expect (XBM_TK_IDENT); | 5901 | expect (XBM_TK_IDENT); |
| @@ -5910,7 +5910,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5910 | 5910 | ||
| 5911 | if (v10) | 5911 | if (v10) |
| 5912 | { | 5912 | { |
| 5913 | 5913 | ||
| 5914 | for (i = 0; i < nbytes; i += 2) | 5914 | for (i = 0; i < nbytes; i += 2) |
| 5915 | { | 5915 | { |
| 5916 | int val = value; | 5916 | int val = value; |
| @@ -5919,7 +5919,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5919 | *p++ = val; | 5919 | *p++ = val; |
| 5920 | if (!padding_p || ((i + 2) % bytes_per_line)) | 5920 | if (!padding_p || ((i + 2) % bytes_per_line)) |
| 5921 | *p++ = value >> 8; | 5921 | *p++ = value >> 8; |
| 5922 | 5922 | ||
| 5923 | if (LA1 == ',' || LA1 == '}') | 5923 | if (LA1 == ',' || LA1 == '}') |
| 5924 | match (); | 5924 | match (); |
| 5925 | else | 5925 | else |
| @@ -5932,9 +5932,9 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5932 | { | 5932 | { |
| 5933 | int val = value; | 5933 | int val = value; |
| 5934 | expect (XBM_TK_NUMBER); | 5934 | expect (XBM_TK_NUMBER); |
| 5935 | 5935 | ||
| 5936 | *p++ = val; | 5936 | *p++ = val; |
| 5937 | 5937 | ||
| 5938 | if (LA1 == ',' || LA1 == '}') | 5938 | if (LA1 == ',' || LA1 == '}') |
| 5939 | match (); | 5939 | match (); |
| 5940 | else | 5940 | else |
| @@ -5946,7 +5946,7 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 5946 | return 1; | 5946 | return 1; |
| 5947 | 5947 | ||
| 5948 | failure: | 5948 | failure: |
| 5949 | 5949 | ||
| 5950 | fclose (fp); | 5950 | fclose (fp); |
| 5951 | if (*data) | 5951 | if (*data) |
| 5952 | { | 5952 | { |
| @@ -5975,7 +5975,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 5975 | int success_p = 0; | 5975 | int success_p = 0; |
| 5976 | Lisp_Object file; | 5976 | Lisp_Object file; |
| 5977 | struct gcpro gcpro1; | 5977 | struct gcpro gcpro1; |
| 5978 | 5978 | ||
| 5979 | xassert (STRINGP (specified_file)); | 5979 | xassert (STRINGP (specified_file)); |
| 5980 | file = Qnil; | 5980 | file = Qnil; |
| 5981 | GCPRO1 (file); | 5981 | GCPRO1 (file); |
| @@ -5987,7 +5987,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 5987 | UNGCPRO; | 5987 | UNGCPRO; |
| 5988 | return 0; | 5988 | return 0; |
| 5989 | } | 5989 | } |
| 5990 | 5990 | ||
| 5991 | rc = xbm_read_bitmap_file_data (SDATA (file), &img->width, | 5991 | rc = xbm_read_bitmap_file_data (SDATA (file), &img->width, |
| 5992 | &img->height, &data); | 5992 | &img->height, &data); |
| 5993 | if (rc) | 5993 | if (rc) |
| @@ -5996,14 +5996,14 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 5996 | unsigned long foreground = FRAME_FOREGROUND_PIXEL (f); | 5996 | unsigned long foreground = FRAME_FOREGROUND_PIXEL (f); |
| 5997 | unsigned long background = FRAME_BACKGROUND_PIXEL (f); | 5997 | unsigned long background = FRAME_BACKGROUND_PIXEL (f); |
| 5998 | Lisp_Object value; | 5998 | Lisp_Object value; |
| 5999 | 5999 | ||
| 6000 | xassert (img->width > 0 && img->height > 0); | 6000 | xassert (img->width > 0 && img->height > 0); |
| 6001 | 6001 | ||
| 6002 | /* Get foreground and background colors, maybe allocate colors. */ | 6002 | /* Get foreground and background colors, maybe allocate colors. */ |
| 6003 | value = image_spec_value (img->spec, QCforeground, NULL); | 6003 | value = image_spec_value (img->spec, QCforeground, NULL); |
| 6004 | if (!NILP (value)) | 6004 | if (!NILP (value)) |
| 6005 | foreground = x_alloc_image_color (f, img, value, foreground); | 6005 | foreground = x_alloc_image_color (f, img, value, foreground); |
| 6006 | 6006 | ||
| 6007 | value = image_spec_value (img->spec, QCbackground, NULL); | 6007 | value = image_spec_value (img->spec, QCbackground, NULL); |
| 6008 | if (!NILP (value)) | 6008 | if (!NILP (value)) |
| 6009 | background = x_alloc_image_color (f, img, value, background); | 6009 | background = x_alloc_image_color (f, img, value, background); |
| @@ -6026,7 +6026,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 6026 | } | 6026 | } |
| 6027 | else | 6027 | else |
| 6028 | success_p = 1; | 6028 | success_p = 1; |
| 6029 | 6029 | ||
| 6030 | UNBLOCK_INPUT; | 6030 | UNBLOCK_INPUT; |
| 6031 | #endif /* MAC_TODO */ | 6031 | #endif /* MAC_TODO */ |
| 6032 | } | 6032 | } |
| @@ -6076,7 +6076,7 @@ xbm_load (f, img) | |||
| 6076 | xassert (img->width > 0 && img->height > 0); | 6076 | xassert (img->width > 0 && img->height > 0); |
| 6077 | 6077 | ||
| 6078 | BLOCK_INPUT; | 6078 | BLOCK_INPUT; |
| 6079 | 6079 | ||
| 6080 | if (fmt[XBM_ASCENT].count) | 6080 | if (fmt[XBM_ASCENT].count) |
| 6081 | img->ascent = XFASTINT (fmt[XBM_ASCENT].value); | 6081 | img->ascent = XFASTINT (fmt[XBM_ASCENT].value); |
| 6082 | 6082 | ||
| @@ -6095,7 +6095,7 @@ xbm_load (f, img) | |||
| 6095 | int i; | 6095 | int i; |
| 6096 | char *p; | 6096 | char *p; |
| 6097 | int nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR; | 6097 | int nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR; |
| 6098 | 6098 | ||
| 6099 | p = bits = (char *) alloca (nbytes * img->height); | 6099 | p = bits = (char *) alloca (nbytes * img->height); |
| 6100 | for (i = 0; i < img->height; ++i, p += nbytes) | 6100 | for (i = 0; i < img->height; ++i, p += nbytes) |
| 6101 | { | 6101 | { |
| @@ -6137,14 +6137,14 @@ xbm_load (f, img) | |||
| 6137 | 6137 | ||
| 6138 | return success_p; | 6138 | return success_p; |
| 6139 | } | 6139 | } |
| 6140 | 6140 | ||
| 6141 | 6141 | ||
| 6142 | 6142 | ||
| 6143 | /*********************************************************************** | 6143 | /*********************************************************************** |
| 6144 | XPM images | 6144 | XPM images |
| 6145 | ***********************************************************************/ | 6145 | ***********************************************************************/ |
| 6146 | 6146 | ||
| 6147 | #if HAVE_XPM | 6147 | #if HAVE_XPM |
| 6148 | 6148 | ||
| 6149 | static int xpm_image_p P_ ((Lisp_Object object)); | 6149 | static int xpm_image_p P_ ((Lisp_Object object)); |
| 6150 | static int xpm_load P_ ((struct frame *f, struct image *img)); | 6150 | static int xpm_load P_ ((struct frame *f, struct image *img)); |
| @@ -6278,7 +6278,7 @@ xpm_load (f, img) | |||
| 6278 | Lisp_Object tail; | 6278 | Lisp_Object tail; |
| 6279 | XpmColorSymbol *xpm_syms; | 6279 | XpmColorSymbol *xpm_syms; |
| 6280 | int i, size; | 6280 | int i, size; |
| 6281 | 6281 | ||
| 6282 | attrs.valuemask |= XpmColorSymbols; | 6282 | attrs.valuemask |= XpmColorSymbols; |
| 6283 | 6283 | ||
| 6284 | /* Count number of symbols. */ | 6284 | /* Count number of symbols. */ |
| @@ -6319,7 +6319,7 @@ xpm_load (f, img) | |||
| 6319 | UNBLOCK_INPUT; | 6319 | UNBLOCK_INPUT; |
| 6320 | return 0; | 6320 | return 0; |
| 6321 | } | 6321 | } |
| 6322 | 6322 | ||
| 6323 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), | 6323 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), |
| 6324 | SDATA (file), &img->pixmap, &img->mask, | 6324 | SDATA (file), &img->pixmap, &img->mask, |
| 6325 | &attrs); | 6325 | &attrs); |
| @@ -6359,19 +6359,19 @@ xpm_load (f, img) | |||
| 6359 | case XpmOpenFailed: | 6359 | case XpmOpenFailed: |
| 6360 | image_error ("Error opening XPM file (%s)", img->spec, Qnil); | 6360 | image_error ("Error opening XPM file (%s)", img->spec, Qnil); |
| 6361 | break; | 6361 | break; |
| 6362 | 6362 | ||
| 6363 | case XpmFileInvalid: | 6363 | case XpmFileInvalid: |
| 6364 | image_error ("Invalid XPM file (%s)", img->spec, Qnil); | 6364 | image_error ("Invalid XPM file (%s)", img->spec, Qnil); |
| 6365 | break; | 6365 | break; |
| 6366 | 6366 | ||
| 6367 | case XpmNoMemory: | 6367 | case XpmNoMemory: |
| 6368 | image_error ("Out of memory (%s)", img->spec, Qnil); | 6368 | image_error ("Out of memory (%s)", img->spec, Qnil); |
| 6369 | break; | 6369 | break; |
| 6370 | 6370 | ||
| 6371 | case XpmColorFailed: | 6371 | case XpmColorFailed: |
| 6372 | image_error ("Color allocation error (%s)", img->spec, Qnil); | 6372 | image_error ("Color allocation error (%s)", img->spec, Qnil); |
| 6373 | break; | 6373 | break; |
| 6374 | 6374 | ||
| 6375 | default: | 6375 | default: |
| 6376 | image_error ("Unknown error (%s)", img->spec, Qnil); | 6376 | image_error ("Unknown error (%s)", img->spec, Qnil); |
| 6377 | break; | 6377 | break; |
| @@ -6520,7 +6520,7 @@ lookup_pixel_color (f, pixel) | |||
| 6520 | int rc; | 6520 | int rc; |
| 6521 | 6521 | ||
| 6522 | BLOCK_INPUT; | 6522 | BLOCK_INPUT; |
| 6523 | 6523 | ||
| 6524 | cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); | 6524 | cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); |
| 6525 | color.pixel = pixel; | 6525 | color.pixel = pixel; |
| 6526 | XQueryColor (NULL, cmap, &color); | 6526 | XQueryColor (NULL, cmap, &color); |
| @@ -6530,7 +6530,7 @@ lookup_pixel_color (f, pixel) | |||
| 6530 | if (rc) | 6530 | if (rc) |
| 6531 | { | 6531 | { |
| 6532 | ++ct_colors_allocated; | 6532 | ++ct_colors_allocated; |
| 6533 | 6533 | ||
| 6534 | p = (struct ct_color *) xmalloc (sizeof *p); | 6534 | p = (struct ct_color *) xmalloc (sizeof *p); |
| 6535 | p->r = color.red; | 6535 | p->r = color.red; |
| 6536 | p->g = color.green; | 6536 | p->g = color.green; |
| @@ -6567,7 +6567,7 @@ colors_in_color_table (n) | |||
| 6567 | colors = (unsigned long *) xmalloc (ct_colors_allocated | 6567 | colors = (unsigned long *) xmalloc (ct_colors_allocated |
| 6568 | * sizeof *colors); | 6568 | * sizeof *colors); |
| 6569 | *n = ct_colors_allocated; | 6569 | *n = ct_colors_allocated; |
| 6570 | 6570 | ||
| 6571 | for (i = j = 0; i < CT_SIZE; ++i) | 6571 | for (i = j = 0; i < CT_SIZE; ++i) |
| 6572 | for (p = ct_table[i]; p; p = p->next) | 6572 | for (p = ct_table[i]; p; p = p->next) |
| 6573 | colors[j++] = p->pixel; | 6573 | colors[j++] = p->pixel; |
| @@ -6625,7 +6625,7 @@ x_laplace_write_row (f, pixels, width, ximg, y) | |||
| 6625 | int y; | 6625 | int y; |
| 6626 | { | 6626 | { |
| 6627 | int x; | 6627 | int x; |
| 6628 | 6628 | ||
| 6629 | for (x = 0; x < width; ++x) | 6629 | for (x = 0; x < width; ++x) |
| 6630 | XPutPixel (ximg, x, y, pixels[x]); | 6630 | XPutPixel (ximg, x, y, pixels[x]); |
| 6631 | } | 6631 | } |
| @@ -6691,7 +6691,7 @@ x_laplace (f, img) | |||
| 6691 | int r = in[rowa][x].red + mv2 - in[rowb][x + 2].red; | 6691 | int r = in[rowa][x].red + mv2 - in[rowb][x + 2].red; |
| 6692 | int g = in[rowa][x].green + mv2 - in[rowb][x + 2].green; | 6692 | int g = in[rowa][x].green + mv2 - in[rowb][x + 2].green; |
| 6693 | int b = in[rowa][x].blue + mv2 - in[rowb][x + 2].blue; | 6693 | int b = in[rowa][x].blue + mv2 - in[rowb][x + 2].blue; |
| 6694 | 6694 | ||
| 6695 | out[x + 1] = lookup_rgb_color (f, r & 0xffff, g & 0xffff, | 6695 | out[x + 1] = lookup_rgb_color (f, r & 0xffff, g & 0xffff, |
| 6696 | b & 0xffff); | 6696 | b & 0xffff); |
| 6697 | } | 6697 | } |
| @@ -6707,7 +6707,7 @@ x_laplace (f, img) | |||
| 6707 | /* Free the input image, and free resources of IMG. */ | 6707 | /* Free the input image, and free resources of IMG. */ |
| 6708 | XDestroyImage (ximg); | 6708 | XDestroyImage (ximg); |
| 6709 | x_clear_image (f, img); | 6709 | x_clear_image (f, img); |
| 6710 | 6710 | ||
| 6711 | /* Put the output image into pixmap, and destroy it. */ | 6711 | /* Put the output image into pixmap, and destroy it. */ |
| 6712 | x_put_x_image (f, oimg, pixmap, img->width, img->height); | 6712 | x_put_x_image (f, oimg, pixmap, img->width, img->height); |
| 6713 | x_destroy_x_image (oimg); | 6713 | x_destroy_x_image (oimg); |
| @@ -6742,7 +6742,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6742 | unsigned long bg; | 6742 | unsigned long bg; |
| 6743 | 6743 | ||
| 6744 | BLOCK_INPUT; | 6744 | BLOCK_INPUT; |
| 6745 | 6745 | ||
| 6746 | /* Create an image and pixmap serving as mask. */ | 6746 | /* Create an image and pixmap serving as mask. */ |
| 6747 | rc = x_create_x_image_and_pixmap (f, img->width, img->height, 1, | 6747 | rc = x_create_x_image_and_pixmap (f, img->width, img->height, 1, |
| 6748 | &mask_img, &img->mask); | 6748 | &mask_img, &img->mask); |
| @@ -6760,7 +6760,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6760 | take that as color. Otherwise, try to determine the color | 6760 | take that as color. Otherwise, try to determine the color |
| 6761 | heuristically. */ | 6761 | heuristically. */ |
| 6762 | look_at_corners_p = 1; | 6762 | look_at_corners_p = 1; |
| 6763 | 6763 | ||
| 6764 | if (CONSP (how)) | 6764 | if (CONSP (how)) |
| 6765 | { | 6765 | { |
| 6766 | int rgb[3], i = 0; | 6766 | int rgb[3], i = 0; |
| @@ -6780,7 +6780,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6780 | Colormap cmap; | 6780 | Colormap cmap; |
| 6781 | 6781 | ||
| 6782 | sprintf (color_name, "#%04x%04x%04x", rgb[0], rgb[1], rgb[2]); | 6782 | sprintf (color_name, "#%04x%04x%04x", rgb[0], rgb[1], rgb[2]); |
| 6783 | 6783 | ||
| 6784 | cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); | 6784 | cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); |
| 6785 | if (XLookupColor (dpy, cmap, color_name, &exact, &color)) | 6785 | if (XLookupColor (dpy, cmap, color_name, &exact, &color)) |
| 6786 | { | 6786 | { |
| @@ -6789,7 +6789,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6789 | } | 6789 | } |
| 6790 | } | 6790 | } |
| 6791 | } | 6791 | } |
| 6792 | 6792 | ||
| 6793 | if (look_at_corners_p) | 6793 | if (look_at_corners_p) |
| 6794 | { | 6794 | { |
| 6795 | unsigned long corners[4]; | 6795 | unsigned long corners[4]; |
| @@ -6805,7 +6805,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6805 | for (i = best_count = 0; i < 4; ++i) | 6805 | for (i = best_count = 0; i < 4; ++i) |
| 6806 | { | 6806 | { |
| 6807 | int j, n; | 6807 | int j, n; |
| 6808 | 6808 | ||
| 6809 | for (j = n = 0; j < 4; ++j) | 6809 | for (j = n = 0; j < 4; ++j) |
| 6810 | if (corners[i] == corners[j]) | 6810 | if (corners[i] == corners[j]) |
| 6811 | ++n; | 6811 | ++n; |
| @@ -6825,7 +6825,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 6825 | x_put_x_image (f, mask_img, img->mask, img->width, img->height); | 6825 | x_put_x_image (f, mask_img, img->mask, img->width, img->height); |
| 6826 | x_destroy_x_image (mask_img); | 6826 | x_destroy_x_image (mask_img); |
| 6827 | XDestroyImage (ximg); | 6827 | XDestroyImage (ximg); |
| 6828 | 6828 | ||
| 6829 | UNBLOCK_INPUT; | 6829 | UNBLOCK_INPUT; |
| 6830 | #endif /* MAC_TODO */ | 6830 | #endif /* MAC_TODO */ |
| 6831 | 6831 | ||
| @@ -6896,11 +6896,11 @@ pbm_image_p (object) | |||
| 6896 | Lisp_Object object; | 6896 | Lisp_Object object; |
| 6897 | { | 6897 | { |
| 6898 | struct image_keyword fmt[PBM_LAST]; | 6898 | struct image_keyword fmt[PBM_LAST]; |
| 6899 | 6899 | ||
| 6900 | bcopy (pbm_format, fmt, sizeof fmt); | 6900 | bcopy (pbm_format, fmt, sizeof fmt); |
| 6901 | 6901 | ||
| 6902 | if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm) | 6902 | if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm) |
| 6903 | || (fmt[PBM_ASCENT].count | 6903 | || (fmt[PBM_ASCENT].count |
| 6904 | && XFASTINT (fmt[PBM_ASCENT].value) > 100)) | 6904 | && XFASTINT (fmt[PBM_ASCENT].value) > 100)) |
| 6905 | return 0; | 6905 | return 0; |
| 6906 | 6906 | ||
| @@ -6978,14 +6978,14 @@ pbm_read_file (file, size) | |||
| 6978 | buf = NULL; | 6978 | buf = NULL; |
| 6979 | } | 6979 | } |
| 6980 | } | 6980 | } |
| 6981 | 6981 | ||
| 6982 | return buf; | 6982 | return buf; |
| 6983 | } | 6983 | } |
| 6984 | 6984 | ||
| 6985 | 6985 | ||
| 6986 | /* Load PBM image IMG for use on frame F. */ | 6986 | /* Load PBM image IMG for use on frame F. */ |
| 6987 | 6987 | ||
| 6988 | static int | 6988 | static int |
| 6989 | pbm_load (f, img) | 6989 | pbm_load (f, img) |
| 6990 | struct frame *f; | 6990 | struct frame *f; |
| 6991 | struct image *img; | 6991 | struct image *img; |
| @@ -7048,7 +7048,7 @@ pbm_load (f, img) | |||
| 7048 | case '1': | 7048 | case '1': |
| 7049 | raw_p = 0, type = PBM_MONO; | 7049 | raw_p = 0, type = PBM_MONO; |
| 7050 | break; | 7050 | break; |
| 7051 | 7051 | ||
| 7052 | case '2': | 7052 | case '2': |
| 7053 | raw_p = 0, type = PBM_GRAY; | 7053 | raw_p = 0, type = PBM_GRAY; |
| 7054 | break; | 7054 | break; |
| @@ -7060,11 +7060,11 @@ pbm_load (f, img) | |||
| 7060 | case '4': | 7060 | case '4': |
| 7061 | raw_p = 1, type = PBM_MONO; | 7061 | raw_p = 1, type = PBM_MONO; |
| 7062 | break; | 7062 | break; |
| 7063 | 7063 | ||
| 7064 | case '5': | 7064 | case '5': |
| 7065 | raw_p = 1, type = PBM_GRAY; | 7065 | raw_p = 1, type = PBM_GRAY; |
| 7066 | break; | 7066 | break; |
| 7067 | 7067 | ||
| 7068 | case '6': | 7068 | case '6': |
| 7069 | raw_p = 1, type = PBM_COLOR; | 7069 | raw_p = 1, type = PBM_COLOR; |
| 7070 | break; | 7070 | break; |
| @@ -7085,7 +7085,7 @@ pbm_load (f, img) | |||
| 7085 | if (raw_p && max_color_idx > 255) | 7085 | if (raw_p && max_color_idx > 255) |
| 7086 | max_color_idx = 255; | 7086 | max_color_idx = 255; |
| 7087 | } | 7087 | } |
| 7088 | 7088 | ||
| 7089 | if (width < 0 | 7089 | if (width < 0 |
| 7090 | || height < 0 | 7090 | || height < 0 |
| 7091 | || (type != PBM_MONO && max_color_idx < 0)) | 7091 | || (type != PBM_MONO && max_color_idx < 0)) |
| @@ -7098,14 +7098,14 @@ pbm_load (f, img) | |||
| 7098 | UNBLOCK_INPUT; | 7098 | UNBLOCK_INPUT; |
| 7099 | goto error; | 7099 | goto error; |
| 7100 | } | 7100 | } |
| 7101 | 7101 | ||
| 7102 | /* Initialize the color hash table. */ | 7102 | /* Initialize the color hash table. */ |
| 7103 | init_color_table (); | 7103 | init_color_table (); |
| 7104 | 7104 | ||
| 7105 | if (type == PBM_MONO) | 7105 | if (type == PBM_MONO) |
| 7106 | { | 7106 | { |
| 7107 | int c = 0, g; | 7107 | int c = 0, g; |
| 7108 | 7108 | ||
| 7109 | for (y = 0; y < height; ++y) | 7109 | for (y = 0; y < height; ++y) |
| 7110 | for (x = 0; x < width; ++x) | 7110 | for (x = 0; x < width; ++x) |
| 7111 | { | 7111 | { |
| @@ -7130,7 +7130,7 @@ pbm_load (f, img) | |||
| 7130 | for (x = 0; x < width; ++x) | 7130 | for (x = 0; x < width; ++x) |
| 7131 | { | 7131 | { |
| 7132 | int r, g, b; | 7132 | int r, g, b; |
| 7133 | 7133 | ||
| 7134 | if (type == PBM_GRAY) | 7134 | if (type == PBM_GRAY) |
| 7135 | r = g = b = raw_p ? *p++ : pbm_scan_number (&p, end); | 7135 | r = g = b = raw_p ? *p++ : pbm_scan_number (&p, end); |
| 7136 | else if (raw_p) | 7136 | else if (raw_p) |
| @@ -7145,7 +7145,7 @@ pbm_load (f, img) | |||
| 7145 | g = pbm_scan_number (&p, end); | 7145 | g = pbm_scan_number (&p, end); |
| 7146 | b = pbm_scan_number (&p, end); | 7146 | b = pbm_scan_number (&p, end); |
| 7147 | } | 7147 | } |
| 7148 | 7148 | ||
| 7149 | if (r < 0 || g < 0 || b < 0) | 7149 | if (r < 0 || g < 0 || b < 0) |
| 7150 | { | 7150 | { |
| 7151 | xfree (ximg->data); | 7151 | xfree (ximg->data); |
| @@ -7156,7 +7156,7 @@ pbm_load (f, img) | |||
| 7156 | img->spec, Qnil); | 7156 | img->spec, Qnil); |
| 7157 | goto error; | 7157 | goto error; |
| 7158 | } | 7158 | } |
| 7159 | 7159 | ||
| 7160 | /* RGB values are now in the range 0..max_color_idx. | 7160 | /* RGB values are now in the range 0..max_color_idx. |
| 7161 | Scale this to the range 0..0xffff supported by X. */ | 7161 | Scale this to the range 0..0xffff supported by X. */ |
| 7162 | r = (double) r * 65535 / max_color_idx; | 7162 | r = (double) r * 65535 / max_color_idx; |
| @@ -7165,17 +7165,17 @@ pbm_load (f, img) | |||
| 7165 | XPutPixel (ximg, x, y, lookup_rgb_color (f, r, g, b)); | 7165 | XPutPixel (ximg, x, y, lookup_rgb_color (f, r, g, b)); |
| 7166 | } | 7166 | } |
| 7167 | } | 7167 | } |
| 7168 | 7168 | ||
| 7169 | /* Store in IMG->colors the colors allocated for the image, and | 7169 | /* Store in IMG->colors the colors allocated for the image, and |
| 7170 | free the color table. */ | 7170 | free the color table. */ |
| 7171 | img->colors = colors_in_color_table (&img->ncolors); | 7171 | img->colors = colors_in_color_table (&img->ncolors); |
| 7172 | free_color_table (); | 7172 | free_color_table (); |
| 7173 | 7173 | ||
| 7174 | /* Put the image into a pixmap. */ | 7174 | /* Put the image into a pixmap. */ |
| 7175 | x_put_x_image (f, ximg, img->pixmap, width, height); | 7175 | x_put_x_image (f, ximg, img->pixmap, width, height); |
| 7176 | x_destroy_x_image (ximg); | 7176 | x_destroy_x_image (ximg); |
| 7177 | UNBLOCK_INPUT; | 7177 | UNBLOCK_INPUT; |
| 7178 | 7178 | ||
| 7179 | img->width = width; | 7179 | img->width = width; |
| 7180 | img->height = height; | 7180 | img->height = height; |
| 7181 | 7181 | ||
| @@ -7253,9 +7253,9 @@ png_image_p (object) | |||
| 7253 | { | 7253 | { |
| 7254 | struct image_keyword fmt[PNG_LAST]; | 7254 | struct image_keyword fmt[PNG_LAST]; |
| 7255 | bcopy (png_format, fmt, sizeof fmt); | 7255 | bcopy (png_format, fmt, sizeof fmt); |
| 7256 | 7256 | ||
| 7257 | if (!parse_image_spec (object, fmt, PNG_LAST, Qpng) | 7257 | if (!parse_image_spec (object, fmt, PNG_LAST, Qpng) |
| 7258 | || (fmt[PNG_ASCENT].count | 7258 | || (fmt[PNG_ASCENT].count |
| 7259 | && XFASTINT (fmt[PNG_ASCENT].value) > 100)) | 7259 | && XFASTINT (fmt[PNG_ASCENT].value) > 100)) |
| 7260 | return 0; | 7260 | return 0; |
| 7261 | 7261 | ||
| @@ -7312,7 +7312,7 @@ png_read_from_memory (png_ptr, data, length) | |||
| 7312 | 7312 | ||
| 7313 | if (length > tbr->len - tbr->index) | 7313 | if (length > tbr->len - tbr->index) |
| 7314 | png_error (png_ptr, "Read error"); | 7314 | png_error (png_ptr, "Read error"); |
| 7315 | 7315 | ||
| 7316 | bcopy (tbr->bytes + tbr->index, data, length); | 7316 | bcopy (tbr->bytes + tbr->index, data, length); |
| 7317 | tbr->index = tbr->index + length; | 7317 | tbr->index = tbr->index + length; |
| 7318 | } | 7318 | } |
| @@ -7455,14 +7455,14 @@ png_load (f, img) | |||
| 7455 | png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, | 7455 | png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, |
| 7456 | &interlace_type, NULL, NULL); | 7456 | &interlace_type, NULL, NULL); |
| 7457 | 7457 | ||
| 7458 | /* If image contains simply transparency data, we prefer to | 7458 | /* If image contains simply transparency data, we prefer to |
| 7459 | construct a clipping mask. */ | 7459 | construct a clipping mask. */ |
| 7460 | if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) | 7460 | if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) |
| 7461 | transparent_p = 1; | 7461 | transparent_p = 1; |
| 7462 | else | 7462 | else |
| 7463 | transparent_p = 0; | 7463 | transparent_p = 0; |
| 7464 | 7464 | ||
| 7465 | /* This function is easier to write if we only have to handle | 7465 | /* This function is easier to write if we only have to handle |
| 7466 | one data format: RGB or RGBA with 8 bits per channel. Let's | 7466 | one data format: RGB or RGBA with 8 bits per channel. Let's |
| 7467 | transform other formats into that format. */ | 7467 | transform other formats into that format. */ |
| 7468 | 7468 | ||
| @@ -7475,7 +7475,7 @@ png_load (f, img) | |||
| 7475 | png_set_expand (png_ptr); | 7475 | png_set_expand (png_ptr); |
| 7476 | 7476 | ||
| 7477 | /* Convert grayscale images to RGB. */ | 7477 | /* Convert grayscale images to RGB. */ |
| 7478 | if (color_type == PNG_COLOR_TYPE_GRAY | 7478 | if (color_type == PNG_COLOR_TYPE_GRAY |
| 7479 | || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) | 7479 | || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) |
| 7480 | png_set_gray_to_rgb (png_ptr); | 7480 | png_set_gray_to_rgb (png_ptr); |
| 7481 | 7481 | ||
| @@ -7506,14 +7506,14 @@ png_load (f, img) | |||
| 7506 | png_color_16 *image_background; | 7506 | png_color_16 *image_background; |
| 7507 | 7507 | ||
| 7508 | if (png_get_bKGD (png_ptr, info_ptr, &image_background)) | 7508 | if (png_get_bKGD (png_ptr, info_ptr, &image_background)) |
| 7509 | /* Image contains a background color with which to | 7509 | /* Image contains a background color with which to |
| 7510 | combine the image. */ | 7510 | combine the image. */ |
| 7511 | png_set_background (png_ptr, image_background, | 7511 | png_set_background (png_ptr, image_background, |
| 7512 | PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); | 7512 | PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); |
| 7513 | else | 7513 | else |
| 7514 | { | 7514 | { |
| 7515 | /* Image does not contain a background color with which | 7515 | /* Image does not contain a background color with which |
| 7516 | to combine the image data via an alpha channel. Use | 7516 | to combine the image data via an alpha channel. Use |
| 7517 | the frame's background instead. */ | 7517 | the frame's background instead. */ |
| 7518 | XColor color; | 7518 | XColor color; |
| 7519 | Colormap cmap; | 7519 | Colormap cmap; |
| @@ -7573,7 +7573,7 @@ png_load (f, img) | |||
| 7573 | UNBLOCK_INPUT; | 7573 | UNBLOCK_INPUT; |
| 7574 | goto error; | 7574 | goto error; |
| 7575 | } | 7575 | } |
| 7576 | 7576 | ||
| 7577 | /* Create an image and pixmap serving as mask if the PNG image | 7577 | /* Create an image and pixmap serving as mask if the PNG image |
| 7578 | contains an alpha channel. */ | 7578 | contains an alpha channel. */ |
| 7579 | if (channels == 4 | 7579 | if (channels == 4 |
| @@ -7605,16 +7605,16 @@ png_load (f, img) | |||
| 7605 | XPutPixel (ximg, x, y, lookup_rgb_color (f, r, g, b)); | 7605 | XPutPixel (ximg, x, y, lookup_rgb_color (f, r, g, b)); |
| 7606 | 7606 | ||
| 7607 | /* An alpha channel, aka mask channel, associates variable | 7607 | /* An alpha channel, aka mask channel, associates variable |
| 7608 | transparency with an image. Where other image formats | 7608 | transparency with an image. Where other image formats |
| 7609 | support binary transparency---fully transparent or fully | 7609 | support binary transparency---fully transparent or fully |
| 7610 | opaque---PNG allows up to 254 levels of partial transparency. | 7610 | opaque---PNG allows up to 254 levels of partial transparency. |
| 7611 | The PNG library implements partial transparency by combining | 7611 | The PNG library implements partial transparency by combining |
| 7612 | the image with a specified background color. | 7612 | the image with a specified background color. |
| 7613 | 7613 | ||
| 7614 | I'm not sure how to handle this here nicely: because the | 7614 | I'm not sure how to handle this here nicely: because the |
| 7615 | background on which the image is displayed may change, for | 7615 | background on which the image is displayed may change, for |
| 7616 | real alpha channel support, it would be necessary to create | 7616 | real alpha channel support, it would be necessary to create |
| 7617 | a new image for each possible background. | 7617 | a new image for each possible background. |
| 7618 | 7618 | ||
| 7619 | What I'm doing now is that a mask is created if we have | 7619 | What I'm doing now is that a mask is created if we have |
| 7620 | boolean transparency information. Otherwise I'm using | 7620 | boolean transparency information. Otherwise I'm using |
| @@ -7738,11 +7738,11 @@ jpeg_image_p (object) | |||
| 7738 | Lisp_Object object; | 7738 | Lisp_Object object; |
| 7739 | { | 7739 | { |
| 7740 | struct image_keyword fmt[JPEG_LAST]; | 7740 | struct image_keyword fmt[JPEG_LAST]; |
| 7741 | 7741 | ||
| 7742 | bcopy (jpeg_format, fmt, sizeof fmt); | 7742 | bcopy (jpeg_format, fmt, sizeof fmt); |
| 7743 | 7743 | ||
| 7744 | if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg) | 7744 | if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg) |
| 7745 | || (fmt[JPEG_ASCENT].count | 7745 | || (fmt[JPEG_ASCENT].count |
| 7746 | && XFASTINT (fmt[JPEG_ASCENT].value) > 100)) | 7746 | && XFASTINT (fmt[JPEG_ASCENT].value) > 100)) |
| 7747 | return 0; | 7747 | return 0; |
| 7748 | 7748 | ||
| @@ -7811,7 +7811,7 @@ our_skip_input_data (cinfo, num_bytes) | |||
| 7811 | { | 7811 | { |
| 7812 | if (num_bytes > src->bytes_in_buffer) | 7812 | if (num_bytes > src->bytes_in_buffer) |
| 7813 | ERREXIT (cinfo, JERR_INPUT_EOF); | 7813 | ERREXIT (cinfo, JERR_INPUT_EOF); |
| 7814 | 7814 | ||
| 7815 | src->bytes_in_buffer -= num_bytes; | 7815 | src->bytes_in_buffer -= num_bytes; |
| 7816 | src->next_input_byte += num_bytes; | 7816 | src->next_input_byte += num_bytes; |
| 7817 | } | 7817 | } |
| @@ -7849,7 +7849,7 @@ jpeg_memory_src (cinfo, data, len) | |||
| 7849 | src = (struct jpeg_source_mgr *) cinfo->src; | 7849 | src = (struct jpeg_source_mgr *) cinfo->src; |
| 7850 | src->next_input_byte = data; | 7850 | src->next_input_byte = data; |
| 7851 | } | 7851 | } |
| 7852 | 7852 | ||
| 7853 | src = (struct jpeg_source_mgr *) cinfo->src; | 7853 | src = (struct jpeg_source_mgr *) cinfo->src; |
| 7854 | src->init_source = our_init_source; | 7854 | src->init_source = our_init_source; |
| 7855 | src->fill_input_buffer = our_fill_input_buffer; | 7855 | src->fill_input_buffer = our_fill_input_buffer; |
| @@ -7864,7 +7864,7 @@ jpeg_memory_src (cinfo, data, len) | |||
| 7864 | /* Load image IMG for use on frame F. Patterned after example.c | 7864 | /* Load image IMG for use on frame F. Patterned after example.c |
| 7865 | from the JPEG lib. */ | 7865 | from the JPEG lib. */ |
| 7866 | 7866 | ||
| 7867 | static int | 7867 | static int |
| 7868 | jpeg_load (f, img) | 7868 | jpeg_load (f, img) |
| 7869 | struct frame *f; | 7869 | struct frame *f; |
| 7870 | struct image *img; | 7870 | struct image *img; |
| @@ -7897,7 +7897,7 @@ jpeg_load (f, img) | |||
| 7897 | UNGCPRO; | 7897 | UNGCPRO; |
| 7898 | return 0; | 7898 | return 0; |
| 7899 | } | 7899 | } |
| 7900 | 7900 | ||
| 7901 | fp = fopen (SDATA (file), "r"); | 7901 | fp = fopen (SDATA (file), "r"); |
| 7902 | if (fp == NULL) | 7902 | if (fp == NULL) |
| 7903 | { | 7903 | { |
| @@ -7906,12 +7906,12 @@ jpeg_load (f, img) | |||
| 7906 | return 0; | 7906 | return 0; |
| 7907 | } | 7907 | } |
| 7908 | } | 7908 | } |
| 7909 | 7909 | ||
| 7910 | /* Customize libjpeg's error handling to call my_error_exit when an | 7910 | /* Customize libjpeg's error handling to call my_error_exit when an |
| 7911 | error is detected. This function will perform a longjmp. */ | 7911 | error is detected. This function will perform a longjmp. */ |
| 7912 | mgr.pub.error_exit = my_error_exit; | 7912 | mgr.pub.error_exit = my_error_exit; |
| 7913 | cinfo.err = jpeg_std_error (&mgr.pub); | 7913 | cinfo.err = jpeg_std_error (&mgr.pub); |
| 7914 | 7914 | ||
| 7915 | if ((rc = setjmp (mgr.setjmp_buffer)) != 0) | 7915 | if ((rc = setjmp (mgr.setjmp_buffer)) != 0) |
| 7916 | { | 7916 | { |
| 7917 | if (rc == 1) | 7917 | if (rc == 1) |
| @@ -7922,20 +7922,20 @@ jpeg_load (f, img) | |||
| 7922 | image_error ("Error reading JPEG image `%s': %s", img->spec, | 7922 | image_error ("Error reading JPEG image `%s': %s", img->spec, |
| 7923 | build_string (buffer)); | 7923 | build_string (buffer)); |
| 7924 | } | 7924 | } |
| 7925 | 7925 | ||
| 7926 | /* Close the input file and destroy the JPEG object. */ | 7926 | /* Close the input file and destroy the JPEG object. */ |
| 7927 | if (fp) | 7927 | if (fp) |
| 7928 | fclose (fp); | 7928 | fclose (fp); |
| 7929 | jpeg_destroy_decompress (&cinfo); | 7929 | jpeg_destroy_decompress (&cinfo); |
| 7930 | 7930 | ||
| 7931 | BLOCK_INPUT; | 7931 | BLOCK_INPUT; |
| 7932 | 7932 | ||
| 7933 | /* If we already have an XImage, free that. */ | 7933 | /* If we already have an XImage, free that. */ |
| 7934 | x_destroy_x_image (ximg); | 7934 | x_destroy_x_image (ximg); |
| 7935 | 7935 | ||
| 7936 | /* Free pixmap and colors. */ | 7936 | /* Free pixmap and colors. */ |
| 7937 | x_clear_image (f, img); | 7937 | x_clear_image (f, img); |
| 7938 | 7938 | ||
| 7939 | UNBLOCK_INPUT; | 7939 | UNBLOCK_INPUT; |
| 7940 | UNGCPRO; | 7940 | UNGCPRO; |
| 7941 | return 0; | 7941 | return 0; |
| @@ -7992,7 +7992,7 @@ jpeg_load (f, img) | |||
| 7992 | init_color_table (); | 7992 | init_color_table (); |
| 7993 | colors = (unsigned long *) alloca (cinfo.actual_number_of_colors | 7993 | colors = (unsigned long *) alloca (cinfo.actual_number_of_colors |
| 7994 | * sizeof *colors); | 7994 | * sizeof *colors); |
| 7995 | 7995 | ||
| 7996 | for (i = 0; i < cinfo.actual_number_of_colors; ++i) | 7996 | for (i = 0; i < cinfo.actual_number_of_colors; ++i) |
| 7997 | { | 7997 | { |
| 7998 | /* Multiply RGB values with 255 because X expects RGB values | 7998 | /* Multiply RGB values with 255 because X expects RGB values |
| @@ -8024,7 +8024,7 @@ jpeg_load (f, img) | |||
| 8024 | jpeg_destroy_decompress (&cinfo); | 8024 | jpeg_destroy_decompress (&cinfo); |
| 8025 | if (fp) | 8025 | if (fp) |
| 8026 | fclose (fp); | 8026 | fclose (fp); |
| 8027 | 8027 | ||
| 8028 | /* Put the image into the pixmap. */ | 8028 | /* Put the image into the pixmap. */ |
| 8029 | x_put_x_image (f, ximg, img->pixmap, width, height); | 8029 | x_put_x_image (f, ximg, img->pixmap, width, height); |
| 8030 | x_destroy_x_image (ximg); | 8030 | x_destroy_x_image (ximg); |
| @@ -8102,12 +8102,12 @@ tiff_image_p (object) | |||
| 8102 | { | 8102 | { |
| 8103 | struct image_keyword fmt[TIFF_LAST]; | 8103 | struct image_keyword fmt[TIFF_LAST]; |
| 8104 | bcopy (tiff_format, fmt, sizeof fmt); | 8104 | bcopy (tiff_format, fmt, sizeof fmt); |
| 8105 | 8105 | ||
| 8106 | if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff) | 8106 | if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff) |
| 8107 | || (fmt[TIFF_ASCENT].count | 8107 | || (fmt[TIFF_ASCENT].count |
| 8108 | && XFASTINT (fmt[TIFF_ASCENT].value) > 100)) | 8108 | && XFASTINT (fmt[TIFF_ASCENT].value) > 100)) |
| 8109 | return 0; | 8109 | return 0; |
| 8110 | 8110 | ||
| 8111 | /* Must specify either the :data or :file keyword. */ | 8111 | /* Must specify either the :data or :file keyword. */ |
| 8112 | return fmt[TIFF_FILE].count + fmt[TIFF_DATA].count == 1; | 8112 | return fmt[TIFF_FILE].count + fmt[TIFF_DATA].count == 1; |
| 8113 | } | 8113 | } |
| @@ -8168,22 +8168,22 @@ tiff_seek_in_memory (data, off, whence) | |||
| 8168 | case SEEK_SET: /* Go from beginning of source. */ | 8168 | case SEEK_SET: /* Go from beginning of source. */ |
| 8169 | idx = off; | 8169 | idx = off; |
| 8170 | break; | 8170 | break; |
| 8171 | 8171 | ||
| 8172 | case SEEK_END: /* Go from end of source. */ | 8172 | case SEEK_END: /* Go from end of source. */ |
| 8173 | idx = src->len + off; | 8173 | idx = src->len + off; |
| 8174 | break; | 8174 | break; |
| 8175 | 8175 | ||
| 8176 | case SEEK_CUR: /* Go from current position. */ | 8176 | case SEEK_CUR: /* Go from current position. */ |
| 8177 | idx = src->index + off; | 8177 | idx = src->index + off; |
| 8178 | break; | 8178 | break; |
| 8179 | 8179 | ||
| 8180 | default: /* Invalid `whence'. */ | 8180 | default: /* Invalid `whence'. */ |
| 8181 | return -1; | 8181 | return -1; |
| 8182 | } | 8182 | } |
| 8183 | 8183 | ||
| 8184 | if (idx > src->len || idx < 0) | 8184 | if (idx > src->len || idx < 0) |
| 8185 | return -1; | 8185 | return -1; |
| 8186 | 8186 | ||
| 8187 | src->index = idx; | 8187 | src->index = idx; |
| 8188 | return src->index; | 8188 | return src->index; |
| 8189 | } | 8189 | } |
| @@ -8255,7 +8255,7 @@ tiff_load (f, img) | |||
| 8255 | UNGCPRO; | 8255 | UNGCPRO; |
| 8256 | return 0; | 8256 | return 0; |
| 8257 | } | 8257 | } |
| 8258 | 8258 | ||
| 8259 | /* Try to open the image file. */ | 8259 | /* Try to open the image file. */ |
| 8260 | tiff = TIFFOpen (SDATA (file), "r"); | 8260 | tiff = TIFFOpen (SDATA (file), "r"); |
| 8261 | if (tiff == NULL) | 8261 | if (tiff == NULL) |
| @@ -8294,7 +8294,7 @@ tiff_load (f, img) | |||
| 8294 | TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width); | 8294 | TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width); |
| 8295 | TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height); | 8295 | TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height); |
| 8296 | buf = (uint32 *) xmalloc (width * height * sizeof *buf); | 8296 | buf = (uint32 *) xmalloc (width * height * sizeof *buf); |
| 8297 | 8297 | ||
| 8298 | rc = TIFFReadRGBAImage (tiff, width, height, buf, 0); | 8298 | rc = TIFFReadRGBAImage (tiff, width, height, buf, 0); |
| 8299 | TIFFClose (tiff); | 8299 | TIFFClose (tiff); |
| 8300 | if (!rc) | 8300 | if (!rc) |
| @@ -8323,14 +8323,14 @@ tiff_load (f, img) | |||
| 8323 | for (y = 0; y < height; ++y) | 8323 | for (y = 0; y < height; ++y) |
| 8324 | { | 8324 | { |
| 8325 | uint32 *row = buf + y * width; | 8325 | uint32 *row = buf + y * width; |
| 8326 | 8326 | ||
| 8327 | for (x = 0; x < width; ++x) | 8327 | for (x = 0; x < width; ++x) |
| 8328 | { | 8328 | { |
| 8329 | uint32 abgr = row[x]; | 8329 | uint32 abgr = row[x]; |
| 8330 | int r = TIFFGetR (abgr) << 8; | 8330 | int r = TIFFGetR (abgr) << 8; |
| 8331 | int g = TIFFGetG (abgr) << 8; | 8331 | int g = TIFFGetG (abgr) << 8; |
| 8332 | int b = TIFFGetB (abgr) << 8; | 8332 | int b = TIFFGetB (abgr) << 8; |
| 8333 | XPutPixel (ximg, x, height - 1 - y, lookup_rgb_color (f, r, g, b)); | 8333 | XPutPixel (ximg, x, height - 1 - y, lookup_rgb_color (f, r, g, b)); |
| 8334 | } | 8334 | } |
| 8335 | } | 8335 | } |
| 8336 | 8336 | ||
| @@ -8343,7 +8343,7 @@ tiff_load (f, img) | |||
| 8343 | x_destroy_x_image (ximg); | 8343 | x_destroy_x_image (ximg); |
| 8344 | xfree (buf); | 8344 | xfree (buf); |
| 8345 | UNBLOCK_INPUT; | 8345 | UNBLOCK_INPUT; |
| 8346 | 8346 | ||
| 8347 | img->width = width; | 8347 | img->width = width; |
| 8348 | img->height = height; | 8348 | img->height = height; |
| 8349 | 8349 | ||
| @@ -8421,12 +8421,12 @@ gif_image_p (object) | |||
| 8421 | { | 8421 | { |
| 8422 | struct image_keyword fmt[GIF_LAST]; | 8422 | struct image_keyword fmt[GIF_LAST]; |
| 8423 | bcopy (gif_format, fmt, sizeof fmt); | 8423 | bcopy (gif_format, fmt, sizeof fmt); |
| 8424 | 8424 | ||
| 8425 | if (!parse_image_spec (object, fmt, GIF_LAST, Qgif) | 8425 | if (!parse_image_spec (object, fmt, GIF_LAST, Qgif) |
| 8426 | || (fmt[GIF_ASCENT].count | 8426 | || (fmt[GIF_ASCENT].count |
| 8427 | && XFASTINT (fmt[GIF_ASCENT].value) > 100)) | 8427 | && XFASTINT (fmt[GIF_ASCENT].value) > 100)) |
| 8428 | return 0; | 8428 | return 0; |
| 8429 | 8429 | ||
| 8430 | /* Must specify either the :data or :file keyword. */ | 8430 | /* Must specify either the :data or :file keyword. */ |
| 8431 | return fmt[GIF_FILE].count + fmt[GIF_DATA].count == 1; | 8431 | return fmt[GIF_FILE].count + fmt[GIF_DATA].count == 1; |
| 8432 | } | 8432 | } |
| @@ -8499,7 +8499,7 @@ gif_load (f, img) | |||
| 8499 | UNGCPRO; | 8499 | UNGCPRO; |
| 8500 | return 0; | 8500 | return 0; |
| 8501 | } | 8501 | } |
| 8502 | 8502 | ||
| 8503 | /* Open the GIF file. */ | 8503 | /* Open the GIF file. */ |
| 8504 | gif = DGifOpenFileName (SDATA (file)); | 8504 | gif = DGifOpenFileName (SDATA (file)); |
| 8505 | if (gif == NULL) | 8505 | if (gif == NULL) |
| @@ -8560,14 +8560,14 @@ gif_load (f, img) | |||
| 8560 | UNGCPRO; | 8560 | UNGCPRO; |
| 8561 | return 0; | 8561 | return 0; |
| 8562 | } | 8562 | } |
| 8563 | 8563 | ||
| 8564 | /* Allocate colors. */ | 8564 | /* Allocate colors. */ |
| 8565 | gif_color_map = gif->SavedImages[ino].ImageDesc.ColorMap; | 8565 | gif_color_map = gif->SavedImages[ino].ImageDesc.ColorMap; |
| 8566 | if (!gif_color_map) | 8566 | if (!gif_color_map) |
| 8567 | gif_color_map = gif->SColorMap; | 8567 | gif_color_map = gif->SColorMap; |
| 8568 | init_color_table (); | 8568 | init_color_table (); |
| 8569 | bzero (pixel_colors, sizeof pixel_colors); | 8569 | bzero (pixel_colors, sizeof pixel_colors); |
| 8570 | 8570 | ||
| 8571 | for (i = 0; i < gif_color_map->ColorCount; ++i) | 8571 | for (i = 0; i < gif_color_map->ColorCount; ++i) |
| 8572 | { | 8572 | { |
| 8573 | int r = gif_color_map->Colors[i].Red << 8; | 8573 | int r = gif_color_map->Colors[i].Red << 8; |
| @@ -8580,7 +8580,7 @@ gif_load (f, img) | |||
| 8580 | free_color_table (); | 8580 | free_color_table (); |
| 8581 | 8581 | ||
| 8582 | /* Clear the part of the screen image that are not covered by | 8582 | /* Clear the part of the screen image that are not covered by |
| 8583 | the image from the GIF file. Full animated GIF support | 8583 | the image from the GIF file. Full animated GIF support |
| 8584 | requires more than can be done here (see the gif89 spec, | 8584 | requires more than can be done here (see the gif89 spec, |
| 8585 | disposal methods). Let's simply assume that the part | 8585 | disposal methods). Let's simply assume that the part |
| 8586 | not covered by a sub-image is in the frame's background color. */ | 8586 | not covered by a sub-image is in the frame's background color. */ |
| @@ -8627,14 +8627,14 @@ gif_load (f, img) | |||
| 8627 | while (row >= image_height) | 8627 | while (row >= image_height) |
| 8628 | row = interlace_start[++pass]; | 8628 | row = interlace_start[++pass]; |
| 8629 | } | 8629 | } |
| 8630 | 8630 | ||
| 8631 | for (x = 0; x < image_width; x++) | 8631 | for (x = 0; x < image_width; x++) |
| 8632 | { | 8632 | { |
| 8633 | int i = raster[(y * image_width) + x]; | 8633 | int i = raster[(y * image_width) + x]; |
| 8634 | XPutPixel (ximg, x + image_left, row + image_top, | 8634 | XPutPixel (ximg, x + image_left, row + image_top, |
| 8635 | pixel_colors[i]); | 8635 | pixel_colors[i]); |
| 8636 | } | 8636 | } |
| 8637 | 8637 | ||
| 8638 | row += interlace_increment[pass]; | 8638 | row += interlace_increment[pass]; |
| 8639 | } | 8639 | } |
| 8640 | } | 8640 | } |
| @@ -8647,14 +8647,14 @@ gif_load (f, img) | |||
| 8647 | XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]); | 8647 | XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]); |
| 8648 | } | 8648 | } |
| 8649 | } | 8649 | } |
| 8650 | 8650 | ||
| 8651 | DGifCloseFile (gif); | 8651 | DGifCloseFile (gif); |
| 8652 | 8652 | ||
| 8653 | /* Put the image into the pixmap, then free the X image and its buffer. */ | 8653 | /* Put the image into the pixmap, then free the X image and its buffer. */ |
| 8654 | x_put_x_image (f, ximg, img->pixmap, width, height); | 8654 | x_put_x_image (f, ximg, img->pixmap, width, height); |
| 8655 | x_destroy_x_image (ximg); | 8655 | x_destroy_x_image (ximg); |
| 8656 | UNBLOCK_INPUT; | 8656 | UNBLOCK_INPUT; |
| 8657 | 8657 | ||
| 8658 | UNGCPRO; | 8658 | UNGCPRO; |
| 8659 | return 1; | 8659 | return 1; |
| 8660 | } | 8660 | } |
| @@ -8751,11 +8751,11 @@ gs_image_p (object) | |||
| 8751 | struct image_keyword fmt[GS_LAST]; | 8751 | struct image_keyword fmt[GS_LAST]; |
| 8752 | Lisp_Object tem; | 8752 | Lisp_Object tem; |
| 8753 | int i; | 8753 | int i; |
| 8754 | 8754 | ||
| 8755 | bcopy (gs_format, fmt, sizeof fmt); | 8755 | bcopy (gs_format, fmt, sizeof fmt); |
| 8756 | 8756 | ||
| 8757 | if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript) | 8757 | if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript) |
| 8758 | || (fmt[GS_ASCENT].count | 8758 | || (fmt[GS_ASCENT].count |
| 8759 | && XFASTINT (fmt[GS_ASCENT].value) > 100)) | 8759 | && XFASTINT (fmt[GS_ASCENT].value) > 100)) |
| 8760 | return 0; | 8760 | return 0; |
| 8761 | 8761 | ||
| @@ -8823,7 +8823,7 @@ gs_load (f, img) | |||
| 8823 | image_error ("Unable to create pixmap for `%s'", img->spec, Qnil); | 8823 | image_error ("Unable to create pixmap for `%s'", img->spec, Qnil); |
| 8824 | return 0; | 8824 | return 0; |
| 8825 | } | 8825 | } |
| 8826 | 8826 | ||
| 8827 | /* Call the loader to fill the pixmap. It returns a process object | 8827 | /* Call the loader to fill the pixmap. It returns a process object |
| 8828 | if successful. We do not record_unwind_protect here because | 8828 | if successful. We do not record_unwind_protect here because |
| 8829 | other places in redisplay like calling window scroll functions | 8829 | other places in redisplay like calling window scroll functions |
| @@ -8834,12 +8834,12 @@ gs_load (f, img) | |||
| 8834 | (unsigned long) FRAME_W32_WINDOW (f), | 8834 | (unsigned long) FRAME_W32_WINDOW (f), |
| 8835 | (unsigned long) img->pixmap); | 8835 | (unsigned long) img->pixmap); |
| 8836 | window_and_pixmap_id = build_string (buffer); | 8836 | window_and_pixmap_id = build_string (buffer); |
| 8837 | 8837 | ||
| 8838 | sprintf (buffer, "%lu %lu", | 8838 | sprintf (buffer, "%lu %lu", |
| 8839 | FRAME_FOREGROUND_PIXEL (f), | 8839 | FRAME_FOREGROUND_PIXEL (f), |
| 8840 | FRAME_BACKGROUND_PIXEL (f)); | 8840 | FRAME_BACKGROUND_PIXEL (f)); |
| 8841 | pixel_colors = build_string (buffer); | 8841 | pixel_colors = build_string (buffer); |
| 8842 | 8842 | ||
| 8843 | XSETFRAME (frame, f); | 8843 | XSETFRAME (frame, f); |
| 8844 | loader = image_spec_value (img->spec, QCloader, NULL); | 8844 | loader = image_spec_value (img->spec, QCloader, NULL); |
| 8845 | if (NILP (loader)) | 8845 | if (NILP (loader)) |
| @@ -8897,10 +8897,10 @@ x_kill_gs_process (pixmap, f) | |||
| 8897 | if (ximg) | 8897 | if (ximg) |
| 8898 | { | 8898 | { |
| 8899 | int x, y; | 8899 | int x, y; |
| 8900 | 8900 | ||
| 8901 | /* Initialize the color table. */ | 8901 | /* Initialize the color table. */ |
| 8902 | init_color_table (); | 8902 | init_color_table (); |
| 8903 | 8903 | ||
| 8904 | /* For each pixel of the image, look its color up in the | 8904 | /* For each pixel of the image, look its color up in the |
| 8905 | color table. After having done so, the color table will | 8905 | color table. After having done so, the color table will |
| 8906 | contain an entry for each color used by the image. */ | 8906 | contain an entry for each color used by the image. */ |
| @@ -8933,7 +8933,7 @@ x_kill_gs_process (pixmap, f) | |||
| 8933 | else | 8933 | else |
| 8934 | image_error ("Cannot get X image of `%s'; colors will not be freed", | 8934 | image_error ("Cannot get X image of `%s'; colors will not be freed", |
| 8935 | img->spec, Qnil); | 8935 | img->spec, Qnil); |
| 8936 | 8936 | ||
| 8937 | UNBLOCK_INPUT; | 8937 | UNBLOCK_INPUT; |
| 8938 | } | 8938 | } |
| 8939 | } | 8939 | } |
| @@ -9039,8 +9039,8 @@ value. */) | |||
| 9039 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 9039 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 9040 | prop_atom, 0, bytes_remaining, | 9040 | prop_atom, 0, bytes_remaining, |
| 9041 | False, XA_STRING, | 9041 | False, XA_STRING, |
| 9042 | &actual_type, &actual_format, | 9042 | &actual_type, &actual_format, |
| 9043 | &actual_size, &bytes_remaining, | 9043 | &actual_size, &bytes_remaining, |
| 9044 | (unsigned char **) &tmp_data); | 9044 | (unsigned char **) &tmp_data); |
| 9045 | if (rc == Success) | 9045 | if (rc == Success) |
| 9046 | prop_value = make_string (tmp_data, size); | 9046 | prop_value = make_string (tmp_data, size); |
| @@ -9094,7 +9094,7 @@ start_hourglass () | |||
| 9094 | #if 0 /* MAC_TODO: cursor shape changes. */ | 9094 | #if 0 /* MAC_TODO: cursor shape changes. */ |
| 9095 | EMACS_TIME delay; | 9095 | EMACS_TIME delay; |
| 9096 | int secs, usecs = 0; | 9096 | int secs, usecs = 0; |
| 9097 | 9097 | ||
| 9098 | cancel_hourglass (); | 9098 | cancel_hourglass (); |
| 9099 | 9099 | ||
| 9100 | if (INTEGERP (Vhourglass_delay) | 9100 | if (INTEGERP (Vhourglass_delay) |
| @@ -9110,7 +9110,7 @@ start_hourglass () | |||
| 9110 | } | 9110 | } |
| 9111 | else | 9111 | else |
| 9112 | secs = DEFAULT_HOURGLASS_DELAY; | 9112 | secs = DEFAULT_HOURGLASS_DELAY; |
| 9113 | 9113 | ||
| 9114 | EMACS_SET_SECS_USECS (delay, secs, usecs); | 9114 | EMACS_SET_SECS_USECS (delay, secs, usecs); |
| 9115 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, | 9115 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, |
| 9116 | show_hourglass, NULL); | 9116 | show_hourglass, NULL); |
| @@ -9129,7 +9129,7 @@ cancel_hourglass () | |||
| 9129 | cancel_atimer (hourglass_atimer); | 9129 | cancel_atimer (hourglass_atimer); |
| 9130 | hourglass_atimer = NULL; | 9130 | hourglass_atimer = NULL; |
| 9131 | } | 9131 | } |
| 9132 | 9132 | ||
| 9133 | if (hourglass_shown_p) | 9133 | if (hourglass_shown_p) |
| 9134 | hide_hourglass (); | 9134 | hide_hourglass (); |
| 9135 | } | 9135 | } |
| @@ -9156,23 +9156,23 @@ show_hourglass (timer) | |||
| 9156 | if (!hourglass_shown_p) | 9156 | if (!hourglass_shown_p) |
| 9157 | { | 9157 | { |
| 9158 | Lisp_Object rest, frame; | 9158 | Lisp_Object rest, frame; |
| 9159 | 9159 | ||
| 9160 | BLOCK_INPUT; | 9160 | BLOCK_INPUT; |
| 9161 | 9161 | ||
| 9162 | FOR_EACH_FRAME (rest, frame) | 9162 | FOR_EACH_FRAME (rest, frame) |
| 9163 | if (FRAME_W32_P (XFRAME (frame))) | 9163 | if (FRAME_W32_P (XFRAME (frame))) |
| 9164 | { | 9164 | { |
| 9165 | struct frame *f = XFRAME (frame); | 9165 | struct frame *f = XFRAME (frame); |
| 9166 | 9166 | ||
| 9167 | f->output_data.w32->hourglass_p = 1; | 9167 | f->output_data.w32->hourglass_p = 1; |
| 9168 | 9168 | ||
| 9169 | if (!f->output_data.w32->hourglass_window) | 9169 | if (!f->output_data.w32->hourglass_window) |
| 9170 | { | 9170 | { |
| 9171 | unsigned long mask = CWCursor; | 9171 | unsigned long mask = CWCursor; |
| 9172 | XSetWindowAttributes attrs; | 9172 | XSetWindowAttributes attrs; |
| 9173 | 9173 | ||
| 9174 | attrs.cursor = f->output_data.w32->hourglass_cursor; | 9174 | attrs.cursor = f->output_data.w32->hourglass_cursor; |
| 9175 | 9175 | ||
| 9176 | f->output_data.w32->hourglass_window | 9176 | f->output_data.w32->hourglass_window |
| 9177 | = XCreateWindow (FRAME_X_DISPLAY (f), | 9177 | = XCreateWindow (FRAME_X_DISPLAY (f), |
| 9178 | FRAME_OUTER_WINDOW (f), | 9178 | FRAME_OUTER_WINDOW (f), |
| @@ -9181,7 +9181,7 @@ show_hourglass (timer) | |||
| 9181 | CopyFromParent, | 9181 | CopyFromParent, |
| 9182 | mask, &attrs); | 9182 | mask, &attrs); |
| 9183 | } | 9183 | } |
| 9184 | 9184 | ||
| 9185 | XMapRaised (FRAME_X_DISPLAY (f), | 9185 | XMapRaised (FRAME_X_DISPLAY (f), |
| 9186 | f->output_data.w32->hourglass_window); | 9186 | f->output_data.w32->hourglass_window); |
| 9187 | XFlush (FRAME_X_DISPLAY (f)); | 9187 | XFlush (FRAME_X_DISPLAY (f)); |
| @@ -9208,7 +9208,7 @@ hide_hourglass () | |||
| 9208 | FOR_EACH_FRAME (rest, frame) | 9208 | FOR_EACH_FRAME (rest, frame) |
| 9209 | { | 9209 | { |
| 9210 | struct frame *f = XFRAME (frame); | 9210 | struct frame *f = XFRAME (frame); |
| 9211 | 9211 | ||
| 9212 | if (FRAME_W32_P (f) | 9212 | if (FRAME_W32_P (f) |
| 9213 | /* Watch out for newly created frames. */ | 9213 | /* Watch out for newly created frames. */ |
| 9214 | && f->output_data.x->hourglass_window) | 9214 | && f->output_data.x->hourglass_window) |
| @@ -9236,7 +9236,7 @@ hide_hourglass () | |||
| 9236 | 9236 | ||
| 9237 | static Lisp_Object x_create_tip_frame P_ ((struct mac_display_info *, | 9237 | static Lisp_Object x_create_tip_frame P_ ((struct mac_display_info *, |
| 9238 | Lisp_Object)); | 9238 | Lisp_Object)); |
| 9239 | 9239 | ||
| 9240 | /* The frame of a currently visible tooltip, or null. */ | 9240 | /* The frame of a currently visible tooltip, or null. */ |
| 9241 | 9241 | ||
| 9242 | Lisp_Object tip_frame; | 9242 | Lisp_Object tip_frame; |
| @@ -9344,7 +9344,7 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9344 | else | 9344 | else |
| 9345 | font = x_new_font (f, SDATA (font)); | 9345 | font = x_new_font (f, SDATA (font)); |
| 9346 | } | 9346 | } |
| 9347 | 9347 | ||
| 9348 | /* Try out a font which we hope has bold and italic variations. */ | 9348 | /* Try out a font which we hope has bold and italic variations. */ |
| 9349 | if (!STRINGP (font)) | 9349 | if (!STRINGP (font)) |
| 9350 | font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); | 9350 | font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); |
| @@ -9369,7 +9369,7 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9369 | 9369 | ||
| 9370 | x_default_parameter (f, parms, Qborder_width, make_number (2), | 9370 | x_default_parameter (f, parms, Qborder_width, make_number (2), |
| 9371 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); | 9371 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); |
| 9372 | 9372 | ||
| 9373 | /* This defaults to 2 in order to match xterm. We recognize either | 9373 | /* This defaults to 2 in order to match xterm. We recognize either |
| 9374 | internalBorderWidth or internalBorder (which is what xterm calls | 9374 | internalBorderWidth or internalBorder (which is what xterm calls |
| 9375 | it). */ | 9375 | it). */ |
| @@ -9407,7 +9407,7 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9407 | end up in init_iterator with a null face cache, which should not | 9407 | end up in init_iterator with a null face cache, which should not |
| 9408 | happen. */ | 9408 | happen. */ |
| 9409 | init_frame_faces (f); | 9409 | init_frame_faces (f); |
| 9410 | 9410 | ||
| 9411 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; | 9411 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; |
| 9412 | window_prompting = x_figure_window_size (f, parms); | 9412 | window_prompting = x_figure_window_size (f, parms); |
| 9413 | 9413 | ||
| @@ -9430,7 +9430,7 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9430 | { | 9430 | { |
| 9431 | XSetWindowAttributes attrs; | 9431 | XSetWindowAttributes attrs; |
| 9432 | unsigned long mask; | 9432 | unsigned long mask; |
| 9433 | 9433 | ||
| 9434 | BLOCK_INPUT; | 9434 | BLOCK_INPUT; |
| 9435 | mask = CWBackPixel | CWOverrideRedirect | CWSaveUnder | CWEventMask; | 9435 | mask = CWBackPixel | CWOverrideRedirect | CWSaveUnder | CWEventMask; |
| 9436 | /* Window managers looks at the override-redirect flag to | 9436 | /* Window managers looks at the override-redirect flag to |
| @@ -9525,7 +9525,7 @@ DY added (default is 10). */) | |||
| 9525 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 9525 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 9526 | int old_windows_or_buffers_changed = windows_or_buffers_changed; | 9526 | int old_windows_or_buffers_changed = windows_or_buffers_changed; |
| 9527 | int count = SPECPDL_INDEX (); | 9527 | int count = SPECPDL_INDEX (); |
| 9528 | 9528 | ||
| 9529 | specbind (Qinhibit_redisplay, Qt); | 9529 | specbind (Qinhibit_redisplay, Qt); |
| 9530 | 9530 | ||
| 9531 | GCPRO4 (string, parms, frame, timeout); | 9531 | GCPRO4 (string, parms, frame, timeout); |
| @@ -9541,7 +9541,7 @@ DY added (default is 10). */) | |||
| 9541 | dx = make_number (5); | 9541 | dx = make_number (5); |
| 9542 | else | 9542 | else |
| 9543 | CHECK_NUMBER (dx); | 9543 | CHECK_NUMBER (dx); |
| 9544 | 9544 | ||
| 9545 | if (NILP (dy)) | 9545 | if (NILP (dy)) |
| 9546 | dy = make_number (-10); | 9546 | dy = make_number (-10); |
| 9547 | else | 9547 | else |
| @@ -9561,7 +9561,7 @@ DY added (default is 10). */) | |||
| 9561 | && !NILP (Fequal (last_parms, parms))) | 9561 | && !NILP (Fequal (last_parms, parms))) |
| 9562 | { | 9562 | { |
| 9563 | struct frame *f = XFRAME (tip_frame); | 9563 | struct frame *f = XFRAME (tip_frame); |
| 9564 | 9564 | ||
| 9565 | /* Only DX and DY have changed. */ | 9565 | /* Only DX and DY have changed. */ |
| 9566 | if (!NILP (tip_timer)) | 9566 | if (!NILP (tip_timer)) |
| 9567 | { | 9567 | { |
| @@ -9652,7 +9652,7 @@ DY added (default is 10). */) | |||
| 9652 | } | 9652 | } |
| 9653 | else | 9653 | else |
| 9654 | row_width = row->pixel_width; | 9654 | row_width = row->pixel_width; |
| 9655 | 9655 | ||
| 9656 | height += row->height; | 9656 | height += row->height; |
| 9657 | width = max (width, row_width); | 9657 | width = max (width, row_width); |
| 9658 | } | 9658 | } |
| @@ -9706,16 +9706,16 @@ Value is t is tooltip was open, nil otherwise. */) | |||
| 9706 | /* Return quickly if nothing to do. */ | 9706 | /* Return quickly if nothing to do. */ |
| 9707 | if (NILP (tip_timer) && NILP (tip_frame)) | 9707 | if (NILP (tip_timer) && NILP (tip_frame)) |
| 9708 | return Qnil; | 9708 | return Qnil; |
| 9709 | 9709 | ||
| 9710 | frame = tip_frame; | 9710 | frame = tip_frame; |
| 9711 | timer = tip_timer; | 9711 | timer = tip_timer; |
| 9712 | GCPRO2 (frame, timer); | 9712 | GCPRO2 (frame, timer); |
| 9713 | tip_frame = tip_timer = deleted = Qnil; | 9713 | tip_frame = tip_timer = deleted = Qnil; |
| 9714 | 9714 | ||
| 9715 | count = SPECPDL_INDEX (); | 9715 | count = SPECPDL_INDEX (); |
| 9716 | specbind (Qinhibit_redisplay, Qt); | 9716 | specbind (Qinhibit_redisplay, Qt); |
| 9717 | specbind (Qinhibit_quit, Qt); | 9717 | specbind (Qinhibit_quit, Qt); |
| 9718 | 9718 | ||
| 9719 | if (!NILP (timer)) | 9719 | if (!NILP (timer)) |
| 9720 | call1 (Qcancel_timer, timer); | 9720 | call1 (Qcancel_timer, timer); |
| 9721 | 9721 | ||
| @@ -9864,7 +9864,7 @@ DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") | |||
| 9864 | Lisp_Object spec; | 9864 | Lisp_Object spec; |
| 9865 | { | 9865 | { |
| 9866 | int id = -1; | 9866 | int id = -1; |
| 9867 | 9867 | ||
| 9868 | if (valid_image_p (spec)) | 9868 | if (valid_image_p (spec)) |
| 9869 | id = lookup_image (SELECTED_FRAME (), spec); | 9869 | id = lookup_image (SELECTED_FRAME (), spec); |
| 9870 | 9870 | ||
| @@ -10012,7 +10012,7 @@ or when you set the mouse color. */); | |||
| 10012 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, | 10012 | DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, |
| 10013 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); | 10013 | doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); |
| 10014 | display_hourglass_p = 1; | 10014 | display_hourglass_p = 1; |
| 10015 | 10015 | ||
| 10016 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, | 10016 | DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, |
| 10017 | doc: /* *Seconds to wait before displaying an hourglass pointer. | 10017 | doc: /* *Seconds to wait before displaying an hourglass pointer. |
| 10018 | Value must be an integer or float. */); | 10018 | Value must be an integer or float. */); |
| @@ -10139,16 +10139,16 @@ meaning don't clear the cache. */); | |||
| 10139 | Qxpm = intern ("xpm"); | 10139 | Qxpm = intern ("xpm"); |
| 10140 | staticpro (&Qxpm); | 10140 | staticpro (&Qxpm); |
| 10141 | #endif | 10141 | #endif |
| 10142 | 10142 | ||
| 10143 | #if HAVE_JPEG | 10143 | #if HAVE_JPEG |
| 10144 | Qjpeg = intern ("jpeg"); | 10144 | Qjpeg = intern ("jpeg"); |
| 10145 | staticpro (&Qjpeg); | 10145 | staticpro (&Qjpeg); |
| 10146 | #endif | 10146 | #endif |
| 10147 | 10147 | ||
| 10148 | #if HAVE_TIFF | 10148 | #if HAVE_TIFF |
| 10149 | Qtiff = intern ("tiff"); | 10149 | Qtiff = intern ("tiff"); |
| 10150 | staticpro (&Qtiff); | 10150 | staticpro (&Qtiff); |
| 10151 | #endif | 10151 | #endif |
| 10152 | 10152 | ||
| 10153 | #if HAVE_GIF | 10153 | #if HAVE_GIF |
| 10154 | Qgif = intern ("gif"); | 10154 | Qgif = intern ("gif"); |
| @@ -10192,23 +10192,23 @@ init_xfns () | |||
| 10192 | #if 0 /* NTEMACS_TODO : Image support for W32 */ | 10192 | #if 0 /* NTEMACS_TODO : Image support for W32 */ |
| 10193 | define_image_type (&gs_type); | 10193 | define_image_type (&gs_type); |
| 10194 | define_image_type (&pbm_type); | 10194 | define_image_type (&pbm_type); |
| 10195 | 10195 | ||
| 10196 | #if HAVE_XPM | 10196 | #if HAVE_XPM |
| 10197 | define_image_type (&xpm_type); | 10197 | define_image_type (&xpm_type); |
| 10198 | #endif | 10198 | #endif |
| 10199 | 10199 | ||
| 10200 | #if HAVE_JPEG | 10200 | #if HAVE_JPEG |
| 10201 | define_image_type (&jpeg_type); | 10201 | define_image_type (&jpeg_type); |
| 10202 | #endif | 10202 | #endif |
| 10203 | 10203 | ||
| 10204 | #if HAVE_TIFF | 10204 | #if HAVE_TIFF |
| 10205 | define_image_type (&tiff_type); | 10205 | define_image_type (&tiff_type); |
| 10206 | #endif | 10206 | #endif |
| 10207 | 10207 | ||
| 10208 | #if HAVE_GIF | 10208 | #if HAVE_GIF |
| 10209 | define_image_type (&gif_type); | 10209 | define_image_type (&gif_type); |
| 10210 | #endif | 10210 | #endif |
| 10211 | 10211 | ||
| 10212 | #if HAVE_PNG | 10212 | #if HAVE_PNG |
| 10213 | define_image_type (&png_type); | 10213 | define_image_type (&png_type); |
| 10214 | #endif | 10214 | #endif |