2004-04-15 Kevin Greiner <kgreiner@xpediantsolutions.com>
[gnus] / lisp / gnus-picon.el
1 ;;; gnus-picon.el --- displaying pretty icons in Gnus
2
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 ;;      Free Software Foundation, Inc.
5
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Keywords: news xpm annotation glyph faces
8
9 ;; This file is part of GNU Emacs.
10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Commentary:
27
28 ;; There are three picon types relevant to Gnus:
29 ;;
30 ;; Persons: person@subdomain.dom
31 ;;          users/dom/subdomain/person/face.gif
32 ;;          usenix/dom/subdomain/person/face.gif
33 ;;          misc/MISC/person/face.gif
34 ;; Domains: subdomain.dom
35 ;;          domain/dom/subdomain/unknown/face.gif
36 ;; Groups:  comp.lang.lisp
37 ;;          news/comp/lang/lisp/unknown/face.gif
38 ;;
39 ;; Original implementation by Wes Hardaker <hardaker@ece.ucdavis.edu>.
40 ;;
41 ;;; Code:
42
43 (eval-when-compile (require 'cl))
44
45 (require 'gnus)
46 (require 'gnus-art)
47
48 ;;; User variables:
49
50 (defcustom gnus-picon-news-directories '("news")
51   "*List of directories to search for newsgroups faces."
52   :type '(repeat string)
53   :group 'gnus-picon)
54
55 (defcustom gnus-picon-user-directories '("users" "usenix" "local" "misc")
56   "*List of directories to search for user faces."
57   :type '(repeat string)
58   :group 'gnus-picon)
59
60 (defcustom gnus-picon-domain-directories '("domains")
61   "*List of directories to search for domain faces.
62 Some people may want to add \"unknown\" to this list."
63   :type '(repeat string)
64   :group 'gnus-picon)
65
66 (defcustom gnus-picon-file-types
67   (let ((types (list "xbm")))
68     (when (gnus-image-type-available-p 'gif)
69       (push "gif" types))
70     (when (gnus-image-type-available-p 'xpm)
71       (push "xpm" types))
72     types)
73   "*List of suffixes on picon file names to try."
74   :type '(repeat string)
75   :group 'gnus-picon)
76
77 (defface gnus-picon-xbm-face '((t (:foreground "black" :background "white")))
78   "Face to show xbm picon in."
79   :group 'gnus-picon)
80
81 (defface gnus-picon-face '((t (:foreground "black" :background "white")))
82   "Face to show picon in."
83   :group 'gnus-picon)
84
85 ;;; Internal variables:
86
87 (defvar gnus-picon-setup-p nil)
88 (defvar gnus-picon-glyph-alist nil
89   "Picon glyphs cache.
90 List of pairs (KEY . GLYPH) where KEY is either a filename or an URL.")
91 (defvar gnus-picon-cache nil)
92