/[eclipse]/eclipse/lib/sm/package.lisp
ViewVC logotype

Contents of /eclipse/lib/sm/package.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations)
Sun Feb 22 23:56:46 2009 UTC (5 years, 2 months ago) by ihatchondo
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +22 -1 lines
Add: constant names for predefined property names and types (section 11 of xsmp).
1 ihatchondo 1.8 ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: COMMON-LISP; -*-
2 ihatchondo 1.10 ;;; $Id: package.lisp,v 1.10 2009/02/22 23:56:46 ihatchondo Exp $
3 ihatchondo 1.8 ;;; ---------------------------------------------------------------------------
4     ;;; Title: SM Library
5     ;;; Created: 2004 01 15 15:28
6     ;;; Author: Iban Hatchondo <hatchond@labri.fr>
7     ;;; ---------------------------------------------------------------------------
8     ;;; (c) copyright 2004 by Iban Hatchondo
9    
10     ;;;
11     ;;; Permission is granted to any individual or institution to use,
12     ;;; copy, modify, and distribute this software, provided that this
13     ;;; complete copyright and permission notice is maintained, intact, in
14     ;;; all copies and supporting documentation.
15     ;;;
16     ;;; This program is distributed in the hope that it will be useful,
17     ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18     ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19    
20     ;;; NOTE: All comments below are from the original, modified only for
21     ;;; readability. (added for package doc).
22     ;;;
23     ;;; Permission is hereby granted, free of charge, to any person obtaining a
24     ;;; copy of this software and associated documentation files (the ``Software'')
25     ;;; to deal in the Software without restriction, including without limitation
26     ;;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
27     ;;; and/or sell copies of the Software, and to permit persons to whom the
28     ;;; Software is furnished to do so, subject to the following conditions:
29     ;;;
30     ;;; The above copyright notice and this permission notice shall be included in
31     ;;; all copies or substantial portions of the Software.
32     ;;;
33     ;;; THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
34     ;;; OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35     ;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36     ;;; THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
37     ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
38     ;;; OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39     ;;; SOFTWARE.
40     ;;; Except as contained in this notice, the name of the X Consortium shall not
41     ;;; be used in advertising or otherwise to promote the sale, use or other
42     ;;; dealings in this Software without prior written authorization from the X
43     ;;; Consortium.
44     ;;; (X Window System is a trademark of X Consortium, Inc.)
45    
46     (common-lisp:in-package :common-lisp-user)
47    
48     (defpackage "SM-LIB"
49     (:use common-lisp ice-lib)
50     (:documentation
51     "The purpose of the X Session Management Protocol (XSMP) is to provide a
52     uniform mechanism for users to save and restore their sessions. A
53     session is a group of clients, each of which has a particular state.
54     The session is controlled by a network service called the session manager.
55     The session manager issues commands to its clients on behalf of the user.
56     These commands may cause clients to save their state or to terminate. It is
57     expected that the client will save its state in such a way that the client
58     can be restarted at a later time and resume its operation as if it had
59     never been terminated. A client's state might include information about
60     the file currently being edited, the current position of the insertion
61     point within the file, or the start of an uncommitted transaction. The
62     means by which clients are restarted is unspecified by this protocol.
63    
64     For purposes of this protocol, a \fIclient\fP of the session manager is
65     defined as a connection to the session manager. A client is typically,
66     though not necessarily, a process running an application program connected
67     to an X Window System display. However, a client may be connected to more
68     than one X display or not be connected to any X displays at all.
69    
70     This protocol is layered on top of the X Consortium's ICE protocol and
71     relies on the ICE protocol to handle connection management and
72     authentication.
73    
74     This a small implementation of the protocol specification that contains
75     only the functions that are used on the client side. If you want to build a
76     SM server you'll need to implement some functionalities describe in the
77     specification.
78    
79     protocol specification can be found at:
80 ihatchondo 1.9 {http://www.xfree86.org/current/xsmp.pdf}")
81 ihatchondo 1.8 (:import-from :ice-lib
82     #:make-default-versions
83     #:authentication-protocol-index
84     #:protocol-major-opcode
85     #:major-opcode #:offending-minor-opcode
86     #:version-index #:vendor-name #:release-name
87     #:sintern #:index+
88     )
89     (:shadow
90     #:get-properties
91     #:string-length #:strings-length #:strings
92     #:buffer-read-string #:buffer-write-string
93     #:buffer-read-strings #:buffer-write-strings)
94     (:size 90)
95     (:export
96     ;; classes. minor opcode
97     #:register-client ; 1
98     #:register-client-reply ; 2
99     #:save-yourself ; 3
100     #:save-yourself-request ; 4
101     #:interact-request ; 5
102     #:interact ; 6
103     #:interact-done ; 7
104     #:save-yourself-done ; 8
105     #:die ; 9
106     #:shutdown-cancelled ; 10
107     #:connection-closed ; 11
108     #:set-properties ; 12
109     #:delete-properties ; 13
110     #:get-properties ; 14
111     #:get-properties-reply ; 15
112     #:save-yourself-phase2-request ; 16
113     #:save-yourself-phase2 ; 17
114     #:save-complete ; 18
115    
116     ;; structures.
117     #:property
118    
119     ;; condition
120     #:session-manager-unavailable
121    
122     ;; sm lib classes
123     #:sm-connection
124    
125     ;; types
126     #:interact-style
127     #:dialog-type
128     #:save-type
129     #:array8
130     #:array8s
131     #:properties
132    
133     ;; constants & vars
134     #:+sm-proto-major+
135     #:+sm-proto-minor+
136    
137 ihatchondo 1.10 #:+clone-command+
138     #:+current-directory+
139     #:+discard-command+
140     #:+environment+
141     #:+process-id+
142     #:+program+
143     #:+restart-command+
144     #:+resign-command+
145     #:+restart-style-hint+
146     #:+shutdown-command+
147     #:+user-id+
148    
149     #:+restart-if-running+
150     #:+restart-anyway+
151     #:+restart-immediately+
152     #:+restart-never+
153    
154     #:+list-of-array8+
155     #:+array8+
156     #:+card8+
157    
158 ihatchondo 1.8 ;; macros.
159     #:buffer-read-array8
160     #:buffer-read-array8s
161     #:buffer-read-client-id
162     #:buffer-read-dialog-type
163     #:buffer-read-interact-style
164     #:buffer-read-properties
165     #:buffer-read-property
166     #:buffer-read-save-type
167     #:buffer-write-array8
168     #:buffer-write-array8s
169     #:buffer-write-client-id
170     #:buffer-write-dialog-type
171     #:buffer-write-interact-style
172     #:buffer-write-properties
173     #:buffer-write-property
174     #:buffer-write-save-type
175     #:signal-sm-error
176    
177     ;; functions
178     #:connection-closed-p
179     #:delete-properties-p
180     #:die-p
181     #:get-properties-p
182     #:get-properties-reply-p
183     #:interact-done-p
184     #:interact-p
185     #:interact-request-p
186     #:property-p
187     #:register-client-p
188     #:register-client-reply-p
189     #:register-xsmp-protocol
190     #:save-complete-p
191     #:save-yourself-done-p
192     #:save-yourself-p
193     #:save-yourself-request-p
194     #:save-yourself-phase2-p
195     #:save-yourself-phase2-request-p
196     #:set-properties-p
197     #:shutdown-cancelled-p
198    
199     #:array8-length
200     #:array8s-length
201     #:client-id-length
202     #:dialog-type-length
203     #:interact-style-length
204     #:properties-length
205     #:property-length
206     #:save-type-length
207    
208     #:array8->string
209     #:array8s->strings
210     #:string->array8
211     #:strings->array8s
212    
213     #:copy-property
214     #:make-property
215     #:property-name
216     #:property-type
217     #:property-values
218     #:make-array8
219    
220     #:close-sm-connection
221     #:connection-closed-reason
222     #:open-sm-connection
223     #:session-manager-unavailable-reason
224    
225     ;; methods
226     #:delete-properties-properties
227     #:get-properties-reply-properties
228     #:interact-done-cancel-shutdown-p
229     #:interact-request-dialog-type
230     #:register-client-previous-id
231     #:register-client-reply-client-id
232     #:save-yourself-done-success-p
233     #:save-yourself-fast-p
234     #:save-yourself-interact-style
235     #:save-yourself-request-fast-p
236     #:save-yourself-request-global-p
237     #:save-yourself-request-interact-style
238     #:save-yourself-request-shutdown-p
239     #:save-yourself-request-type
240     #:save-yourself-shutdown-p
241     #:save-yourself-type
242     #:set-properties-properties
243     #:sm-client-id
244     #:sm-protocol-revision
245     #:sm-protocol-version
246     #:sm-release
247     #:sm-vendor
248     ))

  ViewVC Help
Powered by ViewVC 1.1.5