Japanese translation of message catalog for Sawfish Window-Manager
Revisão | 076ab71b55d46479f796ff62de9b8c17aaf92e46 (tree) |
---|---|
Hora | 2000-05-11 02:59:44 |
Autor | john <john> |
Commiter | john |
(maximize-do-horizontal, maximize-do-vertical): use
current-head-dimensions and current-head-offset of the maximized window
to give the maximization bounds
(maximize-find-max-rectangle): new optional arg HEAD, the head to
constrain the rectangle to. Also, the output rectangle may only span a
single head
(maximize-do-both): constrain the maximized window to its current head
@@ -148,7 +148,8 @@ | ||
148 | 148 | (let |
149 | 149 | ((x-span (maximize-expand-edges (cdr coords) (+ (cdr coords) |
150 | 150 | (cdr fdims)) |
151 | - 0 (screen-width) | |
151 | + (car (current-head-offset w)) | |
152 | + (car (current-head-dimensions w)) | |
152 | 153 | (car coords) (+ (car coords) |
153 | 154 | (car fdims)) |
154 | 155 | (car edges)))) |
@@ -161,7 +162,8 @@ | ||
161 | 162 | (let |
162 | 163 | ((y-span (maximize-expand-edges (car coords) (+ (car coords) |
163 | 164 | (car fdims)) |
164 | - 0 (screen-height) | |
165 | + (cdr (current-head-offset w)) | |
166 | + (cdr (current-head-dimensions w)) | |
165 | 167 | (cdr coords) (+ (cdr coords) |
166 | 168 | (cdr fdims)) |
167 | 169 | (cdr edges)))) |
@@ -173,7 +175,7 @@ | ||
173 | 175 | |
174 | 176 | ;; 2D packing |
175 | 177 | |
176 | -(defun maximize-find-max-rectangle (avoided edges) | |
178 | +(defun maximize-find-max-rectangle (avoided edges &optional head) | |
177 | 179 | (let* |
178 | 180 | ((grid (grid-from-edges (car edges) (cdr edges))) |
179 | 181 | rects) |
@@ -181,12 +183,16 @@ | ||
181 | 183 | (sort (car grid)) (sort (cdr grid)) |
182 | 184 | (lambda (rect) |
183 | 185 | ;; the rectangle mustn't overlap any avoided windows |
186 | + ;; or span multiple heads, or be on a different head | |
187 | + ;; to that requested | |
184 | 188 | (catch 'foo |
185 | 189 | (mapc (lambda (w) |
186 | - (when (> (rect-2d-overlap | |
187 | - (window-frame-dimensions w) | |
188 | - (window-position w) | |
189 | - rect) 0) | |
190 | + (when (or (> (rect-2d-overlap | |
191 | + (window-frame-dimensions w) | |
192 | + (window-position w) | |
193 | + rect) 0) | |
194 | + (/= (rectangle-heads rect) 1) | |
195 | + (and head (/= head (find-head (car rect) (cadr rect))))) | |
190 | 196 | (throw 'foo nil))) |
191 | 197 | avoided) |
192 | 198 | t)))) |
@@ -204,7 +210,8 @@ | ||
204 | 210 | |
205 | 211 | (defun maximize-do-both (window avoided edges coords dims fdims) |
206 | 212 | (let |
207 | - ((max-rect (maximize-find-max-rectangle avoided edges))) | |
213 | + ((max-rect (maximize-find-max-rectangle avoided edges | |
214 | + (current-head window)))) | |
208 | 215 | (when max-rect |
209 | 216 | (rplaca coords (nth 0 max-rect)) |
210 | 217 | (rplacd coords (nth 1 max-rect)) |
@@ -268,7 +275,7 @@ doesn't overlap any avoided windows, or nil." | ||
268 | 275 | (edges (get-visible-window-edges ':with-ignored-windows t |
269 | 276 | ':windows avoided |
270 | 277 | ':include-root t))) |
271 | - (maximize-find-max-rectangle avoided edges))) | |
278 | + (maximize-find-max-rectangle avoided edges (current-head w)))) | |
272 | 279 | |
273 | 280 | |
274 | 281 | ;; commands |
@@ -148,7 +148,8 @@ | ||
148 | 148 | (let |
149 | 149 | ((x-span (maximize-expand-edges (cdr coords) (+ (cdr coords) |
150 | 150 | (cdr fdims)) |
151 | - 0 (screen-width) | |
151 | + (car (current-head-offset w)) | |
152 | + (car (current-head-dimensions w)) | |
152 | 153 | (car coords) (+ (car coords) |
153 | 154 | (car fdims)) |
154 | 155 | (car edges)))) |
@@ -161,7 +162,8 @@ | ||
161 | 162 | (let |
162 | 163 | ((y-span (maximize-expand-edges (car coords) (+ (car coords) |
163 | 164 | (car fdims)) |
164 | - 0 (screen-height) | |
165 | + (cdr (current-head-offset w)) | |
166 | + (cdr (current-head-dimensions w)) | |
165 | 167 | (cdr coords) (+ (cdr coords) |
166 | 168 | (cdr fdims)) |
167 | 169 | (cdr edges)))) |
@@ -173,7 +175,7 @@ | ||
173 | 175 | |
174 | 176 | ;; 2D packing |
175 | 177 | |
176 | -(defun maximize-find-max-rectangle (avoided edges) | |
178 | +(defun maximize-find-max-rectangle (avoided edges &optional head) | |
177 | 179 | (let* |
178 | 180 | ((grid (grid-from-edges (car edges) (cdr edges))) |
179 | 181 | rects) |
@@ -181,12 +183,16 @@ | ||
181 | 183 | (sort (car grid)) (sort (cdr grid)) |
182 | 184 | (lambda (rect) |
183 | 185 | ;; the rectangle mustn't overlap any avoided windows |
186 | + ;; or span multiple heads, or be on a different head | |
187 | + ;; to that requested | |
184 | 188 | (catch 'foo |
185 | 189 | (mapc (lambda (w) |
186 | - (when (> (rect-2d-overlap | |
187 | - (window-frame-dimensions w) | |
188 | - (window-position w) | |
189 | - rect) 0) | |
190 | + (when (or (> (rect-2d-overlap | |
191 | + (window-frame-dimensions w) | |
192 | + (window-position w) | |
193 | + rect) 0) | |
194 | + (/= (rectangle-heads rect) 1) | |
195 | + (and head (/= head (find-head (car rect) (cadr rect))))) | |
190 | 196 | (throw 'foo nil))) |
191 | 197 | avoided) |
192 | 198 | t)))) |
@@ -204,7 +210,8 @@ | ||
204 | 210 | |
205 | 211 | (defun maximize-do-both (window avoided edges coords dims fdims) |
206 | 212 | (let |
207 | - ((max-rect (maximize-find-max-rectangle avoided edges))) | |
213 | + ((max-rect (maximize-find-max-rectangle avoided edges | |
214 | + (current-head window)))) | |
208 | 215 | (when max-rect |
209 | 216 | (rplaca coords (nth 0 max-rect)) |
210 | 217 | (rplacd coords (nth 1 max-rect)) |
@@ -268,7 +275,7 @@ doesn't overlap any avoided windows, or nil." | ||
268 | 275 | (edges (get-visible-window-edges ':with-ignored-windows t |
269 | 276 | ':windows avoided |
270 | 277 | ':include-root t))) |
271 | - (maximize-find-max-rectangle avoided edges))) | |
278 | + (maximize-find-max-rectangle avoided edges (current-head w)))) | |
272 | 279 | |
273 | 280 | |
274 | 281 | ;; commands |