aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2000-10-16 14:45:44 +0000
committerMiles Bader2000-10-16 14:45:44 +0000
commit836765981d15ac6d86eff8645cc76eb021c7f278 (patch)
treed55c6a52bcd1215ca99858f81817b57c49ba6c18 /src
parentb41fe2c315335c74d73d73116260fdd613132460 (diff)
downloademacs-836765981d15ac6d86eff8645cc76eb021c7f278.tar.gz
emacs-836765981d15ac6d86eff8645cc76eb021c7f278.zip
Revert last change.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c70
1 files changed, 9 insertions, 61 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 9e7f9268841..4c53ccb85ae 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -239,7 +239,6 @@ extern Lisp_Object Qdisplay;
239Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background; 239Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
240Lisp_Object Qscreen_gamma, Qline_spacing, Qcenter; 240Lisp_Object Qscreen_gamma, Qline_spacing, Qcenter;
241Lisp_Object Qcompound_text; 241Lisp_Object Qcompound_text;
242extern Lisp_Object Qbackground_tile;
243 242
244/* The below are defined in frame.c. */ 243/* The below are defined in frame.c. */
245 244
@@ -751,7 +750,6 @@ static void x_create_im P_ ((struct frame *));
751void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 750void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
752static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object)); 751static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
753void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 752void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
754void x_set_background_tile P_ ((struct frame *, Lisp_Object, Lisp_Object));
755void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 753void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
756void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 754void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
757void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 755void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -798,7 +796,6 @@ static struct x_frame_parm_table x_frame_parms[] =
798 "auto-raise", x_set_autoraise, 796 "auto-raise", x_set_autoraise,
799 "auto-lower", x_set_autolower, 797 "auto-lower", x_set_autolower,
800 "background-color", x_set_background_color, 798 "background-color", x_set_background_color,
801 "background-tile", x_set_background_tile,
802 "border-color", x_set_border_color, 799 "border-color", x_set_border_color,
803 "border-width", x_set_border_width, 800 "border-width", x_set_border_width,
804 "cursor-color", x_set_cursor_color, 801 "cursor-color", x_set_cursor_color,
@@ -1428,42 +1425,6 @@ x_set_background_color (f, arg, oldval)
1428} 1425}
1429 1426
1430void 1427void
1431x_set_background_tile (f, arg, oldval)
1432 struct frame *f;
1433 Lisp_Object arg, oldval;
1434{
1435 int tile_id = lookup_image (f, arg, 0);
1436 struct image *tile_image = IMAGE_FROM_ID (f, tile_id);
1437 Pixmap tile_pixmap = tile_image ? tile_image->pixmap : 0;
1438
1439 f->output_data.x->background_tile = tile_pixmap;
1440
1441 if (FRAME_X_WINDOW (f) != 0 && tile_pixmap)
1442 {
1443 BLOCK_INPUT;
1444 /* The main frame area. */
1445 XSetTile (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
1446 f->output_data.x->background_tile);
1447 XSetWindowBackgroundPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1448 f->output_data.x->background_tile);
1449 {
1450 Lisp_Object bar;
1451 for (bar = FRAME_SCROLL_BARS (f); !NILP (bar);
1452 bar = XSCROLL_BAR (bar)->next)
1453 XSetWindowBackgroundPixmap (FRAME_X_DISPLAY (f),
1454 SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)),
1455 f->output_data.x->background_tile);
1456 }
1457 UNBLOCK_INPUT;
1458
1459 update_face_from_frame_parameter (f, Qbackground_tile, arg);
1460
1461 if (FRAME_VISIBLE_P (f))
1462 redraw_frame (f);
1463 }
1464}
1465
1466void
1467x_set_mouse_color (f, arg, oldval) 1428x_set_mouse_color (f, arg, oldval)
1468 struct frame *f; 1429 struct frame *f;
1469 Lisp_Object arg, oldval; 1430 Lisp_Object arg, oldval;
@@ -5424,7 +5385,7 @@ or omitted means use the selected frame.")
5424 if (valid_image_p (spec)) 5385 if (valid_image_p (spec))
5425 { 5386 {
5426 struct frame *f = check_x_frame (frame); 5387 struct frame *f = check_x_frame (frame);
5427 int id = lookup_image (f, spec, 0); 5388 int id = lookup_image (f, spec);
5428 struct image *img = IMAGE_FROM_ID (f, id); 5389 struct image *img = IMAGE_FROM_ID (f, id);
5429 int width = img->width + 2 * img->margin; 5390 int width = img->width + 2 * img->margin;
5430 int height = img->height + 2 * img->margin; 5391 int height = img->height + 2 * img->margin;
@@ -5455,7 +5416,7 @@ or omitted means use the selected frame.")
5455 if (valid_image_p (spec)) 5416 if (valid_image_p (spec))
5456 { 5417 {
5457 struct frame *f = check_x_frame (frame); 5418 struct frame *f = check_x_frame (frame);
5458 int id = lookup_image (f, spec, 0); 5419 int id = lookup_image (f, spec);
5459 struct image *img = IMAGE_FROM_ID (f, id); 5420 struct image *img = IMAGE_FROM_ID (f, id);
5460 if (img->mask) 5421 if (img->mask)
5461 mask = Qt; 5422 mask = Qt;
@@ -5738,7 +5699,7 @@ clear_image_cache (f, force_p)
5738{ 5699{
5739 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); 5700 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
5740 5701
5741 if (c && (c->refcount <= 1) && INTEGERP (Vimage_cache_eviction_delay)) 5702 if (c && INTEGERP (Vimage_cache_eviction_delay))
5742 { 5703 {
5743 EMACS_TIME t; 5704 EMACS_TIME t;
5744 unsigned long old; 5705 unsigned long old;
@@ -5775,10 +5736,7 @@ clear_image_cache (f, force_p)
5775 struct frame *f = XFRAME (frame); 5736 struct frame *f = XFRAME (frame);
5776 if (FRAME_X_P (f) 5737 if (FRAME_X_P (f)
5777 && FRAME_X_IMAGE_CACHE (f) == c) 5738 && FRAME_X_IMAGE_CACHE (f) == c)
5778 { 5739 clear_current_matrices (f);
5779 clear_current_matrices (f);
5780 free_all_realized_faces (frame);
5781 }
5782 } 5740 }
5783 5741
5784 ++windows_or_buffers_changed; 5742 ++windows_or_buffers_changed;
@@ -5813,15 +5771,12 @@ FRAME t means clear the image caches of all frames.")
5813 5771
5814 5772
5815/* Return the id of image with Lisp specification SPEC on frame F. 5773/* Return the id of image with Lisp specification SPEC on frame F.
5816 SPEC must be a valid Lisp image specification (see valid_image_p). 5774 SPEC must be a valid Lisp image specification (see valid_image_p). */
5817 If DELAY_LOAD is true, then the image isn't actually loaded yet (it
5818 will be loaded when prepare_image_for_display is called). */
5819 5775
5820int 5776int
5821lookup_image (f, spec, delay_load) 5777lookup_image (f, spec)
5822 struct frame *f; 5778 struct frame *f;
5823 Lisp_Object spec; 5779 Lisp_Object spec;
5824 int delay_load;
5825{ 5780{
5826 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); 5781 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
5827 struct image *img; 5782 struct image *img;
@@ -5851,14 +5806,12 @@ lookup_image (f, spec, delay_load)
5851 BLOCK_INPUT; 5806 BLOCK_INPUT;
5852 img = make_image (spec, hash); 5807 img = make_image (spec, hash);
5853 cache_image (f, img); 5808 cache_image (f, img);
5854 if (! delay_load) 5809 img->load_failed_p = img->type->load (f, img) == 0;
5855 img->load_failed_p = img->type->load (f, img) == 0;
5856 xassert (!interrupt_input_blocked);
5857 5810
5858 /* If we can't load the image, and we don't have a width and 5811 /* If we can't load the image, and we don't have a width and
5859 height, use some arbitrary width and height so that we can 5812 height, use some arbitrary width and height so that we can
5860 draw a rectangle for it. */ 5813 draw a rectangle for it. */
5861 if (img->pixmap == 0) 5814 if (img->load_failed_p)
5862 { 5815 {
5863 Lisp_Object value; 5816 Lisp_Object value;
5864 5817
@@ -7049,13 +7002,8 @@ xpm_lookup_color (f, color_name, color)
7049 char *color_name; 7002 char *color_name;
7050 XColor *color; 7003 XColor *color;
7051{ 7004{
7052 char *s;
7053 struct xpm_cached_color *p; 7005 struct xpm_cached_color *p;
7054 unsigned h = xpm_color_bucket (color_name); 7006 int h = xpm_color_bucket (color_name);
7055
7056 for (s = color_name; *s; ++s)
7057 h = (h << 2) ^ *s;
7058 h %= XPM_COLOR_CACHE_BUCKETS;
7059 7007
7060 for (p = xpm_color_cache[h]; p; p = p->next) 7008 for (p = xpm_color_cache[h]; p; p = p->next)
7061 if (strcmp (p->name, color_name) == 0) 7009 if (strcmp (p->name, color_name) == 0)