aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2007-05-24 02:14:22 +0000
committerMiles Bader2007-05-24 02:14:22 +0000
commit24236bd83e64a3cfa96f01af3b2a925dd234612d (patch)
tree77873f1d6ae4b869cc4264a9e113977cad7ac592 /src
parentf9263a779af1a6436e05c87756747eb13883593b (diff)
parent698c8370d994f75b78ca711a3144f18b0a26ca89 (diff)
downloademacs-24236bd83e64a3cfa96f01af3b2a925dd234612d.tar.gz
emacs-24236bd83e64a3cfa96f01af3b2a925dd234612d.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 762-764) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 22-23) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-15
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/image.c52
2 files changed, 57 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 67f6bd282c2..5cadef9490b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12007-05-21 Chong Yidong <cyd@stupidchicken.com>
2
3 * image.c (uncache_image): New function.
4 (Fimage_refresh): New function.
5
12007-05-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 62007-05-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 7
3 * Makefile.in: Move GPM check outside HAVE_X_WINDOWS. 8 * Makefile.in: Move GPM check outside HAVE_X_WINDOWS.
diff --git a/src/image.c b/src/image.c
index 5243778526e..dbe200195d0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1631,6 +1631,27 @@ make_image_cache ()
1631} 1631}
1632 1632
1633 1633
1634/* Search frame F for an images with spec SPEC, and free it. */
1635
1636static void
1637uncache_image (f, spec)
1638 struct frame *f;
1639 Lisp_Object spec;
1640{
1641 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
1642 struct image *img = IMAGE_FROM_ID (f, lookup_image (f, spec));
1643 unsigned hash = sxhash (spec, 0);
1644 int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
1645
1646 for (img = c->buckets[i]; img; img = img->next)
1647 if (img->hash == hash && !NILP (Fequal (img->spec, spec)))
1648 {
1649 free_image (f, img);
1650 break;
1651 }
1652}
1653
1654
1634/* Free image cache of frame F. Be aware that X frames share images 1655/* Free image cache of frame F. Be aware that X frames share images
1635 caches. */ 1656 caches. */
1636 1657
@@ -1741,6 +1762,36 @@ FRAME t means clear the image caches of all frames. */)
1741} 1762}
1742 1763
1743 1764
1765DEFUN ("image-refresh", Fimage_refresh, Simage_refresh,
1766 1, 2, 0,
1767 doc: /* Refresh the image with specification SPEC on frame FRAME.
1768If SPEC specifies an image file, the displayed image is updated with
1769the current contents of that file.
1770FRAME nil or omitted means use the selected frame.
1771FRAME t means refresh the image on all frames. */)
1772 (spec, frame)
1773 Lisp_Object spec, frame;
1774{
1775 if (!valid_image_p (spec))
1776 error ("Invalid image specification");
1777
1778 if (EQ (frame, Qt))
1779 {
1780 Lisp_Object tail;
1781 FOR_EACH_FRAME (tail, frame)
1782 {
1783 struct frame *f = XFRAME (frame);
1784 if (FRAME_WINDOW_P (f))
1785 uncache_image (f, spec);
1786 }
1787 }
1788 else
1789 uncache_image (check_x_frame (frame), spec);
1790
1791 return Qnil;
1792}
1793
1794
1744/* Compute masks and transform image IMG on frame F, as specified 1795/* Compute masks and transform image IMG on frame F, as specified
1745 by the image's specification, */ 1796 by the image's specification, */
1746 1797
@@ -8662,6 +8713,7 @@ non-numeric, there is no explicit limit on the size of images. */);
8662 8713
8663 defsubr (&Sinit_image_library); 8714 defsubr (&Sinit_image_library);
8664 defsubr (&Sclear_image_cache); 8715 defsubr (&Sclear_image_cache);
8716 defsubr (&Simage_refresh);
8665 defsubr (&Simage_size); 8717 defsubr (&Simage_size);
8666 defsubr (&Simage_mask_p); 8718 defsubr (&Simage_mask_p);
8667 defsubr (&Simage_extension_data); 8719 defsubr (&Simage_extension_data);