annotate lisp/eos/sun-eos-browser.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; sun-eos-browser.el --- Implements the XEmacs/SPARCworks SourceBrowser interface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Maintainer: Eduardo Pelegri-Llopart <eduardo.pelegri-llopart@Eng.Sun.COM>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Author: Eduardo Pelegri-Llopart <eduardo.pelegri-llopart@Eng.Sun.COM>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: SPARCworks EOS Era on SPARCworks SBrowser Source Browser
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; Please send feedback to eduardo.pelegri-llopart@eng.sun.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 (require 'eos-common "sun-eos-common")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; ================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Browser Protocol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; ================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; three notifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; SPRO_SBENG_START
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; SPRO_SBENG_CURRENT_ELEMENT CONTEXT_UID filename lineno center==0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; SPRO_SBENG_QUIT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (defvar eos::currentMatch-inst "/* XPM */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 static char * file[] = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 \"14 11 5 1\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 \" s background c #FFFFFFFFFFFF\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 \". c #000000000000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 \"X c #0000FFFF0000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 \"o c #000077770000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 \"O c #000044440000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 \" \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 \" oo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 \" oXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 \" oXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 \" oXXXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 \" oXXXXXXXo. \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 \" oXXXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 \" oXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 \" oXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 \" oo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 \" \"};")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defvar eos::currentMatch-inst-alt "/* XPM */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 static char * file[] = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 \"14 11 5 1\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 \" s background c #FFFFFFFFFFFF\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 \". c #000000000000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 \"X c #0000FFFF0000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 \"o c #000077770000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 \"O c #000044440000\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 \" \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 \" oo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 \" oXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 \" oXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 \" oXXXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 \" oXXXXXXXo. \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 \" oXXXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 \" oXXXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 \" oXOo \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 \" oo .. \",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 \" .. \"};")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defvar sbrowser-pattern-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defun eos::browser-startup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; Actions to do at startup for eos-browser.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (make-face 'sbrowse-arrow-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (set-face-foreground 'sbrowse-arrow-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 eos::sbrowse-arrow-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (set-face-background 'sbrowse-arrow-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (face-background (get-face 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (setq sbrowser-pattern-list ; list of browser TT patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (eos::create-sbrowser-patterns))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;; now register glyphs and faces...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (eos::annotation-set-inst 'sbrowser 'x eos::currentMatch-inst [nothing])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (eos::annotation-set-inst 'sbrowser 'tty "|>" [nothing])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (eos::annotation-set-face 'sbrowser 'x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (get-face 'sbrowse-arrow-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (get-face 'sbrowse-arrow-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (eos::annotation-set-face 'sbrowser 'tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (get-face 'highlight)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (get-face 'highlight))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defvar eos::current-match nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (defun eos::spro_sbeng_current_element (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; SPRO_SBENG_CURRENT_ELEMENT CONTEXT_UID filename lineno center==0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (let* ((filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (get-tooltalk-message-attribute msg 'arg_val 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (lineno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (read (get-tooltalk-message-attribute msg 'arg_ival 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (setq eos::current-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (eos::make-annotation-visible eos::current-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 lineno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 'sbrowser))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (return-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defun eos::spro_sbeng_start (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (eos::make-annotation-invisible eos::current-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (return-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defun eos::spro_sbeng_quit (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (eos::make-annotation-invisible eos::current-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (return-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (defun eos::create-sbrowser-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; returns list of patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (make-an-observer "SPRO_SBENG_CURRENT_ELEMENT"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 'eos::spro_sbeng_current_element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (make-an-observer "SPRO_SBENG_START"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 'eos::spro_sbeng_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (make-an-observer "SPRO_SBENG_QUIT"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 'eos::spro_sbeng_quit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (defun eos::register-sbrowser-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;; register all sbrowser patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (mapcar 'register-tooltalk-pattern sbrowser-pattern-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defun eos::unregister-sbrowser-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;; unregister all sbrowser patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (mapcar 'unregister-tooltalk-pattern sbrowser-pattern-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;; Actions to start a sourcebrowser in the background.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (defvar eos::sbrowser-process nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "sbrowser process for the background. Only one per XEmacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (defun eos::start-sbrowser ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; Start an "sbrowser -editor" in the background. Will ask for confirmation if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;; XEmacs somehow believes there is already one running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (if (or (not (processp eos::sbrowser-process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (not (eq (process-status eos::sbrowser-process) 'run))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "Warning! XEmacs believes there already is a sbrowser -editor, proceed?"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (setq eos::sbrowser-process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (start-process "*eos sbrowser*" nil "sbrowser" "-editor"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (message "Starting SBrowser subprocess")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (eos::select-sbrowser-frame (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (provide 'eos-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;;; sun-eos-browser.el ends here