/[mcclim]/mcclim/Drei/drawing-options.lisp
ViewVC logotype

Contents of /mcclim/Drei/drawing-options.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations)
Wed Jan 30 13:49:30 2008 UTC (6 years, 2 months ago) by thenriksen
Branch: MAIN
CVS Tags: McCLIM-0-9-6, HEAD
Changes since 1.5: +8 -8 lines
Changed lots of defconstants to defvars in Drei.

This removes the need for make-load-forms.
1 ;;; -*- Mode: Lisp; Package: DREI -*-
2
3 ;;; (c) copyright 2008 by
4 ;;; Troels Henriksen (athas@sigkill.dk)
5
6 ;;; This library is free software; you can redistribute it and/or
7 ;;; modify it under the terms of the GNU Library General Public
8 ;;; License as published by the Free Software Foundation; either
9 ;;; version 2 of the License, or (at your option) any later version.
10 ;;;
11 ;;; This library is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;;; Library General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Library General Public
17 ;;; License along with this library; if not, write to the
18 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 ;;; Boston, MA 02111-1307 USA.
20
21 ;;; A bunch of predefined drawing options, styles and faces to make
22 ;;; syntax highlighting rules more elegant.
23
24 (in-package :drei)
25
26 ;;; Some general styles.
27
28 (defvar +roman-face+ (make-face :style (make-text-style nil :roman nil))
29 "A face specifying a roman style, but with unspecified family
30 and size.")
31
32 (defvar +italic-face+ (make-face :style (make-text-style nil :italic nil))
33 "A face specifying an italic style, but with unspecified
34 family and size.")
35
36 (defvar +bold-face+ (make-face :style (make-text-style nil :bold nil))
37 "A face specifying a boldface style, but with unspecified
38 family and size.")
39
40 (defvar +bold-italic-face+ (make-face :style (make-text-style nil :bold nil))
41 "A face specifying an italic boldface style, but with
42 unspecified family and size.")
43
44 ;;; ...and their drawing options.
45
46 (defvar +roman-face-drawing-options+ (make-drawing-options :face +roman-face+)
47 "Options used for drawing with a roman face.")
48
49 (defvar +italic-face-drawing-options+ (make-drawing-options :face +italic-face+)
50 "Options used for drawing with an italic face.")
51
52 (defvar +bold-face-drawing-options+ (make-drawing-options :face +bold-face+)
53 "Options used for drawing with boldface.")
54
55 (defvar +bold-italic-face-drawing-options+ (make-drawing-options :face +bold-italic-face+)
56 "Options used for drawing with italic boldface.")
57
58 ;;; Some drawing options for specific syntactical elements,
59 ;;; approximately like GNU Emacs. These are not constants, as users
60 ;;; may want to change them to fit their colour scheme. Of course,
61 ;;; syntax highlighting rules are free to ignore these, but I think
62 ;;; the default rules should at least use these.
63
64 (defvar *keyword-drawing-options*
65 (make-drawing-options :face (make-face :ink +red3+))
66 "The drawing options used for drawing the syntactical
67 equivalent of keyword symbols. In Lisp, this is used for keyword
68 symbols.")
69
70 (defvar *special-operator-drawing-options*
71 (make-drawing-options :face (make-face :ink +steel-blue+
72 :style (make-text-style nil :bold nil)))
73 "The drawing options used for drawing the syntactical
74 equivalent of special operators. In Lisp, this is used for macros
75 and special operators, in most other languages, it should
76 probably be used for language keywords.")
77
78 (defvar *special-variable-drawing-options*
79 (make-drawing-options :face (make-face :ink +darkgoldenrod4+))
80 "The drawing options used for drawing variables that are
81 somehow special. In Lisp, this is used for globally bound
82 non-constant variables with dynamic scope. In other language, it
83 should probably be used for global variables or similar.")
84
85 (defvar *string-drawing-options*
86 (make-drawing-options :face (make-face :ink +green4+))
87 "The drawing options used for syntax-highlighting strings.")
88
89 (defvar *comment-drawing-options*
90 (make-drawing-options :face (make-face :ink +maroon+
91 :style (make-text-style nil :bold nil)))
92 "The drawing options used for drawing comments in source
93 code.")
94
95 (defvar *error-drawing-options*
96 (make-drawing-options :face (make-face :ink +red+))
97 "The drawing options used for drawing syntax errors.")

  ViewVC Help
Powered by ViewVC 1.1.5