/[emacs]/emacs/lisp/toolbar/tool-bar.el
ViewVC logotype

Diff of /emacs/lisp/toolbar/tool-bar.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30.2.3 by miles, Tue May 11 02:21:09 2004 UTC revision 1.30.2.4 by miles, Tue Jul 6 10:00:19 2004 UTC
# Line 96  PROPS are additional items to add to the Line 96  PROPS are additional items to add to the
96  Info node `(elisp)Tool Bar'.  Items are added from left to right.  Info node `(elisp)Tool Bar'.  Items are added from left to right.
97    
98  ICON is the base name of a file containing the image to use.  The  ICON is the base name of a file containing the image to use.  The
99  function will first try to use ICON.xpm, then ICON.pbm, and finally  function will first try to use lc-ICON.xpm if display-color-cells
100    is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
101  ICON.xbm, using `find-image'.  ICON.xbm, using `find-image'.
102    
103  Use this function only to make bindings in the global value of `tool-bar-map'.  Use this function only to make bindings in the global value of `tool-bar-map'.
# Line 112  PROPS are additional items to add to the Line 113  PROPS are additional items to add to the
113  Info node `(elisp)Tool Bar'.  Items are added from left to right.  Info node `(elisp)Tool Bar'.  Items are added from left to right.
114    
115  ICON is the base name of a file containing the image to use.  The  ICON is the base name of a file containing the image to use.  The
116  function will first try to use ICON.xpm, then ICON.pbm, and finally  function will first try to use lc-ICON.xpm if display-color-cells
117    is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
118  ICON.xbm, using `find-image'."  ICON.xbm, using `find-image'."
119    (let* ((fg (face-attribute 'tool-bar :foreground))    (let* ((fg (face-attribute 'tool-bar :foreground))
120           (bg (face-attribute 'tool-bar :background))           (bg (face-attribute 'tool-bar :background))
121           (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))           (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
122                          (if (eq bg 'unspecified) nil (list :background bg))))                          (if (eq bg 'unspecified) nil (list :background bg))))
123             (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
124             (xpm-lo-spec (if (> (display-color-cells) 256)
125                              nil
126                            (list :type 'xpm :file (concat "lc-" icon ".xpm"))))
127             (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
128             (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
129           (image (find-image           (image (find-image
130                  (if (display-color-p)                  (if (display-color-p)
131                      (list (list :type 'xpm :file (concat icon ".xpm"))                      (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
132                            (append (list :type 'pbm :file (concat icon ".pbm"))                    (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))))
133                                    colors)  
                           (append (list :type 'xbm :file (concat icon ".xbm"))  
                                   colors))  
                   (list (append (list :type 'pbm :file (concat icon ".pbm"))  
                                 colors)  
                         (append (list :type 'xbm :file (concat icon ".xbm"))  
                                 colors)  
                         (list :type 'xpm :file (concat icon ".xpm")))))))  
134      (when (and (display-images-p) image)      (when (and (display-images-p) image)
135        (unless (image-mask-p image)        (unless (image-mask-p image)
136          (setq image (append image '(:mask heuristic))))          (setq image (append image '(:mask heuristic))))
# Line 170  MAP must contain appropriate binding for Line 171  MAP must contain appropriate binding for
171           (bg (face-attribute 'tool-bar :background))           (bg (face-attribute 'tool-bar :background))
172           (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))           (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
173                          (if (eq bg 'unspecified) nil (list :background bg))))                          (if (eq bg 'unspecified) nil (list :background bg))))
174             (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
175             (xpm-lo-spec (if (> (display-color-cells) 256)
176                              nil
177                            (list :type 'xpm :file (concat "lc-" icon ".xpm"))))
178             (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
179             (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
180           (spec (if (display-color-p)           (spec (if (display-color-p)
181                     (list (list :type 'xpm :file (concat icon ".xpm"))                     (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
182                           (append (list :type 'pbm :file (concat icon ".pbm"))                   (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))
                                        colors)  
                          (append (list :type 'xbm :file (concat icon ".xbm"))  
                                        colors))  
                  (list (append (list :type 'pbm :file (concat icon ".pbm"))  
                                      colors)  
                        (append (list :type 'xbm :file (concat icon ".xbm"))  
                                      colors)  
                        (list :type 'xpm :file (concat icon ".xpm")))))  
183           (image (find-image spec))           (image (find-image spec))
184           submap key)           submap key)
185      (when (and (display-images-p) image)      (when (and (display-images-p) image)

Legend:
Removed from v.1.30.2.3  
changed lines
  Added in v.1.30.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26