~ubuntu-branches/ubuntu/lucid/sawfish/lucid-updates

« back to all changes in this revision

Viewing changes to lisp/sawfish/wm/util/compat.jl

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2002-01-20 17:42:28 UTC
  • Revision ID: james.westby@ubuntu.com-20020120174228-4q1ydztbkvfq1ht2
Tags: upstream-1.0.1.20020116
ImportĀ upstreamĀ versionĀ 1.0.1.20020116

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;; compat.jl -- aliases for obsolete functions
 
2
;; $Id: compat.jl,v 1.13 2000/09/11 07:44:42 john Exp $
 
3
 
 
4
;; Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
 
5
 
 
6
;; This file is part of sawmill.
 
7
 
 
8
;; sawmill is free software; you can redistribute it and/or modify it
 
9
;; under the terms of the GNU General Public License as published by
 
10
;; the Free Software Foundation; either version 2, or (at your option)
 
11
;; any later version.
 
12
 
 
13
;; sawmill is distributed in the hope that it will be useful, but
 
14
;; WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
;; GNU General Public License for more details.
 
17
 
 
18
;; You should have received a copy of the GNU General Public License
 
19
;; along with sawmill; see the file COPYING.  If not, write to
 
20
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
21
 
 
22
(define-structure sawfish.wm.util.compat
 
23
 
 
24
    (export show-message
 
25
            ws-copy-window
 
26
            ws-move-window
 
27
            ws-insert-workspace
 
28
            ws-remove-workspace
 
29
            sawmill-directory
 
30
            sawmill-lisp-lib-directory
 
31
            sawmill-site-lisp-directory
 
32
            sawmill-exec-directory
 
33
            sawmill-version
 
34
            custom-set-color
 
35
            custom-set-font
 
36
            custom-set-frame-style)
 
37
 
 
38
    (open rep
 
39
          sawfish.wm.misc
 
40
          sawfish.wm.custom
 
41
          sawfish.wm.commands
 
42
          sawfish.wm.workspace)
 
43
 
 
44
;;; obsolete functions
 
45
 
 
46
  (define (show-message #!optional text font fg bg position)
 
47
    (let ((attrs nil))
 
48
      (when font
 
49
        (setq attrs (cons (cons 'font font) attrs)))
 
50
      (when fg
 
51
        (setq attrs (cons (cons 'fg fg) attrs)))
 
52
      (when bg
 
53
        (setq attrs (cons (cons 'bg bg) attrs)))
 
54
      (when position
 
55
        (setq attrs (cons (cons 'position position) attrs)))
 
56
      (display-message text attrs)))
 
57
 
 
58
  (define ws-copy-window copy-window-to-workspace)
 
59
  (define ws-move-window move-window-to-workspace)
 
60
  (define ws-insert-workspace insert-workspace)
 
61
  (define ws-remove-workspace remove-workspace)
 
62
 
 
63
;;; obsolete variables
 
64
 
 
65
  (define sawmill-directory sawfish-directory)
 
66
  (define sawmill-lisp-lib-directory sawfish-lisp-lib-directory)
 
67
  (define sawmill-site-lisp-directory sawfish-site-lisp-directory)
 
68
  (define sawmill-exec-directory sawfish-exec-directory)
 
69
  (define sawmill-version sawfish-version)
 
70
 
 
71
;;; obsolete commands
 
72
 
 
73
  (define (define-commands index)
 
74
    (let ((fn (lambda (base)
 
75
                (intern (format nil "%s:%d" base (1+ index))))))
 
76
      (define-command (fn "select-workspace")
 
77
        (lambda () (select-workspace-from-first index)))
 
78
      (define-command (fn "send-to-workspace")
 
79
        (lambda (w) (send-window-to-workspace-from-first w index)) #:spec "%W")
 
80
      (define-command (fn "copy-to-workspace")
 
81
        (lambda (w) (send-window-to-workspace-from-first w index t)) #:spec "%W")
 
82
      (put (fn "select-workspace") 'deprecated-command t)
 
83
      (put (fn "send-to-workspace") 'deprecated-command t)
 
84
      (put (fn "copy-to-workspace") 'deprecated-command t)))
 
85
 
 
86
  (do ((i 0 (1+ i)))
 
87
      ((= i 9))
 
88
    (define-commands i))
 
89
 
 
90
  (define-command 'insert-workspace (command-ref 'insert-workspace-after))
 
91
  (put 'insert-workspace 'deprecated-command t)
 
92
 
 
93
;;; obsolete options
 
94
 
 
95
  (put 'viewport-columns 'custom-obsolete t)
 
96
  (put 'viewport-rows 'custom-obsolete t)
 
97
  (put 'viewport-dimensions 'custom-obsolete t)
 
98
  (put 'preallocated-workspaces 'custom-obsolete t)
 
99
  (put 'iconify-whole-group 'custom-obsolete t)
 
100
  (put 'uniconify-whole-group 'custom-obsolete t)
 
101
  (put 'always-update-frames 'custom-obsolete t)
 
102
 
 
103
;;; obsolete custom setters
 
104
 
 
105
  (define (custom-set-color var value #!optional req)
 
106
    (custom-set-typed-variable var value 'color req))
 
107
  (define (custom-set-font var value #!optional req)
 
108
    (custom-set-typed-variable var value 'font req))
 
109
  (define (custom-set-frame-style var value #!optional req)
 
110
    (custom-set-typed-variable var value 'frame-style req))
 
111
 
 
112
  (define-custom-setter 'custom-set-color custom-set-color)
 
113
  (define-custom-setter 'custom-set-font custom-set-font)
 
114
  (define-custom-setter 'custom-set-frame-style custom-set-frame-style))