Japanese translation of message catalog for Sawfish Window-Manager
Revision | 62e3dd52f9e3e866aeeda95687dac38cea242676 (tree) |
---|---|
Time | 1999-08-02 21:55:29 |
Author | john <john> |
Commiter | john |
(transients-on-parents-workspace): new variable
(merge-next-workspace, merge-previous-workspace, insert-workspace): new
commands, in the workspace menu
(popup-workspace-list, popup-window-list): new commands
@@ -36,6 +36,10 @@ workspace.") | ||
36 | 36 | (defvar raise-windows-on-uniconify t |
37 | 37 | "When non-nil, windows are raised after being uniconified.") |
38 | 38 | |
39 | +(defvar transients-on-parents-workspace nil | |
40 | + "When non-nil transient windows are opened on the same workspace as | |
41 | +their parent window.") | |
42 | + | |
39 | 43 | ;; List of all workspaces; a workspace is `(workspace WINDOWS...)'. |
40 | 44 | ;; Each window has its `workspace' property set to the workspace it's |
41 | 45 | ;; a member of. [src/gnome.c accesses this variable] |
@@ -46,7 +50,10 @@ workspace.") | ||
46 | 50 | |
47 | 51 | (defvar static-workspace-menus |
48 | 52 | '(("Next" next-workspace) |
49 | - ("Previous" previous-workspace))) | |
53 | + ("Previous" previous-workspace) | |
54 | + ("Insert" insert-workspace) | |
55 | + ("Merge next" merge-next-workspace) | |
56 | + ("Merge previous" merge-previous-workspace))) | |
50 | 57 | |
51 | 58 | |
52 | 59 | ;; Low level functions |
@@ -64,18 +71,41 @@ workspace.") | ||
64 | 71 | ;; usually called from the add-window-hook |
65 | 72 | (defun ws-add-window (w) |
66 | 73 | (unless (window-get w 'sticky) |
67 | - (if (null ws-current-workspace) | |
68 | - (progn | |
69 | - ;; initialisation | |
70 | - (setq ws-current-workspace (list 'workspace w)) | |
71 | - (setq ws-workspaces (list ws-current-workspace)) | |
72 | - (call-hook 'add-workspace-hook (list ws-current-workspace))) | |
73 | - (rplacd ws-current-workspace | |
74 | - (nconc (delq w (cdr ws-current-workspace)) (list w)))) | |
75 | - (window-put w 'workspace ws-current-workspace) | |
76 | - (unless (window-visible-p w) | |
77 | - (show-window w)) | |
78 | - (call-hook 'add-to-workspace-hook (list w)))) | |
74 | + (let | |
75 | + (parent) | |
76 | + (if (and transients-on-parents-workspace | |
77 | + (window-transient-p w) | |
78 | + (setq parent (get-window-by-id (window-transient-p w))) | |
79 | + (window-get parent 'workspace) | |
80 | + (not (eq (window-get parent 'workspace) ws-current-workspace))) | |
81 | + ;; put the window on its parents workspace | |
82 | + (ws-add-window-to-space w (window-get parent 'workspace)) | |
83 | + (if (null ws-current-workspace) | |
84 | + (progn | |
85 | + ;; initialisation | |
86 | + (setq ws-current-workspace (list 'workspace w)) | |
87 | + (setq ws-workspaces (list ws-current-workspace)) | |
88 | + (call-hook 'add-workspace-hook (list ws-current-workspace))) | |
89 | + (rplacd ws-current-workspace | |
90 | + (nconc (delq w (cdr ws-current-workspace)) (list w)))) | |
91 | + (window-put w 'workspace ws-current-workspace) | |
92 | + (unless (window-visible-p w) | |
93 | + (show-window w)) | |
94 | + (call-hook 'add-to-workspace-hook (list w)))))) | |
95 | + | |
96 | +;; called from the map-notify hook | |
97 | +(defun ws-window-mapped (w) | |
98 | + (let | |
99 | + (parent) | |
100 | + (when (and transients-on-parents-workspace | |
101 | + (window-transient-p w) | |
102 | + (not (window-get w 'sticky)) | |
103 | + (setq parent (get-window-by-id (window-transient-p w))) | |
104 | + (window-get parent 'workspace) | |
105 | + (not (eq (window-get w 'workspace) | |
106 | + (window-get parent 'workspace)))) | |
107 | + (ws-remove-window w) | |
108 | + (ws-add-window-to-space w (window-get parent 'workspace))))) | |
79 | 109 | |
80 | 110 | (defun ws-remove-window (w) |
81 | 111 | (let |
@@ -108,6 +138,15 @@ workspace.") | ||
108 | 138 | (call-hook 'add-workspace-hook (list space)) |
109 | 139 | space)) |
110 | 140 | |
141 | +(defun ws-insert-workspace () | |
142 | + (if (null ws-workspaces) | |
143 | + (ws-add-workspace t) | |
144 | + (let | |
145 | + ((space (list 'workspace)) | |
146 | + (join (memq ws-current-workspace ws-workspaces))) | |
147 | + (rplacd join (cons space (cdr join))) | |
148 | + space))) | |
149 | + | |
111 | 150 | (defun ws-find-next-workspace (&optional cycle) |
112 | 151 | (when (cdr ws-workspaces) |
113 | 152 | (let |
@@ -135,6 +174,18 @@ workspace.") | ||
135 | 174 | (show-window w))) (cdr ws-current-workspace)) |
136 | 175 | (call-hook 'enter-workspace-hook (list ws-current-workspace))))) |
137 | 176 | |
177 | +(defun ws-merge-workspaces (src dest) | |
178 | + ;; XXX doing this causes a nasty flicker of windows that | |
179 | + ;; XXX get unmapped, moved, then re-mapped | |
180 | + (when (eq ws-current-workspace src) | |
181 | + (ws-switch-workspace dest)) | |
182 | + (while (cdr src) | |
183 | + (let | |
184 | + ((w (nth 1 src))) | |
185 | + (ws-remove-window w) | |
186 | + (ws-add-window-to-space w dest))) | |
187 | + (setq ws-workspaces (delq src ws-workspaces))) | |
188 | + | |
138 | 189 | |
139 | 190 | ;; Menu constructors |
140 | 191 |
@@ -155,6 +206,10 @@ workspace.") | ||
155 | 206 | (setq i (1+ i))) |
156 | 207 | (nconc (nreverse menu) (list nil) static-workspace-menus))) |
157 | 208 | |
209 | +(defun popup-workspace-list () | |
210 | + (interactive) | |
211 | + (popup-menu (workspace-menu))) | |
212 | + | |
158 | 213 | (defun window-menu () |
159 | 214 | (let |
160 | 215 | (menu space win name) |
@@ -182,6 +237,10 @@ workspace.") | ||
182 | 237 | (setq menu (cons nil menu)))) |
183 | 238 | (nreverse menu))) |
184 | 239 | |
240 | +(defun popup-window-list () | |
241 | + (interactive) | |
242 | + (popup-menu (window-menu))) | |
243 | + | |
185 | 244 | |
186 | 245 | ;; Commands |
187 | 246 |
@@ -221,7 +280,6 @@ will be created." | ||
221 | 280 | (ws-remove-window window) |
222 | 281 | (ws-add-window-to-space window space))) |
223 | 282 | |
224 | - | |
225 | 283 | (defun next-workspace-window () |
226 | 284 | "Focus on the next window of the current workspace" |
227 | 285 | (interactive) |
@@ -238,6 +296,25 @@ will be created." | ||
238 | 296 | (when (and space (not (eq space ws-current-workspace))) |
239 | 297 | (ws-switch-workspace space)))) |
240 | 298 | |
299 | +(defun merge-next-workspace () | |
300 | + "Delete the current workspace. Its member windows are relocated to the next | |
301 | +workspace." | |
302 | + (interactive) | |
303 | + (when (> (length ws-workspaces) 1) | |
304 | + (ws-merge-workspaces ws-current-workspace (ws-find-next-workspace t)))) | |
305 | + | |
306 | +(defun merge-previous-workspace () | |
307 | + "Delete the current workspace. Its member windows are relocated to the next | |
308 | +workspace." | |
309 | + (interactive) | |
310 | + (when (> (length ws-workspaces) 1) | |
311 | + (ws-merge-workspaces ws-current-workspace (ws-find-previous-workspace t)))) | |
312 | + | |
313 | +(defun insert-workspace () | |
314 | + "Create a new workspace following the current workspace." | |
315 | + (interactive) | |
316 | + (ws-switch-workspace (ws-insert-workspace))) | |
317 | + | |
241 | 318 | |
242 | 319 | ;; Iconification (but without icons) |
243 | 320 |
@@ -283,4 +360,5 @@ will be created." | ||
283 | 360 | (unless (memq 'ws-add-window add-window-hook) |
284 | 361 | (add-hook 'add-window-hook 'ws-add-window t) |
285 | 362 | (add-hook 'destroy-notify-hook 'ws-remove-window t) |
363 | + (add-hook 'map-notify-hook 'ws-window-mapped t) | |
286 | 364 | (mapc 'ws-add-window (managed-windows))) |
@@ -36,6 +36,10 @@ workspace.") | ||
36 | 36 | (defvar raise-windows-on-uniconify t |
37 | 37 | "When non-nil, windows are raised after being uniconified.") |
38 | 38 | |
39 | +(defvar transients-on-parents-workspace nil | |
40 | + "When non-nil transient windows are opened on the same workspace as | |
41 | +their parent window.") | |
42 | + | |
39 | 43 | ;; List of all workspaces; a workspace is `(workspace WINDOWS...)'. |
40 | 44 | ;; Each window has its `workspace' property set to the workspace it's |
41 | 45 | ;; a member of. [src/gnome.c accesses this variable] |
@@ -46,7 +50,10 @@ workspace.") | ||
46 | 50 | |
47 | 51 | (defvar static-workspace-menus |
48 | 52 | '(("Next" next-workspace) |
49 | - ("Previous" previous-workspace))) | |
53 | + ("Previous" previous-workspace) | |
54 | + ("Insert" insert-workspace) | |
55 | + ("Merge next" merge-next-workspace) | |
56 | + ("Merge previous" merge-previous-workspace))) | |
50 | 57 | |
51 | 58 | |
52 | 59 | ;; Low level functions |
@@ -64,18 +71,41 @@ workspace.") | ||
64 | 71 | ;; usually called from the add-window-hook |
65 | 72 | (defun ws-add-window (w) |
66 | 73 | (unless (window-get w 'sticky) |
67 | - (if (null ws-current-workspace) | |
68 | - (progn | |
69 | - ;; initialisation | |
70 | - (setq ws-current-workspace (list 'workspace w)) | |
71 | - (setq ws-workspaces (list ws-current-workspace)) | |
72 | - (call-hook 'add-workspace-hook (list ws-current-workspace))) | |
73 | - (rplacd ws-current-workspace | |
74 | - (nconc (delq w (cdr ws-current-workspace)) (list w)))) | |
75 | - (window-put w 'workspace ws-current-workspace) | |
76 | - (unless (window-visible-p w) | |
77 | - (show-window w)) | |
78 | - (call-hook 'add-to-workspace-hook (list w)))) | |
74 | + (let | |
75 | + (parent) | |
76 | + (if (and transients-on-parents-workspace | |
77 | + (window-transient-p w) | |
78 | + (setq parent (get-window-by-id (window-transient-p w))) | |
79 | + (window-get parent 'workspace) | |
80 | + (not (eq (window-get parent 'workspace) ws-current-workspace))) | |
81 | + ;; put the window on its parents workspace | |
82 | + (ws-add-window-to-space w (window-get parent 'workspace)) | |
83 | + (if (null ws-current-workspace) | |
84 | + (progn | |
85 | + ;; initialisation | |
86 | + (setq ws-current-workspace (list 'workspace w)) | |
87 | + (setq ws-workspaces (list ws-current-workspace)) | |
88 | + (call-hook 'add-workspace-hook (list ws-current-workspace))) | |
89 | + (rplacd ws-current-workspace | |
90 | + (nconc (delq w (cdr ws-current-workspace)) (list w)))) | |
91 | + (window-put w 'workspace ws-current-workspace) | |
92 | + (unless (window-visible-p w) | |
93 | + (show-window w)) | |
94 | + (call-hook 'add-to-workspace-hook (list w)))))) | |
95 | + | |
96 | +;; called from the map-notify hook | |
97 | +(defun ws-window-mapped (w) | |
98 | + (let | |
99 | + (parent) | |
100 | + (when (and transients-on-parents-workspace | |
101 | + (window-transient-p w) | |
102 | + (not (window-get w 'sticky)) | |
103 | + (setq parent (get-window-by-id (window-transient-p w))) | |
104 | + (window-get parent 'workspace) | |
105 | + (not (eq (window-get w 'workspace) | |
106 | + (window-get parent 'workspace)))) | |
107 | + (ws-remove-window w) | |
108 | + (ws-add-window-to-space w (window-get parent 'workspace))))) | |
79 | 109 | |
80 | 110 | (defun ws-remove-window (w) |
81 | 111 | (let |
@@ -108,6 +138,15 @@ workspace.") | ||
108 | 138 | (call-hook 'add-workspace-hook (list space)) |
109 | 139 | space)) |
110 | 140 | |
141 | +(defun ws-insert-workspace () | |
142 | + (if (null ws-workspaces) | |
143 | + (ws-add-workspace t) | |
144 | + (let | |
145 | + ((space (list 'workspace)) | |
146 | + (join (memq ws-current-workspace ws-workspaces))) | |
147 | + (rplacd join (cons space (cdr join))) | |
148 | + space))) | |
149 | + | |
111 | 150 | (defun ws-find-next-workspace (&optional cycle) |
112 | 151 | (when (cdr ws-workspaces) |
113 | 152 | (let |
@@ -135,6 +174,18 @@ workspace.") | ||
135 | 174 | (show-window w))) (cdr ws-current-workspace)) |
136 | 175 | (call-hook 'enter-workspace-hook (list ws-current-workspace))))) |
137 | 176 | |
177 | +(defun ws-merge-workspaces (src dest) | |
178 | + ;; XXX doing this causes a nasty flicker of windows that | |
179 | + ;; XXX get unmapped, moved, then re-mapped | |
180 | + (when (eq ws-current-workspace src) | |
181 | + (ws-switch-workspace dest)) | |
182 | + (while (cdr src) | |
183 | + (let | |
184 | + ((w (nth 1 src))) | |
185 | + (ws-remove-window w) | |
186 | + (ws-add-window-to-space w dest))) | |
187 | + (setq ws-workspaces (delq src ws-workspaces))) | |
188 | + | |
138 | 189 | |
139 | 190 | ;; Menu constructors |
140 | 191 |
@@ -155,6 +206,10 @@ workspace.") | ||
155 | 206 | (setq i (1+ i))) |
156 | 207 | (nconc (nreverse menu) (list nil) static-workspace-menus))) |
157 | 208 | |
209 | +(defun popup-workspace-list () | |
210 | + (interactive) | |
211 | + (popup-menu (workspace-menu))) | |
212 | + | |
158 | 213 | (defun window-menu () |
159 | 214 | (let |
160 | 215 | (menu space win name) |
@@ -182,6 +237,10 @@ workspace.") | ||
182 | 237 | (setq menu (cons nil menu)))) |
183 | 238 | (nreverse menu))) |
184 | 239 | |
240 | +(defun popup-window-list () | |
241 | + (interactive) | |
242 | + (popup-menu (window-menu))) | |
243 | + | |
185 | 244 | |
186 | 245 | ;; Commands |
187 | 246 |
@@ -221,7 +280,6 @@ will be created." | ||
221 | 280 | (ws-remove-window window) |
222 | 281 | (ws-add-window-to-space window space))) |
223 | 282 | |
224 | - | |
225 | 283 | (defun next-workspace-window () |
226 | 284 | "Focus on the next window of the current workspace" |
227 | 285 | (interactive) |
@@ -238,6 +296,25 @@ will be created." | ||
238 | 296 | (when (and space (not (eq space ws-current-workspace))) |
239 | 297 | (ws-switch-workspace space)))) |
240 | 298 | |
299 | +(defun merge-next-workspace () | |
300 | + "Delete the current workspace. Its member windows are relocated to the next | |
301 | +workspace." | |
302 | + (interactive) | |
303 | + (when (> (length ws-workspaces) 1) | |
304 | + (ws-merge-workspaces ws-current-workspace (ws-find-next-workspace t)))) | |
305 | + | |
306 | +(defun merge-previous-workspace () | |
307 | + "Delete the current workspace. Its member windows are relocated to the next | |
308 | +workspace." | |
309 | + (interactive) | |
310 | + (when (> (length ws-workspaces) 1) | |
311 | + (ws-merge-workspaces ws-current-workspace (ws-find-previous-workspace t)))) | |
312 | + | |
313 | +(defun insert-workspace () | |
314 | + "Create a new workspace following the current workspace." | |
315 | + (interactive) | |
316 | + (ws-switch-workspace (ws-insert-workspace))) | |
317 | + | |
241 | 318 | |
242 | 319 | ;; Iconification (but without icons) |
243 | 320 |
@@ -283,4 +360,5 @@ will be created." | ||
283 | 360 | (unless (memq 'ws-add-window add-window-hook) |
284 | 361 | (add-hook 'add-window-hook 'ws-add-window t) |
285 | 362 | (add-hook 'destroy-notify-hook 'ws-remove-window t) |
363 | + (add-hook 'map-notify-hook 'ws-window-mapped t) | |
286 | 364 | (mapc 'ws-add-window (managed-windows))) |