annotate lisp/gtk-init.el @ 1929:7999c3afeac9

[xemacs-hg @ 2004-02-25 22:50:48 by viteno] Update xemacs_extra_name.
author viteno
date Wed, 25 Feb 2004 22:50:48 +0000
parents 39ccc7dd8077
children 461fdb92f3b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 ;;; gtk-init.el --- initialization code for mswindows
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 ;; Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995, 1996 Ben Wing.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 ;; Author: various
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 ;; Rewritten for Gtk by: William Perry
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 ;; any later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 ;; General Public License for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
26 (globally-declare-boundp
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
27 '(gtk-initial-argv-list
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
28 gtk-initial-geometry))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
29
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
30 (globally-declare-fboundp
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
31 '(gtk-keysym-on-keyboard-p))
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
32
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 (defvar gtk-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 (defvar gtk-pre-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
35 (defvar gtk-post-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 (defvar gtk-command-switch-alist
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 '(
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 ;; GNOME Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 ("--disable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 ("--enable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 ("--espeaker" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 ;; GTK Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 ("--gdk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 ("--gdk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 ("--display" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 ("--sync" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 ("--no-xshm" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 ("--name" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 ("--class" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 ("--gxid_host" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 ("--gxid_port" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 ("--xim-preedit" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 ("--xim-status" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 ("--gtk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 ("--gtk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 ("--gtk-module" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 ;; Glib options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 ("--g-fatal-warnings" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 ;; Session management options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 ("--sm-client-id" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 ("--sm-config-prefix" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 ("--sm-disable" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 "An assoc list of command line arguments that should in gtk-initial-argv-list.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 This is necessary because GTK and GNOME consider it a fatal error if they receive
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 unknown command line arguments (perfectly reasonable). But this means that if
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 the user specifies a file name on the command line they will be unable to start.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 So we filter the command line and allow only items in this list in.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 The CDR of the assoc list is whether it accepts an argument. All options are in
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 GNU long form though.")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 (defun init-pre-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 "Initialize Gtk GUI at startup (pre). Don't call this."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 (when (not gtk-pre-win-initted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 (setq initial-frame-plist (if initial-frame-unmapped-p
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 '(initially-unmapped t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 gtk-pre-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 (defun gtk-init-handle-geometry (arg)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 "Set up initial geometry info for GTK devices."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 (setq gtk-initial-geometry (pop command-line-args-left)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 (defun gtk-filter-arguments ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 (let ((accepted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 (rejected nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 (todo nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94 (setq todo (mapcar (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 ;; Need to look for --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 (concat "^" (car argdesc) "=")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 ;; Just a simple arg
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 (concat "^" (regexp-quote (car argdesc)) "$")))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 gtk-command-switch-alist))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 (while command-line-args-left
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 (if (catch 'found
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 (mapc (lambda (r)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 (if (string-match r (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 (throw 'found t))) todo)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 (mapc (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 ;; This time we only care about argument items
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 ;; that take an argument. We'll check to see if
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 ;; someone used --foo bar instead of --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 (if (string-match (concat "^" (car argdesc) "$") (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 ;; Yup! Need to push
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 (progn
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 (throw 'found t)))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 gtk-command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 (push (pop command-line-args-left) rejected)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 (setq command-line-args-left (nreverse rejected))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 (nreverse accepted)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 (defun init-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 "Initialize Gtk GUI at startup. Don't call this."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 (unless gtk-win-initted
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 (init-pre-gtk-win)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 (setq gtk-initial-argv-list (cons (car command-line-args) (gtk-filter-arguments))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 gtk-initial-geometry (nth 1 (member "-geometry" command-line-args-left)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 (make-gtk-device)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 (init-post-gtk-win)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 (setq gtk-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 (defun init-post-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 (unless gtk-post-win-initted
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 (when (featurep 'mule)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 (define-specifier-tag 'mule-fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 (lambda (device) (eq 'gtk (device-type device))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 (set-face-font
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 'default
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 '("-*-fixed-medium-r-*--16-*-iso8859-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 "-*-fixed-medium-r-*--*-iso8859-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 "-*-fixed-medium-r-*--*-iso8859-2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 "-*-fixed-medium-r-*--*-iso8859-3"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 "-*-fixed-medium-r-*--*-iso8859-4"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 "-*-fixed-medium-r-*--*-iso8859-7"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 "-*-fixed-medium-r-*--*-iso8859-8"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 "-*-fixed-medium-r-*--*-iso8859-5"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 "-*-fixed-medium-r-*--*-iso8859-9"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 ;; Following 3 fonts proposed by Teruhiko.Kurosaka@Japan.eng.sun
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 "-sun-gothic-medium-r-normal--14-120-75-75-c-60-jisx0201.1976-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153 "-sun-gothic-medium-r-normal--14-120-75-75-c-120-jisx0208.1983-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 "-wadalab-gothic-medium-r-normal--14-120-75-75-c-120-jisx0212.1990-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 ;; Other Japanese fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156 "-*-fixed-medium-r-*--*-jisx0201.1976-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157 "-*-fixed-medium-r-*--*-jisx0208.1983-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 "-*-fixed-medium-r-*--*-jisx0212*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160 ;; Chinese fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 "-*-*-medium-r-*--*-gb2312.1980-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 ;; Use One font specification for CNS chinese
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 ;; Too many variations in font naming
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 "-*-fixed-medium-r-*--*-cns11643*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 ;; "-*-fixed-medium-r-*--*-cns11643*2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 ;; "-*-fixed-medium-r-*--*-cns11643*3"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 ;; "-*-fixed-medium-r-*--*-cns11643*4"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 ;; "-*-fixed-medium-r-*--*-cns11643.5-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 ;; "-*-fixed-medium-r-*--*-cns11643.6-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 ;; "-*-fixed-medium-r-*--*-cns11643.7-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 "-*-fixed-medium-r-*--*-big5*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 "-*-fixed-medium-r-*--*-sisheng_cwnn-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 ;; Other fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 ;; "-*-fixed-medium-r-*--*-viscii1.1-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 ;; "-*-fixed-medium-r-*--*-mulearabic-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 ;; "-*-fixed-medium-r-*--*-mulearabic-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 ;; "-*-fixed-medium-r-*--*-mulearabic-2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 ;; "-*-fixed-medium-r-*--*-muleipa-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 ;; "-*-fixed-medium-r-*--*-ethio-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187 "-*-mincho-medium-r-*--*-ksc5601.1987-*" ; Korean
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 "-*-fixed-medium-r-*--*-tis620.2529-1" ; Thai
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
190 'global '(mule-fonts) 'append))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 (setq gtk-post-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194 (push '("-geometry" . gtk-init-handle-geometry) command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196 ;;; Stuff to get compose keys working on GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 (eval-when-compile
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 (defmacro gtk-define-dead-key (key map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199 `(when (gtk-keysym-on-keyboard-p ',key)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 (define-key function-key-map [,key] ',map))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202 (defun gtk-initialize-compose ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 "Enable compose processing"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 (autoload 'compose-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 (autoload 'compose-acute-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 (autoload 'compose-grave-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 (autoload 'compose-cedilla-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 (autoload 'compose-diaeresis-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 (autoload 'compose-circumflex-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 (autoload 'compose-tilde-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 (when (gtk-keysym-on-keyboard-p 'multi-key)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 (define-key function-key-map [multi-key] 'compose-map))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215 ;; The dead keys might really be called just about anything, depending
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220 ;; Go figure.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 ;; Presumably if someone is running OpenWindows, they won't be using
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223 ;; the DEC or HP keysyms, but if they are defined then that is possible,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
224 ;; so in that case we accept them all.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 ;; If things seem not to be working, you might want to check your
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 ;; mixed up view of what these keys should be called.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 ;; Canonical names:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 (gtk-define-dead-key acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 (gtk-define-dead-key grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233 (gtk-define-dead-key cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 (gtk-define-dead-key diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 (gtk-define-dead-key circumflex compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 (gtk-define-dead-key tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237 (gtk-define-dead-key degree compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 ;; Sun according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240 (gtk-define-dead-key SunFA_Acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 (gtk-define-dead-key SunFA_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 (gtk-define-dead-key SunFA_Cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243 (gtk-define-dead-key SunFA_Diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244 (gtk-define-dead-key SunFA_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
245 (gtk-define-dead-key SunFA_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247 ;; Sun according to OpenWindows 2:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248 (gtk-define-dead-key Dead_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 (gtk-define-dead-key Dead_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250 (gtk-define-dead-key Dead_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
251
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
252 ;; Sun according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 (gtk-define-dead-key SunXK_FA_Acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 (gtk-define-dead-key SunXK_FA_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
255 (gtk-define-dead-key SunXK_FA_Cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
256 (gtk-define-dead-key SunXK_FA_Diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
257 (gtk-define-dead-key SunXK_FA_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
258 (gtk-define-dead-key SunXK_FA_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 ;; DEC according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261 (gtk-define-dead-key Dacute_accent compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 (gtk-define-dead-key Dgrave_accent compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263 (gtk-define-dead-key Dcedilla_accent compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 (gtk-define-dead-key Dcircumflex_accent compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
265 (gtk-define-dead-key Dtilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
266 (gtk-define-dead-key Dring_accent compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
268 ;; DEC according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
269 (gtk-define-dead-key DXK_acute_accent compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
270 (gtk-define-dead-key DXK_grave_accent compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
271 (gtk-define-dead-key DXK_cedilla_accent compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
272 (gtk-define-dead-key DXK_circumflex_accent compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 (gtk-define-dead-key DXK_tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
274 (gtk-define-dead-key DXK_ring_accent compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
275
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 ;; HP according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
277 (gtk-define-dead-key hpmute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
278 (gtk-define-dead-key hpmute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
279 (gtk-define-dead-key hpmute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
280 (gtk-define-dead-key hpmute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
281 (gtk-define-dead-key hpmute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
283 ;; Empirically discovered on Linux XFree86 MetroX:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
284 (gtk-define-dead-key usldead_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
285 (gtk-define-dead-key usldead_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
286 (gtk-define-dead-key usldead_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
287 (gtk-define-dead-key usldead_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
288 (gtk-define-dead-key usldead_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
289
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
290 ;; HP according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291 (gtk-define-dead-key hpXK_mute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
292 (gtk-define-dead-key hpXK_mute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
293 (gtk-define-dead-key hpXK_mute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
294 (gtk-define-dead-key hpXK_mute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
295 (gtk-define-dead-key hpXK_mute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
296
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 ;; HP according to HP-UX 8.0:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
298 (gtk-define-dead-key XK_mute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
299 (gtk-define-dead-key XK_mute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
300 (gtk-define-dead-key XK_mute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
301 (gtk-define-dead-key XK_mute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302 (gtk-define-dead-key XK_mute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
303
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 ;; Xfree86 seems to use lower case and a hyphen
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
305 (gtk-define-dead-key dead-acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
306 (gtk-define-dead-key dead-grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 (gtk-define-dead-key dead-cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
308 (gtk-define-dead-key dead-diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 (gtk-define-dead-key dead-circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310 (gtk-define-dead-key dead-circumflex compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
311 (gtk-define-dead-key dead-tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
312 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
313
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
314 (when (featurep 'gtk)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
315 (add-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
316 'create-console-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317 (lambda (console)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 (letf (((selected-console) console))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319 (when (eq 'gtk (console-type console))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
320 (gtk-initialize-compose))))))