forked from ChasManRors/ecb
/
ecb-face.el
357 lines (311 loc) · 16.5 KB
/
ecb-face.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
;;; ecb-face.el --- all face-options of ECB
;; Copyright (C) 2000, 2001 Jesper Nordenberg
;; Author: Klaus Berndl <klaus.berndl@sdm.de>
;; Maintainer: Jesper Nordenberg <mayhem@home.se>
;; Keywords: java, class, browser
;; Created: Feb 2002
;; This program is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free Software
;; Foundation; either version 2, or (at your option) any later version.
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.
;; You should have received a copy of the GNU General Public License along with
;; GNU Emacs; see the file COPYING. If not, write to the Free Software
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;;; Commentary:
;; This file contains all options with type 'face and all face-definitions of
;; ECB.
(defgroup ecb-face-options nil
"Settings for all faces used in ECB."
:group 'ecb
:prefix "ecb-")
(defgroup ecb-faces nil
"Definitions of all ECB-faces"
:group 'ecb-face-options
:group 'faces
:prefix "ecb-")
(defmacro ecb-face-default (&optional height bold-p italic-p
inherit
fg-light-col fg-dark-col
bg-light-col bg-dark-col
fg-rest bg-rest
reverse-video-p)
"Macro for setting default values for an ECB face.
The parameters are set for the following display-types:
- ((class color) (background light)): HEIGHT, BOLD-P, ITALIC-P, INHERIT
FG-LIGHT-COL, BG-LIGHT-COL
- ((class color) (background dark)): HEIGHT, BOLD-P, ITALIC-P, INHERIT
FG-DARK-COL, BG-DARK-COL
- t: HEIGHT, BOLD-P, ITALIC-P, INHERIT, FG-REST, BG-REST, REVERSE-VIDEO."
`(list (list '((class color) (background light))
(append (if (and ,height running-emacs-21) (list :height ,height))
(if ,bold-p (if running-emacs-21
(list :weight 'bold)
(list :bold t)))
(if ,italic-p (if running-emacs-21
(list :slant 'italic)
(list :italic t)))
(if (and ,inherit running-emacs-21) (list :inherit ,inherit))
(if ,fg-light-col (list :foreground ,fg-light-col))
(if ,bg-light-col (list :background ,bg-light-col))))
(list '((class color) (background dark))
(append (if (and ,height running-emacs-21) (list :height ,height))
(if ,bold-p (if running-emacs-21
(list :weight 'bold)
(list :bold t)))
(if ,italic-p (if running-emacs-21
(list :slant 'italic)
(list :italic t)))
(if (and ,inherit running-emacs-21) (list :inherit ,inherit))
(if ,fg-dark-col (list :foreground ,fg-dark-col))
(if ,bg-dark-col (list :background ,bg-dark-col))))
(list 't (append (if (and ,height running-emacs-21) (list :height ,height))
(if ,bold-p (if running-emacs-21
(list :weight 'bold)
(list :bold t)))
(if ,italic-p (if running-emacs-21
(list :slant 'italic)
(list :italic t)))
(if (and ,inherit running-emacs-21) (list :inherit ,inherit))
(if ,fg-rest (list :foreground ,fg-rest))
(if ,bg-rest (list :foreground ,bg-rest))
(if ,reverse-video-p (list :reverse-video t))))))
(defface ecb-default-general-face (ecb-face-default 1.0)
"*Basic face for all ECB tree-buffers.
It´s recommended to define here the font-family, the font-size, the basic
color etc.
In GNU Emacs 21.X all faces \(even the face 'ecb-default-highlight-face') used
in the ECB tree-buffers inherit from this face. Therefore the default
attributes like font etc. of a face used in a tree-buffer can be very easily
changed with face 'ecb-default-general-face'.
With XEmacs and GNU Emacs 20.X there is no inheritance-feature but the options
`ecb-directories-general-face', `ecb-sources-general-face',
`ecb-methods-general-face' and `ecb-history-general-face' offer the choice to
use the face 'ecb-default-general-face' so also with XEmacs and GNU Emacs 20.X
the basic face-settings can be easily changed just by customizing the face
'ecb-default-general-face'!"
:group 'ecb-faces)
(defface ecb-directories-general-face (ecb-face-default 1.0 nil nil
'ecb-default-general-face)
"*Basic face for the ECB directories buffer.
It´s recommended to define here the font-family, the font-size, the basic
color etc."
:group 'ecb-faces)
(defcustom ecb-directories-general-face 'ecb-default-general-face
"*Basic face for the ECB directories buffer. This defines the basic
face the whole directory buffer should displayed with. If the face
'ecb-default-general-face' is used then the display of all ECB-tree-buffers
can be changed by modifying only the face 'ecb-default-general-face'."
:group 'ecb-face-options
:group 'ecb-directories
:type '(radio (const :tag "Use ecb-default-general-face"
:value ecb-default-general-face)
(face :tag "Special face"
:value ecb-directories-general-face)))
(defface ecb-sources-general-face (ecb-face-default 1.0 nil nil
'ecb-default-general-face)
"*Basic face for the ECB sources buffer.
It´s recommended to define here the font-family, the font-size, the basic
color etc."
:group 'ecb-faces)
(defcustom ecb-sources-general-face 'ecb-default-general-face
"*Basic face for the ECB sources buffer. This defines the basic
face the whole directory buffer should displayed with. If the face
'ecb-default-general-face' is used then the display of all ECB-tree-buffers
can be changed by modifying only the face 'ecb-default-general-face'."
:group 'ecb-face-options
:group 'ecb-sources
:type 'face
:type '(radio (const :tag "Use ecb-default-general-face"
:value ecb-default-general-face)
(face :tag "Special face"
:value ecb-sources-general-face)))
(defface ecb-methods-general-face (ecb-face-default 1.0 nil nil
'ecb-default-general-face)
"*Basic face for the ECB methods buffer.
It´s recommended to define here the font-family, the font-size, the basic
color etc."
:group 'ecb-faces)
(defcustom ecb-methods-general-face 'ecb-default-general-face
"*Basic face for the ECB methods buffer. This defines the basic
face the whole directory buffer should displayed with. If the face
'ecb-default-general-face' is used then the display of all ECB-tree-buffers
can be changed by modifying only the face 'ecb-default-general-face'."
:group 'ecb-face-options
:group 'ecb-methods
:type '(radio (const :tag "Use ecb-default-general-face"
:value ecb-default-general-face)
(face :tag "Special face"
:value ecb-methods-general-face)))
(defface ecb-history-general-face (ecb-face-default 1.0 nil nil
'ecb-default-general-face)
"*Basic face for the ECB history buffer.
It´s recommended to define here the font-family, the font-size, the basic
color etc."
:group 'ecb-faces)
(defcustom ecb-history-general-face 'ecb-default-general-face
"*Basic face for the ECB directory buffer. This defines the basic
face the whole directory buffer should displayed with. If the face
'ecb-default-general-face' is used then the display of all ECB-tree-buffers
can be changed by modifying only the face 'ecb-default-general-face'."
:group 'ecb-face-options
:group 'ecb-history
:type '(radio (const :tag "Use ecb-default-general-face"
:value ecb-default-general-face)
(face :tag "Special face"
:value ecb-history-general-face)))
;; this face should also inherit from 'ecb-default-general-face': Then
;; changing the font in 'ecb-default-general-face' changes the font in all
;; faces of the tree-buffers.
(defface ecb-default-highlight-face (ecb-face-default nil nil nil
'ecb-default-general-face
"yellow" nil
"cornflower blue" "magenta"
nil nil t)
"*Define basic face for highlighting the selected node in an ECB
tree-buffer.
In GNU Emacs 21.X all highlighting faces in the ECB tree-buffers inherit from
this face. Therefore the default attributes like font etc. of a face used in a
tree-buffer for highlighting the current token can be very easily changed with
face 'ecb-default-highlight-face'.
With XEmacs and GNU Emacs 20.X there is no inheritance-feature but the options
`ecb-directory-face', `ecb-source-face', `ecb-method-face' and
`ecb-history-face' offer the choice to use the face
'ecb-default-highlight-face' so also with XEmacs and GNU Emacs 20.X the basic
face-settings can be easily changed just by customizing the face
'ecb-default-highlight-face'!"
:group 'ecb-faces)
(defface ecb-directory-face (ecb-face-default nil nil nil
'ecb-default-highlight-face
"yellow" nil
"cornflower blue" "magenta"
nil nil t)
"*Define face used for highlighting current directory in the
directories buffer."
:group 'ecb-faces)
(defcustom ecb-directory-face 'ecb-default-highlight-face
"*Face used for highlighting current directory in the directories
buffer. If the face 'ecb-default-highlight-face' is used then the display of
all ECB-tree-buffers can be changed by modifying only the face
'ecb-default-highlight-face'."
:group 'ecb-face-options
:group 'ecb-directories
:type '(radio (const :tag "Use ecb-default-highlight-face"
:value ecb-default-highlight-face)
(face :tag "Special face"
:value ecb-directory-face)))
(defface ecb-source-face (ecb-face-default nil nil nil
'ecb-default-highlight-face
"yellow" nil
"cornflower blue" "magenta"
nil nil t)
"*Define face used for highlighting current source in the
sources buffer."
:group 'ecb-faces)
(defcustom ecb-source-face 'ecb-default-highlight-face
"*Face used for highlighting current source in the sources buffer.
If the face 'ecb-default-highlight-face' is used then the display of all
ECB-tree-buffers can be changed by modifying only the face
'ecb-default-highlight-face'."
:group 'ecb-face-options
:group 'ecb-sources
:type '(radio (const :tag "Use ecb-default-highlight-face"
:value ecb-default-highlight-face)
(face :tag "Special face"
:value ecb-sources-face)))
(defface ecb-method-face (ecb-face-default nil nil nil
'ecb-default-highlight-face
"yellow" nil
"cornflower blue" "magenta"
nil nil t)
"*Define face used for highlighting current method, class or variable
in the methods buffer."
:group 'ecb-faces)
(defcustom ecb-method-face 'ecb-default-highlight-face
"*Face used for highlighting current method, class or variable in the
methods buffer. If the face 'ecb-default-highlight-face' is used then the
display of all ECB-tree-buffers can be changed by modifying only the face
'ecb-default-highlight-face'."
:group 'ecb-face-options
:group 'ecb-methods
:type '(radio (const :tag "Use ecb-default-highlight-face"
:value ecb-default-highlight-face)
(face :tag "Special face"
:value ecb-method-face)))
(defface ecb-history-face (ecb-face-default nil nil nil
'ecb-default-highlight-face
"yellow" nil
"cornflower blue" "magenta"
nil nil t)
"*Define face used for highlighting current history-entry in the
history buffer."
:group 'ecb-faces)
(defcustom ecb-history-face 'ecb-default-highlight-face
"*Face used for highlighting current history-entry in the history
buffer. If the face 'ecb-default-highlight-face' is used then the display of
all ECB-tree-buffers can be changed by modifying only the face
'ecb-default-highlight-face'."
:group 'ecb-face-options
:group 'ecb-history
:type '(radio (const :tag "Use ecb-default-highlight-face"
:value ecb-default-highlight-face)
(face :tag "Special face"
:value ecb-history-face)))
(defface ecb-token-header-face (ecb-face-default nil nil nil nil nil nil
"SeaGreen1" "SeaGreen1"
nil nil t)
"*Define face used for highlighting the token header after jumping to
it by clicking onto a node in the methods buffer."
:group 'ecb-faces)
(defcustom ecb-token-header-face 'ecb-token-header-face
"*Face used for highlighting the token header after jumping to
it by clicking onto a node in the methods buffer."
:group 'ecb-face-options
:group 'ecb-methods
:type 'face)
(defface ecb-source-in-directories-buffer-face (ecb-face-default nil nil nil
'ecb-default-general-face
"medium blue"
"LightBlue1"
nil nil
nil "gray")
"*Define a face for displaying sources in the directories buffer."
:group 'ecb-faces)
(defcustom ecb-source-in-directories-buffer-face
'ecb-source-in-directories-buffer-face
"*Face for source files in the directories buffer."
:group 'ecb-directories
:group 'ecb-face-options
:type 'face)
(defface ecb-type-token-class-face (ecb-face-default nil t)
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-type-token-interface-face (ecb-face-default nil t)
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-type-token-struct-face (ecb-face-default nil t)
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-type-token-typedef-face (ecb-face-default nil t)
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-type-token-enum-face (ecb-face-default nil t)
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-type-token-group-face (ecb-face-default nil t nil nil
(if running-xemacs
"dimgray"
"dim gray")
(if running-xemacs
"dimgray"
"dim gray"))
"*Define face used with option `ecb-type-token-display'."
:group 'ecb-faces)
(defface ecb-bucket-token-face (ecb-face-default nil t)
"*Face which can be used for displaying bucket tokens in the methods
buffer. See also `ecb-bucket-token-display'."
:group 'ecb-faces)
(provide 'ecb-face)
;;; ecb-face.el ends here