Japanese translation of message catalog for Sawfish Window-Manager
修訂 | f5498efa0c9375fb9f71242f4a2f86a7c70c77cd (tree) |
---|---|
時間 | 2010-11-03 04:30:02 |
作者 | Christopher Roy Bratusek <zanghar@free...> |
Commiter | Christopher Roy Bratusek |
added edge-actions
final preparative tasks in hot-spots, infinite-desktop and edge-flip
@@ -497,6 +497,7 @@ the user." | ||
497 | 497 | (defgroup placement "Placement" :group misc) |
498 | 498 | (defgroup stacking "Stacking" :group misc) |
499 | 499 | (defgroup workspace "Workspaces") |
500 | + (defgroup edge-actions "Edge Actions") | |
500 | 501 | |
501 | 502 | ;;; loading user's customisations |
502 | 503 |
@@ -0,0 +1,109 @@ | ||
1 | +;; edge-action.jl -- Edges taken to another dimension | |
2 | + | |
3 | +;; Copyright (C) 2010 Christopher Roy Bratusek <zanghar@freenet.de> | |
4 | + | |
5 | +;; This file is part of sawfish. | |
6 | + | |
7 | +;; sawfish is free software; you can redistribute it and/or modify it | |
8 | +;; under the terms of the GNU General Public License as published by | |
9 | +;; the Free Software Foundation; either version 2, or (at your option) | |
10 | +;; any later version. | |
11 | + | |
12 | +;; sawfish is distributed in the hope that it will be useful, but | |
13 | +;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | +;; GNU General Public License for more details. | |
16 | + | |
17 | +;; You should have received a copy of the GNU General Public License | |
18 | +;; along with sawfish; see the file COPYING. If not, write to | |
19 | +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
20 | + | |
21 | +(define-structure sawfish.wm.edge.actions | |
22 | + | |
23 | + (export edges-activate) | |
24 | + | |
25 | + (open rep | |
26 | + rep.system | |
27 | + sawfish.wm.misc | |
28 | + sawfish.wm.events | |
29 | + sawfish.wm.custom | |
30 | + sawfish.wm.edge.util | |
31 | + sawfish.wm.edge.flip | |
32 | + sawfish.wm.edge.hot-spots | |
33 | + sawfish.wm.edge.infinite-desktop) | |
34 | + | |
35 | + (define-structure-alias edge-actions sawfish.wm.edge.actions) | |
36 | + | |
37 | + (define func nil) | |
38 | + | |
39 | + (defcustom edge-actions-enabled nil | |
40 | + "Activate the screen-edges." | |
41 | + :group edge-actions | |
42 | + :type boolean | |
43 | + :after-set (lambda () edges-activate)) | |
44 | + | |
45 | + (defcustom edge-actions-delay 250 | |
46 | + "Delay (in miliseconds) before the edges are activated." | |
47 | + :group edge-actions | |
48 | + :type number | |
49 | + :range (50 . nil)) | |
50 | + | |
51 | + (defcustom left-edge-func 'none | |
52 | + "Action for the left screen-edge." | |
53 | + :group edge-actions | |
54 | + :type (choice hot-spot viewport-drag flip-workspace flip-viewport none)) | |
55 | + | |
56 | + (defcustom top-edge-func 'none | |
57 | + "Action for the top screen-edge." | |
58 | + :group edge-actions | |
59 | + :type (choice hot-spot viewport-drag flip-workspace flip-viewport none)) | |
60 | + | |
61 | + (defcustom right-edge-func 'none | |
62 | + "Action for the right screen-edge." | |
63 | + :group edge-actions | |
64 | + :type (choice hot-spot viewport-drag flip-workspace flip-viewport none)) | |
65 | + | |
66 | + (defcustom bottom-edge-func 'none | |
67 | + "Action for the bottom screen-edge." | |
68 | + :group edge-actions | |
69 | + :type (choice hot-spot viewport-drag flip-workspace flip-viewport none)) | |
70 | + | |
71 | + (define (edge-action-call func edge) | |
72 | + (case func | |
73 | + ((hot-spot) | |
74 | + (hot-spot-activate edge)) | |
75 | + ((viewport-drag) | |
76 | + (infinite-desktop-activate edge)) | |
77 | + ((flip-workspace) | |
78 | + (edge-flip-activate edge 'workspace)) | |
79 | + ((flip-viewport) | |
80 | + (edge-flip-activate edge 'viewport)))) | |
81 | + | |
82 | + (define (edge-action-init) | |
83 | + (let ((corner (get-active-corner)) | |
84 | + (edge (get-active-edge))) | |
85 | + (if corner | |
86 | + (hot-spot-activate corner) | |
87 | + (setq func nil) | |
88 | + (cond ((eq edge 'left) | |
89 | + (edge-action-call left-edge-func edge)) | |
90 | + ((eq edge 'right) | |
91 | + (edge-action-call right-edge-func edge)) | |
92 | + ((eq edge 'top) | |
93 | + (edge-action-call top-edge-func edge)) | |
94 | + ((eq edge 'bottom) | |
95 | + (edge-action-call bottom-edge-func edge)))))) | |
96 | + | |
97 | + (define (edges-activate) | |
98 | + (if edge-actions-enabled | |
99 | + (progn | |
100 | + (flippers-activate t) | |
101 | + (unless (in-hook-p 'enter-flipper-hook edge-action-init) | |
102 | + (add-hook 'enter-flipper-hook edge-action-init)) | |
103 | + (unless (in-hook-p 'while-moving-hook edge-action-init) | |
104 | + (add-hook 'while-moving-hook edge-action-init))) | |
105 | + (flippers-activate nil) | |
106 | + (if (in-hook-p 'enter-flipper-hook edge-action-init) | |
107 | + (remove-hook 'enter-flipper-hook edge-action-init)) | |
108 | + (if (in-hook-p 'while-moving-hook edge-action-init) | |
109 | + (remove-hook 'while-moving-hook edge-action-init))))) | |
\ No newline at end of file |
@@ -32,20 +32,12 @@ | ||
32 | 32 | sawfish.wm.viewport |
33 | 33 | sawfish.wm.workspace |
34 | 34 | sawfish.wm.commands.move-resize |
35 | - sawfish.wm.ext.workspace-grid | |
36 | - sawfish.wm.edge.flippers | |
37 | - sawfish.wm.edge.util) | |
35 | + sawfish.wm.ext.workspace-grid) | |
38 | 36 | |
39 | 37 | (define-structure-alias edge-flip sawfish.wm.edge.flip) |
40 | 38 | |
41 | 39 | (define ef-current-edge nil) |
42 | 40 | |
43 | - (defvar before-edge-flip-hook '() | |
44 | - "Hook called immediately before edge-flipping.") | |
45 | - | |
46 | - (defvar after-edge-flip-hook '() | |
47 | - "Hook called immediately after edge-flipping.") | |
48 | - | |
49 | 41 | (define (edge-flip-activate edge type) |
50 | 42 | (let ((ptr (query-pointer t))) |
51 | 43 | (before-flip) |
@@ -29,8 +29,7 @@ | ||
29 | 29 | sawfish.wm.windows |
30 | 30 | sawfish.wm.misc |
31 | 31 | sawfish.wm.events |
32 | - sawfish.wm.workspace | |
33 | - sawfish.wm.edge.util) | |
32 | + sawfish.wm.workspace) | |
34 | 33 | |
35 | 34 | (define-structure-alias hot-spots sawfish.wm.edge.hot-spots) |
36 | 35 |
@@ -58,51 +57,44 @@ | ||
58 | 57 | (defvar bottom-left-corner-program nil |
59 | 58 | "The program launched when hitting the bottom-left-corner.") |
60 | 59 | |
61 | - (define (hot-spot-activate) | |
62 | - (cond ((eq (get-active-corner) 'top-left) | |
63 | - (unless (eq top-left-corner-program nil) | |
64 | - (if (functionp top-left-corner-program) | |
65 | - (funcall top-left-corner-program) | |
66 | - (system (concat top-left-corner-program " &"))))) | |
67 | - | |
68 | - ((eq (get-active-corner) 'top-right) | |
69 | - (unless (eq top-right-corner-program nil) | |
70 | - (if (functionp top-right-corner-program) | |
71 | - (funcall top-right-corner-program) | |
72 | - (system (concat top-right-corner-program " &"))))) | |
73 | - | |
74 | - ((eq (get-active-corner) 'bottom-right) | |
75 | - (unless (eq bottom-right-corner-program nil) | |
76 | - (if (functionp bottom-right-corner-program) | |
77 | - (funcall bottom-right-corner-program) | |
78 | - (system (concat bottom-right-corner-program " &"))))) | |
79 | - | |
80 | - ((eq (get-active-corner) 'bottom-left) | |
81 | - (unless (eq bottom-left-corner-program nil) | |
82 | - (if (functionp bottom-left-corner-program) | |
83 | - (funcall bottom-left-corner-program) | |
84 | - (system (concat bottom-left-corner-program " &"))))) | |
85 | - | |
86 | - ((eq (get-active-edge) 'left) | |
87 | - (unless (eq left-edge-program nil) | |
88 | - (if (functionp left-edge-program) | |
89 | - (funcall left-edge-program) | |
90 | - (system (concat left-edge-program " &"))))) | |
91 | - | |
92 | - ((eq (get-active-edge) 'top) | |
93 | - (unless (eq top-edge-program nil) | |
94 | - (if (functionp top-edge-program) | |
95 | - (funcall top-edge-program) | |
96 | - (system (concat top-edge-program " &"))))) | |
97 | - | |
98 | - ((eq (get-active-edge) 'right) | |
99 | - (unless (eq right-edge-program nil) | |
100 | - (if (functionp right-edge-program) | |
101 | - (funcall right-edge-program) | |
102 | - (system (concat right-edge-program " &"))))) | |
103 | - | |
104 | - ((eq (get-active-edge) 'bottom) | |
105 | - (unless (eq bottom-edge-program nil) | |
106 | - (if (functionp bottom-edge-program) | |
107 | - (funcall bottom-edge-program) | |
108 | - (system (concat bottom-edge-program " &")))))))) | |
60 | + (define (hot-spot-activate spot) | |
61 | + (case spot | |
62 | + ((top-left) | |
63 | + (if (functionp top-left-corner-program) | |
64 | + (funcall top-left-corner-program) | |
65 | + (system (concat top-left-corner-program " &")))) | |
66 | + | |
67 | + ((top-right) | |
68 | + (if (functionp top-right-corner-program) | |
69 | + (funcall top-right-corner-program) | |
70 | + (system (concat top-right-corner-program " &")))) | |
71 | + | |
72 | + ((bottom-right) | |
73 | + (if (functionp bottom-right-corner-program) | |
74 | + (funcall bottom-right-corner-program) | |
75 | + (system (concat bottom-right-corner-program " &")))) | |
76 | + | |
77 | + ((bottom-left) | |
78 | + (if (functionp bottom-left-corner-program) | |
79 | + (funcall bottom-left-corner-program) | |
80 | + (system (concat bottom-left-corner-program " &")))) | |
81 | + | |
82 | + ((left) | |
83 | + (if (functionp left-edge-program) | |
84 | + (funcall left-edge-program) | |
85 | + (system (concat left-edge-program " &")))) | |
86 | + | |
87 | + ((top) | |
88 | + (if (functionp top-edge-program) | |
89 | + (funcall top-edge-program) | |
90 | + (system (concat top-edge-program " &")))) | |
91 | + | |
92 | + ((right) | |
93 | + (if (functionp right-edge-program) | |
94 | + (funcall right-edge-program) | |
95 | + (system (concat right-edge-program " &")))) | |
96 | + | |
97 | + ((bottom) | |
98 | + (if (functionp bottom-edge-program) | |
99 | + (funcall bottom-edge-program) | |
100 | + (system (concat bottom-edge-program " &"))))))) | |
\ No newline at end of file |
@@ -27,32 +27,24 @@ | ||
27 | 27 | sawfish.wm.misc |
28 | 28 | sawfish.wm.custom |
29 | 29 | sawfish.wm.commands.move-cursor |
30 | - sawfish.wm.viewport | |
31 | - sawfish.wm.util.prompt | |
32 | - sawfish.wm.edge.flippers | |
33 | - sawfish.wm.edge.util) | |
30 | + sawfish.wm.viewport) | |
34 | 31 | |
35 | - (define-structure-alias infinite-desktop sawfish.wm.edge.infinite-desktop) | |
36 | - | |
37 | - (defgroup infinite-desktop "Infinite Desktop" :group workspace) | |
38 | - | |
39 | - (defcustom infinite-desktop-move-distance 64 | |
40 | - "Amount to move the viewport when the pointer hits the screen edge." | |
41 | - :group (workspace infinite-desktop) | |
32 | + (defcustom viewport-drag-distance 64 | |
33 | + "Amount to drag the viewport when the pointer hits the screen edge." | |
34 | + :group edge-actions | |
42 | 35 | :type number |
43 | 36 | :range (1 . nil)) |
44 | 37 | |
45 | - (defcustom infinite-desktop-move-cursor-distance 32 | |
46 | - "Amount to pull back the cursor after moving the viewport." | |
47 | - :group (workspace infinite-desktop) | |
38 | + (defcustom viewport-drag-cursor-distance 32 | |
39 | + "Amount to pull back the cursor after dragging the viewport." | |
40 | + :group edge-actions | |
48 | 41 | :type number |
49 | 42 | :range (1 . nil)) |
50 | 43 | |
51 | - (define (infinite-desktop-move-right) | |
52 | - "Shifts the viewport `infinite-desktop-move-distance' pixels to the | |
53 | -right." | |
54 | - (let ((dist infinite-desktop-move-distance) | |
55 | - (cdist infinite-desktop-move-cursor-distance) | |
44 | + (define (viewport-drag-right) | |
45 | + "Shifts the viewport `viewport-drag-distance' pixels to the right." | |
46 | + (let ((dist viewport-drag-distance) | |
47 | + (cdist viewport-drag-cursor-distance) | |
56 | 48 | (maxx (* (screen-width) (1- (car viewport-dimensions))))) |
57 | 49 | (if |
58 | 50 | (and (viewport-honor-workspace-edges) |
@@ -61,11 +53,10 @@ right." | ||
61 | 53 | (set-viewport (+ viewport-x-offset dist) viewport-y-offset) |
62 | 54 | (move-cursor (- (min dist cdist)) 0))) |
63 | 55 | |
64 | - (define (infinite-desktop-move-left) | |
65 | - "Shifts the viewport `infinite-desktop-move-distance' pixels to the | |
66 | -left." | |
67 | - (let ((dist (- infinite-desktop-move-distance)) | |
68 | - (cdist (- infinite-desktop-move-cursor-distance)) | |
56 | + (define (viewport-drag-left) | |
57 | + "Shifts the viewport `viewport-drag-distance' pixels to the left." | |
58 | + (let ((dist (- viewport-drag-distance)) | |
59 | + (cdist (- viewport-drag-cursor-distance)) | |
69 | 60 | (minx 0)) |
70 | 61 | (if |
71 | 62 | (and (viewport-honor-workspace-edges) |
@@ -74,10 +65,10 @@ left." | ||
74 | 65 | (set-viewport (+ viewport-x-offset dist) viewport-y-offset) |
75 | 66 | (move-cursor (- (max dist cdist)) 0))) |
76 | 67 | |
77 | - (define (infinite-desktop-move-top) | |
78 | - "Shifts the viewport `infinite-desktop-move-distance' pixels up." | |
79 | - (let ((dist (- infinite-desktop-move-distance)) | |
80 | - (cdist (- infinite-desktop-move-cursor-distance)) | |
68 | + (define (viewport-drag-top) | |
69 | + "Shifts the viewport `viewport-drag-distance' pixels up." | |
70 | + (let ((dist (- viewport-drag-distance)) | |
71 | + (cdist (- viewport-drag-cursor-distance)) | |
81 | 72 | (miny 0)) |
82 | 73 | (if |
83 | 74 | (and (viewport-honor-workspace-edges) |
@@ -86,10 +77,10 @@ left." | ||
86 | 77 | (set-viewport viewport-x-offset (+ viewport-y-offset dist)) |
87 | 78 | (move-cursor 0 (- (max dist cdist))))) |
88 | 79 | |
89 | - (define (infinite-desktop-move-bottom) | |
90 | - "Shifts the viewport `infinite-desktop-move-distance' pixels down." | |
91 | - (let ((dist infinite-desktop-move-distance) | |
92 | - (cdist infinite-desktop-move-cursor-distance) | |
80 | + (define (viewport-drag-bottom) | |
81 | + "Shifts the viewport `viewport-drag-distance' pixels down." | |
82 | + (let ((dist viewport-drag-distance) | |
83 | + (cdist viewport-drag-cursor-distance) | |
93 | 84 | (maxy (* (screen-height) (1- (cdr viewport-dimensions))))) |
94 | 85 | (if |
95 | 86 | (and (viewport-honor-workspace-edges) |
@@ -98,10 +89,10 @@ left." | ||
98 | 89 | (set-viewport viewport-x-offset (+ viewport-y-offset dist)) |
99 | 90 | (move-cursor 0 (- (min dist cdist))))) |
100 | 91 | |
101 | - (define (infinite-desktop-activate) | |
92 | + (define (infinite-desktop-activate edge) | |
102 | 93 | "Called when a desktop flipper is triggered to shift the visible desktop." |
103 | - (let ((edge (get-active-edge))) | |
104 | - (cond ((eq edge 'right) (infinite-desktop-move-right)) | |
105 | - ((eq edge 'left) (infinite-desktop-move-left)) | |
106 | - ((eq edge 'bottom) (infinite-desktop-move-bottom)) | |
107 | - ((eq edge 'top) (infinite-desktop-move-top)))))) | |
94 | + (case edge | |
95 | + ((left) (viewport-drag-left)) | |
96 | + ((top) (viewport-drag-top)) | |
97 | + ((right) (viewport-drag-right)) | |
98 | + ((bottom) (viewport-drag-bottom))))) |
@@ -1,6 +1,6 @@ | ||
1 | -;; edge-util.jl -- common utils for EdgeFlip/InfiniteDesktop/HotSpots | |
1 | +;; edge-util.jl -- common utils for EdgeActions | |
2 | 2 | |
3 | -;; Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk> | |
3 | +;; Copyright (C) 2010 Christopher Roy Bratusek <zanghar@freenet.de> | |
4 | 4 | |
5 | 5 | ;; This file is part of sawfish. |
6 | 6 |
@@ -47,13 +47,11 @@ | ||
47 | 47 | (if (in-hook-p 'randr-change-notify-hook recreate-flippers) |
48 | 48 | (remove-hook 'randr-change-notify-hook recreate-flippers)))) |
49 | 49 | |
50 | - (defgroup hot-spot "Hot Spots" :group workspace) | |
51 | - | |
52 | 50 | (defcustom hot-spots-area 50 |
53 | 51 | "Lenght in px (in both x and y direction) wich is used as hot-spots-area." |
54 | 52 | :type number |
55 | 53 | :range (5 . 500) |
56 | - :group (workspace hot-spot)) | |
54 | + :group edge-actions) | |
57 | 55 | |
58 | 56 | (define (get-active-corner) |
59 | 57 | (let ((cursor-x (car (query-pointer))) |