• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:type

36 (defconst image-type-header-regexps
49 be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol. If not a symbol,
52 a non-nil value, TYPE is the image's type.")
54 (defconst image-type-file-name-regexps
66 be of image type IMAGE-TYPE.")
71 (defvar image-type-auto-detectable
82 \(See `image-type-auto-detected-p').
87 - maybe auto-detect only if the image type is available
88 (see `image-type-available-p').")
223 (defun image-type-from-data (data)
224 "Determine the image type from image data DATA.
225 Value is a symbol specifying the image type or nil if type cannot
227 (let ((types image-type-header-regexps)
228 type)
231 (image-type (cdr (car types))))
232 (if (or (and (symbolp image-type)
234 (and (consp image-type)
235 (funcall (car image-type) data)
236 (setq image-type (cdr image-type))))
237 (setq type image-type
240 type))
244 (defun image-type-from-buffer ()
245 "Determine the image type from data in the current buffer.
246 Value is a symbol specifying the image type or nil if type cannot
248 (let ((types image-type-header-regexps)
249 type
254 (image-type (cdr (car types)))
256 (if (or (and (symbolp image-type)
258 (and (consp image-type)
259 (funcall (car image-type)
266 (setq image-type (cdr image-type))))
267 (setq type image-type
271 type))
275 (defun image-type-from-file-header (file)
276 "Determine the type of image file FILE from its first few bytes.
277 Value is a symbol specifying the image type, or nil if type cannot
287 (image-type-from-buffer))))
291 (defun image-type-from-file-name (file)
292 "Determine the type of image file FILE from its name.
293 Value is a symbol specifying the image type, or nil if type cannot
295 (let ((types image-type-file-name-regexps)
296 type)
299 (setq type (cdr (car types))
302 type))
306 (defun image-type (file-or-data &optional type data-p)
307 "Determine and return image type.
309 Optional TYPE is a symbol describing the image type. If TYPE is omitted
310 or nil, try to determine the image type from its first few bytes
312 use its file extension as image type.
318 (unless (or type
319 (setq type (image-type-from-file-header file-or-data)))
322 (error "Cannot determine image type"))
323 (setq type (intern extension)))))
326 (unless type
327 (setq type (image-type-from-data file-or-data)))))
328 (unless type
329 (error "Cannot determine image type"))
330 (unless (symbolp type)
331 (error "Invalid image type `%s'" type))
332 type)
336 (defun image-type-available-p (type)
337 "Return non-nil if image type TYPE is available.
340 (init-image-library type image-library-alist)))
344 (defun image-type-auto-detected-p ()
348 First, compare the beginning of the buffer with `image-type-header-regexps'.
349 If an appropriate image type is found, check if that image type can be
350 autodetected using the variable `image-type-auto-detectable'. Finally,
355 (let* ((type (image-type-from-buffer))
356 (auto (and type (cdr (assq type image-type-auto-detectable)))))
358 (or (eq auto t) (image-type-available-p type))
373 (defun create-image (file-or-data &optional type data-p &rest props)
376 Optional TYPE is a symbol describing the image type. If TYPE is omitted
377 or nil, try to determine the image type from its first few bytes
379 use its file extension as image type.
383 Value is the image created, or nil if images of type TYPE are not supported.
386 (setq type (image-type file-or-data type data-p))
387 (when (image-type-available-p type)
388 (append (list 'image :type type (if data-p :data :file) file-or-data)
543 a specification are image type dependent. All specifications must at
544 least contain the properties `:type TYPE' and either `:file FILE' or
545 `:data DATA', where TYPE is a symbol specifying the image type,
558 (type (plist-get spec :type))
562 (when (image-type-available-p type)
582 a specification are image type dependent. All specifications must at
583 least contain the properties `:type TYPE' and either `:file FILE' or
584 `:data DATA', where TYPE is a symbol specifying the image type,
592 (defimage test-image ((:type xpm :file \"~/test1.xpm\")
593 (:type xbm :file \"~/test1.xbm\")))"