Japanese translation of message catalog for Sawfish Window-Manager
Revisão | 7617593b4d5b257566a7724732bfa7ee08ed6331 (tree) |
---|---|
Hora | 1999-08-21 19:01:41 |
Autor | john <john> |
Commiter | john |
new file, replaces the libgnome.so dl
@@ -0,0 +1,154 @@ | ||
1 | +;; gnome.jl -- minimal GNOME compliance | |
2 | +;; $Id$ | |
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 | +(provide 'gnome) | |
23 | + | |
24 | +(defconst WIN_STATE_STICKY 1) | |
25 | + | |
26 | +(defvar gnome-window-names "^(gmc|panel)$") | |
27 | + | |
28 | +(defvar gnome-window-id nil) | |
29 | + | |
30 | +(defvar gnome-supported-protocols [_WIN_CLIENT_LIST _WIN_WORKSPACE | |
31 | + _WIN_WORKSPACE_COUNT _WIN_STATE]) | |
32 | + | |
33 | +(defun gnome-set-client-list () | |
34 | + (let | |
35 | + (clients vec) | |
36 | + (mapc #'(lambda (w) | |
37 | + (when (and (windowp w) (window-mapped-p w) | |
38 | + (not (window-get w 'ignored))) | |
39 | + (setq clients (cons (window-id w) clients)))) | |
40 | + (managed-windows)) | |
41 | + (setq vec (apply 'vector clients)) | |
42 | + (set-x-property 'root '_WIN_CLIENT_LIST vec 'CARDINAL 32))) | |
43 | + | |
44 | +(defun gnome-set-workspace () | |
45 | + (let | |
46 | + ((total 0)) | |
47 | + (mapc #'(lambda (space) | |
48 | + (when (eq space ws-current-workspace) | |
49 | + (set-x-property 'root '_WIN_WORKSPACE | |
50 | + (vector total) 'CARDINAL 32)) | |
51 | + (mapc #'(lambda (w) | |
52 | + (set-x-property w '_WIN_WORKSPACE | |
53 | + (vector total) 'CARDINAL 32)) | |
54 | + (cdr space)) | |
55 | + (setq total (1+ total))) | |
56 | + ws-workspaces) | |
57 | + (set-x-property 'root '_WIN_WORKSPACE_COUNT (vector total) 'CARDINAL 32))) | |
58 | + | |
59 | +(defun gnome-set-client-state (w) | |
60 | + (let | |
61 | + ((state 0)) | |
62 | + (when (window-get w 'sticky) | |
63 | + (setq state (logior state WIN_STATE_STICKY))) | |
64 | + (set-x-property w '_WIN_STATE (vector state) 'CARDINAL 32))) | |
65 | + | |
66 | +(defun gnome-honour-client-state (w) | |
67 | + (let | |
68 | + ((state (get-x-property w '_WIN_STATE))) | |
69 | + (when (eq (car state) 'CARDINAL) | |
70 | + (unless (zerop (logand (aref (nth 2 state) 0) WIN_STATE_STICKY)) | |
71 | + (unless (window-get w 'sticky) | |
72 | + (toggle-window-sticky w)))) | |
73 | + w)) | |
74 | + | |
75 | +(defun gnome-client-message-handler (w type data) | |
76 | + (cond ((eq type '_WIN_WORKSPACE) | |
77 | + (select-workspace (aref data 0)) | |
78 | + t) | |
79 | + ((eq type '_WIN_STATE) | |
80 | + (let | |
81 | + ((mask (aref data 0)) | |
82 | + (values (aref data 1)) | |
83 | + tem) | |
84 | + (unless (zerop (logand mask WIN_STATE_STICKY)) | |
85 | + (setq tem (window-get w 'sticky)) | |
86 | + (if (or (and (not tem) | |
87 | + (not (zerop (logand values WIN_STATE_STICKY)))) | |
88 | + (and tem (zerop (logand values WIN_STATE_STICKY)))) | |
89 | + (toggle-window-sticky w)))) | |
90 | + t))) | |
91 | + | |
92 | +(defun gnome-event-proxyer () | |
93 | + (when (eq (current-event-window) 'root) | |
94 | + (let | |
95 | + ((event (event-name (current-event)))) | |
96 | + ;; XXX should check that there's no binding of the | |
97 | + ;; XXX corresponding event in the root-window-keymap or | |
98 | + ;; XXX the global-keymap | |
99 | + (when (string-match "-(Click1|Off)$" event) | |
100 | + (proxy-current-event gnome-window-id) | |
101 | + t)))) | |
102 | + | |
103 | + | |
104 | +;; initialisation | |
105 | + | |
106 | +(defun gnome-init () | |
107 | + (setq ignored-window-names (cons gnome-window-names ignored-window-names)) | |
108 | + (setq sticky-window-names (cons gnome-window-names sticky-window-names)) | |
109 | + (setq gnome-window-id (create-window 'root -200 -200 5 5)) | |
110 | + | |
111 | + (set-x-property 'root '_WIN_SUPPORTING_WM_CHECK | |
112 | + (vector gnome-window-id) 'CARDINAL 32) | |
113 | + (set-x-property gnome-window-id '_WIN_SUPPORTING_WM_CHECK | |
114 | + (vector gnome-window-id) 'CARDINAL 32) | |
115 | + | |
116 | + (set-x-property 'root '_WIN_DESKTOP_BUTTON_PROXY | |
117 | + (vector gnome-window-id) 'CARDINAL 32) | |
118 | + (set-x-property gnome-window-id '_WIN_DESKTOP_BUTTON_PROXY | |
119 | + (vector gnome-window-id) 'CARDINAL 32) | |
120 | + | |
121 | + (set-x-property 'root '_WIN_PROTOCOLS | |
122 | + gnome-supported-protocols 'ATOM 32) | |
123 | + | |
124 | + (delete-x-property 'root '_WIN_AREA) | |
125 | + (delete-x-property 'root '_WIN_AREA_COUNT) | |
126 | + (delete-x-property 'root '_WIN_WORKSPACE_NAMES) | |
127 | + | |
128 | + (add-hook 'enter-workspace-hook 'gnome-set-workspace) | |
129 | + (add-hook 'add-workspace-hook 'gnome-set-workspace) | |
130 | + (add-hook 'delete-workspace-hook 'gnome-set-workspace) | |
131 | + (add-hook 'add-to-workspace-hook 'gnome-set-workspace) | |
132 | + (add-hook 'remove-from-workspace-hook 'gnome-set-workspace) | |
133 | + | |
134 | + (add-hook 'add-window-hook 'gnome-set-client-list) | |
135 | + (add-hook 'destroy-notify-hook 'gnome-set-client-list) | |
136 | + (add-hook 'map-notify-hook 'gnome-set-client-list) | |
137 | + (add-hook 'umap-notify-hook 'gnome-set-client-list) | |
138 | + | |
139 | + (add-hook 'client-message-hook 'gnome-client-message-handler) | |
140 | + | |
141 | + (add-hook 'window-state-change-hook 'gnome-set-client-state) | |
142 | + (add-hook 'add-window-hook 'gnome-honour-client-state) | |
143 | + | |
144 | + (add-hook 'unbound-key-hook 'gnome-event-proxyer) | |
145 | + | |
146 | + (add-hook 'before-exit-hook 'gnome-exit)) | |
147 | + | |
148 | +(defun gnome-exit () | |
149 | + (destroy-window gnome-window-id) | |
150 | + (delete-x-property 'root '_WIN_SUPPORTING_WM_CHECK) | |
151 | + (delete-x-property 'root '_WIN_PROTOCOLS)) | |
152 | + | |
153 | +(unless gnome-window-id | |
154 | + (gnome-init)) |
@@ -0,0 +1,154 @@ | ||
1 | +;; gnome.jl -- minimal GNOME compliance | |
2 | +;; $Id$ | |
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 | +(provide 'gnome) | |
23 | + | |
24 | +(defconst WIN_STATE_STICKY 1) | |
25 | + | |
26 | +(defvar gnome-window-names "^(gmc|panel)$") | |
27 | + | |
28 | +(defvar gnome-window-id nil) | |
29 | + | |
30 | +(defvar gnome-supported-protocols [_WIN_CLIENT_LIST _WIN_WORKSPACE | |
31 | + _WIN_WORKSPACE_COUNT _WIN_STATE]) | |
32 | + | |
33 | +(defun gnome-set-client-list () | |
34 | + (let | |
35 | + (clients vec) | |
36 | + (mapc #'(lambda (w) | |
37 | + (when (and (windowp w) (window-mapped-p w) | |
38 | + (not (window-get w 'ignored))) | |
39 | + (setq clients (cons (window-id w) clients)))) | |
40 | + (managed-windows)) | |
41 | + (setq vec (apply 'vector clients)) | |
42 | + (set-x-property 'root '_WIN_CLIENT_LIST vec 'CARDINAL 32))) | |
43 | + | |
44 | +(defun gnome-set-workspace () | |
45 | + (let | |
46 | + ((total 0)) | |
47 | + (mapc #'(lambda (space) | |
48 | + (when (eq space ws-current-workspace) | |
49 | + (set-x-property 'root '_WIN_WORKSPACE | |
50 | + (vector total) 'CARDINAL 32)) | |
51 | + (mapc #'(lambda (w) | |
52 | + (set-x-property w '_WIN_WORKSPACE | |
53 | + (vector total) 'CARDINAL 32)) | |
54 | + (cdr space)) | |
55 | + (setq total (1+ total))) | |
56 | + ws-workspaces) | |
57 | + (set-x-property 'root '_WIN_WORKSPACE_COUNT (vector total) 'CARDINAL 32))) | |
58 | + | |
59 | +(defun gnome-set-client-state (w) | |
60 | + (let | |
61 | + ((state 0)) | |
62 | + (when (window-get w 'sticky) | |
63 | + (setq state (logior state WIN_STATE_STICKY))) | |
64 | + (set-x-property w '_WIN_STATE (vector state) 'CARDINAL 32))) | |
65 | + | |
66 | +(defun gnome-honour-client-state (w) | |
67 | + (let | |
68 | + ((state (get-x-property w '_WIN_STATE))) | |
69 | + (when (eq (car state) 'CARDINAL) | |
70 | + (unless (zerop (logand (aref (nth 2 state) 0) WIN_STATE_STICKY)) | |
71 | + (unless (window-get w 'sticky) | |
72 | + (toggle-window-sticky w)))) | |
73 | + w)) | |
74 | + | |
75 | +(defun gnome-client-message-handler (w type data) | |
76 | + (cond ((eq type '_WIN_WORKSPACE) | |
77 | + (select-workspace (aref data 0)) | |
78 | + t) | |
79 | + ((eq type '_WIN_STATE) | |
80 | + (let | |
81 | + ((mask (aref data 0)) | |
82 | + (values (aref data 1)) | |
83 | + tem) | |
84 | + (unless (zerop (logand mask WIN_STATE_STICKY)) | |
85 | + (setq tem (window-get w 'sticky)) | |
86 | + (if (or (and (not tem) | |
87 | + (not (zerop (logand values WIN_STATE_STICKY)))) | |
88 | + (and tem (zerop (logand values WIN_STATE_STICKY)))) | |
89 | + (toggle-window-sticky w)))) | |
90 | + t))) | |
91 | + | |
92 | +(defun gnome-event-proxyer () | |
93 | + (when (eq (current-event-window) 'root) | |
94 | + (let | |
95 | + ((event (event-name (current-event)))) | |
96 | + ;; XXX should check that there's no binding of the | |
97 | + ;; XXX corresponding event in the root-window-keymap or | |
98 | + ;; XXX the global-keymap | |
99 | + (when (string-match "-(Click1|Off)$" event) | |
100 | + (proxy-current-event gnome-window-id) | |
101 | + t)))) | |
102 | + | |
103 | + | |
104 | +;; initialisation | |
105 | + | |
106 | +(defun gnome-init () | |
107 | + (setq ignored-window-names (cons gnome-window-names ignored-window-names)) | |
108 | + (setq sticky-window-names (cons gnome-window-names sticky-window-names)) | |
109 | + (setq gnome-window-id (create-window 'root -200 -200 5 5)) | |
110 | + | |
111 | + (set-x-property 'root '_WIN_SUPPORTING_WM_CHECK | |
112 | + (vector gnome-window-id) 'CARDINAL 32) | |
113 | + (set-x-property gnome-window-id '_WIN_SUPPORTING_WM_CHECK | |
114 | + (vector gnome-window-id) 'CARDINAL 32) | |
115 | + | |
116 | + (set-x-property 'root '_WIN_DESKTOP_BUTTON_PROXY | |
117 | + (vector gnome-window-id) 'CARDINAL 32) | |
118 | + (set-x-property gnome-window-id '_WIN_DESKTOP_BUTTON_PROXY | |
119 | + (vector gnome-window-id) 'CARDINAL 32) | |
120 | + | |
121 | + (set-x-property 'root '_WIN_PROTOCOLS | |
122 | + gnome-supported-protocols 'ATOM 32) | |
123 | + | |
124 | + (delete-x-property 'root '_WIN_AREA) | |
125 | + (delete-x-property 'root '_WIN_AREA_COUNT) | |
126 | + (delete-x-property 'root '_WIN_WORKSPACE_NAMES) | |
127 | + | |
128 | + (add-hook 'enter-workspace-hook 'gnome-set-workspace) | |
129 | + (add-hook 'add-workspace-hook 'gnome-set-workspace) | |
130 | + (add-hook 'delete-workspace-hook 'gnome-set-workspace) | |
131 | + (add-hook 'add-to-workspace-hook 'gnome-set-workspace) | |
132 | + (add-hook 'remove-from-workspace-hook 'gnome-set-workspace) | |
133 | + | |
134 | + (add-hook 'add-window-hook 'gnome-set-client-list) | |
135 | + (add-hook 'destroy-notify-hook 'gnome-set-client-list) | |
136 | + (add-hook 'map-notify-hook 'gnome-set-client-list) | |
137 | + (add-hook 'umap-notify-hook 'gnome-set-client-list) | |
138 | + | |
139 | + (add-hook 'client-message-hook 'gnome-client-message-handler) | |
140 | + | |
141 | + (add-hook 'window-state-change-hook 'gnome-set-client-state) | |
142 | + (add-hook 'add-window-hook 'gnome-honour-client-state) | |
143 | + | |
144 | + (add-hook 'unbound-key-hook 'gnome-event-proxyer) | |
145 | + | |
146 | + (add-hook 'before-exit-hook 'gnome-exit)) | |
147 | + | |
148 | +(defun gnome-exit () | |
149 | + (destroy-window gnome-window-id) | |
150 | + (delete-x-property 'root '_WIN_SUPPORTING_WM_CHECK) | |
151 | + (delete-x-property 'root '_WIN_PROTOCOLS)) | |
152 | + | |
153 | +(unless gnome-window-id | |
154 | + (gnome-init)) |