Mercurial > emacs
comparison src/image.c @ 62815:94db1d097527
(Vimage_library_alist): Moved from image.el.
(syms_of_image): Defvar it.
(lookup_image_type): Use it.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 27 May 2005 13:16:05 +0000 |
parents | a8d780395b8f |
children | e369bf902cfc 01137c1fdbe9 |
comparison
equal
deleted
inserted
replaced
62814:ab46ab2a20b7 | 62815:94db1d097527 |
---|---|
614 | 614 |
615 /* A list of symbols, one for each supported image type. */ | 615 /* A list of symbols, one for each supported image type. */ |
616 | 616 |
617 Lisp_Object Vimage_types; | 617 Lisp_Object Vimage_types; |
618 | 618 |
619 /* An alist of image types and libraries that implement the type. */ | |
620 | |
621 Lisp_Object Vimage_library_alist; | |
622 | |
619 /* Cache for delayed-loading image types. */ | 623 /* Cache for delayed-loading image types. */ |
620 | 624 |
621 static Lisp_Object Vimage_type_cache; | 625 static Lisp_Object Vimage_type_cache; |
622 | 626 |
623 /* The symbol `xbm' which is used as the type symbol for XBM images. */ | 627 /* The symbol `xbm' which is used as the type symbol for XBM images. */ |
694 Lisp_Object symbol; | 698 Lisp_Object symbol; |
695 { | 699 { |
696 struct image_type *type; | 700 struct image_type *type; |
697 | 701 |
698 /* We must initialize the image-type if it hasn't been already. */ | 702 /* We must initialize the image-type if it hasn't been already. */ |
699 if (NILP (Finit_image_library (symbol, Qnil))) | 703 if (NILP (Finit_image_library (symbol, Vimage_library_alist))) |
700 return 0; /* unimplemented */ | 704 return 0; /* unimplemented */ |
701 | 705 |
702 for (type = image_types; type; type = type->next) | 706 for (type = image_types; type; type = type->next) |
703 if (EQ (symbol, *type->type)) | 707 if (EQ (symbol, *type->type)) |
704 break; | 708 break; |
7983 } | 7987 } |
7984 | 7988 |
7985 void | 7989 void |
7986 syms_of_image () | 7990 syms_of_image () |
7987 { | 7991 { |
7992 extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ | |
7993 | |
7988 /* Must be defined now becase we're going to update it below, while | 7994 /* Must be defined now becase we're going to update it below, while |
7989 defining the supported image types. */ | 7995 defining the supported image types. */ |
7990 DEFVAR_LISP ("image-types", &Vimage_types, | 7996 DEFVAR_LISP ("image-types", &Vimage_types, |
7991 doc: /* List of potentially supported image types. | 7997 doc: /* List of potentially supported image types. |
7992 Each element of the list is a symbol for a image type, like 'jpeg or 'png. | 7998 Each element of the list is a symbol for a image type, like 'jpeg or 'png. |
7993 To check whether it is really supported, use `image-type-available-p'. */); | 7999 To check whether it is really supported, use `image-type-available-p'. */); |
7994 Vimage_types = Qnil; | 8000 Vimage_types = Qnil; |
8001 | |
8002 DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, | |
8003 doc: /* Alist of image types vs external libraries needed to display them. | |
8004 | |
8005 Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol | |
8006 representing a supported image type, and the rest are strings giving | |
8007 alternate filenames for the corresponding external libraries. | |
8008 | |
8009 Emacs tries to load the libraries in the order they appear on the | |
8010 list; if none is loaded, the running session of Emacs won't | |
8011 support the image type. Types 'pbm and 'xbm don't need to be | |
8012 listed; they're always supported. */); | |
8013 Vimage_library_alist = Qnil; | |
8014 Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt); | |
7995 | 8015 |
7996 Vimage_type_cache = Qnil; | 8016 Vimage_type_cache = Qnil; |
7997 staticpro (&Vimage_type_cache); | 8017 staticpro (&Vimage_type_cache); |
7998 | 8018 |
7999 QCascent = intern (":ascent"); | 8019 QCascent = intern (":ascent"); |