- (setq found (tree-widget--locate-sub-directory
- tree-widget-themes-directory
- tree-widget-themes-load-path))))
- ;; Store the result in the cache for later use.
- (aset tree-widget--theme 1 (or found 'void))
- found))
-
-(defsubst tree-widget-set-image-properties (props)
- "In current theme, set images properties to PROPS."
- (aset tree-widget--theme 2 props))
-
-(defun tree-widget-image-properties (file)
- "Return the properties of an image in current theme.
-FILE is the absolute file name of an image.
-
-If there is a \"tree-widget-theme-setup\" library in the theme
-directory, where is located FILE, load it to setup theme images
-properties. Typically it should contain something like this:
-
- (tree-widget-set-image-properties
- (if (featurep 'xemacs)
- '(:ascent center)
- '(:ascent center :mask (heuristic t))
- ))
-
-When there is no \"tree-widget-theme-setup\" library in the current
-theme directory, load the one from the default theme, if available.
-Default global properties are provided for respectively Emacs and
-XEmacs in the variables `tree-widget-image-properties-emacs', and
-`tree-widget-image-properties-xemacs'."
- ;; If properties are in the cache, use them.
- (let ((plist (aref tree-widget--theme 2)))
- (unless plist
- ;; Load tree-widget-theme-setup if available.
- (load (expand-file-name "tree-widget-theme-setup"
- (file-name-directory file)) t t)
- ;; If properties have been setup, use them.
- (unless (setq plist (aref tree-widget--theme 2))
- ;; Try from the default theme.
- (load (expand-file-name "../default/tree-widget-theme-setup"
- (file-name-directory file)) t t)
- ;; If properties have been setup, use them.
- (unless (setq plist (aref tree-widget--theme 2))
- ;; By default, use supplied global properties.
- (setq plist (if (featurep 'xemacs)
- tree-widget-image-properties-xemacs
- tree-widget-image-properties-emacs))
- ;; Setup the cache.
- (tree-widget-set-image-properties plist))))
- plist))