aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-05-06 06:52:24 +0000
committerYAMAMOTO Mitsuharu2006-05-06 06:52:24 +0000
commitfb8b2fc34870049d3d948a8f64ca369b82be5085 (patch)
tree82478dbd576cb73ca6899c897625c4afa7f80fc7 /src/image.c
parent2f291aac74e82c31e3e3e143b0608ebeec177d10 (diff)
downloademacs-fb8b2fc34870049d3d948a8f64ca369b82be5085.tar.gz
emacs-fb8b2fc34870049d3d948a8f64ca369b82be5085.zip
(Qduration) [MAC_OS]: New variable.
(syms_of_image) [MAC_OS]: Intern and staticpro it. [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val. [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring instead of cfstring_create_with_string.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c
index 688ff200055..37c3bd48209 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2628,7 +2628,7 @@ image_load_quartz2d (f, img, png_p)
2628 UNGCPRO; 2628 UNGCPRO;
2629 return 0; 2629 return 0;
2630 } 2630 }
2631 path = cfstring_create_with_string (file); 2631 path = cfstring_create_with_utf8_cstring (SDATA (file));
2632 url = CFURLCreateWithFileSystemPath (NULL, path, 2632 url = CFURLCreateWithFileSystemPath (NULL, path,
2633 kCFURLPOSIXPathStyle, 0); 2633 kCFURLPOSIXPathStyle, 0);
2634 CFRelease (path); 2634 CFRelease (path);
@@ -7899,6 +7899,8 @@ gif_load (f, img)
7899#else /* !HAVE_GIF */ 7899#else /* !HAVE_GIF */
7900 7900
7901#ifdef MAC_OS 7901#ifdef MAC_OS
7902static Lisp_Object Qduration;
7903
7902static int 7904static int
7903gif_load (f, img) 7905gif_load (f, img)
7904 struct frame *f; 7906 struct frame *f;
@@ -7920,7 +7922,8 @@ gif_load (f, img)
7920 RGBColor bg_color; 7922 RGBColor bg_color;
7921 int width, height; 7923 int width, height;
7922 XImagePtr ximg; 7924 XImagePtr ximg;
7923 TimeValue time; 7925 TimeScale time_scale;
7926 TimeValue time, duration;
7924 int ino; 7927 int ino;
7925 CGrafPtr old_port; 7928 CGrafPtr old_port;
7926 GDHandle old_gdh; 7929 GDHandle old_gdh;
@@ -8028,6 +8031,7 @@ gif_load (f, img)
8028 image, img->spec); 8031 image, img->spec);
8029 goto error; 8032 goto error;
8030 } 8033 }
8034 time_scale = GetMediaTimeScale (media);
8031 8035
8032 specified_bg = image_spec_value (img->spec, QCbackground, NULL); 8036 specified_bg = image_spec_value (img->spec, QCbackground, NULL);
8033 if (!STRINGP (specified_bg) || 8037 if (!STRINGP (specified_bg) ||
@@ -8053,7 +8057,7 @@ gif_load (f, img)
8053 SetGWorld (old_port, old_gdh); 8057 SetGWorld (old_port, old_gdh);
8054 SetMovieActive (movie, 1); 8058 SetMovieActive (movie, 1);
8055 SetMovieGWorld (movie, ximg, NULL); 8059 SetMovieGWorld (movie, ximg, NULL);
8056 SampleNumToMediaTime (media, ino + 1, &time, NULL); 8060 SampleNumToMediaTime (media, ino + 1, &time, &duration);
8057 SetMovieTimeValue (movie, time); 8061 SetMovieTimeValue (movie, time);
8058 MoviesTask (movie, 0L); 8062 MoviesTask (movie, 0L);
8059 DisposeTrackMedia (media); 8063 DisposeTrackMedia (media);
@@ -8061,6 +8065,12 @@ gif_load (f, img)
8061 DisposeMovie (movie); 8065 DisposeMovie (movie);
8062 if (dh) 8066 if (dh)
8063 DisposeHandle (dh); 8067 DisposeHandle (dh);
8068
8069 /* Save GIF image extension data for `image-extension-data'.
8070 Format is (count IMAGES duration DURATION). */
8071 img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration,
8072 make_float ((double)duration / time_scale));
8073
8064 /* Maybe fill in the background field while we have ximg handy. */ 8074 /* Maybe fill in the background field while we have ximg handy. */
8065 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) 8075 if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
8066 IMAGE_BACKGROUND (img, f, ximg); 8076 IMAGE_BACKGROUND (img, f, ximg);
@@ -8616,6 +8626,11 @@ non-numeric, there is no explicit limit on the size of images. */);
8616 ADD_IMAGE_TYPE(Qgif); 8626 ADD_IMAGE_TYPE(Qgif);
8617#endif 8627#endif
8618 8628
8629#ifdef MAC_OS
8630 Qduration = intern ("duration");
8631 staticpro (&Qduration);
8632#endif
8633
8619#if defined (HAVE_PNG) || defined (MAC_OS) 8634#if defined (HAVE_PNG) || defined (MAC_OS)
8620 Qpng = intern ("png"); 8635 Qpng = intern ("png");
8621 staticpro (&Qpng); 8636 staticpro (&Qpng);