Mercurial > emacs
comparison src/image.c @ 83516:1321f6cfb389
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-266
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-267
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-268
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-269
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-270
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-271
Rename "field-at-point" to "field-at-pos"
* emacs@sv.gnu.org/emacs--devo--0--patch-272
(comint-insert-input): Remove redundant calls to setq and goto-char
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-556
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 10 May 2006 15:04:01 +0000 |
parents | 966a40e7fb54 7c25b386a4c3 |
children | b6689e223e2f |
comparison
equal
deleted
inserted
replaced
83515:f7a396df2380 | 83516:1321f6cfb389 |
---|---|
2628 { | 2628 { |
2629 image_error ("Cannot find image file `%s'", specified_file, Qnil); | 2629 image_error ("Cannot find image file `%s'", specified_file, Qnil); |
2630 UNGCPRO; | 2630 UNGCPRO; |
2631 return 0; | 2631 return 0; |
2632 } | 2632 } |
2633 path = cfstring_create_with_string (file); | 2633 path = cfstring_create_with_utf8_cstring (SDATA (file)); |
2634 url = CFURLCreateWithFileSystemPath (NULL, path, | 2634 url = CFURLCreateWithFileSystemPath (NULL, path, |
2635 kCFURLPOSIXPathStyle, 0); | 2635 kCFURLPOSIXPathStyle, 0); |
2636 CFRelease (path); | 2636 CFRelease (path); |
2637 source = CGDataProviderCreateWithURL (url); | 2637 source = CGDataProviderCreateWithURL (url); |
2638 CFRelease (url); | 2638 CFRelease (url); |
7899 } | 7899 } |
7900 | 7900 |
7901 #else /* !HAVE_GIF */ | 7901 #else /* !HAVE_GIF */ |
7902 | 7902 |
7903 #ifdef MAC_OS | 7903 #ifdef MAC_OS |
7904 static Lisp_Object Qduration; | |
7905 | |
7904 static int | 7906 static int |
7905 gif_load (f, img) | 7907 gif_load (f, img) |
7906 struct frame *f; | 7908 struct frame *f; |
7907 struct image *img; | 7909 struct image *img; |
7908 { | 7910 { |
7920 Lisp_Object specified_bg; | 7922 Lisp_Object specified_bg; |
7921 XColor color; | 7923 XColor color; |
7922 RGBColor bg_color; | 7924 RGBColor bg_color; |
7923 int width, height; | 7925 int width, height; |
7924 XImagePtr ximg; | 7926 XImagePtr ximg; |
7925 TimeValue time; | 7927 TimeScale time_scale; |
7928 TimeValue time, duration; | |
7926 int ino; | 7929 int ino; |
7927 CGrafPtr old_port; | 7930 CGrafPtr old_port; |
7928 GDHandle old_gdh; | 7931 GDHandle old_gdh; |
7929 | 7932 |
7930 specified_file = image_spec_value (img->spec, QCfile, NULL); | 7933 specified_file = image_spec_value (img->spec, QCfile, NULL); |
8028 { | 8031 { |
8029 image_error ("Invalid image number `%s' in image `%s'", | 8032 image_error ("Invalid image number `%s' in image `%s'", |
8030 image, img->spec); | 8033 image, img->spec); |
8031 goto error; | 8034 goto error; |
8032 } | 8035 } |
8036 time_scale = GetMediaTimeScale (media); | |
8033 | 8037 |
8034 specified_bg = image_spec_value (img->spec, QCbackground, NULL); | 8038 specified_bg = image_spec_value (img->spec, QCbackground, NULL); |
8035 if (!STRINGP (specified_bg) || | 8039 if (!STRINGP (specified_bg) || |
8036 !mac_defined_color (f, SDATA (specified_bg), &color, 0)) | 8040 !mac_defined_color (f, SDATA (specified_bg), &color, 0)) |
8037 { | 8041 { |
8053 bg_color.blue = color.blue; | 8057 bg_color.blue = color.blue; |
8054 RGBBackColor (&bg_color); | 8058 RGBBackColor (&bg_color); |
8055 SetGWorld (old_port, old_gdh); | 8059 SetGWorld (old_port, old_gdh); |
8056 SetMovieActive (movie, 1); | 8060 SetMovieActive (movie, 1); |
8057 SetMovieGWorld (movie, ximg, NULL); | 8061 SetMovieGWorld (movie, ximg, NULL); |
8058 SampleNumToMediaTime (media, ino + 1, &time, NULL); | 8062 SampleNumToMediaTime (media, ino + 1, &time, &duration); |
8059 SetMovieTimeValue (movie, time); | 8063 SetMovieTimeValue (movie, time); |
8060 MoviesTask (movie, 0L); | 8064 MoviesTask (movie, 0L); |
8061 DisposeTrackMedia (media); | 8065 DisposeTrackMedia (media); |
8062 DisposeMovieTrack (track); | 8066 DisposeMovieTrack (track); |
8063 DisposeMovie (movie); | 8067 DisposeMovie (movie); |
8064 if (dh) | 8068 if (dh) |
8065 DisposeHandle (dh); | 8069 DisposeHandle (dh); |
8070 | |
8071 /* Save GIF image extension data for `image-extension-data'. | |
8072 Format is (count IMAGES duration DURATION). */ | |
8073 img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration, | |
8074 make_float ((double)duration / time_scale)); | |
8075 | |
8066 /* Maybe fill in the background field while we have ximg handy. */ | 8076 /* Maybe fill in the background field while we have ximg handy. */ |
8067 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) | 8077 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) |
8068 IMAGE_BACKGROUND (img, f, ximg); | 8078 IMAGE_BACKGROUND (img, f, ximg); |
8069 | 8079 |
8070 /* Put the image into the pixmap. */ | 8080 /* Put the image into the pixmap. */ |
8616 Qgif = intern ("gif"); | 8626 Qgif = intern ("gif"); |
8617 staticpro (&Qgif); | 8627 staticpro (&Qgif); |
8618 ADD_IMAGE_TYPE(Qgif); | 8628 ADD_IMAGE_TYPE(Qgif); |
8619 #endif | 8629 #endif |
8620 | 8630 |
8631 #ifdef MAC_OS | |
8632 Qduration = intern ("duration"); | |
8633 staticpro (&Qduration); | |
8634 #endif | |
8635 | |
8621 #if defined (HAVE_PNG) || defined (MAC_OS) | 8636 #if defined (HAVE_PNG) || defined (MAC_OS) |
8622 Qpng = intern ("png"); | 8637 Qpng = intern ("png"); |
8623 staticpro (&Qpng); | 8638 staticpro (&Qpng); |
8624 ADD_IMAGE_TYPE(Qpng); | 8639 ADD_IMAGE_TYPE(Qpng); |
8625 #endif | 8640 #endif |