• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

修订版f309e60ed5c4bd7714069aea917b0a2db04159f1 (tree)
时间1999-07-26 00:00:38
作者john <john>
Commiterjohn

Log Message

(cycle-through-workspaces, delete-workspaces-when-empty,
uniconify-to-current-workspace, static-workspace-menus): new variables

(workspace-menu, window-menu): dynamic menu constructors

(iconify-window, uniconify-window): new commands

更改概述

差异

--- a/lisp/sawfish/wm/workspace.jl
+++ b/lisp/sawfish/wm/workspace.jl
@@ -1,4 +1,5 @@
11 ;; workspace.jl -- similar to virtual desktops
2+;; $Id$
23
34 (provide 'workspace)
45
@@ -6,6 +7,22 @@
67
78 (defvar ws-current-workspace nil)
89
10+(defvar cycle-through-workspaces nil
11+ "When non-nil, moving through workspaces is cyclical, instead of stopping
12+when the first or last has been reached.")
13+
14+(defvar delete-workspaces-when-empty t
15+ "When non-nil, workspaces are immediately deleted once they contain no
16+windows.")
17+
18+(defvar uniconify-to-current-workspace t
19+ "When non-nil, windows that are uniconified appear on the current
20+workspace.")
21+
22+(defvar static-workspace-menus
23+ '(("Next" next-workspace)
24+ ("Previous" previous-workspace)))
25+
926
1027 ;; Low level functions
1128
@@ -13,7 +30,9 @@
1330 (defun ws-add-window-to-space (w space)
1431 (rplacd space (nconc (cdr space) (list w)))
1532 (window-put w 'workspace space)
16- (when (and ws-current-workspace (eq space ws-current-workspace))
33+ (when (and ws-current-workspace
34+ (eq space ws-current-workspace)
35+ (not (window-get w 'iconified)))
1736 (show-window w)))
1837
1938 (defun ws-add-window (w)
@@ -25,14 +44,16 @@
2544 (setq ws-workspaces (list ws-current-workspace)))
2645 (rplacd ws-current-workspace
2746 (nconc (delq w (cdr ws-current-workspace)) (list w))))
28- (window-put w 'workspace ws-current-workspace)))
47+ (window-put w 'workspace ws-current-workspace)
48+ (unless (window-visible-p w)
49+ (show-window w))))
2950
3051 (defun ws-remove-window (w)
3152 (let
3253 ((space (window-get w 'workspace)))
3354 (when space
3455 (rplacd space (delq w (cdr space)))
35- (when (null (cdr space))
56+ (when (and delete-workspaces-when-empty (null (cdr space)))
3657 ;; workspace is now empty
3758 (when (eq ws-current-workspace space)
3859 (ws-switch-workspace (or (nth 1 (memq space ws-workspaces))
@@ -63,7 +84,6 @@
6384 (or tem (and cycle (car ws-workspaces))))))
6485
6586 (defun ws-find-previous-workspace (&optional cycle)
66- (interactive)
6787 (when (cdr ws-workspaces)
6888 (let
6989 ((tem ws-workspaces))
@@ -73,25 +93,78 @@
7393 (car tem)))))
7494
7595 (defun ws-switch-workspace (space)
76- (when ws-current-workspace
77- (mapc 'hide-window (cdr ws-current-workspace))
78- (call-hook 'leave-workspace-hook (list ws-current-workspace)))
79- (setq ws-current-workspace space)
80- (when ws-current-workspace
81- (mapc 'show-window (cdr ws-current-workspace))
82- (call-hook 'enter-workspace-hook (list ws-current-workspace))))
96+ (unless (eq ws-current-workspace space)
97+ (when ws-current-workspace
98+ (mapc 'hide-window (cdr ws-current-workspace))
99+ (call-hook 'leave-workspace-hook (list ws-current-workspace)))
100+ (setq ws-current-workspace space)
101+ (when ws-current-workspace
102+ (mapc #'(lambda (w)
103+ (unless (window-get w 'iconified)
104+ (show-window w))) (cdr ws-current-workspace))
105+ (call-hook 'enter-workspace-hook (list ws-current-workspace)))))
106+
107+
108+;; menu constructors
109+
110+(defun workspace-menu ()
111+ (let
112+ ((tem ws-workspaces)
113+ (i 0)
114+ menu)
115+ (while tem
116+ (setq menu (cons (list (format nil "space %d%s"
117+ (1+ i)
118+ (if (eq (car tem) ws-current-workspace)
119+ " *" ""))
120+ `(lambda ()
121+ (ws-switch-workspace (nth ,i ws-workspaces))))
122+ menu))
123+ (setq tem (cdr tem))
124+ (setq i (1+ i)))
125+ (nconc (nreverse menu) (list nil) static-workspace-menus)))
126+
127+(defun window-menu ()
128+ (let
129+ (menu space win name)
130+ (setq space ws-workspaces)
131+ (while space
132+ (setq win (cdr (car space)))
133+ (while win
134+ (when (window-mapped-p (car win))
135+ (setq name (window-name (car win)))
136+ (setq menu (cons (list (concat
137+ (and (window-get (car win) 'iconified) ?\[)
138+ (if (> (length name) 20)
139+ (concat (substring name 0 20) "...")
140+ name)
141+ (and (window-get (car win) 'iconified) ?\])
142+ (and (eq (input-focus) (car win)) " *"))
143+ `(lambda ()
144+ (display-window
145+ (get-window-by-id
146+ ,(window-id (car win))))))
147+ menu)))
148+ (setq win (cdr win)))
149+ (setq space (cdr space))
150+ (when space
151+ (setq menu (cons nil menu))))
152+ (nreverse menu)))
83153
84154
85155 ;; Commands
86156
87157 (defun next-workspace ()
158+ "Display the next workspace."
88159 (interactive)
89160 (let
90- ((space (ws-find-next-workspace t)))
161+ ((space (ws-find-next-workspace cycle-through-workspaces)))
91162 (when space
92163 (ws-switch-workspace space))))
93164
94165 (defun send-to-next-workspace (window)
166+ "Move WINDOW to the next workspace. If no next workspace exists, one will be
167+created."
95168 (interactive "f")
96169 (let
97170 ((space (or (ws-find-next-workspace)
@@ -100,13 +173,16 @@
100173 (ws-add-window-to-space window space)))
101174
102175 (defun previous-workspace ()
176+ "Display the previous workspace."
103177 (interactive)
104178 (let
105- ((space (ws-find-previous-workspace t)))
179+ ((space (ws-find-previous-workspace cycle-through-workspaces)))
106180 (when space
107181 (ws-switch-workspace space))))
108182
109183 (defun send-to-previous-workspace (window)
184+ "Move WINDOW to the previous workspace. If no such workspace exists, one
185+will be created."
110186 (interactive "f")
111187 (let
112188 ((space (or (ws-find-previous-workspace)
@@ -115,8 +191,44 @@
115191 (ws-add-window-to-space window space)))
116192
117193
194+;; iconification (but without icons)
195+
196+(defun iconify-window (w)
197+ (interactive "f")
198+ (unless (window-get w 'iconified)
199+ (window-put w 'iconified t)
200+ (when (window-visible-p w)
201+ (hide-window w))
202+ (call-hook 'iconify-window-hook (list w))))
203+
204+(defun uniconify-window (w)
205+ (interactive "f")
206+ (when (window-get w 'iconified)
207+ (window-put w 'iconified nil)
208+ (cond ((eq (window-get w 'workspace) ws-current-workspace)
209+ (show-window w))
210+ (uniconify-to-current-workspace
211+ (ws-remove-window w)
212+ (ws-add-window w)))
213+ (call-hook 'uniconify-window-hook (list w))))
214+
215+(defun display-window (w)
216+ "Display the workspace containing window W."
217+ (interactive "f")
218+ (when w
219+ (if (and (window-get w 'iconified) uniconify-to-current-workspace)
220+ (uniconify-window w)
221+ (let
222+ ((space (window-get w 'workspace)))
223+ (when (and space (not (eq space ws-current-workspace)))
224+ (ws-switch-workspace space))
225+ (uniconify-window w)
226+ (warp-cursor-to-window w)))))
227+
228+
118229 ;; initialisation
119230
120-(add-hook 'add-window-hook 'ws-add-window t)
121-(add-hook 'destroy-notify-hook 'ws-remove-window t)
122-(mapc 'ws-add-window (managed-windows))
231+(unless (memq 'ws-add-window add-window-hook)
232+ (add-hook 'add-window-hook 'ws-add-window t)
233+ (add-hook 'destroy-notify-hook 'ws-remove-window t)
234+ (mapc 'ws-add-window (managed-windows)))
--- a/lisp/workspace.jl
+++ b/lisp/workspace.jl
@@ -1,4 +1,5 @@
11 ;; workspace.jl -- similar to virtual desktops
2+;; $Id$
23
34 (provide 'workspace)
45
@@ -6,6 +7,22 @@
67
78 (defvar ws-current-workspace nil)
89
10+(defvar cycle-through-workspaces nil
11+ "When non-nil, moving through workspaces is cyclical, instead of stopping
12+when the first or last has been reached.")
13+
14+(defvar delete-workspaces-when-empty t
15+ "When non-nil, workspaces are immediately deleted once they contain no
16+windows.")
17+
18+(defvar uniconify-to-current-workspace t
19+ "When non-nil, windows that are uniconified appear on the current
20+workspace.")
21+
22+(defvar static-workspace-menus
23+ '(("Next" next-workspace)
24+ ("Previous" previous-workspace)))
25+
926
1027 ;; Low level functions
1128
@@ -13,7 +30,9 @@
1330 (defun ws-add-window-to-space (w space)
1431 (rplacd space (nconc (cdr space) (list w)))
1532 (window-put w 'workspace space)
16- (when (and ws-current-workspace (eq space ws-current-workspace))
33+ (when (and ws-current-workspace
34+ (eq space ws-current-workspace)
35+ (not (window-get w 'iconified)))
1736 (show-window w)))
1837
1938 (defun ws-add-window (w)
@@ -25,14 +44,16 @@
2544 (setq ws-workspaces (list ws-current-workspace)))
2645 (rplacd ws-current-workspace
2746 (nconc (delq w (cdr ws-current-workspace)) (list w))))
28- (window-put w 'workspace ws-current-workspace)))
47+ (window-put w 'workspace ws-current-workspace)
48+ (unless (window-visible-p w)
49+ (show-window w))))
2950
3051 (defun ws-remove-window (w)
3152 (let
3253 ((space (window-get w 'workspace)))
3354 (when space
3455 (rplacd space (delq w (cdr space)))
35- (when (null (cdr space))
56+ (when (and delete-workspaces-when-empty (null (cdr space)))
3657 ;; workspace is now empty
3758 (when (eq ws-current-workspace space)
3859 (ws-switch-workspace (or (nth 1 (memq space ws-workspaces))
@@ -63,7 +84,6 @@
6384 (or tem (and cycle (car ws-workspaces))))))
6485
6586 (defun ws-find-previous-workspace (&optional cycle)
66- (interactive)
6787 (when (cdr ws-workspaces)
6888 (let
6989 ((tem ws-workspaces))
@@ -73,25 +93,78 @@
7393 (car tem)))))
7494
7595 (defun ws-switch-workspace (space)
76- (when ws-current-workspace
77- (mapc 'hide-window (cdr ws-current-workspace))
78- (call-hook 'leave-workspace-hook (list ws-current-workspace)))
79- (setq ws-current-workspace space)
80- (when ws-current-workspace
81- (mapc 'show-window (cdr ws-current-workspace))
82- (call-hook 'enter-workspace-hook (list ws-current-workspace))))
96+ (unless (eq ws-current-workspace space)
97+ (when ws-current-workspace
98+ (mapc 'hide-window (cdr ws-current-workspace))
99+ (call-hook 'leave-workspace-hook (list ws-current-workspace)))
100+ (setq ws-current-workspace space)
101+ (when ws-current-workspace
102+ (mapc #'(lambda (w)
103+ (unless (window-get w 'iconified)
104+ (show-window w))) (cdr ws-current-workspace))
105+ (call-hook 'enter-workspace-hook (list ws-current-workspace)))))
106+
107+
108+;; menu constructors
109+
110+(defun workspace-menu ()
111+ (let
112+ ((tem ws-workspaces)
113+ (i 0)
114+ menu)
115+ (while tem
116+ (setq menu (cons (list (format nil "space %d%s"
117+ (1+ i)
118+ (if (eq (car tem) ws-current-workspace)
119+ " *" ""))
120+ `(lambda ()
121+ (ws-switch-workspace (nth ,i ws-workspaces))))
122+ menu))
123+ (setq tem (cdr tem))
124+ (setq i (1+ i)))
125+ (nconc (nreverse menu) (list nil) static-workspace-menus)))
126+
127+(defun window-menu ()
128+ (let
129+ (menu space win name)
130+ (setq space ws-workspaces)
131+ (while space
132+ (setq win (cdr (car space)))
133+ (while win
134+ (when (window-mapped-p (car win))
135+ (setq name (window-name (car win)))
136+ (setq menu (cons (list (concat
137+ (and (window-get (car win) 'iconified) ?\[)
138+ (if (> (length name) 20)
139+ (concat (substring name 0 20) "...")
140+ name)
141+ (and (window-get (car win) 'iconified) ?\])
142+ (and (eq (input-focus) (car win)) " *"))
143+ `(lambda ()
144+ (display-window
145+ (get-window-by-id
146+ ,(window-id (car win))))))
147+ menu)))
148+ (setq win (cdr win)))
149+ (setq space (cdr space))
150+ (when space
151+ (setq menu (cons nil menu))))
152+ (nreverse menu)))
83153
84154
85155 ;; Commands
86156
87157 (defun next-workspace ()
158+ "Display the next workspace."
88159 (interactive)
89160 (let
90- ((space (ws-find-next-workspace t)))
161+ ((space (ws-find-next-workspace cycle-through-workspaces)))
91162 (when space
92163 (ws-switch-workspace space))))
93164
94165 (defun send-to-next-workspace (window)
166+ "Move WINDOW to the next workspace. If no next workspace exists, one will be
167+created."
95168 (interactive "f")
96169 (let
97170 ((space (or (ws-find-next-workspace)
@@ -100,13 +173,16 @@
100173 (ws-add-window-to-space window space)))
101174
102175 (defun previous-workspace ()
176+ "Display the previous workspace."
103177 (interactive)
104178 (let
105- ((space (ws-find-previous-workspace t)))
179+ ((space (ws-find-previous-workspace cycle-through-workspaces)))
106180 (when space
107181 (ws-switch-workspace space))))
108182
109183 (defun send-to-previous-workspace (window)
184+ "Move WINDOW to the previous workspace. If no such workspace exists, one
185+will be created."
110186 (interactive "f")
111187 (let
112188 ((space (or (ws-find-previous-workspace)
@@ -115,8 +191,44 @@
115191 (ws-add-window-to-space window space)))
116192
117193
194+;; iconification (but without icons)
195+
196+(defun iconify-window (w)
197+ (interactive "f")
198+ (unless (window-get w 'iconified)
199+ (window-put w 'iconified t)
200+ (when (window-visible-p w)
201+ (hide-window w))
202+ (call-hook 'iconify-window-hook (list w))))
203+
204+(defun uniconify-window (w)
205+ (interactive "f")
206+ (when (window-get w 'iconified)
207+ (window-put w 'iconified nil)
208+ (cond ((eq (window-get w 'workspace) ws-current-workspace)
209+ (show-window w))
210+ (uniconify-to-current-workspace
211+ (ws-remove-window w)
212+ (ws-add-window w)))
213+ (call-hook 'uniconify-window-hook (list w))))
214+
215+(defun display-window (w)
216+ "Display the workspace containing window W."
217+ (interactive "f")
218+ (when w
219+ (if (and (window-get w 'iconified) uniconify-to-current-workspace)
220+ (uniconify-window w)
221+ (let
222+ ((space (window-get w 'workspace)))
223+ (when (and space (not (eq space ws-current-workspace)))
224+ (ws-switch-workspace space))
225+ (uniconify-window w)
226+ (warp-cursor-to-window w)))))
227+
228+
118229 ;; initialisation
119230
120-(add-hook 'add-window-hook 'ws-add-window t)
121-(add-hook 'destroy-notify-hook 'ws-remove-window t)
122-(mapc 'ws-add-window (managed-windows))
231+(unless (memq 'ws-add-window add-window-hook)
232+ (add-hook 'add-window-hook 'ws-add-window t)
233+ (add-hook 'destroy-notify-hook 'ws-remove-window t)
234+ (mapc 'ws-add-window (managed-windows)))