1 ;;; xwem-theme.el --- Themes support for xwem.
3 ;; Copyright (C) 2004,2005 by XWEM Org.
5 ;; Author: Zajcev Evgeny <zevlg@yandex.ru>
6 ;; Created: Tue Nov 23 14:49:41 MSK 2004
8 ;; X-CVS: $Id: xwem-theme.el,v 1.5 2005-04-04 19:54:16 lg Exp $
10 ;; This file is part of XWEM.
12 ;; XWEM is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; XWEM is distributed in the hope that it will be useful, but WITHOUT
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
20 ;; License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 ;;; Synched up with: Not in FSF
37 (defgroup xwem-theme nil
38 "Group to customize xwem themes."
42 (defcustom xwem-theme-default
43 `((face xwem-tabber-face
44 (((frame-selected tab-selected)
45 (:foreground "white" :background "green4" :bold t))
46 ((delimiter-left frame-selected tab-selected)
47 (:foreground "white"))
48 ((delimiter-right frame-selected tab-selected)
49 (:foreground "black"))
51 ((frame-selected tab-nonselected)
52 (:foreground "black" :background "gray80"))
53 ((delimiter-left frame-selected tab-nonselected)
54 (:foreground "white"))
55 ((delimiter-right frame-selected tab-nonselected)
56 (:foreground "black"))
58 ((frame-nonselected tab-selected)
59 (:foreground "gray80" :background "DarkGreen" :bold t))
60 ((delimiter-left frame-nonselected tab-selected)
61 (:foreground "white"))
62 ((delimiter-right frame-nonselected tab-selected)
63 (:foreground "black"))
65 ((frame-nonselected tab-nonselected)
66 (:foreground "black" :background "gray40"))
67 ((delimiter-left frame-nonselected tab-nonselected)
68 (:foreground "white"))
69 ((delimiter-right frame-nonselected tab-nonselected)
70 (:foreground "black"))
72 (t (:foreground "white"))))
75 (((selected) (:foreground "green"))
76 (t (:foreground "gray80"))))
78 (face xwem-frame-inner-border-face
80 (:foreground "gray80" :background "gray80"))
82 (:foreground "gray50" :background "gray50"))
84 (:foreground "gray20" :background "gray20"))
86 (:foreground "cyan2" :background "cyan2"))
88 (:foreground "royalblue" :background "royalblue"))
90 (:foreground "blue4" :background "blue4"))))
92 (face xwem-launch-dock-face
93 (((medium) (:foreground "gray70"))
94 ((light) (:foreground "white"))
95 ((dark) (:foreground "black"))))
97 (face xwem-strokes-face
99 (:foreground "red4" :background "black"))
101 (:foreground "red" :background "black"))
102 ((background begin light)
103 (:foreground "magenta4" :background "black"
104 :line-width 12 :cap-style X-CapRound))
105 ((background begin dark)
106 (:foreground "magenta" :background "black"
107 :line-width 12 :cap-style X-CapRound))))
109 (face xwem-tray-delimiter-face
111 (:foreground "gray40"))
112 ((background light shadow)
113 (:foreground "gray30"))
115 (:foreground "gray70"))
116 ((background dark shadow)
117 (:foreground "gray80"))))
119 (face xwem-window-outline-face
120 (((frame-selected win-selected)
121 (:foreground "green" :background "green4" :line-width 4))
122 ((frame-selected win-nonselected)
123 (:foreground "gray70" :background "gray70" :line-width 4))
124 ((frame-nonselected win-selected)
125 (:foreground "green3" :background "green4" :line-width 4))
126 ((frame-nonselected win-nonselected)
127 (:foreground "gray60" :background "gray40" :line-width 4))))
129 (face xwem-window-delimiter-face
131 (:foreground "royalblue" :background "black"))
133 (:foreground "blue4" :background "black"))
134 ((horizontal light shadow)
135 (:foreground "cyan" :background "black"))
137 (:foreground "royalblue" :background "black"))
139 (:foreground "blue4" :background "black"))
140 ((light shadow vertical)
141 (:foreground "cyan" :background "black"))
142 (t (:foreground "gray20" :background "black"))))
145 (frame-property inner-border-width 8)
146 (frame-property inner-border-thickness 2)
147 (frame-property title-height 18)
149 ;; Clients properties
150 (client-property x-border-width 2)
153 (custom xwem-cursor-help-foreground-color "#00BB00")
154 (custom xwem-cursor-help-background-color "#009900")
155 (custom xwem-root-cursor-foreground-color "white")
156 (custom xwem-root-cursor-background-color "black")
157 (custom xwem-frame-cursor-foreground-color "#111111")
158 (custom xwem-frame-cursor-background-color "#EEEEEE")
160 (custom xwem-minibuffer-bgcol "gray80")
162 "Default xwem theme."
166 (defcustom xwem-theme-extrim
167 `((face xwem-tabber-face
168 (((frame-selected tab-selected)
169 (:foreground "white" :background "gray20"
170 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" :bold t))
171 ((delimiter-left frame-selected tab-selected)
172 (:foreground "white"))
173 ((delimiter-right frame-selected tab-selected)
174 (:foreground "black"))
176 ((frame-selected tab-nonselected)
177 (:foreground "black" :background "gray80"
178 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*"))
179 ((delimiter-left frame-selected tab-nonselected)
180 (:foreground "white"))
181 ((delimiter-right frame-selected tab-nonselected)
182 (:foreground "black"))
184 ((frame-nonselected tab-selected)
185 (:foreground "gray80" :background "gray40"
186 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" :bold t))
187 ((delimiter-left frame-nonselected tab-selected)
188 (:foreground "white"))
189 ((delimiter-right frame-nonselected tab-selected)
190 (:foreground "black"))
192 ((frame-nonselected tab-nonselected)
193 (:foreground "black" :background "gray40"
194 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*"))
195 ((delimiter-left frame-nonselected tab-nonselected)
196 (:foreground "white"))
197 ((delimiter-right frame-nonselected tab-nonselected)
198 (:foreground "black"))
200 (t (:foreground "white"))))
203 (((selected) (:foreground "white"))
204 (t (:foreground "dark"))))
206 (face xwem-frame-inner-border-face
207 (((light nonselected)
208 (:foreground "gray80"))
209 ((medium nonselected)
210 (:foreground "gray50"))
212 (:foreground "gray20"))
214 (:foreground "white"))
216 (:foreground "gray50"))
218 (:foreground "dark"))))
220 (face xwem-launch-dock-face
221 (((medium) (:foreground "gray70"))
222 ((light) (:foreground "white"))
223 ((dark) (:foreground "black"))))
225 (face xwem-strokes-face
227 (:foreground "dimgray" :background "black"))
229 (:foreground "lightgray" :background "black"))
230 ((background begin light)
231 (:foreground "darkslategrey" :background "black"
232 :line-width 12 :cap-style X-CapRound))
233 ((background begin dark)
234 (:foreground "grey" :background "black"
235 :line-width 12 :cap-style X-CapRound))
236 (t (:foreground "dimgray" :background "black"
237 :line-width 6 :cap-style X-CapRound
238 :subwindow-mode X-IncludeInferiors
239 :function (eval xwem-strokes-gc-function)))))
241 (face xwem-tray-delimiter-face
243 (:foreground "gray40"))
244 ((background light shadow)
245 (:foreground "gray30"))
247 (:foreground "gray70"))
248 ((background dark shadow)
249 (:foreground "gray80"))))
251 (face xwem-window-outline-face
252 (((frame-selected win-selected)
253 (:foreground "dark" :background "dark"))
254 ((frame-selected win-nonselected)
255 (:foreground "gray50" :background "gray50"))
256 ((frame-nonselected win-selected)
257 (:foreground "gray20" :background "gray20"))
258 ((frame-nonselected win-nonselected)
259 (:foreground "gray60" :background "gray40"))))
261 (face xwem-window-delimiter-face
263 (:foreground "gray30" :background "black"))
265 (:foreground "gray10" :background "black"))
266 ((horizontal light shadow)
267 (:foreground "gray80" :background "black"))
269 (:foreground "gray10" :background "black"))
271 (:foreground "gray40" :background "black"))
272 ((light shadow vertical)
273 (:foreground "white" :background "black"))
274 (t (:foreground "gray20" :background "black"))))
277 (frame-property inner-border-width 3)
278 (frame-property inner-border-thickness 1)
279 (frame-property title-height 12)
281 ;; Clients properties
282 (client-property x-border-width 3)
285 (custom xwem-cursor-help-foreground-color "#888888")
286 (custom xwem-cursor-help-background-color "#080808")
287 (custom xwem-root-cursor-foreground-color "black")
288 (custom xwem-root-cursor-background-color "white")
289 (custom xwem-frame-cursor-foreground-color "white")
290 (custom xwem-frame-cursor-background-color "black")
292 (custom xwem-minibuffer-bgcol "black")
294 "Extrimal xwem theme."
299 (defconst xwem-cursor-default-theme
300 '((custom xwem-cursor-help-foreground-color "#00BB00")
301 (custom xwem-cursor-help-background-color "#009900")
302 (custom xwem-root-cursor-foreground-color "white")
303 (custom xwem-root-cursor-background-color "black")
304 (custom xwem-frame-cursor-foreground-color "#111111")
305 (custom xwem-frame-cursor-background-color "#EEEEEE")))
307 (defconst xwem-cursor-extrim-theme
308 `((custom xwem-cursor-help-foreground-color "#888888")
309 (custom xwem-cursor-help-background-color "#080808")
310 (custom xwem-root-cursor-foreground-color "black")
311 (custom xwem-root-cursor-background-color "white")
312 (custom xwem-frame-cursor-foreground-color "white")
313 (custom xwem-frame-cursor-background-color "black")))
315 (defconst xwem-cursor-ocean-theme
316 `((custom xwem-cursor-help-foreground-color "#009999")
317 (custom xwem-cursor-help-background-color "#006B6B")
318 (custom xwem-root-cursor-foreground-color "#005858")
319 (custom xwem-root-cursor-background-color "#AFFFFA")
320 (custom xwem-frame-cursor-foreground-color "#BFFFFB")
321 (custom xwem-frame-cursor-background-color "#006D66")))
323 (defconst xwem-cursor-spring-theme
324 `((custom xwem-cursor-help-foreground-color "#00B366")
325 (custom xwem-cursor-help-background-color "#007D48")
326 (custom xwem-root-cursor-foreground-color "#007B3D")
327 (custom xwem-root-cursor-background-color "#BFFFD6")
328 (custom xwem-frame-cursor-foreground-color "#80FFC9")
329 (custom xwem-frame-cursor-background-color "#007D48")))
331 (defconst xwem-cursor-winter-theme
332 `((custom xwem-cursor-help-foreground-color "white")
333 (custom xwem-cursor-help-background-color "gray50")
334 (custom xwem-root-cursor-foreground-color "white")
335 (custom xwem-root-cursor-background-color "gray50")
336 (custom xwem-frame-cursor-foreground-color "white")
337 (custom xwem-frame-cursor-background-color "gray50")))
339 (defvar xwem-cursor-themes
340 '((default . xwem-cursor-default-theme)
341 (extrim . xwem-cursor-extrim-theme)
342 (ocean . xwem-cursor-ocean-theme)
343 (spring . xwem-cursor-spring-theme)
344 (winter . xwem-cursor-winter-theme))
345 "Alist of themes for cursors colors.
346 Alist in form \(THEME-NAME . THEME-VAR\).")
349 (defconst xwem-frame-default-theme
350 '((frame-property inner-border-width 8)
351 (frame-property inner-border-thickness 2)
352 (frame-property title-height 18)
353 (custom xwem-win-vertical-delim-width (8 . 1))
354 (custom xwem-win-horizontal-delim-width (6 . 1))))
356 (defconst xwem-frame-extrim-theme
357 '((frame-property inner-border-width 3)
358 (frame-property inner-border-thickness 1)
359 (frame-property title-height 12)
360 (custom xwem-win-vertical-delim-width (4 . 1))
361 (custom xwem-win-horizontal-delim-width (3 . 1))))
363 (defvar xwem-frame-themes
364 '((default . xwem-frame-default-theme)
365 (extrim . xwem-frame-extrim-theme))
366 "Alist of themes for frame.
367 Alist in form \(THEME-NAME . THEME-VAR\).")
369 ;;; Internal variables
370 (defvar xwem-managing-themes nil
371 "List of themes to manage clients.")
373 (defconst xwem-face-default-theme
374 '((face xwem-tabber-face
375 (((frame-selected tab-selected)
376 (:foreground "white" :background "green4" :bold t))
377 ((delimiter-left frame-selected tab-selected)
378 (:foreground "white"))
379 ((delimiter-right frame-selected tab-selected)
380 (:foreground "black"))
382 ((frame-selected tab-nonselected)
383 (:foreground "black" :background "gray80"))
384 ((delimiter-left frame-selected tab-nonselected)
385 (:foreground "white"))
386 ((delimiter-right frame-selected tab-nonselected)
387 (:foreground "black"))
389 ((frame-nonselected tab-selected)
390 (:foreground "gray80" :background "DarkGreen" :bold t))
391 ((delimiter-left frame-nonselected tab-selected)
392 (:foreground "white"))
393 ((delimiter-right frame-nonselected tab-selected)
394 (:foreground "black"))
396 ((frame-nonselected tab-nonselected)
397 (:foreground "black" :background "gray40"))
398 ((delimiter-left frame-nonselected tab-nonselected)
399 (:foreground "white"))
400 ((delimiter-right frame-nonselected tab-nonselected)
401 (:foreground "black"))
403 (t (:foreground "white"))))
406 (((selected) (:foreground "green"))
407 (t (:foreground "gray80"))))
409 (face xwem-frame-inner-border-face
410 (((light nonselected)
411 (:foreground "gray80" :background "gray80"))
412 ((medium nonselected)
413 (:foreground "gray50" :background "gray50"))
415 (:foreground "gray20" :background "gray20"))
417 (:foreground "cyan2" :background "cyan2"))
419 (:foreground "royalblue" :background "royalblue"))
421 (:foreground "blue4" :background "blue4"))))
423 (face xwem-launch-dock-face
424 (((medium) (:foreground "gray70"))
425 ((light) (:foreground "white"))
426 ((dark) (:foreground "black"))))
428 (face xwem-strokes-face
430 (:foreground "red4" :background "black"))
432 (:foreground "red" :background "black"))
433 ((background begin light)
434 (:foreground "magenta4" :background "black"
435 :line-width 12 :cap-style X-CapRound))
436 ((background begin dark)
437 (:foreground "magenta" :background "black"
438 :line-width 12 :cap-style X-CapRound))))
440 (face xwem-tray-delimiter-face
442 (:foreground "gray40"))
443 ((background light shadow)
444 (:foreground "gray30"))
446 (:foreground "gray70"))
447 ((background dark shadow)
448 (:foreground "gray80"))))
450 (face xwem-window-outline-face
451 (((frame-selected win-selected)
452 (:foreground "green" :background "green4" :line-width 4))
453 ((frame-selected win-nonselected)
454 (:foreground "gray70" :background "gray70" :line-width 4))
455 ((frame-nonselected win-selected)
456 (:foreground "green3" :background "green4" :line-width 4))
457 ((frame-nonselected win-nonselected)
458 (:foreground "gray60" :background "gray40" :line-width 4))))
460 (face xwem-window-delimiter-face
462 (:foreground "royalblue" :background "black"))
464 (:foreground "blue4" :background "black"))
465 ((horizontal light shadow)
466 (:foreground "cyan" :background "black"))
468 (:foreground "royalblue" :background "black"))
470 (:foreground "blue4" :background "black"))
471 ((light shadow vertical)
472 (:foreground "cyan" :background "black"))
473 (t (:foreground "gray20" :background "black")))))
474 "Default faces theme.")
476 (defconst xwem-face-extrim-theme
477 `((face xwem-tabber-face
478 (((frame-selected tab-selected)
479 (:foreground "white" :background "gray20"
480 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" :bold t))
481 ((delimiter-left frame-selected tab-selected)
482 (:foreground "white"))
483 ((delimiter-right frame-selected tab-selected)
484 (:foreground "black"))
486 ((frame-selected tab-nonselected)
487 (:foreground "black" :background "gray80"
488 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*"))
489 ((delimiter-left frame-selected tab-nonselected)
490 (:foreground "white"))
491 ((delimiter-right frame-selected tab-nonselected)
492 (:foreground "black"))
494 ((frame-nonselected tab-selected)
495 (:foreground "gray80" :background "gray40"
496 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" :bold t))
497 ((delimiter-left frame-nonselected tab-selected)
498 (:foreground "white"))
499 ((delimiter-right frame-nonselected tab-selected)
500 (:foreground "black"))
502 ((frame-nonselected tab-nonselected)
503 (:foreground "black" :background "gray40"
504 :font "-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*"))
505 ((delimiter-left frame-nonselected tab-nonselected)
506 (:foreground "white"))
507 ((delimiter-right frame-nonselected tab-nonselected)
508 (:foreground "black"))))
511 (((selected) (:foreground "white"))
512 (t (:foreground "dark"))))
514 (face xwem-frame-inner-border-face
515 (((light nonselected)
516 (:foreground "gray80"))
517 ((medium nonselected)
518 (:foreground "gray50"))
520 (:foreground "gray20"))
522 (:foreground "white"))
524 (:foreground "gray50"))
526 (:foreground "dark"))))
528 (face xwem-launch-dock-face
529 (((medium) (:foreground "gray70"))
530 ((light) (:foreground "white"))
531 ((dark) (:foreground "black"))))
533 (face xwem-strokes-face
535 (:foreground "dimgray" :background "black"))
537 (:foreground "lightgray" :background "black"))
538 ((background begin light)
539 (:foreground "darkslategrey" :background "black"
540 :line-width 12 :cap-style X-CapRound))
541 ((background begin dark)
542 (:foreground "grey" :background "black"
543 :line-width 12 :cap-style X-CapRound))))
545 (face xwem-tray-delimiter-face
547 (:foreground "gray40"))
548 ((background light shadow)
549 (:foreground "gray30"))
551 (:foreground "gray70"))
552 ((background dark shadow)
553 (:foreground "gray80"))))
555 (face xwem-window-outline-face
556 (((frame-selected win-selected)
557 (:foreground "dark" :background "dark"))
558 ((frame-selected win-nonselected)
559 (:foreground "gray50" :background "gray50"))
560 ((frame-nonselected win-selected)
561 (:foreground "gray20" :background "gray20"))
562 ((frame-nonselected win-nonselected)
563 (:foreground "gray60" :background "gray40"))))
565 (face xwem-window-delimiter-face
567 (:foreground "gray30" :background "black"))
569 (:foreground "gray10" :background "black"))
570 ((horizontal light shadow)
571 (:foreground "gray80" :background "black"))
573 (:foreground "gray10" :background "black"))
575 (:foreground "gray40" :background "black"))
576 ((light shadow vertical)
577 (:foreground "white" :background "black")))))
578 "Extrim face theme.")
580 (defconst xwem-face-ocean-theme
581 '((face xwem-tabber-face
582 (((frame-selected tab-selected)
583 (:foreground "#7DC5C5" :background "#174D4D" :bold t))
584 ((delimiter-left frame-selected tab-selected)
585 (:foreground "white"))
586 ((delimiter-right frame-selected tab-selected)
587 (:foreground "black"))
589 ((frame-selected tab-nonselected)
590 (:foreground "#102A2A" :background "#598080"))
591 ((delimiter-left frame-selected tab-nonselected)
592 (:foreground "white"))
593 ((delimiter-right frame-selected tab-nonselected)
594 (:foreground "black"))
596 ((frame-nonselected tab-selected)
597 (:foreground "#6BA0A0" :background "#406060" :bold t))
598 ((delimiter-left frame-nonselected tab-selected)
599 (:foreground "white"))
600 ((delimiter-right frame-nonselected tab-selected)
601 (:foreground "black"))
603 ((frame-nonselected tab-nonselected)
604 (:foreground "#123D3D" :background "#507070"))
605 ((delimiter-left frame-nonselected tab-nonselected)
606 (:foreground "white"))
607 ((delimiter-right frame-nonselected tab-nonselected)
608 (:foreground "black"))))
611 (((selected) (:foreground "#10BABA"))
612 (t (:foreground "#085580"))))
614 (face xwem-frame-inner-border-face
615 (((light nonselected)
616 (:foreground "gray80" :background "gray80"))
617 ((medium nonselected)
618 (:foreground "gray50" :background "gray50"))
620 (:foreground "gray20" :background "gray20"))
622 (:foreground "#7DB3B3" :background "#7DB3B3"))
624 (:foreground "#176D6D" :background "#176D6D"))
626 (:foreground "#102A2A" :background "#102A2A"))))
628 (face xwem-launch-dock-face
629 (((medium) (:foreground "#176D6D"))
630 ((light) (:foreground "#7DB3B3"))
631 ((dark) (:foreground "#102A2A"))))
633 (face xwem-strokes-face
635 (:foreground "#176D6D" :background "black"))
637 (:foreground "#7DB3B3" :background "black"))
638 ((background begin light)
639 (:foreground "#154C4C" :background "black"
640 :line-width 12 :cap-style X-CapRound))
641 ((background begin dark)
642 (:foreground "#6DA0A0" :background "black"
643 :line-width 12 :cap-style X-CapRound))))
645 (face xwem-tray-delimiter-face
647 (:foreground "gray40"))
648 ((background light shadow)
649 (:foreground "gray30"))
651 (:foreground "gray70"))
652 ((background dark shadow)
653 (:foreground "gray80"))))
655 (face xwem-window-outline-face
656 (((frame-selected win-selected)
657 (:foreground "#10BABA" :background "green4" :line-width 4))
658 ((frame-selected win-nonselected)
659 (:foreground "gray70" :background "gray70" :line-width 4))
660 ((frame-nonselected win-selected)
661 (:foreground "#109898" :background "green4" :line-width 4))
662 ((frame-nonselected win-nonselected)
663 (:foreground "gray60" :background "gray40" :line-width 4))))
665 (face xwem-window-delimiter-face
667 (:foreground "#176D6D" :background "#176D6D"))
669 (:foreground "#102A2A" :background "#102A2A"))
670 ((horizontal light shadow)
671 (:foreground "#7DB3B3" :background "#7DB3B3"))
673 (:foreground "#176D6D" :background "#176D6D"))
675 (:foreground "#102A2A" :background "#102A2A"))
676 ((light shadow vertical)
677 (:foreground "#7DB3B3" :background "#7DB3B3")))))
678 "Ocean faces theme.")
680 (defvar xwem-face-themes
681 '((default . xwem-face-default-theme)
682 (extrim . xwem-face-extrim-theme)
683 (ocean . xwem-face-ocean-theme)
685 "List of themes for xwem faces.")
687 (defvar xwem-frame-themes nil
688 "List of themes for frames.")
690 (defvar xwem-client-themes nil
691 "List of themes for clients.")
693 (defvar xwem-theme-themes '(xwem-theme-default xwem-theme-extrim)
696 (defun xwem-theme-apply-face-spec (face spec domain)
697 "Apply to FACE it spec."
698 (let (tag-set vplist tt tv vfont)
700 (setq tag-set (car (car spec))
701 vplist (cadr (car spec))
706 (setq tt (car vplist)
708 (cond ((eq tt :foreground)
709 (xwem-set-face-foreground face tv tag-set domain))
711 (xwem-set-face-background face tv tag-set domain))
713 (xwem-set-face-line-style face tv tag-set domain))
715 (xwem-set-face-line-width face tv tag-set domain))
717 (xwem-set-face-cap-style face tv tag-set domain))
719 (xwem-set-face-join-style face tv tag-set domain))
721 (xwem-set-face-function face tv tag-set domain))
722 ((eq tt :subwindow-mode)
723 (xwem-set-face-subwindow-mode face tv tag-set domain))
724 ((eq tt :graphics-exposures)
725 (xwem-set-face-graphics-exposures face tv tag-set domain))
728 (xwem-set-face-font face tv tag-set domain))
731 (setq tv (or (x-make-font-bold (or vfont (face-font-name face)))
732 (or vfont (face-font-name face '(default)))))
733 (setq tv (or (x-make-font-unbold (or vfont (face-font-name face)))
734 (or vfont (face-font-name face '(default))))))
736 (xwem-set-face-font face tv tag-set domain))
739 (setq tv (or (x-make-font-italic (or vfont (face-font-name face)))
740 (or vfont (face-font-name face '(default)))))
741 (setq tv (or (x-make-font-unitalic (face-font-name face))
742 (or vfont (face-font-name face '(default))))))
744 (xwem-set-face-font face tv tag-set domain)))
745 (setq vplist (cddr vplist)))
746 (setq spec (cdr spec)))))
748 (defun xwem-theme-apply (theme &optional domain)
749 "Apply theme to DOMAIN.
750 If DOMAIN is omitted, apply THEME globally."
751 (mapc #'(lambda (tspec)
754 (when (find-face (cadr tspec))
755 (xwem-theme-apply-face-spec (cadr tspec) (caddr tspec) domain)))
758 (if (and domain (xwem-frame-p domain))
759 (xwem-frame-set-property domain (cadr tspec) (caddr tspec))
761 (xwem-frame-set-property f (cadr tspec) (caddr tspec)))
762 (xwem-frames-list))))
765 (if (and domain (xwem-cl-p domain))
766 (xwem-client-set-property domain (cadr tspec) (caddr tspec))
768 (xwem-client-set-property c (cadr tspec) (caddr tspec)))
769 (xwem-clients-list))))
772 (customize-set-variable (cadr tspec) (caddr tspec)))))
775 ;;;###autoload(autoload 'xwem-theme-set "xwem-theme" nil t)
776 (define-xwem-command xwem-theme-set (theme &optional domain)
777 "Interactively set theme."
779 (list (xwem-completing-read
780 "XWEM Theme [default]: "
781 (mapcar #'(lambda (el)
782 (last (split-string (symbol-name el) "-")))
785 (xwem-completing-read
786 "XWEM Domain [global]: "
787 '(("client") ("window") ("frame"))
791 (if (string= "" theme)
792 (setq theme xwem-theme-default)
793 (setq theme (symbol-value (intern (concat "xwem-theme-" theme)))))
796 (cond ((string= "client" domain)
797 (setq domain (xwem-cl-selected)))
798 ((string= "window" domain)
799 (setq domain (xwem-win-selected)))
800 ((string= "frame" domain)
801 (setq domain (xwem-frame-selected)))
802 (t (setq domain nil)))
804 (xwem-theme-apply theme domain))
807 (provide 'xwem-theme)
809 ;;; xwem-theme.el ends here