Mercurial > emacs
comparison src/image.c @ 70560:de135c2adb2f
(Qduration) [MAC_OS]: Undo previous change.
(syms_of_image) [MAC_OS]: Likewise.
[MAC_OS] (gif_load): Emulate Graphic Control Extension block.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 10 May 2006 08:23:20 +0000 |
parents | 7c25b386a4c3 |
children | 998a6aaa87bf b6689e223e2f 146cd8369025 |
comparison
equal
deleted
inserted
replaced
70559:a1af34eacdb3 | 70560:de135c2adb2f |
---|---|
7897 } | 7897 } |
7898 | 7898 |
7899 #else /* !HAVE_GIF */ | 7899 #else /* !HAVE_GIF */ |
7900 | 7900 |
7901 #ifdef MAC_OS | 7901 #ifdef MAC_OS |
7902 static Lisp_Object Qduration; | |
7903 | |
7904 static int | 7902 static int |
7905 gif_load (f, img) | 7903 gif_load (f, img) |
7906 struct frame *f; | 7904 struct frame *f; |
7907 struct image *img; | 7905 struct image *img; |
7908 { | 7906 { |
8065 DisposeMovie (movie); | 8063 DisposeMovie (movie); |
8066 if (dh) | 8064 if (dh) |
8067 DisposeHandle (dh); | 8065 DisposeHandle (dh); |
8068 | 8066 |
8069 /* Save GIF image extension data for `image-extension-data'. | 8067 /* Save GIF image extension data for `image-extension-data'. |
8070 Format is (count IMAGES duration DURATION). */ | 8068 Format is (count IMAGES 0xf9 GRAPHIC_CONTROL_EXTENSION_BLOCK). */ |
8071 img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration, | 8069 { |
8072 make_float ((double)duration / time_scale)); | 8070 unsigned char gce[4]; |
8071 int centisec = ((float)duration / time_scale) * 100.0f + 0.5f; | |
8072 | |
8073 /* Fill the delay time field. */ | |
8074 gce[1] = centisec & 0xff; | |
8075 gce[2] = (centisec >> 8) & 0xff; | |
8076 /* We don't know about other fields. */ | |
8077 gce[0] = gce[3] = 0; | |
8078 | |
8079 img->data.lisp_val = list4 (Qcount, make_number (nsamples), | |
8080 make_number (0xf9), | |
8081 make_unibyte_string (gce, 4)); | |
8082 } | |
8073 | 8083 |
8074 /* Maybe fill in the background field while we have ximg handy. */ | 8084 /* Maybe fill in the background field while we have ximg handy. */ |
8075 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) | 8085 if (NILP (image_spec_value (img->spec, QCbackground, NULL))) |
8076 IMAGE_BACKGROUND (img, f, ximg); | 8086 IMAGE_BACKGROUND (img, f, ximg); |
8077 | 8087 |
8624 Qgif = intern ("gif"); | 8634 Qgif = intern ("gif"); |
8625 staticpro (&Qgif); | 8635 staticpro (&Qgif); |
8626 ADD_IMAGE_TYPE(Qgif); | 8636 ADD_IMAGE_TYPE(Qgif); |
8627 #endif | 8637 #endif |
8628 | 8638 |
8629 #ifdef MAC_OS | |
8630 Qduration = intern ("duration"); | |
8631 staticpro (&Qduration); | |
8632 #endif | |
8633 | |
8634 #if defined (HAVE_PNG) || defined (MAC_OS) | 8639 #if defined (HAVE_PNG) || defined (MAC_OS) |
8635 Qpng = intern ("png"); | 8640 Qpng = intern ("png"); |
8636 staticpro (&Qpng); | 8641 staticpro (&Qpng); |
8637 ADD_IMAGE_TYPE(Qpng); | 8642 ADD_IMAGE_TYPE(Qpng); |
8638 #endif | 8643 #endif |