mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-26 06:43:32 +01:00
Compare commits
1638 Commits
wmaker-0.9
...
wmaker-0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bd9e8358f | ||
|
|
9c381862b3 | ||
|
|
fec8347d27 | ||
|
|
51b342fee5 | ||
|
|
2406256d48 | ||
|
|
1e06e1e29b | ||
|
|
4005557bb3 | ||
|
|
556b0d77a1 | ||
|
|
9cb4388180 | ||
|
|
371818fe36 | ||
|
|
238b8ed3ca | ||
|
|
adebdf41c6 | ||
|
|
ef659ca1fb | ||
|
|
6b5e589d09 | ||
|
|
162cca286d | ||
|
|
9c337624cf | ||
|
|
5da2fcb7e3 | ||
|
|
c6c7652e24 | ||
|
|
b6d48420bb | ||
|
|
c92ea52271 | ||
|
|
3f306184bd | ||
|
|
58faae8ff5 | ||
|
|
6dc89b1522 | ||
|
|
d3e5e73bfc | ||
|
|
166abcd17a | ||
|
|
2abb323777 | ||
|
|
be5b58aaee | ||
|
|
fe177c6966 | ||
|
|
39e1398257 | ||
|
|
abc2d13f7d | ||
|
|
8d731b719e | ||
|
|
f5cb2f3d1c | ||
|
|
f6b9fc8870 | ||
|
|
d0bb7ae0c8 | ||
|
|
16045a6be4 | ||
|
|
9740c02403 | ||
|
|
89295b91fb | ||
|
|
029846dd14 | ||
|
|
765814e393 | ||
|
|
b75ac967d9 | ||
|
|
f90df24915 | ||
|
|
18d77de91c | ||
|
|
2925e54bc1 | ||
|
|
2c9e500b88 | ||
|
|
0d66ba5735 | ||
|
|
d31472773b | ||
|
|
30c8c1c645 | ||
|
|
1bac0c9dcb | ||
|
|
af059d408b | ||
|
|
654dcfeb28 | ||
|
|
cd29983e03 | ||
|
|
f2dea1b840 | ||
|
|
f85066a19e | ||
|
|
be5d04525d | ||
|
|
b431dcc399 | ||
|
|
ecbee34f3a | ||
|
|
35b912dd25 | ||
|
|
d90c8d5370 | ||
|
|
8e9c06627d | ||
|
|
36ac3b3344 | ||
|
|
7c142f54d0 | ||
|
|
3250826215 | ||
|
|
e5ebe0cb92 | ||
|
|
9cef8c882e | ||
|
|
1a9ece0438 | ||
|
|
f2a7f233e3 | ||
|
|
75511e2ec8 | ||
|
|
2e7ca448ae | ||
|
|
b5e2821c3e | ||
|
|
b9eb99ca73 | ||
|
|
382337c980 | ||
|
|
bb9f91a355 | ||
|
|
a772f2797d | ||
|
|
bc4084e679 | ||
|
|
eb3f0b12f8 | ||
|
|
96a6e4da1e | ||
|
|
6c3cd08dad | ||
|
|
ad07a97788 | ||
|
|
173eaee9c2 | ||
|
|
907dd97e45 | ||
|
|
6623c27f4e | ||
|
|
6505b2f81c | ||
|
|
1cd354d796 | ||
|
|
5f1e25152c | ||
|
|
3b298e8964 | ||
|
|
cb5076794a | ||
|
|
1bd9074464 | ||
|
|
f33c89e369 | ||
|
|
b323800c02 | ||
|
|
137a571fec | ||
|
|
97d281e310 | ||
|
|
9b65f55f53 | ||
|
|
266d9a2945 | ||
|
|
8eb6c82231 | ||
|
|
f4f96a8fb7 | ||
|
|
894d1c80a3 | ||
|
|
27a2259934 | ||
|
|
c54bb11ee9 | ||
|
|
a9e2923f67 | ||
|
|
dc2a991e21 | ||
|
|
4b7bb5bc5c | ||
|
|
c5744aaa8b | ||
|
|
db9f5c9658 | ||
|
|
5088b6755d | ||
|
|
35a43c9430 | ||
|
|
dda7f48407 | ||
|
|
e749c455c6 | ||
|
|
29301d9b03 | ||
|
|
5ee39b7a27 | ||
|
|
057048e09b | ||
|
|
1265873fa3 | ||
|
|
1a64ca8275 | ||
|
|
68e4ccca58 | ||
|
|
788a51c116 | ||
|
|
e750f9307e | ||
|
|
a75699faef | ||
|
|
bec0272584 | ||
|
|
32c8dc04ce | ||
|
|
4501d4c078 | ||
|
|
659519f306 | ||
|
|
c2a357fe1b | ||
|
|
3a68e974b6 | ||
|
|
fab73f47c7 | ||
|
|
9940073530 | ||
|
|
7d48855077 | ||
|
|
9f2f94a174 | ||
|
|
741243a792 | ||
|
|
bee02df72f | ||
|
|
d292c62080 | ||
|
|
dc4df6455a | ||
|
|
4894e3fe4d | ||
|
|
43972d307a | ||
|
|
7f840db1aa | ||
|
|
ca64091f05 | ||
|
|
c478a39a4a | ||
|
|
c6991fb991 | ||
|
|
bc8ccee72f | ||
|
|
9d503d2abc | ||
|
|
8c6525a2b7 | ||
|
|
1a01ac103f | ||
|
|
337a6e9228 | ||
|
|
0121d78e54 | ||
|
|
13a9ebedcf | ||
|
|
ca9dd144ae | ||
|
|
3a191af838 | ||
|
|
7a39f32816 | ||
|
|
28ce91a901 | ||
|
|
e65f527ad4 | ||
|
|
21c891e669 | ||
|
|
354ec080ad | ||
|
|
482d8d3583 | ||
|
|
6831daf427 | ||
|
|
0134720621 | ||
|
|
d65430137d | ||
|
|
47b801021c | ||
|
|
42febe3cec | ||
|
|
c86de122f9 | ||
|
|
24e223dc27 | ||
|
|
ab3057c68d | ||
|
|
18f9c49f0a | ||
|
|
22f1ae15e6 | ||
|
|
9384e3273f | ||
|
|
0db65843ff | ||
|
|
32c720dd86 | ||
|
|
677117276c | ||
|
|
1b69c49fb2 | ||
|
|
1c6d0f38ef | ||
|
|
41c943e900 | ||
|
|
05ff62caaf | ||
|
|
3ab50b65b7 | ||
|
|
0350026866 | ||
|
|
c5f103984a | ||
|
|
a72c166b6e | ||
|
|
3aae412588 | ||
|
|
6f7fa45a99 | ||
|
|
8f9b843990 | ||
|
|
5255c364b8 | ||
|
|
05f88d0aa7 | ||
|
|
978cb1f154 | ||
|
|
11497973ad | ||
|
|
9456252d51 | ||
|
|
867f221ead | ||
|
|
92ecb3c3ed | ||
|
|
aa1ee24fc0 | ||
|
|
cad716b5ef | ||
|
|
2ffda2e663 | ||
|
|
c45cab7bad | ||
|
|
7857c9c204 | ||
|
|
8e9a5b7582 | ||
|
|
e0ebcab4a7 | ||
|
|
904e8d2be4 | ||
|
|
39181154ab | ||
|
|
963b4b2b78 | ||
|
|
763491f3ff | ||
|
|
5182b32fe9 | ||
|
|
82e857a49e | ||
|
|
2cb3119e08 | ||
|
|
4b744d517b | ||
|
|
96c9ec185a | ||
|
|
3b71662011 | ||
|
|
c1031965e9 | ||
|
|
f41880cf05 | ||
|
|
b857bafc88 | ||
|
|
fb4cd10519 | ||
|
|
7b413ff07f | ||
|
|
56772f792c | ||
|
|
bb7d9b48bd | ||
|
|
ff1e6f8273 | ||
|
|
3187f95278 | ||
|
|
7783c2258b | ||
|
|
0c151a55f4 | ||
|
|
66556c421d | ||
|
|
a325624b4a | ||
|
|
d9b15a2311 | ||
|
|
0a30d42eaa | ||
|
|
8708b62cea | ||
|
|
b764a766bf | ||
|
|
ab348c6dc8 | ||
|
|
7caadb48de | ||
|
|
d6dc62649b | ||
|
|
9f8363dc14 | ||
|
|
51ad8b7dc1 | ||
|
|
546c148ac0 | ||
|
|
9ee94f8777 | ||
|
|
f5167ae12d | ||
|
|
a2328d9842 | ||
|
|
1b2e8a6491 | ||
|
|
e237ec15a0 | ||
|
|
283286e0cd | ||
|
|
64e4019614 | ||
|
|
2eaac2a5d7 | ||
|
|
f1a36b4c07 | ||
|
|
ebe7673bf6 | ||
|
|
8e0ec489a8 | ||
|
|
698cffacc5 | ||
|
|
9a0c3ab737 | ||
|
|
f17ec34cce | ||
|
|
79bad0d14c | ||
|
|
c3139e9d0c | ||
|
|
177fb22126 | ||
|
|
139382380f | ||
|
|
9ad35c440f | ||
|
|
bcc85e51c6 | ||
|
|
f2201f45cf | ||
|
|
ed072cd578 | ||
|
|
058e0a0ebd | ||
|
|
bb69682b88 | ||
|
|
b6ffe90ec4 | ||
|
|
36159c614f | ||
|
|
050cae3bd2 | ||
|
|
de1421394c | ||
|
|
8b73356c4f | ||
|
|
92b803bbdf | ||
|
|
34ca63c59f | ||
|
|
051a30f550 | ||
|
|
5c96c69cb5 | ||
|
|
aed4d78e87 | ||
|
|
01478146f9 | ||
|
|
588e04dda7 | ||
|
|
36c3f7edf4 | ||
|
|
e8feda5414 | ||
|
|
a3ce005980 | ||
|
|
ccd96d1563 | ||
|
|
78be868972 | ||
|
|
b1a67e4bc7 | ||
|
|
a7471fd82a | ||
|
|
17c93f0947 | ||
|
|
c2e4f62777 | ||
|
|
afc900a7c3 | ||
|
|
0e99f6ea3c | ||
|
|
fd5c06c056 | ||
|
|
153f5250bc | ||
|
|
dcd08355ed | ||
|
|
c13236c2e6 | ||
|
|
aa890c8868 | ||
|
|
278fdfa1db | ||
|
|
329bcca763 | ||
|
|
3a24237a8d | ||
|
|
6d5ffca076 | ||
|
|
ae0cc1427f | ||
|
|
7a10bcb51e | ||
|
|
4e70bdb5cd | ||
|
|
ecfeb8bc1c | ||
|
|
101e24b0be | ||
|
|
1644eec5ec | ||
|
|
6a7fcb98ef | ||
|
|
2c5dbae444 | ||
|
|
288943c813 | ||
|
|
2e0d2f3df9 | ||
|
|
3b97d33d0a | ||
|
|
201ea95e9d | ||
|
|
0bb96cdfe7 | ||
|
|
761f3c6e85 | ||
|
|
4989097049 | ||
|
|
3919363aa3 | ||
|
|
0e01e69205 | ||
|
|
d30b942b9e | ||
|
|
5770e53c50 | ||
|
|
0faff93cf7 | ||
|
|
895a6e97e1 | ||
|
|
23ac316d1e | ||
|
|
c16c1a32af | ||
|
|
c7e6b3a18f | ||
|
|
2658ed0fb2 | ||
|
|
26c64933e0 | ||
|
|
c7f745c353 | ||
|
|
b8b59d939d | ||
|
|
062f6dd59d | ||
|
|
ee3422dd10 | ||
|
|
73c00fac27 | ||
|
|
2a7a4d77d7 | ||
|
|
e106d88a42 | ||
|
|
1292b5a0cc | ||
|
|
64a95b73c3 | ||
|
|
da597a4b87 | ||
|
|
fbe202f49b | ||
|
|
6184c955e7 | ||
|
|
0d66173e1f | ||
|
|
54f9e2e9cc | ||
|
|
f7931ecd02 | ||
|
|
cd501741a1 | ||
|
|
e946ef3ae5 | ||
|
|
a3ee595115 | ||
|
|
32342a6428 | ||
|
|
10bc05170c | ||
|
|
12b6120f05 | ||
|
|
330fc85e56 | ||
|
|
bf64058020 | ||
|
|
f76ed31fa3 | ||
|
|
787036551f | ||
|
|
04f50a0833 | ||
|
|
f8b6871371 | ||
|
|
7491f5479b | ||
|
|
4976d48b6f | ||
|
|
9e90cebc01 | ||
|
|
fc825382d6 | ||
|
|
68a902aa2e | ||
|
|
9c8398c0dc | ||
|
|
cf719c2979 | ||
|
|
09b28b92f1 | ||
|
|
952319ae60 | ||
|
|
bd4abc5304 | ||
|
|
8d7db5d744 | ||
|
|
d2faac6333 | ||
|
|
aa24e862c4 | ||
|
|
db9e002ecf | ||
|
|
1f17fb940c | ||
|
|
667bb9191b | ||
|
|
62565b42f6 | ||
|
|
d25631016e | ||
|
|
10953b3a7e | ||
|
|
324248ecde | ||
|
|
f9c1265604 | ||
|
|
349bc2dda2 | ||
|
|
4cf72c990d | ||
|
|
59f5aeeec5 | ||
|
|
01c7390be1 | ||
|
|
be022d9623 | ||
|
|
a3b6b62049 | ||
|
|
fd47650717 | ||
|
|
c3a132215d | ||
|
|
f619546af9 | ||
|
|
3b2362662e | ||
|
|
aa99207ab4 | ||
|
|
356c242143 | ||
|
|
b66a890404 | ||
|
|
311ab6b08c | ||
|
|
a504370f3b | ||
|
|
a5ca34ccb1 | ||
|
|
1c21d946ec | ||
|
|
777bf28ab3 | ||
|
|
f8d9e4cd53 | ||
|
|
5e9ebfea76 | ||
|
|
a7663fbbcf | ||
|
|
7831acebe3 | ||
|
|
f892ce4d37 | ||
|
|
6223ed1854 | ||
|
|
e996f58da8 | ||
|
|
246068a634 | ||
|
|
415ac91afc | ||
|
|
5ed02b58be | ||
|
|
b565b48b92 | ||
|
|
e56438d2c1 | ||
|
|
8b1babc5b3 | ||
|
|
0d45deff07 | ||
|
|
34da09a0a3 | ||
|
|
21dfd29b1b | ||
|
|
ce1513f89f | ||
|
|
fb9765c0f8 | ||
|
|
def69435b1 | ||
|
|
f5f367841b | ||
|
|
e4664c6492 | ||
|
|
ca658beeb5 | ||
|
|
452fe4dc89 | ||
|
|
1f24970160 | ||
|
|
d862310c81 | ||
|
|
93767d399d | ||
|
|
6909ee0976 | ||
|
|
066d0cdef7 | ||
|
|
63037bf426 | ||
|
|
bc5985e824 | ||
|
|
dd82c46335 | ||
|
|
66f6817966 | ||
|
|
cd78f11abc | ||
|
|
2757713637 | ||
|
|
e650bf49ea | ||
|
|
9f1207342a | ||
|
|
bd58625a3f | ||
|
|
ea74fe8871 | ||
|
|
237c386fdc | ||
|
|
702764a7b0 | ||
|
|
0d8a530bc3 | ||
|
|
fed1bf4de3 | ||
|
|
58961dce72 | ||
|
|
2dd4a34961 | ||
|
|
6dba612d58 | ||
|
|
378a59f02e | ||
|
|
102e836e8e | ||
|
|
783d4b9de7 | ||
|
|
82dcc944c2 | ||
|
|
766e8ad575 | ||
|
|
df7fb014e5 | ||
|
|
86fbf8baaa | ||
|
|
3ba54ed0d6 | ||
|
|
7c02d5f1c5 | ||
|
|
bd77216edf | ||
|
|
298343f5ad | ||
|
|
f0b8be0aed | ||
|
|
6948a9f2fe | ||
|
|
fd10d4069f | ||
|
|
f45d57ff16 | ||
|
|
3857def779 | ||
|
|
c34a55ed5a | ||
|
|
9330ddf946 | ||
|
|
adb936e9f2 | ||
|
|
0118906a85 | ||
|
|
30fd8a1f75 | ||
|
|
1b2f3c0431 | ||
|
|
bec778aae2 | ||
|
|
a3264184bd | ||
|
|
821bacb5f4 | ||
|
|
3cf4ba91aa | ||
|
|
0717a0f07e | ||
|
|
c42d6822de | ||
|
|
4dadc83a4c | ||
|
|
ad2b5f0ec9 | ||
|
|
1003f89dc0 | ||
|
|
6b1b6bc02e | ||
|
|
a01c1fcb79 | ||
|
|
85cef4e2d9 | ||
|
|
5a16cb8e02 | ||
|
|
f3e3ddf4f2 | ||
|
|
b7ae1b50e2 | ||
|
|
6ad22c8672 | ||
|
|
803eb68fc4 | ||
|
|
fd869154c6 | ||
|
|
9c6e71ead0 | ||
|
|
3b85fca43c | ||
|
|
18059fb1c7 | ||
|
|
d9832e578f | ||
|
|
f751cc6a50 | ||
|
|
24ce829f7f | ||
|
|
a79c0e76d0 | ||
|
|
6dcfdd072b | ||
|
|
3995130b79 | ||
|
|
81aa311c42 | ||
|
|
c3c2d8d7f1 | ||
|
|
b6423a7b4f | ||
|
|
6d65daf1be | ||
|
|
97ecb7b613 | ||
|
|
f53797f9ef | ||
|
|
45799efa02 | ||
|
|
bf6bc79d37 | ||
|
|
36cd5e6641 | ||
|
|
40231016f9 | ||
|
|
4d74b18987 | ||
|
|
2e64831fb6 | ||
|
|
0de3e590ce | ||
|
|
6987d4aa40 | ||
|
|
40e1ea08b8 | ||
|
|
d27ce03780 | ||
|
|
014bc52531 | ||
|
|
2103fe390b | ||
|
|
29ac626494 | ||
|
|
4a7daf2322 | ||
|
|
074092f319 | ||
|
|
e86b8dcb2f | ||
|
|
9c252988f8 | ||
|
|
f0c5073600 | ||
|
|
c610b8d7ce | ||
|
|
e5ae684d02 | ||
|
|
9e103a46e9 | ||
|
|
f60e65001b | ||
|
|
4ac65ab260 | ||
|
|
29ccfbbf20 | ||
|
|
1d09b9fdcd | ||
|
|
e0697c9162 | ||
|
|
6366aeef3a | ||
|
|
cc01ca5c6b | ||
|
|
3250144b94 | ||
|
|
d6fe27af15 | ||
|
|
45bfc1d1c5 | ||
|
|
ec91b9f68e | ||
|
|
e2ce62eb5b | ||
|
|
379f7022bd | ||
|
|
ecfb2dc902 | ||
|
|
32cebb1305 | ||
|
|
b48b3370e2 | ||
|
|
2c20413831 | ||
|
|
af6c4ec37f | ||
|
|
577506cbd2 | ||
|
|
3892f3220a | ||
|
|
70c6494c46 | ||
|
|
28bbf705eb | ||
|
|
3957f01293 | ||
|
|
709e7654bc | ||
|
|
7da7203d91 | ||
|
|
e8843b3fed | ||
|
|
38e088314a | ||
|
|
267496c54c | ||
|
|
278bf5ee7e | ||
|
|
453a0226ad | ||
|
|
4e4d75c55e | ||
|
|
82aea844d0 | ||
|
|
d1f9b80171 | ||
|
|
f363292d3c | ||
|
|
2bdeb693f6 | ||
|
|
cd5e004127 | ||
|
|
a268327a48 | ||
|
|
ca9c57f695 | ||
|
|
75654cf43c | ||
|
|
5fcf15f0d5 | ||
|
|
60a4121a92 | ||
|
|
91529ff1a7 | ||
|
|
496cb58cea | ||
|
|
74cd836e48 | ||
|
|
3803ae6493 | ||
|
|
401a37d924 | ||
|
|
3966cd2fc2 | ||
|
|
527f5f1730 | ||
|
|
7bf8efef54 | ||
|
|
e9764aab71 | ||
|
|
95ee539d6d | ||
|
|
f68ec6c913 | ||
|
|
a6410d61e5 | ||
|
|
c9b816de75 | ||
|
|
c7ab9d34f7 | ||
|
|
9b5db31d95 | ||
|
|
f0c1dc9fc3 | ||
|
|
69b6848187 | ||
|
|
062ff99fac | ||
|
|
1c4ad880d1 | ||
|
|
a092d8848a | ||
|
|
f429055b4f | ||
|
|
a61f6c2484 | ||
|
|
39ecbc1084 | ||
|
|
0382dd5dd7 | ||
|
|
5d2fb4ec97 | ||
|
|
ebac6e7c83 | ||
|
|
1e76a78604 | ||
|
|
528955c447 | ||
|
|
6dda67bc51 | ||
|
|
34089d7661 | ||
|
|
3c2fc82b6e | ||
|
|
7889c50c36 | ||
|
|
587a37dc60 | ||
|
|
70909f4d5d | ||
|
|
ae91ee4b0a | ||
|
|
a6b1833b41 | ||
|
|
4c7d0025dd | ||
|
|
420fcb2819 | ||
|
|
ed115929f3 | ||
|
|
5455a585dc | ||
|
|
ed80a9bf5c | ||
|
|
9ededf6cb2 | ||
|
|
20a695f70f | ||
|
|
8aca1b816f | ||
|
|
157209a035 | ||
|
|
583235bb36 | ||
|
|
68cdba0e29 | ||
|
|
dd8d320619 | ||
|
|
89a6476a33 | ||
|
|
bf9e025289 | ||
|
|
936a85ce25 | ||
|
|
05f6a30716 | ||
|
|
c2188d0793 | ||
|
|
3eb01800e8 | ||
|
|
e66afb6e18 | ||
|
|
d025625df0 | ||
|
|
e20f45ef3c | ||
|
|
33343bcd59 | ||
|
|
f10ec42ba8 | ||
|
|
5a65dbeb3d | ||
|
|
549cefc47b | ||
|
|
d517d5cac0 | ||
|
|
4b89104aca | ||
|
|
140249ad0c | ||
|
|
8a58c8b568 | ||
|
|
5c2a1ae1a1 | ||
|
|
367d1f938d | ||
|
|
e2d816c7a2 | ||
|
|
bab90b2168 | ||
|
|
708bc27e3f | ||
|
|
a622197faa | ||
|
|
a3281b1e89 | ||
|
|
017e6a84a0 | ||
|
|
d01c2a596f | ||
|
|
b5101fc8ae | ||
|
|
eb14bca73b | ||
|
|
5d03c455fc | ||
|
|
d44aa97243 | ||
|
|
f2824647f3 | ||
|
|
1da498ff3b | ||
|
|
0e41122680 | ||
|
|
dcfd7a4b5e | ||
|
|
8ef38e9910 | ||
|
|
80a59696e5 | ||
|
|
8238e4681a | ||
|
|
90d24a1648 | ||
|
|
7f6699ffca | ||
|
|
e17a197bc4 | ||
|
|
f73ccae798 | ||
|
|
7c320447fb | ||
|
|
7c98f7cfc4 | ||
|
|
fc262124cd | ||
|
|
664ab79add | ||
|
|
7e424bf232 | ||
|
|
e7c2a3dc69 | ||
|
|
c15da2e406 | ||
|
|
35f2b667db | ||
|
|
f29fba2c83 | ||
|
|
c253c5a7c7 | ||
|
|
441145cfc0 | ||
|
|
aa5be46e94 | ||
|
|
1a8316d4c9 | ||
|
|
52b8aabccc | ||
|
|
05a3eadd65 | ||
|
|
a4395c5764 | ||
|
|
591dc5cd4d | ||
|
|
fb3d9e65a6 | ||
|
|
28e6bde782 | ||
|
|
75a0beffeb | ||
|
|
72108875aa | ||
|
|
6616323088 | ||
|
|
a1119f8dd3 | ||
|
|
c89e8df33f | ||
|
|
e7c8ac76ea | ||
|
|
af403073f0 | ||
|
|
5a5216ffb9 | ||
|
|
bcee010082 | ||
|
|
ea19294b70 | ||
|
|
0004d38ef8 | ||
|
|
8517f3dcef | ||
|
|
022421e879 | ||
|
|
9ab6368b33 | ||
|
|
033e3eaa54 | ||
|
|
a18fd7cd69 | ||
|
|
cd1c55d63c | ||
|
|
fd02f5f083 | ||
|
|
f386e34d29 | ||
|
|
32ecd4ee58 | ||
|
|
98e3c7e347 | ||
|
|
74c17bffae | ||
|
|
d40fa69b92 | ||
|
|
ea9d3e643f | ||
|
|
bbf84eb0e8 | ||
|
|
ac89706859 | ||
|
|
602fbc9ee4 | ||
|
|
9a895dcda5 | ||
|
|
9e4253f670 | ||
|
|
0bf6297a32 | ||
|
|
8f7d4b7751 | ||
|
|
d1e1c13fa3 | ||
|
|
225c99a6ca | ||
|
|
268ead4eca | ||
|
|
883cda48e3 | ||
|
|
cacc04d4a2 | ||
|
|
94777b9715 | ||
|
|
8cb6a78726 | ||
|
|
6fb2b13ec7 | ||
|
|
90675a6f04 | ||
|
|
c9937f6f6a | ||
|
|
29a5267485 | ||
|
|
41da1b30db | ||
|
|
25b5ca2566 | ||
|
|
729886ef52 | ||
|
|
f863dafef1 | ||
|
|
311255a646 | ||
|
|
529ee0bd21 | ||
|
|
878a57d7b2 | ||
|
|
36bed6a77e | ||
|
|
3c628d50d2 | ||
|
|
5e004d5f11 | ||
|
|
cf5fdca63d | ||
|
|
e14e6b3da8 | ||
|
|
707ce34a5e | ||
|
|
95a73e2783 | ||
|
|
9fae35fbc4 | ||
|
|
8b6ff01d39 | ||
|
|
f93f847b33 | ||
|
|
525ab89d01 | ||
|
|
5a6e1653ac | ||
|
|
d24cbc79ee | ||
|
|
6f44be87fc | ||
|
|
4b44020488 | ||
|
|
9548c42b71 | ||
|
|
cc02023e3e | ||
|
|
be95172c95 | ||
|
|
dfe7e255b2 | ||
|
|
46c8d6d2bf | ||
|
|
6aa43d356c | ||
|
|
fa27215fcc | ||
|
|
8cb744739c | ||
|
|
dee9c457cf | ||
|
|
3d0ed99043 | ||
|
|
88d16d03b9 | ||
|
|
256c8a498e | ||
|
|
544bc8e7a7 | ||
|
|
883ed8ac9a | ||
|
|
ca86f5594d | ||
|
|
2c0a449f00 | ||
|
|
b3ca57674d | ||
|
|
4093d24625 | ||
|
|
c24499f6ad | ||
|
|
c088aba057 | ||
|
|
389a0a252c | ||
|
|
6fe23037ef | ||
|
|
b9e8bbbdc7 | ||
|
|
052efedd93 | ||
|
|
a401dcbdf6 | ||
|
|
124442a811 | ||
|
|
ae7235c2df | ||
|
|
cfdf1e92fe | ||
|
|
63219247c6 | ||
|
|
d25fde4173 | ||
|
|
9b27217b53 | ||
|
|
cd5382cedf | ||
|
|
0da2b6e928 | ||
|
|
e47413eefd | ||
|
|
17f1eb6568 | ||
|
|
2affd6d484 | ||
|
|
dee30d06ac | ||
|
|
c3a2438fac | ||
|
|
69ff0d72cc | ||
|
|
4222204abc | ||
|
|
25d083a85f | ||
|
|
bb48c35522 | ||
|
|
42a4d95e5b | ||
|
|
309d5c0d1a | ||
|
|
53d31c7bbd | ||
|
|
066de301df | ||
|
|
c21ae6b580 | ||
|
|
cc69d2aae3 | ||
|
|
a657fafcce | ||
|
|
a23e42639a | ||
|
|
fd7b117346 | ||
|
|
ada7161d8d | ||
|
|
70c9208e40 | ||
|
|
97d7c32184 | ||
|
|
d7fe9a5bcd | ||
|
|
74aa65abeb | ||
|
|
b9caaa8729 | ||
|
|
73d75fa848 | ||
|
|
cba94da2cf | ||
|
|
68208a01a0 | ||
|
|
b71f2c30fd | ||
|
|
c058af6d35 | ||
|
|
0b74ae4194 | ||
|
|
085224973a | ||
|
|
3b8c36510f | ||
|
|
37677b2ec0 | ||
|
|
a2de2c34ee | ||
|
|
0706471a10 | ||
|
|
0d441c3b98 | ||
|
|
18437e0309 | ||
|
|
3d47016788 | ||
|
|
b02a12b8c1 | ||
|
|
f6f72acbde | ||
|
|
ff52ef3996 | ||
|
|
0a461416e3 | ||
|
|
c164db31bf | ||
|
|
e206f471fe | ||
|
|
99e5a7a9eb | ||
|
|
bf2f942138 | ||
|
|
914d4e06ef | ||
|
|
eae7ef6c59 | ||
|
|
ea7ef65b19 | ||
|
|
e393c6b61a | ||
|
|
db6605932b | ||
|
|
4111f336d0 | ||
|
|
8b6e96ab74 | ||
|
|
2165faec5d | ||
|
|
3f2c87fb06 | ||
|
|
5bfac9036d | ||
|
|
0a06ddd9e3 | ||
|
|
4b4c5513ce | ||
|
|
522d84b0ef | ||
|
|
faa74a14b1 | ||
|
|
c7e3666e62 | ||
|
|
df601267e6 | ||
|
|
4e193c172b | ||
|
|
3cd382bccc | ||
|
|
27d55b3e33 | ||
|
|
2a025b2edd | ||
|
|
806784e194 | ||
|
|
5a3cab3cef | ||
|
|
2eb1107e20 | ||
|
|
d8b92c979e | ||
|
|
78ff715d39 | ||
|
|
5956d71d77 | ||
|
|
ead0fb2e4b | ||
|
|
7746fe7c5a | ||
|
|
5dcd31acbe | ||
|
|
92d52523c4 | ||
|
|
eb51844fa8 | ||
|
|
2dc97e4f15 | ||
|
|
141b046c33 | ||
|
|
49922831e8 | ||
|
|
f846b7cdd3 | ||
|
|
cc1503a2f0 | ||
|
|
a950d0e247 | ||
|
|
e192302bd7 | ||
|
|
33ebded4f9 | ||
|
|
a3078a5095 | ||
|
|
f38e5e40c8 | ||
|
|
658597b889 | ||
|
|
c3a1c76b44 | ||
|
|
6bc48464e9 | ||
|
|
b657f15344 | ||
|
|
fd9bb936aa | ||
|
|
cca2814afe | ||
|
|
c97bf19079 | ||
|
|
6bfb175b19 | ||
|
|
7246fa2d4c | ||
|
|
529276a395 | ||
|
|
314f1dc907 | ||
|
|
19326554cc | ||
|
|
3e83e9d5ae | ||
|
|
ceedad4231 | ||
|
|
c79eaa59b2 | ||
|
|
8349a018f0 | ||
|
|
2ff138f311 | ||
|
|
0106b2a4e9 | ||
|
|
0493974cbc | ||
|
|
d5e5ae6ca0 | ||
|
|
df4141236b | ||
|
|
5728b6436d | ||
|
|
3d0223ded4 | ||
|
|
156d8ebfa5 | ||
|
|
280e1e099d | ||
|
|
c3024542ad | ||
|
|
700f8cc706 | ||
|
|
67f73e9d54 | ||
|
|
930e59dd31 | ||
|
|
45c5145ff2 | ||
|
|
0bd7bcd434 | ||
|
|
206fe5e821 | ||
|
|
b8025ee899 | ||
|
|
f3d36b1c26 | ||
|
|
ff9f942c47 | ||
|
|
4f4b7655de | ||
|
|
399d476126 | ||
|
|
948dde0abd | ||
|
|
f9847da97c | ||
|
|
362915a7b3 | ||
|
|
ac4362a88f | ||
|
|
8b6f884d36 | ||
|
|
027a720c17 | ||
|
|
e71f78f4fe | ||
|
|
a6d3317a9a | ||
|
|
235114993d | ||
|
|
404e4a7a03 | ||
|
|
653b099ea2 | ||
|
|
824255b1ae | ||
|
|
a2d2f76bd0 | ||
|
|
baecab089c | ||
|
|
e357e94896 | ||
|
|
952f6bfb1c | ||
|
|
e3db102591 | ||
|
|
41af9ca07f | ||
|
|
727b25d947 | ||
|
|
97f74548ef | ||
|
|
adfb761021 | ||
|
|
ff49393bfa | ||
|
|
236c1c5f70 | ||
|
|
da5e2f8a0d | ||
|
|
e988386013 | ||
|
|
a089647d27 | ||
|
|
3c7ca36d5b | ||
|
|
5c0b851cc6 | ||
|
|
0e995bbf6e | ||
|
|
5d8dfa4764 | ||
|
|
b796928504 | ||
|
|
9ab2b642a6 | ||
|
|
39a5f3da0b | ||
|
|
5fe4160025 | ||
|
|
b2e7620868 | ||
|
|
9ad278ddf8 | ||
|
|
ac52d4de65 | ||
|
|
9f694b66b5 | ||
|
|
1fb452ea95 | ||
|
|
bef6555b6a | ||
|
|
fae81bf518 | ||
|
|
448a68c6d2 | ||
|
|
af41673dbf | ||
|
|
2e7b7b7e02 | ||
|
|
35a2ed24ec | ||
|
|
bb0c1f3035 | ||
|
|
9e86868373 | ||
|
|
fccde3b7e6 | ||
|
|
44c9ee694d | ||
|
|
829830c010 | ||
|
|
6d08aa22d8 | ||
|
|
43c3526d21 | ||
|
|
139f912e61 | ||
|
|
4658f4f9a1 | ||
|
|
9b792369cb | ||
|
|
aaa4517df7 | ||
|
|
88a82ab8df | ||
|
|
ed9482b626 | ||
|
|
7d74648fc3 | ||
|
|
42cccb2313 | ||
|
|
19f0998cd1 | ||
|
|
f0e8b76c03 | ||
|
|
39fa6d9e2c | ||
|
|
76e8a8f963 | ||
|
|
f5d845cfad | ||
|
|
d6db53af0b | ||
|
|
fd07a6bb36 | ||
|
|
347d6f9fda | ||
|
|
81eefca4ef | ||
|
|
8edb9dad81 | ||
|
|
46183e8215 | ||
|
|
c978b3fc2b | ||
|
|
a13eb4e920 | ||
|
|
dd94b98b81 | ||
|
|
c815449e68 | ||
|
|
fc9e453de2 | ||
|
|
02feb72fdc | ||
|
|
42cb1291e3 | ||
|
|
7facc79c0c | ||
|
|
5795bb5638 | ||
|
|
6bdc1318c1 | ||
|
|
ebbc5c48ba | ||
|
|
da4e4128b3 | ||
|
|
254c00ba6f | ||
|
|
a5eb4910e4 | ||
|
|
b6ced4fa5d | ||
|
|
0e671d3683 | ||
|
|
6110610f5e | ||
|
|
cd7edbcc11 | ||
|
|
f97b997f38 | ||
|
|
a1e80f5411 | ||
|
|
4700e5f0b2 | ||
|
|
2be53e92e6 | ||
|
|
96800cdc16 | ||
|
|
d53b43608a | ||
|
|
def62293e9 | ||
|
|
089c99941f | ||
|
|
ee450acb30 | ||
|
|
50765fab84 | ||
|
|
fbd9c12cd0 | ||
|
|
e3b9026532 | ||
|
|
1fbce07805 | ||
|
|
bc0700e016 | ||
|
|
a08adcd283 | ||
|
|
f8158d047a | ||
|
|
de68ee6f1b | ||
|
|
f44944c18d | ||
|
|
7f022f1c8f | ||
|
|
cedf620543 | ||
|
|
9d3d34599f | ||
|
|
1a594de74e | ||
|
|
f8291de919 | ||
|
|
7ef416f8ac | ||
|
|
c61e5bfeb8 | ||
|
|
32fe186c54 | ||
|
|
910a851f35 | ||
|
|
fc5c0fe1a4 | ||
|
|
21a5f41c08 | ||
|
|
202b9eadc5 | ||
|
|
e8074ae1cd | ||
|
|
fbab31b798 | ||
|
|
dd6a54bba5 | ||
|
|
bd3fb21441 | ||
|
|
2e7b039558 | ||
|
|
cab8bbc495 | ||
|
|
01ea1fa8b4 | ||
|
|
1c1697dc40 | ||
|
|
423b78811a | ||
|
|
e498a8bd79 | ||
|
|
d356baebea | ||
|
|
3eb8c9d498 | ||
|
|
284d3b56fe | ||
|
|
968ebdedf2 | ||
|
|
efcad8497e | ||
|
|
97f68b5865 | ||
|
|
883600748e | ||
|
|
9e2d1b3ecf | ||
|
|
4a4775f076 | ||
|
|
33328d997e | ||
|
|
6bc550d91b | ||
|
|
cbff60297e | ||
|
|
971f611bad | ||
|
|
70d8ad515b | ||
|
|
b5df97db95 | ||
|
|
72546aab81 | ||
|
|
cc30444dda | ||
|
|
aee0ad45f2 | ||
|
|
e6e3e1aa49 | ||
|
|
753f44c4b7 | ||
|
|
2755b1e45d | ||
|
|
975d4becf1 | ||
|
|
95c68d2b10 | ||
|
|
1bcfb89cd1 | ||
|
|
e83eeb15cc | ||
|
|
f25464c792 | ||
|
|
8311058a16 | ||
|
|
4e2ee27bfa | ||
|
|
39fdb451ba | ||
|
|
244b63e6b5 | ||
|
|
1b0ed30b9b | ||
|
|
0db76b822d | ||
|
|
21fb6db616 | ||
|
|
219315aa58 | ||
|
|
ad373ef0dd | ||
|
|
761fd37e51 | ||
|
|
afe2e5d9d6 | ||
|
|
b3afad67ff | ||
|
|
bca60318ca | ||
|
|
0601e0f002 | ||
|
|
391a8edb9c | ||
|
|
517cd6a8be | ||
|
|
ba786015b7 | ||
|
|
aaf934eb2f | ||
|
|
056a290a7d | ||
|
|
51c9f2a852 | ||
|
|
3d01e5c879 | ||
|
|
8352c9ef60 | ||
|
|
528d97b597 | ||
|
|
42a78ee73f | ||
|
|
aab9028fc2 | ||
|
|
1a0e665e58 | ||
|
|
1bec2efba0 | ||
|
|
72f359be44 | ||
|
|
cf9f0ec67e | ||
|
|
3adc058421 | ||
|
|
ebe9a27e8d | ||
|
|
6cbdebb84b | ||
|
|
9079b904d6 | ||
|
|
f550333474 | ||
|
|
fe3cbb0dc4 | ||
|
|
a3c99bddc8 | ||
|
|
4f4ea569a0 | ||
|
|
e819818eeb | ||
|
|
99aad55425 | ||
|
|
d3cb286428 | ||
|
|
882edc04d2 | ||
|
|
a68b130a9d | ||
|
|
f4479dae30 | ||
|
|
a97699c513 | ||
|
|
e46f2b3e79 | ||
|
|
9e8e4625ab | ||
|
|
799134f59b | ||
|
|
2075881f2d | ||
|
|
f2585dc1f7 | ||
|
|
a568686b39 | ||
|
|
0173fe896d | ||
|
|
7d11577a82 | ||
|
|
4f07f5e1dd | ||
|
|
a4e247d052 | ||
|
|
07a0639c93 | ||
|
|
854ae58305 | ||
|
|
87ce0de15f | ||
|
|
51a54ba2e2 | ||
|
|
119507d541 | ||
|
|
b08b182147 | ||
|
|
6368bde7e5 | ||
|
|
4954d4df23 | ||
|
|
558fc5f0d3 | ||
|
|
393a917a4f | ||
|
|
8d7c725b7b | ||
|
|
8f724f65aa | ||
|
|
3bc2535968 | ||
|
|
85b4dba721 | ||
|
|
f6b7cb39b9 | ||
|
|
37466f4927 | ||
|
|
e1453087f5 | ||
|
|
e9d4930657 | ||
|
|
b618febb2c | ||
|
|
73eaddfa3a | ||
|
|
a2c297e6a7 | ||
|
|
31b5ee1a5f | ||
|
|
3bc48f0893 | ||
|
|
cbe2f4e61a | ||
|
|
c33455fdb4 | ||
|
|
edeca34be9 | ||
|
|
3ae34b958c | ||
|
|
809c536879 | ||
|
|
69d2e51876 | ||
|
|
171eca8b64 | ||
|
|
3c2b3792a6 | ||
|
|
215a57077c | ||
|
|
fd07e032df | ||
|
|
918d0b5af1 | ||
|
|
3ed409cbd0 | ||
|
|
e06b3005e8 | ||
|
|
e4d0ea5373 | ||
|
|
7e4a3ae57f | ||
|
|
89bf263410 | ||
|
|
7a180b0ef8 | ||
|
|
14643408e8 | ||
|
|
6bf5f947a9 | ||
|
|
ac8a493ed9 | ||
|
|
5ef03b2a3a | ||
|
|
385dbdb3d6 | ||
|
|
8b049dec73 | ||
|
|
0f26c43371 | ||
|
|
6ae01b9d90 | ||
|
|
7013467da4 | ||
|
|
01907f9983 | ||
|
|
a9e136ec41 | ||
|
|
ace761c690 | ||
|
|
484bb08316 | ||
|
|
9a67c55fa0 | ||
|
|
744490c0b2 | ||
|
|
0e80a23c51 | ||
|
|
d0a48d9914 | ||
|
|
625e762f9a | ||
|
|
8bc9a1dd19 | ||
|
|
93687024ce | ||
|
|
9fa427bc7f | ||
|
|
d435ea7468 | ||
|
|
f43aa47d68 | ||
|
|
b949a1c464 | ||
|
|
c2975ab510 | ||
|
|
9777b14fb7 | ||
|
|
8ba6118c2e | ||
|
|
25c67fc7cc | ||
|
|
a06b0673d8 | ||
|
|
d9296ff9a4 | ||
|
|
e01d14abe4 | ||
|
|
e499f31a4e | ||
|
|
8fe18de926 | ||
|
|
e95f886e06 | ||
|
|
6c2a5f19f1 | ||
|
|
c126f1d08f | ||
|
|
dce16306bc | ||
|
|
f6fefbd9b6 | ||
|
|
5fa8b979b9 | ||
|
|
af857e8b95 | ||
|
|
cbbc1fc9ac | ||
|
|
18de6b8c96 | ||
|
|
7490b14bf0 | ||
|
|
a750fe03f4 | ||
|
|
8fd4821155 | ||
|
|
f65b99e615 | ||
|
|
43c7abe79f | ||
|
|
7feb59251e | ||
|
|
c82138eab9 | ||
|
|
077a2eaa71 | ||
|
|
751b6e7938 | ||
|
|
bbaa42240f | ||
|
|
7036890288 | ||
|
|
7c14c0b14a | ||
|
|
85f31104cd | ||
|
|
1b2745fad8 | ||
|
|
5ff0272508 | ||
|
|
1060f49366 | ||
|
|
614eb4c9e8 | ||
|
|
76eab97209 | ||
|
|
b5ed9841bc | ||
|
|
3f8bba8064 | ||
|
|
4f853ce3b6 | ||
|
|
a23b72c32a | ||
|
|
5377ec8fba | ||
|
|
0451160f7d | ||
|
|
a396f3bd66 | ||
|
|
125cba8f82 | ||
|
|
ee1f13da45 | ||
|
|
7aff3b6e44 | ||
|
|
5eebb8bc3c | ||
|
|
51134d2438 | ||
|
|
ba5fceb21c | ||
|
|
3c408fa179 | ||
|
|
8b68042b30 | ||
|
|
210bcec4de | ||
|
|
9a2732a4c3 | ||
|
|
668cac00f6 | ||
|
|
7cc64627cc | ||
|
|
b16181143c | ||
|
|
4b894021d9 | ||
|
|
cdf457d2d5 | ||
|
|
3490c8bd30 | ||
|
|
70abda81d0 | ||
|
|
c37046e6a9 | ||
|
|
09e6fd1526 | ||
|
|
060ba6a9cd | ||
|
|
f6080ffd56 | ||
|
|
ffda48bd61 | ||
|
|
7859e2d59f | ||
|
|
14863cd3b1 | ||
|
|
300d02bf54 | ||
|
|
1420e44bb1 | ||
|
|
de9fcef214 | ||
|
|
843dc889f4 | ||
|
|
b4cb488241 | ||
|
|
d8eea6a155 | ||
|
|
b305eb84fb | ||
|
|
88c6a51547 | ||
|
|
d59dacbccd | ||
|
|
f4890b17e6 | ||
|
|
660b61a182 | ||
|
|
752d084609 | ||
|
|
94a0c7b42f | ||
|
|
8594c39a0b | ||
|
|
34293e072a | ||
|
|
1f21919809 | ||
|
|
c5f5e0b9c0 | ||
|
|
24d7457ec6 | ||
|
|
4de3d69934 | ||
|
|
be8a5d4a45 | ||
|
|
ff6a6ebbaa | ||
|
|
219e7fcafa | ||
|
|
f38aa69e40 | ||
|
|
8ca05fd4be | ||
|
|
f206c15fea | ||
|
|
4478f21b7f | ||
|
|
d2853c8584 | ||
|
|
51236308d2 | ||
|
|
02de600ecd | ||
|
|
a8813b2eae | ||
|
|
0d32a6d3b7 | ||
|
|
553464d965 | ||
|
|
a71a604ab1 | ||
|
|
cf2301a048 | ||
|
|
ce9b375b8d | ||
|
|
b8f118e9a5 | ||
|
|
ae8937e152 | ||
|
|
091c9c366d | ||
|
|
3c847aa52b | ||
|
|
758f4c80d1 | ||
|
|
b4b07c2cac | ||
|
|
4a9d561ce4 | ||
|
|
2bc0c1124a | ||
|
|
6483b198d3 | ||
|
|
b042d2be8e | ||
|
|
80814b7dba | ||
|
|
e7f3e62d69 | ||
|
|
e10e7d08fa | ||
|
|
844bf1b4e3 | ||
|
|
7374fe5984 | ||
|
|
e18eba6ae7 | ||
|
|
35ed80648b | ||
|
|
09c56140a2 | ||
|
|
ece6d213aa | ||
|
|
5b24997446 | ||
|
|
8f63bdafcd | ||
|
|
8e0ef4766d | ||
|
|
1194889c95 | ||
|
|
ee69b6207a | ||
|
|
5afe745c01 | ||
|
|
9318a7f428 | ||
|
|
2ba8d2eec9 | ||
|
|
790917a8e7 | ||
|
|
8d4819c7ea | ||
|
|
392ab2607d | ||
|
|
a257e16593 | ||
|
|
17cc7c3c77 | ||
|
|
cc629f342c | ||
|
|
afebdb50fa | ||
|
|
f41db5b5be | ||
|
|
ca1c29cd98 | ||
|
|
e9d42e5121 | ||
|
|
aeb4cb8a79 | ||
|
|
bfd1abd32b | ||
|
|
7e5b8e412f | ||
|
|
44edeea804 | ||
|
|
d872b73881 | ||
|
|
27dcdd3798 | ||
|
|
ce04eabec6 | ||
|
|
368e7e3e8f | ||
|
|
5c8eb580b3 | ||
|
|
48044feb29 | ||
|
|
2031a25869 | ||
|
|
be05b0f01e | ||
|
|
b17077ede0 | ||
|
|
be065e3bf4 | ||
|
|
894bf4e292 | ||
|
|
c201e1612c | ||
|
|
f6b7178542 | ||
|
|
ce32e2b5e0 | ||
|
|
6269d3a66f | ||
|
|
3289b6c772 | ||
|
|
0baac21e95 | ||
|
|
5423e8318e | ||
|
|
c68597b6e8 | ||
|
|
a78cff4e7f | ||
|
|
3b289c4a8c | ||
|
|
eae99ee833 | ||
|
|
baef1646ac | ||
|
|
df8649cf54 | ||
|
|
492206fe6c | ||
|
|
8dc7c5f554 | ||
|
|
15f74cfb10 | ||
|
|
3751b587eb | ||
|
|
a1867f2473 | ||
|
|
014ced4794 | ||
|
|
d7fd103528 | ||
|
|
493a263a7d | ||
|
|
7f59c4dfa3 | ||
|
|
ac8da4a8f0 | ||
|
|
1150f741ec | ||
|
|
fef3ee5742 | ||
|
|
dcbfb467de | ||
|
|
c8c613074e | ||
|
|
c20bfe9737 | ||
|
|
7b74111259 | ||
|
|
de48a9b1f5 | ||
|
|
dadb78b835 | ||
|
|
ef2349bc69 | ||
|
|
930a3922d5 | ||
|
|
6300d3462b | ||
|
|
9215d2d9dd | ||
|
|
879d84d883 | ||
|
|
c238d8417f | ||
|
|
3f27b998a7 | ||
|
|
abb8c62fe0 | ||
|
|
c396e8ca4f | ||
|
|
ffb803a0ba | ||
|
|
e75b1b6d70 | ||
|
|
68bd644b0d | ||
|
|
4ddc2a5a0a | ||
|
|
12d16d92e7 | ||
|
|
b575955263 | ||
|
|
f7dc986ed1 | ||
|
|
0350b8445a | ||
|
|
4041278f48 | ||
|
|
62f4eff7ae | ||
|
|
4247ac9f82 | ||
|
|
6002ce0cbc | ||
|
|
22978af5a6 | ||
|
|
37829a7c60 | ||
|
|
518b3b4480 | ||
|
|
554f9dea25 | ||
|
|
7a38ea85b9 | ||
|
|
bbe55ba242 | ||
|
|
39426bde35 | ||
|
|
c960ae622e | ||
|
|
607beee479 | ||
|
|
abda319c16 | ||
|
|
65aa3ae9c8 | ||
|
|
ec7506e5e5 | ||
|
|
12de2f319e | ||
|
|
bbf3635590 | ||
|
|
3be81b0243 | ||
|
|
35bcfa6a02 | ||
|
|
6082f2d243 | ||
|
|
6b5cfc887a | ||
|
|
e4fedca2bb | ||
|
|
c183d9107e | ||
|
|
fb91e5d67a | ||
|
|
08f990a946 | ||
|
|
241e66ff0a | ||
|
|
79e1bb53d3 | ||
|
|
c90484324c | ||
|
|
1b666f53e4 | ||
|
|
b59575e709 | ||
|
|
3f8248f534 | ||
|
|
68a55be998 | ||
|
|
68f70da310 | ||
|
|
c165beeb4b | ||
|
|
daad5ed828 | ||
|
|
2e91634921 | ||
|
|
81aaed2bf8 | ||
|
|
e7a46d5cdf | ||
|
|
7dc767ae78 | ||
|
|
859338fd83 | ||
|
|
1bc042c172 | ||
|
|
6bf7994520 | ||
|
|
444de5e6b6 | ||
|
|
4078af654b | ||
|
|
7b9b7de172 | ||
|
|
0c2d2c69b9 | ||
|
|
13ba5d5f5b | ||
|
|
828cb7a147 | ||
|
|
71aa4f2884 | ||
|
|
ea4645bc09 | ||
|
|
28cbda550a | ||
|
|
7d905787d2 | ||
|
|
0e12a076aa | ||
|
|
0f5c36a67e | ||
|
|
1f2b9999b9 | ||
|
|
55959b4f7e | ||
|
|
67a8a82670 | ||
|
|
83774951b7 | ||
|
|
298338c111 | ||
|
|
ab9c85a11d | ||
|
|
294ea56d84 | ||
|
|
eee6551aff | ||
|
|
1a0c8afa80 | ||
|
|
61a96e79c4 | ||
|
|
ef7c45df53 | ||
|
|
c7868fa405 | ||
|
|
118a93808a | ||
|
|
9dadfe7a68 | ||
|
|
d51bbe6626 | ||
|
|
5f02b1b5f4 | ||
|
|
9f7aaa8aed | ||
|
|
66bd06b5d5 | ||
|
|
43b1914f37 | ||
|
|
2a52ce3544 | ||
|
|
2ad40e0734 | ||
|
|
5178465bb6 | ||
|
|
cef4fbb422 | ||
|
|
9911ecd985 | ||
|
|
109e504262 | ||
|
|
63e4338284 | ||
|
|
8018da8149 | ||
|
|
034339320f | ||
|
|
de881d9c03 | ||
|
|
e1d5ce7a51 | ||
|
|
b4b25fdf6a | ||
|
|
badecc244b | ||
|
|
833128385f | ||
|
|
9a2dbc5a5f | ||
|
|
939f46b870 | ||
|
|
ee569220df | ||
|
|
baac5ead1e | ||
|
|
8d0020cf9a | ||
|
|
4688e1b568 | ||
|
|
484b19ba89 | ||
|
|
0db4d7885b | ||
|
|
744ccb85d2 | ||
|
|
e37db24efe | ||
|
|
3473a11787 | ||
|
|
6d6d53a350 | ||
|
|
51885365a6 | ||
|
|
0049b5bc8c | ||
|
|
2901a153ce | ||
|
|
6b791d8a89 | ||
|
|
1f3adb0ea5 | ||
|
|
ad853b386e | ||
|
|
1861880239 | ||
|
|
6367bf5234 | ||
|
|
708cf2d2a2 | ||
|
|
6723aa55aa | ||
|
|
e54f763f14 | ||
|
|
914d984422 | ||
|
|
ba4c4bd61a | ||
|
|
585307ba39 | ||
|
|
f1980ce1f1 | ||
|
|
23a790da1d | ||
|
|
7793bb9d67 | ||
|
|
366cb8367b | ||
|
|
422fedbc4b | ||
|
|
c89cb142ba | ||
|
|
72dfe4aa89 | ||
|
|
4e90a87b14 | ||
|
|
f55eef413f | ||
|
|
643e49f190 | ||
|
|
8a2a0b6adc | ||
|
|
0deb198b10 | ||
|
|
b6689a0108 | ||
|
|
7ef8178d2a | ||
|
|
b3e817305d | ||
|
|
a2133e8e2f | ||
|
|
efa31f30b2 | ||
|
|
024e2f5299 | ||
|
|
629b118767 | ||
|
|
d8ef209c9a | ||
|
|
2ba803ad98 | ||
|
|
33c9e87692 | ||
|
|
0a5febcada | ||
|
|
41fdb79e28 | ||
|
|
d74a90d1bf | ||
|
|
fe8ab024af | ||
|
|
6c6e832c52 | ||
|
|
13c2d523e2 | ||
|
|
e7cc15df71 | ||
|
|
3db3f179d1 | ||
|
|
5fa41941fe | ||
|
|
4c4d50c813 | ||
|
|
8c5a7b287a | ||
|
|
347fbcc87a | ||
|
|
a2cb317f11 | ||
|
|
391d5de79e | ||
|
|
ad4358c605 | ||
|
|
2203b229b0 | ||
|
|
4932433b95 | ||
|
|
f9792a042a | ||
|
|
96b9b22cb2 | ||
|
|
1f1eb393f8 | ||
|
|
bf88570a5f | ||
|
|
a3246cfe3b | ||
|
|
c5f027d811 | ||
|
|
af8cec15e3 | ||
|
|
15e37ff942 | ||
|
|
347e804bb6 | ||
|
|
a063338175 | ||
|
|
781b663341 | ||
|
|
09140a82b9 | ||
|
|
87161c5e0c | ||
|
|
cda27758bc | ||
|
|
b014ef2770 | ||
|
|
e9309e1e39 | ||
|
|
06d3360224 | ||
|
|
9d6728d3e7 | ||
|
|
2765bec3e4 | ||
|
|
7df49cce14 | ||
|
|
21eb8456ba | ||
|
|
bc3995bf6b | ||
|
|
7f457fa275 | ||
|
|
484bdbe7d4 | ||
|
|
ef2f5a6f29 | ||
|
|
12b6be768e | ||
|
|
6a0120f014 | ||
|
|
0a0c2391de | ||
|
|
7a86f48f73 | ||
|
|
3953f53680 | ||
|
|
92eff967a7 | ||
|
|
eaca92db50 | ||
|
|
1a85719971 | ||
|
|
5979162878 | ||
|
|
306165775e | ||
|
|
c7f2a189c4 | ||
|
|
ca2c1f900d | ||
|
|
18408fff93 | ||
|
|
5c46f48898 | ||
|
|
567279b962 | ||
|
|
1a27b34160 | ||
|
|
9789cf3154 | ||
|
|
513a509096 | ||
|
|
f6645ac564 | ||
|
|
cf0f7d68d5 | ||
|
|
3106292f4b | ||
|
|
e42586c712 | ||
|
|
0a47a19b3e | ||
|
|
e4fcd515fe | ||
|
|
4bce3e3805 | ||
|
|
cbd13dd95f | ||
|
|
18c7a20136 | ||
|
|
816fee1b68 | ||
|
|
5b93254d0f | ||
|
|
62bf6d17b5 | ||
|
|
8efc490361 | ||
|
|
5f5b1df7d2 | ||
|
|
88ab8b74b4 | ||
|
|
2ccc8e4a79 | ||
|
|
8490e31fde | ||
|
|
05720d9707 | ||
|
|
f8dd3dc49e | ||
|
|
c04a2caeab | ||
|
|
cf62d1591f | ||
|
|
7857f297ea | ||
|
|
b37e065252 | ||
|
|
d7183d33b4 | ||
|
|
2ed9c12ee5 | ||
|
|
229b6984de | ||
|
|
a1f35d7f5b | ||
|
|
34be9d7816 | ||
|
|
9af6316d1d | ||
|
|
6924454836 | ||
|
|
328251c68a | ||
|
|
2f87d01a41 | ||
|
|
22730876e4 | ||
|
|
be08535ab4 | ||
|
|
108127f0b5 | ||
|
|
6d75291e1d | ||
|
|
ca60620f50 | ||
|
|
a9aeefbe70 | ||
|
|
d6c134f420 | ||
|
|
442e3876c6 | ||
|
|
19f110d26e | ||
|
|
3f6ae395ce | ||
|
|
ba027149bd | ||
|
|
f893728d2d | ||
|
|
01dddf00c8 | ||
|
|
fe736e849c | ||
|
|
874b0fadf5 | ||
|
|
31f16389f6 | ||
|
|
2706f7217c | ||
|
|
e522ca734d | ||
|
|
3a0eb643d9 | ||
|
|
f79379c090 | ||
|
|
001bc28037 | ||
|
|
203eba8937 | ||
|
|
d27e43e6b5 | ||
|
|
1db15a3543 | ||
|
|
c970c94f82 | ||
|
|
570df8316d | ||
|
|
21b5df494b | ||
|
|
e113ec10c9 | ||
|
|
95a576bd62 | ||
|
|
3f7110b120 | ||
|
|
f9bb2a428a | ||
|
|
333dbf5418 | ||
|
|
a9238c99b9 | ||
|
|
4a041b6f0a | ||
|
|
688a56e8ab | ||
|
|
59fc927dc9 | ||
|
|
066af13b5c | ||
|
|
e2d8cbe238 | ||
|
|
cb31fd374c | ||
|
|
f4fd88b8a9 | ||
|
|
f36ab39680 | ||
|
|
0a32ecf1fe | ||
|
|
9baff1363c | ||
|
|
f18567db9a | ||
|
|
be0d694dc2 | ||
|
|
6310e40d47 | ||
|
|
7a84127a27 | ||
|
|
288853e44f | ||
|
|
09a8911b6f | ||
|
|
ceeca912cd | ||
|
|
7a3b139dcb | ||
|
|
e2b6a85e80 | ||
|
|
38074e7bd5 | ||
|
|
f516213bf3 | ||
|
|
bbc52564d0 | ||
|
|
3e9aae7a91 | ||
|
|
9fa4fbef91 | ||
|
|
f21ce5768b | ||
|
|
b487d56452 | ||
|
|
d316260395 | ||
|
|
6b08fc9e78 | ||
|
|
0c469de04f | ||
|
|
d680e6e580 | ||
|
|
3c323e1e9a | ||
|
|
06f59b9928 | ||
|
|
4339e446e4 | ||
|
|
72689513a3 | ||
|
|
56d8568787 | ||
|
|
c91bb1ba13 | ||
|
|
e4800e84d0 | ||
|
|
ee28b0257a | ||
|
|
722c82c8ab | ||
|
|
2061c30758 |
@@ -1,8 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
aclocal.m4
|
|
||||||
configure config.log config.cache config.guess config.status config.sub
|
|
||||||
libtool ltconfig ltmain.sh
|
|
||||||
autom4te.cache
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
update
|
|
||||||
WindowMaker*.tar.gz
|
|
||||||
94
.gitignore
vendored
Normal file
94
.gitignore
vendored
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# These files are generated by the AutoTools
|
||||||
|
*Makefile
|
||||||
|
*Makefile.in
|
||||||
|
.deps/
|
||||||
|
.libs/
|
||||||
|
INSTALL
|
||||||
|
aclocal.m4
|
||||||
|
autom4te.cache*
|
||||||
|
compile
|
||||||
|
config-paths.h
|
||||||
|
config.guess
|
||||||
|
config.h
|
||||||
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
depcomp
|
||||||
|
install-sh
|
||||||
|
libtool
|
||||||
|
ltmain.sh
|
||||||
|
missing
|
||||||
|
mkinstalldirs
|
||||||
|
stamp-h1
|
||||||
|
m4/ld-version-script.m4
|
||||||
|
m4/libtool.m4
|
||||||
|
m4/ltoptions.m4
|
||||||
|
m4/ltsugar.m4
|
||||||
|
m4/ltversion.m4
|
||||||
|
m4/lt~obsolete.m4
|
||||||
|
|
||||||
|
src/wconfig.h
|
||||||
|
|
||||||
|
# These files are compilation stuff
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
*.la
|
||||||
|
*.a
|
||||||
|
|
||||||
|
# These are compilation results
|
||||||
|
src/wmaker
|
||||||
|
test/wtest
|
||||||
|
|
||||||
|
util/convertfonts
|
||||||
|
util/geticonset
|
||||||
|
util/getstyle
|
||||||
|
util/seticons
|
||||||
|
util/setstyle
|
||||||
|
util/wdread
|
||||||
|
util/wdwrite
|
||||||
|
util/wmagnify
|
||||||
|
util/wmaker.inst
|
||||||
|
util/wmgenmenu
|
||||||
|
util/wmiv
|
||||||
|
util/wmmenugen
|
||||||
|
util/wmsetbg
|
||||||
|
util/wmsetup
|
||||||
|
util/wxcopy
|
||||||
|
util/wxpaste
|
||||||
|
|
||||||
|
wrlib/get-wraster-flags
|
||||||
|
wrlib/tests/testdraw
|
||||||
|
wrlib/tests/testgrad
|
||||||
|
wrlib/tests/testrot
|
||||||
|
wrlib/tests/view
|
||||||
|
|
||||||
|
WINGs/Examples/colorpick
|
||||||
|
WINGs/Examples/connect
|
||||||
|
WINGs/Examples/fontl
|
||||||
|
WINGs/Examples/puzzle
|
||||||
|
WINGs/Examples/server
|
||||||
|
WINGs/Extras/test
|
||||||
|
WINGs/Tests/testmywidget
|
||||||
|
WINGs/Tests/wmfile
|
||||||
|
WINGs/Tests/wmquery
|
||||||
|
WINGs/Tests/wtest
|
||||||
|
WINGs/get-wings-flags
|
||||||
|
WINGs/get-wutil-flags
|
||||||
|
|
||||||
|
WPrefs.app/WPrefs
|
||||||
|
|
||||||
|
# These files are generated from make rules
|
||||||
|
wrlib/wrlib.pc
|
||||||
|
WINGs/WINGs.pc
|
||||||
|
WINGs/WUtil.pc
|
||||||
|
|
||||||
|
WindowMaker/Defaults/WMRootMenu
|
||||||
|
WindowMaker/Defaults/WMState
|
||||||
|
WindowMaker/Defaults/WMWindowAttributes
|
||||||
|
WindowMaker/Defaults/WindowMaker
|
||||||
|
WindowMaker/IconSets/Default.iconset
|
||||||
|
|
||||||
|
# Some text editors generate backup files
|
||||||
|
*~
|
||||||
12
AUTHORS
12
AUTHORS
@@ -7,7 +7,7 @@ patches, bug fixes and other stuff for Window Maker:
|
|||||||
ABE Shige <sabe@ibm.net>
|
ABE Shige <sabe@ibm.net>
|
||||||
I18N support, diagonal and vertical gradient, cosmetic additions to
|
I18N support, diagonal and vertical gradient, cosmetic additions to
|
||||||
move/resize frames, window list menu, side swapping and other things for dock,
|
move/resize frames, window list menu, side swapping and other things for dock,
|
||||||
japanese local, icon arrangement fix, remember current workspace after
|
Japanese local, icon arrangement fix, remember current workspace after
|
||||||
restart, dock bug fixes
|
restart, dock bug fixes
|
||||||
|
|
||||||
Andrea Arcangeli <arcangeli@mbox.queen.it>
|
Andrea Arcangeli <arcangeli@mbox.queen.it>
|
||||||
@@ -103,9 +103,9 @@ Bradley M Keryan <keryan@andrew.cmu.edu>
|
|||||||
EMACS/keypad like cursor movement for WINGs textfield
|
EMACS/keypad like cursor movement for WINGs textfield
|
||||||
|
|
||||||
Jim Knoble <jmknoble@pobox.com>
|
Jim Knoble <jmknoble@pobox.com>
|
||||||
made autoarrange icons a runtime option, SHADOW_RESIZEBAR c-time option,
|
made autoarrange icons a run-time option, SHADOW_RESIZEBAR c-time option,
|
||||||
no workspace switch to the same workspace, dashed icon selection,
|
no workspace switch to the same workspace, dashed icon selection,
|
||||||
misclellaneous bug fixes, definable cursors, --no-polling command line option.
|
miscellaneous bug fixes, definable cursors, --no-polling command line option.
|
||||||
|
|
||||||
The JED Text Editor <xjed@windowmaker.info>
|
The JED Text Editor <xjed@windowmaker.info>
|
||||||
Project maintainer
|
Project maintainer
|
||||||
@@ -135,7 +135,7 @@ Tim Malone <mrgone@eskimo.com>
|
|||||||
bug fix, jpeg bug fix
|
bug fix, jpeg bug fix
|
||||||
|
|
||||||
MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp>
|
MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp>
|
||||||
I18N bug fixes and japanese locale, wsetfont script
|
I18N bug fixes and Japanese locale, wsetfont script
|
||||||
|
|
||||||
Brian Alexander Martin <brian@goober.wireless.ucsc.edu>
|
Brian Alexander Martin <brian@goober.wireless.ucsc.edu>
|
||||||
PIPE_MENU
|
PIPE_MENU
|
||||||
@@ -171,7 +171,7 @@ Toby Sargeant <?>
|
|||||||
menu format converter
|
menu format converter
|
||||||
|
|
||||||
Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
|
Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
|
||||||
SCO portability, german locale, autoconf enhancements
|
SCO portability, German locale, autoconf enhancements
|
||||||
|
|
||||||
Christopher Seawood <cls@seawood.org>
|
Christopher Seawood <cls@seawood.org>
|
||||||
REDUCE_APPICON/single-icon
|
REDUCE_APPICON/single-icon
|
||||||
@@ -197,7 +197,7 @@ many fixes and enhancements for move, resize and window placement code.
|
|||||||
Marco van Hylckama Vlieg <fatal@global.uibk.ac.at>
|
Marco van Hylckama Vlieg <fatal@global.uibk.ac.at>
|
||||||
house icon for WINGs file dialogs, defaultAppIcon and Clip xpm tchX.tiff
|
house icon for WINGs file dialogs, defaultAppIcon and Clip xpm tchX.tiff
|
||||||
Plus the following icons:
|
Plus the following icons:
|
||||||
DefaultAppIcon.tiff GNUterm.tiff clip2.tiff defaultterm.tiff draw.tiff
|
GNUterm.tiff clip2.tiff defaultterm.tiff draw.tiff
|
||||||
linuxterm.tiff mixer.tiff notepad.tiff pdf.tiff ps.tiff real.tiff sgiterm.tiff
|
linuxterm.tiff mixer.tiff notepad.tiff pdf.tiff ps.tiff real.tiff sgiterm.tiff
|
||||||
sound.tiff staroffice2.tiff timer.tiff wilber.tiff write.tiff xdvi.tiff
|
sound.tiff staroffice2.tiff timer.tiff wilber.tiff write.tiff xdvi.tiff
|
||||||
xv.tiff
|
xv.tiff
|
||||||
|
|||||||
16
BUGFORM
16
BUGFORM
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
|
|
||||||
If you find a bug please fill this form and send it to
|
If you find a bug please fill this form and send it to
|
||||||
developers@windowmaker.info Please, USE THIS FORM!!!
|
wmaker-dev@lists.windowmaker.org Please, USE THIS FORM!!!
|
||||||
|
|
||||||
You can also report a bug in the WWW bug tracker at
|
You can also report a bug in the WWW bug tracker at
|
||||||
http://windowmaker.info/cgi-bin/bugs or by sending this report
|
http://bugs.windowmaker.org/projects/wmaker/issues or by sending this report to
|
||||||
to bugs@windowmaker.info
|
bugs@windowmaker.org
|
||||||
|
|
||||||
|
|
||||||
0. Before reporting this bug I already:
|
0. Before reporting this bug I already:
|
||||||
@@ -20,7 +20,7 @@ to bugs@windowmaker.info
|
|||||||
[ ] could not compile
|
[ ] could not compile
|
||||||
[ ] crashed
|
[ ] crashed
|
||||||
[ ] configuration option does not work
|
[ ] configuration option does not work
|
||||||
[ ] weird behaviour
|
[ ] weird behavior
|
||||||
[ ] cosmetic
|
[ ] cosmetic
|
||||||
[ ] some problem with WPrefs
|
[ ] some problem with WPrefs
|
||||||
[ ] others: ...................................
|
[ ] others: ...................................
|
||||||
@@ -42,13 +42,13 @@ to bugs@windowmaker.info
|
|||||||
5. Changes to the src/wconfig.h file:
|
5. Changes to the src/wconfig.h file:
|
||||||
|
|
||||||
|
|
||||||
6. The error occured during:
|
6. The error occurred during:
|
||||||
[ ] configuration
|
[ ] configuration
|
||||||
[ ] compilation
|
[ ] compilation
|
||||||
[ ] startup
|
[ ] start-up
|
||||||
[ ] use
|
[ ] use
|
||||||
|
|
||||||
7. Changes made to the configuration files, if the error ocurred during use:
|
7. Changes made to the configuration files, if the error occurred during use:
|
||||||
|
|
||||||
|
|
||||||
8. Error messages output:
|
8. Error messages output:
|
||||||
@@ -70,6 +70,6 @@ WindowMaker Version (run "wmaker -version"): .........................
|
|||||||
|
|
||||||
11. backtrace if the bug made Window Maker crash. PLEASE SEND THE
|
11. backtrace if the bug made Window Maker crash. PLEASE SEND THE
|
||||||
BACKTRACE. Your bug report might be of not much use without one.
|
BACKTRACE. Your bug report might be of not much use without one.
|
||||||
strace/truss outputs are usually not usefull for crashes, so you can
|
strace/truss outputs are usually not useful for crashes, so you can
|
||||||
skip it. The README file has instructions to make one.
|
skip it. The README file has instructions to make one.
|
||||||
|
|
||||||
|
|||||||
31
COPYING
31
COPYING
@@ -1,9 +1,8 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
|||||||
General Public License applies to most of the Free Software
|
General Public License applies to most of the Free Software
|
||||||
Foundation's software and to any other program whose authors commit to
|
Foundation's software and to any other program whose authors commit to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
@@ -56,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
|||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
|||||||
License. (Exception: if the Program itself is interactive but
|
License. (Exception: if the Program itself is interactive but
|
||||||
does not normally print such an announcement, your work based on
|
does not normally print such an announcement, your work based on
|
||||||
the Program is not required to print an announcement.)
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
These requirements apply to the modified work as a whole. If
|
||||||
identifiable sections of that work are not derived from the Program,
|
identifiable sections of that work are not derived from the Program,
|
||||||
and can be reasonably considered independent and separate works in
|
and can be reasonably considered independent and separate works in
|
||||||
@@ -169,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
|||||||
access to copy the source code from the same place counts as
|
access to copy the source code from the same place counts as
|
||||||
distribution of the source code, even though third parties are not
|
distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
except as expressly provided under this License. Any attempt
|
except as expressly provided under this License. Any attempt
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
@@ -226,7 +225,7 @@ impose that choice.
|
|||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
This section is intended to make thoroughly clear what is believed to
|
||||||
be a consequence of the rest of this License.
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
original copyright holder who places the Program under this License
|
original copyright holder who places the Program under this License
|
||||||
@@ -279,8 +278,8 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|||||||
POSSIBILITY OF SUCH DAMAGES.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
Appendix: How to Apply These Terms to Your New Programs
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
possible use to the public, the best way to achieve this is to make it
|
possible use to the public, the best way to achieve this is to make it
|
||||||
@@ -292,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
|||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) 19yy <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -304,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
|||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
consider it more useful to permit linking proprietary applications with the
|
||||||
library. If this is what you want to do, use the GNU Library General
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|||||||
91
COPYING.OPL
91
COPYING.OPL
@@ -1,91 +0,0 @@
|
|||||||
|
|
||||||
OpenContent License (OPL)
|
|
||||||
Version 1.0, July 14, 1998.
|
|
||||||
|
|
||||||
This document outlines the principles underlying the OpenContent
|
|
||||||
(OC) movement and may be redistributed provided it remains
|
|
||||||
unaltered. For legal purposes, this document is the license under
|
|
||||||
which OpenContent is made available for use.
|
|
||||||
|
|
||||||
The original version of this document may be found at
|
|
||||||
http://www.opencontent.org/opl.shtml
|
|
||||||
|
|
||||||
LICENSE
|
|
||||||
|
|
||||||
Terms and Conditions for Copying, Distributing, and Modifying
|
|
||||||
|
|
||||||
Items other than copying, distributing, and modifying the Content
|
|
||||||
with which this license was distributed (such as using, etc.) are
|
|
||||||
outside the scope of this license.
|
|
||||||
|
|
||||||
1. You may copy and distribute exact replicas of the OpenContent
|
|
||||||
(OC) as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any
|
|
||||||
warranty; and give any other recipients of the OC a copy of this
|
|
||||||
License along with the OC. You may at your option charge a fee for
|
|
||||||
the media and/or handling involved in creating a unique copy of the
|
|
||||||
OC for use offline, you may at your option offer instructional
|
|
||||||
support for the OC in exchange for a fee, or you may at your option
|
|
||||||
offer warranty in exchange for a fee. You may not charge a fee for
|
|
||||||
the OC itself. You may not charge a fee for the sole service of
|
|
||||||
providing access to and/or use of the OC via a network (e.g. the
|
|
||||||
Internet), whether it be via the world wide web, FTP, or any other
|
|
||||||
method.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the OpenContent or any
|
|
||||||
portion of it, thus forming works based on the Content, and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified content to carry prominent notices
|
|
||||||
stating that you changed it, the exact nature and content of the
|
|
||||||
changes, and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the OC or any part
|
|
||||||
thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License, unless otherwise permitted
|
|
||||||
under applicable Fair Use law.
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the OC, and
|
|
||||||
can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work
|
|
||||||
based on the OC, the distribution of the whole must be on the terms
|
|
||||||
of this License, whose permissions for other licensees extend to
|
|
||||||
the entire whole, and thus to each and every part regardless of who
|
|
||||||
wrote it. Exceptions are made to this requirement to release
|
|
||||||
modified works free of charge under this license only in compliance
|
|
||||||
with Fair Use law where applicable.
|
|
||||||
|
|
||||||
3. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to copy,
|
|
||||||
distribute or modify the OC. These actions are prohibited by law if
|
|
||||||
you do not accept this License. Therefore, by distributing or
|
|
||||||
translating the OC, or by deriving works herefrom, you indicate
|
|
||||||
your acceptance of this License to do so, and all its terms and
|
|
||||||
conditions for copying, distributing or translating the OC.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
4. BECAUSE THE OPENCONTENT (OC) IS LICENSED FREE OF CHARGE, THERE
|
|
||||||
IS NO WARRANTY FOR THE OC, TO THE EXTENT PERMITTED BY APPLICABLE
|
|
||||||
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
|
|
||||||
AND/OR OTHER PARTIES PROVIDE THE OC "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. THE ENTIRE RISK OF USE OF THE OC IS WITH YOU.
|
|
||||||
SHOULD THE OC PROVE FAULTY, INACCURATE, OR OTHERWISE UNACCEPTABLE
|
|
||||||
YOU ASSUME THE COST OF ALL NECESSARY REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
5. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
|
||||||
MIRROR AND/OR REDISTRIBUTE THE OC AS PERMITTED ABOVE, BE LIABLE TO
|
|
||||||
YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
|
||||||
THE OC, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
171
FAQ
171
FAQ
@@ -18,7 +18,7 @@ Summary of Contents:
|
|||||||
1.5 What is an App Icon?
|
1.5 What is an App Icon?
|
||||||
1.6 How can I get a question added to the FAQ?
|
1.6 How can I get a question added to the FAQ?
|
||||||
1.7 How do I report bugs?
|
1.7 How do I report bugs?
|
||||||
1.8 Is there an anomymous cvs server?
|
1.8 Is there an anonymous cvs server?
|
||||||
|
|
||||||
2 - Installation
|
2 - Installation
|
||||||
2.1 Where can I get proplist.h?
|
2.1 Where can I get proplist.h?
|
||||||
@@ -34,12 +34,12 @@ Summary of Contents:
|
|||||||
2.10 Do I need to rerun wmaker.inst with every new version of
|
2.10 Do I need to rerun wmaker.inst with every new version of
|
||||||
Window Maker?
|
Window Maker?
|
||||||
2.11 When I install Window Maker, I've used wmaker.inst correctly
|
2.11 When I install Window Maker, I've used wmaker.inst correctly
|
||||||
and I only get aroot menu with xterm and exit. How do I fix this?
|
and I only get a root menu with xterm and exit. How do I fix this?
|
||||||
2.12 How do I get Window Maker to use more than 16 colors on my
|
2.12 How do I get Window Maker to use more than 16 colors on my
|
||||||
SGI Indy Workstation?
|
SGI Indy Workstation?
|
||||||
2.13 Using WindowMaker with Solaris 2.6 CDE
|
2.13 Using WindowMaker with Solaris 2.6 CDE
|
||||||
2.14 How do I switch CDE's windowmanager to use Window Maker?
|
2.14 How do I switch CDE's window manager to use Window Maker?
|
||||||
2.15 When I run wmaker it quits complaing about something
|
2.15 When I run wmaker it quits complaining about something
|
||||||
"__register_frame_info".
|
"__register_frame_info".
|
||||||
2.16 When I run wmaker it complains about something like library is
|
2.16 When I run wmaker it complains about something like library is
|
||||||
62, caller expects 61
|
62, caller expects 61
|
||||||
@@ -51,7 +51,7 @@ Summary of Contents:
|
|||||||
3.3 How do I "dock" AppIcons on the Clip?
|
3.3 How do I "dock" AppIcons on the Clip?
|
||||||
3.4 Why do none of my Key Bindings work in Window Maker 0.1x.x
|
3.4 Why do none of my Key Bindings work in Window Maker 0.1x.x
|
||||||
3.5 How do I rename workspaces?
|
3.5 How do I rename workspaces?
|
||||||
3.6 How can I resize a window if the window is larger than my currect
|
3.6 How can I resize a window if the window is larger than my current
|
||||||
desktop?
|
desktop?
|
||||||
3.7 How do I "undock" AppIcons?
|
3.7 How do I "undock" AppIcons?
|
||||||
3.8 I docked an application but when I run it the button is permanently
|
3.8 I docked an application but when I run it the button is permanently
|
||||||
@@ -59,7 +59,7 @@ Summary of Contents:
|
|||||||
3.9 When I run wmaker it complains about not being able to load any
|
3.9 When I run wmaker it complains about not being able to load any
|
||||||
fonts.
|
fonts.
|
||||||
3.10 When I set the root background with wmsetbg by hand it works,
|
3.10 When I set the root background with wmsetbg by hand it works,
|
||||||
but when I do that from the configuration files it doesnt!
|
but when I do that from the configuration files it doesn't!
|
||||||
|
|
||||||
4 - Configuration
|
4 - Configuration
|
||||||
4.1 What are those files inside my ~/GNUstep directory?
|
4.1 What are those files inside my ~/GNUstep directory?
|
||||||
@@ -79,7 +79,7 @@ Summary of Contents:
|
|||||||
4.11 How do I get my Minimize Icon to look like the triangle I see in
|
4.11 How do I get my Minimize Icon to look like the triangle I see in
|
||||||
screenshots?
|
screenshots?
|
||||||
4.12 How do I get superfluous bells and whistles working?
|
4.12 How do I get superfluous bells and whistles working?
|
||||||
4.13 How do I get my oldstyle back?
|
4.13 How do I get my old style back?
|
||||||
4.14 How do I get the window menu with only a two button mouse?
|
4.14 How do I get the window menu with only a two button mouse?
|
||||||
4.15 How do I edit my root menu?
|
4.15 How do I edit my root menu?
|
||||||
4.16 How can I set dock/clip to use single click to launch applications,
|
4.16 How can I set dock/clip to use single click to launch applications,
|
||||||
@@ -101,7 +101,7 @@ Summary of Contents:
|
|||||||
example)
|
example)
|
||||||
5.11 Window Maker breaks scilab
|
5.11 Window Maker breaks scilab
|
||||||
5.12 Netscape icons show up in black and white
|
5.12 Netscape icons show up in black and white
|
||||||
5.13 Snow flakes from xsnow don't acumulate on titlebars!
|
5.13 Snow flakes from xsnow don't accumulate on title bars!
|
||||||
5.14 I'm using RedHat 6.0 and Netscape dies without reason.
|
5.14 I'm using RedHat 6.0 and Netscape dies without reason.
|
||||||
|
|
||||||
6 - Programming
|
6 - Programming
|
||||||
@@ -143,13 +143,12 @@ here for example screenshots.
|
|||||||
1.2 Where can I get Window Maker?
|
1.2 Where can I get Window Maker?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The official site to get new developmental versions from is
|
The official site to get new developmental versions from is
|
||||||
ftp://ftp.windowmaker.info/pub/beta/srcs/.
|
http://windowmaker.org/pub/source/beta/
|
||||||
|
|
||||||
NOTE: Also see http://wm.current.nu/downloads.html for the latest
|
The mercurial repository is available at https://hg.windowmaker.org/wmaker
|
||||||
Stable and Development versions.
|
|
||||||
|
|
||||||
The development versions are usually very stable themselves, so if you
|
The development versions are usually very stable themselves, so if you
|
||||||
want to have all the newest features, you can rather safetly go with the
|
want to have all the newest features, you can rather safely go with the
|
||||||
development versions. Just remember to save any unsaved data before
|
development versions. Just remember to save any unsaved data before
|
||||||
you go playing around with the config files. Also, remember they are
|
you go playing around with the config files. Also, remember they are
|
||||||
developmental versions, so your mileage may vary, don't get angry if they
|
developmental versions, so your mileage may vary, don't get angry if they
|
||||||
@@ -158,76 +157,50 @@ crash.
|
|||||||
|
|
||||||
1.3 Where are the mailing list archives?
|
1.3 Where are the mailing list archives?
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
Phillip Smith from Netplex, our wonderful provider of windowmaker.info, has
|
Please read the information on the web pages at http://lists.windowmaker.org/
|
||||||
set up some new lists from the domain. Please read the information on the
|
for information on how to subscribe, the posting guidelines, and how to access
|
||||||
web pages at http://www.windowmaker.info/lists.html for information on how
|
the web archives.
|
||||||
to subscribe, the posting guidelines, and how to access the web archives.
|
|
||||||
|
|
||||||
Many thanks to Ed Orcutt who hosted the original lists from his own machine
|
|
||||||
for many years and Caldera who graciously allowed Ed to continue hosting
|
|
||||||
from them when he moved to his new position with them. Ed provided a very
|
|
||||||
valuable service for many years and we are sad to see him go.
|
|
||||||
|
|
||||||
|
|
||||||
1.4 Where is more documentation on configuring Window Maker?
|
1.4 Where is more documentation on configuring Window Maker?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Besides the mailing list archives, there are nice documents in
|
Besides the mailing list archives, there are nice documents in
|
||||||
ftp://ftp.windowmaker.info/pub/docs/, at
|
http://windowmaker.org/documentation.php
|
||||||
http://wm.current.nu/downloads.html on my download page and at
|
|
||||||
http://wm.current.nu/user-guide/index.htm in the online user-guide.
|
|
||||||
|
|
||||||
|
|
||||||
1.5 What is an appicon?
|
1.5 What is an appicon?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
An appicon is the icon (without the tiny titlebar a minimized application icon
|
An appicon is the icon (without the tiny title bar a minimized application icon
|
||||||
has) produced by most applications that initially is in the bottom left corner
|
has) produced by most applications that initially is in the bottom left corner
|
||||||
of the screen while an application is running. For an example, run xterm and
|
of the screen while an application is running. For an example, run xterm and
|
||||||
notice the icon in the corner. (Make sure that you use xterm and not a
|
notice the icon in the corner.
|
||||||
default older rxvt because older versions of rxvt do not properly set their
|
|
||||||
window attributes.)
|
|
||||||
|
|
||||||
|
|
||||||
1.6. How can I get a question added to the FAQ?
|
1.6. How can I get a question added to the FAQ?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Right now, the only method is to mail Chris Green <sprout@dok.org> or
|
Ask on the mailing list, or send your request to faqs@windowmaker.org
|
||||||
myself <largo@current.nu> the question or post it on the Window Maker
|
|
||||||
Mailing list, and see if enough people have the same problem.
|
|
||||||
|
|
||||||
If you are a developer and would like to be able to edit the official FAQ on
|
Other avenues are the Window Maker wiki
|
||||||
Chris's site, let him know at <sprout@dok.org>
|
http://bugs.windowmaker.org/projects/wmaker/wiki
|
||||||
|
and the forums
|
||||||
He is currently pondering writing a front end that allows everyone to add
|
http://bugs.windowmaker.org/projects/wmaker/boards
|
||||||
entries and only require a moderator approval before being posted.
|
|
||||||
|
|
||||||
|
|
||||||
1.7. How do I report bugs?
|
1.7. How do I report bugs?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
You can look at the BUGFORM file in your tarball of Window Maker.
|
You can look at the BUGFORM file in your tarball of Window Maker.
|
||||||
Alternatively, you can use the Window Maker Bugtracker at
|
Alternatively, you can use the Window Maker Bugtracker at
|
||||||
http://windowmaker.info/cgi-bin/bugs.
|
http://bugs.windowmaker.org/projects/wmaker/issues
|
||||||
|
|
||||||
|
|
||||||
1.8. Is there an anomymous cvs server?
|
1.8. Is there a public source code repository?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Yes there is. To check out from cvs, first
|
Yes there is. To check out from mercurial use:
|
||||||
|
hg clone http://hg.windowmaker.org/wmaker wmaker
|
||||||
|
|
||||||
export CVSROOT=":pserver:anoncvs@cvs.net-community.com:/gnustep"
|
To update your source tree, cd to the wmaker directory and type
|
||||||
cvs login
|
hg pull
|
||||||
|
|
||||||
'anoncvs' is the password.
|
|
||||||
|
|
||||||
Then issue the command. "wm" is the name of the module.
|
|
||||||
|
|
||||||
cvs -z3 checkout -d WindowMaker wm
|
|
||||||
|
|
||||||
|
|
||||||
To update your source tree, cd to the WindowMaker directory and type
|
|
||||||
|
|
||||||
cvs -z3 update
|
|
||||||
|
|
||||||
inside the WindowMaker directory.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-=-=-=-=-=-=-
|
-=-=-=-=-=-=-
|
||||||
@@ -260,7 +233,7 @@ libtiff section of this FAQ.
|
|||||||
2.3 How do I get libtiff to work?
|
2.3 How do I get libtiff to work?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The whole key to getting libtiff working for me was to upgrade to >=
|
The whole key to getting libtiff working for me was to upgrade to >=
|
||||||
tiff-v3.4beta037-tar.gz availible at ftp.sgi.com.
|
tiff-v3.4beta037-tar.gz available at ftp.sgi.com.
|
||||||
|
|
||||||
Rerun ./configure and make and it should work. I had previously been using
|
Rerun ./configure and make and it should work. I had previously been using
|
||||||
tiff-v3.4-tar.gz instead so the library was there just not working. A note to
|
tiff-v3.4-tar.gz instead so the library was there just not working. A note to
|
||||||
@@ -275,7 +248,7 @@ Also, make sure to use gnu-make for the Window Maker compile.
|
|||||||
|
|
||||||
2.4 How do I get libjpeg to work?
|
2.4 How do I get libjpeg to work?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The newest jpeg libs are availible at ftp://ftp.uu.net/graphics/jpeg/.
|
The newest jpeg libs are available at ftp://ftp.uu.net/graphics/jpeg/.
|
||||||
|
|
||||||
How many of you have seen that darned "lib reports 62 caller expects 61" type of
|
How many of you have seen that darned "lib reports 62 caller expects 61" type of
|
||||||
error?
|
error?
|
||||||
@@ -311,7 +284,7 @@ Also, make sure to use gnu-make for the Window Maker compile.
|
|||||||
|
|
||||||
2.5 How do I get libpng to work?
|
2.5 How do I get libpng to work?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The newest png libs are availible at
|
The newest png libs are available at
|
||||||
http://www.cdrom.com/pub/png/pngcode.html.
|
http://www.cdrom.com/pub/png/pngcode.html.
|
||||||
|
|
||||||
You should also get the newest zlib libs from
|
You should also get the newest zlib libs from
|
||||||
@@ -333,10 +306,10 @@ Also, make sure to use gnu-make for the Window Maker compile.
|
|||||||
|
|
||||||
2.6 How do I get libgif (or libungif) to work?
|
2.6 How do I get libgif (or libungif) to work?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The newest libgif is availible at
|
The newest libgif is available at
|
||||||
ftp://sunsite.unc.edu/pub/Linux/libs/giflib/.
|
ftp://sunsite.unc.edu/pub/Linux/libs/giflib/.
|
||||||
|
|
||||||
The newest libungif is availible at
|
The newest libungif is available at
|
||||||
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/.
|
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/.
|
||||||
|
|
||||||
I had a few problems with libgif... it seems that the install process didn't
|
I had a few problems with libgif... it seems that the install process didn't
|
||||||
@@ -373,14 +346,14 @@ The same is true for CDE.
|
|||||||
Now, answering the question: Yes, you can use WindowMaker in these
|
Now, answering the question: Yes, you can use WindowMaker in these
|
||||||
environments. To use Window Maker with GNOME, you don't need to do
|
environments. To use Window Maker with GNOME, you don't need to do
|
||||||
anything special. To use it with CDE, read the answer for "How do I switch
|
anything special. To use it with CDE, read the answer for "How do I switch
|
||||||
CDE's windowmanager to use Window Maker?"
|
CDE's window manager to use Window Maker?"
|
||||||
|
|
||||||
To use it with KDE, read it's documentation to get rid of kwm (and possibly
|
To use it with KDE, read it's documentation to get rid of kwm (and possibly
|
||||||
kpanel) and replace it with wmaker. Then, start WPrefs.app, go to "Mouse
|
kpanel) and replace it with wmaker. Then, start WPrefs.app, go to "Mouse
|
||||||
Preferences" and set the "Disable mouse actions" check box. You will
|
Preferences" and set the "Disable mouse actions" check box. You will
|
||||||
need to restart Window Maker to make this change take effect. The
|
need to restart Window Maker to make this change take effect. The
|
||||||
"Disable mouse actions" change is needed to allow you to use krootwm,
|
"Disable mouse actions" change is needed to allow you to use krootwm,
|
||||||
wich enables you to use kfm's desktop icons, but will prevent you from
|
which enables you to use kfm's desktop icons, but will prevent you from
|
||||||
accessing Window Maker's Applications and Window List menus with the
|
accessing Window Maker's Applications and Window List menus with the
|
||||||
mouse.
|
mouse.
|
||||||
|
|
||||||
@@ -444,7 +417,7 @@ future version, this will be noted in the NEWS file.
|
|||||||
|
|
||||||
|
|
||||||
2.11 When I install Window Maker, I've used wmaker.inst correctly
|
2.11 When I install Window Maker, I've used wmaker.inst correctly
|
||||||
and I only get aroot menu with xterm and exit. How do I fix this?
|
and I only get a root menu with xterm and exit. How do I fix this?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Most likely, the problem is that Window Maker can not find a copy of the C
|
Most likely, the problem is that Window Maker can not find a copy of the C
|
||||||
pre processor in a directory such as /lib. The file /lib/cpp should be a
|
pre processor in a directory such as /lib. The file /lib/cpp should be a
|
||||||
@@ -493,7 +466,7 @@ instead of OpenWindows. In order to choose WindowMaker, you simply
|
|||||||
choose "OpenWindows Desktop" in the "Options - Session" Menus.
|
choose "OpenWindows Desktop" in the "Options - Session" Menus.
|
||||||
Choose "CDE Desktop" if you want CDE.
|
Choose "CDE Desktop" if you want CDE.
|
||||||
|
|
||||||
The Color schemes and settings for Window Maker are seperate from
|
The Color schemes and settings for Window Maker are separate from
|
||||||
CDE. Tested on a SPARC 10, Solaris x86 should work also. (better,
|
CDE. Tested on a SPARC 10, Solaris x86 should work also. (better,
|
||||||
hopefully)
|
hopefully)
|
||||||
|
|
||||||
@@ -558,7 +531,7 @@ custom Nortel thing), you should be in Window Maker heaven ;).
|
|||||||
Difference between the methods: (according to Thomas)
|
Difference between the methods: (according to Thomas)
|
||||||
|
|
||||||
I've been told that the difference between setting the resource and Peter's
|
I've been told that the difference between setting the resource and Peter's
|
||||||
method is that if you override the window manager with the resouce, you
|
method is that if you override the window manager with the resource, you
|
||||||
still get the CDE resources read into the resource database (so you still
|
still get the CDE resources read into the resource database (so you still
|
||||||
have your color settings & such from CDE), whereas with Peter's, the CDE
|
have your color settings & such from CDE), whereas with Peter's, the CDE
|
||||||
resource don't get read into the database. I don't know if this is true or not,
|
resource don't get read into the database. I don't know if this is true or not,
|
||||||
@@ -586,7 +559,7 @@ So, if you add "dtaction ExitSession" in that file, the command to shutdown
|
|||||||
CDE will be automatically executed when you exit WindowMaker.
|
CDE will be automatically executed when you exit WindowMaker.
|
||||||
|
|
||||||
|
|
||||||
2.15 When I run wmaker it quits complaing about something
|
2.15 When I run wmaker it quits complaining about something
|
||||||
__register_frame_info.
|
__register_frame_info.
|
||||||
----------------------------------
|
----------------------------------
|
||||||
This is due to using gcc >= 2.8.0 or egcs to compile Window Maker or a
|
This is due to using gcc >= 2.8.0 or egcs to compile Window Maker or a
|
||||||
@@ -637,9 +610,9 @@ Usage:
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
Launch an application. If there is a little icon that pops up in the bottom
|
Launch an application. If there is a little icon that pops up in the bottom
|
||||||
corner of the screen, drag it over to the dock icon(s). You should see a
|
corner of the screen, drag it over to the dock icon(s). You should see a
|
||||||
whiteish square indicating when it is close enough to dock, and where it will
|
whitish square indicating when it is close enough to dock, and where it will
|
||||||
be placed. To make sure this application will be there next time you start up
|
be placed. To make sure this application will be there next time you start up
|
||||||
windowmaker, exit windowmaker with the "exit session" option.
|
WindowMaker, exit WindowMaker with the "exit session" option.
|
||||||
|
|
||||||
|
|
||||||
3.2 What is the difference between the 'Exit' and 'Exit Session' Options?
|
3.2 What is the difference between the 'Exit' and 'Exit Session' Options?
|
||||||
@@ -678,7 +651,7 @@ menu.
|
|||||||
|
|
||||||
|
|
||||||
3.6 How can I resize a window if the window is larger than my
|
3.6 How can I resize a window if the window is larger than my
|
||||||
currect desktop?
|
current desktop?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
David Reviejo <dreviejo@arrakis.es> best summed up this answer:
|
David Reviejo <dreviejo@arrakis.es> best summed up this answer:
|
||||||
|
|
||||||
@@ -734,7 +707,7 @@ TODO: give complete explanation
|
|||||||
|
|
||||||
|
|
||||||
3.10 When I set the root background with wmsetbg by hand it works,
|
3.10 When I set the root background with wmsetbg by hand it works,
|
||||||
but when I do that from the configuration files it doesnt!
|
but when I do that from the configuration files it doesn't!
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
DOH! If you set the root background with wmsetbg by hand, it will obviously
|
DOH! If you set the root background with wmsetbg by hand, it will obviously
|
||||||
@@ -759,7 +732,7 @@ Configuration:
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
~/GNUstep/WindowMaker/WindowMaker
|
~/GNUstep/WindowMaker/WindowMaker
|
||||||
|
|
||||||
The main config file. This file controls options such as keybindings,
|
The main config file. This file controls options such as key bindings,
|
||||||
fonts, pixmaps, and focus modes.
|
fonts, pixmaps, and focus modes.
|
||||||
|
|
||||||
|
|
||||||
@@ -824,13 +797,13 @@ alt-tab is changes context.
|
|||||||
Paul Warren <<pdw@ferret.lmh.ox.ac.uk>> has released a patch that will
|
Paul Warren <<pdw@ferret.lmh.ox.ac.uk>> has released a patch that will
|
||||||
give this style of Context Switching to Window Maker.
|
give this style of Context Switching to Window Maker.
|
||||||
|
|
||||||
It is availible from http://ferret.lmh.ox.ac.uk/~pdw/patches/
|
It is available from http://ferret.lmh.ox.ac.uk/~pdw/patches/
|
||||||
|
|
||||||
|
|
||||||
4.5 How can I define my own Icon for a program? (instead of the
|
4.5 How can I define my own Icon for a program? (instead of the
|
||||||
Icon the Application Supplies?)
|
Icon the Application Supplies?)
|
||||||
----------------------------------
|
----------------------------------
|
||||||
You can right click on the titlebar of the running app and choose the
|
You can right click on the title bar of the running app and choose the
|
||||||
"Attributes..." option, then click on the "Ignore client supplied icon"
|
"Attributes..." option, then click on the "Ignore client supplied icon"
|
||||||
checkbox. Click "Apply", "Save" and close the Attributes Editor.
|
checkbox. Click "Apply", "Save" and close the Attributes Editor.
|
||||||
|
|
||||||
@@ -874,7 +847,7 @@ This should allow you do dock the program normally.
|
|||||||
|
|
||||||
Emulate Appicon does exactly the same thing as dockit, a small app
|
Emulate Appicon does exactly the same thing as dockit, a small app
|
||||||
distributed with ancient versions of Window Maker before the Attribute
|
distributed with ancient versions of Window Maker before the Attribute
|
||||||
Editor existed (now depricated for the obvious reason). If Emulate Appicon
|
Editor existed (now deprecated for the obvious reason). If Emulate Appicon
|
||||||
does not work, dockit will not work either. Such applications violate the
|
does not work, dockit will not work either. Such applications violate the
|
||||||
ICCCM (Inter-Client Communication Conventions Manual) and are considered
|
ICCCM (Inter-Client Communication Conventions Manual) and are considered
|
||||||
badly coded for not setting the instance.class hints.
|
badly coded for not setting the instance.class hints.
|
||||||
@@ -884,7 +857,7 @@ badly coded for not setting the instance.class hints.
|
|||||||
program for that matter?)
|
program for that matter?)
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Right Click on the title bar and choose "Attributes". Click on Panel 2 and
|
Right Click on the title bar and choose "Attributes". Click on Panel 2 and
|
||||||
click the the "Disable titlebar" and "Disable resizebar" options. Click
|
click the "Disable titlebar" and "Disable resizebar" options. Click
|
||||||
"Save", "Apply" and then close the Attributes panel.
|
"Save", "Apply" and then close the Attributes panel.
|
||||||
|
|
||||||
By Default, to get back to the attributes menu once you've removed the
|
By Default, to get back to the attributes menu once you've removed the
|
||||||
@@ -976,7 +949,7 @@ you can also try variations of this to get different tiling and other effects
|
|||||||
(where X is a number 1-9 I believe):
|
(where X is a number 1-9 I believe):
|
||||||
'xv -root -quit -rmodeX ~/background.jpg'
|
'xv -root -quit -rmodeX ~/background.jpg'
|
||||||
|
|
||||||
If you would like xv functionality in your menu, heres a nice little tip from
|
If you would like xv functionality in your menu, here's a nice little tip from
|
||||||
Alfredo:
|
Alfredo:
|
||||||
|
|
||||||
Add the following line to your ~/GNUstep/Library/WindowMaker/menu file. (all on
|
Add the following line to your ~/GNUstep/Library/WindowMaker/menu file. (all on
|
||||||
@@ -997,7 +970,7 @@ menu.
|
|||||||
|
|
||||||
FTitleBack = (spixmap, foo.xpm, black);
|
FTitleBack = (spixmap, foo.xpm, black);
|
||||||
|
|
||||||
Would have the effect of streching a pixmap to fit the titlebar of the active
|
Would have the effect of stretching a pixmap to fit the title bar of the active
|
||||||
window.
|
window.
|
||||||
You can use png, gif, ppm, tiff, jpeg and xpm images interchangeably in
|
You can use png, gif, ppm, tiff, jpeg and xpm images interchangeably in
|
||||||
Window Maker if you have compiled in support for those formats.
|
Window Maker if you have compiled in support for those formats.
|
||||||
@@ -1017,14 +990,14 @@ http://wm.current.nu/themes/images/screenshots/Midnight3.jpg
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
Add Superfluous=YES; to your ~/GNUstep/Defaults/Windowmaker file.
|
Add Superfluous=YES; to your ~/GNUstep/Defaults/Windowmaker file.
|
||||||
|
|
||||||
This option was added as a runtime option in Window Maker >= 0.16.1.
|
This option was added as a run-time option in Window Maker >= 0.16.1.
|
||||||
|
|
||||||
|
|
||||||
4.13 How do I get the classic NeXT(tm)-like style back?
|
4.13 How do I get the classic NeXT(tm)-like style back?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Add NewStyle=NO; to your ~/GNUstep/Defaults/Windowmaker file.
|
Add NewStyle=NO; to your ~/GNUstep/Defaults/Windowmaker file.
|
||||||
|
|
||||||
This option was added as a runtime option in Window Maker >= 0.16.1
|
This option was added as a run-time option in Window Maker >= 0.16.1
|
||||||
|
|
||||||
|
|
||||||
4.14 How do I get the window menu with only a two button mouse?
|
4.14 How do I get the window menu with only a two button mouse?
|
||||||
@@ -1032,7 +1005,7 @@ This option was added as a runtime option in Window Maker >= 0.16.1
|
|||||||
Jim Noble <jmknoble@ntrnet.net> writes:
|
Jim Noble <jmknoble@ntrnet.net> writes:
|
||||||
|
|
||||||
If you've got a two-button mouse under some versions of Solaris x86,
|
If you've got a two-button mouse under some versions of Solaris x86,
|
||||||
there's no way (that i'm aware of) to emulate a 3-button mouse. The right
|
there's no way (that I'm aware of) to emulate a 3-button mouse. The right
|
||||||
button can be either MB2 or MB3, but chording doesn't work.
|
button can be either MB2 or MB3, but chording doesn't work.
|
||||||
|
|
||||||
ApplicationMenuMouseButton = Left;
|
ApplicationMenuMouseButton = Left;
|
||||||
@@ -1052,11 +1025,11 @@ windows menu.
|
|||||||
You can now use WPrefs.app
|
You can now use WPrefs.app
|
||||||
(see http://wm.current.nu/features/configuration.html for more info)
|
(see http://wm.current.nu/features/configuration.html for more info)
|
||||||
if you have the new PropList style menu, or you can manually edit the
|
if you have the new PropList style menu, or you can manually edit the
|
||||||
oldstyle menu file
|
old style menu file
|
||||||
|
|
||||||
~/GNUstep/Library/WindowMaker/menu
|
~/GNUstep/Library/WindowMaker/menu
|
||||||
|
|
||||||
(or you can also manually edit the newstyle menu file)
|
(or you can also manually edit the new style menu file)
|
||||||
|
|
||||||
~/GNUstep/Defaults/WMRootMenu
|
~/GNUstep/Defaults/WMRootMenu
|
||||||
|
|
||||||
@@ -1066,7 +1039,7 @@ menu, try
|
|||||||
|
|
||||||
touch ~/GNUstep/Library/WindowMaker/menu
|
touch ~/GNUstep/Library/WindowMaker/menu
|
||||||
|
|
||||||
(or 'touch ~/GNUstep/Defaults/WMRootMenu' for the newstyle menu)
|
(or 'touch ~/GNUstep/Defaults/WMRootMenu' for the new style menu)
|
||||||
|
|
||||||
to force the modification time into the future.
|
to force the modification time into the future.
|
||||||
|
|
||||||
@@ -1078,7 +1051,7 @@ This question was officially answered as follows:
|
|||||||
|
|
||||||
You cannot do this. This is because single click is used to select
|
You cannot do this. This is because single click is used to select
|
||||||
app-icons, or to raise/lower the app-icon or the dock/clip. If
|
app-icons, or to raise/lower the app-icon or the dock/clip. If
|
||||||
this is impelmented then you will be unable to select or
|
this is implemented then you will be unable to select or
|
||||||
raise/lower dock/clip or app-icons, without also launching the
|
raise/lower dock/clip or app-icons, without also launching the
|
||||||
application it represents.
|
application it represents.
|
||||||
|
|
||||||
@@ -1109,7 +1082,7 @@ by default.
|
|||||||
4.19 How do I define my own icon for a program? I don't like the one it
|
4.19 How do I define my own icon for a program? I don't like the one it
|
||||||
supplies.
|
supplies.
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Right-click the titlebar of the running application and start the Attributes
|
Right-click the title bar of the running application and start the Attributes
|
||||||
Editor. Check the "Ignore client supplied icon" box. "Apply" and "Save",
|
Editor. Check the "Ignore client supplied icon" box. "Apply" and "Save",
|
||||||
and close the Attributes Editor.
|
and close the Attributes Editor.
|
||||||
|
|
||||||
@@ -1125,7 +1098,7 @@ Other Applications:
|
|||||||
|
|
||||||
5.1 How do I assign gimp an appicon?
|
5.1 How do I assign gimp an appicon?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Window Maker now can assign Icons from within the windowmanager, to
|
Window Maker now can assign Icons from within the window manager, to
|
||||||
do so, right click on the title bar of an app or hit F10 while the desired app
|
do so, right click on the title bar of an app or hit F10 while the desired app
|
||||||
is focused, choose "Attributes...", click on the "4" Button, enter the icon file
|
is focused, choose "Attributes...", click on the "4" Button, enter the icon file
|
||||||
name (make sure this is in your pixmap path, or you can type in the full path
|
name (make sure this is in your pixmap path, or you can type in the full path
|
||||||
@@ -1146,7 +1119,7 @@ You don't need to patch the XEmacs code, just run
|
|||||||
|
|
||||||
./configure --with-session=yes (in addition to any other options you use)
|
./configure --with-session=yes (in addition to any other options you use)
|
||||||
|
|
||||||
in your XEmacs 20.3+ sourcedir and rebuild it. Then XEmacs shows an
|
in your XEmacs 20.3+ source dir and rebuild it. Then XEmacs shows an
|
||||||
appicon when running and you can easily dock it.
|
appicon when running and you can easily dock it.
|
||||||
|
|
||||||
|
|
||||||
@@ -1157,7 +1130,7 @@ Its called asclock. It was included with each version of Window
|
|||||||
Maker until version 0.17.5, and was no longer included in
|
Maker until version 0.17.5, and was no longer included in
|
||||||
0.18.0 and above.
|
0.18.0 and above.
|
||||||
You could find it in ./WindowMaker-0.xx.x/misc/asclock.tgz and it was
|
You could find it in ./WindowMaker-0.xx.x/misc/asclock.tgz and it was
|
||||||
prepatched to be able to dock. Some other (older) versions you might find
|
pre-patched to be able to dock. Some other (older) versions you might find
|
||||||
on the net don't dock.
|
on the net don't dock.
|
||||||
|
|
||||||
Since it was pulled from the distribution (probably to save space), I've
|
Since it was pulled from the distribution (probably to save space), I've
|
||||||
@@ -1191,7 +1164,7 @@ Several Nice applications are available:
|
|||||||
wmmixer and wmcd and wmmount
|
wmmixer and wmcd and wmmount
|
||||||
http://www.geocities.com/SiliconValley/Vista/2471/linux.htm#xapps
|
http://www.geocities.com/SiliconValley/Vista/2471/linux.htm#xapps
|
||||||
|
|
||||||
ascd,WMRack,asmixer,asmodem, and others
|
ascd, WMRack, asmixer, asmodem, and others
|
||||||
ftp://ftp.windowmaker.info/pub/wmaker/contrib/srcs/apps/
|
ftp://ftp.windowmaker.info/pub/wmaker/contrib/srcs/apps/
|
||||||
|
|
||||||
wmavgload, wmmount, and wmload
|
wmavgload, wmmount, and wmload
|
||||||
@@ -1207,8 +1180,8 @@ A huge index of most available dockapps is available at:
|
|||||||
|
|
||||||
5.7 How do I get an appicon for rxvt so I can dock it?
|
5.7 How do I get an appicon for rxvt so I can dock it?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
The default rxvt that comes with most distribtions is an outdated version of
|
The default rxvt that comes with most distributions is an outdated version of
|
||||||
rxvt. The newest development version of rxvt is availible from
|
rxvt. The newest development version of rxvt is available from
|
||||||
ftp://ftp.math.fu-berlin.de/pub/rxvt/devel/. As of the time of this writing, the
|
ftp://ftp.math.fu-berlin.de/pub/rxvt/devel/. As of the time of this writing, the
|
||||||
version is 2.4.7 and it natively produces an appicon without a patch.
|
version is 2.4.7 and it natively produces an appicon without a patch.
|
||||||
|
|
||||||
@@ -1268,7 +1241,7 @@ For example:
|
|||||||
|
|
||||||
rxvt -name foo -e irc
|
rxvt -name foo -e irc
|
||||||
|
|
||||||
Then, go to the Attributes menu (right click on titlebar (or hit F10) and
|
Then, go to the Attributes menu (right click on title bar (or hit F10) and
|
||||||
choose 'Attributes...')
|
choose 'Attributes...')
|
||||||
Then choose 'Advanced Options' from the listbox and enable 'Don't Bind
|
Then choose 'Advanced Options' from the listbox and enable 'Don't Bind
|
||||||
Keyboard shortcuts'.
|
Keyboard shortcuts'.
|
||||||
@@ -1295,7 +1268,7 @@ Meanwhile, the workaround for this is to open the window list menu
|
|||||||
(click on the root window with the middle mouse button) and click
|
(click on the root window with the middle mouse button) and click
|
||||||
on the ScilabGraphic entry. The window should be brought to your
|
on the ScilabGraphic entry. The window should be brought to your
|
||||||
reach. Then, open the window commands menu (right click on window's
|
reach. Then, open the window commands menu (right click on window's
|
||||||
titlebar) and open the Attributes panel. Go to the "Advanced Options"
|
title bar) and open the Attributes panel. Go to the "Advanced Options"
|
||||||
section, check the "Keep inside screen" option and save.
|
section, check the "Keep inside screen" option and save.
|
||||||
|
|
||||||
If you can recompile Scilab, this came from a Scilab developer:
|
If you can recompile Scilab, this came from a Scilab developer:
|
||||||
@@ -1312,10 +1285,10 @@ in routines/xsci/jpc_SGraph.c
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
I have seen this happen on some systems if you run Netscape in a high
|
I have seen this happen on some systems if you run Netscape in a high
|
||||||
colour depth (32bpp). That is a Netscape bug. Therefore, bug Netscape.
|
color depth (32bpp). That is a Netscape bug. Therefore, bug Netscape.
|
||||||
|
|
||||||
|
|
||||||
5.13 Snow flakes from xsnow don't acumulate on titlebars!
|
5.13 Snow flakes from xsnow don't accumulate on title bars!
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
Because of the way xsnow is coded, it seems that it can't "see"
|
Because of the way xsnow is coded, it seems that it can't "see"
|
||||||
@@ -1386,7 +1359,7 @@ information center about WINGs by <crn@ozemail.com.au>.
|
|||||||
|
|
||||||
6.4 Where can I get more information about WINGs?
|
6.4 Where can I get more information about WINGs?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
Nic Berstein <nic@postilion.org> has created a WINGs Developement list.
|
Nic Berstein <nic@postilion.org> has created a WINGs Development list.
|
||||||
|
|
||||||
The purpose of this list is to provide a forum for support, ideas,
|
The purpose of this list is to provide a forum for support, ideas,
|
||||||
suggestions, bug reports etc. for the WINGs widget set library.
|
suggestions, bug reports etc. for the WINGs widget set library.
|
||||||
@@ -1412,7 +1385,7 @@ also scroll one through workspaces.
|
|||||||
|
|
||||||
For those that would like to send an application to a specific workspace,
|
For those that would like to send an application to a specific workspace,
|
||||||
either drag it to an edge of the desktop onto the next workspace or you can
|
either drag it to an edge of the desktop onto the next workspace or you can
|
||||||
right click on the titlebar, choose "Move to..." and choose the appropriate
|
right click on the title bar, choose "Move to..." and choose the appropriate
|
||||||
workspace.
|
workspace.
|
||||||
|
|
||||||
BUT, Window Maker does support KDE and GNOME protocols, including the
|
BUT, Window Maker does support KDE and GNOME protocols, including the
|
||||||
@@ -1423,7 +1396,7 @@ environments and use their pagers.
|
|||||||
|
|
||||||
7.2 Can I have folders like in AfterStep?
|
7.2 Can I have folders like in AfterStep?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
No. Window Maker does however support the collapsable Clip per desktop
|
No. Window Maker does however support the collapsible Clip per desktop
|
||||||
for a similar functionality.
|
for a similar functionality.
|
||||||
|
|
||||||
|
|
||||||
@@ -1491,7 +1464,7 @@ for an in-depth walk-through on making a Theme archive.
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
This should be as simple as untarring the Theme.tar.gz into one of two
|
This should be as simple as untarring the Theme.tar.gz into one of two
|
||||||
places. You can untar it to the global /usr/local/share/WindowMaker/* directory,
|
places. You can untar it to the global /usr/local/share/WindowMaker/* directory,
|
||||||
and have it be accessable to all users, or you can untar it to your own
|
and have it be accessible to all users, or you can untar it to your own
|
||||||
~/GNUstep/Library/WindowMaker/ directory for your own personal use.
|
~/GNUstep/Library/WindowMaker/ directory for your own personal use.
|
||||||
|
|
||||||
Use your favorite variation of the following:
|
Use your favorite variation of the following:
|
||||||
|
|||||||
10
FAQ.I18N
10
FAQ.I18N
@@ -19,9 +19,9 @@ If I18N support does not work for you, check these:
|
|||||||
support a locale for your language, you can use X Window System's
|
support a locale for your language, you can use X Window System's
|
||||||
locale emulation feature instead of OS's locale. To use this
|
locale emulation feature instead of OS's locale. To use this
|
||||||
feature, add this option to the configure, "--with-x-locale".
|
feature, add this option to the configure, "--with-x-locale".
|
||||||
if your OS is commercial one, such as Solaris,IRIX,AIX,...,
|
if your OS is commercial one, such as Solaris, IRIX, AIX, ...
|
||||||
you perhaps don't have to use X's locale emulation.
|
you perhaps don't have to use X's locale emulation.
|
||||||
But if your OS is Linux or NetBSD or .. , it's possible
|
But if your OS is Linux or NetBSD or..., it is possible that
|
||||||
your locale is not supported so far. then use "--with-x-locale".
|
your locale is not supported so far. then use "--with-x-locale".
|
||||||
|
|
||||||
Note: to use X's locale emulation, your Xlib has to be
|
Note: to use X's locale emulation, your Xlib has to be
|
||||||
@@ -39,7 +39,7 @@ If I18N support does not work for you, check these:
|
|||||||
MenuTitleFont = "Trebuchet MS:bold:pixelsize=12";
|
MenuTitleFont = "Trebuchet MS:bold:pixelsize=12";
|
||||||
......................................................
|
......................................................
|
||||||
|
|
||||||
then you can't display asian language (ja,ko,ch) characters using
|
then you can't display Asian language (ja, ko, ch) characters using
|
||||||
Trebuchet MS. A font that is guaranteed to work for any language is
|
Trebuchet MS. A font that is guaranteed to work for any language is
|
||||||
sans (or sans-serif). sans is not a font itself, but an alias which
|
sans (or sans-serif). sans is not a font itself, but an alias which
|
||||||
points to multiple fonts and will load the first in that list that
|
points to multiple fonts and will load the first in that list that
|
||||||
@@ -51,9 +51,9 @@ If I18N support does not work for you, check these:
|
|||||||
|
|
||||||
However, please note that if your font is something like:
|
However, please note that if your font is something like:
|
||||||
|
|
||||||
"Trebuchet MS,Luxi Sans,sans:pixelsize=12"
|
"Trebuchet MS,sans serif:pixelsize=12"
|
||||||
|
|
||||||
this will not be able to display asian languages if any of the
|
this will not be able to display Asian languages if any of the
|
||||||
previous fonts before sans are installed. This is because unlike
|
previous fonts before sans are installed. This is because unlike
|
||||||
the proper font pickup that sans guarantees for your language,
|
the proper font pickup that sans guarantees for your language,
|
||||||
this construct only allows a font fallback mechanism, which tries
|
this construct only allows a font fallback mechanism, which tries
|
||||||
|
|||||||
64
FAQ.I18N.cs
64
FAQ.I18N.cs
@@ -1,64 +0,0 @@
|
|||||||
Často kladené otázky na podporu místního nastavení
|
|
||||||
==================================================
|
|
||||||
|
|
||||||
Pokud vám nefunguje podpora I18N, tak zkontrolujte tato nastavení:
|
|
||||||
|
|
||||||
- systémová proměnná LANG musí být nastavená tak, aby odpovídala vašemu
|
|
||||||
místnímu nastavení (čeština = czech), vaše místní nastavení musí být
|
|
||||||
podporovatelné vaším operačním systémem nebo X emulací. Všechny
|
|
||||||
podporovatelné lokalizace zobrazíte příkazem "locale -a". Měli byste
|
|
||||||
také zkontrolovat, zda-li je vaše místní nastavení podporované
|
|
||||||
X emulací. Soubor: "/usr/X11R6/lib/X11/locale/locale.alias" by měl
|
|
||||||
obsahovat podobnou sekvenci (podpora pro češtinu):
|
|
||||||
|
|
||||||
cs cs_CZ.ISO8859-2
|
|
||||||
cs_CS cs_CZ.ISO8859-2
|
|
||||||
cs_CS.ISO8859-2 cs_CZ.ISO8859-2
|
|
||||||
cs_CZ cs_CZ.ISO8859-2
|
|
||||||
cs_CZ.iso88592 cs_CZ.ISO8859-2
|
|
||||||
cz cz_CZ.ISO8859-2
|
|
||||||
cz_CZ cz_CZ.ISO8859-2
|
|
||||||
|
|
||||||
- zkontrolujte použití správných fontů pro vaše místní nastavení.
|
|
||||||
Pokud nepoužíváte správné fonty s kódováním, které je nastaveno v
|
|
||||||
Xlib nebo libc, tak se můžou dít "dost divné věci". Zkuste explicitně
|
|
||||||
zadat kování do proměnné LANG: LANG=cs_CS.ISO8859-2 nebo
|
|
||||||
LANG=cs_CZ.iso88592 a znovu zkontrolujte:
|
|
||||||
"/usr/X11R6/lib/X11/locale/locale.alias"
|
|
||||||
|
|
||||||
- pokud váš operační systém nepodporuje místní nastavení (locales), nebo
|
|
||||||
pokud váš OS nepodporuje místní nastavení pro váš jazyk, můžete
|
|
||||||
použít emulaci místního nastavení X Window Systému. Zprovoznit tuto
|
|
||||||
emulaci je možné spuštěním ./configure s volbou "--witn-x-locale".
|
|
||||||
Pokud používáte nějaký komerční systém jako je například IRIX, AIX,
|
|
||||||
Solaris, ...,tak asi X emulaci nebudete potřebovat. Ovšem pokud je
|
|
||||||
vaším operačním systémem Linux, NetBSD nebo jiný užasný, volně
|
|
||||||
šiřitelný operační systém, tak je možné, že vaše místní nastavení
|
|
||||||
zatím není podporované. Potom použijte volbu "--witn-x-locale".
|
|
||||||
|
|
||||||
Pozn: Aby jste mohli používat X emulaci místních nastavení, tak vaše
|
|
||||||
Xlib musí být zkompilované s touto podporou. Xlib v RedHat 5.0
|
|
||||||
tak zkompilované nejsou (RH4.x jsou OK). Překompilované Xlib
|
|
||||||
s podporou pro emulací místních nastavení pro RH5.0 jsou
|
|
||||||
dostupné na adrese:
|
|
||||||
|
|
||||||
ftp://ftp.linux.or.jp/pub/RPM/glibc
|
|
||||||
|
|
||||||
- fonty, které používáte by měli být podporované vaším místním nastavením.
|
|
||||||
Jestliže vaše nastavení fontů v souboru ~/GNUstep/Defaults/WindowMaker
|
|
||||||
vypadá takto:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"; ,
|
|
||||||
|
|
||||||
nemůžete zobrazovat znaky jiné než iso8859-x ve fontu helvetica.
|
|
||||||
Jednoduchý způsob, jak zobrazovat znaky různých jazyků, je nastavit všechny
|
|
||||||
fonty takto:
|
|
||||||
|
|
||||||
"-*-*-medium-r-normal-*-14-*-*-*-*-*-*-*"
|
|
||||||
|
|
||||||
Také je nutné změnit nastavení fontů v souborech stylů v adresáři:
|
|
||||||
~/Library/WindowMaker/Style.
|
|
||||||
|
|
||||||
- pokud si nejste jisti, zda-li má systémová proměnná LC_TYPE správnou
|
|
||||||
hodnotu, tak ji nenastavujte.
|
|
||||||
57
FAQ.I18N.sk
57
FAQ.I18N.sk
@@ -1,57 +0,0 @@
|
|||||||
(Toto je len preklad dosť starého súboru! Ak by ste mali skutočne problémy
|
|
||||||
s Window Makerom a slovenčinou a v tomto súbore by ste nenašli pomoc,
|
|
||||||
pošlite popis problému na adresu <judas@linux.sk>.)
|
|
||||||
|
|
||||||
Ak vám nefunguje podpora miestnych nastavení, skontrolujte nasledujúce:
|
|
||||||
|
|
||||||
- premenná LANG je nastavená na vaše miestne nastavenia a tieto
|
|
||||||
sú podporované vašim OS alebo X emuláciou. Zoznam podporovaných
|
|
||||||
miestnych nastavení získate príkazom "locale -a". Zoznam
|
|
||||||
miestnych nastvení podporovaných X emuláciou sa nachádza v
|
|
||||||
súbore "/usr/X11R6/lib/X11/locale/locale.alias".
|
|
||||||
|
|
||||||
- používate správne fonty pre svoje miestne nastavenia. Ak
|
|
||||||
používate font s odlišným kódovaním ako je nastavené v Xlib
|
|
||||||
alebo libc, môžu sa diať čudné veci. Skúste explicitne zadať
|
|
||||||
kókovanie do premennej LANG, teda sk_SK.ISO-8859-2. Znovu,
|
|
||||||
pozrite si súbor "/usr/X11R6/lib/X11/locale/locale.aliax".
|
|
||||||
|
|
||||||
- ak váš OS nepodporuje žiadne miestne nastavenia alebo váš OS
|
|
||||||
nepodporuje vaše miestne nastavenia, môžete použiť emuláciu
|
|
||||||
podpory miestnych nastavení X Window Systému. To urobíte
|
|
||||||
voľbou "--with-x-locale" skriptu configure. Ak používate
|
|
||||||
komerčný OS ako Solaris, IRIX, AIX, ..., pravdepodobne
|
|
||||||
nepotrebujete použiť X emuláciu miestnych nastavení. Ale ak
|
|
||||||
je váš OS Linux alebo NetBSD alebo ..., je možné, že vaše
|
|
||||||
miestne nastavenia ešte nie sú podporované. Vtedy použite
|
|
||||||
"--with-x-locale".
|
|
||||||
|
|
||||||
Pozor: aby ste mohli používať X emuláciu miestnych nastvení,
|
|
||||||
vaša Xlib musí byť skompilovaná s touto podporou.
|
|
||||||
Xlib v Linux RedHat5.0 tak skompilovaná nie je.
|
|
||||||
(RH4.x je v poriadku). Prekompilovaná Xlib pre
|
|
||||||
RH5.0 s podporou emulácie miestnych nastavení je
|
|
||||||
dostupná na adrese
|
|
||||||
|
|
||||||
ftp://ftp.linux.or.jp/pub/RPM/glibc
|
|
||||||
|
|
||||||
- fonty, ktoré používate, podporujú vaše miesne nastavenia.
|
|
||||||
Ak vaše nastavenia fontov v ~/GNUstep/Defaults/WindowMaker
|
|
||||||
vyzerajú takto:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*";
|
|
||||||
......................................................
|
|
||||||
|
|
||||||
potom nemôžete zobrazovať znaky iné ako iso8859-x vo fonte
|
|
||||||
helvetica. Jednoduchý spôsob ako zobrazovať znaky rôznych
|
|
||||||
jazykov je nastaviť všetky fonty takto:
|
|
||||||
|
|
||||||
"-*-*-medium-r-normal-*-14-*-*-*-*-*-*-*"
|
|
||||||
|
|
||||||
a tiež potrebujete zmeniť nastavenia fontov v súboroch štýlov
|
|
||||||
v adresári ~/Library/WindowMaker/Style.
|
|
||||||
|
|
||||||
- premenná LC_CTYPE nie je nastavená alebo má správnu hodnotu. Ak
|
|
||||||
si nie ste istí, nenastavujte ju.
|
|
||||||
|
|
||||||
@@ -1,52 +1,18 @@
|
|||||||
|
|
||||||
Installation Instructions for Window Maker
|
Installation Instructions for Window Maker
|
||||||
|
|
||||||
|
The latest version of Window Maker (-crm) can be found in the
|
||||||
|
git repository at
|
||||||
|
|
||||||
|
http://repo.or.cz/w/wmaker-crm.git
|
||||||
|
|
||||||
|
|
||||||
SUPPORTED PLATFORMS
|
SUPPORTED PLATFORMS
|
||||||
===================
|
===================
|
||||||
(ie: I've heard someone has compiled it on...)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Conectiva 5.9 (beta)
|
- Intel GNU/Linux Systems in general
|
||||||
- Intel GNU/Linux Slackware
|
|
||||||
- Intel GNU/Linux Debian
|
|
||||||
- Intel GNU/Linux other distributions
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- Solaris 2.8 on Ultra Sparc 10 and E450
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 over MacOS
|
|
||||||
- Amiga 3000 running RedHat Linux 5.1 (Rawhide)
|
|
||||||
- IBM S/390 running Linux
|
|
||||||
- IBM S/390 running Conectiva Linux (experimental)
|
|
||||||
- iBook running Darwin
|
|
||||||
- Darwin PPC / Macos X
|
|
||||||
- Windows NT with Cygwin/XFree86
|
|
||||||
- Sony PlayStation2 running Linux
|
|
||||||
|
|
||||||
All registered trademarks are registered by their owners. (duh)
|
Patches to make it work on other platforms are welcome.
|
||||||
|
|
||||||
Patches to make it work on other platforms are welcome.
|
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS:
|
REQUIREMENTS:
|
||||||
@@ -54,7 +20,7 @@ REQUIREMENTS:
|
|||||||
|
|
||||||
The following software is required to use Window Maker:
|
The following software is required to use Window Maker:
|
||||||
|
|
||||||
- X11R6.x
|
- X11R6.x
|
||||||
Window Maker can be compiled in older versions of X, like X11R5
|
Window Maker can be compiled in older versions of X, like X11R5
|
||||||
(Solaris) or X11R4 (OpenWindows) but it will not work 100% correctly.
|
(Solaris) or X11R4 (OpenWindows) but it will not work 100% correctly.
|
||||||
In such servers there will not be application icons and you'll have
|
In such servers there will not be application icons and you'll have
|
||||||
@@ -83,18 +49,18 @@ OPTIONAL:
|
|||||||
|
|
||||||
These libraries are not required to make Window Maker work, but they
|
These libraries are not required to make Window Maker work, but they
|
||||||
are supported in case you want to use them. Version numbers are those
|
are supported in case you want to use them. Version numbers are those
|
||||||
that I have (and therefore, guraranteed to work), but other versions
|
that I have (and therefore, guaranteed to work), but other versions
|
||||||
might work too.
|
might work too.
|
||||||
|
|
||||||
|
|
||||||
- libXPM 4.7 or newer
|
- libXPM 4.7 or newer
|
||||||
Older versions may not work!!!
|
Older versions may not work!!!
|
||||||
Available at ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
Available at ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
||||||
|
|
||||||
There is builtin support for XPM files, but it will not
|
There is built-in support for XPM files, but it will not
|
||||||
load images in some uncommon encodings.
|
load images in some uncommon encodings.
|
||||||
|
|
||||||
- libpng 0.96 or newer and zlib
|
- libpng 0.96 or newer and zlib
|
||||||
For PNG image support.
|
For PNG image support.
|
||||||
http://www.cdrom.com/pub/png/
|
http://www.cdrom.com/pub/png/
|
||||||
|
|
||||||
@@ -120,6 +86,12 @@ might work too.
|
|||||||
CONFIGURE OPTIONS:
|
CONFIGURE OPTIONS:
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
If you downloaded the cvs or git versions, type
|
||||||
|
|
||||||
|
./autogen.sh
|
||||||
|
|
||||||
|
to generate the config files.
|
||||||
|
|
||||||
These options can be passed to the configure script to enable/disable
|
These options can be passed to the configure script to enable/disable
|
||||||
some Window Maker features. Example:
|
some Window Maker features. Example:
|
||||||
|
|
||||||
@@ -145,26 +117,18 @@ To get a list of other options, run ./configure --help
|
|||||||
texture generation a little bit, but in some cases it seems to be
|
texture generation a little bit, but in some cases it seems to be
|
||||||
necessary due to a bug that manifests as messed icons and textures.
|
necessary due to a bug that manifests as messed icons and textures.
|
||||||
|
|
||||||
--disable-motif
|
--disable-motif
|
||||||
disable support for mwm window manager hints
|
disable support for mwm window manager hints
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
remove things that are already supported in desktop environments,
|
|
||||||
like KDE and GNOME. Disabled things are: window list, root
|
|
||||||
applications menu, multiple window selection. Note that you will not
|
|
||||||
be able to exit Window Maker from itself anymore; you will have to
|
|
||||||
use kill with the SIGTERM signal or exit it from KDE. It is not
|
|
||||||
advisable to enable it.
|
|
||||||
|
|
||||||
--enable-modelock
|
--enable-modelock
|
||||||
XKB language status lock support. If you don't know what it is you
|
XKB language status lock support. If you don't know what it is you
|
||||||
probably don't need it.
|
probably don't need it.
|
||||||
|
|
||||||
--disable-xpm
|
--disable-xpm
|
||||||
disables use of the XPM library even if it is available on your
|
disables use of the XPM library even if it is available on your
|
||||||
system.
|
system.
|
||||||
|
|
||||||
--disable-png
|
--disable-png
|
||||||
disables use of PNG library
|
disables use of PNG library
|
||||||
|
|
||||||
--disable-tiff
|
--disable-tiff
|
||||||
@@ -183,73 +147,14 @@ To get a list of other options, run ./configure --help
|
|||||||
PLATFORM SPECIFIC NOTES:
|
PLATFORM SPECIFIC NOTES:
|
||||||
========================
|
========================
|
||||||
|
|
||||||
- DEC/Alpha machines
|
|
||||||
|
|
||||||
#>>>>>>>>>>>
|
|
||||||
From: Anton Ivanov <aivanov@eu.level3.net>
|
|
||||||
To: Marcelo E. Magallon <mmagallo@debian.org>
|
|
||||||
Subject: Re: Is the WindowMaker package working ok on Alpha?
|
|
||||||
|
|
||||||
> Hi,
|
|
||||||
>
|
|
||||||
> I was reading some docs on the WindowMaker tarball, and found this:
|
|
||||||
>
|
|
||||||
> | - DEC/Alpha machines
|
|
||||||
> | You might need to pass the --disable-shm flag to configure,
|
|
||||||
> | like ./configure --disable-shm
|
|
||||||
>
|
|
||||||
> is anyone having problems with WindowMaker on Alpha? Can someone
|
|
||||||
> please test this? Should the flag be passed when building on Alpha?
|
|
||||||
|
|
||||||
Disclaimer: alphas under my command have never run X and are least likely to
|
|
||||||
suddenly start running it anytime soon.
|
|
||||||
|
|
||||||
Alpha used to have some ridiculously low amount of shared memory
|
|
||||||
configured.
|
|
||||||
So quite a lot of apps used to barf. Namely - cdrecord, mysql server, etc.
|
|
||||||
|
|
||||||
Check where is yours at the moment and raise it to a more appropriate
|
|
||||||
value by either catting to the appropriate /proc entry or changing the
|
|
||||||
/usr/src/linux/include/asm/shmparam.h.
|
|
||||||
|
|
||||||
Otherwise the shared memory on alpha should be fully functional and I
|
|
||||||
see no reason to disable it. Mine are bumped up to 32 or more on most
|
|
||||||
machines.
|
|
||||||
|
|
||||||
And If I recall correctly the comments in that file are actually
|
|
||||||
wrong. Value is not bytes, but in machine size word. For alpha *8.
|
|
||||||
|
|
||||||
As I said - I do not run X on them so all #include "stdisclaimer.h"
|
|
||||||
apply.
|
|
||||||
#<<<<<<<<<<<<
|
|
||||||
|
|
||||||
|
|
||||||
- SCO Unix - run configure like
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
- SunOS, Solaris
|
|
||||||
If you have gcc installed, run configure as:
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
Sun's cpp lacks some features needed by Window Maker and it can
|
|
||||||
cause problems when parsing the config files.
|
|
||||||
You also might need to use the --with-libs-from and --with-incs-from
|
|
||||||
to supply the directory where libtiff is located.
|
|
||||||
Someone mailed me that you also must make /usr/local/lib be the
|
|
||||||
first path in LD_LIBRARY_PATH to make it work.
|
|
||||||
|
|
||||||
If you have a Ultra Creator 3D or some other machine with high-end
|
|
||||||
graphics, be sure to start the X server with the default visual
|
|
||||||
set to 24bpp or you might experience problems with mangled colors.
|
|
||||||
This is a wmaker bug and will be fixed.
|
|
||||||
|
|
||||||
- GNU/Linux in general
|
- GNU/Linux in general
|
||||||
Make sure you have /usr/local/lib in /etc/ld.so.conf and that you
|
Make sure you have /usr/local/lib in /etc/ld.so.conf and that you
|
||||||
run ldconfig after installing.
|
run ldconfig after installing.
|
||||||
Uninstall any packaged version of Window Maker before installing a new
|
Uninstall any packaged version of Window Maker before installing a new
|
||||||
version.
|
version.
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
- RedHat GNU/Linux
|
||||||
RedHat systems have several annoying problems. If you use it,
|
RedHat systems have several annoying problems. If you use it,
|
||||||
be sure to follow the steps below or Window Maker will not work:
|
be sure to follow the steps below or Window Maker will not work:
|
||||||
|
|
||||||
* if you installed the Window Maker that comes with RedHat, uninstall
|
* if you installed the Window Maker that comes with RedHat, uninstall
|
||||||
@@ -269,7 +174,7 @@ apply.
|
|||||||
seem to have bugs that cause the system to hang.
|
seem to have bugs that cause the system to hang.
|
||||||
|
|
||||||
- Debian GNU/Linux
|
- Debian GNU/Linux
|
||||||
If you want JPEG and TIFF support, make sure you have libtiff-dev
|
If you want JPEG and TIFF support, make sure you have libtiff-dev
|
||||||
and libjpeg-dev installed.
|
and libjpeg-dev installed.
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
- SuSE GNU/Linux
|
||||||
@@ -280,7 +185,7 @@ apply.
|
|||||||
- MetroX (unknown version)
|
- MetroX (unknown version)
|
||||||
MetroX has a bug that corrupts pixmaps that are set as window
|
MetroX has a bug that corrupts pixmaps that are set as window
|
||||||
backgrounds. If you use MetroX and has weird problems with
|
backgrounds. If you use MetroX and has weird problems with
|
||||||
textures, do not use textures in titlebars. Or use a different
|
textures, do not use textures in title bars. Or use a different
|
||||||
X server.
|
X server.
|
||||||
|
|
||||||
INSTALLATION:
|
INSTALLATION:
|
||||||
@@ -307,11 +212,11 @@ smaller, you can instead type:
|
|||||||
This will build and install Window Maker with default parameters.
|
This will build and install Window Maker with default parameters.
|
||||||
|
|
||||||
If you want to customize some compile-time options, you can do the
|
If you want to customize some compile-time options, you can do the
|
||||||
following.
|
following.
|
||||||
|
|
||||||
1. (optional) Look at the CONFIGURE OPTIONS section above for the
|
1. (optional) Look at the CONFIGURE OPTIONS section above for the
|
||||||
options available. Also run:
|
options available. Also run:
|
||||||
|
|
||||||
./configure --help
|
./configure --help
|
||||||
|
|
||||||
to get a complete listing of other options that are available.
|
to get a complete listing of other options that are available.
|
||||||
@@ -321,14 +226,14 @@ following.
|
|||||||
|
|
||||||
./configure --enable-modelock
|
./configure --enable-modelock
|
||||||
|
|
||||||
3. (optional) Edit src/wconfig.h with your favorite text editor
|
3. (optional) Edit src/wconfig.h with your favorite text editor
|
||||||
and browse through it for some options you might want to change.
|
and browse through it for some options you might want to change.
|
||||||
|
|
||||||
4. Compile. Just type:
|
4. Compile. Just type:
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
5. Login as root (if you can't do that, read the "I don't have the
|
5. Login as root (if you can't do that, read the "I don't have the
|
||||||
root password :-(" section) and install Window Maker in your system:
|
root password :-(" section) and install Window Maker in your system:
|
||||||
su root
|
su root
|
||||||
make install
|
make install
|
||||||
@@ -350,8 +255,8 @@ Type:
|
|||||||
wmaker.inst will install Window Maker configuration files and will
|
wmaker.inst will install Window Maker configuration files and will
|
||||||
setup X to automatically launch Window Maker at startup.
|
setup X to automatically launch Window Maker at startup.
|
||||||
|
|
||||||
That's it!
|
That's it!
|
||||||
|
|
||||||
You can type "man wmaker" to get some general help for configuration
|
You can type "man wmaker" to get some general help for configuration
|
||||||
and other stuff.
|
and other stuff.
|
||||||
|
|
||||||
@@ -365,12 +270,11 @@ Installing the extras package
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
Unpack WindowMaker-extra-<version-number>.tar.gz in /usr/local/share
|
Unpack WindowMaker-extra-<version-number>.tar.gz in /usr/local/share
|
||||||
|
|
||||||
You can get the file at ftp://ftp.windowmaker.info. This file is optional
|
You can get the file at http://windowmaker.org/pub/source/release/. This file
|
||||||
and only have a few icons, and themes. Look for the latest <version-number>
|
is optional and only have a few icons, and themes. Look for the latest
|
||||||
available.
|
<version-number> available. Also there is a WindowMaker-extra.readme to
|
||||||
Also there is a WindowMaker-extra.readme to instruct you where that package
|
instruct you where that package should go.
|
||||||
should go.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -380,14 +284,14 @@ I don't have the root password :(
|
|||||||
If you can't get superuser privileges (can't be root) you can install
|
If you can't get superuser privileges (can't be root) you can install
|
||||||
wmaker in your own home directory. For that, supply the --prefix option
|
wmaker in your own home directory. For that, supply the --prefix option
|
||||||
when running configure in step 2 of building Window Maker. You will
|
when running configure in step 2 of building Window Maker. You will
|
||||||
also need to supply the --with-appspath option, to specify the path for
|
also need to supply the --with-gnustepdir option, to specify the path for
|
||||||
WPrefs.app Example:
|
WPrefs.app Example:
|
||||||
|
|
||||||
./configure --prefix=/home/jshmoe --with-appspath=/home/jshmoe/GNUstep/Applications
|
./configure --prefix=/home/jshmoe --with-gnustepdir=/home/jshmoe/GNUstep/Applications
|
||||||
|
|
||||||
|
|
||||||
Then make /home/jshmoe/bin be included in your search PATH, add
|
Then make /home/jshmoe/bin be included in your search PATH, add
|
||||||
/home/jshmoe/lib to your LD_LIBRARY_PATH environment variable and run
|
/home/jshmoe/lib to your LD_LIBRARY_PATH environment variable and run
|
||||||
bin/wmaker.inst
|
bin/wmaker.inst
|
||||||
|
|
||||||
Of course, /home/jshmoe is supposed to be replaced with your actual home
|
Of course, /home/jshmoe is supposed to be replaced with your actual home
|
||||||
@@ -429,7 +333,7 @@ autoconf 2.13
|
|||||||
automake 1.4
|
automake 1.4
|
||||||
libtool 1.3
|
libtool 1.3
|
||||||
|
|
||||||
Note that it must not be libtool 1.2b, it must be libtool 1.3,
|
Note that it must not be libtool 1.2b, it must be libtool 1.3,
|
||||||
from the GNU sites.
|
from the GNU sites.
|
||||||
|
|
||||||
== configure doesn't detect libtiff, or other graphic libraries.
|
== configure doesn't detect libtiff, or other graphic libraries.
|
||||||
@@ -443,7 +347,7 @@ located. You can put multiple paths in any of these options, as the example
|
|||||||
of --with-incs-from shows. Just put a space between them.
|
of --with-incs-from shows. Just put a space between them.
|
||||||
|
|
||||||
|
|
||||||
== configure doesn't detect libXpm.
|
== configure doesn't detect libXpm.
|
||||||
|
|
||||||
* Check if you have a symbolic link from libXpm.so.4.9 to libXpm.so
|
* Check if you have a symbolic link from libXpm.so.4.9 to libXpm.so
|
||||||
|
|
||||||
@@ -464,9 +368,10 @@ If you're not sure, try renaming ~/GNUstep to ~/GNUtmp and then run wmaker.inst
|
|||||||
|
|
||||||
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
|
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
|
||||||
|
|
||||||
* Window Maker is not finding cpp (the C preprocessor). If your cpp is
|
* Window Maker could not read your menu definition file
|
||||||
not located in /lib/cpp, edit src/config.h and correct the path in
|
you should check wmaker's output for an error, it may be
|
||||||
CPP_PATH.
|
visible in the console or in the .xsession-errors file.
|
||||||
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from true; giving up
|
== checking lex output file root... configure: error: cannot find output from true; giving up
|
||||||
|
|
||||||
@@ -487,7 +392,7 @@ Steps 1 to 3 can be skipped if you use the Install script.
|
|||||||
|
|
||||||
1 - You have to select the languages you want to support. Set the
|
1 - You have to select the languages you want to support. Set the
|
||||||
LINGUAS to the list of locales you want. English is always
|
LINGUAS to the list of locales you want. English is always
|
||||||
suported. Example:
|
supported. Example:
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
setenv LINGUAS "pt ja de"
|
||||||
in csh
|
in csh
|
||||||
@@ -500,18 +405,18 @@ in sh
|
|||||||
The list of supported locales can be found in po/README.
|
The list of supported locales can be found in po/README.
|
||||||
English is the default language.
|
English is the default language.
|
||||||
|
|
||||||
Read po/README if you wish to translate and maintain locale files
|
Read po/README if you wish to translate and maintain locale files
|
||||||
for other languages.
|
for other languages.
|
||||||
|
|
||||||
2 - Additionally, if your language uses multi-byte characters, such
|
2 - Additionally, if your language uses multi-byte characters, such
|
||||||
as Japanese or Korean, you must set the MultiByteText option to YES
|
as Japanese or Korean, you must set the MultiByteText option to YES
|
||||||
in ~/GNUstep/Defaults/WMGLOBAL
|
in ~/GNUstep/Defaults/WMGLOBAL
|
||||||
|
|
||||||
3 - Configure, build and install Window Maker normally.
|
3 - Configure, build and install Window Maker normally.
|
||||||
|
|
||||||
4 - To select a particular locale at runtime you must set the LANG
|
4 - To select a particular locale at run-time you must set the LANG
|
||||||
environment variable to the locale you want. For example, if you want to set
|
environment variable to the locale you want. For example, if you want to set
|
||||||
the portuguese locale, you must run
|
the Portuguese locale, you must run
|
||||||
|
|
||||||
setenv LANG pt
|
setenv LANG pt
|
||||||
|
|
||||||
@@ -519,16 +424,14 @@ in csh or
|
|||||||
|
|
||||||
export LANG; LANG=pt
|
export LANG; LANG=pt
|
||||||
|
|
||||||
in Bourne sh and similars
|
in Bourne sh and similar
|
||||||
|
|
||||||
Note: If you have the LC_CTYPE environment variable set, you must
|
Note: If you have the LC_CTYPE environment variable set, you must
|
||||||
unset it before running wmaker.
|
unset it before running wmaker.
|
||||||
|
|
||||||
For menu definition files, Window Maker searches for them in the
|
For menu definition files, Window Maker searches for them in the
|
||||||
following order (for brazilian portuguese, in this case):
|
following order (for Brazilian Portuguese, in this case):
|
||||||
|
|
||||||
menu.pt_BR
|
menu.pt_BR
|
||||||
menu.pt
|
menu.pt
|
||||||
menu
|
menu
|
||||||
|
|
||||||
|
|
||||||
604
INSTALL.cs
604
INSTALL.cs
@@ -1,604 +0,0 @@
|
|||||||
Instrukce pro instalaci okenního manažera Window Maker
|
|
||||||
|
|
||||||
PODPOROVANÉ PLATFORMY
|
|
||||||
=====================
|
|
||||||
("Podporované" znamená, že už to na dané platformě někdo zprovoznil...)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Conectiva 5.9 (beta)
|
|
||||||
- Intel GNU/Linux Slackware
|
|
||||||
- Intel GNU/Linux Debian
|
|
||||||
- Intel GNU/Linux ostatní distribuce
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 over MacOS
|
|
||||||
- Amiga 3000 running RedHat Linux 5.1 (Rawhide)
|
|
||||||
- IBM S/390 s Linuxem
|
|
||||||
- iBook s OS Darwin
|
|
||||||
|
|
||||||
Patche pro rozběhání na jiných platformách jsou vítané.
|
|
||||||
|
|
||||||
POŽADAVKY
|
|
||||||
=========
|
|
||||||
|
|
||||||
Následující software je potřebný/nezbytný pro běh Window Makeru:
|
|
||||||
|
|
||||||
- X11R6.x
|
|
||||||
Window Maker může být zkompilován na starších verzích X, jako
|
|
||||||
je X11R5 (Solaris) nebo X11R4 (OpenWindows), ale nebude to pracovat
|
|
||||||
100% spolehlivě. Na těchto systémech nebudou fungovat ikony
|
|
||||||
aplikací a budete mít problémy s používáním doku. Upgrade
|
|
||||||
uživatelských knihoven (Xlib, Xt atd.) zlepší tyto problémy pokud
|
|
||||||
nemůžete aktualizovat váš X server.
|
|
||||||
|
|
||||||
Následující software je potřebný ke zkompilování Window Makeru:
|
|
||||||
|
|
||||||
- Zákládní běžné věci
|
|
||||||
Když budete komplivat Window Maker, tak se ujistěte, že máte gcc
|
|
||||||
(nebo jiný ANCI C kompilátor) a nainstalované hlavičkové soubory
|
|
||||||
pro X. Hlavně pro začátečníky v Linuxu: musíte nainstalovat všechny
|
|
||||||
X-devel balíky a gcc. Jinak nebudete schopni zkompilovat žádný
|
|
||||||
program s grafickým rozhraním, tedy ani Window Maker.
|
|
||||||
|
|
||||||
- autoconf, automake a libtool
|
|
||||||
Tyto nástroje NEJSOU POTŘEBA, ale když máte jeden nebo dva nebo
|
|
||||||
všechny tři nainstalované, tak se UJISTĚTE, že máte přesně
|
|
||||||
následující VERZE:
|
|
||||||
autoconf 2.54
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.4.2
|
|
||||||
Máte-li odlišnou verzi, tak ji dočasně přejmenujte, nebo ji rovnou
|
|
||||||
odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji
|
|
||||||
stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat.
|
|
||||||
|
|
||||||
Pozn. libProblist už není potřeba ke zkompilování Window Makeru, protože
|
|
||||||
libProblist byl přímo zabudován do WINGs. Z toho důvodu už není
|
|
||||||
potřeba ani lex (flex) a yacc (nebo bison).
|
|
||||||
|
|
||||||
|
|
||||||
NEPOVINNÉ
|
|
||||||
=========
|
|
||||||
|
|
||||||
Tyto knihovny nejsou nutné pro běh Windo Makeru, ale jsou podporované, když
|
|
||||||
je budete chtít použít. Tyto verze jsou používané vývojovým týmem, který
|
|
||||||
garantuje, že budou fungovat. Ostatní verze by měli fungovat také.
|
|
||||||
|
|
||||||
- libXPM 4.7 nebo novější
|
|
||||||
Starší verze nemusí fungovat!!!
|
|
||||||
Dostupné na ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
|
||||||
|
|
||||||
Je zde zabudovaná podpora pro soubory XPM, ale nenačte obrázky s
|
|
||||||
nestandardním formátem kódování.
|
|
||||||
|
|
||||||
- libpng 0.96 nebo novější a zlib
|
|
||||||
Pro podporu PNG obrázků
|
|
||||||
http://www.cdrom.com/pub/png/
|
|
||||||
|
|
||||||
- libtiff 3.4 nebo novější
|
|
||||||
Pro podporu TIFF obrázků
|
|
||||||
Dostupné na ftp://ftp.sgi.com/graphics/tiff
|
|
||||||
|
|
||||||
- libjpeg 6.0.1 nebo novější
|
|
||||||
Pro podporu JPEG obrázků
|
|
||||||
http://www.ijg.org/
|
|
||||||
|
|
||||||
- libgif 2.2 nebo libungif
|
|
||||||
Pro podporu GIF obrázků
|
|
||||||
Dostupné na ftp://prtr-13.ucsc.edu/pub/libungif/
|
|
||||||
|
|
||||||
-GNU xgettxt
|
|
||||||
Když chcete používat češtinu nebo jiné jazyky kromě angličtiny,
|
|
||||||
tak potřebujete GNU xgettext.
|
|
||||||
Ostatní verze nejsou kompatibilní a nebudou fungovat
|
|
||||||
GNU verze je dostupná na ftp://ftp.gnu.org
|
|
||||||
|
|
||||||
|
|
||||||
KONFIGURAČNÍ NASTAVENÍ
|
|
||||||
======================
|
|
||||||
|
|
||||||
Tyto volby mohou být předané konfiguračnímu skriptu jako argumenty za
|
|
||||||
účelem povolení/zakázání určité vlastnosti Window Makera.
|
|
||||||
|
|
||||||
Příklad:
|
|
||||||
|
|
||||||
./configura --enable-kde --enable-gnome
|
|
||||||
|
|
||||||
nakonfiguruje Window Maker s podporou KDE a GNOME
|
|
||||||
|
|
||||||
Seznam ostatních možností dostanete spuštěním ./configure --help
|
|
||||||
|
|
||||||
--with-libs-from
|
|
||||||
specifikuje, které další adresáře s knihovnami se mají
|
|
||||||
prohledávat. Řetězec -L musí předcházet každému adresáři,
|
|
||||||
např:
|
|
||||||
--with-libs-from="-L/opt/libs -L/usr/local/lib"
|
|
||||||
|
|
||||||
--with-incs-from
|
|
||||||
určuje, které další adresáře s hlavičkovými soubory se mají
|
|
||||||
prohledat. Řetězec -I musí předcházet každému adresáři,
|
|
||||||
např:
|
|
||||||
--with-incs-from="-I/opt/headers -I/usr/local/include"
|
|
||||||
|
|
||||||
--enable-single-icon
|
|
||||||
umožňuje skrýt všechny ikony aplikací WM_CLASS+WM_INSTANCE
|
|
||||||
do jedné jediné. Tato vlastnost není podporovaná ze strany vývojářů.
|
|
||||||
Když budete mít s touto funkcí problémy, tak se obraťte na jejího
|
|
||||||
autora: Christopher Seawood <cls@seawood.org>
|
|
||||||
|
|
||||||
--disable-shm
|
|
||||||
zakáže používání zdílené paměti MIT. To trochu zpomalí generování
|
|
||||||
textur, ale v některých případech se to jeví jako nezbytnost z důvodu
|
|
||||||
chyby, která způsobuje špatné zobrazování ikon a textur.
|
|
||||||
|
|
||||||
--disable-motif
|
|
||||||
zakáže podporu pokynů pro okenní manažer mwm.
|
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
odstraní nástroje a funkce, které jsou už dostupné v desktopových
|
|
||||||
prosředích KDE a GNOME. Odstraní se: seznam oken, menu aplikací,
|
|
||||||
výběr více oken. Uvědomte si, že takto už nebudete schopni ukončit
|
|
||||||
samotný Window Maker pomocí aplikačního menu. Budete muset zabít Window
|
|
||||||
Maker z textové konzole nebo ho ukončit z KDE nebo GNOME.
|
|
||||||
Nedoporučuje se povolit tuto vlastnost.
|
|
||||||
|
|
||||||
--enable-modelock
|
|
||||||
podpora pro XKB nastavení jazyka. Když nevíte, o co jde, tak to
|
|
||||||
pravděpodobně nebudete potřebovat.
|
|
||||||
|
|
||||||
--enable-sound
|
|
||||||
povolí podporu modulu zvukových efektů.
|
|
||||||
|
|
||||||
--disable-xpm
|
|
||||||
zakáže podporu knihovny XPM, pokud je dostupná na vašem systému.
|
|
||||||
|
|
||||||
--disable-png
|
|
||||||
zakáže podporu knihovny PNG.
|
|
||||||
|
|
||||||
--disable-tiff
|
|
||||||
zakáže podporu knihovny TIFF.
|
|
||||||
|
|
||||||
--disable-gif
|
|
||||||
zakáže podporu knihovny GIF.
|
|
||||||
|
|
||||||
--disable-jpeg
|
|
||||||
zakáže podporu knihovny JPEG.
|
|
||||||
|
|
||||||
--disable-shape
|
|
||||||
zakáže tvarovaná okna (pro oclock, xeyes, atd.).
|
|
||||||
|
|
||||||
POŽADAVKY PRO SPECIFICKÉ PLATFORMY
|
|
||||||
==================================
|
|
||||||
|
|
||||||
-DEC/Alpha
|
|
||||||
|
|
||||||
Následující mail není přeložen, ale hovoří se v něm, že pravděpodobně
|
|
||||||
není potřeba konfigurovat Window Maker na Alphě s volbou --disable-shm.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
From: Anton Ivanov <aivanov@eu.level3.net>
|
|
||||||
To: Marcelo E. Magallon <mmagallo@debian.org>
|
|
||||||
Subject: Re: Is the WindowMaker package working ok on Alpha?
|
|
||||||
|
|
||||||
> Hi,
|
|
||||||
>
|
|
||||||
> I was reading some docs on the WindowMaker tarball, and found this:
|
|
||||||
>
|
|
||||||
> | - DEC/Alpha machines
|
|
||||||
> | You might need to pass the --disable-shm flag to configure,
|
|
||||||
> | like ./configure --disable-shm
|
|
||||||
>
|
|
||||||
> is anyone having problems with WindowMaker on Alpha? Can someone
|
|
||||||
> please test this? Should the flag be passed when building on Alpha?
|
|
||||||
|
|
||||||
Disclaimer: alphas under my command have never run X and are least likely to
|
|
||||||
suddenly start running it anytime soon.
|
|
||||||
|
|
||||||
Alpha used to have some ridiculously low amount of shared memory
|
|
||||||
configured.
|
|
||||||
So quite a lot of apps used to barf. Namely - cdrecord, mysql server, etc.
|
|
||||||
|
|
||||||
Check where is yours at the moment and raise it to a more appropriate
|
|
||||||
value by either catting to the appropriate /proc entry or changing the
|
|
||||||
/usr/src/linux/include/asm/shmparam.h.
|
|
||||||
|
|
||||||
Otherwise the shared memory on alpha should be fully functional and I
|
|
||||||
see no reason to disable it. Mine are bumped up to 32 or more on most
|
|
||||||
machines.
|
|
||||||
|
|
||||||
And If I recall correctly the comments in that file are actually
|
|
||||||
wrong. Value is not bytes, but in machine size word. For alpha *8.
|
|
||||||
|
|
||||||
As I said - I do not run X on them so all #include "stdisclaimer.h"
|
|
||||||
apply.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- SCO Unix - configure spusťte takto:
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
- SunOS, Solaris
|
|
||||||
Když máte naistalovaný gcc, tak configure spusťte takto:
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
Preprocesoru cpp od Sunu chybějí některé vlastnosti, které Window Maker
|
|
||||||
potřebuje, a to může způsobit problémy během parsování konfiguračních
|
|
||||||
souborů. Je možné, že budete muset použít --with-libs-from a
|
|
||||||
--with-incs-from k nahrazení adresáře s libtiff.
|
|
||||||
Někdo doporučuje použít /usr/local/lib jako první cestu v LD_LIBRARY_PATH.
|
|
||||||
|
|
||||||
Když máte Ultra Creator 3D nebo jinou high-end grafickou kartu, tak se
|
|
||||||
ujistěte, že X server startuje s 24 bitovou barevnou hloubkou, jinak
|
|
||||||
můžete mít problémy s pomícháním barev. Toto je chyba Window Makeru,
|
|
||||||
která bude odstraněna.
|
|
||||||
|
|
||||||
- GNU/Linux obecně
|
|
||||||
Ujistěte se, že soubor /etc/ld.so.conf obsahuje řádek "/usr/local/lib".
|
|
||||||
Odinstalujte jakoukoliv starší verzi balíčku Window Makeru před instalací
|
|
||||||
novější verze.
|
|
||||||
Nezapomeňte spustit ldconfig po instalaci Window Makeru.
|
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
|
||||||
RedHat má několik obtěžujících chyb. Pokud ho používáte dodržujte několik
|
|
||||||
následujících kroků, jinak vám Window Maker nebude fungovat.
|
|
||||||
|
|
||||||
* pokud máte nainstalovaný Window Maker z distribuce RedHat, tak ho před
|
|
||||||
upgradem odinstalujte
|
|
||||||
|
|
||||||
* ujistěte se, že nemáte systémové proměnné LANG a LINGUAS nastavené
|
|
||||||
na en_RN
|
|
||||||
|
|
||||||
* ujistěte se, že vaše systémová proměnná PATH obsahuje položku
|
|
||||||
/usr/local/bin
|
|
||||||
|
|
||||||
* ujistěte se, že soubor /etc/ld.so.conf obsahuje řádek "/usr/local/lib"
|
|
||||||
před tím, než spustíte ldconfig (na konci instalace)
|
|
||||||
|
|
||||||
* pokud máte problémy, které se projevují chybovou hláškou, která
|
|
||||||
obsahuje text --no-reexec, tak odinstalujte libtool-1.2b a nainstalujte
|
|
||||||
si novější verzi libtool-1.3. libtool-1.3 můžete nalézt na adrese:
|
|
||||||
ftp.gnu.org . Přečtěte si také odstavec ŘEŠENÍ PROBLÉMÚ.
|
|
||||||
|
|
||||||
* pokud máte nainstalovaný balíček Window Maker od RedHatu a nyní
|
|
||||||
instalujete novou verzi "ručně" (kompilováním zdrojových kódů), tak
|
|
||||||
nejprve odinstalujte stávající balíček.
|
|
||||||
|
|
||||||
* ujistěte se, že se na vašem systému nachází symbolický link z
|
|
||||||
/usr/include/X11 na /usr/X11R6/include/X11. Pokud tomu tak není, tak
|
|
||||||
na příkazovou řádku napište:
|
|
||||||
|
|
||||||
ln -s /usr/X11R6/include/X11 /usr/include/X11
|
|
||||||
|
|
||||||
* ujistěte se, že máte symbolický link /lib/cpp ukazující na cpp
|
|
||||||
program
|
|
||||||
|
|
||||||
Pokud pochybujete o nějakém z předcházejích kroků, tak neváhejte
|
|
||||||
kontaktovat uživatelskou podporu distribuce RedHat. Oni vám laskavě
|
|
||||||
zodpoví všechny vaše dotazy zohledňující váš systém. Oni vědí
|
|
||||||
mnohem více o vašem (jejich) systému než my (my nepoužíváme
|
|
||||||
RedHat).
|
|
||||||
|
|
||||||
- PowerPC MkLinux
|
|
||||||
Budete potřebovat poslední verzi Xpma. Starší verze pravděpodobně
|
|
||||||
obsahují chybu, která způsobuje zamrznutí systému.
|
|
||||||
|
|
||||||
- Debian GNU/Linux
|
|
||||||
Pokud chcete podporu JPEG a TIFF, tak se ujistěte, že máte nainstalovány
|
|
||||||
balíčky libtiff-dev a libjpeg-dev.
|
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
|
||||||
Pokud máte již nainstalován baliček Window Maker od SuSE, tak ho
|
|
||||||
odstraňte než se pustíte do kompilace Window Makeru. když tak
|
|
||||||
neučiníte, budete mít problémy.
|
|
||||||
|
|
||||||
- MetroX (neznámá verze)
|
|
||||||
Metrox obsahuje chybu, která zapřičiňuje, že obrázky, které jsou
|
|
||||||
nastaveny jako pozadí, jsou poškozeny. Pokud používáte Metrox a
|
|
||||||
máte podivné problémy s texturami, tak nepoužívejte textury v
|
|
||||||
titulcích nebo používejte jiný X server.
|
|
||||||
|
|
||||||
INSTALACE
|
|
||||||
=========
|
|
||||||
|
|
||||||
Nejjednodušší způsob, jak nainstalovat Window Maker, je spustit skript
|
|
||||||
Install nebo Install.cs (ten s vámi komunikuje česky). Oba skripty
|
|
||||||
vás jednoduše provedou celou instalací.
|
|
||||||
|
|
||||||
su
|
|
||||||
Install.cs
|
|
||||||
|
|
||||||
Poznámka: tato metoda neposkytuje všechny možnosti konfigurace a pokud
|
|
||||||
se setkáte s nějakými problémy, tak stejně budete muset
|
|
||||||
použít následující způsob kompilace.
|
|
||||||
|
|
||||||
Kompilace Window Makeru
|
|
||||||
-----------------------
|
|
||||||
Pro osvědčený způsob zadejte následující příkazy v shellu:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
pak se přihlašte jako root a zadejte:
|
|
||||||
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
pokud nejste programátor a nebudete ladit Window Maker, tak se můžete zbavit
|
|
||||||
ladících symbolů v binárních souborech a zmenšit jejich velikost:
|
|
||||||
|
|
||||||
make install-strip
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
Takto zkompilujete a nainstalujete Window Maker se standartními parametry.
|
|
||||||
|
|
||||||
Pokud chcete upravit některé vlastnosti, tak musíte učinit následující:
|
|
||||||
|
|
||||||
1. (volitelné) Podívejte se na část MOŽNOSTI KONFIGURACE, kde jsou
|
|
||||||
uvedené možnosti konfigurace. Nebo spusťte:
|
|
||||||
|
|
||||||
./configure --help
|
|
||||||
|
|
||||||
tak dostanete kompletní seznam všech dostupných možností konfigurace.
|
|
||||||
|
|
||||||
2. Spusťte ./configure s možností, kterou jste si vybrali. Například,
|
|
||||||
pokud chcete použít možnost --enable-kde, tak zadejte:
|
|
||||||
|
|
||||||
./configure --enable-kde
|
|
||||||
|
|
||||||
3. (volitelné) Otevřete soubor ./src/wconfig.h vaším oblíbeným editorem
|
|
||||||
a upravte některé možnosti, které si přejete změnit.
|
|
||||||
|
|
||||||
4. Kompilace. Zadejte pouze:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
5. Přihlaste se jako root (pokud tak nemůžetet učinit, tak si přečtěte
|
|
||||||
část "Nemám rootovské helso :-(") a nainstalujte Window Maker na váš
|
|
||||||
systém:
|
|
||||||
|
|
||||||
su root
|
|
||||||
make install
|
|
||||||
|
|
||||||
Nastavení specifické pro uživatele
|
|
||||||
----------------------------------
|
|
||||||
|
|
||||||
Tyto instrukce nejsou povinné, pokud upgradujete Window Maker ze starší
|
|
||||||
verze na novější a pokud není uvedeno jinak v souboru NEWS.
|
|
||||||
|
|
||||||
Každý uživatel na vašem systému, který si přeje používat Window Maker musí
|
|
||||||
udělat následující:
|
|
||||||
|
|
||||||
1. Nainsatlovat konfigurační soubory Window Makeru do jeho domovského
|
|
||||||
adresáře:
|
|
||||||
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
wmaker.inst nainstaluje konfigurační soubory a nastaví X server tak,
|
|
||||||
aby automaticky spouštěl Window Maker při jejich spuštění.
|
|
||||||
|
|
||||||
To je všechno, přátelé.
|
|
||||||
|
|
||||||
Informace o konfiguraci a spoustě ostatních věcí vám poskytne:
|
|
||||||
|
|
||||||
man wmaker
|
|
||||||
|
|
||||||
Pro hlubší úvod do Window Makeru si přečtěte Uživatelskou příručku (User Guide).
|
|
||||||
|
|
||||||
Měli byste se také podívat na FAQ (Frequently Asked Questions = často kladené
|
|
||||||
otázky), pokud budete mít nějaké problémy/potíže jak při samotné kompilaci,
|
|
||||||
tak s užíváním Window Makeru.
|
|
||||||
|
|
||||||
Instalování speciálního balíčku
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
Rozbalte WindowMaker-extra-<číslo_verze>.tar.gz v adresáři /usr/local/share
|
|
||||||
|
|
||||||
Tento soubor si můžete sehnat na adrese: ftp://ftp.windowmaker.info. Instalace
|
|
||||||
tohoto souboru vůbec není nutná. tento balíček obsahuje několik ikon a témat.
|
|
||||||
Hledejte poslední dostupnou verzi. V balíčku také naleznete soubor
|
|
||||||
WindowMaker-extra.readme, který vám poradí, co máte udělat.
|
|
||||||
|
|
||||||
Nemám rootovské helso :-(
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Pokud nemáte superuživatelská privilegia (nemůžete se přihlásit jako root),
|
|
||||||
tak nezoufejte, protože můžete nainstalovat Window Maker do vašeho vlastního
|
|
||||||
domovského adresáře. K tomu musíte použít volbu --prefix při spuštění
|
|
||||||
./configure. Také musíte použít volbu --with-appspath, která specifikuje
|
|
||||||
cestu pro WPrefs.app.
|
|
||||||
Příklad:
|
|
||||||
|
|
||||||
./configure --prefix=/home/karel --with-appspath=/home/karel/GNUstep/Applications
|
|
||||||
|
|
||||||
Potom přidejte adresář /home/karel/bin do systémové proměnné PATH a adresář
|
|
||||||
/home/karel/lib do sytémové proměnné LD_LIBRARY_PATH a nakonec spusťte
|
|
||||||
~/bin/wmaker.inst.
|
|
||||||
|
|
||||||
Samozřejmě, že adresář /home/karel bude ve vašem případě nahrazen vaším
|
|
||||||
vlastním domovským adresářem.
|
|
||||||
|
|
||||||
|
|
||||||
UPGRADE
|
|
||||||
=======
|
|
||||||
|
|
||||||
Pokud upgradujete ze starší verze Window Makeru:
|
|
||||||
|
|
||||||
1. Nakonfigurujte a zkompilujte Window Maker jako obvykle.
|
|
||||||
2. Nainstalujte Window Maker (ale nespouštějte wmaker.inst).
|
|
||||||
3. Přečtěte si soubor NEWS a aktualizujte vaše konfigurační soubory,
|
|
||||||
pokud je to nezbytné.
|
|
||||||
|
|
||||||
ŘEŠENÍ PROBLÉMÚ
|
|
||||||
===============
|
|
||||||
|
|
||||||
Pokud máte nějaké problémy během konfigurace (když běží configure), jako
|
|
||||||
například neschopnost použít knihovnu grafického formátu, o kterém víte, že
|
|
||||||
ho máte nainstalován, tak se podívejte do souboru config.log. Možná zde
|
|
||||||
najdete příčinu svých problémů.
|
|
||||||
|
|
||||||
== Error with loading fonts, even if they exist.
|
|
||||||
|
|
||||||
Zkuste kompilaci bez podpory NLS (národního prostředí).
|
|
||||||
|
|
||||||
== Error when configuring
|
|
||||||
|
|
||||||
ltconfig: unrecognized option `--no-reexec'
|
|
||||||
Try `ltconfig --help' for more information.
|
|
||||||
configure: error: libtool configure failed
|
|
||||||
|
|
||||||
odstraňte volbu --no-reexec ze souboru aclocal.mc a spusťte znovu configure.
|
|
||||||
Také zkontrolujte, zda verze autoconfu a automaku, které máte nainsatlované
|
|
||||||
odpovídají níže uvedeným hodnotám:
|
|
||||||
autoconf 2.13
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.3
|
|
||||||
|
|
||||||
Poznámka: nemůže to být libtool 1.2b, ale musí to být libtool 1.3 ze stránek
|
|
||||||
GNU.
|
|
||||||
|
|
||||||
== configure doesn't detect libtiff, or other graphic libraries.
|
|
||||||
|
|
||||||
Smažte soubor config.cache, pak znovu spusťte configure s následujícími
|
|
||||||
volbami (a jinými, které používáte):
|
|
||||||
--with-libs-from="-L/usr/local/lib"
|
|
||||||
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
|
|
||||||
Na příslušná místa vložte cesty k vaším grafickým knihovnám a odpovídajícím
|
|
||||||
hlavičkovým souborům. Můžete zadat několik cest do těchto voleb, jako je to
|
|
||||||
ve výše uvedeném příkladě --with-incs-from. Jenom je nezapomeňte oddělit
|
|
||||||
mezerou.
|
|
||||||
|
|
||||||
== configure doesn't detect libXpm.
|
|
||||||
|
|
||||||
* Zkontrolujte, jestli máte symbolický link ze souboru libXpm.so.4.9 na
|
|
||||||
soubor libXpm.so
|
|
||||||
|
|
||||||
== Segmentation fault on startup
|
|
||||||
|
|
||||||
* Zkontrolujte, jestli verze knihovny libXPM je vyšší než 4.7
|
|
||||||
|
|
||||||
* Zkontrolujte, zda-li máte upravenou verzi ~/GNUstep/Defaults/WindowMaker
|
|
||||||
Pokud si nejste jisti, tak zkuste přejmenovat ~/GNUstep na ~/GNUtmp a
|
|
||||||
spusťte wmaker.inst
|
|
||||||
|
|
||||||
== "...: your machine is misconfigured. gethostname() returned (none)"
|
|
||||||
|
|
||||||
* Jméno vašeho počítače je nastaveno nesprávně, protože začíná uvozovkami.
|
|
||||||
Spusťte man hostname a zde se dozvíte, jak změnit jméno vašeho počítače.
|
|
||||||
|
|
||||||
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
|
|
||||||
|
|
||||||
* Window Maker nemůže nalézt cpp (preprocesor jazyka C). Pokud se váš cpp
|
|
||||||
nenachází v /lib/cpp, tak otevřte soubor src/config.h a nastavte správně
|
|
||||||
cestu CPP_PATH.
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from true; giving up
|
|
||||||
|
|
||||||
* Přečtěte si odstavec POŽADAVKY na začátku tohoto souboru.
|
|
||||||
|
|
||||||
MÍSTNÍ NASTAVENÍ / INTERNACIONALIZACE
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
Window Maker má podporu národních jazyků. Aby jste ji povolili, tak
|
|
||||||
musíte zkompilovat Window Maker s několika dalšími parametry.
|
|
||||||
Seznam podporovaných jazyků naleznete v souboru ./po/README.
|
|
||||||
|
|
||||||
0 - Musíte mít nainstalovaný balíček GNU gettextu. Tento balíček
|
|
||||||
můžete nalézt na ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
|
|
||||||
|
|
||||||
Kroky 1,2 a 3 můžete vynechat, pokud používáte skript Install.cs nebo
|
|
||||||
skript Install.
|
|
||||||
|
|
||||||
1 - Vyberte si jazyky, které budete chtít používat. Zadejte seznam
|
|
||||||
těchto jazyků do systémové proměnné LINGUAS. Angličtina je
|
|
||||||
podporována vždy. Příklady
|
|
||||||
|
|
||||||
C - shell:
|
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
|
||||||
|
|
||||||
Bash(sh):
|
|
||||||
|
|
||||||
export LINGUAS
|
|
||||||
LINGUAS="pt ja de"
|
|
||||||
|
|
||||||
Přečtěte si soubor po/README pokud chcete přeložit Window Maker
|
|
||||||
pro nějaký další jazyk.
|
|
||||||
|
|
||||||
2 - Navíc, pokud váš jazyk používá multi-byte znaky, například Japonština
|
|
||||||
nebo Korejština, tak musíte nastavit volbu the MultiByteText na YES
|
|
||||||
v souboru ~/GNUstep/Defaults/WMGLOBAL
|
|
||||||
|
|
||||||
3 - Nakonfigurujte, zkompilujte a nainstalujte Window Maker jako obvykle.
|
|
||||||
|
|
||||||
4 - Národní prostředí si můžete změnit i za běhu Window Makeru. Systémovou
|
|
||||||
proměnnou LANG nastavíte na vámi zvolenou hodnotu. Například, pokud
|
|
||||||
chcete použít portugalské prostředí, musíte spustit:
|
|
||||||
|
|
||||||
C - shell:
|
|
||||||
|
|
||||||
setenv LANG pt
|
|
||||||
|
|
||||||
Bourne shell a podobné:
|
|
||||||
|
|
||||||
export LANG
|
|
||||||
LANG=pt
|
|
||||||
|
|
||||||
Nakonec musíte restartovat/spustit Window Maker.
|
|
||||||
|
|
||||||
Poznámka: Když máte nastavenou systémovou proměnnou LC_TYPE, tak jí
|
|
||||||
musíte zrušit před spuštěním Window Makeru.
|
|
||||||
|
|
||||||
Window Maker hledá soubory s definicí menu v tomto pořadí (pro
|
|
||||||
brazilskou portugalštinu):
|
|
||||||
|
|
||||||
menu.pt_BR
|
|
||||||
menu.pt
|
|
||||||
menu
|
|
||||||
|
|
||||||
5 - Pokud si vyberete jazyk, který používá multi-byte znaky, tak musíte
|
|
||||||
příslušným způsobem nastavit fonty. Přečtěte si manuálové stránky
|
|
||||||
o XCreateFontSet k získání většího množství informací o daném
|
|
||||||
problému. Musíte změnit v souboru ~/GNUstep/Default/WindowMaker
|
|
||||||
nastavení fontů pro titulky, menu, atd. Fonty pro dialogy nastavíte
|
|
||||||
v souboru ~/GNUstep/Default/WMGLOBAL. Řetězce %d ve jménech fontů
|
|
||||||
nemusí být odstraněné. Také můžete použít skript wsetfont, který
|
|
||||||
toto vše učiní za vás. Pokud se ho rozhodnote použít, tak si k němu
|
|
||||||
přečtěte instrukce tak, že spustíte wsetfont bez argumentů.
|
|
||||||
|
|
||||||
Příklad části souboru ~/GNUstep/Default/WindowMaker:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
|
|
||||||
a souboru ~/GNUstep/Default/WMGLOBAL:
|
|
||||||
|
|
||||||
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
|
|
||||||
Tyto dva fonty jsou používány v aplikacích, které používají WINGs (WindowMaker a
|
|
||||||
WPrefs.app).
|
|
||||||
|
|
||||||
Skript wsetfont vám umožní nastavit fonty mnohem jednoduším způsobem. Podívejte
|
|
||||||
se na jeho manuálové stránku k získání bližších informací.
|
|
||||||
594
INSTALL.es
594
INSTALL.es
@@ -1,594 +0,0 @@
|
|||||||
|
|
||||||
Instrucciones de Instalación para Window Maker
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PLATAFORMAS SOPORTADAS
|
|
||||||
======================
|
|
||||||
(obs: Alguien me mencionó que lo compiló en...)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Conectiva 5.9 (beta)
|
|
||||||
- Intel GNU/Linux Slackware
|
|
||||||
- Intel GNU/Linux Debian
|
|
||||||
- Intel GNU/Linux other distributions
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 over MacOS
|
|
||||||
- Amiga 3000 running RedHat Linux 5.1 (Rawhide)
|
|
||||||
- IBM S/390 running Linux
|
|
||||||
- iBook running Darwin
|
|
||||||
- Windows NT with Cygwin/XFree86
|
|
||||||
- Sony PlayStation2 running Linux
|
|
||||||
|
|
||||||
Todas las marcas registradas están registradas por sus dueños. (duh)
|
|
||||||
|
|
||||||
Los parches que lo hagan funcionar en otras plataformas son bienvenidos.
|
|
||||||
|
|
||||||
|
|
||||||
REQUERIMIENTOS:
|
|
||||||
==============
|
|
||||||
|
|
||||||
El siguiente software se necesita para usar Window Maker:
|
|
||||||
|
|
||||||
- X11R6.x
|
|
||||||
Window Maker puede ser compilado en versiones más antiguas de X,
|
|
||||||
como X11R5 (Solaris) o X11R4 (OpenWindows) pero no funcionará 100%
|
|
||||||
correctamente.
|
|
||||||
En tales servidores no habrá íconos de aplicación y tendrá problemas
|
|
||||||
usando el dock. Actualizar las bibliotecas cliente (Xlib, Xt, etc)
|
|
||||||
ayudará si no puede actualizar el servidor.
|
|
||||||
|
|
||||||
Lo siguiente se necesita para compilar Window Maker:
|
|
||||||
|
|
||||||
- Requerimientos básicos y obvios
|
|
||||||
Si compila Window Maker, asegúrese de tener gcc (u algún otro
|
|
||||||
compilador ANSI C) y los archivos header de X instalados. Especialmente
|
|
||||||
para los usuarios de Linux principiantes: debe instalar todos los paquetes
|
|
||||||
de desarrollo de X y la suite gcc. De lo contrario no será capaz de
|
|
||||||
compilar ningún programa X, incluyendo Window Maker.
|
|
||||||
|
|
||||||
- libPropList
|
|
||||||
Esta biblioteca se puede encontrar en ftp://ftp.windowmaker.info/pub/libs
|
|
||||||
o en ftp://ftp.gnome.org/pub/libPropList
|
|
||||||
Instálela antes de compilar Window Maker.
|
|
||||||
|
|
||||||
- autoconf, automake y libtool
|
|
||||||
Estas herramientas NO son necesarias, pero SI tiene una o más de ellas
|
|
||||||
instaladas, asegúrese de tener TODO lo siguiente con estas versiones
|
|
||||||
exactas:
|
|
||||||
|
|
||||||
autoconf 2.54
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.4.2
|
|
||||||
|
|
||||||
Si tiene una versión distinta, desactívelas temporalemte renombrándolas
|
|
||||||
a otras cosa o desinstalándolas desde su sistema. Si no desarrolla
|
|
||||||
software no las necesita, así que puede desinstalarla sin peligro.
|
|
||||||
|
|
||||||
- lex (o flex) y yacc (o bison)
|
|
||||||
Estas son usadas por libPropList. lex en realidad no se necesita ya que
|
|
||||||
su archivo de salida está incluido, pero o yo o automake es tonto,
|
|
||||||
causando que el script configure para libPropList simplemente
|
|
||||||
aborte sin ningún motivo si lex no es encontrado.
|
|
||||||
|
|
||||||
OPCIONAL:
|
|
||||||
=========
|
|
||||||
Estas bibliotecas no son necesarias para hacer que Window Maker funcione,
|
|
||||||
pero están soportadas en caso de que quiera usarlas. Los números de versión
|
|
||||||
son aquellos que yo tengo (y por lo tanto, garantizo que funciona), pero
|
|
||||||
otras versiones podría funcionar también.
|
|
||||||
|
|
||||||
- libXPM 4.7 o más actual.
|
|
||||||
Versiones antiguas pueden no funcionar!!!
|
|
||||||
Disponible en ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
|
||||||
|
|
||||||
Hay soporte nativo para archivos XPM, pero no cargará imagenes de
|
|
||||||
algunos formatos poco comunes.
|
|
||||||
|
|
||||||
-libpng 0.96 o más actual y zlib
|
|
||||||
Para soporte de imágenes PNG.
|
|
||||||
http://www.cdrom.com/pub/png/
|
|
||||||
|
|
||||||
- libtiff 3.4 o más actual.
|
|
||||||
Para soporte de imaen TIFF.
|
|
||||||
Puede obtenerla en ftp://ftp.sgi.com/graphics/tiff
|
|
||||||
|
|
||||||
- libjpeg 6.0.1 o más actual
|
|
||||||
Para soporte de imagen JPEG
|
|
||||||
http://www.ijg.org/
|
|
||||||
|
|
||||||
- libgif 2.2 o libungif
|
|
||||||
Para soporte de imagen GIF.
|
|
||||||
ftp://prtr-13.ucsc.edu/pub/libungif/
|
|
||||||
|
|
||||||
- GNU xgettext
|
|
||||||
Si quiere usar mensajes traducidos, necesitará GNU gettext.
|
|
||||||
Otras versiones de gettext no son compatibles y no funcionarán.
|
|
||||||
Obtenga la versión GNU desde ftp://ftp.gnu.org
|
|
||||||
|
|
||||||
OPCIONES DE CONFIGURACIÓN:
|
|
||||||
=========================
|
|
||||||
Estas opciones pueden ser pasadas al script configure para activar/desactivar
|
|
||||||
algunas opciones de Window Maker. Ejemplo:
|
|
||||||
|
|
||||||
./configure --enable-kde --enable-gnome
|
|
||||||
|
|
||||||
configurará Window Maker para que sea compilado con soporte para KDE y GNOME.
|
|
||||||
|
|
||||||
Para obtener una lista de otras opciones, ejecute ./configure --help
|
|
||||||
|
|
||||||
--with-libs-from
|
|
||||||
especifica rutas adicionales por donde se debe buscar bibliotecas.
|
|
||||||
El -L flag debe preceder a cada ruta, tal como:
|
|
||||||
|
|
||||||
--with-libs-from="-L/opt/libs -L/usr/local/lib"
|
|
||||||
|
|
||||||
--with-incs-from
|
|
||||||
especifica rutas adicionales para la búsqueda de archivos header.
|
|
||||||
El parámetro -I debe preceder a cada ruta, tal como:
|
|
||||||
|
|
||||||
--with-incs-from="-I/opt/headers -I/usr/local/include"
|
|
||||||
|
|
||||||
--enable-single-icon
|
|
||||||
activa el agrupamiento de todos los appicons (iconos de aplicaciones)
|
|
||||||
del WM_CLASS+WM_INSTANCE en uno solo. Esta característica no es soportada
|
|
||||||
por todos los desarrolladores. Si tiene algún problema con ella, contacte
|
|
||||||
a su autor: Christopher Seawood <cls@seawood.org>
|
|
||||||
|
|
||||||
--disable-shm
|
|
||||||
desactiva el uso de la extensión MIT de memoria compartida. Esto
|
|
||||||
ralentizará la generación de texturas un poco, pero en algunos casos
|
|
||||||
parecerá necesario debido a un error que se manifiesta como íconos y
|
|
||||||
texturas desordenadas.
|
|
||||||
|
|
||||||
--disable-motif
|
|
||||||
desactiva el soporte para el gestor de ventanas mwm.
|
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
quita cosas que ya están soportadas en los entornos de escritorio,
|
|
||||||
tal como KDE y Gnome. Desactiva cosas como: lista de ventanas,
|
|
||||||
menú de aplicaciones raíz, selección de ventanas múltiple. Note
|
|
||||||
que no podrá salir más desde dentro de Window Maker; tendrá que usar
|
|
||||||
kill con la señal SIGTERM o salir de KDE. No aconsejo activarlo.
|
|
||||||
|
|
||||||
--enable-modelock
|
|
||||||
Soporte para bloqueo de estado de lenguaje XKB. Si no sabe que es esto
|
|
||||||
probablemente no lo necesite.
|
|
||||||
|
|
||||||
--enable-sound
|
|
||||||
activa el soporte del módulo para efectos sonoros.
|
|
||||||
|
|
||||||
--disable-xpm
|
|
||||||
desactiva el uso de la biblioteca XPM aunque este disponible en su
|
|
||||||
sistema.
|
|
||||||
|
|
||||||
--disable-png
|
|
||||||
desactiva el uso de la biblioteca PNG.
|
|
||||||
|
|
||||||
--disable-tiff
|
|
||||||
desactiva el uso de la biblioteca TIFF.
|
|
||||||
|
|
||||||
--disable-gif
|
|
||||||
desactiva el uso de la biblioteca GIF.
|
|
||||||
|
|
||||||
--disable-jpeg
|
|
||||||
desactiva el uso de la biblioteca JPEG.
|
|
||||||
|
|
||||||
--disable-shape
|
|
||||||
desactiva la forma de ventanas (para oclock, xeyes etc.)
|
|
||||||
|
|
||||||
NOTAS ESPECÍFICAS A LA PLATAFORMA:
|
|
||||||
=================================
|
|
||||||
|
|
||||||
- máquinas DEC/Alpha
|
|
||||||
|
|
||||||
#>>>>>>>>>>>
|
|
||||||
From: Anton Ivanov <aivanov@eu.level3.net>
|
|
||||||
To: Marcelo E. Magallon <mmagallo@debian.org>
|
|
||||||
Subject: Re: El paquete WindowMaker funciona bien en Alpha?
|
|
||||||
|
|
||||||
> Hola,
|
|
||||||
>
|
|
||||||
> Estuve leyendo algunos documentos en el tarball de WindowMaker,
|
|
||||||
> y encontré esto:
|
|
||||||
>
|
|
||||||
> | - máquinas DEC/Alpha
|
|
||||||
> | podría necesitar pasar el parámetro --disable-shm a configure,
|
|
||||||
> | así ./configure --disable-shm
|
|
||||||
>
|
|
||||||
> alguien está teniendo problemas con WindowMaker en Alpha? Puede alguien
|
|
||||||
> por favor probar esto? Debería el parámetro ser pasado al compilar
|
|
||||||
> en Alpha?
|
|
||||||
|
|
||||||
Descargo de responsabilidad: alphas bajo mi mando nunca han ejecutado X
|
|
||||||
y es poco probable de que las ejecute repentinamente en algún momento.
|
|
||||||
|
|
||||||
Alpha suele tener alguna ridícula poca cantidad de memoria compartida
|
|
||||||
configurada.
|
|
||||||
|
|
||||||
Así que muchísimas aplicaciones suelen to barf. Concretamente - cdrecord, mysql server, etc.
|
|
||||||
|
|
||||||
Verifique donde está el suyo en este momento y súbalo a un valor más adecuado catting la entrada
|
|
||||||
adecuada de /proc o cambiando el /usr/src/linux/include/asm/shmparam.h.
|
|
||||||
|
|
||||||
De lo contrario la memoria compartida en alpha debiera ser completamente funcional y no veo razón
|
|
||||||
para desactivarla. Las mías están aumentadas a 32 o más en muchas máquinas.
|
|
||||||
|
|
||||||
Y si recuerdo correctamente los comentarios en aquél archivo están en realidad mal.
|
|
||||||
El valor no está en bytes, pero si en palabra de tamaño máquina. Para alpha *8.
|
|
||||||
|
|
||||||
Como dije - no ejecuto X en ellas asi que apliqué a todas #include "stdisclaimer.h".
|
|
||||||
#<<<<<<<<<<<<
|
|
||||||
|
|
||||||
- SCO Unix - ejecute configure así
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
-SunOS, Solaris
|
|
||||||
Si tiene gcc instalado, ejecute configure como:
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
Sun cpp le falta algunas características que necesita Window Maker y
|
|
||||||
puede causarle problemas al analizar sintacticamente los archivos config.
|
|
||||||
También podría necesitar usar el --with-libs-from y --with-incs-from para
|
|
||||||
suministrarle el directorio donde libtiff se aloja.
|
|
||||||
Alguien me envió un mensaje diciéndome que también debe hacer que /usr/local/lib
|
|
||||||
sea la primera ruta en LD_LIBRARY_PATH para que funcione.
|
|
||||||
|
|
||||||
Si tiene un Ultra Creator 3D o alguna otra máquina con gráficos high-end,
|
|
||||||
asegúrese de iniciar el servidor X con el valor visual por defecto a 24bpp o
|
|
||||||
podría experimentar problemas con colores destrozados.
|
|
||||||
Este es un error de wmaker y será reparado.
|
|
||||||
|
|
||||||
- GNU/Linux en general
|
|
||||||
Asegúrese de tener /usr/local/lib en /etc/ld.so.conf y de ejecutar
|
|
||||||
ldconfig después de instalar.
|
|
||||||
Desinstale cualquier versión empaquetada de Window Maker antes de
|
|
||||||
instalar una nueva versión.
|
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
|
||||||
Los sistemas RedHat tienen varios problemas molestos. Si lo usa,
|
|
||||||
asegúrese de seguir los pasos de más abajo o Window Maker no funcionará:
|
|
||||||
|
|
||||||
* si instaló el Window Maker que viene con RedHat, desinstálelo antes de
|
|
||||||
actualizar;
|
|
||||||
|
|
||||||
*asegúrese que no tiene las variables de entorno LANG y LINGUAS establecidas a
|
|
||||||
en_RN;
|
|
||||||
|
|
||||||
*asegúrese de tener /usr/local/bin en su variable de entorno PATH;
|
|
||||||
|
|
||||||
* asegúrese de tener /usr/local/lib en /etc/ld.so.conf antes de ejecutar
|
|
||||||
ldconfig;
|
|
||||||
|
|
||||||
*si tiene problemas que mencionan un menaje de error con --no-reexec
|
|
||||||
desinstale libtool-1.2b e instale libtool-1.3 en su lugar. libtool-1.3
|
|
||||||
se puede encontrar en ftp.gnu.org. También lea la sección TROUBLESHOOTING
|
|
||||||
(PROBLEMAS);
|
|
||||||
|
|
||||||
* si instaló el paquete Window Maker desde RedHat y está instalando una
|
|
||||||
nueva versión de WM a mano (compilandolo usted mismo), desinstale antes el
|
|
||||||
paquete desde RedHat.
|
|
||||||
|
|
||||||
*asegúrese de tener un enlace simbólico desde /usr/include/X11 hacia
|
|
||||||
/usr/X11R6/include/X11 (si no, tipee ln -s /usr/X11R6/include/X11 /usr/include/X11)
|
|
||||||
|
|
||||||
* asegúrese de tener /lib/cpp apuntando al programa cpp.
|
|
||||||
|
|
||||||
Si tiene alguna duda en cuanto a hacer algunas de las cosas de arriba,
|
|
||||||
por favor no dude en contactar el soporte para usuarios de RedHat. Ellos
|
|
||||||
responderán amablemente a todas sus preguntas en lo que respecta a su sistema.
|
|
||||||
Ellos también conocen mucho más acerca de su propio sistema que nosotros
|
|
||||||
(nosotros no usamos RedHat).
|
|
||||||
|
|
||||||
- PowerPC MkLinux
|
|
||||||
Necesitará tener la última version de Xpmac. Las versiones más antiguas
|
|
||||||
parecen tener errores que producen el cuelgue del sistema.
|
|
||||||
|
|
||||||
- Debian GNU/Linux
|
|
||||||
Si quiere soporte JPEG y TIFF, asegúrese de tener libtiff-dev y
|
|
||||||
libjpeg-dev instalados.
|
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
|
||||||
Si instaló el paquete Window Maker desde SuSE,
|
|
||||||
desinstálelo antes de instentar compilar wmaker o podría
|
|
||||||
tener problemas.
|
|
||||||
|
|
||||||
|
|
||||||
- MetroX (version desconocida)
|
|
||||||
MetroX tiene un error que corrompe pixmaps que se establecen como
|
|
||||||
fondos de ventana. Si usa MetroX y tuvo problemas raros con texturas, no use
|
|
||||||
texturas en las barras de títulos. O use un servidor X distinto.
|
|
||||||
|
|
||||||
INSTALACIÓN:
|
|
||||||
=============
|
|
||||||
|
|
||||||
Compilando Window Maker
|
|
||||||
------------------
|
|
||||||
Para un comienzo rápido, tipee lo siguiente en el prompt del shell:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
luego, regístrese como root y tipee:
|
|
||||||
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
o si quiere remover los símbolos de depuración desde los binarios y hacerlos más
|
|
||||||
pequeños, puede tipear:
|
|
||||||
|
|
||||||
make install-strip
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
Esto compilará e instalará Window Maker con los parámetros por defecto.
|
|
||||||
|
|
||||||
Si quiere personalizar algunas opciones de compilación, puede hacer lo siguiente.
|
|
||||||
|
|
||||||
1. (opcional)Mire en la sección OPCIONES DE CONFIGURACIÓN para ver las
|
|
||||||
opciones disponibles. También ejecute:
|
|
||||||
|
|
||||||
./configure --help
|
|
||||||
|
|
||||||
para obtener un listado completo de otras opciones que están disponibles.
|
|
||||||
|
|
||||||
2. Ejecute configure con las opciones que quiera. Por ejemplo, si quiere
|
|
||||||
usar la opción --enable-kde, tipee:
|
|
||||||
|
|
||||||
./configure --enable-kde
|
|
||||||
|
|
||||||
3. (opcional) Edite src/wconfig.h con su editor de texto favorito y
|
|
||||||
echele un vistazo por algunas opciones que podría querer cambiar.
|
|
||||||
|
|
||||||
4. Compile. Solo tipee:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
5. Regístrese como root (si no puede hacerlo, lea la sección "No tengo la contraseña de root" :-()
|
|
||||||
e instale Window Maker en su sistema:
|
|
||||||
su root
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
Configuración específica del usuario
|
|
||||||
------------------------------------
|
|
||||||
|
|
||||||
Estas instrucciones no necesitan ser seguidas al actualizar Window Maker
|
|
||||||
desde una versión más antigua, a menos que se indique de otra forma en el archivo
|
|
||||||
NEWS.
|
|
||||||
|
|
||||||
Todo usuario en su sistema que desee ejecutar Window Maker debe hacer lo siguiente:
|
|
||||||
|
|
||||||
1. Instale los archivos de configuración de Window Maker en su directorio home.
|
|
||||||
Tipee:
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
wmaker.inst instalará los archivos de configuración de Window Maker y
|
|
||||||
configurará X para que automáticamente lance Window Maker al inicio.
|
|
||||||
|
|
||||||
Eso es todo!
|
|
||||||
|
|
||||||
Puede tipear "man wmaker" para obtener algo de ayuda general para la
|
|
||||||
configuración y otras cosas.
|
|
||||||
Lea la Guia de Usuario para una explicación más a fondo de Window Maker.
|
|
||||||
|
|
||||||
Podría querer dar una mirada a la FAQ también.
|
|
||||||
|
|
||||||
Instalando el paquete extras
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Desempaquete WindowMaker-extra-<número-de-versión>.tar.gz en /usr/local/share
|
|
||||||
|
|
||||||
Puede obtener el archivo en ftp://ftp.windowmmaker.org. Este archivo es optativo
|
|
||||||
y solo tiene unos pocos íconos, y temas. Busque el último <número-de-versión>
|
|
||||||
disponible.
|
|
||||||
También hay un WindowMaker-extra.readme que le enseña donde vería ir ese paquete.
|
|
||||||
|
|
||||||
|
|
||||||
No tengo la contraseña de root :(
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
Si no puede obtener privilegios de superusuario (no puede ser root) puede
|
|
||||||
instalar wmaker en su propio directorio home. Para esto, proporcione la
|
|
||||||
opción --prefix al ejecutar configure en el paso 2 de compilando Window Maker.
|
|
||||||
También necesitará proporcionar la opción --with-appspath, para especificar la ruta
|
|
||||||
para WPrefs.app. Ejemplo:
|
|
||||||
|
|
||||||
./configure --prefix=/home/jshmoe --with-appspath=/home/jshmoe/GNUstep/Applications
|
|
||||||
|
|
||||||
Luego haga /home/jshmoe/bin para que se lo incluya en su ruta de búsqueda, agregue
|
|
||||||
/home/jshmoe/lib a su variable de entorno LD_LIBRARY_PATH y ejecute bin/wmaker.inst
|
|
||||||
|
|
||||||
Por supuesto, /home/jshmoe se supone que va a ser reemplazado con la ruta a su
|
|
||||||
directorio home real.
|
|
||||||
|
|
||||||
|
|
||||||
ACTUALIZANDO
|
|
||||||
============
|
|
||||||
Si está actualizando desde una versión antigua de Window Maker:
|
|
||||||
|
|
||||||
1. Configure y compile Window Maker como siempre.
|
|
||||||
2. Instale Window Maker (pero no ejecute wmaker.inst)
|
|
||||||
3. Lea el archivo NEWS y actualice sus archivos de configuración,
|
|
||||||
si es necesario.
|
|
||||||
|
|
||||||
PROBLEMAS
|
|
||||||
=========
|
|
||||||
|
|
||||||
Cuando tenga alguno problemas durante la configuración (al ejecutar configure),
|
|
||||||
tal como no poder usar una biblioteca de formato gráfico que piensa tener instalada,
|
|
||||||
mire en el archivo config.log para obtener ideas sobre el problema.
|
|
||||||
|
|
||||||
== Error al cargar las fuentes, siempre que existan.
|
|
||||||
|
|
||||||
Intente recompilar sin el soporte NLS.
|
|
||||||
|
|
||||||
== Error al configurar
|
|
||||||
|
|
||||||
ltconfig: unrecognized option `--no-reexec'
|
|
||||||
Try `ltconfig --help' for more information.
|
|
||||||
configure: error: libtool configure failed
|
|
||||||
|
|
||||||
quite la opción --no-reexec desde aclocal.m4 y libPropList/aclocal.m4 y
|
|
||||||
reconfigure.
|
|
||||||
También asegúrese que las versiones de autoconf y automake que tenga instaladas son:
|
|
||||||
|
|
||||||
autoconf 2.13
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.3
|
|
||||||
|
|
||||||
Note que ella no debe ser libtool 1.2b, debe ser libtool 1.3,
|
|
||||||
desde los sitios GNU.
|
|
||||||
|
|
||||||
== No puedo encontrar proplist.h o libPropList.something
|
|
||||||
|
|
||||||
Baje e instale libPropList desde los lugares ya citados en algún lugar
|
|
||||||
de este archivo.
|
|
||||||
|
|
||||||
== configure no detecta libtiff, u otras bibliotecas gráficas.
|
|
||||||
|
|
||||||
Elimine config.cache, luego vuelva a ejecutar configure añadiendo las siguientes
|
|
||||||
opciones a configure (entre sus otras opciones):
|
|
||||||
|
|
||||||
--with-libs-from="-L/usr/local/lib"
|
|
||||||
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
|
|
||||||
|
|
||||||
Sustituya las rutas donde están localizadas sus bibliotecas gráficas y sus
|
|
||||||
correspondientes archivos header. Puede colocar rutas múltiples en cualquiera de
|
|
||||||
estas opciones, como se muestra en el ejemplo de --with-incs-from . Solo coloque
|
|
||||||
un espacio entre ellas.
|
|
||||||
|
|
||||||
== configure no detecta libXpm.
|
|
||||||
|
|
||||||
* Verifique si tiene un enlace simbólico desde libXpm.so.4.9 a libXpm.so
|
|
||||||
|
|
||||||
== Segmentation fault al inicio.
|
|
||||||
|
|
||||||
* Verifique si la versión de libXPM que tiene es por lo menos la 4.7
|
|
||||||
|
|
||||||
* Verifique si tiene una versión actualizada de ~/GNUstep/Defaults/WindowMaker
|
|
||||||
|
|
||||||
Si no está seguro, intente renombrar ~/GNUstep a ~/GNUtmp y luego ejecute wmaker.inst
|
|
||||||
|
|
||||||
== "...: your machine is misconfigured. gethostname() returned (none)"
|
|
||||||
|
|
||||||
* el hostname de su máquina está definido a algo inválido, como comenzar con
|
|
||||||
un paréntesis. Haga un man hostname para obtener información acerca de como definirlo.
|
|
||||||
|
|
||||||
|
|
||||||
== El menú raíz contiene solo 2 entradas. ("XTerm" y "Exit...")
|
|
||||||
|
|
||||||
* Window Maker no está encontrando cpp (el preprocesador de C). Si su
|
|
||||||
cpp no está ubicado en /lib/cpp, edite src/config.h y corrija la ruta en
|
|
||||||
CPP_PATH.
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from true; giving up
|
|
||||||
|
|
||||||
* Lea la sección REQUERIMIENTOS de este archivo.
|
|
||||||
|
|
||||||
|
|
||||||
LOCALES/INTERNACIONALIZACIÓN
|
|
||||||
============================
|
|
||||||
|
|
||||||
Window Maker tiene soporte de idioma nacional. Para activar este soporte,
|
|
||||||
debe compilar Window Maker con algunos parámetros adicionales.
|
|
||||||
|
|
||||||
0 - Debe tener el paquete GNU gettext instalado. Puede obtenerse en
|
|
||||||
ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
|
|
||||||
|
|
||||||
Los pasos 1 al 3 pueden saltearse si usa el script Install.
|
|
||||||
|
|
||||||
1 - Debe seleccionar los idiomas que quiere soportar. Defina el
|
|
||||||
LINGUAS a la lista de locales que quiera. El Inglés siempre está
|
|
||||||
soportado. Ejemplo:
|
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
|
||||||
en csh
|
|
||||||
|
|
||||||
o
|
|
||||||
|
|
||||||
export LINGUAS;LINGUAS="pt ja de"
|
|
||||||
en sh
|
|
||||||
|
|
||||||
La lista de locales soportados se pueden encontrar en po/README.
|
|
||||||
El Inglés es el idioma pr defecto.
|
|
||||||
|
|
||||||
Lea po/README si desea traducir y mantener archivos locale para otros
|
|
||||||
idiomas.
|
|
||||||
|
|
||||||
2 - Adicionalmente, si su idioma usa caracteres multi-byte, tal como
|
|
||||||
Japonés o Coreano, debe definir la opción MultiByteText a YES
|
|
||||||
en ~/GNUstep/Defaults/WMGLOBAL
|
|
||||||
|
|
||||||
3 - Configure, compile e instale Window Maker normalmente.
|
|
||||||
|
|
||||||
4 - Para seleccionar un locale particular en tiempo de ejecución debe definir la
|
|
||||||
variable de entorno LANG al locale que quiera. Por ejemplo, si quiere definir
|
|
||||||
el locale portugués, debe ejecutar
|
|
||||||
|
|
||||||
setenv LANG pt
|
|
||||||
|
|
||||||
en csh o
|
|
||||||
|
|
||||||
export LANG; LANG=pt
|
|
||||||
|
|
||||||
en Bourne sh y similares
|
|
||||||
|
|
||||||
Nota: Si tiene definida la variable de entorno LC_CTYPE, debe
|
|
||||||
indefinirla antes de ejecutar wmaker.
|
|
||||||
|
|
||||||
Window Maker busca los archivos de definición de menú en el siguiente orden:
|
|
||||||
(para portugués brasileño, en este caso):
|
|
||||||
|
|
||||||
menu.pt_BR
|
|
||||||
menu.pt
|
|
||||||
menu
|
|
||||||
|
|
||||||
5 - Si elige un idioma que usa caracteres multi-byte, debe configurar
|
|
||||||
las fuentes adecuadamente. Lea la página del manual para XCreateFontSet
|
|
||||||
para obtener más detalles sobre esto. Debe cambiar el archivo ~/G/D/Windowmaker
|
|
||||||
para las fuentes usadas en barras de título, menús y otras cosas. Para las fuentes
|
|
||||||
usadas en ventanas de diálogo, cambie ~/G/D/WMGLOBAL. El %d en los nombres de las
|
|
||||||
fuentes no debe ser quitado. Puede también usar el script wsetfont proporcionado para
|
|
||||||
esta tarea. Lea el mismo script para obtener instrucciones.
|
|
||||||
|
|
||||||
Por ejemplo, puede especificar lo siguiente en ~/G/D/WindowMaker:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
|
|
||||||
y en ~/G/D/WMGLOBAL:
|
|
||||||
|
|
||||||
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
|
|
||||||
Las 2 fuentes de arriba son usadas únicamente por aplicaciones que usan WINGs
|
|
||||||
(WindowMaker y WPrefs.app)
|
|
||||||
|
|
||||||
El script wsetfont que se proporciona le permitirá cambiar las definiciones de fuentes
|
|
||||||
de una manera fácil. De una mirada al script para detalles de uso.
|
|
||||||
|
|
||||||
traducido por Efraín Maximiliano Palermo <max_drake2001@yahoo.com.ar>
|
|
||||||
631
INSTALL.fr
631
INSTALL.fr
@@ -1,631 +0,0 @@
|
|||||||
|
|
||||||
Instructions pour l'installation de Window Maker
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PLATEFORMES SUPPORTÉES
|
|
||||||
======================
|
|
||||||
(c.à.d. : j'ai entendu dire que la compilation a été réalisée avec succès sur..)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Conectiva 5.9 (beta)
|
|
||||||
- Intel GNU/Linux Slackware
|
|
||||||
- Intel GNU/Linux Debian
|
|
||||||
- Intel GNU/Linux (autres)
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- Solaris 2.8 sur Ultra Sparc 10 et E450
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 sous MacOS
|
|
||||||
- Amiga 3000 sous RedHat Linux 5.1 (Rawhide)
|
|
||||||
- IBM S/390 sous Linux
|
|
||||||
- IBM S/390 sous Conectiva Linux (experimental)
|
|
||||||
- iBook sous Darwin
|
|
||||||
- Windows NT sous Cygwin/XFree86
|
|
||||||
- Sony PlayStation2 sous Linux
|
|
||||||
|
|
||||||
Toutes les marques déposées sont la propriété de leur propriétaire.
|
|
||||||
|
|
||||||
Tout patch qui pourrait faciliter l'adaptation à d'autres plateformes
|
|
||||||
est le bienvenu.
|
|
||||||
|
|
||||||
|
|
||||||
PRÉ-REQUIS
|
|
||||||
==========
|
|
||||||
|
|
||||||
Les logiciels suivants sont nécessaires à l'utilisation de Window Maker :
|
|
||||||
|
|
||||||
- X11R6.x
|
|
||||||
Window Maker peut être compilé avec des versions plus anciennes de X,
|
|
||||||
comme X11R5 (Solaris) ou X11R4 (OpenWindows), mais il ne fonctionnera
|
|
||||||
pas correctement à 100%.
|
|
||||||
Avec ces serveurs X, les icônes des applications n'apparaîtrons pas,
|
|
||||||
et vous aurez des problèmes à l'utilisation du dock. La mise à jour
|
|
||||||
des librairies côté client (Xlib, Xt, etc.) pourront améliorer les
|
|
||||||
choses si vous ne pouvez pas mettre à jour le serveur.
|
|
||||||
|
|
||||||
Les éléments suivants sont nécessaires à la compilation de Window Maker :
|
|
||||||
|
|
||||||
- pré-requis de base
|
|
||||||
Pour compiler Window Maker, assurez-vous que gcc (ou tout autre
|
|
||||||
compilateur de C ANSI) ainsi que les fichiers d'en-têtes de X sont
|
|
||||||
installés. Débutants sous Linux : vous devez installer les paquetages
|
|
||||||
de développement de X ainsi que ceux de la suite gcc. Le cas contraire,
|
|
||||||
vous ne pourrez jamais compiler aucun programme prévu pour X, y compris
|
|
||||||
Window Maker.
|
|
||||||
|
|
||||||
- autoconf, automake et libtool
|
|
||||||
Ces outils ne sont pas indispensables, mais si au moins l'un d'eux
|
|
||||||
est installé sur votre système, assurez-vous que TOUS le sont, et
|
|
||||||
que les versions de ces outils sont exactement :
|
|
||||||
autoconf 2.54
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.4.2
|
|
||||||
Si les versions installées sur votre système différent, désactivez-les
|
|
||||||
provisoirement, par exemple en les renommant, ou en les désinstallant
|
|
||||||
de votre système. Si vous ne développez ni de compilez de logiciels,
|
|
||||||
vous n'en avez pas besoin et leur désinstallation n'est donc pas un
|
|
||||||
problème.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONNEL
|
|
||||||
=========
|
|
||||||
|
|
||||||
Ces librairies ne sont pas nécessaires pour utiliser Window Maker, mais
|
|
||||||
elles sont supportées, au cas où vous souhaiteriez les utiliser. Les
|
|
||||||
versions ci-dessous sont celles dont je dispose (et du coup, il est
|
|
||||||
garanti qu'elles fonctionnent), mais des versions différentes peuvent
|
|
||||||
fonctionner aussi bien.
|
|
||||||
|
|
||||||
|
|
||||||
- libXPM 4.7 ou plus récent
|
|
||||||
Les versions plus anciennes peuvent ne pas fonctionner !!!
|
|
||||||
Disponible sur ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
|
||||||
|
|
||||||
Le support des fichiers XPM est intégré, mais il ne prendra
|
|
||||||
pas en compte les images dont le format est exotique.
|
|
||||||
|
|
||||||
- libpng 0.96 ou plus récent, et zlib
|
|
||||||
Pour pouvoir utiliser les images au format PNG.
|
|
||||||
http://www.cdrom.com/pub/png/
|
|
||||||
|
|
||||||
- libtiff 3.4 ou plus récent
|
|
||||||
Pour pouvoir utiliser les images au format TIFF.
|
|
||||||
Vous trouverez ça ici : ftp://ftp.sgi.com/graphics/tiff
|
|
||||||
|
|
||||||
- libjpeg 6.0.1 ou plus récent
|
|
||||||
Pour pouvoir utiliser les images au format JPEG.
|
|
||||||
http://www.ijg.org/
|
|
||||||
|
|
||||||
- libgif 2.2 ou libungif
|
|
||||||
Pour pouvoir utiliser les images au format GIF.
|
|
||||||
ftp://prtr-13.ucsc.edu/pub/libungif/
|
|
||||||
|
|
||||||
- GNU xgettext
|
|
||||||
Si vous voulez disposer des traductions en d'autres langues, GNU gettext
|
|
||||||
est nécessaire. Les autres versions de gettext sont incompatibles et ne
|
|
||||||
fonctionneront pas.
|
|
||||||
Vous trouverez la version GNU sur ftp://ftp.gnu.org
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS DE CONFIGURATION
|
|
||||||
========================
|
|
||||||
|
|
||||||
Ces options peuvent être passées au script de configuration afin d'activer
|
|
||||||
ou désactiver des fonctionnalités de Window Maker. Par exemple :
|
|
||||||
|
|
||||||
./configure --enable-kde --enable-gnome
|
|
||||||
|
|
||||||
configurera Window Maker avec le support intégré pour KDE et GNOME.
|
|
||||||
|
|
||||||
|
|
||||||
Afin d'obtenir la liste des autres options, exécutez ./configure --help
|
|
||||||
|
|
||||||
--with-libs-from
|
|
||||||
ajoute des chemins d'accès pour la recherche des librairies.
|
|
||||||
L'option -L doit précéder chaque chemin d'accès, comme suit :
|
|
||||||
--with-libs-from="-L/opt/libs -L/usr/local/lib"
|
|
||||||
|
|
||||||
--with-incs-from
|
|
||||||
ajoute des chemins d'accès pour la recherche des fichiers d'en-tête.
|
|
||||||
L'option -I doit précéder chaque chemin d'accès, comme suit :
|
|
||||||
--with-incs-from="-I/opt/headers -I/usr/local/include"
|
|
||||||
|
|
||||||
--enable-single-icon
|
|
||||||
active le regroupement des toutes les appicons des WM_CLASS et WM_INSTANCE
|
|
||||||
en une seule icône. Aucun support n'est offert par les développeurs pour
|
|
||||||
cette fonctionnalité. Si vous avez des problèmes avec celle-ci, contactez
|
|
||||||
son auteur :
|
|
||||||
Christopher Seawood <cls@seawood.org>
|
|
||||||
|
|
||||||
--disable-shm
|
|
||||||
désactive l'utilisation de l'extension "MIT shared memory". Cela ralentira
|
|
||||||
un petit peu la génération des textures, mais il semble que cela soit
|
|
||||||
nécessaire dans certains cas pour éviter un bogue se manifestant au niveau
|
|
||||||
des icônes et des textures.
|
|
||||||
|
|
||||||
--disable-motif
|
|
||||||
désactive le support pour les fonctionnalités en rapport avec le gestionnaire
|
|
||||||
de fenêtres mwm.
|
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
désactive des fonctionnalités déjà prises en compte par les gestionnaires de
|
|
||||||
bureau tels que KDE et GNOME. Celà concerne : la liste de fenêtres, le menu
|
|
||||||
des applications, la sélection multiple de fenêtres. Attention : vous ne
|
|
||||||
pourrez plus sortir de Window Maker autrement qu'en utilisant kill avec le
|
|
||||||
signal SIGTERM ou en quittant à l'aide de KDE. Il n'est pas conseillé
|
|
||||||
d'utiliser cette option.
|
|
||||||
|
|
||||||
--enable-modelock
|
|
||||||
active le support pour le verrouillage du "XKB language status". Si vous ne
|
|
||||||
savez pas de quoi il retourne, c'est probablement que vous n'en avez pas
|
|
||||||
utilité.
|
|
||||||
|
|
||||||
--enable-sound
|
|
||||||
active le support pour le module de gestion des effets sonores.
|
|
||||||
|
|
||||||
--disable-xpm
|
|
||||||
désactive l'utilisation de la librairie XPM même si elle est présente
|
|
||||||
sur votre système.
|
|
||||||
|
|
||||||
--disable-png
|
|
||||||
désactive l'utilisation de la librairie PNG.
|
|
||||||
|
|
||||||
--disable-tiff
|
|
||||||
désactive l'utilisation de la librairie TIFF.
|
|
||||||
|
|
||||||
--disable-gif
|
|
||||||
désactive l'utilisation de la librairie GIF.
|
|
||||||
|
|
||||||
--disable-jpeg
|
|
||||||
désactive l'utilisation de la librairie JPEG.
|
|
||||||
|
|
||||||
--disable-shape
|
|
||||||
désactive l'utilisation de "shaped windows" (pour oclock, xeyes, etc.).
|
|
||||||
|
|
||||||
|
|
||||||
NOTES SPÉCIFIQUES AUX PLATEFORMES
|
|
||||||
=================================
|
|
||||||
|
|
||||||
- machines DEC/Alpha
|
|
||||||
|
|
||||||
#>>>>>>>>>>>
|
|
||||||
De : Anton Ivanov <aivanov@eu.level3.net>
|
|
||||||
A : Marcelo E. Magallon <mmagallo@debian.org>
|
|
||||||
Sujet : Re : Est-ce que le paquetage WindowMaker fonctionne correctement sur Alpha?
|
|
||||||
|
|
||||||
> Salut,
|
|
||||||
>
|
|
||||||
> Je lisais la doc contenue dans l'archive de WindowMaker, quand je suis
|
|
||||||
> tombé sur ça :
|
|
||||||
>
|
|
||||||
> | - machines DEC/Alpha
|
|
||||||
> | Il est possible que vous deviez utiliser l'option --disable-shm pour
|
|
||||||
> | configurer la compilation, comme suit :
|
|
||||||
> | ./configure --disable-shm
|
|
||||||
>
|
|
||||||
> est-ce que quelqu'un a eu des problèmes avec WindowMaker sur Alpha? Est-ce
|
|
||||||
> que quelqu'un peut tester cela? Doit-on vraiment utiliser cette option
|
|
||||||
> pour compiler sur Alpha?
|
|
||||||
|
|
||||||
Notez bien : les Alphas dont je me sers ne sont jamais sous X et ne sont pas près
|
|
||||||
de l'être.
|
|
||||||
|
|
||||||
Bien souvent, la configuration des Alphas n'inclut qu'un volume ridiculement
|
|
||||||
petit de mémoire partagée. Aussi il n'est pas étonnant qu'un grand nombre
|
|
||||||
d'applications comme cdrecord ou mysql server plantent carrément.
|
|
||||||
|
|
||||||
Vérifiez ces réglages sur votre système et modifiez-les en conséquent :
|
|
||||||
pour cela, manipulez l'entrée appropriée dans /proc ou modifiez le fichier
|
|
||||||
/usr/src/linux/include/asm/shmparam.h.
|
|
||||||
|
|
||||||
En dehors de ce cas, la mémoire partagée sous Alpha est sensée ne pas
|
|
||||||
poser de problème et je ne vois aucune raison de la désactiver.
|
|
||||||
Pour ma part, elle est à 32 ou plus sur la pluspart des machines.
|
|
||||||
|
|
||||||
De plus, si ma mémoire est exacte, les commentaires dans ce fichier
|
|
||||||
sont tout à fait inexacts. La valeur n'est pas exprimée en octets, mais en
|
|
||||||
mots, dépendant de la machine. Pour les Alphas, c'est donc *8.
|
|
||||||
|
|
||||||
Je rappelle que je n'utilise pas X sur ces machines, donc ce que j'indique
|
|
||||||
est soumis à toutes les réserves habituelles. (#include "standard_disclaimer.h")
|
|
||||||
#<<<<<<<<<<<<
|
|
||||||
|
|
||||||
|
|
||||||
- SCO Unix
|
|
||||||
Lancez configure comme suit :
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
- SunOS, Solaris
|
|
||||||
Si gcc est installé, lancez configure comme suit :
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
Le cpp de Sun ne dispose pas de certaines fonctionnalités nécessaire pour
|
|
||||||
Window Maker et cela peut occasionner des problèmes avec l'utilisation des
|
|
||||||
fichiers de configuration.
|
|
||||||
Il peut être aussi nécessaire d'indiquer le chemin d'accès à la librairie
|
|
||||||
libtiff en utilisant les options --with-libs-from et --with-incs-from
|
|
||||||
avec configure.
|
|
||||||
Quelqu'un m'a rapporté qu'il est nécessaire de faire figurer /usr/local/lib
|
|
||||||
en premier dans la variable d'environnement LD_LIBRARY_PATH.
|
|
||||||
|
|
||||||
Si vous utilisez un Ultra Creator 3D ou une autre machine graphique
|
|
||||||
de haut niveau, faites en sorte de démarrer le serveur X avec le mode
|
|
||||||
graphique par défaut à 24bpp sinon vous pourriez constaer des problèmes
|
|
||||||
au niveau des couleurs.
|
|
||||||
C'est une bogue répertorié au niveau de Window Maker, il sera corrigé.
|
|
||||||
|
|
||||||
- GNU/Linux en général
|
|
||||||
Assurez-vous que /usr/local/lib figure dans /etc/ld.so.conf et que vous
|
|
||||||
avez lancé ldconfig après l'installation.
|
|
||||||
Désinstallez tout précédent paquetage de Window Maker avant d'installer
|
|
||||||
une nouvelle version.
|
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
|
||||||
Il peut y avoir plusieurs problèmes ennuyeux sur les systèmes RedHat.
|
|
||||||
Voici la marche à suivre sous peine de ne pouvoir utiliser Window Maker
|
|
||||||
sur ces systèmes :
|
|
||||||
|
|
||||||
* si la version de Window Maker livrée avec RedHat est installée,
|
|
||||||
désinstallez-la avant de mettre à jour votre système;
|
|
||||||
|
|
||||||
* assurez-vous que ni la variable d'environnement LANG ni LINGUAS ne
|
|
||||||
contiennent "en_RN";
|
|
||||||
|
|
||||||
* vérifiez que /usr/local/bin est présent dans votre variable d'environnement
|
|
||||||
PATH;
|
|
||||||
|
|
||||||
* il faut que /usr/local/lib soit dans /etc/ld.so.conf avant de lancer
|
|
||||||
ldconfig;
|
|
||||||
|
|
||||||
* si vous rencontrez des messages d'erreur en rapport avec "--no-reexec",
|
|
||||||
désinstallez libtool-1.2b et installez libtool-1.3.
|
|
||||||
libtool-1.3 peut être trouvé sur ftp.gnu.org.
|
|
||||||
Consultez aussi la section PROBLÈMES;
|
|
||||||
|
|
||||||
* si vous aviez auparavant installé le paquetage de Window Maker livré
|
|
||||||
avec RedHat et que vous voulez installer maintenant manuellement une nouvelle
|
|
||||||
version, vous devez au préalable désinstaller le paquetage provenant de la
|
|
||||||
RedHat;
|
|
||||||
|
|
||||||
* assurez-vous qu'il existe un lien symbolique de from /usr/include/X11 vers
|
|
||||||
/usr/X11R6/include/X11 (le cas échéant, lancez cette commande :
|
|
||||||
ln -s /usr/X11R6/include/X11 /usr/include/X11);
|
|
||||||
|
|
||||||
* assurez-vous que /lib/cpp pointe bien vers le programme cpp
|
|
||||||
|
|
||||||
Si vous avez un doute concernant quoi que ce soit de relatif à l'installation
|
|
||||||
de Window Maker sur une RedHat, n'hésitez pas à contacter le support
|
|
||||||
utilisateur de RedHat. Ils vous renseigneront toujours et tenteront de vous
|
|
||||||
dépanner dans l'utilisation et la configuration de votre système RedHat.
|
|
||||||
D'un autre côté, ils sont plus au fait que nous pour tout ce qui est relatif
|
|
||||||
aux RedHat (nous n'en utilisons pas).
|
|
||||||
|
|
||||||
- PowerPC MkLinux
|
|
||||||
Installez la version la plus récente de Xpmac. Les versions plus
|
|
||||||
anciennes semblent contenir un bogue qui est susceptible de bloquer
|
|
||||||
le système.
|
|
||||||
|
|
||||||
- Debian GNU/Linux
|
|
||||||
Si vous voulez bénéficier du support des fichier JPEG et TIFF,
|
|
||||||
assurez-vous que les paquetages libtiff-dev et libjpeg-dev sont installés.
|
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
|
||||||
Désinstallez tout précédent paquetage de Window Maker avant d'installer
|
|
||||||
une nouvelle version. Le cas échéant, vous pourriez rencontrer des
|
|
||||||
problèmes.
|
|
||||||
|
|
||||||
- MetroX (version indéterminée)
|
|
||||||
MetroX contient un bogue qui corrompt les pixmaps utilisées en fond
|
|
||||||
de fenêtres. Si vous utilisez MetroX et rencontrer des problèmes
|
|
||||||
avec les textures, n'utilisez pas les textures dans les barres de titre,
|
|
||||||
ou bien utilisez un autre serveur X.
|
|
||||||
|
|
||||||
|
|
||||||
INSTALLATION
|
|
||||||
============
|
|
||||||
|
|
||||||
Compiler Window Maker
|
|
||||||
---------------------
|
|
||||||
Pour aller vite, tapez ce qui suit dans un prompt shell :
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
puis, loguez-vous en tant que root and tapez :
|
|
||||||
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
ou, si vous voulez ôter les infos de débogage des exécutables et ainsi les
|
|
||||||
rendre plus petits, tapez plutôt :
|
|
||||||
|
|
||||||
make install-strip
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
Tout ceci compile et installe Window Maker avec les réglages par défaut.
|
|
||||||
|
|
||||||
Maintenant, si vous voulez personnaliser des options de compilation, vous
|
|
||||||
pouvez faire :
|
|
||||||
|
|
||||||
1. (optionnel) Consulter la section OPTIONS DE CONFIGURATION
|
|
||||||
dans ce même fichier. Exécutez aussi :
|
|
||||||
|
|
||||||
./configure --help
|
|
||||||
|
|
||||||
pour avoir la liste des autres options disponibles.
|
|
||||||
|
|
||||||
2. Lancez configure avec les options choisies. Par exemple, si vous voulez
|
|
||||||
utiliser l'option --enable-kde, tapez :
|
|
||||||
|
|
||||||
./configure --enable-kde
|
|
||||||
|
|
||||||
3. (optionnel) Éditez src/wconfig.h avec votre éditeur de texte favori et
|
|
||||||
et modifiez sont contenu à votre guise.
|
|
||||||
|
|
||||||
4. Compilez. Il faut juste taper :
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
5. Loguez-vous en tant que root (si vous ne pouvez pas le faire, lisez le
|
|
||||||
paragraphe "Je n'ai pas le mot de passe de root :-(") et installez
|
|
||||||
Window Maker sur votre système :
|
|
||||||
su root
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
Réglages pour un utilisateur
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Ces instructions suivantes ne sont pas nécessaires si vous mettez à jour
|
|
||||||
Window Maker à partir d'une version plus ancienne, à moins que ce soit
|
|
||||||
précisé dans le fichier NEWS.
|
|
||||||
|
|
||||||
Chaque utilisateur qui veut utiliser Window Maker sur votre système doit
|
|
||||||
faire ce qui suit :
|
|
||||||
|
|
||||||
1. Installer les fichiers de configuration de Window Maker dans son
|
|
||||||
répertoire personnel.
|
|
||||||
|
|
||||||
Pour ceci, il doit taper :
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
wmaker.inst installera les fichiers de configuration de Window Maker
|
|
||||||
pour l'utilisateur et configurera ses paramètres de X de façon à ce que
|
|
||||||
Window Maker soit automatiquement lancé au démarrage de X.
|
|
||||||
|
|
||||||
C'est tout!
|
|
||||||
|
|
||||||
Vous pouvez aussi taper "man wmaker" afin d'obtenir plus de renseignements
|
|
||||||
sur la configuration et d'autres sujets.
|
|
||||||
|
|
||||||
Consultez le Guide de l'utilisateur afin d'obtenir des informationss plus
|
|
||||||
en détail sur Window Maker.
|
|
||||||
|
|
||||||
Pourquoi ne pas aussi jeter un oeil aux FAQs..
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Installation du paquetage additionnel
|
|
||||||
-------------------------------------
|
|
||||||
|
|
||||||
Décompressez WindowMaker-extra-<version-number>.tar.gz dans /usr/local/share
|
|
||||||
|
|
||||||
Vous trouverez le fichier sur ftp://ftp.windowmaker.info. Ce paquetage est optionnel,
|
|
||||||
il contient des icônes et des thèmes supplémentaires. Vérifiez que vous avez
|
|
||||||
bien la derniere version de ce paquetage.
|
|
||||||
Il y a aussi un fichier WindowMaker-extra.readme qui indique comment procéder à
|
|
||||||
l'installation de ce paquetage.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Je n'ai pas le mot de passe de root :-(
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
Si vous n'avez pas acc-s aux privilèges du super-utilisateur (root), vous pouvez
|
|
||||||
installer Window Maker dans votre répertoire personnel. Pour ce faire, ajoutez
|
|
||||||
l'option --prefix correctement renseignée au moment de l'exécution de ./configure
|
|
||||||
(étape 2 de la compilation de Window Maker).
|
|
||||||
Il est aussi nécessaire d'utiliser l'option --with-appspath, afin de préciser
|
|
||||||
le chemin d'accès à WPrefs.app. Par exemple :
|
|
||||||
|
|
||||||
./configure --prefix=/home/jshmoe --with-appspath=/home/jshmoe/GNUstep/Applications
|
|
||||||
|
|
||||||
|
|
||||||
Puis, faites en sorte que /home/jshmoe/bin soit inclus dans votre PATH, ajoutez
|
|
||||||
/home/jshmoe/lib à votre variable d'environnement LD_LIBRARY_PATH puis lancez
|
|
||||||
bin/wmaker.inst
|
|
||||||
|
|
||||||
Bien sûr, /home/jshmoe est supposé être remplacé par votre répertoire personnel.
|
|
||||||
|
|
||||||
|
|
||||||
MISE À JOUR
|
|
||||||
===========
|
|
||||||
|
|
||||||
Si vous mettez à jour une version plus ancienne de Window Maker :
|
|
||||||
|
|
||||||
1. Configurez et compilez Window Maker comme d'habitude
|
|
||||||
2. Installez Window Maker (mais n'exécutez pas wmaker.inst)
|
|
||||||
3. Consultez le fichier NEWS et mettez à jour vos fichiers de configuration
|
|
||||||
si nécessaire.
|
|
||||||
|
|
||||||
|
|
||||||
PROBLÈMES
|
|
||||||
=========
|
|
||||||
|
|
||||||
Si vous rencontrez des problèmes pendant la phase de configuration, comme par
|
|
||||||
exemple l'impossibilité d'utiliser une librairie de manipulation de format
|
|
||||||
graphique alors que vous pensez qu'elle est installée, jetez un oeil au contenu
|
|
||||||
du fichier config.log, vous y trouverez peut-être des indices pour résoudre
|
|
||||||
ce problème.
|
|
||||||
|
|
||||||
|
|
||||||
== erreur de chargement de polices, alors qu'elles existent
|
|
||||||
|
|
||||||
Essayez de recompiler sans le support pour le NLS.
|
|
||||||
|
|
||||||
|
|
||||||
== erreur à la configuration
|
|
||||||
|
|
||||||
ltconfig: unrecognized option `--no-reexec'
|
|
||||||
Try `ltconfig --help' for more information.
|
|
||||||
configure: error: libtool configure failed
|
|
||||||
|
|
||||||
Otez l'option --no-reexec du fichier aclocal.m4 et relancer la configuration.
|
|
||||||
Assurez vous aussi que les versions d'autoconf et d'automake correspondent bien
|
|
||||||
aux pré-requis :
|
|
||||||
autoconf 2.13
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.3
|
|
||||||
|
|
||||||
Notez bien que ce ne doit PAS être libtool 1.2b, mais libtool bien 1.3,
|
|
||||||
disponible sur les sites GNU.
|
|
||||||
|
|
||||||
|
|
||||||
== configure ne trouve pas libtiff ou une autre librairie graphique
|
|
||||||
|
|
||||||
Effacez le fichier config.cache, et exécutez à nouveau configure avec les options
|
|
||||||
suivantes (en plus des options que vous utilisiez déjà) :
|
|
||||||
--with-libs-from="-L/usr/local/lib"
|
|
||||||
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
|
|
||||||
Insérez les chemins d'accès aux librairies graphiques et à leurs fichiers d'en-tête.
|
|
||||||
Plusieurs chemins d'accès peuvent être ajoutés pour chacune de ces options,
|
|
||||||
comme montré pour --with-incs-from. Séparez-les juste par un espace.
|
|
||||||
|
|
||||||
|
|
||||||
== configure ne trouve pas libXpm
|
|
||||||
|
|
||||||
* Vérifiez que vous avez un lien sympbolique de libXpm.so.4.9 vers libXpm.so
|
|
||||||
|
|
||||||
|
|
||||||
== segmentation fault au démarrage
|
|
||||||
|
|
||||||
* Vérifiez que la version de libXPM qui est installée est au moins 4.7.
|
|
||||||
|
|
||||||
* Vérifiez que votre fichier ~/GNUstep/Defaults/WindowMaker est à jour.
|
|
||||||
|
|
||||||
Si vous n'en êtes pas sûr, renommez ~/GNUstep en ~/GNUtmp et lancez wmaker.inst.
|
|
||||||
|
|
||||||
|
|
||||||
== "...: your machine is misconfigured. gethostname() returned (none)"
|
|
||||||
|
|
||||||
* Le nom d'hôte de votre machine n'est pas indiqué ou est invalide (il commence
|
|
||||||
par une parenthèse par exemple). Consultez les pages du manuel (man hostname) pour
|
|
||||||
savoir comment le positionner correctement.
|
|
||||||
|
|
||||||
|
|
||||||
== Le menu des applications ne contient que 2 entrées ("XTerm" et "Exit...")
|
|
||||||
|
|
||||||
* Window Maker ne trouve pas cpp (le preprocesseur de C). Si votre cpp n'est pas situé
|
|
||||||
dans /lib/cpp, editez src/config.h et modifiez le chemin d'accès dans CPP_PATH en conséquent.
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from true; giving up
|
|
||||||
|
|
||||||
* Consultez la section PRE-REQUIS dans ce même fichier.
|
|
||||||
|
|
||||||
|
|
||||||
LOCALES/INTERNATIONALISATION
|
|
||||||
============================
|
|
||||||
|
|
||||||
Window Maker supporte les langues étrangères. Pour activer cette fonctionalité,
|
|
||||||
vous devez compiler Window Maker avec des paramètres supplémentaires.
|
|
||||||
|
|
||||||
|
|
||||||
0 - GNU gettext doit être installé. Il peut être trouvé ici :
|
|
||||||
ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
|
|
||||||
|
|
||||||
Vous pouvez passer à l'étape 4 si vous utilisez le script Install.
|
|
||||||
|
|
||||||
1 - Il vous faut choisir les langues que vous voulez rendre disponible. Modifiez
|
|
||||||
pour cela la liste des codes de nationalité dans LINGUAS. L'anglais est inclus
|
|
||||||
de façon implicite dans cette liste. Par exemple :
|
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
|
||||||
sous csh
|
|
||||||
|
|
||||||
ou
|
|
||||||
|
|
||||||
export LINGUAS;LINGUAS="pt ja de"
|
|
||||||
sous sh
|
|
||||||
|
|
||||||
La liste de tous les codes de nationalité peut être trouvée dans po/README.
|
|
||||||
L'anglais est la langue par défault.
|
|
||||||
|
|
||||||
Lisez po/README si vous souhaitez traduire ou maintenir les fichiers propres
|
|
||||||
à d'autres adaptations nationales.
|
|
||||||
|
|
||||||
2 - De plus, si votre langue utilise des caractères multi-octets, comme
|
|
||||||
le japonais ou le coréen, vous devez vous assurer que l'option MultiByteText est à YES
|
|
||||||
dans ~/GNUstep/Defaults/WMGLOBAL.
|
|
||||||
|
|
||||||
3 - Configurez, compilez et installez Window Maker normalement.
|
|
||||||
|
|
||||||
4 - Pour choisir une langue particulière à l'exécution, vous devez positionner la variable
|
|
||||||
d'environnement LANG avec la valeur correspondant au code de nationalité adéquat.
|
|
||||||
Par exemple, si vous voulez utiliser le portugais, vous devez faire :
|
|
||||||
|
|
||||||
setenv LANG pt
|
|
||||||
|
|
||||||
sous csh ou
|
|
||||||
|
|
||||||
export LANG; LANG=pt
|
|
||||||
|
|
||||||
sous Bourne sh et apparentés
|
|
||||||
|
|
||||||
Note : si la variable d'environnement LC_CTYPE est positionnée, vous devez l'ôter de
|
|
||||||
l'environnement (unset LC_CTYPE), avant d'exécuter Window Maker.
|
|
||||||
|
|
||||||
En ce qui concerne les fichiers de configuration des menus, Window Maker procède
|
|
||||||
à une recherche suivant cet ordre (pour le portugais brésilien, dans ce cas) :
|
|
||||||
|
|
||||||
menu.pt_BR
|
|
||||||
menu.pt
|
|
||||||
menu
|
|
||||||
|
|
||||||
|
|
||||||
5 - Si vous choisissez une langue qui utilise les caractères multi-octets, vous
|
|
||||||
devez configurer les polices de façon adéquate. Consultez pour cela les pages
|
|
||||||
de manuel de XCreateFontSet. Vous devez modifier dans votre fichier ~/G/D/WindowMaker
|
|
||||||
les polices utilisées dans les titres, menus et autres. En ce qui concerne les polices
|
|
||||||
utilisées dans les boîte de dialogue, modifiez ~/G/D/WMGLOBAL.
|
|
||||||
Le %d dans la définition des polices ne doit PAS être enlevé. Vous pouvez aussi utiliser
|
|
||||||
le script wsetfont, fourni à ces fins.
|
|
||||||
Consultez le script lui-même pour en connaître les instructions.
|
|
||||||
|
|
||||||
Par exemple, vous pouvez mettre ceci dans ~/G/D/WindowMaker :
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
|
|
||||||
et dans ~/G/D/WMGLOBAL :
|
|
||||||
|
|
||||||
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
|
|
||||||
Les 2 polices ci-dessus sont uniquement utilisées par les applications qui utilisent
|
|
||||||
WINGs (Window Maker et WPrefs.app).
|
|
||||||
|
|
||||||
Le script wsetfont inclus vous permettra de changer les réglages des polices de
|
|
||||||
façon plus aisée. Consultez-le afin d'obtenir plus d'informations.
|
|
||||||
557
INSTALL.pt
557
INSTALL.pt
@@ -1,557 +0,0 @@
|
|||||||
Instruções de Instalação do Window Maker
|
|
||||||
|
|
||||||
|
|
||||||
PLATAFORMAS SUPORTADAS
|
|
||||||
======================
|
|
||||||
(obs: fiquei sabendo que conseguiram compilar nesses sistemas...)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Slackware 3.5 (plataforma primária)
|
|
||||||
- outras distribuições do Intel GNU/Linux
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 em MacOS
|
|
||||||
- Amiga 3000 rodando RedHat Linux 5.1 (Rawhide)
|
|
||||||
|
|
||||||
Patches que possibilitem a execução em outras plataformas serão bem-vindos.
|
|
||||||
|
|
||||||
Se a última versão não funcionou para você, tente a 0.53.0,
|
|
||||||
que é conhecida por ser bastante estável em várias plataformas.
|
|
||||||
|
|
||||||
|
|
||||||
REQUERIMENTOS
|
|
||||||
=============
|
|
||||||
|
|
||||||
Os softwares a seguir são necessários para o uso do Window Maker:
|
|
||||||
|
|
||||||
- X11R6.x
|
|
||||||
O Window Maker pode ser compilado em versões mais antigas do X, como X11R5
|
|
||||||
(Solaris) ou X11R4 (OpenWindows) mas não funcionará 100% corretamente. Em
|
|
||||||
tais servidores não existirão ícones de aplicações e você terá problemas
|
|
||||||
usando o dock. Fazer upgrades das bibliotecas (Xlib Xt etc) ajudará se você
|
|
||||||
não pode fazer upgrade do servidor.
|
|
||||||
|
|
||||||
Para compilar o Window Maker você precisará do seguinte:
|
|
||||||
|
|
||||||
- Requerimentos básicos e óbvios
|
|
||||||
Se você vai compilar o Window Maker, tenha certeza de que você possui o gcc
|
|
||||||
(ou outro compilador ANSI) e os arquivos headers do X. Especialmente para
|
|
||||||
os iniciantes em Linux: você deve instalar todos os pacotes de desenvolvimento
|
|
||||||
do X e a suite gcc. Do contrário você não será capaz de compilar nenhum
|
|
||||||
programa X, incluindo o Window Maker.
|
|
||||||
|
|
||||||
- libPropList
|
|
||||||
Você pode achar esta biblioteca em ftp://ftp.windowmaker.info/pub/libs ou
|
|
||||||
ftp://ftp.gnome.org/pub/libPropList. Você deve instalar corretamente
|
|
||||||
esta biblioteca antes de instalar o Window Maker.
|
|
||||||
|
|
||||||
- autoconf, automake and libtool
|
|
||||||
Estes pacotes não são necessários, mas se você tiver um ou mais deles instalados,
|
|
||||||
verifique se todos eles são das seguintes versões:
|
|
||||||
autoconf 2.54
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.4.2
|
|
||||||
Se você possui uma versão diferente, desative-os mudando os nomes dos arquivos
|
|
||||||
para outra coisa ou removendo-os do seu sistema. Se você não desenvolve
|
|
||||||
software você não precisa deles, logo, você pode desinstalá-los com segurança.
|
|
||||||
|
|
||||||
- lex (ou flex) e yacc (ou bison)
|
|
||||||
São usados pelo libPropList. O lex não seria necessário, já que o seu
|
|
||||||
arquivo de saída é incluído, mas como ou eu ou o automake é um pouco
|
|
||||||
burro, o script de configuração para o libPropList simplesmente
|
|
||||||
abortará sem motivo caso o lex não seja achado.
|
|
||||||
|
|
||||||
|
|
||||||
OPCIONAL:
|
|
||||||
=========
|
|
||||||
Estas bibliotecas não são necessárias para que o Window Maker funcione, mas elas
|
|
||||||
são suportadas caso você deseje usá-las. Os números das versões são os que eu
|
|
||||||
possuo (e portanto quase certamente funcionarão), mas outras versões devem funcionar
|
|
||||||
também.
|
|
||||||
|
|
||||||
|
|
||||||
- libXPM 4.7 ou mais atual
|
|
||||||
Versões antigas podem não funcionar.
|
|
||||||
Disponível em ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
|
||||||
Há suporte nativo para arquivos XPM, mas ele não carregará imagens em
|
|
||||||
algumas formatos incomuns.
|
|
||||||
|
|
||||||
- libpng 0.96 ou mais atual e zlib
|
|
||||||
Para suporte a imagens PNG.
|
|
||||||
|
|
||||||
- libtiff 3.4 ou mais atual
|
|
||||||
Para suporte a imagens TIFF. Você pode baixar o libtiff em
|
|
||||||
ftp://ftp.sgi.com/graphics/tiff.
|
|
||||||
|
|
||||||
- libjpeg 6.0.1 ou mais atual
|
|
||||||
Para suporte a imagens JPEG.
|
|
||||||
|
|
||||||
- libgif 2.2 ou libungif
|
|
||||||
Para suporte a imagens tipo GIF.
|
|
||||||
|
|
||||||
- GNU xgettext
|
|
||||||
Se você deseja usar mensagens traduzidas, será necessário o GNU gettext. Outras
|
|
||||||
versões do gettext não são compatíveis e não funcionarão. Baixe a versão
|
|
||||||
GNU através do site ftp://ftp.gnu.org
|
|
||||||
|
|
||||||
A maioria dos pacotes citados pode ser encontrado em ftp.uu.net/pub/graphics
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OPÇÕES DE CONFIGURAÇÃO
|
|
||||||
======================
|
|
||||||
|
|
||||||
Estas opções podem ser passadas ao script de configuração para ativar/desativar algumas
|
|
||||||
opções do Window Maker. Exemplo:
|
|
||||||
|
|
||||||
./configure --enable-kde --enable-gnome
|
|
||||||
|
|
||||||
irá configurar o Window Maker para que seja compilado com suporte ao KDE e GNOME.
|
|
||||||
|
|
||||||
|
|
||||||
Para obter uma lista com outras opcoes, execute ./configure --help:
|
|
||||||
|
|
||||||
--with-libs-from
|
|
||||||
Especifica diretórios (paths) adicionais onde se deve achar as bibliotecas.
|
|
||||||
A flag -L deve preceder cada caminho, tal como:
|
|
||||||
--with-libs-from="-L/opt/libs -L/usr/local/lib"
|
|
||||||
|
|
||||||
--with-incs-from
|
|
||||||
Especifica diretórios adicionais para os arquivos de cabeçalho (header files)
|
|
||||||
que serão procurados. A flag -l deve preceder cada caminho descrito, tal como:
|
|
||||||
--with-incs-from="-I/opt/headers -I/usr/local/include"
|
|
||||||
|
|
||||||
--enable-single-icon
|
|
||||||
Permite o agrupamento de todas as aplicações com a mesma WM_CLASS+WM_INSTANCE em
|
|
||||||
uma só. Esta opção não é suportada por todos os desenvolvedores. Se você tiver algum
|
|
||||||
problema com essa opção, escreva para o seu autor: Christopher Seawood
|
|
||||||
<cls@seawood.org>
|
|
||||||
|
|
||||||
--disable-shm
|
|
||||||
Desativa o uso da extensão de memória compartilhada do MIT. Isto reduzirá
|
|
||||||
um pouco a geração de texturas, mas em alguns casos se mostrará necessário
|
|
||||||
em virtude de um bug que se manifesta quando manipulam-se ícones e texturas.
|
|
||||||
|
|
||||||
--disable-motif
|
|
||||||
Desativa compatibilidade com gerenciador de janelas mwm.
|
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
Remove coisas que já são suportadas em ambientes desktops como o KDE
|
|
||||||
e o GNOME. As opções desativadas são: lista de janelas (window list), menu de
|
|
||||||
aplicações root (root applications menu), seleção múltipla de janelas
|
|
||||||
(multiple window selection). Note que não será mais possível sair do Window
|
|
||||||
Maker de dentro; você terá que usar o kill com o sinal SIGTERM ou sair do KDE.
|
|
||||||
Não é aconselhado ativar essa opção.
|
|
||||||
|
|
||||||
--enable-modelock
|
|
||||||
Suporte ao bloqueio de status de linguagem do XKB. Se você não sabe o que
|
|
||||||
é isto, você provavelmente não precisa.
|
|
||||||
|
|
||||||
--enable-sound
|
|
||||||
Ativa o suporte ao módulo de efeitos sonoros.
|
|
||||||
|
|
||||||
--disable-xpm
|
|
||||||
Desativa o uso da biblioteca XPM mesmo se esta estiver disponível no seu sistema.
|
|
||||||
|
|
||||||
--disable-png
|
|
||||||
Desativa o uso da biblioteca PNG
|
|
||||||
|
|
||||||
--disable-tiff
|
|
||||||
Desativa o uso da biblioteca TIFF
|
|
||||||
|
|
||||||
--disable-gif
|
|
||||||
Desativa o uso da biblioteca GIF
|
|
||||||
|
|
||||||
--disable-jpeg
|
|
||||||
Desativa o uso da biblioteca JPEG
|
|
||||||
|
|
||||||
--disable-shape
|
|
||||||
Desativa o uso das shaped windows (para oclock, xeyes etc.).
|
|
||||||
|
|
||||||
--enable-debug
|
|
||||||
Não use esta opção a não ser que saiba realmente o que está fazendo
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NOTAS ESPECÍFICAS PARA AS PLATAFORMAS
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
- máquinas DEC/Alpha
|
|
||||||
Você provavelmente precisará usar a flag --disable-shm para configurar,
|
|
||||||
como ./configure --disable-shm
|
|
||||||
|
|
||||||
- SCO Unix - execute o configure tal como
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
- SunOS, Solaris
|
|
||||||
Se você possui o gcc instalado, execute o configure como abaixo:
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
O cpp da Sun não possui agumas funções necessárias ao Window Maker e pode
|
|
||||||
causar problemas quando analisados os arquivos de configuração.
|
|
||||||
Você pode ainda precisar usar --with-libs-from e --with-incs-from
|
|
||||||
para fornecer o diretório onde a libtiff está localizada.
|
|
||||||
Alguem me mandou um email dizendo que você precisará deixar o /usr/local/lib
|
|
||||||
como primeiro caminho (path) no LD_LIBRARY_PATH para que funcione.
|
|
||||||
|
|
||||||
Se você tem uma Ultra Creator 3D ou outra máquina com gráficos high-end,
|
|
||||||
certifique-se de iniciar o servidor X com o visual padrão definido em 24bpp
|
|
||||||
ou você poderá ter problemas com cores desfiguaradas. Isto é um bug do
|
|
||||||
wmaker e será consertado.
|
|
||||||
|
|
||||||
- GNU/Linux em geral
|
|
||||||
Confira se você possui /etc/local/lib no /etc/ld.so.conf e rode ldconfig
|
|
||||||
após a instalação.
|
|
||||||
Remova qualquer versão em pacote do Window Maker antes de instalar uma versão
|
|
||||||
mais atual.
|
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
|
||||||
Os sistemas RedHat apresentam vários incômodos. Se você usa, certifique-se
|
|
||||||
de seguir os passos abaixo ou o Window Maker não funcionará:
|
|
||||||
|
|
||||||
* se você instalou o Window Maker que vem junto com o Red Hat, desinstale-o
|
|
||||||
antes de instalar uma versão mais atual.
|
|
||||||
|
|
||||||
* certifique-se de que você não possui as variáveis de ambiente LANG e LINGUAS
|
|
||||||
configuradas como en_RN;
|
|
||||||
|
|
||||||
* certifique-se de que você possui /usr/local/bin na variável PATH;
|
|
||||||
|
|
||||||
* certifique-se de que você tem /usr/local/lib no /etc/ld.conf.so antes de
|
|
||||||
executar o ldconfig;
|
|
||||||
|
|
||||||
* se você tiver problemas que mencionem uma mensagem de erro com o
|
|
||||||
--no-reexec, remova a libtool-1.2b e instale a libtool-1.3. A libtool-1.3
|
|
||||||
pode ser encontrada em ftp.gnu.org. Também leia a seção TROUBLESHOOTING;
|
|
||||||
|
|
||||||
* se você instalou o pacote Window Maker do RedHat e está instalando uma
|
|
||||||
nova versão na mão (você mesmo está compilando), remova o pacote Window
|
|
||||||
Maker do seu sistema RedHat antes.
|
|
||||||
|
|
||||||
* certifique-se de que você possua o vínculo simbólico do /usr/include/X11
|
|
||||||
ao /usr/X11R6/include/X11 (se não, digite ln -s /usr/X11R6/include/X11
|
|
||||||
/usr/include/X11)
|
|
||||||
|
|
||||||
* certifique-se de que você tem o /lib/cpp apontando para o programa cpp.
|
|
||||||
|
|
||||||
Se você possui alguma dúvida quanto a realizar qualquer uma das tarefas acima,
|
|
||||||
por favor não hesite em contatar o suporte ao usuário RedHat. Eles gentilmente
|
|
||||||
irão responder a todas as suas dúvidas relacionadas ao sistema. Eles sabem
|
|
||||||
muito mais sobre o sistema deles do que nós (nós não usamos RedHat).
|
|
||||||
|
|
||||||
- PowerPC MkLinux
|
|
||||||
Você terá que possuir a última versão do Xpmac. Versões mais antigas
|
|
||||||
parecem ter bugs que fazem com que o sistema trave.
|
|
||||||
|
|
||||||
- Debian GNU/Linux
|
|
||||||
Se você deseja suporte a JPEG e TIFF, certifique-se que no seu sistema estão
|
|
||||||
instaladas as bibliotecas libtiff-dev e libjpeg-dev.
|
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
|
||||||
Se você instalou o pacote Window Maker do SuSE, certifique-se de
|
|
||||||
removê-lo do seu sistema antes de compilar o wmaker ou você poderá
|
|
||||||
ter problemas.
|
|
||||||
|
|
||||||
- MetroX (versão desconhecida)
|
|
||||||
O MetroX possui uma falha que corrompe os pixmaps que são definidos
|
|
||||||
como backgrounds de janelas. Se você usa MetroX e está tendo problemas
|
|
||||||
estranhos com texturas, não use texturas nas titlebars. Ou use
|
|
||||||
um servidor X diferente.
|
|
||||||
|
|
||||||
INSTALAÇÃO:
|
|
||||||
===========
|
|
||||||
|
|
||||||
Desempacote o WindowMaker-extra-<numero-da-versao>.tar.gz no /usr/local/share.
|
|
||||||
|
|
||||||
Você pode pegar o arquivo no site ftp://ftp.windowmaker.info. Este arquivo
|
|
||||||
é opcional e possui alguns ícones e temas. Procure pelo último <número-da-versão>
|
|
||||||
disponível.
|
|
||||||
Ainda há o WindowMaker-extra.readme para instruí-lo sobre onde o pacote deve ir.
|
|
||||||
|
|
||||||
|
|
||||||
Compilando o Window Maker
|
|
||||||
-------------------------
|
|
||||||
Se você quer fazer de modo rápido e simples, digite o seguinte no seu prompt:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
depois entre como root e digite:
|
|
||||||
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
ou se você quiser remover os símbolos de depuração dos seus binários para
|
|
||||||
que eles se tornem menores, você pode digitar:
|
|
||||||
|
|
||||||
make install-strip
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
Estes comandos irão compilar e instalar o Window Maker com parâmetros padrões.
|
|
||||||
|
|
||||||
Se você deseja configurar algumas opções de compilação, você pode fazer o seguinte:
|
|
||||||
|
|
||||||
1.(opcional) Olhe na seção OPÇÕES DE CONFIGURAÇÃO acima para ver as
|
|
||||||
opções disponíveis. Execute também:
|
|
||||||
|
|
||||||
./configure --help
|
|
||||||
|
|
||||||
para obter uma lista completa das outras opções.
|
|
||||||
|
|
||||||
2. Rode o configure com as opções que você deseja. Por exemplo, se
|
|
||||||
deseja usar a opção --enable-kde, você deve digitar:
|
|
||||||
|
|
||||||
./configure --enable-kde
|
|
||||||
|
|
||||||
3. (opcional) Edite o arquivo src/wconfig.h com seu editor de texto
|
|
||||||
preferido e procure por alguma opção que deseja mudar
|
|
||||||
|
|
||||||
4. Compile. Só digite:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
5. Entre como root (se você não pode fazer isso, leia a seção "Eu não tenho a
|
|
||||||
senha de root") e instale o Window Maker no seu sistema:
|
|
||||||
|
|
||||||
su root
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
Configurações Específicas
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Estas instruções não precisam ser seguidas quando for feito o upgrade do
|
|
||||||
Window Maker em cima de uma versão antiga, a menos que o arquivo NEWS diga
|
|
||||||
algo diferente.
|
|
||||||
|
|
||||||
Todo usuário no seu sistema que desejar rodar o Window Maker deverá fazer o seguinte:
|
|
||||||
|
|
||||||
1. Instalar os arquivos de configuração do Window Maker no diretório home.
|
|
||||||
Digite:
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
wmaker.inst vai instalar os arquivos de configuração do Window Maker e fazer
|
|
||||||
com que o X rode o Window Maker quando executado.
|
|
||||||
|
|
||||||
É isso!
|
|
||||||
|
|
||||||
Você pode digitar "man wmaker" para ver uma ajuda geral sobre configuração
|
|
||||||
e outras coisas.
|
|
||||||
|
|
||||||
Leia o Manual do Usuário para explicações mais profundas sobre o Window Maker.
|
|
||||||
|
|
||||||
Você deve dar uma olhada no FAQ também.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Eu não tenho a senha de root
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Se você não pode obter privilégios de super-usuário (não pode ser root) você
|
|
||||||
pode instalar o wmaker no seu diretório home. Para isso, forneça a opção
|
|
||||||
--prefix quando for rodar o configure, como explicado no passo 2 da seção
|
|
||||||
Compilando o Window Maker.
|
|
||||||
Você ainda precisará fornecer a opção --with-appspath, para especificar o
|
|
||||||
caminho do WPrefs.app. Exemplo:
|
|
||||||
|
|
||||||
./configure --prefix=/home/jshmoe --with-appspath=/home/jshmoe/GNUstep/Applications
|
|
||||||
|
|
||||||
Depois faça com que /home/jshome/bin seja incluído na variável PATH, adicione
|
|
||||||
/home/jshome/lib na variável de ambiente LD_LIBRARY_PATH e rode bin/wmaker.inst
|
|
||||||
|
|
||||||
É claro, substitua /home/jshome com o seu diretório home.
|
|
||||||
|
|
||||||
|
|
||||||
UPGRADE
|
|
||||||
=======
|
|
||||||
|
|
||||||
Se você está fazendo um upgrade de uma versão antiga do Window maker:
|
|
||||||
|
|
||||||
1. Configure e compile o Window Maker como sempre
|
|
||||||
2. Instale o Window Maker (mas não rode o wmaker.inst)
|
|
||||||
3. Leia o arquivo NEWS e atualize seus arquivos de configuração,
|
|
||||||
se necessário.
|
|
||||||
|
|
||||||
TROUBLESHOOTING
|
|
||||||
===============
|
|
||||||
|
|
||||||
Quando você tiver problemas na configuração (enquanto roda o configure),
|
|
||||||
tal como não conseguir usar uma biblioteca de gráficos que você acha que tem
|
|
||||||
instalada, olhe no arquivo config.log para obter dicas sobre o que pode estar
|
|
||||||
errado.
|
|
||||||
|
|
||||||
== Erro ao carregar as fontes, mesmo quando elas existem
|
|
||||||
|
|
||||||
Tente reconstruir sem suporte NLS.
|
|
||||||
|
|
||||||
== Erro ao configurar
|
|
||||||
|
|
||||||
ltconfig: unrecognized option `--no-reexec'
|
|
||||||
Try `ltconfig --help' for more information.
|
|
||||||
configure: error: libtool configure failed
|
|
||||||
|
|
||||||
remova a opção --no-reexec do aclocal.m4 e da libPropList/aclocal.m4
|
|
||||||
e reconfigure.
|
|
||||||
Também verifique se as versões do autoconf e do automake que você tem
|
|
||||||
instaladas são:
|
|
||||||
autoconf 2.13
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.3
|
|
||||||
|
|
||||||
Note que não deve ser libtool 1.2b, deve ser libtool 1.3.
|
|
||||||
|
|
||||||
== Não acha a proplist.h ou libPropList.algumacoisa
|
|
||||||
|
|
||||||
Baixe e instale a libPropList dos sites já citados neste arquivo.
|
|
||||||
|
|
||||||
== o configure não detecta a libtiff, ou outras bibliotecas gráficas.
|
|
||||||
|
|
||||||
Delete o config.cache, depois rode de novo o configure adicionando as
|
|
||||||
seguintes opções ao configure (e as outras opções que você usa):
|
|
||||||
--with-libs-from="-L/usr/local/lib"
|
|
||||||
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
|
|
||||||
Substitua o caminho para onde estão localizadas as suas bibliotecas gráficas
|
|
||||||
e os correspondentes arquivos de cabeçalho. Você pode colocar caminhos múltiplos
|
|
||||||
em qualquer uma dessas opções, como no exemplo do --with-incs-from. Só ponha um
|
|
||||||
espaço entre eles.
|
|
||||||
|
|
||||||
== o configure não detecta libXpm.
|
|
||||||
|
|
||||||
* Confira se você possui um vínculo simbólico da libXpm.so.4.9 para libXpm.so
|
|
||||||
|
|
||||||
|
|
||||||
== Segmentation fault na inicialização
|
|
||||||
|
|
||||||
* Confira se a versão da libXPM é a 4.7 ou mais atual
|
|
||||||
|
|
||||||
* Confira se você tem uma versão atualizada do ~/GNUstep/Defaults/WindowMaker
|
|
||||||
|
|
||||||
Se você não tem certeza, tente renomear ~/GNUstep para ~/GNUtmp e depois rode
|
|
||||||
o wmaker.inst
|
|
||||||
|
|
||||||
== "...: your machine is misconfigured. gethostname() returned (none)"
|
|
||||||
|
|
||||||
* o hostname da sua máquina está definido incorretamente. Execute um man hostname
|
|
||||||
para obter informações de como resolver isto.
|
|
||||||
|
|
||||||
== O menu do root possui só 2 entradas. ("XTerm" e "Exit...")
|
|
||||||
|
|
||||||
* O Window Maker não está achando o cpp (o pré-processador C). Se o seu cpp
|
|
||||||
não está localizado em /lib/cpp, edite src/config.h e corrija o caminho
|
|
||||||
no CPP_PATH.
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from
|
|
||||||
true; giving up
|
|
||||||
|
|
||||||
* Leia a seção REQUERIMENTOS deste arquivo.
|
|
||||||
|
|
||||||
|
|
||||||
LOCALES/INTERNACIONALIZAÇÃO
|
|
||||||
===========================
|
|
||||||
|
|
||||||
o Window Maker tem suporte a linguagem nacional. Para ativar esse suporte,
|
|
||||||
você precisa compilar o Window Maker com parâmetros adicionais.
|
|
||||||
|
|
||||||
0 - Você deve Ter o pacote do GNU gettext instalado. Este pode ser obtido
|
|
||||||
pelo ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
|
|
||||||
|
|
||||||
Os passos 1,2 e 3 podem ser pulados se você usa o script Install.
|
|
||||||
|
|
||||||
1 - Você deve selecionar as linguagens que deseja suportar. Defina a LINGUAS
|
|
||||||
para a lista dos locales que você deseja. O Inglês é sempre suportado. Exemplo:
|
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
|
||||||
na csh
|
|
||||||
|
|
||||||
ou
|
|
||||||
|
|
||||||
export LINGUAS;LINGUAS="pt ja de"
|
|
||||||
na sh
|
|
||||||
|
|
||||||
A lista dos locales suportados pode ser achado no arquivo po/README.
|
|
||||||
O inglês é a língua oficial.
|
|
||||||
|
|
||||||
Leia o arquivo po/README se você deseja traduzir e manter os arquivos
|
|
||||||
locales para outras linguagens.
|
|
||||||
|
|
||||||
2 - Adicionalmente, se a sua linguagem usa caracteres multi-bytes, tais
|
|
||||||
como as línguas japonesas e koreanas, você deve definir a opção MultiByteText
|
|
||||||
para YES nos arquivos ~/GNUstep/Defaults/WMGLOBAL e ~/GNUstep/Defaults/WindowMaker
|
|
||||||
|
|
||||||
3 - Configure, compile e instale o Window Maker normalmente.
|
|
||||||
|
|
||||||
4 - Para selecionar um locale particular você deve definir a variável de
|
|
||||||
ambiente LANG para o locale que você quer. Por exemplo, se você quer definir o
|
|
||||||
locale português, você deve rodar
|
|
||||||
|
|
||||||
setenv LANG pt
|
|
||||||
|
|
||||||
na csh ou
|
|
||||||
|
|
||||||
export LANG; LANG=pt
|
|
||||||
|
|
||||||
nas Bourne sh e similares
|
|
||||||
|
|
||||||
Nota: Se você tem a variável de ambiente LC_CTYPE definida, você deve
|
|
||||||
indefiní-la antes de rodar o wmaker.
|
|
||||||
|
|
||||||
O Window Maker procura os arquivos de definições de menu na seguinte
|
|
||||||
ordem (para o português brasileiro, neste caso):
|
|
||||||
|
|
||||||
menu.pt_BR
|
|
||||||
menu.pt
|
|
||||||
menu
|
|
||||||
|
|
||||||
|
|
||||||
5 - Se você escolheu uma linguagem que usa caracteres multi-bytes, você
|
|
||||||
deve configurar as fontes adequadamente. Leia a página de manual para o
|
|
||||||
XcreateFontSet para obter mais detalhes sobre isto. Você deve mudar o arquivo
|
|
||||||
~/G/D/WindowMaker para as fontes usadas nas barras de título, menus e
|
|
||||||
outras coisas. Para as fontes usadas nas janelas de diálogo, mude o arquivo
|
|
||||||
~/G/D/WMGLOBAL. O %d no font names não deve ser removido. Você pode ainda usar
|
|
||||||
o wsetfont script para esta tarefa. Leia o próprio script para maiores instruções.
|
|
||||||
|
|
||||||
Por exemplo, você pode especificar o seguinte no ~/G/D/WindowMaker:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
|
|
||||||
e no ~/G/D/WMGLOBAL:
|
|
||||||
|
|
||||||
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
|
|
||||||
|
|
||||||
As duas fontes acima são usadas somente por aplicações que
|
|
||||||
usem WINGs (o Window Maker e WPrefs.app)
|
|
||||||
|
|
||||||
O script wsetfont que é fornecido vai permitir com que você mude as
|
|
||||||
definições de fonte do modo mais fácil. Dê uma olhada no script para maiores
|
|
||||||
detalhes sobre o uso.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Traduzido por Ricardo Sartori <sartori@inf.ufsc.br>
|
|
||||||
601
INSTALL.sk
601
INSTALL.sk
@@ -1,601 +0,0 @@
|
|||||||
|
|
||||||
In¹trukcie pre in¹taláciu Window Makera
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PODPOROVANÉ PLATFORMY
|
|
||||||
=====================
|
|
||||||
(tzn: vraj to na tom niekto skompiloval...)
|
|
||||||
|
|
||||||
- Intel GNU/Linux Conectiva 5.9 (beta)
|
|
||||||
- Intel GNU/Linux Slackware
|
|
||||||
- Intel GNU/Linux Debian
|
|
||||||
- Intel GNU/Linux other distributions
|
|
||||||
- Sparc GNU/Linux RedHat 5.1
|
|
||||||
- PowerPC GNU/MkLinux
|
|
||||||
- Alpha GNU/Linux RedHat 5.1
|
|
||||||
- FreeBSD
|
|
||||||
- NetBSD
|
|
||||||
- OpenBSD
|
|
||||||
- BSDI 4.0
|
|
||||||
- Solaris 2.5.1, 2.5.2
|
|
||||||
- Solaris 2.6.0
|
|
||||||
- Solaris 2.7beta
|
|
||||||
- SCO Unix
|
|
||||||
- SGI Irix 5.x, 6.5
|
|
||||||
- OSF/1
|
|
||||||
- HP-UX
|
|
||||||
- AIX 3.2.5
|
|
||||||
- AIX 4.1.4 / IBM PowerPC
|
|
||||||
- AIX 4.3.1 / IBM CC compiler
|
|
||||||
- AIX 4.3.2 / IBM PowerPC
|
|
||||||
- AIX 5.3
|
|
||||||
- DEC Alpha/Digital UNIX 4.x
|
|
||||||
- XFree86 / OS/2
|
|
||||||
- Corel NetWinder
|
|
||||||
- SunOS 4.x
|
|
||||||
- PowerMac / Power MachTen 4.1.1 over MacOS
|
|
||||||
- Amiga 3000 running RedHat Linux 5.1 (Rawhide)
|
|
||||||
- IBM S/390 running Linux
|
|
||||||
- iBook running Darwin
|
|
||||||
|
|
||||||
Patche na rozbehanie na iných platformách sú vítané.
|
|
||||||
|
|
||||||
|
|
||||||
PO®IADAVKY:
|
|
||||||
===========
|
|
||||||
|
|
||||||
Nasledovný softvér je potrebný pre beh Window Makera:
|
|
||||||
|
|
||||||
- X11R6.x
|
|
||||||
Window Maker mô¾e by» skompilovaný na star¹ích verziách X, ako
|
|
||||||
X11R5 (Solaris) alebo X11R4 (OpenWindows) ale nebude pracova»
|
|
||||||
100% korektne. Na takých serveroch nebudú ikony aplikácií a budete
|
|
||||||
ma» problémy s pou¾ívaním doku. Upgrade klientských kni¾níc (Xlib,
|
|
||||||
Xt, atï.) pomô¾e, ak u¾ nemô¾ete spravi» upgrade servera.
|
|
||||||
|
|
||||||
Nasledovné je potrebné k skompilovaniu Window Makera:
|
|
||||||
|
|
||||||
- Základné be¾né veci
|
|
||||||
Ak chcete kompilova» Window Maker, uistite sa, ¾e máte gcc (alebo
|
|
||||||
iný ANSI C kompilátor) a hlavièkové súbory iXov. Hlavne pre zaèia-
|
|
||||||
toèníkov v Linuxe: musíte nain¹talova» v¹etky X-devel balíky a gcc.
|
|
||||||
Inak nebudete schopní skompilova» ¾iadny program pre X, teda ani
|
|
||||||
Window Maker.
|
|
||||||
|
|
||||||
- libPropList
|
|
||||||
Túto kni¾nicu mo¾no nájs» na ftp://ftp.windowmaker.info/pub/libs alebo
|
|
||||||
ftp://ftp.gnome.org/pub/libPropList. Nain¹talujte ju pred kompiláciou
|
|
||||||
Window Makera.
|
|
||||||
|
|
||||||
- autoconf, automake a libtool
|
|
||||||
Tieto nástroje NIE sú potrebné, ale ak máte niektoré z nich nain¹talo-
|
|
||||||
vané, uistite sa, ¾e V©ETKY sú presne nasledovné verzie:
|
|
||||||
autoconf 2.54
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.4.2
|
|
||||||
Ak máte odli¹né verzie, odin¹talujte ich alebo ich doèasne premenujte.
|
|
||||||
Ak neprogramujete, nebudete ich potrebova» a teda ich mô¾ete
|
|
||||||
odin¹talova».
|
|
||||||
|
|
||||||
- lex (alebo flex) a yacc (alebo bison)
|
|
||||||
Tieto sú vyu¾ívané z libPropList. Lex v skutoènosti nie je nutný,
|
|
||||||
lebo jeho výstupný súbor je prítomný, ale buï ja alebo automake je
|
|
||||||
hlupák, lebo configuraèný skript pre libPropList sa jednoducho
|
|
||||||
ukonèí z neznámych dôvodov ak lex nie je prítomný.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NEPOVINNÉ:
|
|
||||||
==========
|
|
||||||
|
|
||||||
Tieto kni¾nice nie sú nutné pre beh Window Makera, ale sú podporované
|
|
||||||
v prípade, ¾e ich chcete pou¾íva». Èísla verzií sú tie, ktoré som pou¾il
|
|
||||||
ja (teda urèite fungujú), ale aj iné verzie mô¾u pracova» správne.
|
|
||||||
|
|
||||||
|
|
||||||
- libXPM 4.7 alebo nov¹ia
|
|
||||||
Star¹ie verzie nemusia fungova»!!!
|
|
||||||
Dostupné na ftp://sunsite.unc.edu/pub/Linux/libs/X/
|
|
||||||
|
|
||||||
Podpora XPM je aj vstavaná, ale nenaèíta obrázky v
|
|
||||||
ne¹tandardných kódovaniach.
|
|
||||||
|
|
||||||
- libpng 0.96 alebo nov¹ia a zlib
|
|
||||||
Pre podporu obrázkov PNG.
|
|
||||||
http://www.cdrom.com/pub/png/
|
|
||||||
|
|
||||||
- libtiff 3.4 alebo nov¹ia
|
|
||||||
Pre podporu obrázkov TIFF.
|
|
||||||
ftp://ftp.sgi.com/graphics/tiff
|
|
||||||
|
|
||||||
- libjpeg 6.0.1 alebo nov¹ia
|
|
||||||
Pre podporu obrázkov JPEG.
|
|
||||||
http://www.ijg.org/
|
|
||||||
|
|
||||||
- libgif 2.2 alebo libungif
|
|
||||||
Pre podporu obrázkov GIF.
|
|
||||||
ftp://prtr-13.ucsc.edu/pub/libungif/
|
|
||||||
|
|
||||||
- GNU xgettext
|
|
||||||
Ak chcete pou¾íva» prelo¾ené hlásenia, potrebujete GNU gettext.
|
|
||||||
Iné verzie gettext nie sú kompatibilné a nebudú fungova».
|
|
||||||
Stiahnite si GNU verziu z ftp://ftp.gnu.org
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MO®NOSTI CONFIGURE:
|
|
||||||
===================
|
|
||||||
|
|
||||||
Tieto mo¾nosti mô¾u by» dané skriptu configure ako argumenty za úèelom
|
|
||||||
povolenia/zakázania urèitých vlastností Window Makera. Príklad:
|
|
||||||
|
|
||||||
./configure --enable-kde --enable-gnome
|
|
||||||
|
|
||||||
nakonfiguruje Window Maker s podporou KDE a GNOME.
|
|
||||||
|
|
||||||
|
|
||||||
Zoznam v¹etkých mo¾ností vypí¹e príkaz ./configure --help
|
|
||||||
|
|
||||||
--with-libs-from
|
|
||||||
cesty, kde sa majú hµada» kni¾nice. Re»azec -L musí predchádza»
|
|
||||||
ka¾dú cestu, napr.:
|
|
||||||
--with-libs-from="-L/opt/libs -L/usr/local/lib"
|
|
||||||
|
|
||||||
--with-incs-from
|
|
||||||
cesty, kde sa majú hµada» hlavièkové súbory. Re»azec -I musí
|
|
||||||
predchádza» ka¾dú cestu, napr.:
|
|
||||||
--with-incs-from="-I/opt/headers -I/usr/local/include"
|
|
||||||
|
|
||||||
--enable-single-icon
|
|
||||||
umo¾òuje zrolovanie v¹etký ikon aplikácií WM_CLASS+WM_INSTANCE do
|
|
||||||
jedinej. Táto vlastnos» nie je podporovaná zo strany vývojárov.
|
|
||||||
V prípade problémov s òou, kontaktujte autora:
|
|
||||||
Christopher Seawood <cls@seawood.org>
|
|
||||||
|
|
||||||
--disable-shm
|
|
||||||
zaká¾e pou¾itie roz¹írenia zdieµanej pamäte MIT. Toto trochu spomalí
|
|
||||||
generovanie textúr, ale v niektorých prípadoch je táto voµba potrebná
|
|
||||||
kvôli chybe, ktorá spôsobuje nesprávne zobrazovanie ikon a textúr.
|
|
||||||
|
|
||||||
--disable-motif
|
|
||||||
zaká¾e podporu pre pokyny mana¾éra okien wmw
|
|
||||||
|
|
||||||
--enable-lite
|
|
||||||
odstráni veci, ktoré sa u¾ nachádzajú v desktopových prostrediach
|
|
||||||
ako KDE a GNOME. Odstránené veci sú: zoznam okien, menu aplikácií,
|
|
||||||
výber viacerých okien. Vedzte, ¾e u¾ nebudete schopní ukonèi»
|
|
||||||
Window Maker; budete ho musie» zabi» pou¾itím signálu SIGTERM alebo
|
|
||||||
ho ukonèi» z KDE. Neodporúèa sa povoli» túto vlastnos».
|
|
||||||
|
|
||||||
--enable-modelock
|
|
||||||
podpora pre XKB nastavenie jazyka. Ak neviete, èo to je, pravdepo-
|
|
||||||
dobne to nepotrebujete. (Slú¾i to na prepínanie rozlo¾enia kláves
|
|
||||||
pomocou nového tlaèidla na hornom paneli okien.)
|
|
||||||
|
|
||||||
--enable-sound
|
|
||||||
povolí podporu pre modul zvukových efektov
|
|
||||||
|
|
||||||
--disable-xpm
|
|
||||||
zaká¾e podporu pre kni¾nicu XPM aj keï je dostupná na va¹om systéme.
|
|
||||||
|
|
||||||
--disable-png
|
|
||||||
zaká¾e pou¾itie kni¾nice PNG
|
|
||||||
|
|
||||||
--disable-tiff
|
|
||||||
zaká¾e pou¾itie kni¾nice TIFF
|
|
||||||
|
|
||||||
--disable-gif
|
|
||||||
zaká¾e pou¾itie kni¾nice GIF
|
|
||||||
|
|
||||||
--disable-jpeg
|
|
||||||
zaká¾e pou¾itie kni¾nice JPEG
|
|
||||||
|
|
||||||
--disable-shape
|
|
||||||
zaká¾e tvarované okná (pre oclock, xeyes atï.)
|
|
||||||
|
|
||||||
|
|
||||||
POZNÁMKY PRE ©PECIFICKÉ PLATFORMY:
|
|
||||||
==================================
|
|
||||||
|
|
||||||
- DEC/Alpha
|
|
||||||
|
|
||||||
Nasledovný mail nie je prelo¾ený, ale hovorí sa v òom, ¾e
|
|
||||||
_pravdepodobne_ nie je nutné konfigurova» Window Maker na
|
|
||||||
Alphe s voµbou --disable-shm.
|
|
||||||
|
|
||||||
#>>>>>>>>>>>
|
|
||||||
From: Anton Ivanov <aivanov@eu.level3.net>
|
|
||||||
To: Marcelo E. Magallon <mmagallo@debian.org>
|
|
||||||
Subject: Re: Is the WindowMaker package working ok on Alpha?
|
|
||||||
|
|
||||||
> Hi,
|
|
||||||
>
|
|
||||||
> I was reading some docs on the WindowMaker tarball, and found this:
|
|
||||||
>
|
|
||||||
> | - DEC/Alpha machines
|
|
||||||
> | You might need to pass the --disable-shm flag to configure,
|
|
||||||
> | like ./configure --disable-shm
|
|
||||||
>
|
|
||||||
> is anyone having problems with WindowMaker on Alpha? Can someone
|
|
||||||
> please test this? Should the flag be passed when building on Alpha?
|
|
||||||
|
|
||||||
Disclaimer: alphas under my command have never run X and are least likely to
|
|
||||||
suddenly start running it anytime soon.
|
|
||||||
|
|
||||||
Alpha used to have some ridiculously low amount of shared memory
|
|
||||||
configured.
|
|
||||||
So quite a lot of apps used to barf. Namely - cdrecord, mysql server, etc.
|
|
||||||
|
|
||||||
Check where is yours at the moment and raise it to a more appropriate
|
|
||||||
value by either catting to the appropriate /proc entry or changing the
|
|
||||||
/usr/src/linux/include/asm/shmparam.h.
|
|
||||||
|
|
||||||
Otherwise the shared memory on alpha should be fully functional and I
|
|
||||||
see no reason to disable it. Mine are bumped up to 32 or more on most
|
|
||||||
machines.
|
|
||||||
|
|
||||||
And If I recall correctly the comments in that file are actually
|
|
||||||
wrong. Value is not bytes, but in machine size word. For alpha *8.
|
|
||||||
|
|
||||||
As I said - I do not run X on them so all #include "stdisclaimer.h"
|
|
||||||
apply.
|
|
||||||
#<<<<<<<<<<<<
|
|
||||||
|
|
||||||
|
|
||||||
- SCO Unix - spustite configure takto
|
|
||||||
CFLAGS="-belf -DANSICPP" ./configure
|
|
||||||
|
|
||||||
- SunOS, Solaris
|
|
||||||
Ak máte nain¹alované gcc, spustite configure takto:
|
|
||||||
CPP_PATH="gcc -E -x c" ./configure
|
|
||||||
Cpp od Sunu chýbajú niektoré vlastnosti, ktoré Window Maker potrebuje,
|
|
||||||
a to mô¾e spôsobi» problémy pri parsovaní konfiguraèných súborov.
|
|
||||||
Je tie¾ mo¾né, ¾e budete musie» pou¾i» --with-libs-from a
|
|
||||||
--with-incs-from na urèenie ciest k libtiff.
|
|
||||||
Niekto mi mailoval, ¾e tie¾ /usr/local/lib musí by» prvá cesta v
|
|
||||||
premennej LD_LIBRARY_PATH, aby to fungovalo.
|
|
||||||
Ak máte Ultra Creator 3D alebo iný stroj s high-end grafikou,
|
|
||||||
uistite sa, ¾e spú¹»ate iXy s 24-bitovou farebnou håbkou alebo
|
|
||||||
mô¾ete ma» problémy s pomie¹anými farbami. Toto je chyba wmakera
|
|
||||||
a bude opravená.
|
|
||||||
|
|
||||||
- GNU/Linux vo v¹eobecnosti
|
|
||||||
Uistite sa, ¾e máte /usr/local/lib v /etc/ld.so.conf a ¾e ste
|
|
||||||
po in¹talácii spustili ldconfig.
|
|
||||||
Odin¹talujte v¹etky balíkované verzie Window Makera pred in¹talovaním
|
|
||||||
novej verzie.
|
|
||||||
|
|
||||||
- RedHat GNU/Linux
|
|
||||||
Systémy RedHat majú niekoµko nepríjemných problémov. Ak ich pou¾ívate,
|
|
||||||
dodr¾ujte nasledovné kroky, alebo vám Window Maker nebude fungova»:
|
|
||||||
|
|
||||||
* ak máte nain¹alovaný Window Maker, ktorý je dodaný s RedHatom,
|
|
||||||
pred upgadom ho odin¹talujte;
|
|
||||||
|
|
||||||
* uistite sa, ¾e nemáte premenné LANG a LINGUAS nastavené na en_RN;
|
|
||||||
|
|
||||||
* uistite sa, ¾e máte /usr/local/bin v premennej PATH;
|
|
||||||
|
|
||||||
* uistite sa, ¾e máte /usr/local/lib v /etc/ld.so.conf pred
|
|
||||||
spustením ldconfig;
|
|
||||||
|
|
||||||
* ak máte problémy, v ktorých sa spomína chyba s --no-reexec,
|
|
||||||
odin¹talujte libtool-1.2b a nain¹talujte libtool-1.3. libtool-1.3
|
|
||||||
nájdete na ftp.gnu.org. Tie¾ si preèítajte èas» RIE©ENIE PROBLÉMOV.
|
|
||||||
|
|
||||||
|
|
||||||
* uistite sa, ¾e máte symbolický odkaz z /usr/include/X11 na
|
|
||||||
/usr/X11R6/include/X11 (ak nie, zadajte ln -s /usr/X11R6/include/X11
|
|
||||||
/usr/include/X11 )
|
|
||||||
|
|
||||||
* uistite sa, ¾e /lib/cpp odkazuje na program cpp
|
|
||||||
|
|
||||||
Ak máte akékoµvek pochybnosti, prosím, neotáµajte a spojte sa
|
|
||||||
s u¾ívateµskou podporou RedHatu. Radi vám odpovedia na v¹etky
|
|
||||||
va¹e otázky týkajúce sa ich systému. Vedia toho o svojom
|
|
||||||
systéme viac ako my (nepou¾ívame RedHat).
|
|
||||||
|
|
||||||
|
|
||||||
- PowerPC MkLinux
|
|
||||||
Musíte ma» poslednú verziu Xpmac. Star¹ie verzie majú asi chyby,
|
|
||||||
ktoré spôsobujú zmrznutie celého systému.
|
|
||||||
|
|
||||||
- Debian GNU/Linux
|
|
||||||
Ak chcete podporu JPEG a TIFF, uistite sa, ¾e máte nain¹talované
|
|
||||||
libiff-dev a libjpeg-dev.
|
|
||||||
|
|
||||||
- SuSE GNU/Linux
|
|
||||||
Ak ste si nain¹talovali balík Window Makera od SuSE, odin¹talujte
|
|
||||||
ho pred pokusmi o skompilovanie wmakera, alebo mô¾ete ma» problémy.
|
|
||||||
|
|
||||||
- MetroX (neznáma verzia)
|
|
||||||
MetroX má chybu, ktorá kazí obrázky, ktoré sú nastavené ako pozadie
|
|
||||||
okien. Ak pou¾ívate MetroX a máte èudné problémy s textúrami,
|
|
||||||
nepou¾ívajte textúry v horných li¹tách. Alebo pou¾ite iný X server.
|
|
||||||
|
|
||||||
|
|
||||||
IN©TALÁCIA:
|
|
||||||
===========
|
|
||||||
|
|
||||||
Kompilácia Window Makera
|
|
||||||
------------------------
|
|
||||||
Pre rýchly ¹tart, zadajte nasledovné príkazy v shelly:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
|
|
||||||
potom sa prihláste ako root a zadajte:
|
|
||||||
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
alebo ak chcete z binárnych súborov odstráni» symboly pre debugger a urobi»
|
|
||||||
ich men¹ie, napí¹te miesto toho
|
|
||||||
|
|
||||||
make install-strip
|
|
||||||
ldconfig
|
|
||||||
|
|
||||||
Toto skompiluje a nain¹taluje Window Maker so ¹tandardnými parametrami.
|
|
||||||
|
|
||||||
Ak si chcete prispôsobi» nastavenia kompilácie, mo¾ete to urobi» nasledovne:
|
|
||||||
|
|
||||||
1. (voliteµne) Pozrite sa na èas» MO®NOSTI CONFIGURE, kde sú
|
|
||||||
uvedené mo¾nosti. Tie¾ spustite:
|
|
||||||
|
|
||||||
./configure --help
|
|
||||||
|
|
||||||
ktorý vám vypí¹e kompletný zoznam ostatných mo¾ných nastavení.
|
|
||||||
|
|
||||||
2. Spustite configure s nastaveniami, ktoré chcete. Napríklad,
|
|
||||||
ak chcete pou¾íva» podporu pre KDE, zadajte:
|
|
||||||
|
|
||||||
./configure --enable-kde
|
|
||||||
|
|
||||||
3. (voliteµne) Otvorte si súbor src/wconfig.h vo svojom obµúbenom
|
|
||||||
textovom editore a prejdite si ho, èi nenájdete nejaké nastavenia,
|
|
||||||
ktoré chcete zmeni».
|
|
||||||
|
|
||||||
4. Kompilácia. Zadajte len:
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
5. Prihláste sa ako root (ak to nie je mo¾né, èítajte èas» "Nemám
|
|
||||||
rootove heslo :-( ") a nain¹talujte Window Maker:
|
|
||||||
|
|
||||||
su root
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
Nastavenia ¹pecifické pre u¾ívateµov
|
|
||||||
------------------------------------
|
|
||||||
|
|
||||||
Nemusíte sa dr¾a» týchto in¹trukcií, ak robíte upgrade Window Makera zo
|
|
||||||
star¹ej verzie, pokiaµ to nie je uvedené v súbore NEWS.
|
|
||||||
|
|
||||||
Ka¾dý u¾ívateµ na va¹om systéme, ktorý chce pou¾íva» Window Maker, musí
|
|
||||||
urobi» nasledovné:
|
|
||||||
|
|
||||||
1. Nain¹talova» konfiguraèné súbory Window Makera do svojho
|
|
||||||
domovského adresára:
|
|
||||||
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
wmaker.inst nain¹taluje konfiguraèné súbory Window Makera a nastaví
|
|
||||||
iXy aby sa pri ¹tarte automaticky spustil Window Maker.
|
|
||||||
|
|
||||||
To je v¹etko!
|
|
||||||
|
|
||||||
Základné informácie o konfigurácii a iných veciach vám poskytne
|
|
||||||
"man wmaker".
|
|
||||||
|
|
||||||
Pre hlb¹í úvod do Window Makera si preèítajte si U¾ívateµký manuál.
|
|
||||||
|
|
||||||
Tie¾ sa mô¾te pozrie» na FAQ.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Installing the extras package
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
Unpack WindowMaker-extra-<version-number>.tar.gz in /usr/local/share
|
|
||||||
|
|
||||||
You can get the file at ftp://ftp.windowmaker.info. This file is optional
|
|
||||||
and only have a few icons, and themes. Look for the latest <version-number>
|
|
||||||
available.
|
|
||||||
Also there is a WindowMaker-extra.readme to instruct you where that package
|
|
||||||
should go.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Nemám rootove heslo :(
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
Ak nemáte práva roota, mô¾ete si nain¹talova» Window Maker do svojho
|
|
||||||
domovského adresára. Na to musíte pou¾i» voµbu --prefix pre configure
|
|
||||||
v druhom kroku kompilácie Window Makera. Tie¾ musíte pou¾i» voµbu
|
|
||||||
--with-appspath, pomocou ktorej ¹pecifikujete cestu pre WPrefs.app.
|
|
||||||
Príklad:
|
|
||||||
|
|
||||||
./configure --prefix=/home/jshome --with-appspath=/home/jshome/GNUstep/Applications
|
|
||||||
|
|
||||||
Poto pridajte adresár /home/jshome/bin do premennej PATH, /home/jshome/lib
|
|
||||||
do premennej LD_LIBRARY_PATH a spustite bin/wmaker.inst
|
|
||||||
|
|
||||||
Samozrejme, predpokladá sa, ¾e /home/jshome nahradíte va¹im skutoèným
|
|
||||||
domovským adresárom.
|
|
||||||
|
|
||||||
|
|
||||||
UPGRADE
|
|
||||||
=======
|
|
||||||
|
|
||||||
Ak robíte upgrade zo star¹ej verzie Window Makera:
|
|
||||||
|
|
||||||
1. Skofigurujte a skompilujte Window Maker ako v¾dy
|
|
||||||
2. Nain¹talujte Window Maker (ale nespustite wmaker.inst)
|
|
||||||
3. Preèítajte si súbor NEWS a ak je to potrebné, upravte
|
|
||||||
svoje konfiguraèné súbory.
|
|
||||||
|
|
||||||
|
|
||||||
RIE©ENIA PROBLÉMOV
|
|
||||||
==================
|
|
||||||
|
|
||||||
Ak máte problémy poèas konfigurácie (spú¹»ania configure), napríklad
|
|
||||||
nemo¾nos» pou¾i» grafickú kni¾nicu, o ktorej viete, ¾e ju máte nain¹talovanú,
|
|
||||||
v súbore config.log nájdete príèinu problému.
|
|
||||||
|
|
||||||
== Error with loading fonts, even if they exist.
|
|
||||||
|
|
||||||
Skúste kompiláciu bez podpory NLS.
|
|
||||||
|
|
||||||
== Error when configuring
|
|
||||||
|
|
||||||
ltconfig: unrecognized option `--no-reexec'
|
|
||||||
Try `ltconfig --help' for more information.
|
|
||||||
configure: error: libtool configure failed
|
|
||||||
|
|
||||||
Odstáòte voµbu --no-reexec zo súborov aclocal.m4 a libPropList/aclocal.m4
|
|
||||||
a spustite configure.
|
|
||||||
Tie¾ sa uistite, ¾e autoconf a automake, ktoré máte nain¹talované, sú v
|
|
||||||
týchto verziách:
|
|
||||||
autoconf 2.13
|
|
||||||
automake 1.4
|
|
||||||
libtool 1.3
|
|
||||||
|
|
||||||
Nesmie to by» libtool 1.2b, ale libtool 1.3, zo stránok GNU.
|
|
||||||
|
|
||||||
== Cant find proplist.h or libPropList.something
|
|
||||||
|
|
||||||
Stiahnite a nain¹talujte si libPropList zo stránok uvedených
|
|
||||||
niekde v tomto súbore.
|
|
||||||
|
|
||||||
|
|
||||||
== configure doesn't detect libtiff, or other graphic libraries.
|
|
||||||
|
|
||||||
Odstráòte config.cache, spustite configure s pridanými nasledovnými voµbami
|
|
||||||
(okrem iných, ktoré pou¾ívate):
|
|
||||||
--with-libs-from="-L/usr/local/lib"
|
|
||||||
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
|
|
||||||
Vlo¾te cesty k va¹im grafickým kni¾niciam a zodpovedajúcim hlavièkovým
|
|
||||||
súborom. Mô¾ete vlo¾i» viac ciest do ka¾dej z týchto volieb, ako je to
|
|
||||||
uvedené v príklade --with-incs-from. Len ich oddeµte medzerou.
|
|
||||||
|
|
||||||
|
|
||||||
== configure doesn't detect libXpm.
|
|
||||||
|
|
||||||
* Skontrolujte, èi máte symbolický odkaz z libXpm.so.4.9 na libXpm.so
|
|
||||||
|
|
||||||
|
|
||||||
== Segmentation fault on startup
|
|
||||||
|
|
||||||
* Skontrolujte verziu libXpm, musíte ma» aspoò 4.7
|
|
||||||
|
|
||||||
* Skontrolujte, èi máte upravenú verziu ~/GNUstep/Defaults/WindowMaker
|
|
||||||
|
|
||||||
Ak si nie ste istí, skúste premenova» ~/GNUstep na ~/GNUtmp a spustite
|
|
||||||
wmaker.inst
|
|
||||||
|
|
||||||
|
|
||||||
== "...: your machine is misconfigured. gethostname() returned (none)"
|
|
||||||
|
|
||||||
* Meno va¹eho poèítaèa je nastavené na nieèo nesprávne, èo zaèína
|
|
||||||
úvodzovkami. Preèítajte si man hostname a dozviete sa, ako to nastavi».
|
|
||||||
|
|
||||||
|
|
||||||
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
|
|
||||||
|
|
||||||
* Window Maker nevie nájs» cpp (C preprocesor). Ak sa vá¹ cpp nenachádza
|
|
||||||
v /lib/cpp, upravte src/config.h a vlo¾te správnu cestu do CPP_PATH.
|
|
||||||
|
|
||||||
|
|
||||||
== checking lex output file root... configure: error: cannot find output from true; giving up
|
|
||||||
|
|
||||||
* Preèítajte si èas» PO®IADAVKY v tomto súbore.
|
|
||||||
|
|
||||||
|
|
||||||
MIESTNE NASTAVENIA/INTERNACIONALIZÁCIA
|
|
||||||
======================================
|
|
||||||
|
|
||||||
Window Maker má podporu pre národné jazyky. Aby ste ju povolili, musíte
|
|
||||||
skompilova» Window Maker s niekoµkými prídavnými parametrami.
|
|
||||||
|
|
||||||
|
|
||||||
0 - Musíte ma» nain¹talovaný balík GNU gettext. Mô¾ete ho nájs» na
|
|
||||||
adrese ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
|
|
||||||
|
|
||||||
Kroky 1 a¾ 3 mô¾ete vynecha», ak pou¾ívate skript Install
|
|
||||||
|
|
||||||
1 - Musíte urèi» jazyky, pre ktoré chcete podporu. Nastavte premennú
|
|
||||||
LINGUAS na zoznam miestnych nastavení, ktoré chcete. Angliètina je
|
|
||||||
podporovaná v¾dy. Príklad:
|
|
||||||
|
|
||||||
setenv LINGUAS "pt ja de"
|
|
||||||
(csh)
|
|
||||||
|
|
||||||
alebo
|
|
||||||
|
|
||||||
export LINGUAS;LINGUAS="pt ja de"
|
|
||||||
(sh)
|
|
||||||
|
|
||||||
Zoznam podporovaných miestnych nastavení nájdete v súbore po/README.
|
|
||||||
Angliètina je implicitným jazykom.
|
|
||||||
|
|
||||||
Ak chcete preklada» a udr¾iava» súbory s miestnymi nastaveniami, preèítajte
|
|
||||||
si súbor po/README.
|
|
||||||
|
|
||||||
2 - Naviac, ak vá¹ jazyk pou¾íva multi-byte znaky, napríklad Japonèina
|
|
||||||
alebo Kórejèina, musíte nastaveniu MultiByteText priradi» YES v súbore
|
|
||||||
~/GNUstep/Defaults/WMGLOBAL
|
|
||||||
|
|
||||||
3 - Konfigurujte, kompilujte a in¹talujte Window Maker ako zvyèajne.
|
|
||||||
|
|
||||||
4 - Urèité miesne nastavenia si zvolíte nastavením premennej LANG na
|
|
||||||
to, ktoré chcete. Napríklad, ak chcete nastavi» slovenské miestne
|
|
||||||
nastavenia, musíte spusti»
|
|
||||||
|
|
||||||
setenv LANG pt
|
|
||||||
|
|
||||||
(csh)
|
|
||||||
|
|
||||||
export LANG; LANG=pt
|
|
||||||
|
|
||||||
(Bourne sh a podobné)
|
|
||||||
|
|
||||||
Pozor: Ak máte nastavenú premennú LC_CTYPE, musíte ju zru¹i» pred
|
|
||||||
spustením wmaker.
|
|
||||||
|
|
||||||
Window Maker hµadá súbory s definíciou menu v nasledovnom poradí
|
|
||||||
(v tomto prípade pre brazílsku portugalèinu):
|
|
||||||
|
|
||||||
menu.pt_BR
|
|
||||||
menu.pt
|
|
||||||
menu
|
|
||||||
|
|
||||||
|
|
||||||
5 - Ak si zvolíte jazyk, ktorý pou¾íva multi-byte znaky, musíte poriadne
|
|
||||||
nastavi» svoje fonty. Preèítajte si manuálovú stránku k XCreateFontSet,
|
|
||||||
kde nájdete viac detailov. Musíte v súbore ~/G/D/WindowMaker upravi» fonty
|
|
||||||
pre horné li¹ty, menu a iné veci. Pre fonty pou¾ité v dialógových oknách
|
|
||||||
upravte súbor ~/G/D/WMGLOBAL. Re»azce %d v menách fontov nesmú by»
|
|
||||||
odstránené. Tie¾ mô¾ete pou¾i» skript wsetfont, ktorý to urobí za vás.
|
|
||||||
|
|
||||||
Napríklad mô¾e zada» v súbore ~/G/D/WindowMaker nasledovné:
|
|
||||||
|
|
||||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
|
|
||||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
|
|
||||||
|
|
||||||
a v ~/G/D/WMGLOBAL:
|
|
||||||
|
|
||||||
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
|
||||||
|
|
||||||
Tieto dva fonty sa pou¾ijú len v aplikáciách, ktoré pou¾ívajú WINGs
|
|
||||||
(Window Maker a WPrefs.app)
|
|
||||||
|
|
||||||
Skript wsetfont vám umo¾ní nastavi» fonty jednoduch¹ím spôsobom. Pozrite
|
|
||||||
sa priamo do jeho súboru pre bli¾¹ie informácie.
|
|
||||||
|
|
||||||
90
MIRRORS
90
MIRRORS
@@ -1,90 +0,0 @@
|
|||||||
|
|
||||||
Window Maker FTP Mirror Sites
|
|
||||||
=======-=====================
|
|
||||||
|
|
||||||
Official Site (USA):
|
|
||||||
--------------------
|
|
||||||
ftp://ftp.windowmaker.info/
|
|
||||||
|
|
||||||
|
|
||||||
Australia:
|
|
||||||
----------
|
|
||||||
ftp://ftp.goldweb.com.au/pub/WindowMaker/
|
|
||||||
Contact: Matthew Hawkins <matt@goldweb.com.au>
|
|
||||||
|
|
||||||
|
|
||||||
France:
|
|
||||||
-------
|
|
||||||
ftp://ftp.ensm-ales.fr/pub/mirrors/ftp.windowmaker.org
|
|
||||||
Contact: Laurent PELLISSIER <Laurent.Pellissier@ensm-ales.fr>
|
|
||||||
|
|
||||||
|
|
||||||
Germany:
|
|
||||||
--------
|
|
||||||
ftp://ftp.freenews.de/pub/windowmaker/
|
|
||||||
Contact: Jonas Luster <jonas@cabal.arnooo.de>
|
|
||||||
|
|
||||||
|
|
||||||
United States of America:
|
|
||||||
-------------------------
|
|
||||||
ftp://ftp.io.com/pub/mirror/windowmaker/
|
|
||||||
Contact: Bobby <bobby@mezaway.org>
|
|
||||||
|
|
||||||
http://jgo.local.net/cool_downloads/wm/
|
|
||||||
Contact: Joshua Go <joshuago@usa.net>
|
|
||||||
|
|
||||||
ftp://ftp.cybertrails.com/pub/windowmaker/
|
|
||||||
Contact: Adam Jacob <adam@cybertrails.com>
|
|
||||||
|
|
||||||
|
|
||||||
Provider: Ameth Technologies
|
|
||||||
http://www.ameth.org/windowmaker/
|
|
||||||
ftp://ftp.ameth.org/pub/mirrors/ftp.windowmaker.org/
|
|
||||||
Contact: Chase Phillips <shepard@ameth.org>
|
|
||||||
|
|
||||||
|
|
||||||
Third Party Window Maker Distribution Packages
|
|
||||||
==============================================
|
|
||||||
|
|
||||||
Debian GNU/Linux (deb)
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
Contact: Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
|
|
||||||
Sites:
|
|
||||||
http://master.debian.org/~mmagallo/packages/wmaker/
|
|
||||||
|
|
||||||
|
|
||||||
RedHat GNU/Linux (RPM)
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
For Intel:
|
|
||||||
|
|
||||||
Contact: Jim Knoble <jmknoble@pobox.com>
|
|
||||||
Sites:
|
|
||||||
ftp://ftp.windowmaker.info/pub/beta/compiled/linux/rpms/
|
|
||||||
ftp://ftp.redhat.com/pub/contrib/SRPMS/
|
|
||||||
ftp://ftp.redhat.com/pub/contrib/i386/
|
|
||||||
|
|
||||||
For Alpha:
|
|
||||||
|
|
||||||
Contact: Peter Petrakis <peterpan@wn.net>
|
|
||||||
Site:
|
|
||||||
http://math.stcc.mass.edu/petrakis/downloads/X11
|
|
||||||
|
|
||||||
|
|
||||||
HP-UX
|
|
||||||
-----
|
|
||||||
|
|
||||||
Sites:
|
|
||||||
UK: http://hpux.csc.liv.ac.uk/
|
|
||||||
Germany: http://hpux.ask.uni-karlsruhe.de/
|
|
||||||
US (WI): http://hpux.cae.wisc.edu/
|
|
||||||
France: http://hpux.cict.fr/
|
|
||||||
Netherlands: http://hpux.tn.tudelft.nl/
|
|
||||||
Canada: http://hpux.ee.ualberta.ca/
|
|
||||||
Italy: http://hpux.dsi.unimi.it/
|
|
||||||
South Africa: http://hpux.petech.ac.za/
|
|
||||||
Japan: http://hpux.u-aizu.ac.jp/
|
|
||||||
US (UT): http://hpux.cs.utah.edu/
|
|
||||||
|
|
||||||
|
|
||||||
55
Makefile.am
55
Makefile.am
@@ -1,10 +1,53 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\
|
AUTOMAKE_OPTIONS =
|
||||||
contrib
|
|
||||||
|
|
||||||
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \
|
BUILT_SOURCES = config-paths.h
|
||||||
INSTALL.cs INSTALL.fr INSTALL.es INSTALL.pt INSTALL.sk \
|
|
||||||
README.definable-cursor README.pt MIRRORS COPYING.WTFPL mkpatch
|
|
||||||
# libwmfun-0.0.3.tar.gz
|
|
||||||
|
|
||||||
|
DISTCLEANFILES = config-paths.h
|
||||||
|
|
||||||
|
config.h: config-paths.h
|
||||||
|
|
||||||
|
config-paths.h: Makefile
|
||||||
|
@echo "Generating $@"
|
||||||
|
@echo '/* this is a generated file - do not edit */' > $@
|
||||||
|
@echo '' >> $@
|
||||||
|
@echo '/* gettext domain used for menu translations */' >> $@
|
||||||
|
@if test -z "$(menutextdomain)"; then \
|
||||||
|
echo '/* #undef MENU_TEXTDOMAIN "$(menutextdomain)" */' >> $@; \
|
||||||
|
else \
|
||||||
|
echo '#define MENU_TEXTDOMAIN "$(menutextdomain)"' >> $@; \
|
||||||
|
fi
|
||||||
|
@echo '' >> $@
|
||||||
|
@echo '/* define an extra path for pixmaps */' >> $@
|
||||||
|
@echo '#define PIXMAPDIR "$(pixmapdir)"' >> $@
|
||||||
|
@echo '' >> $@
|
||||||
|
@echo '/* where shared data is stored */' >> $@
|
||||||
|
@echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@
|
||||||
|
@echo '' >> $@
|
||||||
|
@echo '/* where the configuration is stored */' >> $@
|
||||||
|
@echo '#define SYSCONFDIR "$(sysconfdir)"' >> $@
|
||||||
|
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib WPrefs.app doc test
|
||||||
|
|
||||||
|
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N INSTALL \
|
||||||
|
INSTALL-WMAKER README.definable-cursor \
|
||||||
|
The-perfect-Window-Maker-patch.txt \
|
||||||
|
README COPYING.WTFPL autogen.sh \
|
||||||
|
email-clients.txt checkpatch.pl
|
||||||
|
|
||||||
|
if USE_LCOV
|
||||||
|
coverage-reset:
|
||||||
|
find . -type f -name '*.gcda' -exec rm -f '{}' ';'
|
||||||
|
lcov --directory . --zerocounters
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
rm -rf coverage @lcov_output_directory@
|
||||||
|
-mkdir -p coverage @lcov_output_directory@
|
||||||
|
lcov --compat-libtool --capture --directory . --output-file coverage/coverage.info
|
||||||
|
genhtml --output-directory @lcov_output_directory@ coverage/coverage.info
|
||||||
|
|
||||||
|
.PHONY: coverage-reset coverage
|
||||||
|
endif
|
||||||
|
|||||||
363
NEWS
363
NEWS
@@ -2,6 +2,235 @@
|
|||||||
NEWS for veteran Window Maker users
|
NEWS for veteran Window Maker users
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
--- 0.95.6
|
||||||
|
|
||||||
|
More image format supported
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
In addition to a more complete Netpbm image formats support, WindowMaker
|
||||||
|
can now load WebP images. It can also make use of the ImageMagick library
|
||||||
|
to support a lot more formats, like SVG, BMP, TGA...
|
||||||
|
|
||||||
|
|
||||||
|
--- 0.95.5
|
||||||
|
|
||||||
|
Support for generated menus in proplist format
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
The root menu now supports a OPEN_PLMENU option to construct a submenu from
|
||||||
|
the output of a command which is proplist format. This can be used e.g. in
|
||||||
|
conjunction with wmmenugen like:
|
||||||
|
|
||||||
|
(
|
||||||
|
"Generated PL Submenu", OPEN_PLMENU,
|
||||||
|
"|| find /usr/share/applications -type f -name '*desktop' | xargs wmmenugen -parser:xdg"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
New window placements
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Now it is possible to maximize windows to the top/bottom halves
|
||||||
|
of the screen and also to the corners (top/bottom + left/right).
|
||||||
|
|
||||||
|
The keyboard shortcuts can be configured with WPrefs.
|
||||||
|
|
||||||
|
|
||||||
|
Options to configure window/menu borders
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
You can now configure the width and color of window and menu borders.
|
||||||
|
For example, the default settings could be configured as follows:
|
||||||
|
|
||||||
|
$ wdwrite WindowMaker FrameBorderWidth 1
|
||||||
|
$ wdwrite WindowMaker FrameBorderColor black
|
||||||
|
$ wdwrite WindowMaker FrameSelectedBorderColor white
|
||||||
|
|
||||||
|
|
||||||
|
Keyboard shortcuts to move windows between workspaces
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
You can now bind keyboard shortcuts - or use the window dropdown menus -
|
||||||
|
to move windows to other workspaces. You can either move a window directly to
|
||||||
|
a particular workspace or to the "next" or "previous" workspace.
|
||||||
|
|
||||||
|
The new shortcuts can be configured in WPrefs.
|
||||||
|
|
||||||
|
|
||||||
|
Native support for Drawers
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
WindowMaker now supports drawers in the dock natively. You can add a dock by
|
||||||
|
right-clicking on a docked appicon and select "Add a drawer". You can now drag
|
||||||
|
appicons to this drawer.
|
||||||
|
You can customize how you want your drawers to auto-expand/collapse and
|
||||||
|
auto-raise/lower, or you can also completely disable them.
|
||||||
|
|
||||||
|
|
||||||
|
Improved switch panel functionality
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
The switch panel can be used to switch between windows of the same WM_CLASS,
|
||||||
|
for example between all open xterms. If the switch panel is opened as normal
|
||||||
|
with either the "FocusNextKey" or "FocusPrevKey" shortcut, you can switch to
|
||||||
|
the next (or previous) window of the same type as the focused window with the
|
||||||
|
"GroupNextKey" or "GroupPrevKey" shortcut. If the switch panel is opened with
|
||||||
|
the "GroupNextKey" or "GroupPrevKey" shortcut, it will show only windows of
|
||||||
|
the same type as the window which was focused at the time the panel was opened,
|
||||||
|
and no difference will be seen between the two types of window selection
|
||||||
|
shortcut.
|
||||||
|
|
||||||
|
The new shortcuts can be configured in WPrefs, where they are described as
|
||||||
|
allowing switching between windows of the same group.
|
||||||
|
|
||||||
|
To maintain consistency with other popular operating systems, the switch panel
|
||||||
|
is now configured so that it no longer automatically closes when the shift key
|
||||||
|
is pressed and released.
|
||||||
|
|
||||||
|
To configure the switch panel so that it does close on release of the shift
|
||||||
|
key, which was the traditional Window Maker behavior, run the following
|
||||||
|
command:
|
||||||
|
|
||||||
|
$ wdwrite WindowMaker StrictWindozeCycling NO
|
||||||
|
|
||||||
|
If you find yourself regularly opening the switch panel just to visualize open
|
||||||
|
windows, you can run the following command to force the first "FocusNextKey"
|
||||||
|
or similar shortcut to open the panel without switching to a new window.
|
||||||
|
|
||||||
|
$ wdwrite WindowMaker SwitchPanelOnlyOpen YES
|
||||||
|
|
||||||
|
|
||||||
|
--- 0.95.4
|
||||||
|
|
||||||
|
New window placement strategy
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
Among the window placement algorithms has arrived the "center" placement to
|
||||||
|
get new windows appear at the center of the screen (unless application
|
||||||
|
explicitly specify a position, of course).
|
||||||
|
|
||||||
|
|
||||||
|
Removed dependency to CPP
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
The menu files used to be pre-processed with CPP, which can be a problem because
|
||||||
|
modern system do not install dev tools by default, and some compilers do not
|
||||||
|
provide a pre-processor anyway. WindowMaker is now autonomous.
|
||||||
|
|
||||||
|
|
||||||
|
--- 0.95.3
|
||||||
|
|
||||||
|
The references to the legacy path /usr/X11R6 have been removed because xorg
|
||||||
|
does not use it in favor of a standard /usr layout. Similarly, the directory
|
||||||
|
/etc/X11/WindowMaker is now /usr/share/WindowMaker.
|
||||||
|
|
||||||
|
|
||||||
|
New application Relaunching functionality
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
There are now several ways to launch a new instance of an application with the
|
||||||
|
same command line that was originally used to start it.
|
||||||
|
|
||||||
|
1. By selecting Launch from the application's window menu.
|
||||||
|
2. By using the "Launch new instance of application" keyboard shortcut.
|
||||||
|
3. By clicking the application's appicon with the middle button.
|
||||||
|
4. By double-clicking the application's appicon while holding Control.
|
||||||
|
|
||||||
|
For example, if you have two xterms open, one started with "xterm" and one
|
||||||
|
started with "xterm -rv", using the Relaunch functionality on the first xterm
|
||||||
|
would run "xterm" and using it on the second would run "xterm -rv". Thus
|
||||||
|
Relaunching can also be thought of as "cloning" an application.
|
||||||
|
|
||||||
|
Application Relaunching works by examining the window's WM_COMMAND property and
|
||||||
|
so will not work if it is not set.
|
||||||
|
|
||||||
|
|
||||||
|
Options to limit the window/menu title height
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
You can now set the minimum and maximum titlebar heights.
|
||||||
|
For example, to force all titlebars to 24 pixels execute
|
||||||
|
the following commands:
|
||||||
|
|
||||||
|
$ wdwrite WindowMaker WindowTitleMinHeight 24
|
||||||
|
$ wdwrite WindowMaker WindowTitleMaxHeight 24
|
||||||
|
$ wdwrite WindowMaker MenuTitleMinHeight 24
|
||||||
|
$ wdwrite WindowMaker MenuTitleMaxHeight 24
|
||||||
|
|
||||||
|
|
||||||
|
--- 0.95.2
|
||||||
|
|
||||||
|
New Resizing functionality
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
You can now use the mouse wheel and modifier keys to resize windows.
|
||||||
|
MOD+Wheel will resize windows vertically and CTRL+Wheel will resize
|
||||||
|
windows horizontally. MOD+CTRL+Wheel will resize both at the same time.
|
||||||
|
The resize step, or increment can be set in WPrefs in the "Window Handling"
|
||||||
|
page, or in the config file with "ResizeIncrement". If this intrudes into
|
||||||
|
a specific application's functionality, you can disable it on an application-
|
||||||
|
by-application basis by setting the "Do not bind mouse clicks" attribute in
|
||||||
|
"Advanced Options".
|
||||||
|
|
||||||
|
New Maximize functionality
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Maximus/Maximumize. A new tiled maximization, configured with a keyboard
|
||||||
|
shortcut. Using it will maximize the window to the greatest area such that it
|
||||||
|
will not overlap any other window of the same workspace. This can be configured
|
||||||
|
in WPrefs in the "Keyboard Shortcuts" page, or in the config file with
|
||||||
|
"MaximusKey".
|
||||||
|
|
||||||
|
Left/right maximization. Now wmaker supports maximizing a window to the
|
||||||
|
left or right half of the screen, making it occupy 50% of the area. This is
|
||||||
|
useful on wide screen displays where you want to bring up two windows side-by-
|
||||||
|
side. The shortcut keys for this can be configured in WPrefs in the "Keyboard
|
||||||
|
Shortcuts" page, or in the config file with "LHMaximizeKey" and "RHMaximizeKey"
|
||||||
|
|
||||||
|
History and AutoComplete in the run dialog
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
The "Run..." dialog now auto-completes executables in your path (triggered by
|
||||||
|
the TAB key) and records the history of past commands (last 500 by default).
|
||||||
|
It can also complete folder names if you start the complete with a "/"
|
||||||
|
To use it replace %a with %A in the "Run..." entry in your WMRootMenu file.
|
||||||
|
See commit 05720d97076ffc1569e5 for more details.
|
||||||
|
|
||||||
|
Automatic menu generator (wmgenmenu)
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
There is now a new utility to generate the Window Maker menu automatically,
|
||||||
|
called wmgenmenu. It searches from a list of pre-defined applications the
|
||||||
|
ones which exist in your $PATH and adds them to the corresponding submenus
|
||||||
|
("Internet", "Terminals", "Editors" etc) of your WM menu. It also supports
|
||||||
|
localization (currently English and German). You can use it like:
|
||||||
|
|
||||||
|
$ wmgenmenu > WMRootMenu-new
|
||||||
|
$ cp WMRootMenu-new $HOME/GNUstep/Defaults/WMRootMenu
|
||||||
|
|
||||||
|
and WM will automatically detect the new menu file and use it without
|
||||||
|
restarting wmaker (made possible by the 'inotify' mechanism)
|
||||||
|
|
||||||
|
Automatic detection of menu changes (via inotify)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
Window Maker now uses the 'inotify' mechanism from the Linux kernel
|
||||||
|
to automatically detect changes in the WMRootMenu file. So the
|
||||||
|
--no-polling option is now gone and Window Maker does not wake up
|
||||||
|
your CPU unnecessarily (0 wakeups when idle, instead of 4).
|
||||||
|
So if you edit the WMRootMenu file by hand (or by using 'wmgenmenu'),
|
||||||
|
there is no need to restart wmaker for the changes to take effect.
|
||||||
|
|
||||||
|
DockApp recognition
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
In addition to applications with only Withdrawn windows, Window Maker
|
||||||
|
will now treat any application with its WM_CLASS res_class set as
|
||||||
|
"DockApp". This provides an easy workaround for toolkits like gtk+ that
|
||||||
|
do not allow creation of windows with the initial_state member of
|
||||||
|
XWMHints set to WithdrawnState.
|
||||||
|
|
||||||
|
|
||||||
--- 0.92.0
|
--- 0.92.0
|
||||||
|
|
||||||
GNUstep Installation Directory
|
GNUstep Installation Directory
|
||||||
@@ -84,7 +313,7 @@ NetWM / EWMH Support
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Support for the EWMH standard has been added. Applications from GNOME 2.x and
|
Support for the EWMH standard has been added. Applications from GNOME 2.x and
|
||||||
KDE 3.x should now interoperate better with Window Maker.
|
KDE 3.x should now inter-operate better with Window Maker.
|
||||||
|
|
||||||
Support for the obsolete/legacy GNOME 1.x, KDE 1.x and OpenLook(!) hints was
|
Support for the obsolete/legacy GNOME 1.x, KDE 1.x and OpenLook(!) hints was
|
||||||
wiped out for the sake of sanity.
|
wiped out for the sake of sanity.
|
||||||
@@ -187,13 +416,13 @@ Shared application icons
|
|||||||
Real application icon sharing was implemented in place of the collapse
|
Real application icon sharing was implemented in place of the collapse
|
||||||
appicon thing. With this applications of the same instance.class will
|
appicon thing. With this applications of the same instance.class will
|
||||||
have a single shared application icon and hiding will hide all windows
|
have a single shared application icon and hiding will hide all windows
|
||||||
of the aplications attached to that appicon as if there is a single
|
of the application attached to that appicon as if there is a single
|
||||||
application. This feature is enabled by default for all applications in
|
application. This feature is enabled by default for all applications in
|
||||||
the global WMWindowAttributes defaults domain using:
|
the global WMWindowAttributes defaults domain using:
|
||||||
|
|
||||||
"*" = {SharedAppIcon = Yes;};
|
"*" = {SharedAppIcon = Yes;};
|
||||||
|
|
||||||
If you're not satisfied with this or want the old behaviour back you
|
If you're not satisfied with this or want the old behavior back you
|
||||||
can revert this (either in the global domain for all users or in your
|
can revert this (either in the global domain for all users or in your
|
||||||
personal WMWindowAttibutes domain) using SharedAppIcon = No; for "*"
|
personal WMWindowAttibutes domain) using SharedAppIcon = No; for "*"
|
||||||
It can also be enabled/disabled for individual applications as needed.
|
It can also be enabled/disabled for individual applications as needed.
|
||||||
@@ -273,7 +502,7 @@ the one where the cursor pointer is.
|
|||||||
- Try to place windows inside one head in non-manual placement modes
|
- Try to place windows inside one head in non-manual placement modes
|
||||||
|
|
||||||
|
|
||||||
Less dependancies
|
Less dependencies
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
starting with 0.70.0 libPropList is no longer required to build Window
|
starting with 0.70.0 libPropList is no longer required to build Window
|
||||||
@@ -404,7 +633,7 @@ configuration files (good for laptops to let them spin disks down when idle).
|
|||||||
Note:
|
Note:
|
||||||
For the ones used with Jim Knoble's 'no polling' patch, this is the same,
|
For the ones used with Jim Knoble's 'no polling' patch, this is the same,
|
||||||
except that the need to #define ENABLE_NO_POLLING in wconfig.h was removed
|
except that the need to #define ENABLE_NO_POLLING in wconfig.h was removed
|
||||||
and the behaviour is always available if you use the command line option.
|
and the behavior is always available if you use the command line option.
|
||||||
|
|
||||||
|
|
||||||
--- 0.63.0
|
--- 0.63.0
|
||||||
@@ -424,7 +653,7 @@ with each section having the specified thickness.
|
|||||||
wmagnify
|
wmagnify
|
||||||
--------
|
--------
|
||||||
|
|
||||||
The wmagnify utility will magnify the area on teh screen where
|
The wmagnify utility will magnify the area on the screen where
|
||||||
your mouse pointer is located, updating it in real-time.
|
your mouse pointer is located, updating it in real-time.
|
||||||
|
|
||||||
tip: maximize it horizontally, make it Omnipresent and Always at Bottom.
|
tip: maximize it horizontally, make it Omnipresent and Always at Bottom.
|
||||||
@@ -439,10 +668,10 @@ covered by windows when maximizing, allowing one to easily access the clip
|
|||||||
or map a menu using the mouse in the border area, even when there are
|
or map a menu using the mouse in the border area, even when there are
|
||||||
windows maximized in both horizontal and vertical directions.
|
windows maximized in both horizontal and vertical directions.
|
||||||
WorkspaceBorder can be one of (None, LeftRight, TopBottom, AllDirections)
|
WorkspaceBorder can be one of (None, LeftRight, TopBottom, AllDirections)
|
||||||
while WorkspaceBorderSize is the size in pixles of the border not to be
|
while WorkspaceBorderSize is the size in pixels of the border not to be
|
||||||
covered by windows when maximizing (usually a small amount 0..5 pixles).
|
covered by windows when maximizing (usually a small amount 0..5 pixels).
|
||||||
|
|
||||||
Both options can be set using WPrefs.app in the "Miscelaneous Ergonomic
|
Both options can be set using WPrefs.app in the "Miscellaneous Ergonomic
|
||||||
Preferences" section. WPrefs will always limit WorkspaceBorderSize in the
|
Preferences" section. WPrefs will always limit WorkspaceBorderSize in the
|
||||||
(0..5) range.
|
(0..5) range.
|
||||||
|
|
||||||
@@ -531,15 +760,15 @@ Window edge attraction was now added.
|
|||||||
|
|
||||||
Attraction = YES/NO;
|
Attraction = YES/NO;
|
||||||
|
|
||||||
will enable/disable gravity to edge's boder.
|
will enable/disable gravity to edge's border.
|
||||||
The strength of gravity can be controled by modify `EdgeResistance' value
|
The strength of gravity can be controlled by modify `EdgeResistance' value
|
||||||
in WindowMaker configuration file.
|
in WindowMaker configuration file.
|
||||||
|
|
||||||
|
|
||||||
Titlebar Draw String Plugin
|
Titlebar Draw String Plugin
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
FTitleColor, UTitleColor, PTitleColor, MenuTitleColor can be assigend with
|
FTitleColor, UTitleColor, PTitleColor, MenuTitleColor can be assigned with
|
||||||
drawstring plugin instead of plain color. For example:
|
drawstring plugin instead of plain color. For example:
|
||||||
|
|
||||||
FTitleColor = (
|
FTitleColor = (
|
||||||
@@ -552,7 +781,7 @@ drawstring plugin instead of plain color. For example:
|
|||||||
);
|
);
|
||||||
|
|
||||||
will invoke function drawplainstring from libwmfun.so and pass 3 colors for
|
will invoke function drawplainstring from libwmfun.so and pass 3 colors for
|
||||||
arguments. To code new plugin, please see plugin.h for more informations.
|
arguments. To code new plugin, please see plugin.h for more information.
|
||||||
|
|
||||||
|
|
||||||
--- 0.60.0
|
--- 0.60.0
|
||||||
@@ -574,7 +803,7 @@ SHEXEC <command> will execute the shell command.
|
|||||||
|
|
||||||
If you want to execute something like blabla > /dev/null, then use SHEXEC
|
If you want to execute something like blabla > /dev/null, then use SHEXEC
|
||||||
|
|
||||||
Dont forget to update your menus.
|
Don't forget to update your menus.
|
||||||
|
|
||||||
|
|
||||||
New Option For setstyle
|
New Option For setstyle
|
||||||
@@ -644,7 +873,7 @@ This entry will work in the following way, depending on the context:
|
|||||||
2. If one or more icons are already selected when the Clip menu is called, the
|
2. If one or more icons are already selected when the Clip menu is called, the
|
||||||
entry will be named "Toggle Omnipresent" and will apply to all selected
|
entry will be named "Toggle Omnipresent" and will apply to all selected
|
||||||
icons trying to toggle their omnipresent state. The icons which will be
|
icons trying to toggle their omnipresent state. The icons which will be
|
||||||
succesfully changed to their new state as requested, will be unselected,
|
successfully changed to their new state as requested, will be unselected,
|
||||||
while the ones that will fail for some reason to gain their new state,
|
while the ones that will fail for some reason to gain their new state,
|
||||||
will remain selected.
|
will remain selected.
|
||||||
|
|
||||||
@@ -672,7 +901,7 @@ don't need a panel to explain them why ;) ).
|
|||||||
|
|
||||||
Now before you load your gun to start a flame war because this is against your
|
Now before you load your gun to start a flame war because this is against your
|
||||||
principles you love so much, please sit down and think that this is a feature,
|
principles you love so much, please sit down and think that this is a feature,
|
||||||
which, if you don't use, the old behaviour of the Clip is totally preserved.
|
which, if you don't use, the old behavior of the Clip is totally preserved.
|
||||||
It just adds some extra capabilities to the Clip for people who think that this
|
It just adds some extra capabilities to the Clip for people who think that this
|
||||||
is useful.
|
is useful.
|
||||||
|
|
||||||
@@ -722,8 +951,8 @@ New crash dialog panel
|
|||||||
From now on, whenever a fatal situation appears, Window Maker will display a
|
From now on, whenever a fatal situation appears, Window Maker will display a
|
||||||
dialog panel to the user and let him choose what to do.
|
dialog panel to the user and let him choose what to do.
|
||||||
The options are:
|
The options are:
|
||||||
- Abort and leave a core file (usefull for debugging and getting backtraces)
|
- Abort and leave a core file (useful for debugging and getting backtraces)
|
||||||
- Restart Window Maker (default behaviour)
|
- Restart Window Maker (default behavior)
|
||||||
- Start alternate window manager (the one defined as fallback, or if not
|
- Start alternate window manager (the one defined as fallback, or if not
|
||||||
possible fvwm or twm in this order).
|
possible fvwm or twm in this order).
|
||||||
|
|
||||||
@@ -812,7 +1041,7 @@ Full Screen Maximization
|
|||||||
|
|
||||||
The FullMaximize window attribute will allow the window to
|
The FullMaximize window attribute will allow the window to
|
||||||
be maximized to the full size of the screen (ignoring anything
|
be maximized to the full size of the screen (ignoring anything
|
||||||
like titlebar, resizebar, dock, panels etc). It should be usefull
|
like titlebar, resizebar, dock, panels etc). It should be useful
|
||||||
for programs that must use the whole screen, like games or things
|
for programs that must use the whole screen, like games or things
|
||||||
like presentation programs.
|
like presentation programs.
|
||||||
|
|
||||||
@@ -871,7 +1100,7 @@ libPropList
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
WARNING!!! libPropList was removed from the Window Maker distribution
|
WARNING!!! libPropList was removed from the Window Maker distribution
|
||||||
and is being distributed separately. If you dont have it installed yet,
|
and is being distributed separately. If you don't have it installed yet,
|
||||||
get it from ftp.windowmaker.info/pub/libs and install before building
|
get it from ftp.windowmaker.info/pub/libs and install before building
|
||||||
Window Maker.
|
Window Maker.
|
||||||
|
|
||||||
@@ -886,7 +1115,7 @@ Complaints should go to gnome people. SIGUSR1 will restart wmaker now.
|
|||||||
script change
|
script change
|
||||||
-------------
|
-------------
|
||||||
WINGs-flags was removed, and replaced by get-wraster-flags.
|
WINGs-flags was removed, and replaced by get-wraster-flags.
|
||||||
Please remove WINGs-flags from your system, since it was obsoloted by
|
Please remove WINGs-flags from your system, since it was obsoleted by
|
||||||
get-wraster-flags.
|
get-wraster-flags.
|
||||||
Continuing to use WINGs-flags can lead to hazardous effects, since is no
|
Continuing to use WINGs-flags can lead to hazardous effects, since is no
|
||||||
longer updated.
|
longer updated.
|
||||||
@@ -1002,7 +1231,7 @@ Syntax is (thgradient, <file>, <opaqueness>, <color1>, <color2>)
|
|||||||
where:
|
where:
|
||||||
<color1> and <color2> are the colors for the gradient,
|
<color1> and <color2> are the colors for the gradient,
|
||||||
<file> is the texture file and
|
<file> is the texture file and
|
||||||
<opaqueness> is the opaqueness to merge the texture witht the gradient,
|
<opaqueness> is the opaqueness to merge the texture with the gradient,
|
||||||
ranging from 0 to 255.
|
ranging from 0 to 255.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -1049,7 +1278,7 @@ AutoRaiseLower option for the Clip. This allows automatic Raise/Lower of the
|
|||||||
Clip icons when the mouse pointer enter/leave the Clip. To avoid unwanted
|
Clip icons when the mouse pointer enter/leave the Clip. To avoid unwanted
|
||||||
raising/lowering there is a time threshold before raising/lowering.
|
raising/lowering there is a time threshold before raising/lowering.
|
||||||
The thresholds can be changed in wconfig.h by changing one or both of
|
The thresholds can be changed in wconfig.h by changing one or both of
|
||||||
AUTO_LOWER_DELAY and AUTO_RAISE_DELAY (expressed in miliseconds).
|
AUTO_LOWER_DELAY and AUTO_RAISE_DELAY (expressed in milliseconds).
|
||||||
For example if you set AUTO_RAISE_DELAY to 0, then the Clip will be raised as
|
For example if you set AUTO_RAISE_DELAY to 0, then the Clip will be raised as
|
||||||
soon as the mouse pointer enters it's area. Setting AUTO_RAISE_DELAY to a very
|
soon as the mouse pointer enters it's area. Setting AUTO_RAISE_DELAY to a very
|
||||||
big value, will make the Clip to practically do not auto raise unless clicked,
|
big value, will make the Clip to practically do not auto raise unless clicked,
|
||||||
@@ -1120,7 +1349,7 @@ Hopefully it's intelligent enough, so you won't notice it.
|
|||||||
|
|
||||||
In case you want to know what's it, it's equivalent to that
|
In case you want to know what's it, it's equivalent to that
|
||||||
(insanely long) 2 second delay present in that Windoze95 menu,
|
(insanely long) 2 second delay present in that Windoze95 menu,
|
||||||
but more usefull than annoying (I hope :). To see it, do the following
|
but more useful than annoying (I hope :). To see it, do the following
|
||||||
with your current wmaker version and later with 0.20.3:
|
with your current wmaker version and later with 0.20.3:
|
||||||
|
|
||||||
- open the apps menu and stick it
|
- open the apps menu and stick it
|
||||||
@@ -1179,7 +1408,7 @@ Edit src/wconfig.h and #define ICON_KABOOM_EXTRA to get
|
|||||||
more effects for the icon undocking animation.
|
more effects for the icon undocking animation.
|
||||||
|
|
||||||
Options for superfluous stuff are even more superfluous, so this
|
Options for superfluous stuff are even more superfluous, so this
|
||||||
will not become runtime.
|
will not become run-time.
|
||||||
|
|
||||||
|
|
||||||
XDE drag and drop support
|
XDE drag and drop support
|
||||||
@@ -1193,7 +1422,7 @@ The support works with gtk 1.1.2
|
|||||||
libPropList
|
libPropList
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
libPropList will now be built automatically by wmaker. Wich means
|
libPropList will now be built automatically by wmaker. Which means
|
||||||
the (simplified) building process is now:
|
the (simplified) building process is now:
|
||||||
|
|
||||||
./configure
|
./configure
|
||||||
@@ -1220,7 +1449,7 @@ Maker will disable the animation of window creation if the focus mode is
|
|||||||
either sloppy or auto AND AutoFocus=NO.
|
either sloppy or auto AND AutoFocus=NO.
|
||||||
|
|
||||||
If you want the animation, enable AutoFocus or use manual focus mode
|
If you want the animation, enable AutoFocus or use manual focus mode
|
||||||
(prefered).
|
(preferred).
|
||||||
|
|
||||||
|
|
||||||
The NoWindowUnderDock option was removed
|
The NoWindowUnderDock option was removed
|
||||||
@@ -1228,8 +1457,8 @@ The NoWindowUnderDock option was removed
|
|||||||
To obtain the same result, use the "Keep Dock On Top" option in the dock menu.
|
To obtain the same result, use the "Keep Dock On Top" option in the dock menu.
|
||||||
|
|
||||||
|
|
||||||
Persistent Program Suplied Icons
|
Persistent Program Supplied Icons
|
||||||
--------------------------------
|
---------------------------------
|
||||||
|
|
||||||
Application supplied icons are now stored, so that the dock will keep
|
Application supplied icons are now stored, so that the dock will keep
|
||||||
showing them after the app is exited. The icons are stored at
|
showing them after the app is exited. The icons are stored at
|
||||||
@@ -1276,7 +1505,7 @@ exitscript
|
|||||||
New runtime options
|
New runtime options
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
1. Miniaturization animation is now selectable by a runtime option
|
1. Miniaturization animation is now selectable by a run-time option
|
||||||
Add a line with
|
Add a line with
|
||||||
|
|
||||||
IconificationStyle = <style>;
|
IconificationStyle = <style>;
|
||||||
@@ -1375,11 +1604,11 @@ Read WPrefs/README
|
|||||||
|
|
||||||
--- 0.18.1
|
--- 0.18.1
|
||||||
|
|
||||||
Boolean balues have changed!!! YES, Y and any non-zero integer will
|
Boolean values have changed!!! YES, Y and any non-zero integer will
|
||||||
mean TRUE and anything else (including True) will mean FALSE. This
|
mean TRUE and anything else (including True) will mean FALSE. This
|
||||||
is to conform to the OpenStep values used for booleans and
|
is to conform to the OpenStep values used for booleans and
|
||||||
not cause headaches later, when GNUstep apps also starts using
|
not cause headaches later, when GNUstep apps also starts using
|
||||||
defaults and users will try using True wich won't get recognized.
|
defaults and users will try using True which won't get recognized.
|
||||||
|
|
||||||
|
|
||||||
--- 0.18.0
|
--- 0.18.0
|
||||||
@@ -1512,7 +1741,7 @@ The Move To command was renamed to Move Icon(s) To.
|
|||||||
|
|
||||||
--- 0.17.0
|
--- 0.17.0
|
||||||
|
|
||||||
If you have libPropList installed, you might want to reinstall it,
|
If you have libPropList installed, you might want to re-install it,
|
||||||
replacing with the included libPropList. It has a small bug fix.
|
replacing with the included libPropList. It has a small bug fix.
|
||||||
|
|
||||||
Misc. Changes
|
Misc. Changes
|
||||||
@@ -1686,7 +1915,7 @@ Start miniaturized, will override start hidden if both set.
|
|||||||
|
|
||||||
IMPORTANT NOTE.
|
IMPORTANT NOTE.
|
||||||
Because of the way Netscape Communicator is implemented, it is NOT possible
|
Because of the way Netscape Communicator is implemented, it is NOT possible
|
||||||
to set the start hidden or miniatirized flags for it. This is because Netscape
|
to set the start hidden or miniaturized flags for it. This is because Netscape
|
||||||
chooses to send a second map event to the window it maps. This makes the
|
chooses to send a second map event to the window it maps. This makes the
|
||||||
window to receive a second map request and to be unhidden or maximized back,
|
window to receive a second map request and to be unhidden or maximized back,
|
||||||
immediately after it was hidden or miniaturized by WindowMaker at startup.
|
immediately after it was hidden or miniaturized by WindowMaker at startup.
|
||||||
@@ -1749,7 +1978,7 @@ They are now settable in the Attributes Panel.
|
|||||||
|
|
||||||
Also added DontSaveSession attribute. This way, you won't end up with multiple
|
Also added DontSaveSession attribute. This way, you won't end up with multiple
|
||||||
unwanted copies of the same app after the previous session is restored.
|
unwanted copies of the same app after the previous session is restored.
|
||||||
I start X with a xterm in .xinitrc instead of wmaker, wich will cause the
|
I start X with a xterm in .xinitrc instead of wmaker, which will cause the
|
||||||
xterm restored by wmaker be duplicate. Just add -name something to the
|
xterm restored by wmaker be duplicate. Just add -name something to the
|
||||||
xterm started form .xinitrc and mark DontSaveSession=YES for that window.
|
xterm started form .xinitrc and mark DontSaveSession=YES for that window.
|
||||||
|
|
||||||
@@ -1759,7 +1988,7 @@ User Specifiable Visual IDs
|
|||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
wmaker now supports different visuals than the default one. It isn't of much
|
wmaker now supports different visuals than the default one. It isn't of much
|
||||||
use for most people, but can be usefull for lucky SGI users who want it
|
use for most people, but can be useful for lucky SGI users who want it
|
||||||
to use TrueColor instead of the default PseudoColor.
|
to use TrueColor instead of the default PseudoColor.
|
||||||
|
|
||||||
wmaker -visualid VISUAL_ID
|
wmaker -visualid VISUAL_ID
|
||||||
@@ -1782,7 +2011,7 @@ The starting workspace is identified in the following order:
|
|||||||
4. Else the current workspace is used.
|
4. Else the current workspace is used.
|
||||||
|
|
||||||
Restoring saved sessions will always use the saved workspace, no matter
|
Restoring saved sessions will always use the saved workspace, no matter
|
||||||
what other options are, except onmipresent.
|
what other options are, except omnipresent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1808,8 +2037,8 @@ animation is used instead. Take a look at the section where this is described
|
|||||||
in src/wconfig.h
|
in src/wconfig.h
|
||||||
By default there is #undef SPREAD_ICON to select "Falling pieces" animation.
|
By default there is #undef SPREAD_ICON to select "Falling pieces" animation.
|
||||||
|
|
||||||
Auto Colapse for Clip
|
Auto Collapse for Clip
|
||||||
---------------------
|
----------------------
|
||||||
|
|
||||||
The clip now supports an option named "Auto Collapse" which can be set from
|
The clip now supports an option named "Auto Collapse" which can be set from
|
||||||
the clip main menu. When set, clip will stay collapsed, and will show itself
|
the clip main menu. When set, clip will stay collapsed, and will show itself
|
||||||
@@ -1835,7 +2064,7 @@ Changed name from Fiend to Clip
|
|||||||
All occurrences of word Fiend with or without capital F were replaced with
|
All occurrences of word Fiend with or without capital F were replaced with
|
||||||
the corresponding Clip (same capital).
|
the corresponding Clip (same capital).
|
||||||
This affects all configuration files under ~/GNUstep that contain this word.
|
This affects all configuration files under ~/GNUstep that contain this word.
|
||||||
It can be refered as "Workspace Dock" too.
|
It can be referred as "Workspace Dock" too.
|
||||||
|
|
||||||
|
|
||||||
New option in Clip menu, and extended Clip behavior
|
New option in Clip menu, and extended Clip behavior
|
||||||
@@ -2008,15 +2237,15 @@ Themes installed under ~/GNUstep will be available only for a user, but
|
|||||||
if if they are installed under /usr/local/share/WindowMaker they will be seen
|
if if they are installed under /usr/local/share/WindowMaker they will be seen
|
||||||
by all users. This is also true for style files, background images, pixmaps,
|
by all users. This is also true for style files, background images, pixmaps,
|
||||||
etc that get installed under /usr/local/share/WindowMaker.
|
etc that get installed under /usr/local/share/WindowMaker.
|
||||||
Themes can be saved or loaded using the Appereance menu.
|
Themes can be saved or loaded using the Appearance menu.
|
||||||
|
|
||||||
Also support for different IconSets is available. You can save or load a new
|
Also support for different IconSets is available. You can save or load a new
|
||||||
IconSet using the Appereance menu.
|
IconSet using the Appearance menu.
|
||||||
|
|
||||||
Setting background images is now as simple as putting the images in the right
|
Setting background images is now as simple as putting the images in the right
|
||||||
place (~/GNUstep/Library/WindowMaker/Backgrounds or
|
place (~/GNUstep/Library/WindowMaker/Backgrounds or
|
||||||
/usr/local/share/WindowMaker/Backgrounds, or any other place in your
|
/usr/local/share/WindowMaker/Backgrounds, or any other place in your
|
||||||
PixmapPath). Then use the Appereance menu. They will be instantly available
|
PixmapPath). Then use the Appearance menu. They will be instantly available
|
||||||
since they are opened by a OPEN_MENU command. Also the image do not need to
|
since they are opened by a OPEN_MENU command. Also the image do not need to
|
||||||
have a .jpg or any other extension. It will be recognized anyhow.
|
have a .jpg or any other extension. It will be recognized anyhow.
|
||||||
As an example please see the OpenStep theme supplied with WindowMaker.
|
As an example please see the OpenStep theme supplied with WindowMaker.
|
||||||
@@ -2104,7 +2333,7 @@ User WindowMaker configuration files are now merged with global ones
|
|||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
When starts WindowMaker will look for database domain files under
|
When starts WindowMaker will look for database domain files under
|
||||||
$GNUSTEP_USER_ROOT/Defaults or ~/GNUstep/Deafults to be read. (In this order).
|
$GNUSTEP_USER_ROOT/Defaults or ~/GNUstep/Defaults to be read. (In this order).
|
||||||
|
|
||||||
If they are not available then it will scan for them in
|
If they are not available then it will scan for them in
|
||||||
$GNUSTEP_LOCAL_ROOT/Defaults, $GNUSTEP_SYSTEM_ROOT/Defaults or
|
$GNUSTEP_LOCAL_ROOT/Defaults, $GNUSTEP_SYSTEM_ROOT/Defaults or
|
||||||
@@ -2121,7 +2350,7 @@ file will be available for users that do not have them in their config files.
|
|||||||
Any option the user have in his config file will override the one in the
|
Any option the user have in his config file will override the one in the
|
||||||
shared domain file.
|
shared domain file.
|
||||||
|
|
||||||
So any new runtime options that appear in WindowMaker domain, do not need to
|
So any new run-time options that appear in WindowMaker domain, do not need to
|
||||||
be set in all user files, except the ones the user wants a different behavior
|
be set in all user files, except the ones the user wants a different behavior
|
||||||
from the default set for all users in the shared file.
|
from the default set for all users in the shared file.
|
||||||
|
|
||||||
@@ -2134,7 +2363,7 @@ So all it needs to have is ~/GNUstep/Defaults directory available.
|
|||||||
New behavior of the Slide Icons
|
New behavior of the Slide Icons
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
Animation constants are now runtime.
|
Animation constants are now run-time.
|
||||||
They are:
|
They are:
|
||||||
IconSlideDelay = 0;
|
IconSlideDelay = 0;
|
||||||
IconSlideStep = 5;
|
IconSlideStep = 5;
|
||||||
@@ -2187,9 +2416,9 @@ Sound support
|
|||||||
|
|
||||||
Some basic sound support is now part of WindowMaker. The sound server is not
|
Some basic sound support is now part of WindowMaker. The sound server is not
|
||||||
yet part of WindowMaker distribution, so you need to download it separately.
|
yet part of WindowMaker distribution, so you need to download it separately.
|
||||||
This is because is linux specific, and need some changes before it can be
|
This is because is Linux specific, and need some changes before it can be
|
||||||
included.
|
included.
|
||||||
Until them if you have a linux system and want to use sound, use the
|
Until them if you have a Linux system and want to use sound, use the
|
||||||
wmsound-0.5 available at http://www.geocities.com/SiliconValley/Bay/7874
|
wmsound-0.5 available at http://www.geocities.com/SiliconValley/Bay/7874
|
||||||
Download that package, and only build the sound server there.
|
Download that package, and only build the sound server there.
|
||||||
DO NO APPLY ANY PATCHES FROM THERE!, because they are already applied.
|
DO NO APPLY ANY PATCHES FROM THERE!, because they are already applied.
|
||||||
@@ -2199,7 +2428,7 @@ procedure.
|
|||||||
|
|
||||||
To enable sound for WindowMaker pass --enable-sound to configure.
|
To enable sound for WindowMaker pass --enable-sound to configure.
|
||||||
|
|
||||||
Also use NoSound = Yes/No; to enable/disable sound at runtime without killing
|
Also use NoSound = Yes/No; to enable/disable sound at run-time without killing
|
||||||
the sound server.
|
the sound server.
|
||||||
|
|
||||||
If you cannot set the sound to work yet, then is not for you.
|
If you cannot set the sound to work yet, then is not for you.
|
||||||
@@ -2209,7 +2438,7 @@ Wait until the sound server will be fixed and will be part of WindowMaker.
|
|||||||
New entries in WindowMaker domain database
|
New entries in WindowMaker domain database
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
The following entries have been added to the runtime options:
|
The following entries have been added to the run-time options:
|
||||||
|
|
||||||
SaveSessionOnExit = No;
|
SaveSessionOnExit = No;
|
||||||
|
|
||||||
@@ -2230,7 +2459,7 @@ If you set it to "128, 128" it will have 2 rows and 2 columns not overlapped.
|
|||||||
|
|
||||||
NoSound = No;
|
NoSound = No;
|
||||||
|
|
||||||
Enable/disable sound at runtime without the need of killing the sound server.
|
Enable/disable sound at run-time without the need of killing the sound server.
|
||||||
|
|
||||||
|
|
||||||
MenuScrollDelay = 10;
|
MenuScrollDelay = 10;
|
||||||
@@ -2275,7 +2504,7 @@ Here are the new fiend features:
|
|||||||
|
|
||||||
All reside in WindowMaker configuration file.
|
All reside in WindowMaker configuration file.
|
||||||
|
|
||||||
2. Added posibility to launch the workspace menu with button1 click on the
|
2. Added possibility to launch the workspace menu with button1 click on the
|
||||||
idle indicator of fiend, or with button3 click on workspace name on the
|
idle indicator of fiend, or with button3 click on workspace name on the
|
||||||
fiend.
|
fiend.
|
||||||
|
|
||||||
@@ -2285,7 +2514,7 @@ Here are the new fiend features:
|
|||||||
4. Fiend's idle indicator do have a color that reflects its normal/collapsed
|
4. Fiend's idle indicator do have a color that reflects its normal/collapsed
|
||||||
state.
|
state.
|
||||||
|
|
||||||
5. The delay between changing workspaces from fiend is now a runtime option:
|
5. The delay between changing workspaces from fiend is now a run-time option:
|
||||||
|
|
||||||
WorkspaceChangeDelay = 700;
|
WorkspaceChangeDelay = 700;
|
||||||
|
|
||||||
@@ -2293,15 +2522,15 @@ Here are the new fiend features:
|
|||||||
|
|
||||||
6. Application icons can be moved between dock and fiend now.
|
6. Application icons can be moved between dock and fiend now.
|
||||||
|
|
||||||
7. The way workspaces are changed is controlled now by two runtime options:
|
7. The way workspaces are changed is controlled now by two run-time options:
|
||||||
|
|
||||||
AdvanceToNewWorkspace=Yes/No;
|
AdvanceToNewWorkspace=Yes/No;
|
||||||
CycleWorkspaces=Yes/No;
|
CycleWorkspaces=Yes/No;
|
||||||
|
|
||||||
Both apply to either fiend navigating buttons or to next/prev worksapace
|
Both apply to either fiend navigating buttons or to next/prev workspace
|
||||||
keybindings. Both default to No, and are in WindowMaker configuration file.
|
keybindings. Both default to No, and are in WindowMaker configuration file.
|
||||||
|
|
||||||
8. Also added posibility to advance to new workspace, no matter what value
|
8. Also added possibility to advance to new workspace, no matter what value
|
||||||
AdvanceToNewWorkspace have, with Control-button1-click on "next workspace"
|
AdvanceToNewWorkspace have, with Control-button1-click on "next workspace"
|
||||||
fiend button.
|
fiend button.
|
||||||
|
|
||||||
@@ -2336,14 +2565,14 @@ In case of WorkspaceBack, color is used to be set in the background until
|
|||||||
the image gets loaded and displayed. This is to avoid the stippled screen
|
the image gets loaded and displayed. This is to avoid the stippled screen
|
||||||
the X server shows, in case the image is big and loads slow.
|
the X server shows, in case the image is big and loads slow.
|
||||||
There is a small utility in the util directory, named wmsetbg which is
|
There is a small utility in the util directory, named wmsetbg which is
|
||||||
used to set the background image. This is needed for windowmaker not to
|
used to set the background image. This is needed for WindowMaker not to
|
||||||
freeze while loading and scaling the image.
|
freeze while loading and scaling the image.
|
||||||
Currently it is hardcoded in windowmaker to use wmsetbg to set the background
|
Currently it is hardcoded in WindowMaker to use wmsetbg to set the background
|
||||||
image, and is better to use it since is smaller that other image manipulation
|
image, and is better to use it since is smaller that other image manipulation
|
||||||
programs, and it is compiled with support for same image types as windowmaker.
|
programs, and it is compiled with support for same image types as WindowMaker.
|
||||||
Since it comes and is installed with WindowMaker, there will be no need to
|
Since it comes and is installed with WindowMaker, there will be no need to
|
||||||
download and use an external app, which also may not have support for the same
|
download and use an external app, which also may not have support for the same
|
||||||
image types as windowmaker.
|
image types as WindowMaker.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2375,13 +2604,13 @@ When an icons is to be docked, but the position can be either in the dock
|
|||||||
or in the fiend, the dock will be used first, and the icon will be docked
|
or in the fiend, the dock will be used first, and the icon will be docked
|
||||||
there.
|
there.
|
||||||
|
|
||||||
Here are the new runtime options introduced by the fiend:
|
Here are the new run-time options introduced by the fiend:
|
||||||
Files are located in ~/GNUstep/Defaults/
|
Files are located in ~/GNUstep/Defaults/
|
||||||
|
|
||||||
In WMWindowAttributes:
|
In WMWindowAttributes:
|
||||||
"Logo.WMFiend" = {Icon = "Cone.xpm";}; - icon for the fiend
|
"Logo.WMFiend" = {Icon = "Cone.xpm";}; - icon for the fiend
|
||||||
|
|
||||||
In Windowmaker:
|
In WindowMaker:
|
||||||
FiendMaxIcons = 25; - the max number of icons in fiend per
|
FiendMaxIcons = 25; - the max number of icons in fiend per
|
||||||
workspace
|
workspace
|
||||||
FiendTitleFont = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*";
|
FiendTitleFont = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*";
|
||||||
@@ -2409,7 +2638,7 @@ to work.
|
|||||||
*** Enhanced Attribute editor.
|
*** Enhanced Attribute editor.
|
||||||
|
|
||||||
Now you can save defaults for all windows.
|
Now you can save defaults for all windows.
|
||||||
Please note that only Icon, KeepInsideScree, and sometimes NoAppIcon
|
Please note that only Icon, KeepInsideScreen, and sometimes NoAppIcon
|
||||||
can be useful in a normal environment. But others may have other opinion ;)
|
can be useful in a normal environment. But others may have other opinion ;)
|
||||||
If you set AlwaysUserIcon default for all windows, note that apps like
|
If you set AlwaysUserIcon default for all windows, note that apps like
|
||||||
asclock, wmload, wmmail, wmrack, will show that icon instead of their
|
asclock, wmload, wmmail, wmrack, will show that icon instead of their
|
||||||
@@ -2434,7 +2663,7 @@ every time you minimize the window and is destroyed when you restore.
|
|||||||
|
|
||||||
--- 0.13.0
|
--- 0.13.0
|
||||||
|
|
||||||
*** Atribute editor is working ;).
|
*** Attribute editor is working ;).
|
||||||
|
|
||||||
How it works is quite obvious.
|
How it works is quite obvious.
|
||||||
Anyway, here is a short description.
|
Anyway, here is a short description.
|
||||||
@@ -2464,7 +2693,7 @@ until you close them.
|
|||||||
Please note that only the root_menu, the window switch_menu and the
|
Please note that only the root_menu, the window switch_menu and the
|
||||||
workspaces_menu can be saved this way.
|
workspaces_menu can be saved this way.
|
||||||
|
|
||||||
*** Changed the lousy Windoze menu behaviour.
|
*** Changed the lousy Windoze menu behavior.
|
||||||
|
|
||||||
This applies to 'NextMenuBehaviour = NO;'
|
This applies to 'NextMenuBehaviour = NO;'
|
||||||
|
|
||||||
@@ -2476,7 +2705,7 @@ will be selected after that delay, and launched when you will release the
|
|||||||
mouse button.
|
mouse button.
|
||||||
If the click was short, a second one is needed to launch the item.
|
If the click was short, a second one is needed to launch the item.
|
||||||
|
|
||||||
*** Autoarrange icons is now a runtime option
|
*** Auto-arrange icons is now a run-time option
|
||||||
|
|
||||||
Use
|
Use
|
||||||
AutoArrangeIcons = YES/NO;
|
AutoArrangeIcons = YES/NO;
|
||||||
@@ -2498,7 +2727,7 @@ and works completely independent.
|
|||||||
|
|
||||||
OPEN_MENU | /foo/bar/script
|
OPEN_MENU | /foo/bar/script
|
||||||
|
|
||||||
will make a menu that is dinamically constructed by /foo/bar/script
|
will make a menu that is dynamically constructed by /foo/bar/script
|
||||||
|
|
||||||
|
|
||||||
--- 0.12.0
|
--- 0.12.0
|
||||||
|
|||||||
235
README
235
README
@@ -4,8 +4,7 @@
|
|||||||
GNU Window Maker
|
GNU Window Maker
|
||||||
X11 Window Manager
|
X11 Window Manager
|
||||||
|
|
||||||
<http://windowmaker.info>
|
<http://windowmaker.org>
|
||||||
<ftp://ftp.windowmaker.info>
|
|
||||||
|
|
||||||
by
|
by
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
|
|
||||||
Congratulations! You have purchased an extremely fine
|
Congratulations! You have purchased an extremely fine
|
||||||
device that would give you thousands of years of trouble-free
|
device that would give you thousands of years of trouble-free
|
||||||
service, except that you undoubtably will destroy it via some
|
service, except that you undoubtedly will destroy it via some
|
||||||
typical bonehead consumer maneuver. Which is why we ask you
|
typical bonehead consumer maneuver. Which is why we ask you
|
||||||
to PLEASE FOR GOD'S SAKE READ THIS OWNER'S MANUAL CAREFULLY
|
to PLEASE FOR GOD'S SAKE READ THIS OWNER'S MANUAL CAREFULLY
|
||||||
BEFORE YOU UNPACK THE DEVICE. YOU ALREADY UNPACKED IT, DIDN'T
|
BEFORE YOU UNPACK THE DEVICE. YOU ALREADY UNPACKED IT, DIDN'T
|
||||||
@@ -41,26 +40,25 @@
|
|||||||
Description
|
Description
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Window Maker is the GNU window manager for the X Window System. It was
|
Window Maker is the GNU window manager for the X Window System. It was designed
|
||||||
designed to emulate the look and feel of part of the NEXTSTEP(tm) GUI. It's
|
to emulate the look and feel of part of the NEXTSTEP(tm) GUI. It's supposed to
|
||||||
supposed to be relatively fast and small, feature rich, easy to configure and
|
be relatively fast and small, feature rich, easy to configure and easy to use,
|
||||||
easy to use, with a simple and elegant appearance borrowed from NEXTSTEP(tm).
|
with a simple and elegant appearance borrowed from NEXTSTEP(tm).
|
||||||
|
|
||||||
Window Maker was designed keeping integration with GNUstep in mind and is the
|
Window Maker was designed keeping integration with GNUstep in mind and is the
|
||||||
"official" window manager for it. It is also part of the GNU project
|
"official" window manager for it. It is also part of the GNU project
|
||||||
(www.gnu.org) Read more about GNUstep further on this file.
|
(www.gnu.org) Read more about GNUstep further on this file.
|
||||||
|
|
||||||
Hints (information given by applications to integrate well with the window
|
Hints (information given by applications to integrate well with the window
|
||||||
manager) for Motif(tm) and NETWM are also supported (NETWM is used by KDE
|
manager) for Motif(tm) and NETWM are also supported (NETWM is used by KDE and
|
||||||
and GNOME, so they are automatically supported as a result).
|
GNOME, so they are automatically supported as a result). So you can replace any
|
||||||
So you can replace any of the window managers for these environments
|
of the window managers for these environments with Window Maker while keeping
|
||||||
with Window Maker while keeping most, if not all, of the native window manager
|
most, if not all, of the native window manager functionality.
|
||||||
functionality.
|
|
||||||
|
|
||||||
Window Maker was previously called WindowMaker.
|
Window Maker was previously called WindowMaker.
|
||||||
|
|
||||||
Window Maker has no connection with Windowmaker, the software for
|
Window Maker has no connection with Windowmaker, the software for making windows
|
||||||
making windows and doors.
|
and doors.
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
@@ -72,8 +70,7 @@ Read before asking.
|
|||||||
in the directories.
|
in the directories.
|
||||||
|
|
||||||
* INSTALL has installation instructions and some troubleshooting tips.
|
* INSTALL has installation instructions and some troubleshooting tips.
|
||||||
You're meant to read it before installing. it was not written just to
|
You're meant to read it if you are compiling the sources.
|
||||||
fill up space in the package...
|
|
||||||
|
|
||||||
* FAQ: Frequently Asked Questions. READ IT!!! FAQ.I18N is for
|
* FAQ: Frequently Asked Questions. READ IT!!! FAQ.I18N is for
|
||||||
internationalization related questions.
|
internationalization related questions.
|
||||||
@@ -81,29 +78,17 @@ internationalization related questions.
|
|||||||
* NEWS: list user visible changes from the previous version. Read it if
|
* NEWS: list user visible changes from the previous version. Read it if
|
||||||
you are upgrading.
|
you are upgrading.
|
||||||
|
|
||||||
* MIRRORS: some alternative places where you can get Window Maker,
|
|
||||||
including platform specific packages of Window Maker.
|
|
||||||
|
|
||||||
* BUGFORM: use it to send bug reports. Please do use it.
|
* BUGFORM: use it to send bug reports. Please do use it.
|
||||||
|
|
||||||
* ChangeLog: what changed from the previous version?
|
* ChangeLog: what changed from the previous version?
|
||||||
|
|
||||||
|
|
||||||
* BUGS: list of known bugs
|
* BUGS: list of known bugs
|
||||||
|
|
||||||
*** Tutorial
|
|
||||||
|
|
||||||
There's a tutorial maintained by Georges Tarbouriech at:
|
|
||||||
|
|
||||||
http://www.linuxfocus.org/~georges.t/
|
|
||||||
|
|
||||||
|
|
||||||
*** User Guide
|
*** User Guide
|
||||||
|
|
||||||
The Window Maker User's Guide can be downloaded from the official ftp
|
The Window Maker User's Guide can be downloaded from the official ftp
|
||||||
or web sites.
|
or web sites.
|
||||||
It can also be viewed in HTML format in:
|
|
||||||
http://people.delphi.com/crc3419/WMUserGuide/index.htm
|
|
||||||
|
|
||||||
The User Guide explains how to use Window Maker, the configuration files
|
The User Guide explains how to use Window Maker, the configuration files
|
||||||
and options.
|
and options.
|
||||||
@@ -119,145 +104,123 @@ Directories & Files in the Source Tree
|
|||||||
======================================
|
======================================
|
||||||
|
|
||||||
* Install is a script for configuring and compiling Window Maker in a easy
|
* Install is a script for configuring and compiling Window Maker in a easy
|
||||||
way (not that the normal way is difficult, but...).
|
way (not that the normal way is difficult, but...).
|
||||||
|
|
||||||
* AUTHORS: the credits
|
* AUTHORS: the credits
|
||||||
|
|
||||||
* TODO: plans for the future
|
* TODO: plans for the future
|
||||||
|
|
||||||
* contrib/ has some contributed patches that are not supported by Window Maker
|
|
||||||
because they conflict with design filosophies of the developers or some
|
|
||||||
other reason.
|
|
||||||
|
|
||||||
* util/ has various utility programs.
|
* util/ has various utility programs.
|
||||||
|
|
||||||
* WPrefs.app/ is the configuration program.
|
* WPrefs.app/ is the configuration program.
|
||||||
|
|
||||||
* src/wconfig.h has compile time options you can change to select some
|
* src/wconfig.h has compile time options you can change to select some
|
||||||
options/features and other stuff.
|
options/features and other stuff.
|
||||||
|
|
||||||
* WINGs/ NEXTSTEP lookalike widget library
|
* WINGs/ NEXTSTEP lookalike widget library
|
||||||
|
|
||||||
* wrlib/ image processing library
|
* wrlib/ image processing library
|
||||||
|
|
||||||
* po/ has message catalogs wich are the translated versions of the messages
|
* po/ has message catalogs which are the translated versions of the messages
|
||||||
displayed by Window Maker.
|
displayed by Window Maker.
|
||||||
|
|
||||||
* docklib-x.x.tar.gz a library for writing dockapps
|
|
||||||
|
|
||||||
|
|
||||||
HELP ME!!!
|
HELP ME!!!
|
||||||
==========
|
==========
|
||||||
|
|
||||||
There is a mailing list for discussing Window Maker at
|
There is a mailing list for discussing Window Maker at
|
||||||
wm-user@windowmaker.info To subscribe to it, send a message containing:
|
wmaker-user@lists.windowmaker.org To subscribe to it, send a message to
|
||||||
subscribe
|
wmaker-user-subscribe@lists.windowmaker.org
|
||||||
in the subject of the message to wm-user-request@windowmaker.info
|
|
||||||
|
|
||||||
If you got a problem, ask there (after reading the docs, of course). The
|
If you got a problem, ask there (after reading the docs, of course). The people
|
||||||
people there is more likely to be able to answer your questions than we are.
|
there is more likely to be able to answer your questions than we are. For bug
|
||||||
For bug reports use the BUGFORM.
|
reports use the BUGFORM.
|
||||||
|
|
||||||
If you have a problem with a precompiled version of Window Maker
|
If you have a problem with a precompiled version of Window Maker (rpm, deb etc),
|
||||||
(rpm, deb etc), first ask the person who made the package.
|
first ask the person who made the package.
|
||||||
|
|
||||||
IMPORTANT NOTE: when asking for help (in the mailing list or to the
|
IMPORTANT NOTE: when asking for help (in the mailing list or to the developers,
|
||||||
developerts, directly) *always* send information about the system you are
|
directly) *always* send information about the system you are using. You can use
|
||||||
using. You can use the system information section at the end of BUGFORM as a
|
the system information section at the end of BUGFORM as a guideline. Another
|
||||||
guideline. Another thing: please don't send HTML mail.
|
thing: please don't send HTML mail.
|
||||||
|
|
||||||
|
|
||||||
There is also a #windowmaker IRC channel at openprojects. To join there,
|
There is also a #windowmaker IRC channel at freenode. To join there, connect
|
||||||
connect your irc client to irc.openprojects.net, irc.linux.com or some other
|
your irc client to irc.freenode.net. irc.windowmaker.org will direct you to the
|
||||||
server of that network.
|
correct IRC network.
|
||||||
|
|
||||||
|
|
||||||
GNUstep
|
GNUstep
|
||||||
=======
|
=======
|
||||||
|
|
||||||
GNUstep is a complete object-oriented development system, based on the
|
GNUstep is a complete object-oriented development system, based on the OpenStep
|
||||||
OpenStep specification released by NeXT(tm) (now Apple(tm)) and Sun(tm). It
|
specification released by NeXT(tm) (now Apple(tm)) and Sun(tm). It will provide
|
||||||
will provide everything one needs to produce cross-platform, object-oriented,
|
everything one needs to produce cross-platform, object-oriented, graphical (and
|
||||||
graphical (and non-graphical) applications; providing among other things,
|
non-graphical) applications; providing among other things, base system
|
||||||
base system libraries, a high-level GUI application framework that uses a
|
libraries, a high-level GUI application framework that uses a Display
|
||||||
Display PostScript(tm)-like imaging model (DGS), objects for accessing
|
PostScript(tm)-like imaging model (DGS), objects for accessing relational
|
||||||
relational databases, distributed objects and a graphical development
|
databases, distributed objects and a graphical development environment, with
|
||||||
environment, with tools like interface modeller, a project management system
|
tools like interface modeler, a project management system (project center) and
|
||||||
(project center) and other tools.
|
other tools.
|
||||||
|
|
||||||
The GNUstep development system will be used to create a user environment,
|
The GNUstep development system will be used to create a user environment, with
|
||||||
with everything needed for a complete graphical user interface, such as a
|
everything needed for a complete graphical user interface, such as a file
|
||||||
file viewer, text editors and other applications. Note that the user
|
viewer, text editors and other applications. Note that the user environment (or
|
||||||
environment (or "desktop environment") is only a small part of the whole
|
"desktop environment") is only a small part of the whole GNUstep project and
|
||||||
GNUstep project and therefore it does not "compete" with other projects like
|
therefore it does not "compete" with other projects like KDE or GNOME, simply
|
||||||
KDE or GNOME, simply because they are completely different things.
|
because they are completely different things.
|
||||||
|
|
||||||
For more information on the GNUstep project, visit: http://www.gnustep.org
|
For more information on the GNUstep project, visit: http://www.gnustep.org
|
||||||
and http://gnustep.current.nu
|
|
||||||
|
|
||||||
|
|
||||||
Running multiple instances of Window Maker
|
Running multiple instances of Window Maker
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
It is not a good idea to run more than one instance of Window Maker
|
It is not a good idea to run more than one instance of Window Maker
|
||||||
from the same user (so that wmaker will use the same configuration
|
from the same user (so that wmaker will use the same configuration files) at the
|
||||||
files) at the same time. You might get unexpected behaviour when Window Maker
|
same time. You might get unexpected behavior when Window Maker updates it's
|
||||||
updates it's configuration files.
|
configuration files.
|
||||||
|
|
||||||
If you really desire to do this, try running Window Maker with the
|
If you really desire to do this, try running Window Maker with the command line
|
||||||
command line option --static so that it will not update or change
|
option --static so that it will not update or change any of the configuration
|
||||||
any of the configuration files.
|
files.
|
||||||
|
|
||||||
Sound support
|
|
||||||
=============
|
|
||||||
|
|
||||||
Sound is supported for Linux and FreeBSD systems with the use of a
|
|
||||||
separately distributed module called WSoundServer. There is also a graphical
|
|
||||||
configuration tool for setting up your sounds called WSoundPrefs.
|
|
||||||
You can download these at:
|
|
||||||
http://shadowmere.student.utwente.nl/
|
|
||||||
|
|
||||||
Note that you must compile Window Maker with the --enable-sound configure
|
|
||||||
flag and set the DisableSound option to NO.
|
|
||||||
|
|
||||||
|
|
||||||
Performance Tuning
|
Performance Tuning
|
||||||
==================
|
==================
|
||||||
|
|
||||||
If you want to diminish Window Maker's memory usage and improve performance,
|
If you want to diminish Window Maker's memory usage and improve performance,
|
||||||
while keeping a nice appearance and good functionality, follow the items
|
while keeping a nice appearance and good functionality, follow the items bellow:
|
||||||
bellow:
|
|
||||||
|
|
||||||
- use solid textures for everything, mainly titlebars and menus. If you
|
- use solid textures for everything, mainly title bars and menus. If you want a
|
||||||
want a nice looking desktop, use the Traditional style.
|
nice looking desktop, use the Traditional style.
|
||||||
- turn NewStyle and Superfluous off
|
- turn NewStyle and Superfluous off
|
||||||
- do not bind many shortcuts in the menu and keep only the essential items
|
- do not bind many shortcuts in the menu and keep only the essential items in
|
||||||
in the menu
|
the menu
|
||||||
- turn on DisableClip
|
- turn on DisableClip
|
||||||
- edit wconfig.h and disable the NUMLOCK_HACK and the features you
|
- edit wconfig.h and disable the NUMLOCK_HACK and the features you don't use
|
||||||
don't use anyway (keep in mind that some of the #defines might not
|
anyway (keep in mind that some of the #defines might not work, as they are not
|
||||||
work, as they are not fully supported). Make sure to always keep
|
fully supported). Make sure to always keep NumLock and ScrollLock turned off.
|
||||||
NumLock and ScrollLock turned off.
|
|
||||||
- turn on DisableAnimations. You can also #undefine ANIMATIONS in wconfig.h
|
- turn on DisableAnimations. You can also #undefine ANIMATIONS in wconfig.h
|
||||||
- strip down the default IconPath and PixmapPath entries to contain only
|
- strip down the default IconPath and PixmapPath entries to contain only
|
||||||
the paths that you really have in your system.
|
the paths that you really have in your system.
|
||||||
- do not use large images in the root background
|
- do not use large images in the root background
|
||||||
- remove support for image formats you don't use
|
- remove support for image formats you don't use
|
||||||
- to reduce memory usage, disable the icon cache, by setting the RIMAGE_CACHE
|
- to reduce memory usage, disable the icon cache, by setting the RIMAGE_CACHE
|
||||||
environment variable to 0. If you want to increase performance at the cost
|
environment variable to 0. If you want to increase performance at the cost of
|
||||||
of memory usage, set it's value to a value like the number of different
|
memory usage, set it's value to a value like the number of different icons you
|
||||||
icons you use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
|
use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
|
||||||
|
|
||||||
|
|
||||||
Keyboard Mouse Control
|
Keyboard Mouse Control
|
||||||
======================
|
======================
|
||||||
|
|
||||||
Many people ask about adding keyboard control of mouse, like in fvwm,
|
Many people ask about adding keyboard control of mouse, like in fvwm, but Window
|
||||||
but Window Maker will not have such feature. The XKB extension supports
|
Maker will not have such feature. The XKB extension supports mouse simulation
|
||||||
mouse simulation from the keyboard, in a much more powerfull fashion than
|
from the keyboard, in a much more powerful fashion than any simulation done by
|
||||||
any simulation done by a window manager.
|
a window manager.
|
||||||
|
|
||||||
To enable it, hit the Control+Shift+NumLock or Shift+NumLock key combination.
|
To enable it, hit the Control+Shift+NumLock or Shift+NumLock key combination.
|
||||||
You should hear the speaker beeping. To disable it, do the same thing.
|
You should hear the speaker beeping. To disable it, do the same thing.
|
||||||
|
|
||||||
To control the mouse the numeric keypad is used as follows:
|
To control the mouse the numeric keypad is used as follows:
|
||||||
@@ -277,34 +240,33 @@ clicked with the 0 (Ins) key.
|
|||||||
|
|
||||||
|
|
||||||
The above key values work in a XFree86 3.2 (X11R6.1) X server but your
|
The above key values work in a XFree86 3.2 (X11R6.1) X server but your
|
||||||
milleage may vary.
|
mileage may vary.
|
||||||
|
|
||||||
|
|
||||||
How to make a gdb backtrace
|
How to make a gdb backtrace
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
Backtraces can help us fix bugs that make Window Maker crash. If you
|
Backtraces can help us fix bugs that make Window Maker crash. If you find a bug
|
||||||
find a bug that crashes Window Maker, please send a backtrace with your
|
that crashes Window Maker, please send a backtrace with your bug report.
|
||||||
bug report.
|
|
||||||
|
|
||||||
To make a usefull backtrace, you need a core file with debugging
|
To make a useful backtrace, you need a core file with debugging information
|
||||||
information produced by Window Maker when it crashes. It should
|
produced by Window Maker when it crashes. It should have been installed without
|
||||||
have been installed without stripping too.
|
stripping too.
|
||||||
|
|
||||||
To compile wmaker with debugging information:
|
To compile wmaker with debugging information:
|
||||||
|
|
||||||
./configure
|
./configure --enable-debug
|
||||||
make CFLAGS=-g
|
make
|
||||||
|
|
||||||
If you get the dialog window telling you that wmaker crashed and
|
If you get the dialog window telling you that wmaker crashed and asks you what
|
||||||
asks you what to do, tell it to "Abort and leave a core file".
|
to do, tell it to "Abort and leave a core file".
|
||||||
|
|
||||||
script
|
script
|
||||||
cd src
|
cd src
|
||||||
gdb .libs/wmaker path_to_the_core_file
|
gdb .libs/wmaker path_to_the_core_file
|
||||||
|
|
||||||
Then, in the gdb prompt type "bt". Quit from gdb by typing "quit"
|
Then, in the gdb prompt type "bt". Quit from gdb by typing "quit" and then, in
|
||||||
and then, in the shell prompt, type "exit".
|
the shell prompt, type "exit".
|
||||||
|
|
||||||
The file named typescript will contain the backtrace.
|
The file named typescript will contain the backtrace.
|
||||||
|
|
||||||
@@ -313,20 +275,19 @@ The file named typescript will contain the backtrace.
|
|||||||
Copyrights & Disclaimers
|
Copyrights & Disclaimers
|
||||||
========================
|
========================
|
||||||
|
|
||||||
Window Maker is copyrighted by Alfredo K. Kojima and is licensed through the
|
Window Maker is copyrighted by Alfredo K. Kojima and is licensed through the GNU
|
||||||
GNU General Public License. Read the COPYING file for the complete license.
|
General Public License. Read the COPYING file for the complete license.
|
||||||
|
|
||||||
The icons that are distributed with this program and were made by Marco van
|
The icons that are distributed with this program and were made by Marco van
|
||||||
Hylckama Vlieg, are licensed through the GNU General Public License. Read the
|
Hylckama Vlieg, are licensed through the GNU General Public License. Read the
|
||||||
COPYING file for the complete license.
|
COPYING file for the complete license.
|
||||||
|
|
||||||
The icons listed in COPYING.WTFPL and are distributed in this
|
The icons listed in COPYING.WTFPL and are distributed in this program and were
|
||||||
program and were made by Banlu Kemiyatorn (]d), are licensed through the
|
made by Banlu Kemiyatorn (]d), are licensed through the "do What The Fuck you
|
||||||
"do What The Fuck you want to Public License". Read the COPYING.WTFPL
|
want to Public License". Read the COPYING.WTFPL file for the complete license.
|
||||||
file for the complete license.
|
|
||||||
|
|
||||||
NeXT, OpenStep and NEXTSTEP are a trademarks of NeXT Computer, Inc.
|
NeXT, OpenStep and NEXTSTEP are a trademarks of NeXT Computer, Inc. All other
|
||||||
All other trademarks are property of their respective owners.
|
trademarks are property of their respective owners.
|
||||||
|
|
||||||
The authors reserve the right to make changes in the software without prior
|
The authors reserve the right to make changes in the software without prior
|
||||||
notice.
|
notice.
|
||||||
@@ -339,15 +300,15 @@ Alfredo K. Kojima <kojima@windowmaker.info>
|
|||||||
Dan Pascu <dan@windowmaker.info>
|
Dan Pascu <dan@windowmaker.info>
|
||||||
]d <id@windowmaker.info>
|
]d <id@windowmaker.info>
|
||||||
|
|
||||||
Please don't ask us questions before reading the documentation (esp. the
|
Please don't ask us questions before reading the documentation (esp. the FAQ,
|
||||||
FAQ, this file and INSTALL files) and about "cool" things you see in
|
this file and INSTALL files) and about "cool" things you see in people's desktop
|
||||||
people's desktop screenshots.
|
screenshots.
|
||||||
|
|
||||||
|
|
||||||
The AUTHORS file contains a list of the people who have contributed to the
|
The AUTHORS file contains a list of the people who have contributed to the
|
||||||
project. The name of people who have helped with localization (translation)
|
project. The name of people who have helped with localization (translation) can
|
||||||
can be found in po/README and Window Maker/README
|
be found in po/README and Window Maker/README
|
||||||
|
|
||||||
If you have any comments, fixes and bug reports (filled BUGFORMs) send them
|
If you have any comments, fixes and bug reports (filled BUGFORMs) send them
|
||||||
to developers@windowmaker.info
|
to wmaker-dev@lists.windowmaker.org
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Using Cursors with 'getstyle' and 'setstyle'
|
|||||||
The 'getstyle' and 'setstyle' style/theme-management utilities can
|
The 'getstyle' and 'setstyle' style/theme-management utilities can
|
||||||
handle user-definable cursors. By default, 'getstyle' ignores cursor
|
handle user-definable cursors. By default, 'getstyle' ignores cursor
|
||||||
definitions; using 'getstyle -t' to get theme-related settings will
|
definitions; using 'getstyle -t' to get theme-related settings will
|
||||||
also include any cursors you've defined in the resulting stylefile.
|
also include any cursors you've defined in the resulting style file.
|
||||||
|
|
||||||
However, by default, 'setstyle' does NOT ignore cursor settings. If
|
However, by default, 'setstyle' does NOT ignore cursor settings. If
|
||||||
you wish to set a style or theme without installing cursor settings,
|
you wish to set a style or theme without installing cursor settings,
|
||||||
|
|||||||
345
README.es
345
README.es
@@ -1,345 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
GNU Window Maker
|
|
||||||
X11 Window Manager
|
|
||||||
|
|
||||||
<http://windowmaker.info>
|
|
||||||
<ftp://ftp.windowmaker.info>
|
|
||||||
|
|
||||||
por
|
|
||||||
|
|
||||||
Alfredo K. Kojima
|
|
||||||
|
|
||||||
Dan Pascu
|
|
||||||
|
|
||||||
]d
|
|
||||||
|
|
||||||
|
|
||||||
Web/FTP Master
|
|
||||||
|
|
||||||
Phillip Smith
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
¡Felicitaciones! Ha adquirido un dispositivo
|
|
||||||
excelentísimo que le proporcionará miles de años de uso sin
|
|
||||||
problemas, si no fuera porque indudablemente lo destruirá a
|
|
||||||
través de alguna maniobra estúpida típica de consumidor. Por
|
|
||||||
eso le pedimos por EL AMOR DE DIOS LEA ESTE MANUAL DEL
|
|
||||||
PROPIETARIO CUIDADOSAMENTE ANTES DE DESEMPAQUETAR EL
|
|
||||||
DISPOSITIVO. ¿YA LO DESEMPAQUETÓ, NO? LO DESEMPAQUETÓ Y LO
|
|
||||||
ENCHUFÓ Y LO ENCENDIÓ Y TOQUETEÓ LAS PERILLAS, Y AHORA SU
|
|
||||||
CHICO, EL MISMO CHICO QUE UNA VEZ METIÓ UNA SALCHICHA EN SU
|
|
||||||
VIDEOCASETERA Y ACCIONÓ "AVANCE RÁPIDO", ESTE CHICO
|
|
||||||
TAMBIÉN ESTÁ TUOQUETEANDO LAS PERILLAS, ¿CIERTO? Y RECIÉN
|
|
||||||
AHORA ESTÁ COMENZANDO A LEER LAS INSTRUCCIONES, ¿¿¿CIERTO???
|
|
||||||
NOSOTROS PODRÍAMOS SIMPLEMENTE ROMPER ESTOS DISPOSITIVOS EN LA
|
|
||||||
FÁBRICA ANTES DE DESPACHARLOS, ¿SABE?
|
|
||||||
-- Dave Barry, "¡Lea Esto Primero!"
|
|
||||||
|
|
||||||
|
|
||||||
Descripción
|
|
||||||
===========
|
|
||||||
|
|
||||||
Window Maker es el gestor de ventanas GNU para el Sistema de Ventanas X. Fue
|
|
||||||
diseñado para emular la apariencia y funcionalidad de parte del GUI de NEXTSTEP(mr).
|
|
||||||
Procura ser relativamente rápido y pequeño, rico en características, fácil de configurar
|
|
||||||
y usar, con una simple y elegante apariencia sacada desde NEXTSTEP(mr).
|
|
||||||
|
|
||||||
Window Maker fue diseñado teniendo en mente la integración con GNUstep y por eso
|
|
||||||
es el gestor de ventanas "oficial". Es también parte del proyecto GNU (www.gnu.org)
|
|
||||||
. Lea mas sobre GNUstep más adelante en este archivo.
|
|
||||||
|
|
||||||
|
|
||||||
Pistas (información dada por las aplicaciones para integrarse bien con el gestor de
|
|
||||||
ventanas) para Motif(tm), OPEN LOOK(tm), KDE y GNOME también son soportados.
|
|
||||||
Entonces puede reemplazar cualquiera de los gestores de ventana para estos entornos
|
|
||||||
con Window Maker manteniendo la mayoría, si no todo, de la funcionalidad del
|
|
||||||
gestor de ventanas nativo.
|
|
||||||
|
|
||||||
Window Maker antes se llamaba WindowMaker.
|
|
||||||
|
|
||||||
Window Maker no tiene relación con Windowmaker, el software para
|
|
||||||
hacer ventanas y puertas.
|
|
||||||
|
|
||||||
|
|
||||||
Documentación
|
|
||||||
=============
|
|
||||||
|
|
||||||
Lea antes de preguntar.
|
|
||||||
|
|
||||||
* Los archivos README distribuidos por todas partes del árbol de fuentes
|
|
||||||
contienen información relacionada al contenido en los directorios.
|
|
||||||
|
|
||||||
* INSTALL tiene instrucciones de instalación y algunos consejos cuando tenga
|
|
||||||
algún problema. Significa que debería leerlo antes de la instalación.
|
|
||||||
No fue escrito solo para ocupar espacio en el paquete...
|
|
||||||
|
|
||||||
* FAQ: Preguntas Frecuentes. LEALO!!! FAQ.I18N es para
|
|
||||||
preguntas relacionadas con la internacionalización.
|
|
||||||
|
|
||||||
* NEWS: lista los cambios visibles por el usuario desde la versión anterior.
|
|
||||||
Léalo si está actualizando.
|
|
||||||
|
|
||||||
* MIRRORS: algunos lugares alternativos donde puede obtener Window Maker,
|
|
||||||
incluyendo paquetes de Window Maker específicos para ciertas plataformas.
|
|
||||||
|
|
||||||
* BUGFORM: uselo para enviar reportes de errores. Por favor uselo.
|
|
||||||
|
|
||||||
* ChangeLog: ¿que cambió desde la versión anterior?
|
|
||||||
|
|
||||||
* BUGS: lista de errores conocidos.
|
|
||||||
|
|
||||||
*** Tutorial
|
|
||||||
|
|
||||||
Hay un tutorial mantenido por Georges Tarbouriech en:
|
|
||||||
|
|
||||||
http://www.linuxfocus.org/~georges.t/
|
|
||||||
|
|
||||||
*** Guía del Usuario
|
|
||||||
|
|
||||||
La Guía del Usuario de Window Maker puede ser bajada desde el ftp oficial
|
|
||||||
o por sitios web.
|
|
||||||
Puede también ser vista en formato HTML en:
|
|
||||||
|
|
||||||
http://people.delphi.com/crc3419/WMUserGuide/index.htm
|
|
||||||
|
|
||||||
La Guía del Usuario explica como usar Window Maker, los archivos de configuración
|
|
||||||
y opciones.
|
|
||||||
|
|
||||||
*** man pages
|
|
||||||
|
|
||||||
Tipee "man wmaker" en el prompt del shell para obtener ayuda general sobre Window Maker.
|
|
||||||
|
|
||||||
|
|
||||||
Directorios y Archivos en el Árbol de Fuentes
|
|
||||||
=============================================
|
|
||||||
|
|
||||||
* Install es un script para configurar y compilar Window Maker de una forma
|
|
||||||
fácil (no es que la forma normal sea difícil, pero...).
|
|
||||||
|
|
||||||
* AUTORES: los créditos
|
|
||||||
|
|
||||||
* TODO: planes para el futuro.
|
|
||||||
|
|
||||||
* contrib/ tiene algunos parches aportados que no están soportados por Window Maker
|
|
||||||
porque entran en conflicto con la filosofía de diseño de los desarrolladores o por
|
|
||||||
alguna otra razón.
|
|
||||||
|
|
||||||
* util/ tiene varios programas utilitarios.
|
|
||||||
|
|
||||||
* WPrefs.app/ es el programa de configuración.
|
|
||||||
|
|
||||||
* src/wconfig.h posee opciones de compilación que puede cambiar para
|
|
||||||
seleccionar algunas opciones/caracteristicas y otras cosas.
|
|
||||||
|
|
||||||
* WINGs/ biblioteca widget para imitación de NEXTSTEP.
|
|
||||||
|
|
||||||
* wrlib/ biblioteca de procesamiento de imagen.
|
|
||||||
|
|
||||||
* po/ posee catálogos de mensajes que son las versiones traducidas de los mensajes
|
|
||||||
mostrados por Window Maker.
|
|
||||||
|
|
||||||
* docklib-x.x.tar.gz es una biblioteca para escribir dockapps.
|
|
||||||
|
|
||||||
SOCORRO!!!
|
|
||||||
==========
|
|
||||||
|
|
||||||
Hay una lista de correo para discutir sobre Window Maker en
|
|
||||||
wm-user@windowmaker.info. Para suscribirse, envie un mensaje que contenga:
|
|
||||||
|
|
||||||
subscribe
|
|
||||||
en el tema del mensaje a wm-user-request@windowmaker.info
|
|
||||||
|
|
||||||
Si tiene algun problema, pregunte aquí (después de leer los docs, por supuesto). Es
|
|
||||||
más probable que las personas de la lista sepan contestar sus preguntas
|
|
||||||
que nosotros. Para reportes de errores use el BUGFORM.
|
|
||||||
|
|
||||||
Si tiene un problema con una versión precompilada de Window Maker
|
|
||||||
(rpm, deb etc), primero pregunte a la persona que hizo el paquete.
|
|
||||||
|
|
||||||
NOTA IMPORTANTE: cuando pida ayuda (en la lista de correo o a los desarrolladores,
|
|
||||||
directamente) *siempre* envie información sobre el sistema que está usando. Puede
|
|
||||||
usar la sección de información del sistema al final del BUGFORM como una guía.
|
|
||||||
Otra cosa: por favor no envie correo HTML.
|
|
||||||
|
|
||||||
También hay un canal de IRC #windowmaker en openprojects. Únase aquí,
|
|
||||||
conecte su cliente de irc a irc.openprojects.net, irc.linux.com o algún otro
|
|
||||||
servidor de esa red.
|
|
||||||
|
|
||||||
GNUstep
|
|
||||||
=======
|
|
||||||
|
|
||||||
GNUStep es un completo sistema de desarrollo orientado a objetos, basado en la
|
|
||||||
especificación OpenStep liberada por NeXT(tm) (ahora Apple(tm) y Sun(tm)). Ello
|
|
||||||
proveerá todo lo que se necesita para producir aplicaciones multiplataforma,
|
|
||||||
orientadas a objetos, gráficas (y no gráficas); suministrando dentro de otras cosas,
|
|
||||||
bibliotecas base del sistema, una estructura de alto nivel para aplicaciones GUI que
|
|
||||||
usan un modelo de imagenes de tipo Display PostScript(tm) (DGS), objetos para acceso
|
|
||||||
a bases de datos relacionales, objetos distribuidos y un entorno de desarrollo gráfico,
|
|
||||||
con herramientas como un modelador de interfaces, un sistema para administración del
|
|
||||||
proyecto (central de proyecto) y otras herramientas.
|
|
||||||
|
|
||||||
El sistema de desarrollo de GNUStep será usado para crear un entorno de usuario,
|
|
||||||
con todo lo necesario para una completa interface gráfica de usuario, tal como
|
|
||||||
un visualizador de archivos, editores de texto y otras aplicaciones. Note que el
|
|
||||||
entorno de usuario (o "entorno de escritorio") es solo un pequeña parte de todo
|
|
||||||
el proyecto GNUStep y por lo tanto no "compite" con otros proyectos como KDE o GNOME,
|
|
||||||
simplemente porque son cosas completamente diferentes.
|
|
||||||
|
|
||||||
Para más información sobre el proyecto GNUStep, visite: http://www.gnustep.org y
|
|
||||||
http://gnustep.current.nu
|
|
||||||
|
|
||||||
|
|
||||||
Ejecutando multiples instancias de Window Maker
|
|
||||||
===============================================
|
|
||||||
|
|
||||||
No es una buena idea eejcutar más de una instancia de Window Maker desde
|
|
||||||
el mismo usuario (ya que wmaker usará los mismos archivos de configuración)
|
|
||||||
al mismo tiempo. Podría obtener un comportamiento inesperado cuando Window
|
|
||||||
Maker actualiza sus archivos de configuración.
|
|
||||||
|
|
||||||
Si de verdad desea hacer esto, intente ejecutar Window Maker con la opción
|
|
||||||
de linea de comando --static ya que así no actualizará o cambiará ninguno de los
|
|
||||||
archivos de configuración.
|
|
||||||
|
|
||||||
Soporte para Sonido
|
|
||||||
===================
|
|
||||||
|
|
||||||
El sonido es soportado por los sistemas Linux y FreeBSD con el uso de
|
|
||||||
un módulo distribuido separadamente llamado WSoundServer. Hay también
|
|
||||||
una herramienta de configuracion gráfica para definir sus sonidos llamada
|
|
||||||
WSoundPref.
|
|
||||||
Puede bajar esto en:
|
|
||||||
http://shadowmere.student.utwente.nl/
|
|
||||||
|
|
||||||
Note que debe compilar Window Maker con el parámetro --enable-sound
|
|
||||||
y definir la opción DisableSound a NO.
|
|
||||||
|
|
||||||
|
|
||||||
Ajuste de Rendimiento.
|
|
||||||
=====================
|
|
||||||
Si quiere disminuir el uso de memoria por parte de Window Maker y mejorar el
|
|
||||||
rendimiento, manteniendo una linda apariencia y buena funcionalidad, siga los
|
|
||||||
items de abajo:
|
|
||||||
|
|
||||||
- use texturas sólidas para todo, principalmente barras de título y menúes.
|
|
||||||
Si quiere un escritorio de aspecto lindo, use el estilo Tradicional.
|
|
||||||
- Apague NewStyle y Superfluous
|
|
||||||
- No una muchos atajos al menú y mantenga solo los items esenciales en el menú.
|
|
||||||
- Active DisableClip
|
|
||||||
- edite wconfig.h y desactive el NUMLOCK_HACK y lo mismo con las características
|
|
||||||
que no use (tenga en mente que algunos de los #defines podrían no funcionar,
|
|
||||||
ya que ellos no están completamente soportados). Asegúrese de mantener siempre
|
|
||||||
Numlock y ScrollLock apagados.
|
|
||||||
- Active DisableAnimations. Puede también #undefine ANIMATIONS en wconfig.h
|
|
||||||
- quite las entradas por defecto IconPath y PixmapPath para contener solo las
|
|
||||||
rutas que en verdad tiene en su sistema.
|
|
||||||
- no use imágenes grandes en el fondo raíz.
|
|
||||||
- quite el soporte para los formatos de imagen que no use.
|
|
||||||
- para reducir el uso de la memoria, desactive el caché de ícono, definiendo
|
|
||||||
la variable de entorno RIMAGE_CACHE a 0. Si quiere aumentar el rendimiento
|
|
||||||
a expensas del uso de la memoria, defina este valor a un valor igual al
|
|
||||||
número de íconos distintos que use.
|
|
||||||
|
|
||||||
Control del Mouse por Teclado
|
|
||||||
=============================
|
|
||||||
|
|
||||||
Muchas personas preguntan sobre agregar control por teclado al mouse, como
|
|
||||||
en fvwm, pero Window Maker no tendrá tal característica. La extensión XKB
|
|
||||||
soporta simulación de mouse desde el teclado, de una manera mucho más poderosa
|
|
||||||
que cualquier otra simulación hecha por un administrador de ventanas.
|
|
||||||
|
|
||||||
Para activarlo, presione la combinación de teclas Control+Shift+NumLock o
|
|
||||||
Shift+NumLock. Debiera escuchar el beep del parlante. Para desactivarlo,
|
|
||||||
haga lo mismo.
|
|
||||||
|
|
||||||
Para controlar el mouse el teclado numérico se usa así:
|
|
||||||
- 4 (flecha izquierda), 7 (Home), 8 (flecha arriba), 9 (PgUP), 6 (flecha derecha),
|
|
||||||
3 (PgDn), 2 (flecha abajo) y 1 (Fin) mueve el mouse a la correspondiente
|
|
||||||
dirección;
|
|
||||||
- sosteniendo una de las teclas de arriba y luego sosteniendo la tecla 5 moverá
|
|
||||||
el puntero más rápido;
|
|
||||||
- / seleccionará el primer botón del mouse (botón izquierdo);
|
|
||||||
- * seleccionará el segundo botón del mouse (botón del medio);
|
|
||||||
- - seleccionará el tercer botón del mouse (botón derecho);
|
|
||||||
- 5 hará un click con el botón actualmente seleccionado del mouse;
|
|
||||||
- + hará un doble click con el botón actualmente seleccionado;
|
|
||||||
- 0 (Ins) cliqueará y mantendrá el botón seleccionado actualmente;
|
|
||||||
- . (Del) liberará el botón seleccionado actualmente que fue anteriormente
|
|
||||||
cliqueado con la tecla 0 (Ins).
|
|
||||||
|
|
||||||
Los valores anteriores de las teclas funcionarán en un servidor X XFree86 3.2
|
|
||||||
(X11R6.1) pero su alcance puede variar.
|
|
||||||
|
|
||||||
Como hacer un gdb backtrace
|
|
||||||
===========================
|
|
||||||
|
|
||||||
Backtraces pueden ayudarnos a arreglar errores que hicieron que Window Maker falle.
|
|
||||||
Si encuentra un bug que hace fallar a Window Maker, por favor envie un backtrace con su
|
|
||||||
reporte de error.
|
|
||||||
|
|
||||||
Para hacer un backtrace útil, necesita un archivo core con información de depuración
|
|
||||||
producida por Window Maker cuando falló. Debería haber sido instalado sin stripping también.
|
|
||||||
|
|
||||||
Para compilar wmaker con información de depuración:
|
|
||||||
|
|
||||||
./configure
|
|
||||||
make CFLAGS=-g
|
|
||||||
|
|
||||||
Si obtiene el cuadro de diálogo que le dice que wmaker falló y le
|
|
||||||
pregunta que hacer, respóndale "Abortar y dejar un archivo core"
|
|
||||||
|
|
||||||
script
|
|
||||||
cd src
|
|
||||||
gdb .libs/wmaker path_to_the_core_file
|
|
||||||
|
|
||||||
Luego, en el prompt gdb escriba "bt". Salga de gdb escribiendo "quit"
|
|
||||||
y luego, en el prompt del shell, scriba "exit"
|
|
||||||
|
|
||||||
El archivo llamado typescript contendrá el backtrace.
|
|
||||||
|
|
||||||
Derechos de Autor y Descargo de Responsabilidad
|
|
||||||
===============================================
|
|
||||||
|
|
||||||
Window Maker está registrado por Alfredo K. Kojima y está licensiado por la
|
|
||||||
Licensia Pública General GNU. Lea el archivo COPYING para leer la licensia
|
|
||||||
completa.
|
|
||||||
|
|
||||||
Los íconos que son distribuidos con este programa y fueron hechos por Marco
|
|
||||||
van Hylckama Vlieg, están licenciados por la Licencia Pública General GNU.
|
|
||||||
Lea el archivo COPYING para leer la licencia completa.
|
|
||||||
|
|
||||||
Los íconos listados en COPYING.WTFPL y son distribuidos en este programa
|
|
||||||
fueron hechos por Banlu Kemiyatorn (]d), están licenciados por la
|
|
||||||
"do What The Fuck you want to Public License". Lea el archivo COPYING.WTFPL
|
|
||||||
para leer la licencia completa.
|
|
||||||
|
|
||||||
NeXT, OpenStep y NEXTSTEP son marcas registradas de NeXT Computer, Inc.
|
|
||||||
Todas las otras marcas registradas son propiedad de sus respectivos dueños.
|
|
||||||
|
|
||||||
Los autores se reservan el derecho de hacer cambios en el software sin previo
|
|
||||||
aviso.
|
|
||||||
|
|
||||||
Autores
|
|
||||||
=======
|
|
||||||
|
|
||||||
Alfredo K. Kojima <kojima@windowmaker.info>
|
|
||||||
Dan Pascu <dan@windowmaker.info>
|
|
||||||
]d <id@windowmaker.info>
|
|
||||||
|
|
||||||
Por favor no nos haga preguntas antes de leer la documentación (especialmente
|
|
||||||
la FAQ, este archivo y los archivos INSTALL) y sobre cosas "cool" que ve en
|
|
||||||
las capturas de pantalla del escritorio de las personas.
|
|
||||||
|
|
||||||
El archivo AUTHORS contiene una lista de las personas que han contribuido
|
|
||||||
con el proyecto. El nombre de las personas que han ayudado con localization
|
|
||||||
(traducción) se puede encontrar en po/README y Window Maker/README
|
|
||||||
|
|
||||||
Si tiene algún comentario, arreglos y reportes de errores (complete BUGFORMs)
|
|
||||||
y enviémelos a developers@windowmaker.info
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
traducido por Efraín Maximiliano Palermo <max_drake2001@yahoo.com.ar>
|
|
||||||
351
README.pt
351
README.pt
@@ -1,351 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
GNU Window Maker
|
|
||||||
Gerenciador de Janelas X11
|
|
||||||
|
|
||||||
<http://windowmaker.info>
|
|
||||||
<ftp://ftp.windowmaker.info>
|
|
||||||
|
|
||||||
por
|
|
||||||
|
|
||||||
Alfredo K. Kojima
|
|
||||||
|
|
||||||
Dan Pascu
|
|
||||||
|
|
||||||
Matthew Hawkins
|
|
||||||
|
|
||||||
]d
|
|
||||||
|
|
||||||
|
|
||||||
Web/FTP Master
|
|
||||||
|
|
||||||
Phillip Smith
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Parabéns! Você acabou de adquirir um dispositivo muito
|
|
||||||
bom que lhe proporcionaria milhares de anos de uso sem problemas,
|
|
||||||
exceto por que, você, com vai certeza destruí-lo com algum procedimento
|
|
||||||
idiota típico dos consumidores. Por isso nós pedimos POR FAVOR,
|
|
||||||
PELO AMOR DE DEUS LEIA O MANUAL DO DONO COM MUITA ATENÇÃO ANTES
|
|
||||||
DE DESEMBRULHAR O DISPOSITIVO. VOCÊ JÁ O DESEMPACOTOU, NÃO FOI?
|
|
||||||
VOCÊ DESEMPACOTOU-O, CONECTOU-O, LIGOU-O E ENCHEU-O DE COISAS,
|
|
||||||
E AGORA A SUA CRIANÇA, A MESMA CRIANÇA QUE UMA VEZ ENFIOU UMA
|
|
||||||
SALSICHA NO SEU VIDEOCASSETE E APERTOU NO "FAST FORWARD", ESTA
|
|
||||||
CRIANÇA ESTÁ BRINCANDO COM OS BOTÕES TAMBÉM CERTO? E SÓ AGORA VOCÊ
|
|
||||||
ESTÁ COMEÇANDO A LER AS INSTRUÇÕES CERTO??? NÓS PODEMOS ENTÃO QUEBRAR
|
|
||||||
ESTES DISPOSITIVOS NA FÁBRICA ANTES DE DESPACHÁ-LOS, VOCÊ
|
|
||||||
SABIA DISSO?
|
|
||||||
-- Dave Barry, "Read This First!"
|
|
||||||
|
|
||||||
|
|
||||||
Descrição
|
|
||||||
=========
|
|
||||||
|
|
||||||
O Window Maker é o gerenciador de janelas GNU para o X Window System. Ele foi
|
|
||||||
desenvolvido para emular o visual e a sensação de parte da GUI NEXTSTEP(tm).
|
|
||||||
Procura ser relativamente rápido e pequeno, rico em opções, fácil de
|
|
||||||
configurar e usar, com uma aparência simples e elegante emprestada do
|
|
||||||
NEXTSTEP(tm).
|
|
||||||
|
|
||||||
O Window Maker foi projetado tendo em mente a integração com o GNUStep e
|
|
||||||
é o gerenciador de janelas "oficial" dele. É ainda parte do projeto GNU
|
|
||||||
(www.gnu.org).
|
|
||||||
Leia mais sobre o GNUstep neste arquivo.
|
|
||||||
|
|
||||||
Hints (informações dadas pelas aplicações para que se integrem bem com o
|
|
||||||
gerenciador de janelas) para Motif(tm), OPEN LOOK(tm), KDE e GNOME também
|
|
||||||
são suportados. Logo, você pode substituir os gerenciadores de janela desses
|
|
||||||
ambientes pelo Window Maker e manter muito, senão toda a funcionalidade do
|
|
||||||
gerenciador de janelas nativo.
|
|
||||||
|
|
||||||
O Window Maker antes se chamava WindowMaker.
|
|
||||||
|
|
||||||
O Window Maker não tem relação com o Windowmaker, o software para construção
|
|
||||||
de janelas e portas.
|
|
||||||
|
|
||||||
|
|
||||||
Documentação
|
|
||||||
============
|
|
||||||
|
|
||||||
Leia antes de perguntar.
|
|
||||||
|
|
||||||
* Os arquivos README distribuídos por toda a árvore dos fontes contêm
|
|
||||||
informações relacionadas ao conteúdo dos diretórios.
|
|
||||||
|
|
||||||
* O INSTALL possui instruções para instalação e algumas dicas quando há
|
|
||||||
algum problema. Você deveria lê-lo antes da instalação. Ele não foi escrito
|
|
||||||
somente para ocupar espaço no pacote...
|
|
||||||
|
|
||||||
* FAQ: Frequently Asked Questions. LEIA! O FAQ.I18N é sobre questões
|
|
||||||
relacionadas à internacionalização.
|
|
||||||
|
|
||||||
* NEWS: lista as mudanças de uma versão para outra e que são visíveis ao
|
|
||||||
usuário. Leia-o se você estiver fazendo uma atualização.
|
|
||||||
|
|
||||||
* MIRRORS: alguns locais alternativos onde você pode pegar o Window Maker,
|
|
||||||
incluindo pacotes do Window Maker específicos para certas plataformas.
|
|
||||||
|
|
||||||
* BUGFORM: use-o para enviar relatos de bug. Use-o por favor.
|
|
||||||
|
|
||||||
* ChangeLog: o que foi mudado a partir da última versão?
|
|
||||||
|
|
||||||
* BUGS: lista dos bugs conhecidos
|
|
||||||
|
|
||||||
|
|
||||||
*** Guia do Usuário
|
|
||||||
|
|
||||||
O Guia do Usuário Window Maker pode ser baixado do ftp oficial ou por
|
|
||||||
sites web. Pode ser visto ainda no formato HTML no:
|
|
||||||
http://people.delphi.com/crc3419/WMUserGuide/index.htm
|
|
||||||
|
|
||||||
O Guia do Usuário explica como usar o Window Maker, fala sobre os
|
|
||||||
arquivos de configuração e as opções.
|
|
||||||
|
|
||||||
*** man pages
|
|
||||||
|
|
||||||
Digite "man wmaker" no prompt da shell para obter uma ajuda geral sobre
|
|
||||||
o Window Maker.
|
|
||||||
|
|
||||||
|
|
||||||
Diretórios & Arquivos na Árvore dos Fontes
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
* O Install é um script para configurar e compilar o Window Maker de
|
|
||||||
um modo fácil (não que o modo normal seja difícil, mas...).
|
|
||||||
|
|
||||||
* AUTHORS: os créditos
|
|
||||||
|
|
||||||
* TODO: planos para o futuro
|
|
||||||
|
|
||||||
* O contrib/ possui alguns patches enviados e que não foram suportados
|
|
||||||
pelo Window Maker por entrarem em conflito com a filosofia de projeto dos
|
|
||||||
desenvolvedores ou por algum outro motivo.
|
|
||||||
|
|
||||||
* O util/ possui vários programas utilitários.
|
|
||||||
|
|
||||||
* O WPrefs.app/ é o programa de configuração.
|
|
||||||
|
|
||||||
* O src/wconfig.h possui opções de compilação que você pode mudar para
|
|
||||||
selecionar algumas opções/aspectos e outras coisas mais.
|
|
||||||
|
|
||||||
* O WINGs/ é a biblioteca de widget NEXTSTEP lookalike
|
|
||||||
|
|
||||||
* A wrlib/ é a biblioteca de processamento de imagens
|
|
||||||
|
|
||||||
* O po/ possui catálogos de mensagens, que são versões traduzidas das
|
|
||||||
mensagens mostradas pelo Window Maker
|
|
||||||
|
|
||||||
* A docklib-x.x.tar.gz é a biblioteca para desenvolvimento de dockapps
|
|
||||||
|
|
||||||
|
|
||||||
SOCORRO!!!
|
|
||||||
==========
|
|
||||||
|
|
||||||
Há uma lista de discussão para debate de questões sobre o Window Maker
|
|
||||||
no wm-user@windowmaker.info. Para inscrever-se, mande uma mensagem
|
|
||||||
contendo:
|
|
||||||
subscribe
|
|
||||||
no campo de assunto da mensagem para wm-user-request@windowmaker.info
|
|
||||||
|
|
||||||
Se você tiver algum problema, pergunte lá (somente depois de ter lido os
|
|
||||||
documentos, é claro). As pessoas da lista estão mais preparadas para
|
|
||||||
resolver o seu problema do que nós. Para relatar BUGS, use o BUGFORM.
|
|
||||||
|
|
||||||
Se você tiver problemas com uma versão pré-compilada do Window
|
|
||||||
Maker (rpm, deb etc), primeiro questione a pessoa que criou o pacote.
|
|
||||||
|
|
||||||
NOTA IMPORTANTE: quando for pedir ajuda (seja na lista de discussão ou
|
|
||||||
diretamente aos desenvolvedores) *sempre* envie informações sobre o sistema
|
|
||||||
que você está usando. Você pode usar a seção system information no final
|
|
||||||
do BUGFORM como guia. Outra coisa: não mande mensagens em HTML.
|
|
||||||
|
|
||||||
Há ainda o canal de IRC #windowmaker na EFNET. Para entrar lá, conecte
|
|
||||||
seu cliente de irc no irc.concentric.net, irc.prison.net ou outro
|
|
||||||
servidor dessa rede.
|
|
||||||
|
|
||||||
|
|
||||||
GNUstep
|
|
||||||
=======
|
|
||||||
|
|
||||||
O GNUstep é um completo sistema de desenvolvimento orientado a objetos,
|
|
||||||
baseado na especificação OpenStep lançada pela NeXT(tm) (agora Apple(tm) e
|
|
||||||
Sun(tm)). Ele irá fornecer tudo que é necessário para desenvolver aplicações
|
|
||||||
orientadas a objetos, gráficas (e não gráficas), cross-platform; fornecendo,
|
|
||||||
dentre outras coisas, bibliotecas bases do sistema, uma estrutura de alto
|
|
||||||
nível para aplicações GUI que usa um modelo de imagens do tipo Display
|
|
||||||
PostScript(tm), objetos para acesso a bancos de dados relacional, objetos
|
|
||||||
distribuídos e um ambiente de desenvolvimento gráfico, com ferramentas como
|
|
||||||
um modelador de interfaces, um projeto de gerenciamento de sistema (central
|
|
||||||
de projetos) e outras ferramentas.
|
|
||||||
|
|
||||||
O sistema de desenvolvimento GNUstep será usado para criar um ambiente
|
|
||||||
de usuário, com tudo necessário para uma interface gráfica, tais como
|
|
||||||
visualizador de arquivos, editores de texto e outras aplicações. Note que o
|
|
||||||
ambiente do usuário (ou "ambiente desktop") é somente uma pequena parte de
|
|
||||||
todo o projeto GNUstep e não "compete" com projetos como o KDE e o GNOME,
|
|
||||||
simplesmente por que eles são coisas completamente diferentes.
|
|
||||||
|
|
||||||
Para mais informação sobre o projeto GNUstep, visite http://www.gnustep.org
|
|
||||||
e http://gnustep.current.nu
|
|
||||||
|
|
||||||
|
|
||||||
Executando múltiplas instâncias do Window Maker
|
|
||||||
===============================================
|
|
||||||
|
|
||||||
Não é uma boa idéia rodar mais de uma instância do Window Maker sob
|
|
||||||
um mesmo usuário ao mesmo tempo (já que o wmaker usa os mesmos arquivos
|
|
||||||
de configuração). Você pode obter comportamentos inesperados quando o
|
|
||||||
Window Maker atualizar os seus arquivos de configuração.
|
|
||||||
|
|
||||||
|
|
||||||
Suporte para som
|
|
||||||
================
|
|
||||||
|
|
||||||
O Som é suportado nos sistemas Linux e FreeBSD com o uso de módulos
|
|
||||||
distribuídos separadamente. Você pode baixá-los no:
|
|
||||||
http://www.frontiernet.net/~southgat/wmsound
|
|
||||||
|
|
||||||
Observe que você deve compilar o Window Maker usando o configure com a
|
|
||||||
flag --enable-sound e definindo a opção DisableSound para NO.
|
|
||||||
|
|
||||||
|
|
||||||
Ajuste da Performance
|
|
||||||
====================
|
|
||||||
|
|
||||||
Se você deseja diminuir o uso de memória pelo Window Maker, aumentar a
|
|
||||||
performance, e ainda manter uma boa aparência e funcionalidade, siga os
|
|
||||||
itens abaixo:
|
|
||||||
|
|
||||||
- use texturas sólidas para tudo, barras de títulos e menus. Se você quer
|
|
||||||
um desktop com um belo visual, use o estilo "Traditional".
|
|
||||||
- desligue o "NewStyle" e o "Superfluous"
|
|
||||||
- não vincule muitos atalhos ao seu menu e guarde somente coisas essenciais
|
|
||||||
no menu
|
|
||||||
- ative o "DisableClip"
|
|
||||||
- edite o wconfig.h e desative o NUMLOCK_HACK e as opções que você não
|
|
||||||
usa mesmo (tenha em mente que alguns dos #defines podem não funcionar,
|
|
||||||
já que eles não estão completamente suportados). Certifique-se de sempre
|
|
||||||
manter o NumLock e o ScrollLock desligados.
|
|
||||||
- ligue a opção "DisableAnimations". Você pode também usar o #undefine
|
|
||||||
ANIMATIONS no arquivo config.h
|
|
||||||
- verifique as entradas padrão "IconPath" e "PixmapPath" para que contenham
|
|
||||||
somente os paths que você realmente possua no seu sistema.
|
|
||||||
- não use imagens grandes no seu background root
|
|
||||||
- remova o suporte para formatos de imagens que você não usa
|
|
||||||
- para reduzir o uso de memória, desative o cache de ícones, definindo a
|
|
||||||
variável de ambiente RIMAGE_CACHE para 0. Se você deseja melhorar o
|
|
||||||
desempenho perdendo só um pouco de memória, defina essa variável para
|
|
||||||
o valor correspondente ao número de ícones que você usa.
|
|
||||||
|
|
||||||
|
|
||||||
Controle de Mouse pelo Teclado
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Muitas pessoas perguntam sobre adicionar o controle do mouse pelo teclado,
|
|
||||||
como no fvwm, mas o Window Maker não possui tal opção. A extensão XKB
|
|
||||||
suporta a simulação do mouse pelo teclado, de uma maneira muito mais
|
|
||||||
poderosa do que qualquer outra simulação realizada por um gerenciador de
|
|
||||||
janelas.
|
|
||||||
|
|
||||||
Para ativá-la, aperte a combinação Control+Shift+NumLock ou Shift+NumLock.
|
|
||||||
Você deve então ouvir um beep. Para desativá-la, faça a mesma coisa.
|
|
||||||
|
|
||||||
Para controlar com o mouse, use as seguintes teclas do keypad:
|
|
||||||
- 4 (seta esquerda), 7 (Home), 8 (seta para cima), 9 (PgUp), 6 (seta direita),
|
|
||||||
3 (PgDn), 2 (seta para baixo) e 1 (End) move o mouse para as direções
|
|
||||||
correspondentes;
|
|
||||||
- segurar as teclas acima e depois segurar a tecla 5 vai fazer o ponteiro
|
|
||||||
se mover mais rápido;
|
|
||||||
- / vai selecionar o primeiro botão do mouse (botão esquerdo);
|
|
||||||
- * vai selecionar o segundo botão do mouse (botão do meio);
|
|
||||||
- - vai selecionar o terceiro botão do mouse (botão direito);
|
|
||||||
- 5 vai fazer um clique com o botão do mouse que foi selecionado;
|
|
||||||
- + vai fazer um duplo-clique com o botão do mouse que foi selecionado;
|
|
||||||
- 0 (Ins) vai clicar e segurar o botão do mouse selecionado;
|
|
||||||
- . (Del) vai liberar o botão do mouse selecionado que foi previamente
|
|
||||||
clicado com a tecla 0 (Ins).
|
|
||||||
|
|
||||||
Os valores das teclas acima funcionam com um servidor X XFree86 3.2 (X11R6.1)
|
|
||||||
mas nosso alcance pode variar.
|
|
||||||
|
|
||||||
|
|
||||||
Como fazer um backtrace com o gdb
|
|
||||||
=================================
|
|
||||||
|
|
||||||
Os backtraces nos ajudam a arrumar bugs que fazem com que o Window Maker
|
|
||||||
trave. Se você achar um bug que trave o Window Maker, por favor envie o
|
|
||||||
backtrace com o relato do bug.
|
|
||||||
|
|
||||||
Para fazer um backtrace útil, você precisa de um arquivo core
|
|
||||||
com informações de depuração produzidas pelo Window Maker quando ele
|
|
||||||
travar. O padrão do Window Maker é iniciar um outro gerenciador
|
|
||||||
de janelas quando ele travar, o que não gerará um arquivo core. Você
|
|
||||||
precisa editar o arquivo src/wconfig.h *depois* de ter rodado o configure
|
|
||||||
e mudar a linha que se parece com o seguinte:
|
|
||||||
|
|
||||||
#undef NO_EMERGENCY_AUTORESTART
|
|
||||||
|
|
||||||
para:
|
|
||||||
|
|
||||||
#define NO_EMERGENCY_AUTORESTART
|
|
||||||
|
|
||||||
Depois, no diretório src, digite:
|
|
||||||
make clean
|
|
||||||
make CFLAGS=-g
|
|
||||||
make install
|
|
||||||
|
|
||||||
e espere o Window Maker ser instalado.
|
|
||||||
|
|
||||||
Depois de instalado o Window Maker, inicie o X e reproduza o bug fazendo
|
|
||||||
com que o Window Maker trave. Quando ele travar, vá até o diretório
|
|
||||||
onde você compilou o wmaker e digite o seguinte comando na sua shell:
|
|
||||||
|
|
||||||
script
|
|
||||||
cd src
|
|
||||||
gdb .libs/wmaker path_ao_arquivo_core
|
|
||||||
|
|
||||||
Depois, no prompt do gdb, digite "bt". Saia do gdb digitando "quit"
|
|
||||||
e depois no prompt da shell, digite "exit".
|
|
||||||
|
|
||||||
O arquivo chamado typescript conterá o backtrace.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Direitos Autorais & Disclaimers
|
|
||||||
===============================
|
|
||||||
|
|
||||||
O Window Maker é registrado por Alfredo K. Kojima e é licenciado pela Licença
|
|
||||||
Pública Geral GNU. Leia o arquivo COPYING para ler a licença completa.
|
|
||||||
|
|
||||||
Os ícones que são distribuídos com esse programa foram criados por Marco
|
|
||||||
van Hylckama Vlieg são licenciados pela OpenContent License. Leia o
|
|
||||||
arquivo COPYING.OPL para a licença completa.
|
|
||||||
|
|
||||||
NeXT, OpenStep e NEXTSTEP são marcas da NeXT Computer, Inc.
|
|
||||||
Todas as outras marcas são propriedade dos respectivos donos.
|
|
||||||
|
|
||||||
Os autores se reservam no direito de fazer alterações no software sem
|
|
||||||
qualquer aviso prévio.
|
|
||||||
|
|
||||||
|
|
||||||
Autores
|
|
||||||
=======
|
|
||||||
|
|
||||||
Alfredo K. Kojima <kojima@windowmaker.info>
|
|
||||||
Dan Pascu <dan@windowmaker.info>
|
|
||||||
]d <id@windowmaker.info>
|
|
||||||
|
|
||||||
Por favor não nos perguntem coisas antes de ler a documentação (o FAQ,
|
|
||||||
este arquivo e os arquivos INSTALL), ou sobre coisas "legais" que você
|
|
||||||
viu em screenshots de desktops.
|
|
||||||
|
|
||||||
O arquivo AUTHORS contem uma lista de pessoas que contribuíram com o projeto.
|
|
||||||
O nome das pessoas que ajudaram com a tradução pode ser achado no po/README e
|
|
||||||
Window Maker/README
|
|
||||||
|
|
||||||
Se você tem algum comentário, correção ou deseja relatar bugs (junto com
|
|
||||||
o BUGFORM) mande-os para developers@windowmaker.info
|
|
||||||
|
|
||||||
|
|
||||||
Traduzido por: Ricardo Sartori <sartori@inf.ufsc.br>
|
|
||||||
1
TODO
1
TODO
@@ -67,5 +67,4 @@ After 1.0.0 is released
|
|||||||
- rework/redesign the appicon/dock/clip concept
|
- rework/redesign the appicon/dock/clip concept
|
||||||
- maybe rewrite the main code in obj-c or c++
|
- maybe rewrite the main code in obj-c or c++
|
||||||
- major clean up in theming/texturing stuff
|
- major clean up in theming/texturing stuff
|
||||||
- dynamically loadable everything
|
|
||||||
|
|
||||||
|
|||||||
207
The-perfect-Window-Maker-patch.txt
Normal file
207
The-perfect-Window-Maker-patch.txt
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
____________
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
|
|
||||||
|
These notes are meant to help you in the process of making and submitting
|
||||||
|
patches to the git repository of wmaker-crm.
|
||||||
|
|
||||||
|
It assumes you have 'git' correctly installed and you have set the most
|
||||||
|
basic configuration options via 'git config'. See the end of this file
|
||||||
|
for an example .gitconfig.
|
||||||
|
|
||||||
|
To clone the wmaker-crm repository you can do:
|
||||||
|
|
||||||
|
git clone git://repo.or.cz/wmaker-crm.git
|
||||||
|
|
||||||
|
You should note that the development occur in the #next branch, and
|
||||||
|
patches are backported to #master when considered ok. So, you probably
|
||||||
|
want to switch to #next branch, if not already done:
|
||||||
|
|
||||||
|
git checkout next
|
||||||
|
|
||||||
|
____________________
|
||||||
|
Testing your changes
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
If you want to raise the quality of your contribution, you are strongly
|
||||||
|
encouraged to use at least this configure option:
|
||||||
|
|
||||||
|
./configure --enable-debug
|
||||||
|
|
||||||
|
This does not only enable debugging information, which you may need when
|
||||||
|
testing your work, it also enables a number of extra compiler warning
|
||||||
|
which help keeping safer code.
|
||||||
|
|
||||||
|
__________________________
|
||||||
|
Producing a patch with git
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
You have the wmaker source and you want to write a patch in order to fix
|
||||||
|
a bug or improve something. A possible work-flow is the following:
|
||||||
|
|
||||||
|
# Optional: Create a new branch (to be safe in case you screw up)
|
||||||
|
git checkout -b fixbug
|
||||||
|
|
||||||
|
Now you fix the bug...
|
||||||
|
|
||||||
|
# Check what you did, review etc
|
||||||
|
git diff
|
||||||
|
|
||||||
|
# if it looks good, commit your changes
|
||||||
|
git commit -a
|
||||||
|
|
||||||
|
Git will open the editor set in your .gitconfig and you'll have to write a
|
||||||
|
commit message. Writing a good message is as important as the source code
|
||||||
|
modifications you've just made! See "Writing the commit log" for advice.
|
||||||
|
|
||||||
|
# Prepare the patch to submit to the mailing-list.
|
||||||
|
# (use HEAD~2 if you want patches for the last 2 commits etc)
|
||||||
|
git format-patch HEAD~1
|
||||||
|
|
||||||
|
# If you have created your own branch, and want all your commits created
|
||||||
|
# after the #next branch, you can use:
|
||||||
|
git format-patch next
|
||||||
|
|
||||||
|
|
||||||
|
In order to ensure consistency in the code, there's an extra step to
|
||||||
|
check the patchs. You should run this script (inherited from the Linux
|
||||||
|
kernel) on the patch files generated and fix your commits for what it
|
||||||
|
reports:
|
||||||
|
|
||||||
|
./checkpatch.pl 00*
|
||||||
|
|
||||||
|
______________________
|
||||||
|
Writing the commit log
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
You had a motivation to write your patch, you studied the sources and you
|
||||||
|
found a way to do what you wanted to do. This whole process takes time and
|
||||||
|
other people will not want to invest that time to rediscover what you've
|
||||||
|
already found.
|
||||||
|
|
||||||
|
So the main reason for the commit message is to explain to other people what
|
||||||
|
you did, _why_ and _how_. And you must assume that the person you must explain
|
||||||
|
these things to will not be as familiar with the code you just modified as you
|
||||||
|
are right after writing the patch -- and that includes yourself in a year or
|
||||||
|
so. Be verbose in all the steps below.
|
||||||
|
|
||||||
|
The good commit log will start with the reason for writing the patch.
|
||||||
|
|
||||||
|
For example, if you use wmaker in some way and you expect that X happens but
|
||||||
|
you get Y, you should say that very clearly. Sometimes that's enough for other
|
||||||
|
more experienced people to know how to solve your issue. They will be able to
|
||||||
|
judge your patch better if they know what you wanted to do -- sometimes there
|
||||||
|
can be a better way to fix it.
|
||||||
|
|
||||||
|
Then you should explain why the wmaker source leads to Y and not to X.
|
||||||
|
|
||||||
|
Technical stuff can be expected at this point, e.g. "upon doing xyz in function
|
||||||
|
foobar(), wmaker sets the variable foo to 'y' instead of setting it to 'x', and
|
||||||
|
that will lead to blabla happening in function foobar_squared()...".
|
||||||
|
|
||||||
|
And finally you explain how you fixed it.
|
||||||
|
|
||||||
|
"You have to set foo to 'x', because then when the function foobar_squared() is
|
||||||
|
called it will do X instead of Y because..."
|
||||||
|
|
||||||
|
At this point other people will have a clear understanding of what you did with
|
||||||
|
minimal effort. And that leads to better patch reviews.
|
||||||
|
|
||||||
|
Furthermore, the above reasons should also tell you that you must not do
|
||||||
|
more than one thing in the same patch. Again:
|
||||||
|
|
||||||
|
"Each patch must do one thing and one thing only."
|
||||||
|
|
||||||
|
If your patch does too much of unrelated stuff, it makes reviewing a nightmare
|
||||||
|
and long-term maintenance much worse (think about a patch which introduces a
|
||||||
|
regression in the middle of many other nice improvements, and now you have to
|
||||||
|
get rid of the regression without removing the improvements -- 'git revert'
|
||||||
|
will not help you here).
|
||||||
|
|
||||||
|
If you find yourself having troubles to write what you did in the commit
|
||||||
|
message, perhaps you did too much. In this case you should split your patch
|
||||||
|
into smaller unrelated pieces and produce a patch series. Unfortunately it's
|
||||||
|
more work for you, but it's much better for wmaker.
|
||||||
|
|
||||||
|
_____________________________________
|
||||||
|
Sending the patch to the mailing list
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Send your patches to:
|
||||||
|
|
||||||
|
wmaker-dev@lists.windowmaker.org
|
||||||
|
|
||||||
|
Please do not send patches to any individual developer unless you have a very
|
||||||
|
good reason to avoid more people being able to comment (and improve) on your
|
||||||
|
patches.
|
||||||
|
|
||||||
|
The HIGHLY RECOMMENDED way to send a patch is to actually let Git do it for
|
||||||
|
you, otherwise you may face the problems below. Doing this is really easy:
|
||||||
|
|
||||||
|
# Tell git once how to send mails:
|
||||||
|
# (of course, replace smtp.example.com with your ISP's)
|
||||||
|
git config --global sendemail.smtpserver "smtp.example.com"
|
||||||
|
git config --global sendemail.validate true
|
||||||
|
git config sendemail.to "Window Maker Devel <wmaker-dev@lists.windowmaker.org>"
|
||||||
|
|
||||||
|
# If you're sending more than 1 patch, you may be interested in having an
|
||||||
|
# introduction mail for the batch:
|
||||||
|
git format-patch --cover-letter next
|
||||||
|
vi/emacs/nedit/whatever 0000-cover-letter.patch
|
||||||
|
|
||||||
|
# When you're satisfied, ask Git to mail all the patches:
|
||||||
|
git send-email 00*
|
||||||
|
|
||||||
|
|
||||||
|
If you do not want or cannot let Git send them for you, please note that
|
||||||
|
sending the patch _properly_ is not as trivial as you may think. Some mail
|
||||||
|
clients convert TABs to spaces or word wrap long lines automatically, which
|
||||||
|
will result in your patch being rejected as it will not apply with 'git apply'.
|
||||||
|
|
||||||
|
You could send the patch as an attachement to the mail, but this generally
|
||||||
|
makes it a bit harder to review, and a lot harder to comment on; that's why
|
||||||
|
the preferred method is inlined patches (like Git does).
|
||||||
|
|
||||||
|
Ideally your patch should contain a very good commit message that explains
|
||||||
|
why you wrote the patch in the first place (see "Writing the commit log").
|
||||||
|
In this case you can simply send the file(s) created in the 'git format-patch'
|
||||||
|
step above as the sole content of your email to the mailing list. All your
|
||||||
|
reasons and explanations will be in the commit log, and your email will look
|
||||||
|
like:
|
||||||
|
|
||||||
|
**********************************
|
||||||
|
From: someone@someplace
|
||||||
|
Subject: [PATCH] Fix something
|
||||||
|
|
||||||
|
The commit message.
|
||||||
|
|
||||||
|
The diff itself.
|
||||||
|
|
||||||
|
**********************************
|
||||||
|
|
||||||
|
Read the file email-clients.txt in the topdir of the wmaker-crm repository
|
||||||
|
to be advised on how to tweak your email client to avoid common pitfalls.
|
||||||
|
|
||||||
|
___________________
|
||||||
|
Example .gitconfig
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
[user]
|
||||||
|
name = Erwin Schrodinger
|
||||||
|
email = schrodinger@gmail.com
|
||||||
|
[core]
|
||||||
|
editor = xjed
|
||||||
|
[status]
|
||||||
|
showUntrackedFiles = no
|
||||||
|
[color]
|
||||||
|
branch = auto
|
||||||
|
status = auto
|
||||||
|
diff = auto
|
||||||
|
ui = auto
|
||||||
|
[apply]
|
||||||
|
whitespace = fix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
get-wings-flags get-wutil-flags
|
|
||||||
.libs *.pc
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
## automake input file for WINGs - Documentation
|
## automake input file for WINGs - Documentation
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
EXTRA_DIST = README.connection
|
EXTRA_DIST =
|
||||||
|
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
Methods of handling WMConnectionDidDieNotification notification events
|
|
||||||
(same for WMConnectionDidTimeoutNotification)
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Once your program got this notification (you need to install an observer for
|
|
||||||
it), there are some ways to handle it:
|
|
||||||
|
|
||||||
1. Make your observer enqueue a new notification in the ASAP queue, and the
|
|
||||||
observer for this new notification (it can be the same function if you
|
|
||||||
arrange to distinguish between the two cases), should remove the connection.
|
|
||||||
You can also close the connection before enqueuing the new notification to
|
|
||||||
the ASAP queue, but is not strictly necessarily, since it will be closed
|
|
||||||
when the observer for the new enqueued notification will be called and you
|
|
||||||
will call the close/remove function there. This is just to make sure your
|
|
||||||
connection will be silent, and won't generate new events until you reach
|
|
||||||
that point.
|
|
||||||
This is by far the best method, since it will assure you that if you
|
|
||||||
enqueue more than one notification to remove the same connection, they will
|
|
||||||
be coalesced, and called only once.
|
|
||||||
|
|
||||||
2. In your observer, put the died/closed connection in an array or bag, and
|
|
||||||
destroy all the connections present in the array/bag, in your main loop,
|
|
||||||
after you call the WHandleEvents()/WMHandleEvent(). Also closing the
|
|
||||||
connection can be done before putting the connection in the array/bag, but
|
|
||||||
is optional as noted above. In this case you need to make sure you don't
|
|
||||||
put in the array/bag the same connection more than once, in case the
|
|
||||||
DieNotification is sent more that once to you. This is automagically solved
|
|
||||||
by method 1.
|
|
||||||
|
|
||||||
3. In case it's your only connection, and you plan to exit if it was closed or
|
|
||||||
died, then you can safely close/remove it, and exit. As long as you no
|
|
||||||
longer access it, there is no problem.
|
|
||||||
|
|
||||||
4. Make you observer remove the connection. Then make sure that after that
|
|
||||||
point your code no longer tries to access that connection (this usually
|
|
||||||
means until your code gets back to the main loop). This is almost always
|
|
||||||
very hard to achive and subject to hidden errors. I do not recommend this
|
|
||||||
way of handling the died notification. It is ugly and very complicated to
|
|
||||||
handle if the program is in a very deeply nested function when it finds out
|
|
||||||
that the connection died. If you use it and get plenty of SIGSEGVs then you
|
|
||||||
know why. This method was not presented here to be used, but to show what
|
|
||||||
should be avoided in dealing with the died notification, in case someone
|
|
||||||
gets the idea to try it this way.
|
|
||||||
|
|
||||||
|
|
||||||
Note: read/write operations means to use our read/write functions (like
|
|
||||||
WMGetMessage()/WMSendMessage()), not the C library ones read()/write().
|
|
||||||
Note2: removing a connection is done by WMDestroyConnection(), while
|
|
||||||
WMCloseConnection() only closes the socket, and removed any pending
|
|
||||||
queues and timers on the connection.
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
connect server fontl puzzle UserTime.plist
|
|
||||||
colorpick
|
|
||||||
.libs
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,32 +1,21 @@
|
|||||||
## automake input file for WINGs - Examples
|
## automake input file for WINGs - Examples
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
|
|
||||||
noinst_PROGRAMS = connect server fontl puzzle colorpick
|
noinst_PROGRAMS = fontl puzzle colorpick
|
||||||
|
|
||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
@XFTLIBS@ @INTLIBS@
|
@XFTLIBS@ @INTLIBS@
|
||||||
|
|
||||||
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a
|
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||||
|
|
||||||
fontl_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a
|
fontl_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||||
|
|
||||||
puzzle_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a
|
puzzle_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||||
|
|
||||||
connect_DEPENDENCIES = $(top_builddir)/WINGs/libWUtil.a
|
|
||||||
|
|
||||||
connect_LDADD = $(top_builddir)/WINGs/libWUtil.a @LIBRARY_SEARCH_PATH@ \
|
|
||||||
@NETLIBS@ @INTLIBS@
|
|
||||||
|
|
||||||
server_DEPENDENCIES = $(top_builddir)/WINGs/libWUtil.a
|
|
||||||
|
|
||||||
server_LDADD = $(top_builddir)/WINGs/libWUtil.a @LIBRARY_SEARCH_PATH@ \
|
|
||||||
@NETLIBS@ @INTLIBS@
|
|
||||||
|
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
|
||||||
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
|
|
||||||
|
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
||||||
|
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@
|
||||||
|
|||||||
@@ -3,14 +3,7 @@
|
|||||||
Files:
|
Files:
|
||||||
-----
|
-----
|
||||||
|
|
||||||
server - server example of using WMConnection. It keeps a database of
|
colorpick - a color picker
|
||||||
timeouts for a group of users, allowing one to add/remove
|
|
||||||
users and update the timeouts associated with them.
|
|
||||||
|
|
||||||
connect - client example of using WMConnection. Works with the server
|
|
||||||
program above. Just start both without any parameter and
|
|
||||||
type help in the client to find out how to operate them.
|
|
||||||
Rest is self explanatory.
|
|
||||||
|
|
||||||
puzzle - a nice zuPzel =)
|
puzzle - a nice zuPzel =)
|
||||||
|
|
||||||
|
|||||||
@@ -3,40 +3,37 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void showSelectedColor(void *self, void *cdata)
|
void showSelectedColor(void *self, void *cdata)
|
||||||
{
|
{
|
||||||
WMColorPanel *panel= (WMColorPanel*)self;
|
WMColorPanel *panel = (WMColorPanel *) self;
|
||||||
|
|
||||||
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
|
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
|
|
||||||
WMInitializeApplication("wmcolorpick", &argc, argv);
|
WMInitializeApplication("wmcolorpick", &argc, argv);
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
dpy = XOpenDisplay("");
|
||||||
if (!dpy) {
|
if (!dpy) {
|
||||||
printf("could not open display\n");
|
printf("could not open display\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
|
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
|
||||||
|
|
||||||
{
|
{
|
||||||
WMColorPanel *panel= WMGetColorPanel(scr);
|
WMColorPanel *panel = WMGetColorPanel(scr);
|
||||||
|
|
||||||
WMSetColorPanelAction(panel, showSelectedColor, NULL);
|
WMSetColorPanelAction(panel, showSelectedColor, NULL);
|
||||||
|
|
||||||
WMShowColorPanel(panel);
|
WMShowColorPanel(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
WMScreenMainLoop(scr);
|
WMScreenMainLoop(scr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,198 +0,0 @@
|
|||||||
/*
|
|
||||||
* WINGs connect.c: example how to create a network client using WMConnection
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2003 Dan Pascu
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int initialized = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
static void connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
static void didInitialize(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static ConnectionDelegate socketDelegate = {
|
|
||||||
NULL, /* data */
|
|
||||||
NULL, /* canResumeSending */
|
|
||||||
NULL, /* didCatchException */
|
|
||||||
connectionDidDie, /* didDie */
|
|
||||||
didInitialize, /* didInitialize */
|
|
||||||
didReceiveInput, /* didReceiveInput */
|
|
||||||
NULL /* didTimeout */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
wAbort(Bool foo)
|
|
||||||
{
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static char*
|
|
||||||
getMessage(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
char *buffer;
|
|
||||||
WMData *aData;
|
|
||||||
int length;
|
|
||||||
|
|
||||||
aData = WMGetConnectionAvailableData(cPtr);
|
|
||||||
if (!aData)
|
|
||||||
return NULL;
|
|
||||||
if ((length=WMGetDataLength(aData))==0) {
|
|
||||||
WMReleaseData(aData);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer = (char*)wmalloc(length+1);
|
|
||||||
WMGetDataBytes(aData, buffer);
|
|
||||||
buffer[length]= '\0';
|
|
||||||
WMReleaseData(aData);
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
inputHandler(int fd, int mask, void *clientData)
|
|
||||||
{
|
|
||||||
WMConnection *cPtr = (WMConnection*)clientData;
|
|
||||||
WMData *aData;
|
|
||||||
char buf[4096];
|
|
||||||
int n;
|
|
||||||
|
|
||||||
if (!initialized)
|
|
||||||
return;
|
|
||||||
|
|
||||||
n = read(fd, buf, 4096);
|
|
||||||
if (n>0) {
|
|
||||||
aData = WMCreateDataWithBytes(buf, n);
|
|
||||||
WMSendConnectionData(cPtr, aData);
|
|
||||||
WMReleaseData(aData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
char *buffer;
|
|
||||||
|
|
||||||
buffer = getMessage(cPtr);
|
|
||||||
if (!buffer) {
|
|
||||||
fprintf(stderr, "Connection closed by peer.\n");
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("%s", buffer);
|
|
||||||
|
|
||||||
wfree(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
WMCloseConnection(cPtr);
|
|
||||||
|
|
||||||
fprintf(stderr, "Connection closed by peer.\n");
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
didInitialize(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
int state = WMGetConnectionState(cPtr);
|
|
||||||
WMHost *host;
|
|
||||||
|
|
||||||
if (state == WCConnected) {
|
|
||||||
host = WMGetHostWithAddress(WMGetConnectionAddress(cPtr));
|
|
||||||
fprintf(stderr, "connected to '%s:%s'\n",
|
|
||||||
host?WMGetHostName(host):WMGetConnectionAddress(cPtr),
|
|
||||||
WMGetConnectionService(cPtr));
|
|
||||||
initialized = 1;
|
|
||||||
if (host)
|
|
||||||
WMReleaseHost(host);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
wsyserrorwithcode(WCErrorCode, "Unable to connect");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
char *ProgName, *host, *port;
|
|
||||||
int i;
|
|
||||||
WMConnection *sPtr;
|
|
||||||
|
|
||||||
wsetabort(wAbort);
|
|
||||||
|
|
||||||
WMInitializeApplication("connect", &argc, argv);
|
|
||||||
|
|
||||||
ProgName = strrchr(argv[0],'/');
|
|
||||||
if (!ProgName)
|
|
||||||
ProgName = argv[0];
|
|
||||||
else
|
|
||||||
ProgName++;
|
|
||||||
|
|
||||||
host = NULL;
|
|
||||||
port = "34567";
|
|
||||||
|
|
||||||
if (argc>1) {
|
|
||||||
for (i=1; i<argc; i++) {
|
|
||||||
if (strcmp(argv[i], "--help")==0 || strcmp(argv[i], "-h")==0) {
|
|
||||||
printf("usage: %s [host [port]]\n\n", ProgName);
|
|
||||||
exit(0);
|
|
||||||
} else {
|
|
||||||
if (!host)
|
|
||||||
host = argv[i];
|
|
||||||
else
|
|
||||||
port = argv[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Trying to make connection to '%s:%s'\n",
|
|
||||||
host?host:"localhost", port);
|
|
||||||
|
|
||||||
sPtr = WMCreateConnectionToAddressAndNotify(host, port, NULL);
|
|
||||||
if (!sPtr) {
|
|
||||||
wfatal("could not create connection. exiting");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
WMSetConnectionDelegate(sPtr, &socketDelegate);
|
|
||||||
|
|
||||||
/* watch what user types and send it over the connection */
|
|
||||||
WMAddInputHandler(0, WIReadMask, inputHandler, sPtr);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
WHandleEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -13,92 +13,85 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License along
|
||||||
* along with this program; if not, write to the Free Software
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
|
|
||||||
void
|
void wAbort()
|
||||||
wAbort()
|
|
||||||
{
|
{
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show(WMWidget *self, void *data)
|
void show(WMWidget * self, void *data)
|
||||||
{
|
{
|
||||||
char buf[60];
|
char buf[60];
|
||||||
void *d;
|
void *d;
|
||||||
WMLabel *l = (WMLabel*)data;
|
WMLabel *l = (WMLabel *) data;
|
||||||
d = WMGetHangedData(self);
|
d = WMGetHangedData(self);
|
||||||
sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
|
sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
|
||||||
WMSetLabelText(l, buf);
|
WMSetLabelText(l, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void quit(WMWidget *self, void *data)
|
void quit(WMWidget * self, void *data)
|
||||||
{
|
{
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
WMButton *lab, *l0=NULL;
|
WMButton *lab, *l0 = NULL;
|
||||||
WMLabel *pos;
|
WMLabel *pos;
|
||||||
int x, y, c;
|
int x, y, c;
|
||||||
char buf[20];
|
char buf[20];
|
||||||
|
|
||||||
WMInitializeApplication("FontView", &argc, argv);
|
WMInitializeApplication("FontView", &argc, argv);
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
dpy = XOpenDisplay("");
|
||||||
if (!dpy) {
|
if (!dpy) {
|
||||||
wfatal("cant open display");
|
wfatal("cant open display");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||||
|
|
||||||
win = WMCreateWindow(scr, "main");
|
win = WMCreateWindow(scr, "main");
|
||||||
WMResizeWidget(win, 20*33, 20+20*9);
|
WMResizeWidget(win, 20 * 33, 20 + 20 * 9);
|
||||||
WMSetWindowTitle(win, "Font Chars");
|
WMSetWindowTitle(win, "Font Chars");
|
||||||
WMSetWindowCloseAction(win, quit, NULL);
|
WMSetWindowCloseAction(win, quit, NULL);
|
||||||
pos = WMCreateLabel(win);
|
pos = WMCreateLabel(win);
|
||||||
WMResizeWidget(pos, 20*33, 20);
|
WMResizeWidget(pos, 20 * 33, 20);
|
||||||
WMMoveWidget(pos, 10, 5);
|
WMMoveWidget(pos, 10, 5);
|
||||||
|
|
||||||
c = 0;
|
c = 0;
|
||||||
for (y=0; y<8; y++) {
|
for (y = 0; y < 8; y++) {
|
||||||
for (x=0; x<32; x++, c++) {
|
for (x = 0; x < 32; x++, c++) {
|
||||||
lab = WMCreateCustomButton(win, WBBStateLightMask);
|
lab = WMCreateCustomButton(win, WBBStateLightMask);
|
||||||
WMResizeWidget(lab, 20, 20);
|
WMResizeWidget(lab, 20, 20);
|
||||||
WMMoveWidget(lab, 10+x*20, 30+y*20);
|
WMMoveWidget(lab, 10 + x * 20, 30 + y * 20);
|
||||||
sprintf(buf, "%c", c);
|
sprintf(buf, "%c", c);
|
||||||
WMSetButtonText(lab, buf);
|
WMSetButtonText(lab, buf);
|
||||||
WMSetButtonAction(lab, show, pos);
|
WMSetButtonAction(lab, show, pos);
|
||||||
WMHangData(lab, (void*)c);
|
WMHangData(lab, (void *)(uintptr_t) c);
|
||||||
if (c>0) {
|
if (c > 0) {
|
||||||
WMGroupButtons(l0, lab);
|
WMGroupButtons(l0, lab);
|
||||||
} else {
|
} else {
|
||||||
l0 = lab;
|
l0 = lab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WMRealizeWidget(win);
|
WMRealizeWidget(win);
|
||||||
WMMapSubwidgets(win);
|
WMMapSubwidgets(win);
|
||||||
WMMapWidget(win);
|
WMMapWidget(win);
|
||||||
WMScreenMainLoop(scr);
|
WMScreenMainLoop(scr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
#define MAX_SIZE 10*10
|
#define MAX_SIZE 10*10
|
||||||
|
|
||||||
|
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
WMButton *Button[MAX_SIZE];
|
WMButton *Button[MAX_SIZE];
|
||||||
char Map[MAX_SIZE];
|
signed char Map[MAX_SIZE];
|
||||||
int Size = 4;
|
int Size = 4;
|
||||||
int MoveCount;
|
int MoveCount;
|
||||||
|
|
||||||
@@ -20,226 +16,218 @@ int MoveCount;
|
|||||||
|
|
||||||
int WinSize = 120;
|
int WinSize = 120;
|
||||||
|
|
||||||
|
Bool CheckWin(void)
|
||||||
Bool
|
|
||||||
CheckWin(void)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < Size*Size-1; i++) {
|
for (i = 0; i < Size * Size - 1; i++) {
|
||||||
if (Map[i] != i)
|
if (Map[i] != i)
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveButton(int button, int x, int y)
|
||||||
void
|
|
||||||
MoveButton(int button, int x, int y)
|
|
||||||
{
|
{
|
||||||
WMMoveWidget(Button[button], x*(WinSize/Size), y*(WinSize/Size));
|
WMMoveWidget(Button[button], x * (WinSize / Size), y * (WinSize / Size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool SlideButton(int button)
|
||||||
Bool
|
|
||||||
SlideButton(int button)
|
|
||||||
{
|
{
|
||||||
int x=0, y=0, done = 0;
|
int x = 0, y = 0, done = 0;
|
||||||
|
|
||||||
/* locate the button */
|
/* locate the button */
|
||||||
for (y = 0; y < Size; y++) {
|
for (y = 0; y < Size; y++) {
|
||||||
for (x = 0; x < Size; x++) {
|
for (x = 0; x < Size; x++) {
|
||||||
if (MAP(x,y) == button) {
|
if (MAP(x, y) == button) {
|
||||||
done = 1;
|
done = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (done)
|
if (done)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x > 0 && MAP(x-1, y) < 0) {
|
if (x > 0 && MAP(x - 1, y) < 0) {
|
||||||
MAP(x,y) = -1;
|
MAP(x, y) = -1;
|
||||||
MoveButton(button, x-1, y);
|
MoveButton(button, x - 1, y);
|
||||||
MAP(x-1,y) = button;
|
MAP(x - 1, y) = button;
|
||||||
} else if (x < Size-1 && MAP(x+1, y) < 0) {
|
} else if (x < Size - 1 && MAP(x + 1, y) < 0) {
|
||||||
MAP(x,y) = -1;
|
MAP(x, y) = -1;
|
||||||
MoveButton(button, x+1, y);
|
MoveButton(button, x + 1, y);
|
||||||
MAP(x+1,y) = button;
|
MAP(x + 1, y) = button;
|
||||||
} else if (y > 0 && MAP(x, y-1) < 0) {
|
} else if (y > 0 && MAP(x, y - 1) < 0) {
|
||||||
MAP(x,y) = -1;
|
MAP(x, y) = -1;
|
||||||
MoveButton(button, x, y-1);
|
MoveButton(button, x, y - 1);
|
||||||
MAP(x,y-1) = button;
|
MAP(x, y - 1) = button;
|
||||||
} else if (y < Size-1 && MAP(x, y+1) < 0) {
|
} else if (y < Size - 1 && MAP(x, y + 1) < 0) {
|
||||||
MAP(x,y) = -1;
|
MAP(x, y) = -1;
|
||||||
MoveButton(button, x, y+1);
|
MoveButton(button, x, y + 1);
|
||||||
MAP(x,y+1) = button;
|
MAP(x, y + 1) = button;
|
||||||
} else {
|
} else {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define SWAP(a,b) {int tmp; tmp=a; a=b; b=tmp;}
|
#define SWAP(a,b) {int tmp; tmp=a; a=b; b=tmp;}
|
||||||
|
|
||||||
void ResetGame(void)
|
void ResetGame(void)
|
||||||
{
|
{
|
||||||
int i, x, y, ox, oy;
|
int i, x, y, ox, oy;
|
||||||
|
|
||||||
|
MoveCount = 0;
|
||||||
|
|
||||||
MoveCount = 0;
|
for (i = 0; i < Size * Size - 1; i++) {
|
||||||
|
Map[i] = i;
|
||||||
|
}
|
||||||
|
Map[i] = -1;
|
||||||
|
ox = x = Size - 1;
|
||||||
|
oy = y = Size - 1;
|
||||||
|
for (i = 0; i < 1000; i++) {
|
||||||
|
int ok;
|
||||||
|
ok = 1;
|
||||||
|
switch (rand() % 4) {
|
||||||
|
case 0:
|
||||||
|
if (x > 0)
|
||||||
|
x--;
|
||||||
|
else
|
||||||
|
ok = 0;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (x < Size - 1)
|
||||||
|
x++;
|
||||||
|
else
|
||||||
|
ok = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (y > 0)
|
||||||
|
y--;
|
||||||
|
else
|
||||||
|
ok = 0;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (y < Size - 1)
|
||||||
|
y++;
|
||||||
|
else
|
||||||
|
ok = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ok) {
|
||||||
|
MoveButton(MAP(x, y), ox, oy);
|
||||||
|
|
||||||
for (i = 0; i < Size*Size-1; i++) {
|
SWAP(MAP(ox, oy), MAP(x, y));
|
||||||
Map[i] = i;
|
|
||||||
}
|
|
||||||
Map[i] = -1;
|
|
||||||
ox = x = Size-1;
|
|
||||||
oy = y = Size-1;
|
|
||||||
for (i = 0; i < 1000; i++) {
|
|
||||||
int ok;
|
|
||||||
ok = 1;
|
|
||||||
switch (rand()%4) {
|
|
||||||
case 0:
|
|
||||||
if (x > 0) x--; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (x < Size-1) x++; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (y > 0) y--; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if (y < Size-1) y++; else ok = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (ok) {
|
|
||||||
MoveButton(MAP(x,y), ox, oy);
|
|
||||||
|
|
||||||
SWAP(MAP(ox, oy), MAP(x, y));
|
while (XPending(WMScreenDisplay(WMWidgetScreen(win)))) {
|
||||||
|
XEvent ev;
|
||||||
while (XPending(WMScreenDisplay(WMWidgetScreen(win)))) {
|
WMNextEvent(WMScreenDisplay(WMWidgetScreen(win)), &ev);
|
||||||
XEvent ev;
|
WMHandleEvent(&ev);
|
||||||
WMNextEvent(WMScreenDisplay(WMWidgetScreen(win)), &ev);
|
}
|
||||||
WMHandleEvent(&ev);
|
ox = x;
|
||||||
}
|
oy = y;
|
||||||
ox = x;
|
}
|
||||||
oy = y;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void buttonClick(WMWidget * w, void *ptr)
|
||||||
void buttonClick(WMWidget *w, void *ptr)
|
|
||||||
{
|
{
|
||||||
char buffer[300];
|
char buffer[300];
|
||||||
|
|
||||||
if (SlideButton((int)ptr)) {
|
if (SlideButton((uintptr_t)ptr)) {
|
||||||
MoveCount++;
|
MoveCount++;
|
||||||
|
|
||||||
if (CheckWin()) {
|
if (CheckWin()) {
|
||||||
sprintf(buffer, "You finished the game in %i moves.", MoveCount);
|
sprintf(buffer, "You finished the game in %i moves.", MoveCount);
|
||||||
|
|
||||||
if (WMRunAlertPanel(WMWidgetScreen(w), win, "You Won!", buffer,
|
if (WMRunAlertPanel(WMWidgetScreen(w), win, "You Won!", buffer,
|
||||||
"Wee!", "Gah! Lemme retry!", NULL) == WAPRDefault) {
|
"Wee!", "Gah! Lemme retry!", NULL) == WAPRDefault) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetGame();
|
ResetGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void resizeObserver(void *self, WMNotification * notif)
|
||||||
static void resizeObserver(void *self, WMNotification *notif)
|
|
||||||
{
|
{
|
||||||
WMSize size = WMGetViewSize(WMWidgetView(win));
|
WMSize size = WMGetViewSize(WMWidgetView(win));
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
WinSize = size.width;
|
WinSize = size.width;
|
||||||
for (y = 0; y < Size; y++) {
|
for (y = 0; y < Size; y++) {
|
||||||
for (x = 0; x < Size; x++) {
|
for (x = 0; x < Size; x++) {
|
||||||
if (MAP(x,y) >= 0) {
|
if (MAP(x, y) >= 0) {
|
||||||
WMResizeWidget(Button[(int)MAP(x,y)],
|
WMResizeWidget(Button[(int)MAP(x, y)], WinSize / Size, WinSize / Size);
|
||||||
WinSize/Size, WinSize/Size);
|
WMMoveWidget(Button[(int)MAP(x, y)], x * (WinSize / Size), y * (WinSize / Size));
|
||||||
WMMoveWidget(Button[(int)MAP(x,y)],
|
}
|
||||||
x*(WinSize/Size), y*(WinSize/Size));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
int x, y, i;
|
int x, y, i;
|
||||||
|
|
||||||
WMInitializeApplication("Puzzle", &argc, argv);
|
WMInitializeApplication("Puzzle", &argc, argv);
|
||||||
|
|
||||||
|
dpy = XOpenDisplay("");
|
||||||
|
if (!dpy) {
|
||||||
|
printf("could not open display\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
|
||||||
if (!dpy) {
|
|
||||||
printf("could not open display\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
|
win = WMCreateWindow(scr, "puzzle");
|
||||||
|
WMResizeWidget(win, WinSize, WinSize);
|
||||||
|
WMSetWindowTitle(win, "zuPzel");
|
||||||
|
WMSetWindowMinSize(win, 80, 80);
|
||||||
|
WMSetWindowAspectRatio(win, 2, 2, 2, 2);
|
||||||
|
WMSetWindowResizeIncrements(win, Size, Size);
|
||||||
|
WMSetViewNotifySizeChanges(WMWidgetView(win), True);
|
||||||
|
WMAddNotificationObserver(resizeObserver, NULL, WMViewSizeDidChangeNotification, WMWidgetView(win));
|
||||||
|
|
||||||
win = WMCreateWindow(scr, "puzzle");
|
for (i = y = 0; y < Size && i < Size * Size - 1; y++) {
|
||||||
WMResizeWidget(win, WinSize, WinSize);
|
for (x = 0; x < Size && i < Size * Size - 1; x++) {
|
||||||
WMSetWindowTitle(win, "zuPzel");
|
char buf[32];
|
||||||
WMSetWindowMinSize(win, 80, 80);
|
WMColor *color;
|
||||||
WMSetWindowAspectRatio(win, 2, 2, 2, 2);
|
RColor col;
|
||||||
WMSetWindowResizeIncrements(win, Size, Size);
|
RHSVColor hsv;
|
||||||
WMSetViewNotifySizeChanges(WMWidgetView(win), True);
|
|
||||||
WMAddNotificationObserver(resizeObserver, NULL,
|
|
||||||
WMViewSizeDidChangeNotification,
|
|
||||||
WMWidgetView(win));
|
|
||||||
|
|
||||||
|
hsv.hue = i * 360 / (Size * Size - 1);
|
||||||
|
hsv.saturation = 120;
|
||||||
|
hsv.value = 200;
|
||||||
|
|
||||||
|
RHSVtoRGB(&hsv, &col);
|
||||||
|
|
||||||
for (i = y = 0; y < Size && i < Size*Size-1; y++) {
|
color = WMCreateRGBColor(scr, col.red << 8, col.green << 8, col.blue << 8, False);
|
||||||
for (x = 0; x < Size && i < Size*Size-1; x++) {
|
|
||||||
char buf[32];
|
|
||||||
WMColor *color;
|
|
||||||
RColor col;
|
|
||||||
RHSVColor hsv;
|
|
||||||
|
|
||||||
hsv.hue = i*360/(Size*Size-1);
|
MAP(x, y) = i;
|
||||||
hsv.saturation = 120;
|
Button[i] = WMCreateButton(win, WBTMomentaryLight);
|
||||||
hsv.value = 200;
|
WMSetWidgetBackgroundColor(Button[i], color);
|
||||||
|
WMReleaseColor(color);
|
||||||
|
WMSetButtonAction(Button[i], buttonClick, (void *)(uintptr_t) i);
|
||||||
|
WMResizeWidget(Button[i], WinSize / Size, WinSize / Size);
|
||||||
|
WMMoveWidget(Button[i], x * (WinSize / Size), y * (WinSize / Size));
|
||||||
|
sprintf(buf, "%i", i + 1);
|
||||||
|
WMSetButtonText(Button[i], buf);
|
||||||
|
WMSetButtonTextAlignment(Button[i], WACenter);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RHSVtoRGB(&hsv, &col);
|
WMMapSubwidgets(win);
|
||||||
|
WMMapWidget(win);
|
||||||
|
WMRealizeWidget(win);
|
||||||
|
|
||||||
color = WMCreateRGBColor(scr, col.red<<8, col.green<<8,
|
ResetGame();
|
||||||
col.blue<<8, False);
|
|
||||||
|
|
||||||
MAP(x,y) = i;
|
WMScreenMainLoop(scr);
|
||||||
Button[i] = WMCreateButton(win, WBTMomentaryLight);
|
|
||||||
WMSetWidgetBackgroundColor(Button[i], color);
|
|
||||||
WMReleaseColor(color);
|
|
||||||
WMSetButtonAction(Button[i], buttonClick, (void*)i);
|
|
||||||
WMResizeWidget(Button[i], WinSize/Size, WinSize/Size);
|
|
||||||
WMMoveWidget(Button[i], x*(WinSize/Size), y*(WinSize/Size));
|
|
||||||
sprintf(buf, "%i", i+1);
|
|
||||||
WMSetButtonText(Button[i], buf);
|
|
||||||
WMSetButtonTextAlignment(Button[i], WACenter);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WMMapSubwidgets(win);
|
return 0;
|
||||||
WMMapWidget(win);
|
|
||||||
WMRealizeWidget(win);
|
|
||||||
|
|
||||||
ResetGame();
|
|
||||||
|
|
||||||
WMScreenMainLoop(scr);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,740 +0,0 @@
|
|||||||
/*
|
|
||||||
* WINGs server.c: example how to create a network server using WMConnection
|
|
||||||
*
|
|
||||||
* Copyright (c) 2001-2003 Dan Pascu
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define _(P) P
|
|
||||||
#define MAXCMD_SIZE 512
|
|
||||||
|
|
||||||
|
|
||||||
char *SEConnectionShouldBeRemovedNotification = "SEConnectionShouldBeRemovedNotification";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
static void connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
static void connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
|
|
||||||
extern char *SEConnectionShouldBeRemovedNotification;
|
|
||||||
|
|
||||||
static WMUserDefaults *timeDB = NULL;
|
|
||||||
static char *ServerAddress = NULL;
|
|
||||||
static char *ServerPort = NULL;
|
|
||||||
static WMArray *allowedHostList = NULL;
|
|
||||||
static WMArray *clientConnections = NULL;
|
|
||||||
static WMConnection *serverPtr = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static ConnectionDelegate socketDelegate = {
|
|
||||||
NULL, /* client data */
|
|
||||||
NULL, /* canResumeSending */
|
|
||||||
NULL, /* didCatchException */
|
|
||||||
connectionDidDie, /* didDie */
|
|
||||||
NULL, /* didInitialize */
|
|
||||||
didReceiveInput, /* didReceiveInput */
|
|
||||||
connectionDidTimeout /* didTimeout */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
wAbort(Bool foo)
|
|
||||||
{
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
printHelp(char *progname)
|
|
||||||
{
|
|
||||||
printf(_("usage: %s [options]\n\n"), progname);
|
|
||||||
puts(_(" --help print this message"));
|
|
||||||
puts(_(" --listen [address:]port only listen on the specified address/port"));
|
|
||||||
puts(_(" --allow host1[,host2...] only allow connections from listed hosts\n"));
|
|
||||||
puts(_(" By default server listens on all interfaces and port 34567, unless"
|
|
||||||
" something\nelse is specified with the --listen option. If address is"
|
|
||||||
" omitted or the keyword\n'Any' is used, it will listen on all interfaces else"
|
|
||||||
" only on the specified one.\n\nFor example --listen localhost: will"
|
|
||||||
" listen on the default port 34567, but only\non connections comming"
|
|
||||||
" in through the loopback interface.\n\n Also by default the server"
|
|
||||||
" listens to incoming connections from any host,\nunless a list of"
|
|
||||||
" hosts is given with the --allow option, in which case it will\nreject"
|
|
||||||
" connections not comming from those hosts.\nThe list of hosts is comma"
|
|
||||||
" separated and should NOT contain ANY spaces."));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
enqueueConnectionForRemoval(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
WMNotification *notif;
|
|
||||||
|
|
||||||
/*don't release notif here. it will be released by queue after processing */
|
|
||||||
notif = WMCreateNotification(SEConnectionShouldBeRemovedNotification,
|
|
||||||
cPtr, NULL);
|
|
||||||
WMEnqueueNotification(WMGetDefaultNotificationQueue(), notif, WMPostASAP);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
sendMessage(WMConnection *cPtr, char *message)
|
|
||||||
{
|
|
||||||
WMData *aData;
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if (WMGetConnectionState(cPtr)!=WCConnected)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
aData = WMCreateDataWithBytes(message, strlen(message));
|
|
||||||
res = WMSendConnectionData(cPtr, aData);
|
|
||||||
WMReleaseData(aData);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
enqueueMessage(WMConnection *cPtr, char *message)
|
|
||||||
{
|
|
||||||
WMData *aData;
|
|
||||||
Bool res;
|
|
||||||
|
|
||||||
if (WMGetConnectionState(cPtr)!=WCConnected)
|
|
||||||
return False;
|
|
||||||
|
|
||||||
aData = WMCreateDataWithBytes(message, strlen(message));
|
|
||||||
res = WMEnqueueConnectionData(cPtr, aData);
|
|
||||||
WMReleaseData(aData);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static char*
|
|
||||||
findDelimiter(char *data, const char *endPtr)
|
|
||||||
{
|
|
||||||
wassertrv(data < endPtr, NULL);
|
|
||||||
|
|
||||||
while (data<endPtr && *data!='\n' && *data!='\r' && *data!=';' && *data!='\0')
|
|
||||||
data++;
|
|
||||||
|
|
||||||
if (data < endPtr)
|
|
||||||
return data;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static WMArray*
|
|
||||||
getAvailableMessages(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
char *ptr, *crtPos, *buffer;
|
|
||||||
const char *bytes, *endPtr;
|
|
||||||
WMData *aData, *receivedData, *holdData;
|
|
||||||
WMRange range;
|
|
||||||
WMArray *messages;
|
|
||||||
int length;
|
|
||||||
|
|
||||||
receivedData = WMGetConnectionAvailableData(cPtr);
|
|
||||||
if (!receivedData)
|
|
||||||
return NULL;
|
|
||||||
if ((length=WMGetDataLength(receivedData))==0) {
|
|
||||||
WMReleaseData(receivedData);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
holdData = (WMData*)WMGetConnectionClientData(cPtr);
|
|
||||||
if (holdData) {
|
|
||||||
WMAppendData(holdData, receivedData);
|
|
||||||
WMReleaseData(receivedData);
|
|
||||||
WMSetConnectionClientData(cPtr, NULL);
|
|
||||||
aData = holdData;
|
|
||||||
} else {
|
|
||||||
aData = receivedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
length = WMGetDataLength(aData);
|
|
||||||
bytes = (char*)WMDataBytes(aData);
|
|
||||||
endPtr = bytes + length;
|
|
||||||
|
|
||||||
messages = WMCreateArrayWithDestructor(1, wfree);
|
|
||||||
crtPos = (char*)bytes;
|
|
||||||
while (crtPos<endPtr && (ptr = findDelimiter(crtPos, endPtr))!=NULL) {
|
|
||||||
range.position = (crtPos - bytes);
|
|
||||||
range.count = (ptr - crtPos);
|
|
||||||
if (range.count > MAXCMD_SIZE) {
|
|
||||||
/* Hmmm... The message is too long. Possibly that someone is
|
|
||||||
* flooding us, or there is a dumb client which do not know
|
|
||||||
* who is talking to. */
|
|
||||||
sendMessage(cPtr, "Command too long\n\r");
|
|
||||||
WMFreeArray(messages);
|
|
||||||
WMReleaseData(aData);
|
|
||||||
WMCloseConnection(cPtr);
|
|
||||||
enqueueConnectionForRemoval(cPtr);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
buffer = wmalloc(range.count+1);
|
|
||||||
WMGetDataBytesWithRange(aData, buffer, range);
|
|
||||||
buffer[range.count] = '\0';
|
|
||||||
WMAddToArray(messages, buffer);
|
|
||||||
crtPos = ptr;
|
|
||||||
while (crtPos<endPtr && (*crtPos=='\n' || *crtPos=='\r' ||
|
|
||||||
*crtPos=='\t' || *crtPos=='\0' ||
|
|
||||||
*crtPos==';' || *crtPos==' ')) {
|
|
||||||
crtPos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (crtPos<endPtr) {
|
|
||||||
range.position = (crtPos - bytes);
|
|
||||||
range.count = (endPtr - crtPos);
|
|
||||||
if (range.count > MAXCMD_SIZE) {
|
|
||||||
/* Flooooooding!!!! */
|
|
||||||
sendMessage(cPtr, "Message too long\n\r");
|
|
||||||
WMFreeArray(messages);
|
|
||||||
WMReleaseData(aData);
|
|
||||||
WMCloseConnection(cPtr);
|
|
||||||
enqueueConnectionForRemoval(cPtr);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
holdData = WMGetSubdataWithRange(aData, range);
|
|
||||||
WMSetConnectionClientData(cPtr, holdData);
|
|
||||||
}
|
|
||||||
WMReleaseData(aData);
|
|
||||||
|
|
||||||
if (WMGetArrayItemCount(messages)==0) {
|
|
||||||
WMFreeArray(messages);
|
|
||||||
messages = NULL;
|
|
||||||
}
|
|
||||||
return messages;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
complainAboutBadArgs(WMConnection *cPtr, char *cmdName, char *badArgs)
|
|
||||||
{
|
|
||||||
char *buf = wmalloc(strlen(cmdName) + strlen(badArgs) + 100);
|
|
||||||
|
|
||||||
sprintf(buf, _("Invalid parameters '%s' for command %s. Use HELP for"
|
|
||||||
" a list of commands.\n"), badArgs, cmdName);
|
|
||||||
sendMessage(cPtr, buf);
|
|
||||||
wfree(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
sendUpdateMessage(WMConnection *cPtr, char *id, int time)
|
|
||||||
{
|
|
||||||
char *buf = wmalloc(strlen(id) + 100);
|
|
||||||
|
|
||||||
sprintf(buf, "%s has %i minutes left\n", id, time);
|
|
||||||
sendMessage(cPtr, buf);
|
|
||||||
wfree(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
showId(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
sendMessage(cPtr, "Server example based on WMConnection\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
showHelp(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
char *buf = wmalloc(strlen(WMGetApplicationName()) + 16);
|
|
||||||
|
|
||||||
sprintf(buf, _("%s commands:\n\n"), WMGetApplicationName());
|
|
||||||
|
|
||||||
enqueueMessage(cPtr, _("\n"));
|
|
||||||
enqueueMessage(cPtr, buf);
|
|
||||||
enqueueMessage(cPtr, _("GET <id>\t- return time left (in minutes) "
|
|
||||||
"for user with id <id>\n"));
|
|
||||||
enqueueMessage(cPtr, _("SET <id> <time>\t- set time limit to <time> "
|
|
||||||
"minutes for user with id <id>\n"));
|
|
||||||
enqueueMessage(cPtr, _("ADD <id> <time>\t- add <time> minutes "
|
|
||||||
"for user with id <id>\n"));
|
|
||||||
enqueueMessage(cPtr, _("SUB <id> <time>\t- subtract <time> minutes "
|
|
||||||
"for user with id <id>\n"));
|
|
||||||
enqueueMessage(cPtr, _("REMOVE <id>\t- remove time limitations for "
|
|
||||||
"user with id <id>\n"));
|
|
||||||
enqueueMessage(cPtr, _("LIST\t\t- list all users and their "
|
|
||||||
"corresponding time limit\n"));
|
|
||||||
enqueueMessage(cPtr, _("ID\t\t- returns the Time Manager "
|
|
||||||
"identification string\n"));
|
|
||||||
enqueueMessage(cPtr, _("EXIT\t\t- exits session\n"));
|
|
||||||
enqueueMessage(cPtr, _("QUIT\t\t- exits session\n"));
|
|
||||||
enqueueMessage(cPtr, _("HELP\t\t- show this message\n\n"));
|
|
||||||
/* Just flush the queue we made before */
|
|
||||||
WMFlushConnection(cPtr);
|
|
||||||
wfree(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
listUsers(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
WMPropList *userList;
|
|
||||||
char *id;
|
|
||||||
int i, time;
|
|
||||||
|
|
||||||
userList = WMGetUDKeys(timeDB);
|
|
||||||
|
|
||||||
for (i=0; i<WMGetPropListItemCount(userList); i++) {
|
|
||||||
id = WMGetFromPLString(WMGetFromPLArray(userList, i));
|
|
||||||
time = WMGetUDIntegerForKey(timeDB, id);
|
|
||||||
sendUpdateMessage(cPtr, id, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
WMReleasePropList(userList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
setTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
|
||||||
{
|
|
||||||
char *id;
|
|
||||||
int i, time;
|
|
||||||
|
|
||||||
id = wmalloc(strlen(cmdArgs));
|
|
||||||
if (sscanf(cmdArgs, "%s %d", id, &time)!=2) {
|
|
||||||
complainAboutBadArgs(cPtr, "SET", cmdArgs);
|
|
||||||
wfree(id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (time<0)
|
|
||||||
time = 0;
|
|
||||||
|
|
||||||
WMSetUDIntegerForKey(timeDB, time, id);
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(clientConnections); i++) {
|
|
||||||
cPtr = WMGetFromArray(clientConnections, i);
|
|
||||||
sendUpdateMessage(cPtr, id, time);
|
|
||||||
}
|
|
||||||
wfree(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
addTimeToUser(WMConnection *cPtr, char *cmdArgs)
|
|
||||||
{
|
|
||||||
char *id;
|
|
||||||
int i, time, newTime;
|
|
||||||
|
|
||||||
id = wmalloc(strlen(cmdArgs));
|
|
||||||
if (sscanf(cmdArgs, "%s %d", id, &time)!=2) {
|
|
||||||
complainAboutBadArgs(cPtr, "ADD", cmdArgs);
|
|
||||||
wfree(id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
newTime = WMGetUDIntegerForKey(timeDB, id) + time;
|
|
||||||
if (newTime<0)
|
|
||||||
newTime = 0;
|
|
||||||
|
|
||||||
WMSetUDIntegerForKey(timeDB, newTime, id);
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(clientConnections); i++) {
|
|
||||||
cPtr = WMGetFromArray(clientConnections, i);
|
|
||||||
sendUpdateMessage(cPtr, id, newTime);
|
|
||||||
}
|
|
||||||
wfree(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
subTimeFromUser(WMConnection *cPtr, char *cmdArgs)
|
|
||||||
{
|
|
||||||
char *id;
|
|
||||||
int i, time, newTime;
|
|
||||||
|
|
||||||
id = wmalloc(strlen(cmdArgs));
|
|
||||||
if (sscanf(cmdArgs, "%s %d", id, &time)!=2) {
|
|
||||||
complainAboutBadArgs(cPtr, "SUB", cmdArgs);
|
|
||||||
wfree(id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
newTime = WMGetUDIntegerForKey(timeDB, id) - time;
|
|
||||||
if (newTime<0)
|
|
||||||
newTime = 0;
|
|
||||||
|
|
||||||
WMSetUDIntegerForKey(timeDB, newTime, id);
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(clientConnections); i++) {
|
|
||||||
cPtr = WMGetFromArray(clientConnections, i);
|
|
||||||
sendUpdateMessage(cPtr, id, newTime);
|
|
||||||
}
|
|
||||||
wfree(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
removeTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (cmdArgs[0]=='\0') {
|
|
||||||
sendMessage(cPtr, _("Missing parameter for command REMOVE."
|
|
||||||
" Use HELP for a list of commands.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr = cmdArgs;
|
|
||||||
while (*ptr && *ptr!=' ' && *ptr!='\t')
|
|
||||||
ptr++;
|
|
||||||
*ptr = '\0';
|
|
||||||
|
|
||||||
WMRemoveUDObjectForKey(timeDB, cmdArgs);
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(clientConnections); i++) {
|
|
||||||
cPtr = WMGetFromArray(clientConnections, i);
|
|
||||||
sendUpdateMessage(cPtr, cmdArgs, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
getTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
int time;
|
|
||||||
|
|
||||||
if (cmdArgs[0]=='\0') {
|
|
||||||
sendMessage(cPtr, _("Missing parameter for command GET."
|
|
||||||
" Use HELP for a list of commands.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr = cmdArgs;
|
|
||||||
while (*ptr && *ptr!=' ' && *ptr!='\t')
|
|
||||||
ptr++;
|
|
||||||
*ptr = '\0';
|
|
||||||
|
|
||||||
if (WMGetUDObjectForKey(timeDB, cmdArgs)!=NULL)
|
|
||||||
time = WMGetUDIntegerForKey(timeDB, cmdArgs);
|
|
||||||
else
|
|
||||||
time = -1;
|
|
||||||
|
|
||||||
sendUpdateMessage(cPtr, cmdArgs, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
handleConnection(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
char *command, *ptr, *cmdArgs, *buffer;
|
|
||||||
WMArray *commands;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
commands = getAvailableMessages(cPtr);
|
|
||||||
if (!commands)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(commands); i++) {
|
|
||||||
command = WMGetFromArray(commands, i);
|
|
||||||
while (*command && (*command==' ' || *command=='\t'))
|
|
||||||
command++;
|
|
||||||
ptr = command;
|
|
||||||
while(*ptr && *ptr!=' ' && *ptr!='\t')
|
|
||||||
ptr++;
|
|
||||||
if (*ptr) {
|
|
||||||
*ptr = '\0';
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
while (*ptr && (*ptr==' ' || *ptr=='\t'))
|
|
||||||
ptr++;
|
|
||||||
|
|
||||||
cmdArgs = ptr;
|
|
||||||
|
|
||||||
fprintf(stderr, "Command: '%s', args: '%s'\n", command, cmdArgs);
|
|
||||||
|
|
||||||
if (strcasecmp(command, "quit")==0 || strcasecmp(command, "exit")==0) {
|
|
||||||
sendMessage(cPtr, "Bye\n");
|
|
||||||
WMCloseConnection(cPtr);
|
|
||||||
enqueueConnectionForRemoval(cPtr);
|
|
||||||
WMFreeArray(commands);
|
|
||||||
return;
|
|
||||||
} else if (strcasecmp(command, "id")==0) {
|
|
||||||
showId(cPtr);
|
|
||||||
} else if (strcasecmp(command, "help")==0) {
|
|
||||||
showHelp(cPtr);
|
|
||||||
} else if (strcasecmp(command, "list")==0) {
|
|
||||||
listUsers(cPtr);
|
|
||||||
} else if (strcasecmp(command, "set")==0) {
|
|
||||||
setTimeForUser(cPtr, cmdArgs);
|
|
||||||
} else if (strcasecmp(command, "add")==0) {
|
|
||||||
addTimeToUser(cPtr, cmdArgs);
|
|
||||||
} else if (strcasecmp(command, "sub")==0) {
|
|
||||||
subTimeFromUser(cPtr, cmdArgs);
|
|
||||||
} else if (strcasecmp(command, "remove")==0) {
|
|
||||||
removeTimeForUser(cPtr, cmdArgs);
|
|
||||||
} else if (strcasecmp(command, "get")==0) {
|
|
||||||
getTimeForUser(cPtr, cmdArgs);
|
|
||||||
} else {
|
|
||||||
buffer = wmalloc(strlen(command) + 100);
|
|
||||||
sprintf(buffer, _("Unknown command '%s'. Try HELP for"
|
|
||||||
" a list of commands.\n"), command);
|
|
||||||
sendMessage(cPtr, buffer);
|
|
||||||
wfree(buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WMFreeArray(commands);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
isAllowedToConnect(WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
WMHost *hPtr;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (allowedHostList == NULL)
|
|
||||||
return True; /* No list. Allow all by default */
|
|
||||||
|
|
||||||
hPtr = WMGetHostWithAddress(WMGetConnectionAddress(cPtr));
|
|
||||||
for (i=0; i<WMGetArrayItemCount(allowedHostList); i++) {
|
|
||||||
if (WMIsHostEqualToHost(hPtr, WMGetFromArray(allowedHostList, i))) {
|
|
||||||
WMReleaseHost(hPtr);
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WMReleaseHost(hPtr);
|
|
||||||
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
if (cPtr == serverPtr) {
|
|
||||||
WMConnection *newPtr = WMAcceptConnection(cPtr);
|
|
||||||
|
|
||||||
if (newPtr) {
|
|
||||||
if (isAllowedToConnect(newPtr)) {
|
|
||||||
WMSetConnectionDelegate(newPtr, &socketDelegate);
|
|
||||||
WMSetConnectionSendTimeout(newPtr, 120);
|
|
||||||
WMAddToArray(clientConnections, newPtr);
|
|
||||||
} else {
|
|
||||||
sendMessage(newPtr, "Sorry, you are not allowed to connect.\n");
|
|
||||||
WMDestroyConnection(newPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Data arriving on an already-connected socket */
|
|
||||||
handleConnection(cPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
WMHost *hPtr;
|
|
||||||
|
|
||||||
if (cPtr == serverPtr) {
|
|
||||||
wfatal(_("The server listening socket did timeout. Exiting."));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
hPtr = WMGetHostWithAddress(WMGetConnectionAddress(cPtr));
|
|
||||||
wwarning(_("Connection with %s did timeout. Closing connection."),
|
|
||||||
WMGetHostName(hPtr));
|
|
||||||
WMReleaseHost(hPtr);
|
|
||||||
|
|
||||||
enqueueConnectionForRemoval(cPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr)
|
|
||||||
{
|
|
||||||
if (cPtr == serverPtr) {
|
|
||||||
/* trouble. server listening port itself died!!! */
|
|
||||||
wfatal(_("The server listening socket died. Exiting."));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
enqueueConnectionForRemoval(cPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
removeConnection(void *observer, WMNotification *notification)
|
|
||||||
{
|
|
||||||
WMConnection *cPtr = (WMConnection*)WMGetNotificationObject(notification);
|
|
||||||
WMData *data;
|
|
||||||
|
|
||||||
WMRemoveFromArray(clientConnections, cPtr);
|
|
||||||
if ((data = (WMData*)WMGetConnectionClientData(cPtr))!=NULL)
|
|
||||||
WMReleaseData(data);
|
|
||||||
WMDestroyConnection(cPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
updatedDomain(void *observer, WMNotification *notification)
|
|
||||||
{
|
|
||||||
wmessage("defaults domain file changed on disk. synchronizing.");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static Bool
|
|
||||||
isDifferent(char *str1, char *str2)
|
|
||||||
{
|
|
||||||
if ((!str1 && !str2) || (str1 && str2 && strcmp(str1, str2)==0))
|
|
||||||
return False;
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
wsetabort(wAbort);
|
|
||||||
|
|
||||||
WMInitializeApplication("server", &argc, argv);
|
|
||||||
|
|
||||||
if (argc>1) {
|
|
||||||
for (i=1; i<argc; i++) {
|
|
||||||
if (strcmp(argv[i], "--help")==0) {
|
|
||||||
printHelp(argv[0]);
|
|
||||||
exit(0);
|
|
||||||
} else if (strcmp(argv[i], "--listen")==0) {
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
if ((p = strchr(argv[++i], ':')) != NULL) {
|
|
||||||
*p = 0;
|
|
||||||
ServerAddress = wstrdup(argv[i]);
|
|
||||||
ServerPort = wstrdup(p+1);
|
|
||||||
*p = ':';
|
|
||||||
if (ServerAddress[0] == 0) {
|
|
||||||
wfree(ServerAddress);
|
|
||||||
ServerAddress = NULL;
|
|
||||||
}
|
|
||||||
if (ServerPort[0] == 0) {
|
|
||||||
wfree(ServerPort);
|
|
||||||
ServerPort = "34567";
|
|
||||||
}
|
|
||||||
} else if (argv[i][0]!=0) {
|
|
||||||
ServerPort = argv[i];
|
|
||||||
}
|
|
||||||
} else if (strcmp(argv[i], "--allow")==0) {
|
|
||||||
char *p, *ptr;
|
|
||||||
int done;
|
|
||||||
WMHost *hPtr;
|
|
||||||
|
|
||||||
ptr = argv[++i];
|
|
||||||
done = 0;
|
|
||||||
while (!done) {
|
|
||||||
if ((p = strchr(ptr, ',')) != NULL) {
|
|
||||||
*p = 0;
|
|
||||||
}
|
|
||||||
if (*ptr != 0) {
|
|
||||||
hPtr = WMGetHostWithName(ptr);
|
|
||||||
if (hPtr) {
|
|
||||||
if (!allowedHostList)
|
|
||||||
allowedHostList = WMCreateArray(4);
|
|
||||||
WMAddToArray(allowedHostList, hPtr);
|
|
||||||
} else {
|
|
||||||
wwarning(_("Unknown host '%s'. Ignored."), ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p!=NULL) {
|
|
||||||
*p = ',';
|
|
||||||
ptr = p+1;
|
|
||||||
} else {
|
|
||||||
done = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
printf(_("%s: invalid argument '%s'\n"), argv[0], argv[i]);
|
|
||||||
printf(_("Try '%s --help' for more information\n"), argv[0]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timeDB = WMGetDefaultsFromPath("./UserTime.plist");
|
|
||||||
WMAddNotificationObserver(updatedDomain, NULL,
|
|
||||||
WMUserDefaultsDidChangeNotification, NULL);
|
|
||||||
|
|
||||||
clientConnections = WMCreateArray(4);
|
|
||||||
|
|
||||||
/* A NULL ServerAddress means to listen on any address the host has.
|
|
||||||
* Else if ServerAddress points to a specific address (like "localhost",
|
|
||||||
* "host.domain.com" or "192.168.1.1"), then it will only listen on that
|
|
||||||
* interface and ignore incoming connections on the others. */
|
|
||||||
if (ServerAddress && strcasecmp(ServerAddress, "Any")==0)
|
|
||||||
ServerAddress = NULL;
|
|
||||||
if (ServerPort==NULL)
|
|
||||||
ServerPort = "34567";
|
|
||||||
|
|
||||||
printf("Server will listen on '%s:%s'\n", ServerAddress?ServerAddress:"Any",
|
|
||||||
ServerPort);
|
|
||||||
printf("This server will allow connections from:");
|
|
||||||
if (allowedHostList) {
|
|
||||||
int i;
|
|
||||||
char *hName;
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(allowedHostList); i++) {
|
|
||||||
hName = WMGetHostName(WMGetFromArray(allowedHostList, i));
|
|
||||||
printf("%s'%s'", i==0?" ":", ", hName);
|
|
||||||
}
|
|
||||||
printf(".\n");
|
|
||||||
} else {
|
|
||||||
printf(" any host.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
serverPtr = WMCreateConnectionAsServerAtAddress(ServerAddress, ServerPort,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (!serverPtr) {
|
|
||||||
wfatal("could not create server on `%s:%s`. Exiting.",
|
|
||||||
ServerAddress ? ServerAddress : "localhost", ServerPort);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
WMSetConnectionDelegate(serverPtr, &socketDelegate);
|
|
||||||
|
|
||||||
WMAddNotificationObserver(removeConnection, NULL,
|
|
||||||
SEConnectionShouldBeRemovedNotification, NULL);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
/* The ASAP notification queue is called at the end of WHandleEvents()
|
|
||||||
* There's where died connections we get while running through
|
|
||||||
* WHandleEvents() get removed. */
|
|
||||||
WHandleEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
.libs
|
|
||||||
test
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
## automake input file for WINGs
|
## automake input file for WINGs
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# is this a kluge? if so, how should i do it?
|
# is this a kluge? if so, how should i do it?
|
||||||
includedir = @includedir@/WINGs
|
includedir = @includedir@/WINGs
|
||||||
@@ -10,25 +8,23 @@ includedir = @includedir@/WINGs
|
|||||||
include_HEADERS = wtableview.h wtabledelegates.h
|
include_HEADERS = wtableview.h wtabledelegates.h
|
||||||
|
|
||||||
|
|
||||||
lib_LIBRARIES = libExtraWINGs.a
|
lib_LTLIBRARIES = libExtraWINGs.la
|
||||||
|
|
||||||
noinst_PROGRAMS = test
|
noinst_PROGRAMS = test
|
||||||
|
|
||||||
EXTRA_DIST =
|
EXTRA_DIST =
|
||||||
|
|
||||||
libExtraWINGs_a_SOURCES = \
|
libExtraWINGs_la_SOURCES = \
|
||||||
wtableview.c \
|
wtableview.c \
|
||||||
wtabledelegates.c \
|
wtabledelegates.c \
|
||||||
wtableview.h \
|
wtableview.h \
|
||||||
wtabledelegates.h
|
wtabledelegates.h
|
||||||
|
|
||||||
AM_CFLAGS = @NOSTRICTALIASING@
|
AM_CPPFLAGS = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
|
||||||
|
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
|
|
||||||
@XFTLIBS@ @INTLIBS@
|
@XFTLIBS@ @INTLIBS@
|
||||||
|
|
||||||
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
|
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
|
||||||
|
|
||||||
|
|||||||
@@ -1,140 +1,124 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "wtableview.h"
|
#include "wtableview.h"
|
||||||
#include "wtabledelegates.h"
|
#include "wtabledelegates.h"
|
||||||
|
|
||||||
|
static char *col1[20] = { 0 };
|
||||||
|
|
||||||
static char *col1[20] = {0};
|
|
||||||
static int col2[20];
|
static int col2[20];
|
||||||
|
|
||||||
|
|
||||||
static char *options[] = {
|
static char *options[] = {
|
||||||
"Option1",
|
"Option1",
|
||||||
"Option2",
|
"Option2",
|
||||||
"Option3",
|
"Option3",
|
||||||
"Option4",
|
"Option4",
|
||||||
"Option5"
|
"Option5"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int numberOfRows(WMTableViewDelegate * self, WMTableView * table)
|
||||||
int
|
|
||||||
numberOfRows(WMTableViewDelegate *self, WMTableView *table)
|
|
||||||
{
|
{
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *valueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row)
|
||||||
void*
|
|
||||||
valueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
/*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column);*/
|
/*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column); */
|
||||||
int i;
|
int i;
|
||||||
if (col1[0] == 0) {
|
if (col1[0] == 0) {
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
sprintf(buf, "Test row %i", i);
|
sprintf(buf, "Test row %i", i);
|
||||||
|
|
||||||
col1[i] = wstrdup(buf);
|
col1[i] = wstrdup(buf);
|
||||||
col2[i] = 0;
|
col2[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)WMGetTableColumnId(column) == 1)
|
if ((uintptr_t)WMGetTableColumnId(column) == 1)
|
||||||
return col1[row];
|
return col1[row];
|
||||||
else
|
else
|
||||||
return (void*)col2[row];
|
return (void *)(uintptr_t) col2[row];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setValueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row, void *data)
|
||||||
void
|
|
||||||
setValueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row,
|
|
||||||
void *data)
|
|
||||||
{
|
{
|
||||||
if ((int)WMGetTableColumnId(column) == 1)
|
if ((uintptr_t)WMGetTableColumnId(column) == 1)
|
||||||
col1[row] = data;
|
col1[row] = data;
|
||||||
else
|
else
|
||||||
col2[row] = (int)data;
|
col2[row] = (uintptr_t) data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static WMTableViewDelegate delegate = {
|
static WMTableViewDelegate delegate = {
|
||||||
NULL,
|
NULL,
|
||||||
numberOfRows,
|
numberOfRows,
|
||||||
valueForCell,
|
valueForCell,
|
||||||
setValueForCell
|
setValueForCell
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void clickedTable(WMWidget * w, void *self)
|
||||||
|
|
||||||
void
|
|
||||||
clickedTable(WMWidget *w, void *self)
|
|
||||||
{
|
{
|
||||||
int row = WMGetTableViewClickedRow((WMTableView*)self);
|
int row = WMGetTableViewClickedRow((WMTableView *) self);
|
||||||
|
|
||||||
WMEditTableViewRow(self, row);
|
WMEditTableViewRow(self, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
WMTableColumn *col;
|
WMTableColumn *col;
|
||||||
WMTableColumnDelegate *colDeleg;
|
WMTableColumnDelegate *colDeleg;
|
||||||
|
|
||||||
WMInitializeApplication("test", &argc, argv);
|
WMInitializeApplication("test", &argc, argv);
|
||||||
|
|
||||||
scr = WMOpenScreen(NULL);
|
scr = WMOpenScreen(NULL);
|
||||||
|
|
||||||
XSynchronize(WMScreenDisplay(scr), 1);
|
XSynchronize(WMScreenDisplay(scr), 1);
|
||||||
|
|
||||||
win = WMCreateWindow(scr, "eweq");
|
win = WMCreateWindow(scr, "eweq");
|
||||||
WMResizeWidget(win, 400, 200);
|
WMResizeWidget(win, 400, 200);
|
||||||
WMMapWidget(win);
|
WMMapWidget(win);
|
||||||
|
|
||||||
table = WMCreateTableView(win);
|
table = WMCreateTableView(win);
|
||||||
WMSetTableViewHasHorizontalScroller(table, 0);
|
WMSetTableViewHasHorizontalScroller(table, 0);
|
||||||
WMSetViewExpandsToParent(WMWidgetView(table), 10, 10, 10, 10);
|
WMSetViewExpandsToParent(WMWidgetView(table), 10, 10, 10, 10);
|
||||||
WMSetTableViewBackgroundColor(table, WMWhiteColor(scr));
|
WMSetTableViewBackgroundColor(table, WMWhiteColor(scr));
|
||||||
/*WMSetTableViewGridColor(table, WMGrayColor(scr));*/
|
/*WMSetTableViewGridColor(table, WMGrayColor(scr)); */
|
||||||
WMSetTableViewHeaderHeight(table, 20);
|
WMSetTableViewHeaderHeight(table, 20);
|
||||||
WMSetTableViewDelegate(table, &delegate);
|
WMSetTableViewDelegate(table, &delegate);
|
||||||
WMSetTableViewAction(table, clickedTable, table);
|
WMSetTableViewAction(table, clickedTable, table);
|
||||||
|
|
||||||
colDeleg = WTCreateStringEditorDelegate(table);
|
colDeleg = WTCreateStringEditorDelegate(table);
|
||||||
|
|
||||||
col = WMCreateTableColumn("Group");
|
col = WMCreateTableColumn("Group");
|
||||||
WMSetTableColumnWidth(col, 180);
|
WMSetTableColumnWidth(col, 180);
|
||||||
WMAddTableViewColumn(table, col);
|
WMAddTableViewColumn(table, col);
|
||||||
WMSetTableColumnDelegate(col, colDeleg);
|
WMSetTableColumnDelegate(col, colDeleg);
|
||||||
WMSetTableColumnId(col, (void*)1);
|
WMSetTableColumnId(col, (void *)1);
|
||||||
|
|
||||||
colDeleg = WTCreateEnumSelectorDelegate(table);
|
colDeleg = WTCreateEnumSelectorDelegate(table);
|
||||||
WTSetEnumSelectorOptions(colDeleg, options, 5);
|
WTSetEnumSelectorOptions(colDeleg, options, 5);
|
||||||
|
|
||||||
col = WMCreateTableColumn("Package");
|
col = WMCreateTableColumn("Package");
|
||||||
WMSetTableColumnWidth(col, 140);
|
WMSetTableColumnWidth(col, 140);
|
||||||
WMAddTableViewColumn(table, col);
|
WMAddTableViewColumn(table, col);
|
||||||
WMSetTableColumnDelegate(col, colDeleg);
|
WMSetTableColumnDelegate(col, colDeleg);
|
||||||
WMSetTableColumnId(col, (void*)2);
|
WMSetTableColumnId(col, (void *)2);
|
||||||
|
|
||||||
colDeleg = WTCreateBooleanSwitchDelegate(table);
|
colDeleg = WTCreateBooleanSwitchDelegate(table);
|
||||||
|
|
||||||
col = WMCreateTableColumn("Bool");
|
col = WMCreateTableColumn("Bool");
|
||||||
WMSetTableColumnWidth(col, 50);
|
WMSetTableColumnWidth(col, 50);
|
||||||
WMAddTableViewColumn(table, col);
|
WMAddTableViewColumn(table, col);
|
||||||
WMSetTableColumnDelegate(col, colDeleg);
|
WMSetTableColumnDelegate(col, colDeleg);
|
||||||
WMSetTableColumnId(col, (void*)2);
|
WMSetTableColumnId(col, (void *)2);
|
||||||
|
|
||||||
WMMapWidget(table);
|
WMMapWidget(table);
|
||||||
WMRealizeWidget(win);
|
WMRealizeWidget(win);
|
||||||
WMScreenMainLoop(scr);
|
WMScreenMainLoop(scr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <WINGs/WINGsP.h>
|
#include <WINGs/WINGsP.h>
|
||||||
|
|
||||||
#include "wtableview.h"
|
#include "wtableview.h"
|
||||||
@@ -7,632 +7,516 @@
|
|||||||
#include "wtabledelegates.h"
|
#include "wtabledelegates.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
GC gc;
|
GC gc;
|
||||||
GC selGC;
|
GC selGC;
|
||||||
WMColor *textColor;
|
WMColor *textColor;
|
||||||
} StringData;
|
} StringData;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
GC selGc;
|
GC selGc;
|
||||||
} PixmapData;
|
} PixmapData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WMTextField *widget;
|
WMTextField *widget;
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
GC gc;
|
GC gc;
|
||||||
GC selGC;
|
GC selGC;
|
||||||
WMColor *textColor;
|
WMColor *textColor;
|
||||||
} StringEditorData;
|
} StringEditorData;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WMPopUpButton *widget;
|
WMPopUpButton *widget;
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
char **options;
|
char **options;
|
||||||
int count;
|
int count;
|
||||||
GC gc;
|
GC gc;
|
||||||
GC selGC;
|
GC selGC;
|
||||||
WMColor *textColor;
|
WMColor *textColor;
|
||||||
} EnumSelectorData;
|
} EnumSelectorData;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
WMButton *widget;
|
WMButton *widget;
|
||||||
WMTableView *table;
|
WMTableView *table;
|
||||||
Bool state;
|
Bool state;
|
||||||
GC gc;
|
GC gc;
|
||||||
GC selGC;
|
GC selGC;
|
||||||
} BooleanSwitchData;
|
} BooleanSwitchData;
|
||||||
|
|
||||||
|
|
||||||
static char *SelectionColor = "#bbbbcc";
|
static char *SelectionColor = "#bbbbcc";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, WMColor *textColor,
|
stringDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMColor * textColor,
|
||||||
WMFont *font, void *data, WMRect rect, Bool selected)
|
WMFont * font, void *data, WMRect rect, Bool selected)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
XRectangle rects[1];
|
XRectangle rects[1];
|
||||||
Display *dpy = WMScreenDisplay(scr);
|
Display *dpy = WMScreenDisplay(scr);
|
||||||
|
|
||||||
x = rect.pos.x + 5;
|
x = rect.pos.x + 5;
|
||||||
y = rect.pos.y + (rect.size.height - WMFontHeight(font))/2;
|
y = rect.pos.y + (rect.size.height - WMFontHeight(font)) / 2;
|
||||||
|
|
||||||
rects[0].x = rect.pos.x+1;
|
rects[0].x = rect.pos.x + 1;
|
||||||
rects[0].y = rect.pos.y+1;
|
rects[0].y = rect.pos.y + 1;
|
||||||
rects[0].width = rect.size.width-1;
|
rects[0].width = rect.size.width - 1;
|
||||||
rects[0].height = rect.size.height-1;
|
rects[0].height = rect.size.height - 1;
|
||||||
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
|
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
|
||||||
|
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
XFillRectangles(dpy, d, gc, rects, 1);
|
XFillRectangles(dpy, d, gc, rects, 1);
|
||||||
|
|
||||||
WMDrawString(scr, d, textColor, font, x, y,
|
WMDrawString(scr, d, textColor, font, x, y, data, strlen(data));
|
||||||
data, strlen(data));
|
} else {
|
||||||
} else {
|
XFillRectangles(dpy, d, sgc, rects, 1);
|
||||||
XFillRectangles(dpy, d, sgc, rects, 1);
|
|
||||||
|
|
||||||
WMDrawString(scr, d, textColor, font, x, y,
|
WMDrawString(scr, d, textColor, font, x, y, data, strlen(data));
|
||||||
data, strlen(data));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
XSetClipMask(dpy, gc, None);
|
XSetClipMask(dpy, gc, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void pixmapDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMPixmap * pixmap, WMRect rect, Bool selected)
|
||||||
|
|
||||||
static void
|
|
||||||
pixmapDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, WMPixmap *pixmap,
|
|
||||||
WMRect rect, Bool selected)
|
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
XRectangle rects[1];
|
XRectangle rects[1];
|
||||||
Display *dpy = WMScreenDisplay(scr);
|
Display *dpy = WMScreenDisplay(scr);
|
||||||
WMSize size;
|
WMSize size;
|
||||||
|
|
||||||
rects[0].x = rect.pos.x+1;
|
rects[0].x = rect.pos.x + 1;
|
||||||
rects[0].y = rect.pos.y+1;
|
rects[0].y = rect.pos.y + 1;
|
||||||
rects[0].width = rect.size.width-1;
|
rects[0].width = rect.size.width - 1;
|
||||||
rects[0].height = rect.size.height-1;
|
rects[0].height = rect.size.height - 1;
|
||||||
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
|
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
|
||||||
|
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
XFillRectangles(dpy, d, gc, rects, 1);
|
XFillRectangles(dpy, d, gc, rects, 1);
|
||||||
|
|
||||||
if (pixmap) {
|
if (pixmap) {
|
||||||
size = WMGetPixmapSize(pixmap);
|
size = WMGetPixmapSize(pixmap);
|
||||||
x = rect.pos.x + (rect.size.width - size.width) / 2;
|
x = rect.pos.x + (rect.size.width - size.width) / 2;
|
||||||
y = rect.pos.y + (rect.size.height - size.height) / 2;
|
y = rect.pos.y + (rect.size.height - size.height) / 2;
|
||||||
|
|
||||||
WMDrawPixmap(pixmap, d, x, y);
|
WMDrawPixmap(pixmap, d, x, y);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
XFillRectangles(dpy, d, sgc, rects, 1);
|
XFillRectangles(dpy, d, sgc, rects, 1);
|
||||||
|
|
||||||
if (pixmap) {
|
if (pixmap) {
|
||||||
size = WMGetPixmapSize(pixmap);
|
size = WMGetPixmapSize(pixmap);
|
||||||
x = rect.pos.x + (rect.size.width - size.width) / 2;
|
x = rect.pos.x + (rect.size.width - size.width) / 2;
|
||||||
y = rect.pos.y + (rect.size.height - size.height) / 2;
|
y = rect.pos.y + (rect.size.height - size.height) / 2;
|
||||||
|
|
||||||
WMDrawPixmap(pixmap, d, x, y);
|
WMDrawPixmap(pixmap, d, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XSetClipMask(dpy, gc, None);
|
XSetClipMask(dpy, gc, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void SECellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
|
|
||||||
static void
|
|
||||||
SECellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringEditorData *strdata = (StringEditorData*)self->data;
|
StringEditorData *strdata = (StringEditorData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
WMTableViewDataForCell(table, column, row),
|
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), False);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedSECellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedSECellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringEditorData *strdata = (StringEditorData*)self->data;
|
StringEditorData *strdata = (StringEditorData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
WMTableViewDataForCell(table, column, row),
|
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), True);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void beginSECellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
static void
|
|
||||||
beginSECellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
StringEditorData *strdata = (StringEditorData*)self->data;
|
StringEditorData *strdata = (StringEditorData *) self->data;
|
||||||
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
||||||
void *data = WMTableViewDataForCell(strdata->table, column, row);
|
void *data = WMTableViewDataForCell(strdata->table, column, row);
|
||||||
|
|
||||||
WMSetTextFieldText(strdata->widget, (char*)data);
|
WMSetTextFieldText(strdata->widget, (char *)data);
|
||||||
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
|
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
|
||||||
WMResizeWidget(strdata->widget, rect.size.width+1, rect.size.height+1);
|
WMResizeWidget(strdata->widget, rect.size.width + 1, rect.size.height + 1);
|
||||||
|
|
||||||
WMMapWidget(strdata->widget);
|
WMMapWidget(strdata->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void endSECellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
static void
|
|
||||||
endSECellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
StringEditorData *strdata = (StringEditorData*)self->data;
|
StringEditorData *strdata = (StringEditorData *) self->data;
|
||||||
char *text;
|
char *text;
|
||||||
|
|
||||||
WMUnmapWidget(strdata->widget);
|
WMUnmapWidget(strdata->widget);
|
||||||
|
|
||||||
text = WMGetTextFieldText(strdata->widget);
|
text = WMGetTextFieldText(strdata->widget);
|
||||||
WMSetTableViewDataForCell(strdata->table, column, row, (void*)text);
|
WMSetTableViewDataForCell(strdata->table, column, row, (void *)text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView * parent)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreateStringEditorDelegate(WMTableView *parent)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(parent);
|
WMScreen *scr = WMWidgetScreen(parent);
|
||||||
StringEditorData *data = wmalloc(sizeof(StringEditorData));
|
StringEditorData *data = wmalloc(sizeof(StringEditorData));
|
||||||
|
|
||||||
data->widget = WMCreateTextField(parent);
|
data->widget = WMCreateTextField(parent);
|
||||||
W_ReparentView(WMWidgetView(data->widget),
|
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
|
||||||
WMGetTableViewDocumentView(parent),
|
data->table = parent;
|
||||||
0, 0);
|
data->font = WMSystemFontOfSize(scr, 12);
|
||||||
data->table = parent;
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->font = WMSystemFontOfSize(scr, 12);
|
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->textColor = WMBlackColor(scr);
|
||||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
|
||||||
data->textColor = WMBlackColor(scr);
|
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = SECellPainter;
|
delegate->drawCell = SECellPainter;
|
||||||
delegate->drawSelectedCell = selectedSECellPainter;
|
delegate->drawSelectedCell = selectedSECellPainter;
|
||||||
delegate->beginCellEdit = beginSECellEdit;
|
delegate->beginCellEdit = beginSECellEdit;
|
||||||
delegate->endCellEdit = endSECellEdit;
|
delegate->endCellEdit = endSECellEdit;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void ESCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
ESCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
|
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
strdata->options[i],
|
strdata->options[i], WMTableViewRectForCell(table, column, row), False);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedESCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedESCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
|
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
strdata->options[i],
|
strdata->options[i], WMTableViewRectForCell(table, column, row), True);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void beginESCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
static void
|
|
||||||
beginESCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
|
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
|
||||||
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
||||||
int data = (int)WMTableViewDataForCell(strdata->table, column, row);
|
uintptr_t data = (uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
|
||||||
|
|
||||||
wassertr(data < strdata->count);
|
wassertr(data < strdata->count);
|
||||||
|
|
||||||
WMSetPopUpButtonSelectedItem(strdata->widget, data);
|
WMSetPopUpButtonSelectedItem(strdata->widget, data);
|
||||||
|
|
||||||
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
|
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
|
||||||
WMResizeWidget(strdata->widget, rect.size.width, rect.size.height+1);
|
WMResizeWidget(strdata->widget, rect.size.width, rect.size.height + 1);
|
||||||
|
|
||||||
WMMapWidget(strdata->widget);
|
WMMapWidget(strdata->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void endESCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
static void
|
|
||||||
endESCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
|
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
WMUnmapWidget(strdata->widget);
|
WMUnmapWidget(strdata->widget);
|
||||||
|
|
||||||
option = WMGetPopUpButtonSelectedItem(strdata->widget);
|
option = WMGetPopUpButtonSelectedItem(strdata->widget);
|
||||||
WMSetTableViewDataForCell(strdata->table, column, row, (void*)option);
|
WMSetTableViewDataForCell(strdata->table, column, row, (void *)(uintptr_t) option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView * parent)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreateEnumSelectorDelegate(WMTableView *parent)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(parent);
|
WMScreen *scr = WMWidgetScreen(parent);
|
||||||
EnumSelectorData *data = wmalloc(sizeof(EnumSelectorData));
|
EnumSelectorData *data = wmalloc(sizeof(EnumSelectorData));
|
||||||
|
|
||||||
data->widget = WMCreatePopUpButton(parent);
|
data->widget = WMCreatePopUpButton(parent);
|
||||||
W_ReparentView(WMWidgetView(data->widget),
|
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
|
||||||
WMGetTableViewDocumentView(parent),
|
data->table = parent;
|
||||||
0, 0);
|
data->font = WMSystemFontOfSize(scr, 12);
|
||||||
data->table = parent;
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->font = WMSystemFontOfSize(scr, 12);
|
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->textColor = WMBlackColor(scr);
|
||||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
data->count = 0;
|
||||||
data->textColor = WMBlackColor(scr);
|
data->options = NULL;
|
||||||
data->count = 0;
|
|
||||||
data->options = NULL;
|
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = ESCellPainter;
|
delegate->drawCell = ESCellPainter;
|
||||||
delegate->drawSelectedCell = selectedESCellPainter;
|
delegate->drawSelectedCell = selectedESCellPainter;
|
||||||
delegate->beginCellEdit = beginESCellEdit;
|
delegate->beginCellEdit = beginESCellEdit;
|
||||||
delegate->endCellEdit = endESCellEdit;
|
delegate->endCellEdit = endESCellEdit;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WTSetEnumSelectorOptions(WMTableColumnDelegate * delegate, char **options, int count)
|
||||||
void
|
|
||||||
WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate, char **options,
|
|
||||||
int count)
|
|
||||||
{
|
{
|
||||||
EnumSelectorData *data = (EnumSelectorData*)delegate->data;
|
EnumSelectorData *data = (EnumSelectorData *) delegate->data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0; i < WMGetPopUpButtonNumberOfItems(data->widget); i++) {
|
||||||
i < WMGetPopUpButtonNumberOfItems(data->widget);
|
WMRemovePopUpButtonItem(data->widget, 0);
|
||||||
i++) {
|
}
|
||||||
WMRemovePopUpButtonItem(data->widget, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
data->options = options;
|
data->options = options;
|
||||||
data->count = count;
|
data->count = count;
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
WMAddPopUpButtonItem(data->widget, options[i]);
|
WMAddPopUpButtonItem(data->widget, options[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
static void BSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
BSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
|
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
|
||||||
WMScreen *scr = WMWidgetScreen(table);
|
WMScreen *scr = WMWidgetScreen(table);
|
||||||
|
|
||||||
if (i) {
|
if (i) {
|
||||||
pixmapDraw(scr, d,
|
pixmapDraw(scr, d,
|
||||||
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
|
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
|
||||||
WMTableViewRectForCell(table, column, row), False);
|
WMTableViewRectForCell(table, column, row), False);
|
||||||
} else {
|
} else {
|
||||||
pixmapDraw(scr, d,
|
pixmapDraw(scr, d,
|
||||||
strdata->gc, strdata->selGC, NULL,
|
strdata->gc, strdata->selGC, NULL, WMTableViewRectForCell(table, column, row), False);
|
||||||
WMTableViewRectForCell(table, column, row), False);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedBSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedBSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
|
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
|
||||||
WMScreen *scr = WMWidgetScreen(table);
|
WMScreen *scr = WMWidgetScreen(table);
|
||||||
|
|
||||||
if (i) {
|
if (i) {
|
||||||
pixmapDraw(scr, d,
|
pixmapDraw(scr, d,
|
||||||
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
|
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
|
||||||
WMTableViewRectForCell(table, column, row), True);
|
WMTableViewRectForCell(table, column, row), True);
|
||||||
} else {
|
} else {
|
||||||
pixmapDraw(scr, d,
|
pixmapDraw(scr, d,
|
||||||
strdata->gc, strdata->selGC, NULL,
|
strdata->gc, strdata->selGC, NULL, WMTableViewRectForCell(table, column, row), True);
|
||||||
WMTableViewRectForCell(table, column, row), True);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void beginBSCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
|
|
||||||
static void
|
|
||||||
beginBSCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
|
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
|
||||||
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
|
||||||
int data = (int)WMTableViewDataForCell(strdata->table, column, row);
|
uintptr_t data = (uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
|
||||||
|
|
||||||
WMSetButtonSelected(strdata->widget, data);
|
WMSetButtonSelected(strdata->widget, data);
|
||||||
WMMoveWidget(strdata->widget, rect.pos.x+1, rect.pos.y+1);
|
WMMoveWidget(strdata->widget, rect.pos.x + 1, rect.pos.y + 1);
|
||||||
WMResizeWidget(strdata->widget, rect.size.width-1, rect.size.height-1);
|
WMResizeWidget(strdata->widget, rect.size.width - 1, rect.size.height - 1);
|
||||||
|
|
||||||
WMMapWidget(strdata->widget);
|
WMMapWidget(strdata->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void endBSCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
|
||||||
static void
|
|
||||||
endBSCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
|
|
||||||
{
|
{
|
||||||
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
|
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
value = WMGetButtonSelected(strdata->widget);
|
value = WMGetButtonSelected(strdata->widget);
|
||||||
WMSetTableViewDataForCell(strdata->table, column, row, (void*)value);
|
WMSetTableViewDataForCell(strdata->table, column, row, (void *)(uintptr_t) value);
|
||||||
WMUnmapWidget(strdata->widget);
|
WMUnmapWidget(strdata->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView * parent)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreateBooleanSwitchDelegate(WMTableView *parent)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(parent);
|
WMScreen *scr = WMWidgetScreen(parent);
|
||||||
BooleanSwitchData *data = wmalloc(sizeof(BooleanSwitchData));
|
BooleanSwitchData *data = wmalloc(sizeof(BooleanSwitchData));
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|
||||||
data->widget = WMCreateSwitchButton(parent);
|
data->widget = WMCreateSwitchButton(parent);
|
||||||
W_ReparentView(WMWidgetView(data->widget),
|
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
|
||||||
WMGetTableViewDocumentView(parent),
|
WMSetButtonText(data->widget, NULL);
|
||||||
0, 0);
|
WMSetButtonImagePosition(data->widget, WIPImageOnly);
|
||||||
WMSetButtonText(data->widget, NULL);
|
WMSetButtonImage(data->widget, NULL);
|
||||||
WMSetButtonImagePosition(data->widget, WIPImageOnly);
|
WMSetButtonAltImage(data->widget, WMGetSystemPixmap(scr, WSICheckMark));
|
||||||
WMSetButtonImage(data->widget, NULL);
|
|
||||||
WMSetButtonAltImage(data->widget, WMGetSystemPixmap(scr, WSICheckMark));
|
|
||||||
|
|
||||||
data->table = parent;
|
data->table = parent;
|
||||||
color = WMCreateNamedColor(scr, SelectionColor, False);
|
color = WMCreateNamedColor(scr, SelectionColor, False);
|
||||||
WMSetWidgetBackgroundColor(data->widget, color);
|
WMSetWidgetBackgroundColor(data->widget, color);
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->selGC = WMColorGC(color);
|
data->selGC = WMColorGC(color);
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = BSCellPainter;
|
delegate->drawCell = BSCellPainter;
|
||||||
delegate->drawSelectedCell = selectedBSCellPainter;
|
delegate->drawSelectedCell = selectedBSCellPainter;
|
||||||
delegate->beginCellEdit = beginBSCellEdit;
|
delegate->beginCellEdit = beginBSCellEdit;
|
||||||
delegate->endCellEdit = endBSCellEdit;
|
delegate->endCellEdit = endBSCellEdit;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void SCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
SCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringData *strdata = (StringData*)self->data;
|
StringData *strdata = (StringData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
WMTableViewDataForCell(table, column, row),
|
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), False);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringData *strdata = (StringData*)self->data;
|
StringData *strdata = (StringData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d,
|
stringDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||||
WMTableViewDataForCell(table, column, row),
|
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), True);
|
||||||
WMTableViewRectForCell(table, column, row),
|
|
||||||
True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreateStringDelegate(WMTableView * parent)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreateStringDelegate(WMTableView *parent)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(parent);
|
WMScreen *scr = WMWidgetScreen(parent);
|
||||||
StringData *data = wmalloc(sizeof(StringData));
|
StringData *data = wmalloc(sizeof(StringData));
|
||||||
|
|
||||||
data->table = parent;
|
data->table = parent;
|
||||||
data->font = WMSystemFontOfSize(scr, 12);
|
data->font = WMSystemFontOfSize(scr, 12);
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||||
data->textColor = WMBlackColor(scr);
|
data->textColor = WMBlackColor(scr);
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = SCellPainter;
|
delegate->drawCell = SCellPainter;
|
||||||
delegate->drawSelectedCell = selectedSCellPainter;
|
delegate->drawSelectedCell = selectedSCellPainter;
|
||||||
delegate->beginCellEdit = NULL;
|
delegate->beginCellEdit = NULL;
|
||||||
delegate->endCellEdit = NULL;
|
delegate->endCellEdit = NULL;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void PCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
PCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringData *strdata = (StringData*)self->data;
|
StringData *strdata = (StringData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
pixmapDraw(WMWidgetScreen(table), d,
|
pixmapDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC,
|
strdata->gc, strdata->selGC,
|
||||||
(WMPixmap*)WMTableViewDataForCell(table, column, row),
|
(WMPixmap *) WMTableViewDataForCell(table, column, row),
|
||||||
WMTableViewRectForCell(table, column, row),
|
WMTableViewRectForCell(table, column, row), False);
|
||||||
False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedPCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedPCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
StringData *strdata = (StringData*)self->data;
|
StringData *strdata = (StringData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
|
|
||||||
pixmapDraw(WMWidgetScreen(table), d,
|
pixmapDraw(WMWidgetScreen(table), d,
|
||||||
strdata->gc, strdata->selGC,
|
strdata->gc, strdata->selGC,
|
||||||
(WMPixmap*)WMTableViewDataForCell(table, column, row),
|
(WMPixmap *) WMTableViewDataForCell(table, column, row),
|
||||||
WMTableViewRectForCell(table, column, row),
|
WMTableViewRectForCell(table, column, row), True);
|
||||||
True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView * table)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreatePixmapDelegate(WMTableView *table)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(table);
|
WMScreen *scr = WMWidgetScreen(table);
|
||||||
StringData *data = wmalloc(sizeof(StringData));
|
StringData *data = wmalloc(sizeof(StringData));
|
||||||
|
|
||||||
data->table = table;
|
data->table = table;
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = PCellPainter;
|
delegate->drawCell = PCellPainter;
|
||||||
delegate->drawSelectedCell = selectedPCellPainter;
|
delegate->drawSelectedCell = selectedPCellPainter;
|
||||||
delegate->beginCellEdit = NULL;
|
delegate->beginCellEdit = NULL;
|
||||||
delegate->endCellEdit = NULL;
|
delegate->endCellEdit = NULL;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void drawPSCell(WMTableColumnDelegate * self, Drawable d, WMTableColumn * column, int row, Bool selected)
|
||||||
static void
|
|
||||||
drawPSCell(WMTableColumnDelegate *self, Drawable d, WMTableColumn *column,
|
|
||||||
int row, Bool selected)
|
|
||||||
{
|
{
|
||||||
StringData *strdata = (StringData*)self->data;
|
StringData *strdata = (StringData *) self->data;
|
||||||
WMTableView *table = WMGetTableColumnTableView(column);
|
WMTableView *table = WMGetTableColumnTableView(column);
|
||||||
void **data;
|
void **data;
|
||||||
WMPixmap *pix;
|
WMPixmap *pix;
|
||||||
char *str;
|
char *str;
|
||||||
WMRect rect;
|
WMRect rect;
|
||||||
WMSize size;
|
WMSize size;
|
||||||
|
|
||||||
data = WMTableViewDataForCell(table, column, row);
|
data = WMTableViewDataForCell(table, column, row);
|
||||||
|
|
||||||
str = (char*)data[0];
|
str = (char *)data[0];
|
||||||
pix = (WMPixmap*)data[1];
|
pix = (WMPixmap *) data[1];
|
||||||
|
|
||||||
rect = WMTableViewRectForCell(table, column, row);
|
rect = WMTableViewRectForCell(table, column, row);
|
||||||
|
|
||||||
if (pix) {
|
if (pix) {
|
||||||
int owidth = rect.size.width;
|
int owidth = rect.size.width;
|
||||||
|
|
||||||
size = WMGetPixmapSize(pix);
|
size = WMGetPixmapSize(pix);
|
||||||
rect.size.width = size.width;
|
rect.size.width = size.width;
|
||||||
|
|
||||||
pixmapDraw(WMWidgetScreen(table),
|
pixmapDraw(WMWidgetScreen(table),
|
||||||
WMViewXID(WMGetTableViewDocumentView(table)),
|
WMViewXID(WMGetTableViewDocumentView(table)),
|
||||||
strdata->gc, strdata->selGC, pix, rect,
|
strdata->gc, strdata->selGC, pix, rect, selected);
|
||||||
selected);
|
|
||||||
|
|
||||||
rect.pos.x += size.width-1;
|
rect.pos.x += size.width - 1;
|
||||||
rect.size.width = owidth-size.width+1;
|
rect.size.width = owidth - size.width + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
|
stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
|
||||||
strdata->textColor, strdata->font, str, rect, selected);
|
strdata->textColor, strdata->font, str, rect, selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void PSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
PSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
drawPSCell(self, d, column, row, False);
|
drawPSCell(self, d, column, row, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void selectedPSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
|
||||||
static void
|
|
||||||
selectedPSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
|
|
||||||
int row, Drawable d)
|
|
||||||
{
|
{
|
||||||
drawPSCell(self, d, column, row, True);
|
drawPSCell(self, d, column, row, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView * parent)
|
||||||
WMTableColumnDelegate*
|
|
||||||
WTCreatePixmapStringDelegate(WMTableView *parent)
|
|
||||||
{
|
{
|
||||||
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
|
||||||
WMScreen *scr = WMWidgetScreen(parent);
|
WMScreen *scr = WMWidgetScreen(parent);
|
||||||
StringData *data = wmalloc(sizeof(StringData));
|
StringData *data = wmalloc(sizeof(StringData));
|
||||||
|
|
||||||
data->table = parent;
|
data->table = parent;
|
||||||
data->font = WMSystemFontOfSize(scr, 12);
|
data->font = WMSystemFontOfSize(scr, 12);
|
||||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||||
data->textColor = WMBlackColor(scr);
|
data->textColor = WMBlackColor(scr);
|
||||||
|
|
||||||
delegate->data = data;
|
delegate->data = data;
|
||||||
delegate->drawCell = PSCellPainter;
|
delegate->drawCell = PSCellPainter;
|
||||||
delegate->drawSelectedCell = selectedPSCellPainter;
|
delegate->drawSelectedCell = selectedPSCellPainter;
|
||||||
delegate->beginCellEdit = NULL;
|
delegate->beginCellEdit = NULL;
|
||||||
delegate->endCellEdit = NULL;
|
delegate->endCellEdit = NULL;
|
||||||
|
|
||||||
return delegate;
|
return delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +1,32 @@
|
|||||||
## automake input file for WINGs
|
## automake input file for WINGs
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
SUBDIRS = WINGs . po Documentation Resources Examples Extras Tests
|
SUBDIRS = WINGs . po Documentation Resources
|
||||||
|
|
||||||
|
libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@
|
||||||
|
libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
|
||||||
#libWINGs_la_LDFLAGS = -version-info 1:1:0
|
|
||||||
|
|
||||||
bin_SCRIPTS = get-wings-flags get-wutil-flags
|
bin_SCRIPTS = get-wings-flags get-wutil-flags
|
||||||
|
|
||||||
lib_LIBRARIES = libWINGs.a libWUtil.a
|
lib_LTLIBRARIES = libWUtil.la libWINGs.la
|
||||||
|
|
||||||
|
|
||||||
LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
||||||
|
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@
|
||||||
|
libWUtil_la_LIBADD = @LIBBSD@
|
||||||
|
|
||||||
|
EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags.in
|
||||||
EXTRA_DIST = BUGS make-rgb python/Makefile python/README python/WINGs.i \
|
|
||||||
python/WINGs.py python/setup.py python/test.py
|
|
||||||
|
|
||||||
|
|
||||||
# wbutton.c
|
# wbutton.c
|
||||||
libWINGs_a_SOURCES = \
|
libWINGs_la_SOURCES = \
|
||||||
array.c \
|
|
||||||
bagtree.c \
|
|
||||||
configuration.c \
|
configuration.c \
|
||||||
connection.c \
|
|
||||||
data.c \
|
|
||||||
dragcommon.c \
|
dragcommon.c \
|
||||||
dragdestination.c \
|
dragdestination.c \
|
||||||
dragsource.c \
|
dragsource.c \
|
||||||
error.c \
|
|
||||||
findfile.c \
|
|
||||||
handlers.c \
|
|
||||||
hashtable.c \
|
|
||||||
host.c \
|
|
||||||
international.c \
|
|
||||||
memory.c \
|
|
||||||
misc.c \
|
|
||||||
notification.c \
|
|
||||||
proplist.c \
|
|
||||||
rgb.h \
|
rgb.h \
|
||||||
selection.c \
|
selection.c \
|
||||||
snprintf.c \
|
|
||||||
string.c \
|
|
||||||
tree.c \
|
|
||||||
userdefaults.c \
|
|
||||||
usleep.c \
|
|
||||||
wapplication.c \
|
|
||||||
wappresource.c \
|
wappresource.c \
|
||||||
wballoon.c \
|
wballoon.c \
|
||||||
wbox.c \
|
wbox.c \
|
||||||
@@ -83,47 +62,76 @@ libWINGs_a_SOURCES = \
|
|||||||
wview.c \
|
wview.c \
|
||||||
wwindow.c
|
wwindow.c
|
||||||
|
|
||||||
|
libWUtil_la_SOURCES = \
|
||||||
libWUtil_a_SOURCES = \
|
|
||||||
array.c \
|
array.c \
|
||||||
bagtree.c \
|
bagtree.c \
|
||||||
connection.c \
|
|
||||||
data.c \
|
data.c \
|
||||||
error.c \
|
error.c \
|
||||||
|
error.h \
|
||||||
findfile.c \
|
findfile.c \
|
||||||
handlers.c \
|
handlers.c \
|
||||||
hashtable.c \
|
hashtable.c \
|
||||||
host.c \
|
|
||||||
international.c \
|
|
||||||
memory.c \
|
memory.c \
|
||||||
|
menuparser.c \
|
||||||
|
menuparser.h \
|
||||||
|
menuparser_macros.c \
|
||||||
misc.c \
|
misc.c \
|
||||||
notification.c \
|
notification.c \
|
||||||
proplist.c \
|
proplist.c \
|
||||||
snprintf.c \
|
|
||||||
string.c \
|
string.c \
|
||||||
tree.c \
|
tree.c \
|
||||||
userdefaults.c \
|
userdefaults.c \
|
||||||
|
userdefaults.h \
|
||||||
usleep.c \
|
usleep.c \
|
||||||
wapplication.c \
|
wapplication.c \
|
||||||
wconfig.h \
|
wconfig.h \
|
||||||
wutil.c
|
wutil.c
|
||||||
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(datadir)/WINGs\" -DDEBUG
|
AM_CFLAGS =
|
||||||
|
|
||||||
AM_CFLAGS = @NOSTRICTALIASING@
|
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
|
||||||
|
-I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
||||||
INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
|
||||||
@XFTFLAGS@ @HEADER_SEARCH_PATH@
|
@XFTFLAGS@ @HEADER_SEARCH_PATH@
|
||||||
|
|
||||||
DISTCLEANFILES = WINGs.pc
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = WINGs.pc WUtil.pc
|
||||||
|
|
||||||
|
DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags get-wutil-flags
|
||||||
|
|
||||||
|
WINGs.pc: Makefile
|
||||||
|
@echo "Generating $@"
|
||||||
|
@echo 'Name: WINGs' > $@
|
||||||
|
@echo 'Description: Small widget set with the NeXTStep(TM) look and feel' >> $@
|
||||||
|
@echo 'Version: $(VERSION)' >> $@
|
||||||
|
@echo 'Requires: wrlib WUtil' >> $@
|
||||||
|
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
|
||||||
|
@echo 'Libs.private: $(XFTLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
|
||||||
|
@echo 'Cflags: $(inc_search_path)' >> $@
|
||||||
|
|
||||||
|
get-wings-flags: get-wings-flags.in Makefile
|
||||||
|
@echo "Generating $@"
|
||||||
|
@$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \
|
||||||
|
-e 's#$${lib_search_path}#$(lib_search_path)#;' \
|
||||||
|
-e 's#$${GFXLIBS}#$(GFXLIBS)#;' \
|
||||||
|
-e 's#$${XFTLIBS}#$(XFTLIBS)#;' \
|
||||||
|
-e 's#$${INTLIBS}#$(INTLIBS)#;' \
|
||||||
|
-e 's#$${XLIBS}#$(XLIBS)#;' < $(abs_srcdir)/get-wings-flags.in > $@
|
||||||
|
@chmod 755 $@
|
||||||
|
|
||||||
|
WUtil.pc: Makefile
|
||||||
|
@echo "Generating $@"
|
||||||
|
@echo 'Name: WUtil' > $@
|
||||||
|
@echo 'Description: Utility library for WINGs' >> $@
|
||||||
|
@echo 'Version: $(VERSION)' >> $@
|
||||||
|
@echo 'Libs: -L$(libdir) -lWUtil' >> $@
|
||||||
|
@echo 'Libs.private: $(INTLIBS)' >> $@
|
||||||
|
@echo 'Cflags: -I$(includedir)' >> $@
|
||||||
|
|
||||||
|
get-wutil-flags: get-wutil-flags.in Makefile
|
||||||
|
@echo "Generating $@"
|
||||||
|
@$(SED) -e 's#$${includedir}#$(includedir)#;' \
|
||||||
|
-e 's#$${libdir}#$(libdir)#;' \
|
||||||
|
-e 's#$${INTLIBS}#$(INTLIBS)#;' < $(abs_srcdir)/get-wutil-flags.in > $@
|
||||||
|
@chmod 755 $@
|
||||||
|
|
||||||
install-exec-local:
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(libdir)/pkgconfig
|
|
||||||
@list='WINGs.pc'; for p in $$list; do \
|
|
||||||
if test -f $$p; then \
|
|
||||||
echo "$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/pkgconfig/"; \
|
|
||||||
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/pkgconfig/; \
|
|
||||||
else :; fi; \
|
|
||||||
done
|
|
||||||
|
|||||||
174
WINGs/NEWS
174
WINGs/NEWS
@@ -1,3 +1,177 @@
|
|||||||
|
** API and ABI modifications since wmaker 0.92.0
|
||||||
|
|
||||||
|
** libWINGs **
|
||||||
|
<WINGsP.h>
|
||||||
|
struct W_DragDestinationInfo: new members added SIZE CHANGE
|
||||||
|
|
||||||
|
<WINGs.h>
|
||||||
|
WMGetTextFieldCursorPosition ADDED
|
||||||
|
WC_Matrix REMOVED from enum.
|
||||||
|
WMCreateProgressIndicator REMOVED
|
||||||
|
WMSetProgressIndicatorMinValue REMOVED
|
||||||
|
WMSetProgressIndicatorMaxValue REMOVED
|
||||||
|
WMSetProgressIndicatorValue REMOVED
|
||||||
|
WMGetProgressIndicatorMinValue REMOVED
|
||||||
|
WMGetProgressIndicatorMaxValue REMOVED
|
||||||
|
WMGetProgressIndicatorValue REMOVED
|
||||||
|
typedef struct W_Ruler WMRuler REMOVED
|
||||||
|
typedef struct WMRulerMargins REMOVED
|
||||||
|
WMAppendTextBlock REMOVED
|
||||||
|
WMAppendTextStream REMOVED
|
||||||
|
WMCreateRuler REMOVED
|
||||||
|
WMCreateTextBlockWithObject REMOVED
|
||||||
|
WMCreateTextBlockWithPixmap REMOVED
|
||||||
|
WMCreateTextBlockWithText REMOVED
|
||||||
|
WMCreateTextForDocumentType REMOVED
|
||||||
|
WMDestroyTextBlock REMOVED
|
||||||
|
WMFindInTextStream REMOVED
|
||||||
|
WMFreezeText REMOVED
|
||||||
|
WMGetGrabbedRulerMargin REMOVED
|
||||||
|
WMGetReleasedRulerMargin REMOVED
|
||||||
|
WMGetRulerMargins REMOVED
|
||||||
|
WMGetRulerOffset REMOVED
|
||||||
|
WMGetTextBlockProperties REMOVED
|
||||||
|
WMGetTextDefaultColor REMOVED
|
||||||
|
WMGetTextDefaultFont REMOVED
|
||||||
|
WMGetTextEditable REMOVED
|
||||||
|
WMGetTextIgnoresNewline REMOVED
|
||||||
|
WMGetTextInsertType REMOVED
|
||||||
|
WMGetTextObjects REMOVED
|
||||||
|
WMGetTextRulerShown REMOVED
|
||||||
|
WMGetTextSelectedObjects REMOVED
|
||||||
|
WMGetTextSelectedStream REMOVED
|
||||||
|
WMGetTextSelectionColor REMOVED
|
||||||
|
WMGetTextSelectionFont REMOVED
|
||||||
|
WMGetTextSelectionUnderlined REMOVED
|
||||||
|
WMGetTextStream REMOVED
|
||||||
|
WMGetTextUsesMonoFont REMOVED
|
||||||
|
WMIsMarginEqualToMargin REMOVED
|
||||||
|
WMPageText REMOVED
|
||||||
|
WMPrependTextBlock REMOVED
|
||||||
|
WMPrependTextStream REMOVED
|
||||||
|
WMRemoveTextBlock REMOVED
|
||||||
|
WMReplaceTextSelection REMOVED
|
||||||
|
WMScrollText REMOVED
|
||||||
|
WMSetRulerMargins REMOVED
|
||||||
|
WMSetRulerMoveAction REMOVED
|
||||||
|
WMSetRulerOffset REMOVED
|
||||||
|
WMSetRulerReleaseAction REMOVED
|
||||||
|
WMSetTextAlignment REMOVED
|
||||||
|
WMSetTextBackgroundColor REMOVED
|
||||||
|
WMSetTextBackgroundPixmap REMOVED
|
||||||
|
WMSetTextBlockProperties REMOVED
|
||||||
|
WMSetTextDefaultColor REMOVED
|
||||||
|
WMSetTextDefaultFont REMOVED
|
||||||
|
WMSetTextDelegate REMOVED
|
||||||
|
WMSetTextEditable REMOVED
|
||||||
|
WMSetTextForegroundColor REMOVED
|
||||||
|
WMSetTextHasHorizontalScroller REMOVED
|
||||||
|
WMSetTextHasRuler REMOVED
|
||||||
|
WMSetTextHasVerticalScroller REMOVED
|
||||||
|
WMSetTextIgnoresNewline REMOVED
|
||||||
|
WMSetTextIndentNewLines REMOVED
|
||||||
|
WMSetTextRelief REMOVED
|
||||||
|
WMSetTextSelectionColor REMOVED
|
||||||
|
WMSetTextSelectionFont REMOVED
|
||||||
|
WMSetTextSelectionUnderlined REMOVED
|
||||||
|
WMSetTextUsesMonoFont REMOVED
|
||||||
|
WMShowTextRuler REMOVED
|
||||||
|
WMThawText REMOVED
|
||||||
|
WMRefreshText REMOVED
|
||||||
|
WMCreateText REMOVED
|
||||||
|
WMClearText REMOVED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
** libWutil **
|
||||||
|
enum WMConnectionState REMOVED
|
||||||
|
enum WMConnectionTimeoutState REMOVED
|
||||||
|
struct ConnectionDelegate REMOVED
|
||||||
|
__wmessage ADDED
|
||||||
|
wstrerror REMOVED
|
||||||
|
wmessage converted from function to wrapper macro
|
||||||
|
wwarning converted from function to wrapper macro
|
||||||
|
wfatal converted from function to wrapper macro
|
||||||
|
wsyserror converted from function to wrapper macro
|
||||||
|
wsyserror REMOVED (use werror instead)
|
||||||
|
werror macro ADDED (replaces wsyserror)
|
||||||
|
wsyserrorwithcode removed
|
||||||
|
wmkdirhier ADDED
|
||||||
|
wrmdirhier ADDED
|
||||||
|
wmalloc0 REMOVED
|
||||||
|
wnew REMOVED
|
||||||
|
wnew0 REMOVED
|
||||||
|
wstrlcpy ADDED
|
||||||
|
wstrlcat ADDED
|
||||||
|
WMPushInArray REMOVED
|
||||||
|
WMWritePropListToFile NUMBER OF FUNCTION ARGUMENTS CHANGED
|
||||||
|
WMGetCurrentHost
|
||||||
|
WMGetHostWithName
|
||||||
|
WMGetHostWithAddress
|
||||||
|
WMRetainHost
|
||||||
|
WMReleaseHost
|
||||||
|
WMSetHostCacheEnabled
|
||||||
|
WMIsHostCacheEnabled
|
||||||
|
WMFlushHostCache
|
||||||
|
WMIsHostEqualToHost
|
||||||
|
WMGetHostName
|
||||||
|
WMGetHostNames
|
||||||
|
WMGetHostAddress
|
||||||
|
WMCreateConnectionAsServerAtAddress REMOVED
|
||||||
|
WMCreateConnectionToAddress REMOVED
|
||||||
|
WMCreateConnectionToAddressAndNotify REMOVED
|
||||||
|
WMCloseConnection REMOVED
|
||||||
|
WMDestroyConnection REMOVED
|
||||||
|
WMConnection* WMAcceptConnection REMOVED
|
||||||
|
WMGetConnectionAvailableData REMOVED
|
||||||
|
WMSendConnectionData REMOVED
|
||||||
|
WMEnqueueConnectionData REMOVED
|
||||||
|
WMFlushConnection REMOVED
|
||||||
|
WMSetConnectionDelegate REMOVED
|
||||||
|
WMGetConnectionService REMOVED
|
||||||
|
WMGetConnectionProtocol REMOVED
|
||||||
|
WMSetConnectionNonBlocking REMOVED
|
||||||
|
WMSetConnectionCloseOnExec REMOVED
|
||||||
|
WMSetConnectionShutdownOnClose REMOVED
|
||||||
|
WMGetConnectionClientData REMOVED
|
||||||
|
WMSetConnectionClientData REMOVED
|
||||||
|
WMGetConnectionFlags REMOVED
|
||||||
|
WMSetConnectionFlags REMOVED
|
||||||
|
WMGetConnectionSocket REMOVED
|
||||||
|
WMGetConnectionState REMOVED
|
||||||
|
WMGetConnectionTimeoutState REMOVED
|
||||||
|
WMGetConnectionUnsentData REMOVED
|
||||||
|
WMGetConnectionQueuedData REMOVED
|
||||||
|
WMSetConnectionDefaultTimeout REMOVED
|
||||||
|
WMSetConnectionOpenTimeout REMOVED
|
||||||
|
WMSetConnectionSendTimeout REMOVED
|
||||||
|
|
||||||
|
WMTreeWalkProc ADDED
|
||||||
|
WMTreeWalk ADDED
|
||||||
|
wshellquote ADDED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------------------
|
||||||
|
|
||||||
|
*** Thu May 9 18:24:03 CEST 2013 - Christophe
|
||||||
|
|
||||||
|
Const-correctness API changes for WRaster, WUtils and WINGs
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
The 3 libraries have been modified to include appropriate 'const' qualifier
|
||||||
|
to the function parameters that are treated as such. This should provide
|
||||||
|
some hints to the compiler for better optimisation.
|
||||||
|
This change should have no impact on the binary interface, and will not
|
||||||
|
impact existing source code.
|
||||||
|
|
||||||
|
There is one exception however:
|
||||||
|
WUtil: wusergnusteppath()
|
||||||
|
This function now returns 'const char *' because its result must *not* be
|
||||||
|
modified, so it may generate a const related warning in old code.
|
||||||
|
|
||||||
|
|
||||||
*** Mon Oct 14 19:42:42 EEST 2002 - Dan
|
*** Mon Oct 14 19:42:42 EEST 2002 - Dan
|
||||||
|
|
||||||
Double buffering
|
Double buffering
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
testtext testcolorpanel testmywidget wmfile wmquery wtest
|
|
||||||
.libs
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
@@ -1,22 +1,20 @@
|
|||||||
## automake input file for WINGs - Tests
|
## automake input file for WINGs - Tests
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
noinst_PROGRAMS = wtest wmquery wmfile testmywidget
|
noinst_PROGRAMS = wtest wmquery wmfile testmywidget
|
||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
@XFTLIBS@ @INTLIBS@
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
|
@XFTLIBS@ @INTLIBS@ @XLIBS@
|
||||||
|
|
||||||
|
|
||||||
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
|
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
|
||||||
|
|
||||||
wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a
|
wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
|
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
||||||
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@ \
|
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@
|
||||||
-DDEBUG
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Include the WINGs private data header.
|
* Include the WINGs private data header.
|
||||||
@@ -25,29 +24,23 @@
|
|||||||
* Define the widget "class"
|
* Define the widget "class"
|
||||||
*/
|
*/
|
||||||
typedef struct W_MyWidget {
|
typedef struct W_MyWidget {
|
||||||
/* these two fields must be present in all your widgets in this
|
/* these two fields must be present in all your widgets in this
|
||||||
* exact position */
|
* exact position */
|
||||||
W_Class widgetClass;
|
W_Class widgetClass;
|
||||||
WMView *view;
|
WMView *view;
|
||||||
|
|
||||||
/* put your stuff here */
|
/* put your stuff here */
|
||||||
char *text;
|
char *text;
|
||||||
|
|
||||||
} _MyWidget;
|
} _MyWidget;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* some forward declarations */
|
/* some forward declarations */
|
||||||
|
|
||||||
static void destroyMyWidget(_MyWidget *mPtr);
|
static void destroyMyWidget(_MyWidget * mPtr);
|
||||||
static void paintMyWidget(_MyWidget *mPtr);
|
static void paintMyWidget(_MyWidget * mPtr);
|
||||||
|
|
||||||
|
|
||||||
static void handleEvents(XEvent *event, void *data);
|
|
||||||
static void handleActionEvents(XEvent *event, void *data);
|
|
||||||
|
|
||||||
|
|
||||||
|
static void handleEvents(XEvent * event, void *data);
|
||||||
|
static void handleActionEvents(XEvent * event, void *data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delegates
|
* Delegates
|
||||||
@@ -55,173 +48,150 @@ static void handleActionEvents(XEvent *event, void *data);
|
|||||||
* You won't need to use this most of the time.
|
* You won't need to use this most of the time.
|
||||||
*/
|
*/
|
||||||
static W_ViewDelegate _MyWidgetDelegate = {
|
static W_ViewDelegate _MyWidgetDelegate = {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* our widget class ID */
|
/* our widget class ID */
|
||||||
static W_Class myWidgetClass = 0;
|
static W_Class myWidgetClass = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initializer for our widget. Must be called before creating any
|
* Initializer for our widget. Must be called before creating any
|
||||||
* instances of the widget.
|
* instances of the widget.
|
||||||
*/
|
*/
|
||||||
W_Class
|
W_Class InitMyWidget(WMScreen * scr)
|
||||||
InitMyWidget(WMScreen *scr)
|
|
||||||
{
|
{
|
||||||
/* register our widget with WINGs and get our widget class ID */
|
/* register our widget with WINGs and get our widget class ID */
|
||||||
if (!myWidgetClass) {
|
if (!myWidgetClass) {
|
||||||
myWidgetClass = W_RegisterUserWidget();
|
myWidgetClass = W_RegisterUserWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
return myWidgetClass;
|
return myWidgetClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Our widget fabrication plant.
|
* Our widget fabrication plant.
|
||||||
*/
|
*/
|
||||||
MyWidget*
|
MyWidget *CreateMyWidget(WMWidget * parent)
|
||||||
CreateMyWidget(WMWidget *parent)
|
|
||||||
{
|
{
|
||||||
MyWidget *mPtr;
|
MyWidget *mPtr;
|
||||||
|
|
||||||
/* allocate some storage for our new widget instance */
|
/* allocate some storage for our new widget instance */
|
||||||
mPtr = wmalloc(sizeof(MyWidget));
|
mPtr = wmalloc(sizeof(MyWidget));
|
||||||
/* initialize it */
|
/* initialize it */
|
||||||
memset(mPtr, 0, sizeof(MyWidget));
|
memset(mPtr, 0, sizeof(MyWidget));
|
||||||
|
|
||||||
/* set the class ID */
|
/* set the class ID */
|
||||||
mPtr->widgetClass = myWidgetClass;
|
mPtr->widgetClass = myWidgetClass;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the view for our widget.
|
* Create the view for our widget.
|
||||||
* Note: the Window for the view is only created after the view is
|
* Note: the Window for the view is only created after the view is
|
||||||
* realized with W_RealizeView()
|
* realized with W_RealizeView()
|
||||||
*
|
*
|
||||||
* Consider the returned view as read-only.
|
* Consider the returned view as read-only.
|
||||||
*/
|
*/
|
||||||
mPtr->view = W_CreateView(W_VIEW(parent));
|
mPtr->view = W_CreateView(W_VIEW(parent));
|
||||||
if (!mPtr->view) {
|
if (!mPtr->view) {
|
||||||
wfree(mPtr);
|
wfree(mPtr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* always do this */
|
/* always do this */
|
||||||
mPtr->view->self = mPtr;
|
mPtr->view->self = mPtr;
|
||||||
|
|
||||||
/* setup the delegates for the view */
|
/* setup the delegates for the view */
|
||||||
mPtr->view->delegate = &_MyWidgetDelegate;
|
mPtr->view->delegate = &_MyWidgetDelegate;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Intercept some events for our widget, so that we can handle them.
|
* Intercept some events for our widget, so that we can handle them.
|
||||||
*/
|
*/
|
||||||
WMCreateEventHandler(mPtr->view, ExposureMask /* this allows us to know when we should paint */
|
WMCreateEventHandler(mPtr->view, ExposureMask /* this allows us to know when we should paint */
|
||||||
|StructureNotifyMask, /* this allows us to know things like when we are destroyed */
|
| StructureNotifyMask, /* this allows us to know things like when we are destroyed */
|
||||||
handleEvents, mPtr);
|
handleEvents, mPtr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Intercept some other events. This could be merged with the above
|
* Intercept some other events. This could be merged with the above
|
||||||
* call, but we separate for more organization.
|
* call, but we separate for more organization.
|
||||||
*/
|
*/
|
||||||
WMCreateEventHandler(mPtr->view, ButtonPressMask,handleActionEvents, mPtr);
|
WMCreateEventHandler(mPtr->view, ButtonPressMask, handleActionEvents, mPtr);
|
||||||
|
|
||||||
return mPtr;
|
return mPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Paint our widget contents.
|
* Paint our widget contents.
|
||||||
*/
|
*/
|
||||||
static void
|
static void paintMyWidget(_MyWidget * mPtr)
|
||||||
paintMyWidget(_MyWidget *mPtr)
|
|
||||||
{
|
{
|
||||||
W_Screen *scr = mPtr->view->screen;
|
W_Screen *scr = mPtr->view->screen;
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|
||||||
|
if (mPtr->text) {
|
||||||
|
|
||||||
if (mPtr->text) {
|
color = WMWhiteColor(scr);
|
||||||
|
|
||||||
color = WMWhiteColor(scr);
|
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
|
||||||
|
mPtr->view->size.width, WACenter, color, False, mPtr->text, strlen(mPtr->text));
|
||||||
|
|
||||||
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
|
WMReleaseColor(color);
|
||||||
mPtr->view->size.width, WACenter, color,
|
}
|
||||||
False, mPtr->text, strlen(mPtr->text));
|
|
||||||
|
|
||||||
WMReleaseColor(color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleEvents(XEvent * event, void *data)
|
||||||
|
|
||||||
static void
|
|
||||||
handleEvents(XEvent *event, void *data)
|
|
||||||
{
|
{
|
||||||
_MyWidget *mPtr = (_MyWidget*)data;
|
_MyWidget *mPtr = (_MyWidget *) data;
|
||||||
|
|
||||||
|
switch (event->type) {
|
||||||
|
case Expose:
|
||||||
|
if (event->xexpose.count != 0)
|
||||||
|
break;
|
||||||
|
paintMyWidget(mPtr);
|
||||||
|
break;
|
||||||
|
|
||||||
switch (event->type) {
|
case DestroyNotify:
|
||||||
case Expose:
|
destroyMyWidget(mPtr);
|
||||||
if (event->xexpose.count!=0)
|
break;
|
||||||
break;
|
|
||||||
paintMyWidget(mPtr);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DestroyNotify:
|
}
|
||||||
destroyMyWidget(mPtr);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleActionEvents(XEvent * event, void *data)
|
||||||
static void
|
|
||||||
handleActionEvents(XEvent *event, void *data)
|
|
||||||
{
|
{
|
||||||
_MyWidget *mPtr = (_MyWidget*)data;
|
_MyWidget *mPtr = (_MyWidget *) data;
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
XBell(mPtr->view->screen->display, 100);
|
XBell(mPtr->view->screen->display, 100);
|
||||||
XBell(mPtr->view->screen->display, 100);
|
XBell(mPtr->view->screen->display, 100);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMyWidgetText(MyWidget * mPtr, char *text)
|
||||||
void
|
|
||||||
SetMyWidgetText(MyWidget *mPtr, char *text)
|
|
||||||
{
|
{
|
||||||
CHECK_CLASS(mPtr, myWidgetClass);
|
CHECK_CLASS(mPtr, myWidgetClass);
|
||||||
|
|
||||||
if (mPtr->text)
|
if (mPtr->text)
|
||||||
wfree(mPtr->text);
|
wfree(mPtr->text);
|
||||||
|
|
||||||
mPtr->text = wstrdup(text);
|
mPtr->text = wstrdup(text);
|
||||||
|
|
||||||
if (W_VIEW_MAPPED(mPtr->view)) {
|
if (W_VIEW_MAPPED(mPtr->view)) {
|
||||||
paintMyWidget(mPtr);
|
paintMyWidget(mPtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void destroyMyWidget(_MyWidget * mPtr)
|
||||||
|
|
||||||
static void
|
|
||||||
destroyMyWidget(_MyWidget *mPtr)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Free all data we allocated for our widget.
|
* Free all data we allocated for our widget.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mPtr->text)
|
if (mPtr->text)
|
||||||
wfree(mPtr->text);
|
wfree(mPtr->text);
|
||||||
|
|
||||||
wfree(mPtr);
|
wfree(mPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,46 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "mywidget.h"
|
#include "mywidget.h"
|
||||||
|
|
||||||
|
void wAbort()
|
||||||
void
|
|
||||||
wAbort()
|
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay("");
|
Display *dpy = XOpenDisplay("");
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
MyWidget *thing;
|
MyWidget *thing;
|
||||||
|
|
||||||
|
WMInitializeApplication("Test", &argc, argv);
|
||||||
|
|
||||||
WMInitializeApplication("Test", &argc, argv);
|
if (!dpy) {
|
||||||
|
wfatal("could not open display");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!dpy) {
|
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||||
wfatal("could not open display");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
/* init our widget */
|
||||||
|
InitMyWidget(scr);
|
||||||
|
|
||||||
/* init our widget */
|
win = WMCreateWindow(scr, "test");
|
||||||
InitMyWidget(scr);
|
WMResizeWidget(win, 150, 50);
|
||||||
|
|
||||||
win = WMCreateWindow(scr, "test");
|
thing = CreateMyWidget(win);
|
||||||
WMResizeWidget(win, 150, 50);
|
SetMyWidgetText(thing, "The Test");
|
||||||
|
WMResizeWidget(thing, 100, 20);
|
||||||
|
WMMoveWidget(thing, 10, 10);
|
||||||
|
|
||||||
thing = CreateMyWidget(win);
|
WMRealizeWidget(win);
|
||||||
SetMyWidgetText(thing, "The Test");
|
WMMapSubwidgets(win);
|
||||||
WMResizeWidget(thing, 100, 20);
|
WMMapWidget(win);
|
||||||
WMMoveWidget(thing, 10, 10);
|
|
||||||
|
|
||||||
WMRealizeWidget(win);
|
WMScreenMainLoop(scr);
|
||||||
WMMapSubwidgets(win);
|
|
||||||
WMMapWidget(win);
|
|
||||||
|
|
||||||
WMScreenMainLoop(scr);
|
return 0;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -21,36 +19,28 @@
|
|||||||
|
|
||||||
#include "logo.xpm"
|
#include "logo.xpm"
|
||||||
|
|
||||||
|
void wAbort()
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
wAbort()
|
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *ProgName;
|
char *ProgName;
|
||||||
|
|
||||||
void usage(void)
|
void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage:\n"
|
"usage:\n"
|
||||||
"\t%s [-options]\n"
|
"\t%s [-options]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"options:\n"
|
"options:\n"
|
||||||
" -s\t\tSave panel (default open panel)\n"
|
" -s\t\tSave panel (default open panel)\n"
|
||||||
" -i <str>\tInitial directory (default /)\n"
|
" -i <str>\tInitial directory (default /)\n"
|
||||||
" -t <str>\tQuery window title (default none)\n"
|
" -t <str>\tQuery window title (default none)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"information:\n"
|
"information:\n"
|
||||||
"\t%s pops up a WindowMaker style file selection panel.\n"
|
"\t%s pops up a WindowMaker style file selection panel.\n"
|
||||||
"\n"
|
"\n" "version:\n" "\t%s\n", ProgName, ProgName, __DATE__);
|
||||||
"version:\n"
|
exit(0);
|
||||||
"\t%s\n"
|
|
||||||
,ProgName,ProgName,__DATE__
|
|
||||||
);
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OPEN_PANEL_TYPE 0
|
#define OPEN_PANEL_TYPE 0
|
||||||
@@ -58,69 +48,65 @@ void usage(void)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay("");
|
Display *dpy = XOpenDisplay("");
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
WMPixmap *pixmap;
|
WMPixmap *pixmap;
|
||||||
WMOpenPanel *oPanel;
|
WMOpenPanel *oPanel;
|
||||||
WMSavePanel *sPanel;
|
WMSavePanel *sPanel;
|
||||||
/* RImage *image;*/
|
/* RImage *image; */
|
||||||
char *title = NULL;
|
char *title = NULL;
|
||||||
char *initial = "/";
|
char *initial = "/";
|
||||||
int ch;
|
int ch;
|
||||||
int panelType = OPEN_PANEL_TYPE;
|
int panelType = OPEN_PANEL_TYPE;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
|
|
||||||
if (!dpy) {
|
if (!dpy) {
|
||||||
puts("could not open display");
|
puts("could not open display");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
WMInitializeApplication("WMFile", &argc, argv);
|
WMInitializeApplication("WMFile", &argc, argv);
|
||||||
|
|
||||||
ProgName = argv[0];
|
ProgName = argv[0];
|
||||||
|
|
||||||
while((ch = getopt(argc, argv, "si:ht:")) != -1)
|
while ((ch = getopt(argc, argv, "si:ht:")) != -1)
|
||||||
switch(ch)
|
switch (ch) {
|
||||||
{
|
case 's':
|
||||||
case 's':
|
panelType = SAVE_PANEL_TYPE;
|
||||||
panelType = SAVE_PANEL_TYPE;
|
break;
|
||||||
break;
|
case 'i':
|
||||||
case 'i':
|
initial = optarg;
|
||||||
initial = optarg;
|
break;
|
||||||
break;
|
case 't':
|
||||||
case 't':
|
title = optarg;
|
||||||
title = optarg;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
usage();
|
||||||
usage();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for(; optind <argc; optind++)
|
for (; optind < argc; optind++)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||||
|
|
||||||
|
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
||||||
|
WMSetApplicationIconPixmap(scr, pixmap);
|
||||||
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
WMReleasePixmap(pixmap);
|
||||||
WMSetApplicationIconPixmap(scr, pixmap);
|
if (panelType == SAVE_PANEL_TYPE) {
|
||||||
WMReleasePixmap(pixmap);
|
sPanel = WMGetSavePanel(scr);
|
||||||
if (panelType == SAVE_PANEL_TYPE) {
|
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
|
||||||
sPanel = WMGetSavePanel(scr);
|
/*title */ NULL, NULL) == True)
|
||||||
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
|
printf("%s\n", WMGetFilePanelFileName(sPanel));
|
||||||
/*title*/ NULL, NULL) == True)
|
else
|
||||||
printf("%s\n", WMGetFilePanelFileName(sPanel));
|
printf("\n");
|
||||||
else
|
} else {
|
||||||
printf("\n");
|
oPanel = WMGetOpenPanel(scr);
|
||||||
} else {
|
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
|
||||||
oPanel = WMGetOpenPanel(scr);
|
/*title */ NULL, NULL) == True)
|
||||||
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
|
printf("%s\n", WMGetFilePanelFileName(oPanel));
|
||||||
/*title*/ NULL, NULL) == True)
|
else
|
||||||
printf("%s\n", WMGetFilePanelFileName(oPanel));
|
printf("\n");
|
||||||
else
|
}
|
||||||
printf("\n");
|
return 0;
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
|
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -12,92 +11,80 @@
|
|||||||
|
|
||||||
#include "logo.xpm"
|
#include "logo.xpm"
|
||||||
|
|
||||||
|
void wAbort()
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
wAbort()
|
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *ProgName;
|
char *ProgName;
|
||||||
|
|
||||||
void
|
void usage(void)
|
||||||
usage(void)
|
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage:\n"
|
"usage:\n"
|
||||||
"\t%s [-options]\n"
|
"\t%s [-options]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"options:\n"
|
"options:\n"
|
||||||
" -i <str>\tInitial entry contents (default none)\n"
|
" -i <str>\tInitial entry contents (default none)\n"
|
||||||
" -p <str>\tPrompt message (default none)\n"
|
" -p <str>\tPrompt message (default none)\n"
|
||||||
" -t <str>\tQuery window title (default none)\n"
|
" -t <str>\tQuery window title (default none)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"information:\n"
|
"information:\n"
|
||||||
"\t%s pops up a WindowMaker style input panel.\n"
|
"\t%s pops up a WindowMaker style input panel.\n"
|
||||||
"\n"
|
"\n" "version:\n" "\t%s\n", ProgName, ProgName, __DATE__);
|
||||||
"version:\n"
|
exit(0);
|
||||||
"\t%s\n"
|
|
||||||
,ProgName,ProgName,__DATE__
|
|
||||||
);
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int main(int argc, char **argv)
|
||||||
main(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay("");
|
Display *dpy = XOpenDisplay("");
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
WMPixmap *pixmap;
|
WMPixmap *pixmap;
|
||||||
char *title = NULL;
|
char *title = NULL;
|
||||||
char *prompt = NULL;
|
char *prompt = NULL;
|
||||||
char *initial = NULL;
|
char *initial = NULL;
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
int ch;
|
int ch;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
|
|
||||||
WMInitializeApplication("WMQuery", &argc, argv);
|
WMInitializeApplication("WMQuery", &argc, argv);
|
||||||
|
|
||||||
ProgName = argv[0];
|
ProgName = argv[0];
|
||||||
|
|
||||||
if (!dpy) {
|
if (!dpy) {
|
||||||
puts("could not open display");
|
puts("could not open display");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
while((ch = getopt(argc, argv, "i:hp:t:")) != -1)
|
while ((ch = getopt(argc, argv, "i:hp:t:")) != -1)
|
||||||
switch(ch)
|
switch (ch) {
|
||||||
{
|
case 'i':
|
||||||
case 'i':
|
initial = optarg;
|
||||||
initial = optarg;
|
break;
|
||||||
break;
|
case 'p':
|
||||||
case 'p':
|
prompt = optarg;
|
||||||
prompt = optarg;
|
break;
|
||||||
break;
|
case 't':
|
||||||
case 't':
|
title = optarg;
|
||||||
title = optarg;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
usage();
|
||||||
usage();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for(; optind <argc; optind++)
|
for (; optind < argc; optind++)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||||
|
|
||||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
||||||
|
|
||||||
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
|
WMSetApplicationIconPixmap(scr, pixmap);
|
||||||
|
WMReleasePixmap(pixmap);
|
||||||
|
|
||||||
WMSetApplicationIconPixmap(scr, pixmap); WMReleasePixmap(pixmap);
|
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
|
||||||
|
printf("%s\n", result);
|
||||||
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
|
else
|
||||||
printf("%s\n", result);
|
printf("\n");
|
||||||
else
|
return 0;
|
||||||
printf("\n");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1502
WINGs/Tests/wtest.c
1502
WINGs/Tests/wtest.c
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
## automake input file for WINGs - Headers subdir
|
## automake input file for WINGs - Headers subdir
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = no-dependencies
|
AUTOMAKE_OPTIONS =
|
||||||
|
|
||||||
# is this a kluge? if so, how should i do it?
|
# is this a kluge? if so, how should i do it?
|
||||||
includedir = @includedir@/WINGs
|
includedir = @includedir@/WINGs
|
||||||
|
|
||||||
include_HEADERS = WINGs.h WUtil.h WINGsP.h proplist-compat.h
|
include_HEADERS = WINGs.h WUtil.h WINGsP.h
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
|
/* WINGs.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 1998 scottc
|
||||||
|
* Copyright (c) 1999-2004 Dan Pascu
|
||||||
|
* Copyright (c) 1999-2001 Alfredo K. Kojima
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _WINGS_H_
|
#ifndef _WINGS_H_
|
||||||
#define _WINGS_H_
|
#define _WINGS_H_
|
||||||
@@ -7,7 +26,7 @@
|
|||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#define WINGS_H_VERSION 20041030
|
#define WINGS_H_VERSION 20140612
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -18,6 +37,22 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __STDC_VERSION__
|
||||||
|
# if __STDC_VERSION__ >= 201112L
|
||||||
|
/*
|
||||||
|
* Ideally, we would like to include the proper header to have 'noreturn' properly
|
||||||
|
* defined (that's what is done for the rest of the code)
|
||||||
|
* However, as we're a public API file we can't do that in a portable fashion, so
|
||||||
|
* we just stick to plain STD C11 keyword
|
||||||
|
*/
|
||||||
|
# define _wings_noreturn _Noreturn
|
||||||
|
# else
|
||||||
|
# define _wings_noreturn /**/
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
#define _wings_noreturn /**/
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned long WMPixel;
|
typedef unsigned long WMPixel;
|
||||||
|
|
||||||
|
|
||||||
@@ -590,7 +625,7 @@ typedef struct W_DragDestinationProcs {
|
|||||||
} WMDragDestinationProcs;
|
} WMDragDestinationProcs;
|
||||||
|
|
||||||
|
|
||||||
/* ...................................................................... */
|
/* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
WMPoint wmkpoint(int x, int y);
|
WMPoint wmkpoint(int x, int y);
|
||||||
@@ -604,20 +639,23 @@ WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
|
|||||||
#define wmkpoint(x, y) (WMPoint){(x), (y)}
|
#define wmkpoint(x, y) (WMPoint){(x), (y)}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wapplication.c ]-------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
void WMInitializeApplication(const char *applicationName, int *argc, char **argv);
|
||||||
|
|
||||||
void WMInitializeApplication(char *applicationName, int *argc, char **argv);
|
/* You're supposed to call this funtion before exiting so WINGs can terminate properly */
|
||||||
|
void WMReleaseApplication(void);
|
||||||
|
|
||||||
void WMSetResourcePath(char *path);
|
void WMSetResourcePath(const char *path);
|
||||||
|
|
||||||
/* don't free the returned string */
|
/* don't free the returned string */
|
||||||
char* WMGetApplicationName();
|
char* WMGetApplicationName(void);
|
||||||
|
|
||||||
/* Try to locate resource file. ext may be NULL */
|
/* Try to locate resource file. ext may be NULL */
|
||||||
char* WMPathForResourceOfType(char *resource, char *ext);
|
char* WMPathForResourceOfType(const char *resource, const char *ext);
|
||||||
|
|
||||||
|
/* ---[ WINGs/widgets.c ]------------------------------------------------- */
|
||||||
|
|
||||||
WMScreen* WMOpenScreen(const char *display);
|
WMScreen* WMOpenScreen(const char *display);
|
||||||
|
|
||||||
@@ -628,7 +666,7 @@ WMScreen* WMCreateScreen(Display *display, int screen);
|
|||||||
|
|
||||||
WMScreen* WMCreateSimpleApplicationScreen(Display *display);
|
WMScreen* WMCreateSimpleApplicationScreen(Display *display);
|
||||||
|
|
||||||
void WMScreenMainLoop(WMScreen *scr);
|
_wings_noreturn void WMScreenMainLoop(WMScreen *scr);
|
||||||
|
|
||||||
void WMBreakModalLoop(WMScreen *scr);
|
void WMBreakModalLoop(WMScreen *scr);
|
||||||
|
|
||||||
@@ -640,7 +678,9 @@ Display* WMScreenDisplay(WMScreen *scr);
|
|||||||
|
|
||||||
int WMScreenDepth(WMScreen *scr);
|
int WMScreenDepth(WMScreen *scr);
|
||||||
|
|
||||||
|
void WMSetFocusToWidget(WMWidget *widget);
|
||||||
|
|
||||||
|
/* ---[ WINGs/wappresource.c ]-------------------------------------------- */
|
||||||
|
|
||||||
void WMSetApplicationIconImage(WMScreen *app, RImage *image);
|
void WMSetApplicationIconImage(WMScreen *app, RImage *image);
|
||||||
|
|
||||||
@@ -651,11 +691,11 @@ void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
|
|||||||
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
|
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
|
||||||
|
|
||||||
/* If color==NULL it will use the default color for panels: ae/aa/ae */
|
/* If color==NULL it will use the default color for panels: ae/aa/ae */
|
||||||
WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
|
WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, const RColor *color);
|
||||||
|
|
||||||
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
|
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
|
||||||
|
|
||||||
void WMSetFocusToWidget(WMWidget *widget);
|
/* ---[ WINGs/wevent.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
WMEventHook* WMHookEventHandler(WMEventHook *handler);
|
WMEventHook* WMHookEventHandler(WMEventHook *handler);
|
||||||
|
|
||||||
@@ -677,8 +717,12 @@ void WMNextEvent(Display *dpy, XEvent *event);
|
|||||||
|
|
||||||
void WMMaskEvent(Display *dpy, long mask, XEvent *event);
|
void WMMaskEvent(Display *dpy, long mask, XEvent *event);
|
||||||
|
|
||||||
|
void WMSetViewNextResponder(WMView *view, WMView *responder);
|
||||||
|
|
||||||
/* ....................................................................... */
|
void WMRelayToNextResponder(WMView *view, XEvent *event);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ WINGs/selection.c ]----------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
|
Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
|
||||||
@@ -693,7 +737,7 @@ Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
|
|||||||
|
|
||||||
extern char *WMSelectionOwnerDidChangeNotification;
|
extern char *WMSelectionOwnerDidChangeNotification;
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
|
||||||
|
|
||||||
WMArray* WMCreateDragOperationArray(int initialSize);
|
WMArray* WMCreateDragOperationArray(int initialSize);
|
||||||
|
|
||||||
@@ -704,6 +748,8 @@ WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
|
|||||||
|
|
||||||
char* WMGetDragOperationItemText(WMDragOperationItem* item);
|
char* WMGetDragOperationItemText(WMDragOperationItem* item);
|
||||||
|
|
||||||
|
/* ---[ WINGs/dragsource.c ]---------------------------------------------- */
|
||||||
|
|
||||||
void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
|
void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
|
||||||
|
|
||||||
void WMReleaseViewDragImage(WMView* view);
|
void WMReleaseViewDragImage(WMView* view);
|
||||||
@@ -724,19 +770,19 @@ void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragIm
|
|||||||
|
|
||||||
void WMUnsetViewDraggable(WMView *view);
|
void WMUnsetViewDraggable(WMView *view);
|
||||||
|
|
||||||
|
/* ---[ WINGs/dragdestination.c ]----------------------------------------- */
|
||||||
|
|
||||||
void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
|
void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
|
||||||
|
|
||||||
void WMUnregisterViewDraggedTypes(WMView *view);
|
void WMUnregisterViewDraggedTypes(WMView *view);
|
||||||
|
|
||||||
void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
|
void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wfont.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
|
Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
|
||||||
|
|
||||||
/* ....................................................................... */
|
WMFont* WMCreateFont(WMScreen *scrPtr, const char *fontName);
|
||||||
|
|
||||||
WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
|
|
||||||
|
|
||||||
WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
|
WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
|
||||||
|
|
||||||
@@ -760,7 +806,16 @@ WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
|
|||||||
|
|
||||||
WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
|
WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
|
||||||
|
|
||||||
/* ....................................................................... */
|
void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
||||||
|
int x, int y, const char *text, int length);
|
||||||
|
|
||||||
|
void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
|
||||||
|
WMColor *background, WMFont *font, int x, int y,
|
||||||
|
const char *text, int length);
|
||||||
|
|
||||||
|
int WMWidthOfString(WMFont *font, const char *text, int length);
|
||||||
|
|
||||||
|
/* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
|
||||||
|
|
||||||
WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
|
WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
|
||||||
|
|
||||||
@@ -780,13 +835,18 @@ WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
|
|||||||
|
|
||||||
WMSize WMGetPixmapSize(WMPixmap *pixmap);
|
WMSize WMGetPixmapSize(WMPixmap *pixmap);
|
||||||
|
|
||||||
WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
|
WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, const char *fileName);
|
||||||
|
|
||||||
WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
|
WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
|
||||||
RColor *color);
|
const RColor *color);
|
||||||
|
|
||||||
WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
|
WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, const char *fileName,
|
||||||
RColor *color);
|
const RColor *color);
|
||||||
|
|
||||||
|
WMPixmap* WMCreateScaledBlendedPixmapFromFile(WMScreen *scrPtr, const char *fileName,
|
||||||
|
const RColor *color,
|
||||||
|
unsigned int width,
|
||||||
|
unsigned int height);
|
||||||
|
|
||||||
void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
|
void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
|
||||||
|
|
||||||
@@ -796,7 +856,7 @@ Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
|
|||||||
|
|
||||||
WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
|
WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
WMColor* WMDarkGrayColor(WMScreen *scr);
|
WMColor* WMDarkGrayColor(WMScreen *scr);
|
||||||
@@ -828,7 +888,7 @@ WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
|
|||||||
unsigned short green, unsigned short blue,
|
unsigned short green, unsigned short blue,
|
||||||
unsigned short alpha, Bool exact);
|
unsigned short alpha, Bool exact);
|
||||||
|
|
||||||
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
|
WMColor* WMCreateNamedColor(WMScreen *scr, const char *name, Bool exact);
|
||||||
|
|
||||||
RColor WMGetRColorFromColor(WMColor *color);
|
RColor WMGetRColorFromColor(WMColor *color);
|
||||||
|
|
||||||
@@ -844,21 +904,7 @@ unsigned short WMGetColorAlpha(WMColor *color);
|
|||||||
|
|
||||||
char* WMGetColorRGBDescription(WMColor *color);
|
char* WMGetColorRGBDescription(WMColor *color);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/widgets.c ]------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
|
||||||
int x, int y, char *text, int length);
|
|
||||||
|
|
||||||
void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
|
|
||||||
WMColor *background, WMFont *font, int x, int y,
|
|
||||||
char *text, int length);
|
|
||||||
|
|
||||||
int WMWidthOfString(WMFont *font, char *text, int length);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ....................................................................... */
|
|
||||||
|
|
||||||
WMScreen* WMWidgetScreen(WMWidget *w);
|
WMScreen* WMWidgetScreen(WMWidget *w);
|
||||||
|
|
||||||
@@ -904,10 +950,12 @@ unsigned int WMWidgetHeight(WMWidget *w);
|
|||||||
|
|
||||||
Window WMWidgetXID(WMWidget *w);
|
Window WMWidgetXID(WMWidget *w);
|
||||||
|
|
||||||
Window WMViewXID(WMView *view);
|
|
||||||
|
|
||||||
void WMRedisplayWidget(WMWidget *w);
|
void WMRedisplayWidget(WMWidget *w);
|
||||||
|
|
||||||
|
/* ---[ WINGs/wview.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
|
Window WMViewXID(WMView *view);
|
||||||
|
|
||||||
void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
|
void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
|
||||||
|
|
||||||
void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
|
void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
|
||||||
@@ -921,10 +969,6 @@ WMPoint WMGetViewScreenPosition(WMView *view);
|
|||||||
|
|
||||||
WMWidget* WMWidgetOfView(WMView *view);
|
WMWidget* WMWidgetOfView(WMView *view);
|
||||||
|
|
||||||
void WMSetViewNextResponder(WMView *view, WMView *responder);
|
|
||||||
|
|
||||||
void WMRelayToNextResponder(WMView *view, XEvent *event);
|
|
||||||
|
|
||||||
/* notifications */
|
/* notifications */
|
||||||
extern char *WMViewSizeDidChangeNotification;
|
extern char *WMViewSizeDidChangeNotification;
|
||||||
|
|
||||||
@@ -932,10 +976,9 @@ extern char *WMViewFocusDidChangeNotification;
|
|||||||
|
|
||||||
extern char *WMViewRealizedNotification;
|
extern char *WMViewRealizedNotification;
|
||||||
|
|
||||||
|
/* ---[ WINGs/wballoon.c ]------------------------------------------------ */
|
||||||
|
|
||||||
/* ....................................................................... */
|
void WMSetBalloonTextForView(const char *text, WMView *view);
|
||||||
|
|
||||||
void WMSetBalloonTextForView(char *text, WMView *view);
|
|
||||||
|
|
||||||
void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
|
void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
|
||||||
|
|
||||||
@@ -948,22 +991,22 @@ void WMSetBalloonDelay(WMScreen *scr, int delay);
|
|||||||
void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
|
void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
|
||||||
|
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wwindow.c ]------------------------------------------------- */
|
||||||
|
|
||||||
WMWindow* WMCreateWindow(WMScreen *screen, char *name);
|
WMWindow* WMCreateWindow(WMScreen *screen, const char *name);
|
||||||
|
|
||||||
WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
|
WMWindow* WMCreateWindowWithStyle(WMScreen *screen, const char *name, int style);
|
||||||
|
|
||||||
WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
|
WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, const char *name,
|
||||||
int style);
|
int style);
|
||||||
|
|
||||||
WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
|
WMWindow* WMCreatePanelForWindow(WMWindow *owner, const char *name);
|
||||||
|
|
||||||
void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
|
void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
|
||||||
|
|
||||||
void WMSetWindowTitle(WMWindow *wPtr, char *title);
|
void WMSetWindowTitle(WMWindow *wPtr, const char *title);
|
||||||
|
|
||||||
void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
|
void WMSetWindowMiniwindowTitle(WMWindow *win, const char *title);
|
||||||
|
|
||||||
void WMSetWindowMiniwindowImage(WMWindow *win, RImage *image);
|
void WMSetWindowMiniwindowImage(WMWindow *win, RImage *image);
|
||||||
|
|
||||||
@@ -992,7 +1035,7 @@ void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
|
|||||||
|
|
||||||
void WMCloseWindow(WMWindow *win);
|
void WMCloseWindow(WMWindow *win);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wbutton.c ]------------------------------------------------- */
|
||||||
|
|
||||||
void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
|
void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
|
||||||
|
|
||||||
@@ -1024,9 +1067,9 @@ void WMSetButtonFont(WMButton *bPtr, WMFont *font);
|
|||||||
|
|
||||||
void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
|
void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
|
||||||
|
|
||||||
void WMSetButtonText(WMButton *bPtr, char *text);
|
void WMSetButtonText(WMButton *bPtr, const char *text);
|
||||||
|
|
||||||
void WMSetButtonAltText(WMButton *bPtr, char *text);
|
void WMSetButtonAltText(WMButton *bPtr, const char *text);
|
||||||
|
|
||||||
void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
|
void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
|
||||||
|
|
||||||
@@ -1056,7 +1099,7 @@ void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
|
|||||||
|
|
||||||
void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
|
void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
WMLabel* WMCreateLabel(WMWidget *parent);
|
WMLabel* WMCreateLabel(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1074,7 +1117,7 @@ void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
|
|||||||
|
|
||||||
void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
|
void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
|
||||||
|
|
||||||
void WMSetLabelText(WMLabel *lPtr, char *text);
|
void WMSetLabelText(WMLabel *lPtr, const char *text);
|
||||||
|
|
||||||
WMFont* WMGetLabelFont(WMLabel *lPtr);
|
WMFont* WMGetLabelFont(WMLabel *lPtr);
|
||||||
|
|
||||||
@@ -1082,7 +1125,7 @@ void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
|
|||||||
|
|
||||||
void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
|
void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wframe.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
WMFrame* WMCreateFrame(WMWidget *parent);
|
WMFrame* WMCreateFrame(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1090,20 +1133,22 @@ void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
|
|||||||
|
|
||||||
void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
|
void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
|
||||||
|
|
||||||
void WMSetFrameTitle(WMFrame *fPtr, char *title);
|
void WMSetFrameTitle(WMFrame *fPtr, const char *title);
|
||||||
|
|
||||||
/* ....................................................................... */
|
void WMSetFrameTitleColor(WMFrame *fPtr, WMColor *color);
|
||||||
|
|
||||||
|
/* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
|
||||||
|
|
||||||
WMTextField* WMCreateTextField(WMWidget *parent);
|
WMTextField* WMCreateTextField(WMWidget *parent);
|
||||||
|
|
||||||
void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
|
void WMInsertTextFieldText(WMTextField *tPtr, const char *text, int position);
|
||||||
|
|
||||||
void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
|
void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
|
||||||
|
|
||||||
/* you can free the returned string */
|
/* you can free the returned string */
|
||||||
char* WMGetTextFieldText(WMTextField *tPtr);
|
char* WMGetTextFieldText(WMTextField *tPtr);
|
||||||
|
|
||||||
void WMSetTextFieldText(WMTextField *tPtr, char *text);
|
void WMSetTextFieldText(WMTextField *tPtr, const char *text);
|
||||||
|
|
||||||
void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
|
void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
|
||||||
|
|
||||||
@@ -1125,6 +1170,8 @@ void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
|
|||||||
|
|
||||||
void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
|
void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
|
||||||
|
|
||||||
|
unsigned WMGetTextFieldCursorPosition(WMTextField *tPtr);
|
||||||
|
|
||||||
void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
|
void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
|
||||||
|
|
||||||
void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
|
void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
|
||||||
@@ -1137,7 +1184,7 @@ extern char *WMTextDidChangeNotification;
|
|||||||
extern char *WMTextDidBeginEditingNotification;
|
extern char *WMTextDidBeginEditingNotification;
|
||||||
extern char *WMTextDidEndEditingNotification;
|
extern char *WMTextDidEndEditingNotification;
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wscroller.c ]----------------------------------------------- */
|
||||||
|
|
||||||
WMScroller* WMCreateScroller(WMWidget *parent);
|
WMScroller* WMCreateScroller(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1157,7 +1204,7 @@ void WMSetScrollerArrowsPosition(WMScroller *sPtr,
|
|||||||
|
|
||||||
extern char *WMScrollerDidScrollNotification;
|
extern char *WMScrollerDidScrollNotification;
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wlist.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
WMList* WMCreateList(WMWidget *parent);
|
WMList* WMCreateList(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1167,13 +1214,13 @@ void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
|
|||||||
|
|
||||||
#define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
|
#define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
|
||||||
|
|
||||||
WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
|
WMListItem* WMInsertListItem(WMList *lPtr, int row, const char *text);
|
||||||
|
|
||||||
void WMSortListItems(WMList *lPtr);
|
void WMSortListItems(WMList *lPtr);
|
||||||
|
|
||||||
void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
|
void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
|
||||||
|
|
||||||
int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
|
int WMFindRowOfListItemWithTitle(WMList *lPtr, const char *title);
|
||||||
|
|
||||||
WMListItem* WMGetListItem(WMList *lPtr, int row);
|
WMListItem* WMGetListItem(WMList *lPtr, int row);
|
||||||
|
|
||||||
@@ -1237,7 +1284,7 @@ Bool WMListAllowsEmptySelection(WMList *lPtr);
|
|||||||
extern char *WMListDidScrollNotification;
|
extern char *WMListDidScrollNotification;
|
||||||
extern char *WMListSelectionDidChangeNotification;
|
extern char *WMListSelectionDidChangeNotification;
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
|
||||||
|
|
||||||
WMBrowser* WMCreateBrowser(WMWidget *parent);
|
WMBrowser* WMCreateBrowser(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1245,7 +1292,7 @@ void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
|
|||||||
|
|
||||||
void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
|
void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
|
||||||
|
|
||||||
void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
|
void WMSetBrowserPathSeparator(WMBrowser *bPtr, const char *separator);
|
||||||
|
|
||||||
void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
|
void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
|
||||||
|
|
||||||
@@ -1257,9 +1304,9 @@ void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
|
|||||||
|
|
||||||
void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
|
void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
|
||||||
|
|
||||||
void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
|
void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, const char *title);
|
||||||
|
|
||||||
WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
|
WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, const char *text, Bool isBranch);
|
||||||
|
|
||||||
void WMSortBrowserColumn(WMBrowser *bPtr, int column);
|
void WMSortBrowserColumn(WMBrowser *bPtr, int column);
|
||||||
|
|
||||||
@@ -1305,7 +1352,7 @@ Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
|
|||||||
|
|
||||||
void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
|
void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
Bool WMMenuItemIsSeparator(WMMenuItem *item);
|
Bool WMMenuItemIsSeparator(WMMenuItem *item);
|
||||||
@@ -1322,7 +1369,7 @@ char* WMGetMenuItemShortcut(WMMenuItem *item);
|
|||||||
|
|
||||||
unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
|
unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
|
||||||
|
|
||||||
void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
|
void WMSetMenuItemShortcut(WMMenuItem *item, const char *shortcut);
|
||||||
|
|
||||||
void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
|
void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
|
||||||
|
|
||||||
@@ -1336,7 +1383,7 @@ WMAction* WMGetMenuItemAction(WMMenuItem *item);
|
|||||||
|
|
||||||
void* WMGetMenuItemData(WMMenuItem *item);
|
void* WMGetMenuItemData(WMMenuItem *item);
|
||||||
|
|
||||||
void WMSetMenuItemTitle(WMMenuItem *item, char *title);
|
void WMSetMenuItemTitle(WMMenuItem *item, const char *title);
|
||||||
|
|
||||||
char* WMGetMenuItemTitle(WMMenuItem *item);
|
char* WMGetMenuItemTitle(WMMenuItem *item);
|
||||||
|
|
||||||
@@ -1368,7 +1415,7 @@ WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
|
|||||||
Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
|
Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
|
||||||
|
|
||||||
WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
|
WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1377,10 +1424,10 @@ void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
|
|||||||
|
|
||||||
void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
|
void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
|
||||||
|
|
||||||
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
|
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, const char *title);
|
||||||
|
|
||||||
WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
|
WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
|
||||||
char *title);
|
const char *title);
|
||||||
|
|
||||||
void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
|
void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
|
||||||
|
|
||||||
@@ -1392,7 +1439,7 @@ void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
|
|||||||
|
|
||||||
int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
|
int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
|
||||||
|
|
||||||
void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
|
void WMSetPopUpButtonText(WMPopUpButton *bPtr, const char *text);
|
||||||
|
|
||||||
/* don't free the returned data */
|
/* don't free the returned data */
|
||||||
char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
|
char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
|
||||||
@@ -1405,7 +1452,7 @@ void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
|
|||||||
|
|
||||||
Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
|
Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
|
||||||
|
|
||||||
WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
|
WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1421,8 +1468,7 @@ int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
|
|||||||
|
|
||||||
int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
|
int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
|
||||||
|
|
||||||
|
/* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
|
||||||
/* ....................................................................... */
|
|
||||||
|
|
||||||
WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
|
WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
|
||||||
|
|
||||||
@@ -1442,7 +1488,7 @@ void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
|
|||||||
|
|
||||||
extern char *WMColorPanelColorChangedNotification;
|
extern char *WMColorPanelColorChangedNotification;
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
|
||||||
|
|
||||||
WMColorWell* WMCreateColorWell(WMWidget *parent);
|
WMColorWell* WMCreateColorWell(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1456,7 +1502,7 @@ void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
|
|||||||
extern char *WMColorWellDidChangeNotification;
|
extern char *WMColorWellDidChangeNotification;
|
||||||
|
|
||||||
|
|
||||||
/* ...................................................................... */
|
/* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
|
||||||
|
|
||||||
WMScrollView* WMCreateScrollView(WMWidget *parent);
|
WMScrollView* WMCreateScrollView(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1481,7 +1527,7 @@ void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
|
|||||||
|
|
||||||
void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
|
void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wslider.c ]------------------------------------------------- */
|
||||||
|
|
||||||
WMSlider* WMCreateSlider(WMWidget *parent);
|
WMSlider* WMCreateSlider(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1505,7 +1551,7 @@ void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
|
|||||||
|
|
||||||
void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
|
void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
WMSplitView* WMCreateSplitView(WMWidget *parent);
|
WMSplitView* WMCreateSplitView(WMWidget *parent);
|
||||||
@@ -1621,9 +1667,9 @@ void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
|
|||||||
|
|
||||||
void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
|
void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
|
||||||
|
|
||||||
void WMPrependTextStream(WMText *tPtr, char *text);
|
void WMPrependTextStream(WMText *tPtr, const char *text);
|
||||||
|
|
||||||
void WMAppendTextStream(WMText *tPtr, char *text);
|
void WMAppendTextStream(WMText *tPtr, const char *text);
|
||||||
|
|
||||||
#define WMClearText(tPtr) WMAppendTextStream \
|
#define WMClearText(tPtr) WMAppendTextStream \
|
||||||
((tPtr), (NULL))
|
((tPtr), (NULL))
|
||||||
@@ -1654,23 +1700,24 @@ int WMGetTextSelectionUnderlined(WMText *tPtr);
|
|||||||
|
|
||||||
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
|
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
|
||||||
|
|
||||||
Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
|
Bool WMFindInTextStream(WMText *tPtr, const char *needle, Bool direction,
|
||||||
Bool caseSensitive);
|
Bool caseSensitive);
|
||||||
|
|
||||||
|
/* Warning: replacement can be modified by the function */
|
||||||
Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
|
Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
|
||||||
|
|
||||||
|
|
||||||
/* parser related stuff... use only if implementing a new parser */
|
/* parser related stuff... use only if implementing a new parser */
|
||||||
|
|
||||||
void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
|
void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, const char *description,
|
||||||
WMColor *color, unsigned short first,
|
WMColor *color, unsigned short first,
|
||||||
unsigned short extraInfo);
|
unsigned short extraInfo);
|
||||||
|
|
||||||
void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
|
void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, const char *description,
|
||||||
WMColor *color, unsigned short first,
|
WMColor *color, unsigned short first,
|
||||||
unsigned short extraInfo);
|
unsigned short extraInfo);
|
||||||
|
|
||||||
void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
|
void* WMCreateTextBlockWithText(WMText *tPtr, const char *text, WMFont *font,
|
||||||
WMColor *color, unsigned short first,
|
WMColor *color, unsigned short first,
|
||||||
unsigned short length);
|
unsigned short length);
|
||||||
|
|
||||||
@@ -1699,8 +1746,7 @@ void* WMRemoveTextBlock(WMText *tPtr);
|
|||||||
|
|
||||||
void WMDestroyTextBlock(WMText *tPtr, void *vtb);
|
void WMDestroyTextBlock(WMText *tPtr, void *vtb);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wtabview.c ]------------------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
WMTabView* WMCreateTabView(WMWidget *parent);
|
WMTabView* WMCreateTabView(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1717,7 +1763,7 @@ void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
|
|||||||
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
|
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
|
||||||
|
|
||||||
WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
|
WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
|
||||||
int identifier, char *label);
|
int identifier, const char *label);
|
||||||
|
|
||||||
WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
|
WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
|
||||||
|
|
||||||
@@ -1744,7 +1790,7 @@ void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
|
|||||||
|
|
||||||
int WMGetTabViewItemIdentifier(WMTabViewItem *item);
|
int WMGetTabViewItemIdentifier(WMTabViewItem *item);
|
||||||
|
|
||||||
void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
|
void WMSetTabViewItemLabel(WMTabViewItem *item, const char *label);
|
||||||
|
|
||||||
char* WMGetTabViewItemLabel(WMTabViewItem *item);
|
char* WMGetTabViewItemLabel(WMTabViewItem *item);
|
||||||
|
|
||||||
@@ -1755,7 +1801,7 @@ WMView* WMGetTabViewItemView(WMTabViewItem *item);
|
|||||||
void WMDestroyTabViewItem(WMTabViewItem *item);
|
void WMDestroyTabViewItem(WMTabViewItem *item);
|
||||||
|
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wbox.c ]---------------------------------------------------- */
|
||||||
|
|
||||||
WMBox* WMCreateBox(WMWidget *parent);
|
WMBox* WMCreateBox(WMWidget *parent);
|
||||||
|
|
||||||
@@ -1771,28 +1817,28 @@ void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
|
|||||||
|
|
||||||
void WMSetBoxHorizontal(WMBox *box, Bool flag);
|
void WMSetBoxHorizontal(WMBox *box, Bool flag);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
|
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, const char *title, const char *msg,
|
||||||
char *defaultButton, char *alternateButton,
|
const char *defaultButton, const char *alternateButton,
|
||||||
char *otherButton);
|
const char *otherButton);
|
||||||
|
|
||||||
/* you can free the returned string */
|
/* you can free the returned string */
|
||||||
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
|
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, const char *title, const char *msg,
|
||||||
char *defaultText, char *okButton, char *cancelButton);
|
const char *defaultText, const char *okButton, const char *cancelButton);
|
||||||
|
|
||||||
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
|
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, const char *title,
|
||||||
char *msg, char *defaultButton,
|
const char *msg, const char *defaultButton,
|
||||||
char *alternateButton, char *otherButton);
|
const char *alternateButton, const char *otherButton);
|
||||||
|
|
||||||
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
|
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, const char *title,
|
||||||
char *msg, char *defaultText, char *okButton,
|
const char *msg, const char *defaultText, const char *okButton,
|
||||||
char *cancelButton);
|
const char *cancelButton);
|
||||||
|
|
||||||
|
|
||||||
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
|
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
|
||||||
char *title, char *defaultButton,
|
const char *title, const char *defaultButton,
|
||||||
char *alternateButton);
|
const char *alternateButton);
|
||||||
|
|
||||||
void WMDestroyAlertPanel(WMAlertPanel *panel);
|
void WMDestroyAlertPanel(WMAlertPanel *panel);
|
||||||
|
|
||||||
@@ -1800,7 +1846,7 @@ void WMDestroyInputPanel(WMInputPanel *panel);
|
|||||||
|
|
||||||
void WMDestroyGenericPanel(WMGenericPanel *panel);
|
void WMDestroyGenericPanel(WMGenericPanel *panel);
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
|
||||||
|
|
||||||
/* only 1 instance per WMScreen */
|
/* only 1 instance per WMScreen */
|
||||||
WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
|
WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
|
||||||
@@ -1821,14 +1867,14 @@ char* WMGetFilePanelFileName(WMFilePanel *panel);
|
|||||||
void WMFreeFilePanel(WMFilePanel *panel);
|
void WMFreeFilePanel(WMFilePanel *panel);
|
||||||
|
|
||||||
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
|
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
|
||||||
char *path, char *name, char **fileTypes);
|
char *path, const char *name, char **fileTypes);
|
||||||
|
|
||||||
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
|
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
|
||||||
|
|
||||||
WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
|
WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
|
||||||
|
|
||||||
|
|
||||||
/* ...................................................................... */
|
/* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
|
||||||
|
|
||||||
/* only 1 instance per WMScreen */
|
/* only 1 instance per WMScreen */
|
||||||
WMFontPanel* WMGetFontPanel(WMScreen *scr);
|
WMFontPanel* WMGetFontPanel(WMScreen *scr);
|
||||||
@@ -1841,13 +1887,22 @@ void WMFreeFontPanel(WMFontPanel *panel);
|
|||||||
|
|
||||||
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
|
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
|
||||||
|
|
||||||
void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
|
void WMSetFontPanelFont(WMFontPanel *panel, const char *fontName);
|
||||||
|
|
||||||
WMFont* WMGetFontPanelFont(WMFontPanel *panel);
|
WMFont* WMGetFontPanelFont(WMFontPanel *panel);
|
||||||
|
|
||||||
|
/* ---[ WINGs/configuration.c ]------------------------------------------- */
|
||||||
|
unsigned W_getconf_mouseWheelUp(void);
|
||||||
|
unsigned W_getconf_mouseWheelDown(void);
|
||||||
|
void W_setconf_doubleClickDelay(int value);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* These definitions are not meant to be seen outside this file */
|
||||||
|
#undef _wings_noreturn
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -16,122 +16,66 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
/* ---[ global settigns ]------------------------------------------------- */
|
||||||
|
|
||||||
#define DOUBLE_BUFFER 1
|
#define DOUBLE_BUFFER 1
|
||||||
|
|
||||||
#define WC_UserWidget 128
|
|
||||||
|
|
||||||
#define SCROLLER_WIDTH 20
|
#define SCROLLER_WIDTH 20
|
||||||
|
|
||||||
|
typedef struct _WINGsConfiguration {
|
||||||
|
char *systemFont;
|
||||||
|
char *boldSystemFont;
|
||||||
|
int defaultFontSize;
|
||||||
|
Bool antialiasedText;
|
||||||
|
char *floppyPath;
|
||||||
|
unsigned doubleClickDelay;
|
||||||
|
unsigned mouseWheelUp;
|
||||||
|
unsigned mouseWheelDown;
|
||||||
|
} _WINGsConfiguration;
|
||||||
|
|
||||||
|
extern char *_WINGS_progname;
|
||||||
|
extern _WINGsConfiguration WINGsConfiguration;
|
||||||
|
extern struct W_Application WMApplication;
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ drag*.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We need to define these structure first because they are used in W_Screen
|
||||||
|
* below. The rest of drag-related stuff if after because it needs W_Screen
|
||||||
|
*/
|
||||||
#define XDND_VERSION 3
|
#define XDND_VERSION 3
|
||||||
|
|
||||||
|
typedef struct W_DraggingInfo {
|
||||||
typedef struct W_Application {
|
|
||||||
char *applicationName;
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
char *resourcePath;
|
|
||||||
} W_Application;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Font {
|
|
||||||
struct W_Screen *screen;
|
|
||||||
|
|
||||||
struct _XftFont *font;
|
|
||||||
|
|
||||||
short height;
|
|
||||||
short y;
|
|
||||||
short refCount;
|
|
||||||
char *name;
|
|
||||||
} W_Font;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Pixmap {
|
|
||||||
struct W_Screen *screen;
|
|
||||||
Pixmap pixmap;
|
|
||||||
Pixmap mask;
|
|
||||||
unsigned short width;
|
|
||||||
unsigned short height;
|
|
||||||
short depth;
|
|
||||||
short refCount;
|
|
||||||
} W_Pixmap;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Color {
|
|
||||||
struct W_Screen *screen;
|
|
||||||
|
|
||||||
XColor color;
|
|
||||||
unsigned short alpha;
|
|
||||||
short refCount;
|
|
||||||
GC gc;
|
|
||||||
struct {
|
|
||||||
unsigned int exact:1;
|
|
||||||
} flags;
|
|
||||||
} W_Color;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_FocusInfo {
|
|
||||||
struct W_View *toplevel;
|
|
||||||
struct W_View *focused; /* view that has the focus in this toplevel */
|
|
||||||
struct W_FocusInfo *next;
|
|
||||||
} W_FocusInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef void* W_DndState(WMView *destView, XClientMessageEvent *event,
|
|
||||||
WMDraggingInfo *info);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_DragOperationItem {
|
|
||||||
WMDragOperationType type;
|
|
||||||
char* text;
|
|
||||||
} W_DragOperationItem;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_DragSourceInfo {
|
|
||||||
WMView *sourceView;
|
|
||||||
Window destinationWindow;
|
|
||||||
W_DndState *state;
|
|
||||||
WMSelectionProcs *selectionProcs;
|
|
||||||
Window icon;
|
|
||||||
WMPoint imageLocation;
|
|
||||||
WMPoint mouseOffset; /* mouse pos in icon */
|
|
||||||
Cursor dragCursor;
|
|
||||||
WMRect noPositionMessageZone;
|
|
||||||
Atom firstThreeTypes[3];
|
|
||||||
} W_DragSourceInfo;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_DragDestinationInfo {
|
|
||||||
WMView *destView;
|
|
||||||
WMView *xdndAwareView;
|
|
||||||
Window sourceWindow;
|
|
||||||
W_DndState *state;
|
|
||||||
Bool sourceActionChanged;
|
|
||||||
WMArray *sourceTypes;
|
|
||||||
WMArray *requiredTypes;
|
|
||||||
Bool typeListAvailable;
|
|
||||||
WMArray *dropDatas;
|
|
||||||
} W_DragDestinationInfo;
|
|
||||||
|
|
||||||
|
|
||||||
struct W_DraggingInfo {
|
|
||||||
unsigned char protocolVersion; /* version supported on the other side */
|
unsigned char protocolVersion; /* version supported on the other side */
|
||||||
Time timestamp;
|
Time timestamp;
|
||||||
|
|
||||||
Atom sourceAction;
|
Atom sourceAction;
|
||||||
Atom destinationAction;
|
Atom destinationAction;
|
||||||
|
|
||||||
W_DragSourceInfo* sourceInfo; /* infos needed by source */
|
struct W_DragSourceInfo* sourceInfo; /* infos needed by source */
|
||||||
W_DragDestinationInfo* destInfo; /* infos needed by destination */
|
struct W_DragDestinationInfo* destInfo; /* infos needed by destination */
|
||||||
} W_DraggingInfo;
|
} W_DraggingInfo;
|
||||||
|
|
||||||
|
/* ---[ Structures from WINGs.h ]----------------------------------------- */
|
||||||
|
|
||||||
|
/* Pre-definition of internal structs */
|
||||||
|
typedef struct W_Color W_Color;
|
||||||
|
typedef struct W_Pixmap W_Pixmap;
|
||||||
|
typedef struct W_View W_View;
|
||||||
|
|
||||||
|
typedef struct W_FocusInfo {
|
||||||
|
W_View *toplevel;
|
||||||
|
W_View *focused; /* view that has the focus in this toplevel */
|
||||||
|
struct W_FocusInfo *next;
|
||||||
|
} W_FocusInfo;
|
||||||
|
|
||||||
typedef struct W_Screen {
|
typedef struct W_Screen {
|
||||||
Display *display;
|
Display *display;
|
||||||
@@ -146,7 +90,7 @@ typedef struct W_Screen {
|
|||||||
|
|
||||||
Window rootWin;
|
Window rootWin;
|
||||||
|
|
||||||
struct W_View *rootView;
|
W_View *rootView;
|
||||||
|
|
||||||
RContext *rcontext;
|
RContext *rcontext;
|
||||||
|
|
||||||
@@ -159,7 +103,7 @@ typedef struct W_Screen {
|
|||||||
W_FocusInfo *focusInfo;
|
W_FocusInfo *focusInfo;
|
||||||
|
|
||||||
RImage *applicationIconImage; /* image (can have alpha channel) */
|
RImage *applicationIconImage; /* image (can have alpha channel) */
|
||||||
struct W_Pixmap *applicationIconPixmap; /* pixmap - no alpha channel */
|
W_Pixmap *applicationIconPixmap; /* pixmap - no alpha channel */
|
||||||
Window applicationIconWindow;
|
Window applicationIconWindow;
|
||||||
|
|
||||||
struct W_Window *windowList; /* list of windows in the app */
|
struct W_Window *windowList; /* list of windows in the app */
|
||||||
@@ -183,8 +127,8 @@ typedef struct W_Screen {
|
|||||||
|
|
||||||
Pixmap stipple;
|
Pixmap stipple;
|
||||||
|
|
||||||
struct W_View *dragSourceView;
|
W_View *dragSourceView;
|
||||||
struct W_DraggingInfo dragInfo;
|
W_DraggingInfo dragInfo;
|
||||||
|
|
||||||
/* colors */
|
/* colors */
|
||||||
W_Color *white;
|
W_Color *white;
|
||||||
@@ -207,9 +151,9 @@ typedef struct W_Screen {
|
|||||||
|
|
||||||
GC drawImStringGC; /* for WMDrawImageString() */
|
GC drawImStringGC; /* for WMDrawImageString() */
|
||||||
|
|
||||||
W_Font *normalFont;
|
struct W_Font *normalFont;
|
||||||
|
|
||||||
W_Font *boldFont;
|
struct W_Font *boldFont;
|
||||||
|
|
||||||
WMHashTable *fontCache;
|
WMHashTable *fontCache;
|
||||||
|
|
||||||
@@ -220,57 +164,57 @@ typedef struct W_Screen {
|
|||||||
struct W_Balloon *balloon;
|
struct W_Balloon *balloon;
|
||||||
|
|
||||||
|
|
||||||
struct W_Pixmap *checkButtonImageOn;
|
W_Pixmap *checkButtonImageOn;
|
||||||
struct W_Pixmap *checkButtonImageOff;
|
W_Pixmap *checkButtonImageOff;
|
||||||
|
|
||||||
struct W_Pixmap *radioButtonImageOn;
|
W_Pixmap *radioButtonImageOn;
|
||||||
struct W_Pixmap *radioButtonImageOff;
|
W_Pixmap *radioButtonImageOff;
|
||||||
|
|
||||||
struct W_Pixmap *buttonArrow;
|
W_Pixmap *buttonArrow;
|
||||||
struct W_Pixmap *pushedButtonArrow;
|
W_Pixmap *pushedButtonArrow;
|
||||||
|
|
||||||
struct W_Pixmap *scrollerDimple;
|
W_Pixmap *scrollerDimple;
|
||||||
|
|
||||||
struct W_Pixmap *upArrow;
|
W_Pixmap *upArrow;
|
||||||
struct W_Pixmap *downArrow;
|
W_Pixmap *downArrow;
|
||||||
struct W_Pixmap *leftArrow;
|
W_Pixmap *leftArrow;
|
||||||
struct W_Pixmap *rightArrow;
|
W_Pixmap *rightArrow;
|
||||||
|
|
||||||
struct W_Pixmap *hiUpArrow;
|
W_Pixmap *hiUpArrow;
|
||||||
struct W_Pixmap *hiDownArrow;
|
W_Pixmap *hiDownArrow;
|
||||||
struct W_Pixmap *hiLeftArrow;
|
W_Pixmap *hiLeftArrow;
|
||||||
struct W_Pixmap *hiRightArrow;
|
W_Pixmap *hiRightArrow;
|
||||||
|
|
||||||
struct W_Pixmap *pullDownIndicator;
|
W_Pixmap *pullDownIndicator;
|
||||||
struct W_Pixmap *popUpIndicator;
|
W_Pixmap *popUpIndicator;
|
||||||
|
|
||||||
struct W_Pixmap *checkMark;
|
W_Pixmap *checkMark;
|
||||||
|
|
||||||
struct W_Pixmap *homeIcon;
|
W_Pixmap *homeIcon;
|
||||||
struct W_Pixmap *altHomeIcon;
|
W_Pixmap *altHomeIcon;
|
||||||
|
|
||||||
struct W_Pixmap *trashcanIcon;
|
W_Pixmap *trashcanIcon;
|
||||||
struct W_Pixmap *altTrashcanIcon;
|
W_Pixmap *altTrashcanIcon;
|
||||||
|
|
||||||
struct W_Pixmap *createDirIcon;
|
W_Pixmap *createDirIcon;
|
||||||
struct W_Pixmap *altCreateDirIcon;
|
W_Pixmap *altCreateDirIcon;
|
||||||
|
|
||||||
struct W_Pixmap *disketteIcon;
|
W_Pixmap *disketteIcon;
|
||||||
struct W_Pixmap *altDisketteIcon;
|
W_Pixmap *altDisketteIcon;
|
||||||
struct W_Pixmap *unmountIcon;
|
W_Pixmap *unmountIcon;
|
||||||
struct W_Pixmap *altUnmountIcon;
|
W_Pixmap *altUnmountIcon;
|
||||||
|
|
||||||
struct W_Pixmap *magnifyIcon;
|
W_Pixmap *magnifyIcon;
|
||||||
/*struct W_Pixmap *altMagnifyIcon;*/
|
/*W_Pixmap *altMagnifyIcon;*/
|
||||||
struct W_Pixmap *wheelIcon;
|
W_Pixmap *wheelIcon;
|
||||||
struct W_Pixmap *grayIcon;
|
W_Pixmap *grayIcon;
|
||||||
struct W_Pixmap *rgbIcon;
|
W_Pixmap *rgbIcon;
|
||||||
struct W_Pixmap *cmykIcon;
|
W_Pixmap *cmykIcon;
|
||||||
struct W_Pixmap *hsbIcon;
|
W_Pixmap *hsbIcon;
|
||||||
struct W_Pixmap *customPaletteIcon;
|
W_Pixmap *customPaletteIcon;
|
||||||
struct W_Pixmap *colorListIcon;
|
W_Pixmap *colorListIcon;
|
||||||
|
|
||||||
struct W_Pixmap *defaultObjectIcon;
|
W_Pixmap *defaultObjectIcon;
|
||||||
|
|
||||||
Cursor defaultCursor;
|
Cursor defaultCursor;
|
||||||
|
|
||||||
@@ -323,24 +267,268 @@ typedef struct W_Screen {
|
|||||||
unsigned ignoreNextDoubleClick:1;
|
unsigned ignoreNextDoubleClick:1;
|
||||||
} W_Screen;
|
} W_Screen;
|
||||||
|
|
||||||
|
#define W_DRAWABLE(scr) (scr)->rcontext->drawable
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ configuration.c ]------------------------------------------------- */
|
||||||
|
|
||||||
|
void W_ReadConfigurations(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ drag*.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct W_DragOperationItem {
|
||||||
|
WMDragOperationType type;
|
||||||
|
char* text;
|
||||||
|
} W_DragOperationItem;
|
||||||
|
|
||||||
|
typedef void* W_DndState(WMView *destView, XClientMessageEvent *event,
|
||||||
|
WMDraggingInfo *info);
|
||||||
|
|
||||||
|
typedef struct W_DragSourceInfo {
|
||||||
|
WMView *sourceView;
|
||||||
|
Window destinationWindow;
|
||||||
|
W_DndState *state;
|
||||||
|
WMSelectionProcs *selectionProcs;
|
||||||
|
Window icon;
|
||||||
|
WMPoint imageLocation;
|
||||||
|
WMPoint mouseOffset; /* mouse pos in icon */
|
||||||
|
Cursor dragCursor;
|
||||||
|
WMRect noPositionMessageZone;
|
||||||
|
Atom firstThreeTypes[3];
|
||||||
|
} W_DragSourceInfo;
|
||||||
|
|
||||||
|
typedef struct W_DragDestinationInfo {
|
||||||
|
WMView *destView;
|
||||||
|
WMView *xdndAwareView;
|
||||||
|
Window sourceWindow;
|
||||||
|
W_DndState *state;
|
||||||
|
Bool sourceActionChanged;
|
||||||
|
WMArray *sourceTypes;
|
||||||
|
WMArray *requiredTypes;
|
||||||
|
Bool typeListAvailable;
|
||||||
|
WMArray *dropDatas;
|
||||||
|
} W_DragDestinationInfo;
|
||||||
|
|
||||||
|
/* -- Functions -- */
|
||||||
|
|
||||||
|
void W_HandleDNDClientMessage(WMView *toplevel, XClientMessageEvent *event);
|
||||||
|
|
||||||
|
Atom W_OperationToAction(WMScreen *scr, WMDragOperationType operation);
|
||||||
|
|
||||||
|
WMDragOperationType W_ActionToOperation(WMScreen *scr, Atom action);
|
||||||
|
|
||||||
|
void W_FreeDragOperationItem(void* item);
|
||||||
|
|
||||||
|
Bool W_SendDnDClientMessage(Display *dpy, Window win, Atom message,
|
||||||
|
unsigned long data1, unsigned long data2,
|
||||||
|
unsigned long data3, unsigned long data4,
|
||||||
|
unsigned long data5);
|
||||||
|
|
||||||
|
void W_DragSourceStartTimer(WMDraggingInfo *info);
|
||||||
|
|
||||||
|
void W_DragSourceStopTimer(void);
|
||||||
|
|
||||||
|
void W_DragSourceStateHandler(WMDraggingInfo *info, XClientMessageEvent *event);
|
||||||
|
|
||||||
|
void W_DragDestinationStartTimer(WMDraggingInfo *info);
|
||||||
|
|
||||||
|
void W_DragDestinationStopTimer(void);
|
||||||
|
|
||||||
|
void W_DragDestinationStoreEnterMsgInfo(WMDraggingInfo *info, WMView *toplevel,
|
||||||
|
XClientMessageEvent *event);
|
||||||
|
|
||||||
|
void W_DragDestinationStorePositionMsgInfo(WMDraggingInfo *info,
|
||||||
|
WMView *toplevel,
|
||||||
|
XClientMessageEvent *event);
|
||||||
|
|
||||||
|
void W_DragDestinationCancelDropOnEnter(WMView *toplevel, WMDraggingInfo *info);
|
||||||
|
|
||||||
|
void W_DragDestinationStateHandler(WMDraggingInfo *info,
|
||||||
|
XClientMessageEvent *event);
|
||||||
|
|
||||||
|
void W_DragDestinationInfoClear(WMDraggingInfo *info);
|
||||||
|
|
||||||
|
void W_FreeViewXdndPart(WMView *view);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ handlers.c ]------------------------------------------------------ */
|
||||||
|
|
||||||
|
Bool W_CheckIdleHandlers(void);
|
||||||
|
|
||||||
|
void W_CheckTimerHandlers(void);
|
||||||
|
|
||||||
|
Bool W_HandleInputEvents(Bool waitForInput, int inputfd);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ notification.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
|
void W_InitNotificationCenter(void);
|
||||||
|
|
||||||
|
void W_ReleaseNotificationCenter(void);
|
||||||
|
|
||||||
|
void W_FlushASAPNotificationQueue(void);
|
||||||
|
|
||||||
|
void W_FlushIdleNotificationQueue(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ selection.c ]----------------------------------------------------- */
|
||||||
|
|
||||||
|
void W_HandleSelectionEvent(XEvent *event);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wapplication.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct W_Application {
|
||||||
|
char *applicationName;
|
||||||
|
int argc;
|
||||||
|
char **argv;
|
||||||
|
char *resourcePath;
|
||||||
|
} W_Application;
|
||||||
|
|
||||||
|
/* -- Functions -- */
|
||||||
|
|
||||||
|
void W_InitApplication(WMScreen *scr);
|
||||||
|
|
||||||
|
Bool W_ApplicationInitialized(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wballoon.c ]------------------------------------------------------ */
|
||||||
|
|
||||||
|
struct W_Balloon *W_CreateBalloon(WMScreen *scr);
|
||||||
|
|
||||||
|
void W_BalloonHandleEnterView(WMView *view);
|
||||||
|
|
||||||
|
void W_BalloonHandleLeaveView(WMView *view);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wcolor.c ]-------------------------------------------------------- */
|
||||||
|
|
||||||
|
struct W_Color {
|
||||||
|
struct W_Screen *screen;
|
||||||
|
|
||||||
|
XColor color;
|
||||||
|
unsigned short alpha;
|
||||||
|
short refCount;
|
||||||
|
GC gc;
|
||||||
|
struct {
|
||||||
|
unsigned int exact:1;
|
||||||
|
} flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define W_PIXEL(c) (c)->color.pixel
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wevent.c ]-------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct W_EventHandler {
|
||||||
|
unsigned long eventMask;
|
||||||
|
|
||||||
|
WMEventProc *proc;
|
||||||
|
|
||||||
|
void *clientData;
|
||||||
|
} W_EventHandler;
|
||||||
|
|
||||||
|
/* -- Functions -- */
|
||||||
|
|
||||||
|
void W_CallDestroyHandlers(W_View *view);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wfont.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct W_Font {
|
||||||
|
struct W_Screen *screen;
|
||||||
|
|
||||||
|
struct _XftFont *font;
|
||||||
|
|
||||||
|
short height;
|
||||||
|
short y;
|
||||||
|
short refCount;
|
||||||
|
char *name;
|
||||||
|
} W_Font;
|
||||||
|
|
||||||
|
#define W_FONTID(f) (f)->font->fid
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ widgets.c ]------------------------------------------------------- */
|
||||||
|
|
||||||
|
#define WC_UserWidget 128
|
||||||
|
|
||||||
|
#define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
|
||||||
|
|
||||||
|
#define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
|
||||||
|
#define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
|
||||||
|
|
||||||
|
/* -- Functions -- */
|
||||||
|
|
||||||
|
W_Class W_RegisterUserWidget(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ winputmethod.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
|
void W_InitIM(WMScreen *scr);
|
||||||
|
|
||||||
|
void W_CreateIC(WMView *view);
|
||||||
|
|
||||||
|
void W_DestroyIC(WMView *view);
|
||||||
|
|
||||||
|
void W_FocusIC(WMView *view);
|
||||||
|
|
||||||
|
void W_UnFocusIC(WMView *view);
|
||||||
|
|
||||||
|
void W_SetPreeditPositon(W_View *view, int x, int y);
|
||||||
|
|
||||||
|
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
|
||||||
|
int buflen, KeySym *keysym, Status *status);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wmisc.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
|
void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
|
||||||
|
unsigned int height, WMReliefType relief);
|
||||||
|
|
||||||
|
void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
|
||||||
|
unsigned int width, unsigned int height,
|
||||||
|
WMReliefType relief,
|
||||||
|
GC black, GC dark, GC light, GC white);
|
||||||
|
|
||||||
|
void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
|
||||||
|
W_Font *font, WMReliefType relief, const char *text,
|
||||||
|
WMAlignment alignment, W_Pixmap *image,
|
||||||
|
WMImagePosition position, WMColor *backColor, int ofs);
|
||||||
|
|
||||||
|
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
||||||
|
int width, WMAlignment alignment, WMColor *color,
|
||||||
|
int wrap, const char *text, int length);
|
||||||
|
|
||||||
|
int W_GetTextHeight(WMFont *font, const char *text, int width, int wrap);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wpixmap.c ]------------------------------------------------------- */
|
||||||
|
|
||||||
|
struct W_Pixmap {
|
||||||
|
struct W_Screen *screen;
|
||||||
|
Pixmap pixmap;
|
||||||
|
Pixmap mask;
|
||||||
|
unsigned short width;
|
||||||
|
unsigned short height;
|
||||||
|
short depth;
|
||||||
|
short refCount;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ wview.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
typedef struct W_ViewDelegate {
|
typedef struct W_ViewDelegate {
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
void (*didMove)(struct W_ViewDelegate*, WMView*);
|
void (*didMove)(struct W_ViewDelegate*, WMView*);
|
||||||
|
|
||||||
void (*didResize)(struct W_ViewDelegate*, WMView*);
|
void (*didResize)(struct W_ViewDelegate*, WMView*);
|
||||||
|
|
||||||
void (*willMove)(struct W_ViewDelegate*, WMView*, int*, int*);
|
void (*willMove)(struct W_ViewDelegate*, WMView*, int*, int*);
|
||||||
|
|
||||||
void (*willResize)(struct W_ViewDelegate*, WMView*,
|
void (*willResize)(struct W_ViewDelegate*, WMView*,
|
||||||
unsigned int*, unsigned int*);
|
unsigned int*, unsigned int*);
|
||||||
} W_ViewDelegate;
|
} W_ViewDelegate;
|
||||||
|
|
||||||
|
struct W_View {
|
||||||
|
|
||||||
typedef struct W_View {
|
|
||||||
struct W_Screen *screen;
|
struct W_Screen *screen;
|
||||||
|
|
||||||
WMWidget *self; /* must point to the widget the view belongs to */
|
WMWidget *self; /* must point to the widget the view belongs to */
|
||||||
@@ -413,40 +601,7 @@ typedef struct W_View {
|
|||||||
} flags;
|
} flags;
|
||||||
|
|
||||||
int refCount;
|
int refCount;
|
||||||
} W_View;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_EventHandler {
|
|
||||||
unsigned long eventMask;
|
|
||||||
|
|
||||||
WMEventProc *proc;
|
|
||||||
|
|
||||||
void *clientData;
|
|
||||||
} W_EventHandler;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _WINGsConfiguration {
|
|
||||||
char *systemFont;
|
|
||||||
char *boldSystemFont;
|
|
||||||
int defaultFontSize;
|
|
||||||
Bool antialiasedText;
|
|
||||||
char *floppyPath;
|
|
||||||
unsigned doubleClickDelay;
|
|
||||||
unsigned mouseWheelUp;
|
|
||||||
unsigned mouseWheelDown;
|
|
||||||
} _WINGsConfiguration;
|
|
||||||
|
|
||||||
extern _WINGsConfiguration WINGsConfiguration;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
|
|
||||||
|
|
||||||
|
|
||||||
#define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
|
|
||||||
#define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
|
|
||||||
|
|
||||||
#define W_VIEW_REALIZED(view) (view)->flags.realized
|
#define W_VIEW_REALIZED(view) (view)->flags.realized
|
||||||
#define W_VIEW_MAPPED(view) (view)->flags.mapped
|
#define W_VIEW_MAPPED(view) (view)->flags.mapped
|
||||||
@@ -458,14 +613,7 @@ extern _WINGsConfiguration WINGsConfiguration;
|
|||||||
#define W_VIEW_WIDTH(view) (view)->size.width
|
#define W_VIEW_WIDTH(view) (view)->size.width
|
||||||
#define W_VIEW_HEIGHT(view) (view)->size.height
|
#define W_VIEW_HEIGHT(view) (view)->size.height
|
||||||
|
|
||||||
|
/* -- Functions -- */
|
||||||
#define W_PIXEL(c) (c)->color.pixel
|
|
||||||
|
|
||||||
#define W_FONTID(f) (f)->font->fid
|
|
||||||
|
|
||||||
#define W_DRAWABLE(scr) (scr)->rcontext->drawable
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
W_View *W_GetViewForXWindow(Display *display, Window window);
|
W_View *W_GetViewForXWindow(Display *display, Window window);
|
||||||
|
|
||||||
@@ -475,20 +623,20 @@ W_View *W_CreateTopView(W_Screen *screen);
|
|||||||
|
|
||||||
W_View *W_CreateUnmanagedTopView(W_Screen *screen);
|
W_View *W_CreateUnmanagedTopView(W_Screen *screen);
|
||||||
|
|
||||||
|
|
||||||
W_View *W_CreateRootView(W_Screen *screen);
|
W_View *W_CreateRootView(W_Screen *screen);
|
||||||
|
|
||||||
void W_DestroyView(W_View *view);
|
void W_DestroyView(W_View *view);
|
||||||
|
|
||||||
void W_RealizeView(W_View *view);
|
void W_RealizeView(W_View *view);
|
||||||
|
|
||||||
|
void W_RedisplayView(WMView *view);
|
||||||
|
|
||||||
void W_ReparentView(W_View *view, W_View *newParent, int x, int y);
|
void W_ReparentView(W_View *view, W_View *newParent, int x, int y);
|
||||||
|
|
||||||
void W_RaiseView(W_View *view);
|
void W_RaiseView(W_View *view);
|
||||||
|
|
||||||
void W_LowerView(W_View *view);
|
void W_LowerView(W_View *view);
|
||||||
|
|
||||||
|
|
||||||
void W_MapView(W_View *view);
|
void W_MapView(W_View *view);
|
||||||
|
|
||||||
void W_MapSubviews(W_View *view);
|
void W_MapSubviews(W_View *view);
|
||||||
@@ -499,6 +647,10 @@ W_View *W_TopLevelOfView(W_View *view);
|
|||||||
|
|
||||||
void W_UnmapView(W_View *view);
|
void W_UnmapView(W_View *view);
|
||||||
|
|
||||||
|
WMView *W_RetainView(WMView *view);
|
||||||
|
|
||||||
|
void W_ReleaseView(WMView *view);
|
||||||
|
|
||||||
void W_MoveView(W_View *view, int x, int y);
|
void W_MoveView(W_View *view, int x, int y);
|
||||||
|
|
||||||
void W_ResizeView(W_View *view, unsigned int width, unsigned int height);
|
void W_ResizeView(W_View *view, unsigned int width, unsigned int height);
|
||||||
@@ -507,132 +659,17 @@ void W_SetViewBackgroundColor(W_View *view, WMColor *color);
|
|||||||
|
|
||||||
void W_SetViewCursor(W_View *view, Cursor cursor);
|
void W_SetViewCursor(W_View *view, Cursor cursor);
|
||||||
|
|
||||||
void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
|
void W_SetFocusOfTopLevel(W_View *toplevel, W_View *view);
|
||||||
unsigned int height, WMReliefType relief);
|
|
||||||
|
|
||||||
void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
|
|
||||||
unsigned int width, unsigned int height,
|
|
||||||
WMReliefType relief,
|
|
||||||
GC black, GC dark, GC light, GC white);
|
|
||||||
|
|
||||||
void W_CallDestroyHandlers(W_View *view);
|
|
||||||
|
|
||||||
void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
|
|
||||||
W_Font *font, WMReliefType relief, char *text,
|
|
||||||
WMAlignment alignment, W_Pixmap *image,
|
|
||||||
WMImagePosition position, WMColor *backColor, int ofs);
|
|
||||||
|
|
||||||
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
|
||||||
int width, WMAlignment alignment, WMColor *color,
|
|
||||||
int wrap, char *text, int length);
|
|
||||||
|
|
||||||
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
|
|
||||||
|
|
||||||
|
|
||||||
int W_TextWidth(WMFont *font, char *text, int length);
|
|
||||||
|
|
||||||
|
W_View *W_FocusedViewOfToplevel(W_View *view);
|
||||||
|
|
||||||
void W_BroadcastMessage(W_View *targetParent, XEvent *event);
|
void W_BroadcastMessage(W_View *targetParent, XEvent *event);
|
||||||
|
|
||||||
void W_DispatchMessage(W_View *target, XEvent *event);
|
void W_DispatchMessage(W_View *target, XEvent *event);
|
||||||
|
|
||||||
void W_SetFocusOfToplevel(W_View *toplevel, W_View *view);
|
|
||||||
|
|
||||||
W_View *W_FocusedViewOfToplevel(W_View *view);
|
|
||||||
|
|
||||||
void W_SetFocusOfTopLevel(W_View *toplevel, W_View *view);
|
|
||||||
|
|
||||||
void W_ReleaseView(WMView *view);
|
|
||||||
|
|
||||||
WMView *W_RetainView(WMView *view);
|
|
||||||
|
|
||||||
void W_InitApplication(WMScreen *scr);
|
|
||||||
|
|
||||||
void W_InitNotificationCenter(void);
|
|
||||||
|
|
||||||
W_Class W_RegisterUserWidget(void);
|
|
||||||
|
|
||||||
void W_RedisplayView(WMView *view);
|
|
||||||
|
|
||||||
Bool W_ApplicationInitialized(void);
|
|
||||||
|
|
||||||
void W_HandleSelectionEvent(XEvent *event);
|
|
||||||
|
|
||||||
void W_HandleDNDClientMessage(WMView *toplevel, XClientMessageEvent *event);
|
|
||||||
|
|
||||||
void W_FlushASAPNotificationQueue(void);
|
|
||||||
|
|
||||||
void W_FlushIdleNotificationQueue(void);
|
|
||||||
|
|
||||||
struct W_Balloon *W_CreateBalloon(WMScreen *scr);
|
|
||||||
|
|
||||||
void W_BalloonHandleEnterView(WMView *view);
|
|
||||||
|
|
||||||
void W_BalloonHandleLeaveView(WMView *view);
|
|
||||||
|
|
||||||
Bool W_CheckIdleHandlers(void);
|
|
||||||
|
|
||||||
void W_CheckTimerHandlers(void);
|
|
||||||
|
|
||||||
Bool W_HandleInputEvents(Bool waitForInput, int inputfd);
|
|
||||||
|
|
||||||
/* XDnD */
|
|
||||||
Atom W_OperationToAction(WMScreen *scr, WMDragOperationType operation);
|
|
||||||
|
|
||||||
WMDragOperationType W_ActionToOperation(WMScreen *scr, Atom action);
|
|
||||||
|
|
||||||
void W_FreeDragOperationItem(void* item);
|
|
||||||
|
|
||||||
Bool W_SendDnDClientMessage(Display *dpy, Window win, Atom message,
|
|
||||||
unsigned long data1, unsigned long data2,
|
|
||||||
unsigned long data3, unsigned long data4,
|
|
||||||
unsigned long data5);
|
|
||||||
|
|
||||||
void W_DragSourceStartTimer(WMDraggingInfo *info);
|
|
||||||
|
|
||||||
void W_DragSourceStopTimer();
|
|
||||||
|
|
||||||
void W_DragSourceStateHandler(WMDraggingInfo *info, XClientMessageEvent *event);
|
|
||||||
|
|
||||||
void W_DragDestinationStartTimer(WMDraggingInfo *info);
|
|
||||||
|
|
||||||
void W_DragDestinationStopTimer();
|
|
||||||
|
|
||||||
void W_DragDestinationStoreEnterMsgInfo(WMDraggingInfo *info, WMView *toplevel,
|
|
||||||
XClientMessageEvent *event);
|
|
||||||
|
|
||||||
void W_DragDestinationStorePositionMsgInfo(WMDraggingInfo *info,
|
|
||||||
WMView *toplevel,
|
|
||||||
XClientMessageEvent *event);
|
|
||||||
|
|
||||||
void W_DragDestinationCancelDropOnEnter(WMView *toplevel, WMDraggingInfo *info);
|
|
||||||
|
|
||||||
void W_DragDestinationStateHandler(WMDraggingInfo *info,
|
|
||||||
XClientMessageEvent *event);
|
|
||||||
|
|
||||||
void W_DragDestinationInfoClear(WMDraggingInfo *info);
|
|
||||||
|
|
||||||
void W_FreeViewXdndPart(WMView *view);
|
|
||||||
|
|
||||||
/* XIM */
|
|
||||||
void W_InitIM(WMScreen *scr);
|
|
||||||
|
|
||||||
void W_CreateIC(WMView *view);
|
|
||||||
|
|
||||||
void W_DestroyIC(WMView *view);
|
|
||||||
|
|
||||||
void W_FocusIC(WMView *view);
|
|
||||||
|
|
||||||
void W_UnFocusIC(WMView *view);
|
|
||||||
|
|
||||||
void W_SetPreeditPositon(W_View *view, int x, int y);
|
|
||||||
|
|
||||||
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
|
|
||||||
int buflen, KeySym *keysym, Status *status);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* _WINGSP_H_ */
|
#endif /* _WINGSP_H_ */
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/* WUtil.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 1998 scottc
|
||||||
|
* Copyright (c) 1999-2004 Dan Pascu
|
||||||
|
* Copyright (c) 1999-2000 Alfredo K. Kojima
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _WUTIL_H_
|
#ifndef _WUTIL_H_
|
||||||
#define _WUTIL_H_
|
#define _WUTIL_H_
|
||||||
|
|
||||||
@@ -19,51 +40,56 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ASSERT_FUNCTION
|
#ifndef __GNUC__
|
||||||
# if (!defined (__GNUC__) || (__GNUC__ < 2 && \
|
#define __attribute__(x) /*NOTHING*/
|
||||||
__GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)))
|
|
||||||
# define __ASSERT_FUNCTION ((char *) 0)
|
|
||||||
# else
|
|
||||||
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
|
||||||
#define wassertr(expr) {}
|
#define wassertr(expr) \
|
||||||
#define wassertrv(expr, val) {}
|
if (!(expr)) { return; }
|
||||||
|
|
||||||
|
#define wassertrv(expr, val) \
|
||||||
|
if (!(expr)) { return (val); }
|
||||||
|
|
||||||
#else /* !NDEBUG */
|
#else /* !NDEBUG */
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#define wassertr(expr) assert(expr)
|
|
||||||
|
|
||||||
#define wassertrv(expr, val) assert(expr)
|
|
||||||
|
|
||||||
#else /* !DEBUG */
|
|
||||||
|
|
||||||
#define wassertr(expr) \
|
#define wassertr(expr) \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
wwarning("%s line %i (%s): assertion %s failed",\
|
wwarning("wassertr: assertion %s failed", #expr); \
|
||||||
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
|
|
||||||
return;\
|
return;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wassertrv(expr, val) \
|
#define wassertrv(expr, val) \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
wwarning("%s line %i (%s): assertion %s failed",\
|
wwarning("wassertrv: assertion %s failed", #expr); \
|
||||||
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
|
|
||||||
return (val);\
|
return (val);\
|
||||||
}
|
}
|
||||||
#endif /* !DEBUG */
|
|
||||||
|
|
||||||
#endif /* !NDEBUG */
|
#endif /* !NDEBUG */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef static_assert
|
||||||
|
# define _wutil_static_assert(check, message) static_assert(check, message)
|
||||||
|
#else
|
||||||
|
# ifdef __STDC_VERSION__
|
||||||
|
# if __STDC_VERSION__ >= 201112L
|
||||||
|
/*
|
||||||
|
* Ideally, we would like to include <assert.h> to have 'static_assert'
|
||||||
|
* properly defined, but as we have to be sure about portability and
|
||||||
|
* because we're a public header we can't count on 'configure' to tell
|
||||||
|
* us about availability, so we use the raw C11 keyword
|
||||||
|
*/
|
||||||
|
# define _wutil_static_assert(check, message) _Static_assert(check, message)
|
||||||
|
# else
|
||||||
|
# define _wutil_static_assert(check, message) /**/
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define _wutil_static_assert(check, message) /**/
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
@@ -83,27 +109,6 @@ typedef enum {
|
|||||||
} WMNotificationCoalescing;
|
} WMNotificationCoalescing;
|
||||||
|
|
||||||
|
|
||||||
/* The possible states for connections */
|
|
||||||
typedef enum {
|
|
||||||
WCNotConnected=0,
|
|
||||||
WCListening,
|
|
||||||
WCInProgress,
|
|
||||||
WCFailed,
|
|
||||||
WCConnected,
|
|
||||||
WCTimedOut,
|
|
||||||
WCDied,
|
|
||||||
WCClosed
|
|
||||||
} WMConnectionState;
|
|
||||||
|
|
||||||
|
|
||||||
/* The possible states for connection timeouts */
|
|
||||||
typedef enum {
|
|
||||||
WCTNone=0,
|
|
||||||
WCTWhileOpening,
|
|
||||||
WCTWhileSending
|
|
||||||
} WMConnectionTimeoutState;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
WBNotFound = INT_MIN, /* element was not found in WMBag */
|
WBNotFound = INT_MIN, /* element was not found in WMBag */
|
||||||
@@ -135,11 +140,12 @@ typedef void WMInputProc(int fd, int mask, void *clientData);
|
|||||||
|
|
||||||
|
|
||||||
typedef int WMCompareDataProc(const void *item1, const void *item2);
|
typedef int WMCompareDataProc(const void *item1, const void *item2);
|
||||||
|
typedef void WMTreeWalkProc(WMTreeNode *aNode, void *data);
|
||||||
|
|
||||||
typedef void WMFreeDataProc(void *data);
|
typedef void WMFreeDataProc(void *data);
|
||||||
|
|
||||||
/* Used by WMBag or WMArray for matching data */
|
/* Used by WMBag or WMArray for matching data */
|
||||||
typedef int WMMatchDataProc(void *item, void *cdata);
|
typedef int WMMatchDataProc(const void *item, const void *cdata);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -174,84 +180,82 @@ typedef int WMArrayIterator;
|
|||||||
typedef void *WMBagIterator;
|
typedef void *WMBagIterator;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
typedef struct {
|
|
||||||
char character; /* the escape character */
|
|
||||||
char *value; /* value to place */
|
|
||||||
} WMSEscapes;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* The connection callbacks */
|
|
||||||
typedef struct ConnectionDelegate {
|
|
||||||
void *data;
|
|
||||||
|
|
||||||
void (*canResumeSending)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
void (*didCatchException)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
void (*didDie)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
void (*didInitialize)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
void (*didReceiveInput)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
void (*didTimeout)(struct ConnectionDelegate *self, WMConnection *cPtr);
|
|
||||||
|
|
||||||
} ConnectionDelegate;
|
|
||||||
|
|
||||||
|
|
||||||
typedef void WMNotificationObserverAction(void *observerData,
|
typedef void WMNotificationObserverAction(void *observerData,
|
||||||
WMNotification *notification);
|
WMNotification *notification);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ Macros ]---------------------------------------------------------- */
|
||||||
|
|
||||||
/*......................................................................*/
|
#define wlengthof(array) \
|
||||||
|
({ \
|
||||||
|
_wutil_static_assert(sizeof(array) > sizeof(array[0]), \
|
||||||
|
"the macro 'wlengthof' cannot be used on pointers, only on known size arrays"); \
|
||||||
|
sizeof(array) / sizeof(array[0]); \
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/* ---[ WINGs/memory.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
|
void* wmalloc(size_t size);
|
||||||
|
void* wrealloc(void *ptr, size_t newsize);
|
||||||
|
void wfree(void *ptr);
|
||||||
|
|
||||||
|
void wrelease(void *ptr);
|
||||||
|
void* wretain(void *ptr);
|
||||||
|
|
||||||
typedef void waborthandler(int);
|
typedef void waborthandler(int);
|
||||||
|
|
||||||
waborthandler* wsetabort(waborthandler* handler);
|
waborthandler* wsetabort(waborthandler* handler);
|
||||||
|
|
||||||
|
/* ---[ WINGs/error.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
WMESSAGE_TYPE_MESSAGE,
|
||||||
|
WMESSAGE_TYPE_WARNING,
|
||||||
|
WMESSAGE_TYPE_ERROR,
|
||||||
|
WMESSAGE_TYPE_FATAL
|
||||||
|
};
|
||||||
|
|
||||||
|
#define wmessage(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_MESSAGE, fmt, ## args)
|
||||||
|
#define wwarning(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_WARNING, fmt, ## args)
|
||||||
|
#define werror(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_ERROR, fmt, ## args)
|
||||||
|
#define wfatal(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_FATAL, fmt, ## args)
|
||||||
|
|
||||||
|
void __wmessage(const char *func, const char *file, int line, int type, const char *msg, ...)
|
||||||
|
__attribute__((__format__(printf,5,6)));
|
||||||
|
|
||||||
|
/* ---[ WINGs/findfile.c ]------------------------------------------------ */
|
||||||
|
|
||||||
|
/* For the 4 function below, you have to free the returned string when you no longer need it */
|
||||||
|
|
||||||
|
char* wfindfile(const char *paths, const char *file);
|
||||||
|
|
||||||
|
char* wfindfileinlist(char *const *path_list, const char *file);
|
||||||
|
|
||||||
|
char* wfindfileinarray(WMPropList* array, const char *file);
|
||||||
|
|
||||||
|
char* wexpandpath(const char *path);
|
||||||
|
|
||||||
|
int wcopy_file(const char *toPath, const char *srcFile, const char *destFile);
|
||||||
|
|
||||||
/* don't free the returned string */
|
/* don't free the returned string */
|
||||||
char* wstrerror(int errnum);
|
char* wgethomedir(void);
|
||||||
|
|
||||||
void wmessage(const char *msg, ...);
|
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
|
||||||
void wwarning(const char *msg, ...);
|
|
||||||
void wfatal(const char *msg, ...);
|
|
||||||
void wsyserror(const char *msg, ...);
|
|
||||||
void wsyserrorwithcode(int error, const char *msg, ...);
|
|
||||||
|
|
||||||
char* wfindfile(char *paths, char *file);
|
int wmkdirhier(const char *path);
|
||||||
|
int wrmdirhier(const char *path);
|
||||||
|
|
||||||
char* wfindfileinlist(char **path_list, char *file);
|
/* ---[ WINGs/string.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
char* wfindfileinarray(WMPropList* array, char *file);
|
char *wstrdup(const char *str);
|
||||||
|
char* wstrndup(const char *str, size_t len);
|
||||||
char* wexpandpath(char *path);
|
|
||||||
|
|
||||||
/* don't free the returned string */
|
|
||||||
char* wgethomedir();
|
|
||||||
|
|
||||||
void* wmalloc(size_t size);
|
|
||||||
void* wmalloc0(size_t size);
|
|
||||||
void* wrealloc(void *ptr, size_t newsize);
|
|
||||||
void wfree(void *ptr);
|
|
||||||
|
|
||||||
#define wnew(type, count) wmalloc(sizeof(type)*count)
|
|
||||||
#define wnew0(type, count) wmalloc0(sizeof(type)*count)
|
|
||||||
|
|
||||||
void wrelease(void *ptr);
|
|
||||||
void* wretain(void *ptr);
|
|
||||||
|
|
||||||
char* wstrdup(char *str);
|
|
||||||
char* wstrndup(char *str, size_t len);
|
|
||||||
|
|
||||||
/* Concatenate str1 with str2 and return that in a newly malloc'ed string.
|
/* Concatenate str1 with str2 and return that in a newly malloc'ed string.
|
||||||
* str1 and str2 can be any strings including static and constant strings.
|
* str1 and str2 can be any strings including static and constant strings.
|
||||||
* str1 and str2 will not be modified.
|
* str1 and str2 will not be modified.
|
||||||
* Free the returned string when you're done with it. */
|
* Free the returned string when you're done with it. */
|
||||||
char* wstrconcat(char *str1, char *str2);
|
char* wstrconcat(const char *str1, const char *str2);
|
||||||
|
|
||||||
/* This will append src to dst, and return dst. dst MUST be either NULL
|
/* This will append src to dst, and return dst. dst MUST be either NULL
|
||||||
* or a string that was a result of a dynamic allocation (malloc, realloc
|
* or a string that was a result of a dynamic allocation (malloc, realloc
|
||||||
@@ -260,7 +264,10 @@ char* wstrconcat(char *str1, char *str2);
|
|||||||
* it is equivalent to calling wstrdup(src) ).
|
* it is equivalent to calling wstrdup(src) ).
|
||||||
* The returned address may be different from the original address of dst,
|
* The returned address may be different from the original address of dst,
|
||||||
* so always assign the returned address to avoid dangling pointers. */
|
* so always assign the returned address to avoid dangling pointers. */
|
||||||
char* wstrappend(char *dst, char *src);
|
char* wstrappend(char *dst, const char *src);
|
||||||
|
|
||||||
|
size_t wstrlcpy(char *, const char *, size_t);
|
||||||
|
size_t wstrlcat(char *, const char *, size_t);
|
||||||
|
|
||||||
|
|
||||||
void wtokensplit(char *command, char ***argv, int *argc);
|
void wtokensplit(char *command, char ***argv, int *argc);
|
||||||
@@ -271,27 +278,27 @@ char* wtokenjoin(char **list, int count);
|
|||||||
|
|
||||||
void wtokenfree(char **tokens, int count);
|
void wtokenfree(char **tokens, int count);
|
||||||
|
|
||||||
char* wtrimspace(char *s);
|
char* wtrimspace(const char *s);
|
||||||
|
|
||||||
|
/* transform `s' so that the result is safe to pass to the shell as an argument.
|
||||||
|
* returns a newly allocated string.
|
||||||
|
* with very heavy inspirations from NetBSD's shquote(3).
|
||||||
|
*/
|
||||||
|
char *wshellquote(const char *s);
|
||||||
|
|
||||||
|
/* ---[ WINGs/misc.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
WMRange wmkrange(int start, int count);
|
WMRange wmkrange(int start, int count);
|
||||||
#ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
|
|
||||||
#define wmkrange(position, count) (WMRange){(position), (count)}
|
/* An application must call this function before exiting, to let WUtil do some internal cleanup */
|
||||||
#endif
|
void wutil_shutdown(void);
|
||||||
|
|
||||||
|
|
||||||
char* wusergnusteppath();
|
/* ---[ WINGs/usleep.c ]-------------------------------------------------- */
|
||||||
|
|
||||||
char* wdefaultspathfordomain(char *domain);
|
void wusleep(unsigned int usec);
|
||||||
|
|
||||||
void wusleep(unsigned int microsec);
|
/* ---[ WINGs/handlers.c ]------------------------------------------------ */
|
||||||
|
|
||||||
#if 0
|
|
||||||
int wsprintesc(char *buffer, int length, char *format, WMSEscapes **escapes,
|
|
||||||
int count);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*......................................................................*/
|
|
||||||
|
|
||||||
/* Event handlers: timer, idle, input */
|
/* Event handlers: timer, idle, input */
|
||||||
|
|
||||||
@@ -320,12 +327,12 @@ void WMDeleteInputHandler(WMHandlerID handlerID);
|
|||||||
* This function will handle all input/timer/idle events, then return.
|
* This function will handle all input/timer/idle events, then return.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void WHandleEvents();
|
void WHandleEvents(void);
|
||||||
|
|
||||||
/*......................................................................*/
|
/* ---[ WINGs/hashtable.c ]----------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
WMHashTable* WMCreateHashTable(WMHashTableCallbacks callbacks);
|
WMHashTable* WMCreateHashTable(const WMHashTableCallbacks callbacks);
|
||||||
|
|
||||||
void WMFreeHashTable(WMHashTable *table);
|
void WMFreeHashTable(WMHashTable *table);
|
||||||
|
|
||||||
@@ -383,7 +390,7 @@ extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
|
|||||||
/* keys are strings, but they are not copied */
|
/* keys are strings, but they are not copied */
|
||||||
|
|
||||||
|
|
||||||
/*......................................................................*/
|
/* ---[ WINGs/array.c ]--------------------------------------------------- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WMArray use an array to store the elements.
|
* WMArray use an array to store the elements.
|
||||||
@@ -419,8 +426,6 @@ void WMAppendArray(WMArray *array, WMArray *other);
|
|||||||
/* add will place the element at the end of the array */
|
/* add will place the element at the end of the array */
|
||||||
void WMAddToArray(WMArray *array, void *item);
|
void WMAddToArray(WMArray *array, void *item);
|
||||||
|
|
||||||
#define WMPushInArray(array, item) WMAddToArray(array, item)
|
|
||||||
|
|
||||||
/* insert will increment the index of elements after it by 1 */
|
/* insert will increment the index of elements after it by 1 */
|
||||||
void WMInsertInArray(WMArray *array, int index, void *item);
|
void WMInsertInArray(WMArray *array, int index, void *item);
|
||||||
|
|
||||||
@@ -485,7 +490,7 @@ void* WMArrayPrevious(WMArray *array, WMArrayIterator *iter);
|
|||||||
for (var = WMArrayLast(array, &(i)); (i) != WANotFound; \
|
for (var = WMArrayLast(array, &(i)); (i) != WANotFound; \
|
||||||
var = WMArrayPrevious(array, &(i)))
|
var = WMArrayPrevious(array, &(i)))
|
||||||
|
|
||||||
/*..........................................................................*/
|
/* ---[ WINGs/bagtree.c ]------------------------------------------------- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tree bags use a red-black tree for storage.
|
* Tree bags use a red-black tree for storage.
|
||||||
@@ -577,7 +582,7 @@ int WMBagIndexForIterator(WMBag *bag, WMBagIterator ptr);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/* ---[ WINGs/data.c ]---------------------------------------------------- */
|
||||||
|
|
||||||
/* WMData handling */
|
/* WMData handling */
|
||||||
|
|
||||||
@@ -587,7 +592,7 @@ WMData* WMCreateDataWithCapacity(unsigned capacity);
|
|||||||
|
|
||||||
WMData* WMCreateDataWithLength(unsigned length);
|
WMData* WMCreateDataWithLength(unsigned length);
|
||||||
|
|
||||||
WMData* WMCreateDataWithBytes(void *bytes, unsigned length);
|
WMData* WMCreateDataWithBytes(const void *bytes, unsigned length);
|
||||||
|
|
||||||
/* destructor is a function called to free the data when releasing the data
|
/* destructor is a function called to free the data when releasing the data
|
||||||
* object, or NULL if no freeing of data is necesary. */
|
* object, or NULL if no freeing of data is necesary. */
|
||||||
@@ -628,13 +633,13 @@ unsigned WMGetDataLength(WMData *aData);
|
|||||||
|
|
||||||
/* Adding data */
|
/* Adding data */
|
||||||
|
|
||||||
void WMAppendDataBytes(WMData *aData, void *bytes, unsigned length);
|
void WMAppendDataBytes(WMData *aData, const void *bytes, unsigned length);
|
||||||
|
|
||||||
void WMAppendData(WMData *aData, WMData *anotherData);
|
void WMAppendData(WMData *aData, WMData *anotherData);
|
||||||
|
|
||||||
/* Modifying data */
|
/* Modifying data */
|
||||||
|
|
||||||
void WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes);
|
void WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, const void *bytes);
|
||||||
|
|
||||||
void WMResetDataBytesInRange(WMData *aData, WMRange aRange);
|
void WMResetDataBytesInRange(WMData *aData, WMRange aRange);
|
||||||
|
|
||||||
@@ -646,8 +651,7 @@ void WMSetDataFormat(WMData *aData, unsigned format);
|
|||||||
unsigned WMGetDataFormat(WMData *aData);
|
unsigned WMGetDataFormat(WMData *aData);
|
||||||
/* Storing data */
|
/* Storing data */
|
||||||
|
|
||||||
|
/* ---[ WINGs/tree.c ]---------------------------------------------------- */
|
||||||
/*--------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Generic Tree and TreeNode */
|
/* Generic Tree and TreeNode */
|
||||||
|
|
||||||
@@ -686,11 +690,17 @@ void WMSortTree(WMTreeNode *aNode, WMCompareDataProc *comparer);
|
|||||||
/* Returns the first node which matches node's data with cdata by 'match' */
|
/* Returns the first node which matches node's data with cdata by 'match' */
|
||||||
WMTreeNode* WMFindInTree(WMTreeNode *aTree, WMMatchDataProc *match, void *cdata);
|
WMTreeNode* WMFindInTree(WMTreeNode *aTree, WMMatchDataProc *match, void *cdata);
|
||||||
|
|
||||||
|
/* Returns the first node where node's data matches cdata by 'match' and node is
|
||||||
|
* at most `limit' depths down from `aTree'. */
|
||||||
|
WMTreeNode *WMFindInTreeWithDepthLimit(WMTreeNode * aTree, WMMatchDataProc * match, void *cdata, int limit);
|
||||||
|
|
||||||
/* Returns first tree node that has data == cdata */
|
/* Returns first tree node that has data == cdata */
|
||||||
#define WMGetFirstInTree(aTree, cdata) WMFindInTree(aTree, NULL, cdata)
|
#define WMGetFirstInTree(aTree, cdata) WMFindInTree(aTree, NULL, cdata)
|
||||||
|
|
||||||
|
/* Walk every node of aNode with `walk' */
|
||||||
|
void WMTreeWalk(WMTreeNode *aNode, WMTreeWalkProc * walk, void *data, Bool DepthFirst);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/* ---[ WINGs/data.c ]---------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
WMNotification* WMCreateNotification(const char *name, void *object, void *clientData);
|
WMNotification* WMCreateNotification(const char *name, void *object, void *clientData);
|
||||||
@@ -736,17 +746,17 @@ void WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
|
|||||||
unsigned coalesceMask);
|
unsigned coalesceMask);
|
||||||
|
|
||||||
|
|
||||||
/*......................................................................*/
|
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
|
||||||
|
|
||||||
/* Property Lists handling */
|
/* Property Lists handling */
|
||||||
|
|
||||||
void WMPLSetCaseSensitive(Bool caseSensitive);
|
void WMPLSetCaseSensitive(Bool caseSensitive);
|
||||||
|
|
||||||
WMPropList* WMCreatePLString(char *str);
|
WMPropList* WMCreatePLString(const char *str);
|
||||||
|
|
||||||
WMPropList* WMCreatePLData(WMData *data);
|
WMPropList* WMCreatePLData(WMData *data);
|
||||||
|
|
||||||
WMPropList* WMCreatePLDataWithBytes(unsigned char *bytes, unsigned int length);
|
WMPropList* WMCreatePLDataWithBytes(const unsigned char *bytes, unsigned int length);
|
||||||
|
|
||||||
WMPropList* WMCreatePLDataWithBytesNoCopy(unsigned char *bytes,
|
WMPropList* WMCreatePLDataWithBytesNoCopy(unsigned char *bytes,
|
||||||
unsigned int length,
|
unsigned int length,
|
||||||
@@ -829,20 +839,31 @@ WMPropList* WMShallowCopyPropList(WMPropList *plist);
|
|||||||
/* Makes a completely separate replica of the original proplist */
|
/* Makes a completely separate replica of the original proplist */
|
||||||
WMPropList* WMDeepCopyPropList(WMPropList *plist);
|
WMPropList* WMDeepCopyPropList(WMPropList *plist);
|
||||||
|
|
||||||
WMPropList* WMCreatePropListFromDescription(char *desc);
|
WMPropList* WMCreatePropListFromDescription(const char *desc);
|
||||||
|
|
||||||
/* Free the returned string when you no longer need it */
|
/* Free the returned string when you no longer need it */
|
||||||
char* WMGetPropListDescription(WMPropList *plist, Bool indented);
|
char* WMGetPropListDescription(WMPropList *plist, Bool indented);
|
||||||
|
|
||||||
WMPropList* WMReadPropListFromFile(char *file);
|
WMPropList* WMReadPropListFromFile(const char *file);
|
||||||
|
|
||||||
Bool WMWritePropListToFile(WMPropList *plist, char *path, Bool atomically);
|
WMPropList* WMReadPropListFromPipe(const char *command);
|
||||||
|
|
||||||
/*......................................................................*/
|
Bool WMWritePropListToFile(WMPropList *plist, const char *path);
|
||||||
|
|
||||||
|
/* ---[ WINGs/userdefaults.c ]-------------------------------------------- */
|
||||||
|
|
||||||
|
/* don't free the returned string */
|
||||||
|
const char* wusergnusteppath(void);
|
||||||
|
|
||||||
|
/* Free the returned string when you no longer need it */
|
||||||
|
char* wdefaultspathfordomain(const char *domain);
|
||||||
|
|
||||||
|
/* Free the returned string when you no longer need it */
|
||||||
|
char* wglobaldefaultspathfordomain(const char *domain);
|
||||||
|
|
||||||
WMUserDefaults* WMGetStandardUserDefaults(void);
|
WMUserDefaults* WMGetStandardUserDefaults(void);
|
||||||
|
|
||||||
WMUserDefaults* WMGetDefaultsFromPath(char *path);
|
WMUserDefaults* WMGetDefaultsFromPath(const char *path);
|
||||||
|
|
||||||
void WMSynchronizeUserDefaults(WMUserDefaults *database);
|
void WMSynchronizeUserDefaults(WMUserDefaults *database);
|
||||||
|
|
||||||
@@ -855,32 +876,33 @@ void WMEnableUDPeriodicSynchronization(WMUserDefaults *database, Bool enable);
|
|||||||
* Keys in array are just retained references to the original keys */
|
* Keys in array are just retained references to the original keys */
|
||||||
WMPropList* WMGetUDKeys(WMUserDefaults *database);
|
WMPropList* WMGetUDKeys(WMUserDefaults *database);
|
||||||
|
|
||||||
WMPropList* WMGetUDObjectForKey(WMUserDefaults *database, char *defaultName);
|
WMPropList* WMGetUDObjectForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
void WMSetUDObjectForKey(WMUserDefaults *database, WMPropList *object,
|
void WMSetUDObjectForKey(WMUserDefaults *database, WMPropList *object,
|
||||||
char *defaultName);
|
const char *defaultName);
|
||||||
|
|
||||||
void WMRemoveUDObjectForKey(WMUserDefaults *database, char *defaultName);
|
void WMRemoveUDObjectForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
char* WMGetUDStringForKey(WMUserDefaults *database, char *defaultName);
|
/* Returns a reference. Do not free it! */
|
||||||
|
char* WMGetUDStringForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
int WMGetUDIntegerForKey(WMUserDefaults *database, char *defaultName);
|
int WMGetUDIntegerForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
float WMGetUDFloatForKey(WMUserDefaults *database, char *defaultName);
|
float WMGetUDFloatForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
Bool WMGetUDBoolForKey(WMUserDefaults *database, char *defaultName);
|
Bool WMGetUDBoolForKey(WMUserDefaults *database, const char *defaultName);
|
||||||
|
|
||||||
void WMSetUDStringForKey(WMUserDefaults *database, char *value,
|
void WMSetUDStringForKey(WMUserDefaults *database, const char *value,
|
||||||
char *defaultName);
|
const char *defaultName);
|
||||||
|
|
||||||
void WMSetUDIntegerForKey(WMUserDefaults *database, int value,
|
void WMSetUDIntegerForKey(WMUserDefaults *database, int value,
|
||||||
char *defaultName);
|
const char *defaultName);
|
||||||
|
|
||||||
void WMSetUDFloatForKey(WMUserDefaults *database, float value,
|
void WMSetUDFloatForKey(WMUserDefaults *database, float value,
|
||||||
char *defaultName);
|
const char *defaultName);
|
||||||
|
|
||||||
void WMSetUDBoolForKey(WMUserDefaults *database, Bool value,
|
void WMSetUDBoolForKey(WMUserDefaults *database, Bool value,
|
||||||
char *defaultName);
|
const char *defaultName);
|
||||||
|
|
||||||
WMPropList* WMGetUDSearchList(WMUserDefaults *database);
|
WMPropList* WMGetUDSearchList(WMUserDefaults *database);
|
||||||
|
|
||||||
@@ -889,137 +911,28 @@ void WMSetUDSearchList(WMUserDefaults *database, WMPropList *list);
|
|||||||
extern char *WMUserDefaultsDidChangeNotification;
|
extern char *WMUserDefaultsDidChangeNotification;
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/* ---[ WINGs/menuparser.c ]---------------------------------------------- */
|
||||||
|
|
||||||
/* WMHost: host handling */
|
|
||||||
|
|
||||||
WMHost* WMGetCurrentHost();
|
typedef struct w_menu_parser *WMenuParser;
|
||||||
|
|
||||||
WMHost* WMGetHostWithName(char* name);
|
|
||||||
|
|
||||||
WMHost* WMGetHostWithAddress(char* address);
|
WMenuParser WMenuParserCreate(const char *file_name, void *file, const char *include_default_paths);
|
||||||
|
|
||||||
WMHost* WMRetainHost(WMHost *hPtr);
|
void WMenuParserRegisterSimpleMacro(WMenuParser parser, const char *name, const char *value);
|
||||||
|
|
||||||
void WMReleaseHost(WMHost *hPtr);
|
void WMenuParserError(WMenuParser parser, const char *msg, ...)
|
||||||
|
__attribute__ ((format (printf, 2, 3)));
|
||||||
|
|
||||||
/*
|
const char *WMenuParserGetFilename(WMenuParser parser);
|
||||||
* Host cache management
|
|
||||||
* If enabled, only one object representing each host will be created, and
|
|
||||||
* a shared instance will be returned by all methods that return a host.
|
|
||||||
* Enabled by default.
|
|
||||||
*/
|
|
||||||
void WMSetHostCacheEnabled(Bool flag);
|
|
||||||
|
|
||||||
Bool WMIsHostCacheEnabled();
|
Bool WMenuParserGetLine(WMenuParser parser, char **title, char **command, char **parameter, char **shortcut);
|
||||||
|
|
||||||
void WMFlushHostCache();
|
void WMenuParserDelete(WMenuParser parser);
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare hosts: Hosts are equal if they share at least one address
|
|
||||||
*/
|
|
||||||
Bool WMIsHostEqualToHost(WMHost* hPtr, WMHost* anotherHost);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Host names.
|
|
||||||
* WMGetHostName() will return first name (official) if a host has several.
|
|
||||||
* WMGetHostNames() will return a R/O WMArray with all the names of the host.
|
|
||||||
*/
|
|
||||||
char* WMGetHostName(WMHost* hPtr);
|
|
||||||
|
|
||||||
/* The returned array is R/O. Do not modify it, and do not free it! */
|
|
||||||
WMArray* WMGetHostNames(WMHost* hPtr);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Host addresses.
|
|
||||||
* Addresses are represented as "Dotted Decimal" strings, e.g. "192.42.172.1"
|
|
||||||
* WMGetHostAddress() will return an arbitrary address if a host has several.
|
|
||||||
* WMGetHostAddresses() will return a R/O WMArray with all addresses of the host.
|
|
||||||
*/
|
|
||||||
char* WMGetHostAddress(WMHost* hPtr);
|
|
||||||
|
|
||||||
/* The returned array is R/O. Do not modify it, and do not free it! */
|
|
||||||
WMArray* WMGetHostAddresses(WMHost* hPtr);
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/* WMConnection functions */
|
|
||||||
|
|
||||||
WMConnection* WMCreateConnectionAsServerAtAddress(char *host, char *service,
|
|
||||||
char *protocol);
|
|
||||||
|
|
||||||
WMConnection* WMCreateConnectionToAddress(char *host, char *service,
|
|
||||||
char *protocol);
|
|
||||||
|
|
||||||
WMConnection* WMCreateConnectionToAddressAndNotify(char *host, char *service,
|
|
||||||
char *protocol);
|
|
||||||
|
|
||||||
void WMCloseConnection(WMConnection *cPtr);
|
|
||||||
|
|
||||||
void WMDestroyConnection(WMConnection *cPtr);
|
|
||||||
|
|
||||||
WMConnection* WMAcceptConnection(WMConnection *listener);
|
|
||||||
|
|
||||||
/* Release the returned data! */
|
|
||||||
WMData* WMGetConnectionAvailableData(WMConnection *cPtr);
|
|
||||||
|
|
||||||
int WMSendConnectionData(WMConnection *cPtr, WMData *data);
|
|
||||||
|
|
||||||
Bool WMEnqueueConnectionData(WMConnection *cPtr, WMData *data);
|
|
||||||
|
|
||||||
#define WMFlushConnection(cPtr) WMSendConnectionData((cPtr), NULL)
|
|
||||||
|
|
||||||
void WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate);
|
|
||||||
|
|
||||||
/* Connection info */
|
|
||||||
|
|
||||||
char* WMGetConnectionAddress(WMConnection *cPtr);
|
|
||||||
|
|
||||||
char* WMGetConnectionService(WMConnection *cPtr);
|
|
||||||
|
|
||||||
char* WMGetConnectionProtocol(WMConnection *cPtr);
|
|
||||||
|
|
||||||
Bool WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag);
|
|
||||||
|
|
||||||
Bool WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag);
|
|
||||||
|
|
||||||
void WMSetConnectionShutdownOnClose(WMConnection *cPtr, Bool flag);
|
|
||||||
|
|
||||||
void* WMGetConnectionClientData(WMConnection *cPtr);
|
|
||||||
|
|
||||||
void WMSetConnectionClientData(WMConnection *cPtr, void *data);
|
|
||||||
|
|
||||||
unsigned int WMGetConnectionFlags(WMConnection *cPtr);
|
|
||||||
|
|
||||||
void WMSetConnectionFlags(WMConnection *cPtr, unsigned int flags);
|
|
||||||
|
|
||||||
int WMGetConnectionSocket(WMConnection *cPtr);
|
|
||||||
|
|
||||||
WMConnectionState WMGetConnectionState(WMConnection *cPtr);
|
|
||||||
|
|
||||||
WMConnectionTimeoutState WMGetConnectionTimeoutState(WMConnection *cPtr);
|
|
||||||
|
|
||||||
WMArray* WMGetConnectionUnsentData(WMConnection *cPtr);
|
|
||||||
|
|
||||||
#define WMGetConnectionQueuedData(cPtr) WMGetConnectionUnsentData(cPtr)
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Passing timeout==0 in the SetTimeout functions below, will reset that
|
|
||||||
* timeout to its default value.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* The default timeout inherited by all WMConnection operations, if none set */
|
|
||||||
void WMSetConnectionDefaultTimeout(unsigned int timeout);
|
|
||||||
|
|
||||||
/* Global timeout for all WMConnection objects, for opening a new connection */
|
|
||||||
void WMSetConnectionOpenTimeout(unsigned int timeout);
|
|
||||||
|
|
||||||
/* Connection specific timeout for sending out data */
|
|
||||||
void WMSetConnectionSendTimeout(WMConnection *cPtr, unsigned int timeout);
|
|
||||||
|
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
|
||||||
extern int WCErrorCode;
|
extern int WCErrorCode;
|
||||||
@@ -1027,8 +940,6 @@ extern int WCErrorCode;
|
|||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
@@ -1,138 +0,0 @@
|
|||||||
/*
|
|
||||||
* This header file is provided for old libPropList compatibility.
|
|
||||||
* DO _NOT_ USE this except for letting your old libPropList-based code to
|
|
||||||
* work with the new property list code from WINGs, with minimal changes.
|
|
||||||
*
|
|
||||||
* All code written with old libPropList functions should work, given
|
|
||||||
* that the following changes are made:
|
|
||||||
*
|
|
||||||
* 1. Replace all
|
|
||||||
* #include <proplist.h>
|
|
||||||
* with
|
|
||||||
* #include <WINGs/proplist-compat.h>
|
|
||||||
* in your code.
|
|
||||||
*
|
|
||||||
* 2. Change all calls to PLSave() to have the extra filename parameter like:
|
|
||||||
* PLSave(proplist_t proplist, char* filename, Bool atomically)
|
|
||||||
*
|
|
||||||
* 3. The PLSetStringCmpHook() function is no longer available. There is a
|
|
||||||
* similar but simpler function provided which is enough for practical
|
|
||||||
* purposes:
|
|
||||||
* PLSetCaseSensitive(Bool caseSensitive)
|
|
||||||
*
|
|
||||||
* 4. The following functions do no longer exist. They were removed because
|
|
||||||
* they were based on concepts borrowed from UserDefaults which conflict
|
|
||||||
* with the retain/release mechanism:
|
|
||||||
* PLSynchronize(), PLDeepSynchronize(), PLShallowSynchronize()
|
|
||||||
* PLSetFilename(), PLGetFilename()
|
|
||||||
* PLGetContainer()
|
|
||||||
* You should change your code to not use them anymore.
|
|
||||||
*
|
|
||||||
* 5. The following functions are no longer available. They were removed
|
|
||||||
* because they also used borrowed concepts which have no place in a
|
|
||||||
* property list as defined in the OpenStep specifications. Also these
|
|
||||||
* functions were hardly ever used in programs to our knowledge.
|
|
||||||
* PLGetDomainNames(), PLGetDomain(), PLSetDomain(), PLDeleteDomain()
|
|
||||||
* PLRegister(), PLUnregister()
|
|
||||||
* You should also change your code to not use them anymore (in case you
|
|
||||||
* ever used them anyway ;-) ).
|
|
||||||
*
|
|
||||||
* 6. Link your program with libWINGs or libWUtil instead of libPropList.
|
|
||||||
* (libWINGs should be used for GUI apps, while libWUtil for non-GUI apps)
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Our recommandation is to rewrite your code to use the new functions and
|
|
||||||
* link against libWINGs/libWUtil. We do not recommend you to keep using old
|
|
||||||
* libPropList function names. This file is provided just to allow existing
|
|
||||||
* libropList based applications to run with minimal changes with the new
|
|
||||||
* proplist code from WINGs before their authors get the time to rewrite
|
|
||||||
* them. New proplist code from WINGs provide a better integration with the
|
|
||||||
* other data types from WINGs, not to mention that the proplist code in WINGs
|
|
||||||
* is actively maintained while the old libPropList is dead.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _PROPLIST_COMPAT_H_
|
|
||||||
#define _PROPLIST_COMPAT_H_
|
|
||||||
|
|
||||||
#include <WINGs/WUtil.h>
|
|
||||||
|
|
||||||
|
|
||||||
typedef WMPropList* proplist_t;
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef YES
|
|
||||||
#define YES True
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO
|
|
||||||
#define NO False
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define PLSetCaseSensitive(c) WMPLSetCaseSensitive(c)
|
|
||||||
|
|
||||||
#define PLMakeString(bytes) WMCreatePLString(bytes)
|
|
||||||
#define PLMakeData(bytes, length) WMCreatePLDataWithBytes(bytes, length)
|
|
||||||
#define PLMakeArrayFromElements WMCreatePLArray
|
|
||||||
#define PLMakeDictionaryFromEntries WMCreatePLDictionary
|
|
||||||
|
|
||||||
#define PLRetain(pl) WMRetainPropList(pl)
|
|
||||||
#define PLRelease(pl) WMReleasePropList(pl)
|
|
||||||
|
|
||||||
#define PLInsertArrayElement(array, pl, pos) WMInsertInPLArray(array, pos, pl)
|
|
||||||
#define PLAppendArrayElement(array, pl) WMAddToPLArray(array, pl)
|
|
||||||
#define PLRemoveArrayElement(array, pos) WMDeleteFromPLArray(array, pos)
|
|
||||||
#define PLInsertDictionaryEntry(dict, key, value) WMPutInPLDictionary(dict, key, value)
|
|
||||||
#define PLRemoveDictionaryEntry(dict, key) WMRemoveFromPLDictionary(dict, key)
|
|
||||||
#define PLMergeDictionaries(dest, source) WMMergePLDictionaries(dest, source, False)
|
|
||||||
|
|
||||||
#define PLGetNumberOfElements(pl) WMGetPropListItemCount(pl)
|
|
||||||
|
|
||||||
#define PLIsString(pl) WMIsPLString(pl)
|
|
||||||
#define PLIsData(pl) WMIsPLData(pl)
|
|
||||||
#define PLIsArray(pl) WMIsPLArray(pl)
|
|
||||||
#define PLIsDictionary(pl) WMIsPLDictionary(pl)
|
|
||||||
#define PLIsSimple(pl) (WMIsPLString(pl) || WMIsPLData(pl))
|
|
||||||
#define PLIsCompound(pl) (WMIsPLArray(pl) || WMIsPLDictionary(pl))
|
|
||||||
#define PLIsEqual(pl1, pl2) WMIsPropListEqualTo(pl1, pl2)
|
|
||||||
|
|
||||||
#define PLGetString(pl) WMGetFromPLString(pl)
|
|
||||||
#define PLGetDataBytes(pl) WMGetPLDataBytes(pl)
|
|
||||||
#define PLGetDataLength(pl) WMGetPLDataLength(pl)
|
|
||||||
#define PLGetArrayElement(pl, index) WMGetFromPLArray(pl, index)
|
|
||||||
#define PLGetDictionaryEntry(pl, key) WMGetFromPLDictionary(pl, key)
|
|
||||||
#define PLGetAllDictionaryKeys(pl) WMGetPLDictionaryKeys(pl)
|
|
||||||
|
|
||||||
#define PLShallowCopy(pl) WMShallowCopyPropList(pl)
|
|
||||||
#define PLDeepCopy(pl) WMDeepCopyPropList(pl)
|
|
||||||
|
|
||||||
#define PLGetProplistWithDescription(desc) WMCreatePropListFromDescription(desc)
|
|
||||||
#define PLGetDescriptionIndent(pl, level) WMGetPropListDescription(pl, True)
|
|
||||||
#define PLGetDescription(pl) WMGetPropListDescription(pl, False)
|
|
||||||
#define PLGetStringDescription(pl) WMGetPropListDescription(pl, False)
|
|
||||||
#define PLGetDataDescription(pl) WMGetPropListDescription(pl, False)
|
|
||||||
|
|
||||||
#define PLGetProplistWithPath(file) WMReadPropListFromFile(file)
|
|
||||||
#define PLSave(pl, file, atm) WMWritePropListToFile(pl, file, atm)
|
|
||||||
|
|
||||||
|
|
||||||
/* Unsupported functions. Do not ask for them. They're evil :P */
|
|
||||||
#define PLSetStringCmpHook(fn) error_PLSetStringCmpHook_is_not_supported
|
|
||||||
#define PLDeepSynchronize(pl) error_PLDeepSynchronize_is_not_supported
|
|
||||||
#define PLSynchronize(pl) error_PLSynchronize_is_not_supported
|
|
||||||
#define PLShallowSynchronize(pl) error_PLShallowSynchronize_is_not_supported
|
|
||||||
#define PLSetFilename(pl, filename) error_PLSetFilename_is_not_supported
|
|
||||||
#define PLGetFilename(pl, filename) error_PLGetFilename_is_not_supported
|
|
||||||
#define PLGetContainer(pl) error_PLGetContainer_is_not_supported
|
|
||||||
|
|
||||||
#define PLGetDomainNames error_PLGetDomainNames_is_not_supported
|
|
||||||
#define PLGetDomain(name) error_PLGetDomain_is_not_supported
|
|
||||||
#define PLSetDomain(name, value, kickme) error_PLSetDomain_is_not_supported
|
|
||||||
#define PLDeleteDomain(name, kickme) error_PLDeleteDomain_is_not_supported
|
|
||||||
#define PLRegister(name, callback) error_PLRegister_is_not_supported
|
|
||||||
#define PLUnregister(name) error_PLUnregister_is_not_supported
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
483
WINGs/array.c
483
WINGs/array.c
@@ -8,361 +8,356 @@
|
|||||||
* proper credit is always appreciated :)
|
* proper credit is always appreciated :)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
|
|
||||||
#define INITIAL_SIZE 8
|
#define INITIAL_SIZE 8
|
||||||
#define RESIZE_INCREMENT 8
|
#define RESIZE_INCREMENT 8
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Array {
|
typedef struct W_Array {
|
||||||
void **items; /* the array data */
|
void **items; /* the array data */
|
||||||
int itemCount; /* # of items in array */
|
int itemCount; /* # of items in array */
|
||||||
int allocSize; /* allocated size of array */
|
int allocSize; /* allocated size of array */
|
||||||
WMFreeDataProc *destructor; /* the destructor to free elements */
|
WMFreeDataProc *destructor; /* the destructor to free elements */
|
||||||
} W_Array;
|
} W_Array;
|
||||||
|
|
||||||
|
WMArray *WMCreateArray(int initialSize)
|
||||||
WMArray*
|
|
||||||
WMCreateArray(int initialSize)
|
|
||||||
{
|
{
|
||||||
return WMCreateArrayWithDestructor(initialSize, NULL);
|
return WMCreateArrayWithDestructor(initialSize, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMArray *WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc * destructor)
|
||||||
WMArray*
|
|
||||||
WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc *destructor)
|
|
||||||
{
|
{
|
||||||
WMArray *array;
|
WMArray *array;
|
||||||
|
|
||||||
array = wmalloc(sizeof(WMArray));
|
array = wmalloc(sizeof(WMArray));
|
||||||
|
|
||||||
if (initialSize <= 0) {
|
if (initialSize <= 0) {
|
||||||
initialSize = INITIAL_SIZE;
|
initialSize = INITIAL_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
array->items = wmalloc(sizeof(void*) * initialSize);
|
array->items = wmalloc(sizeof(void *) * initialSize);
|
||||||
|
|
||||||
array->itemCount = 0;
|
array->itemCount = 0;
|
||||||
array->allocSize = initialSize;
|
array->allocSize = initialSize;
|
||||||
array->destructor = destructor;
|
array->destructor = destructor;
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMArray *WMCreateArrayWithArray(WMArray * array)
|
||||||
WMArray*
|
|
||||||
WMCreateArrayWithArray(WMArray *array)
|
|
||||||
{
|
{
|
||||||
WMArray *newArray;
|
WMArray *newArray;
|
||||||
|
|
||||||
newArray = wmalloc(sizeof(WMArray));
|
newArray = wmalloc(sizeof(WMArray));
|
||||||
|
|
||||||
newArray->items = wmalloc(sizeof(void*) * array->allocSize);
|
newArray->items = wmalloc(sizeof(void *) * array->allocSize);
|
||||||
memcpy(newArray->items, array->items, sizeof(void*)*array->itemCount);
|
memcpy(newArray->items, array->items, sizeof(void *) * array->itemCount);
|
||||||
|
|
||||||
newArray->itemCount = array->itemCount;
|
newArray->itemCount = array->itemCount;
|
||||||
newArray->allocSize = array->allocSize;
|
newArray->allocSize = array->allocSize;
|
||||||
newArray->destructor = NULL;
|
newArray->destructor = NULL;
|
||||||
|
|
||||||
return newArray;
|
return newArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMEmptyArray(WMArray * array)
|
||||||
void
|
|
||||||
WMEmptyArray(WMArray *array)
|
|
||||||
{
|
{
|
||||||
if (array->destructor) {
|
if (array->destructor) {
|
||||||
while (array->itemCount > 0) {
|
while (array->itemCount > 0) {
|
||||||
array->itemCount--;
|
array->itemCount--;
|
||||||
array->destructor(array->items[array->itemCount]);
|
array->destructor(array->items[array->itemCount]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*memset(array->items, 0, array->itemCount * sizeof(void*));*/
|
/*memset(array->items, 0, array->itemCount * sizeof(void*)); */
|
||||||
array->itemCount = 0;
|
array->itemCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMFreeArray(WMArray * array)
|
||||||
void
|
|
||||||
WMFreeArray(WMArray *array)
|
|
||||||
{
|
{
|
||||||
WMEmptyArray(array);
|
if (array == NULL)
|
||||||
wfree(array->items);
|
return;
|
||||||
wfree(array);
|
|
||||||
|
WMEmptyArray(array);
|
||||||
|
wfree(array->items);
|
||||||
|
wfree(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WMGetArrayItemCount(WMArray * array)
|
||||||
int
|
|
||||||
WMGetArrayItemCount(WMArray *array)
|
|
||||||
{
|
{
|
||||||
return array->itemCount;
|
if (array == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return array->itemCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMAppendArray(WMArray * array, WMArray * other)
|
||||||
void
|
|
||||||
WMAppendArray(WMArray *array, WMArray *other)
|
|
||||||
{
|
{
|
||||||
if (other->itemCount == 0)
|
if (array == NULL || other == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (array->itemCount + other->itemCount > array->allocSize) {
|
if (other->itemCount == 0)
|
||||||
array->allocSize += other->allocSize;
|
return;
|
||||||
array->items = wrealloc(array->items, sizeof(void*)*array->allocSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(array->items+array->itemCount, other->items,
|
if (array->itemCount + other->itemCount > array->allocSize) {
|
||||||
sizeof(void*)*other->itemCount);
|
array->allocSize += other->allocSize;
|
||||||
array->itemCount += other->itemCount;
|
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(array->items + array->itemCount, other->items, sizeof(void *) * other->itemCount);
|
||||||
|
array->itemCount += other->itemCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMAddToArray(WMArray * array, void *item)
|
||||||
void
|
|
||||||
WMAddToArray(WMArray *array, void *item)
|
|
||||||
{
|
{
|
||||||
if (array->itemCount >= array->allocSize) {
|
if (array == NULL)
|
||||||
array->allocSize += RESIZE_INCREMENT;
|
return;
|
||||||
array->items = wrealloc(array->items, sizeof(void*)*array->allocSize);
|
|
||||||
}
|
|
||||||
array->items[array->itemCount] = item;
|
|
||||||
|
|
||||||
array->itemCount++;
|
if (array->itemCount >= array->allocSize) {
|
||||||
|
array->allocSize += RESIZE_INCREMENT;
|
||||||
|
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||||
|
}
|
||||||
|
array->items[array->itemCount] = item;
|
||||||
|
|
||||||
|
array->itemCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMInsertInArray(WMArray * array, int index, void *item)
|
||||||
void
|
|
||||||
WMInsertInArray(WMArray *array, int index, void *item)
|
|
||||||
{
|
{
|
||||||
wassertr(index >= 0 && index <= array->itemCount);
|
wassertr(array && index >= 0 && index <= array->itemCount);
|
||||||
|
|
||||||
if (array->itemCount >= array->allocSize) {
|
if (array == NULL)
|
||||||
array->allocSize += RESIZE_INCREMENT;
|
return;
|
||||||
array->items = wrealloc(array->items, sizeof(void*)*array->allocSize);
|
|
||||||
}
|
|
||||||
if (index < array->itemCount) {
|
|
||||||
memmove(array->items+index+1, array->items+index,
|
|
||||||
sizeof(void*)*(array->itemCount-index));
|
|
||||||
}
|
|
||||||
array->items[index] = item;
|
|
||||||
|
|
||||||
array->itemCount++;
|
if (array->itemCount >= array->allocSize) {
|
||||||
|
array->allocSize += RESIZE_INCREMENT;
|
||||||
|
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||||
|
}
|
||||||
|
if (index < array->itemCount) {
|
||||||
|
memmove(array->items + index + 1, array->items + index,
|
||||||
|
sizeof(void *) * (array->itemCount - index));
|
||||||
|
}
|
||||||
|
array->items[index] = item;
|
||||||
|
|
||||||
|
array->itemCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMReplaceInArray(WMArray * array, int index, void *item)
|
||||||
void*
|
|
||||||
WMReplaceInArray(WMArray *array, int index, void *item)
|
|
||||||
{
|
{
|
||||||
void *old;
|
void *old;
|
||||||
|
|
||||||
wassertrv(index >= 0 && index <= array->itemCount, NULL);
|
wassertrv(array && index >= 0 && index <= array->itemCount, NULL);
|
||||||
|
|
||||||
/* is it really useful to perform append if index == array->itemCount ? -Dan */
|
if (array == NULL)
|
||||||
if (index == array->itemCount) {
|
return NULL;
|
||||||
WMAddToArray(array, item);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
old = array->items[index];
|
/* is it really useful to perform append if index == array->itemCount ? -Dan */
|
||||||
array->items[index] = item;
|
if (index == array->itemCount) {
|
||||||
|
WMAddToArray(array, item);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return old;
|
old = array->items[index];
|
||||||
|
array->items[index] = item;
|
||||||
|
|
||||||
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WMDeleteFromArray(WMArray * array, int index)
|
||||||
int
|
|
||||||
WMDeleteFromArray(WMArray *array, int index)
|
|
||||||
{
|
{
|
||||||
wassertrv(index >= 0 && index < array->itemCount, 0);
|
wassertrv(array && index >= 0 && index < array->itemCount, 0);
|
||||||
|
|
||||||
if (array->destructor) {
|
if (array == NULL)
|
||||||
array->destructor(array->items[index]);
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (index < array->itemCount-1) {
|
if (array->destructor) {
|
||||||
memmove(array->items+index, array->items+index+1,
|
array->destructor(array->items[index]);
|
||||||
sizeof(void*)*(array->itemCount-index-1));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
array->itemCount--;
|
if (index < array->itemCount - 1) {
|
||||||
|
memmove(array->items + index, array->items + index + 1,
|
||||||
|
sizeof(void *) * (array->itemCount - index - 1));
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
array->itemCount--;
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WMRemoveFromArrayMatching(WMArray * array, WMMatchDataProc * match, void *cdata)
|
||||||
int
|
|
||||||
WMRemoveFromArrayMatching(WMArray *array, WMMatchDataProc *match, void *cdata)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (match != NULL) {
|
if (array == NULL)
|
||||||
for (i = 0; i < array->itemCount; i++) {
|
return 1;
|
||||||
if ((*match)(array->items[i], cdata)) {
|
|
||||||
WMDeleteFromArray(array, i);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < array->itemCount; i++) {
|
|
||||||
if (array->items[i] == cdata) {
|
|
||||||
WMDeleteFromArray(array, i);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
if (match != NULL) {
|
||||||
|
for (i = 0; i < array->itemCount; i++) {
|
||||||
|
if ((*match) (array->items[i], cdata)) {
|
||||||
|
WMDeleteFromArray(array, i);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < array->itemCount; i++) {
|
||||||
|
if (array->items[i] == cdata) {
|
||||||
|
WMDeleteFromArray(array, i);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMGetFromArray(WMArray * array, int index)
|
||||||
void*
|
|
||||||
WMGetFromArray(WMArray *array, int index)
|
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= array->itemCount)
|
if (index < 0 || array == NULL || index >= array->itemCount)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return array->items[index];
|
return array->items[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMPopFromArray(WMArray * array)
|
||||||
void*
|
|
||||||
WMPopFromArray(WMArray *array)
|
|
||||||
{
|
{
|
||||||
array->itemCount--;
|
if (array == NULL || array->itemCount <= 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return array->items[array->itemCount];
|
array->itemCount--;
|
||||||
|
|
||||||
|
return array->items[array->itemCount];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WMFindInArray(WMArray * array, WMMatchDataProc * match, void *cdata)
|
||||||
int
|
|
||||||
WMFindInArray(WMArray *array, WMMatchDataProc *match, void *cdata)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (match!=NULL) {
|
if (array == NULL)
|
||||||
for (i = 0; i < array->itemCount; i++) {
|
return WANotFound;
|
||||||
if ((*match)(array->items[i], cdata))
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < array->itemCount; i++) {
|
|
||||||
if (array->items[i] == cdata)
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return WANotFound;
|
if (match != NULL) {
|
||||||
|
for (i = 0; i < array->itemCount; i++) {
|
||||||
|
if ((*match) (array->items[i], cdata))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < array->itemCount; i++) {
|
||||||
|
if (array->items[i] == cdata)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return WANotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WMCountInArray(WMArray * array, void *item)
|
||||||
int
|
|
||||||
WMCountInArray(WMArray *array, void *item)
|
|
||||||
{
|
{
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
for (i=0, count=0; i<array->itemCount; i++) {
|
if (array == NULL)
|
||||||
if (array->items[i] == item)
|
return 0;
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
for (i = 0, count = 0; i < array->itemCount; i++) {
|
||||||
|
if (array->items[i] == item)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMSortArray(WMArray * array, WMCompareDataProc * comparer)
|
||||||
void
|
|
||||||
WMSortArray(WMArray *array, WMCompareDataProc *comparer)
|
|
||||||
{
|
{
|
||||||
if (array->itemCount > 1) { /* Don't sort empty or single element arrays */
|
if (array == NULL)
|
||||||
qsort(array->items, array->itemCount, sizeof(void*), comparer);
|
return;
|
||||||
}
|
|
||||||
|
if (array->itemCount > 1) { /* Don't sort empty or single element arrays */
|
||||||
|
qsort(array->items, array->itemCount, sizeof(void *), comparer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMMapArray(WMArray * array, void (*function) (void *, void *), void *data)
|
||||||
void
|
|
||||||
WMMapArray(WMArray *array, void (*function)(void*, void*), void *data)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<array->itemCount; i++) {
|
if (array == NULL)
|
||||||
(*function)(array->items[i], data);
|
return;
|
||||||
}
|
|
||||||
|
for (i = 0; i < array->itemCount; i++) {
|
||||||
|
(*function) (array->items[i], data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMArray *WMGetSubarrayWithRange(WMArray * array, WMRange aRange)
|
||||||
WMArray*
|
|
||||||
WMGetSubarrayWithRange(WMArray* array, WMRange aRange)
|
|
||||||
{
|
{
|
||||||
WMArray *newArray;
|
WMArray *newArray;
|
||||||
|
|
||||||
if (aRange.count <= 0)
|
if (aRange.count <= 0 || array == NULL)
|
||||||
return WMCreateArray(0);
|
return WMCreateArray(0);
|
||||||
|
|
||||||
if (aRange.position < 0)
|
if (aRange.position < 0)
|
||||||
aRange.position = 0;
|
aRange.position = 0;
|
||||||
if (aRange.position >= array->itemCount)
|
if (aRange.position >= array->itemCount)
|
||||||
aRange.position = array->itemCount - 1;
|
aRange.position = array->itemCount - 1;
|
||||||
if (aRange.position + aRange.count > array->itemCount)
|
if (aRange.position + aRange.count > array->itemCount)
|
||||||
aRange.count = array->itemCount - aRange.position;
|
aRange.count = array->itemCount - aRange.position;
|
||||||
|
|
||||||
newArray = WMCreateArray(aRange.count);
|
newArray = WMCreateArray(aRange.count);
|
||||||
memcpy(newArray->items, array->items+aRange.position,
|
memcpy(newArray->items, array->items + aRange.position, sizeof(void *) * aRange.count);
|
||||||
sizeof(void*)*aRange.count);
|
newArray->itemCount = aRange.count;
|
||||||
newArray->itemCount = aRange.count;
|
|
||||||
|
|
||||||
return newArray;
|
return newArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMArrayFirst(WMArray * array, WMArrayIterator * iter)
|
||||||
void*
|
|
||||||
WMArrayFirst(WMArray *array, WMArrayIterator *iter)
|
|
||||||
{
|
{
|
||||||
if (array->itemCount == 0) {
|
if (array == NULL || array->itemCount == 0) {
|
||||||
*iter = WANotFound;
|
*iter = WANotFound;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
*iter = 0;
|
*iter = 0;
|
||||||
return array->items[0];
|
return array->items[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMArrayLast(WMArray * array, WMArrayIterator * iter)
|
||||||
void*
|
|
||||||
WMArrayLast(WMArray *array, WMArrayIterator *iter)
|
|
||||||
{
|
{
|
||||||
if (array->itemCount == 0) {
|
if (array == NULL || array->itemCount == 0) {
|
||||||
*iter = WANotFound;
|
*iter = WANotFound;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
*iter = array->itemCount-1;
|
*iter = array->itemCount - 1;
|
||||||
return array->items[*iter];
|
return array->items[*iter];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMArrayNext(WMArray * array, WMArrayIterator * iter)
|
||||||
void*
|
|
||||||
WMArrayNext(WMArray *array, WMArrayIterator *iter)
|
|
||||||
{
|
{
|
||||||
if (*iter >= 0 && *iter < array->itemCount-1) {
|
if (array == NULL) {
|
||||||
return array->items[++(*iter)];
|
*iter = WANotFound;
|
||||||
} else {
|
return NULL;
|
||||||
*iter = WANotFound;
|
}
|
||||||
return NULL;
|
|
||||||
}
|
if (*iter >= 0 && *iter < array->itemCount - 1) {
|
||||||
|
return array->items[++(*iter)];
|
||||||
|
} else {
|
||||||
|
*iter = WANotFound;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMArrayPrevious(WMArray * array, WMArrayIterator * iter)
|
||||||
void*
|
|
||||||
WMArrayPrevious(WMArray *array, WMArrayIterator *iter)
|
|
||||||
{
|
{
|
||||||
if (*iter > 0 && *iter < array->itemCount) {
|
if (array == NULL) {
|
||||||
return array->items[--(*iter)];
|
*iter = WANotFound;
|
||||||
} else {
|
return NULL;
|
||||||
*iter = WANotFound;
|
}
|
||||||
return NULL;
|
|
||||||
}
|
if (*iter > 0 && *iter < array->itemCount) {
|
||||||
|
return array->items[--(*iter)];
|
||||||
|
} else {
|
||||||
|
*iter = WANotFound;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1123
WINGs/bagtree.c
1123
WINGs/bagtree.c
File diff suppressed because it is too large
Load Diff
@@ -1,122 +1,132 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "WINGsP.h"
|
#include "WINGsP.h"
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
#include <X11/Xlocale.h>
|
#include <X11/Xlocale.h>
|
||||||
|
|
||||||
|
|
||||||
_WINGsConfiguration WINGsConfiguration;
|
_WINGsConfiguration WINGsConfiguration;
|
||||||
|
|
||||||
|
#define SYSTEM_FONT "sans serif"
|
||||||
|
#define BOLD_SYSTEM_FONT "sans serif:bold"
|
||||||
#define SYSTEM_FONT "Trebuchet MS,Luxi Sans"
|
|
||||||
#define BOLD_SYSTEM_FONT "Trebuchet MS,Luxi Sans:bold"
|
|
||||||
#define DEFAULT_FONT_SIZE 12
|
#define DEFAULT_FONT_SIZE 12
|
||||||
|
|
||||||
#define FLOPPY_PATH "/floppy"
|
#define FLOPPY_PATH "/floppy"
|
||||||
|
|
||||||
|
static unsigned getButtonWithName(const char *name, unsigned defaultButton)
|
||||||
static unsigned
|
|
||||||
getButtonWithName(const char *name, unsigned defaultButton)
|
|
||||||
{
|
{
|
||||||
if (strncmp(name, "Button", 6)==0 && strlen(name)==7) {
|
if (strncmp(name, "Button", 6) == 0 && strlen(name) == 7) {
|
||||||
switch (name[6]) {
|
switch (name[6]) {
|
||||||
case '1':
|
case '1':
|
||||||
return Button1;
|
return Button1;
|
||||||
case '2':
|
case '2':
|
||||||
return Button2;
|
return Button2;
|
||||||
case '3':
|
case '3':
|
||||||
return Button3;
|
return Button3;
|
||||||
case '4':
|
case '4':
|
||||||
return Button4;
|
return Button4;
|
||||||
case '5':
|
case '5':
|
||||||
return Button5;
|
return Button5;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultButton;
|
return defaultButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_ReadConfigurations(void)
|
||||||
void
|
|
||||||
W_ReadConfigurations(void)
|
|
||||||
{
|
{
|
||||||
WMUserDefaults *defaults;
|
WMUserDefaults *defaults;
|
||||||
|
Bool aaIsSet = False;
|
||||||
|
|
||||||
memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration));
|
memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration));
|
||||||
|
|
||||||
defaults = WMGetStandardUserDefaults();
|
defaults = WMGetStandardUserDefaults();
|
||||||
|
|
||||||
if (defaults) {
|
if (defaults) {
|
||||||
char *buttonName;
|
char *buttonName;
|
||||||
unsigned button;
|
WMPropList *val;
|
||||||
|
unsigned button;
|
||||||
|
|
||||||
WINGsConfiguration.systemFont =
|
WINGsConfiguration.systemFont = WMGetUDStringForKey(defaults, "SystemFont");
|
||||||
WMGetUDStringForKey(defaults, "SystemFont");
|
|
||||||
|
|
||||||
WINGsConfiguration.boldSystemFont =
|
WINGsConfiguration.boldSystemFont = WMGetUDStringForKey(defaults, "BoldSystemFont");
|
||||||
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
|
||||||
|
|
||||||
WINGsConfiguration.antialiasedText =
|
val = WMGetUDObjectForKey(defaults, "AntialiasedText");
|
||||||
WMGetUDBoolForKey(defaults, "AntialiasedText");
|
if (val && WMIsPLString(val) && WMGetFromPLString(val)) {
|
||||||
|
aaIsSet = True;
|
||||||
|
WINGsConfiguration.antialiasedText =
|
||||||
|
WMGetUDBoolForKey(defaults, "AntialiasedText");
|
||||||
|
}
|
||||||
|
|
||||||
WINGsConfiguration.doubleClickDelay =
|
WINGsConfiguration.doubleClickDelay = WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||||
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
|
||||||
|
|
||||||
WINGsConfiguration.floppyPath =
|
WINGsConfiguration.floppyPath = WMGetUDStringForKey(defaults, "FloppyPath");
|
||||||
WMGetUDStringForKey(defaults, "FloppyPath");
|
|
||||||
|
|
||||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
||||||
if (buttonName) {
|
if (buttonName) {
|
||||||
button = getButtonWithName(buttonName, Button4);
|
button = getButtonWithName(buttonName, Button4);
|
||||||
wfree(buttonName);
|
wfree(buttonName);
|
||||||
} else {
|
} else {
|
||||||
button = Button4;
|
button = Button4;
|
||||||
}
|
}
|
||||||
WINGsConfiguration.mouseWheelUp = button;
|
WINGsConfiguration.mouseWheelUp = button;
|
||||||
|
|
||||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
|
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
|
||||||
if (buttonName) {
|
if (buttonName) {
|
||||||
button = getButtonWithName(buttonName, Button5);
|
button = getButtonWithName(buttonName, Button5);
|
||||||
wfree(buttonName);
|
wfree(buttonName);
|
||||||
} else {
|
} else {
|
||||||
button = Button5;
|
button = Button5;
|
||||||
}
|
}
|
||||||
WINGsConfiguration.mouseWheelDown = button;
|
WINGsConfiguration.mouseWheelDown = button;
|
||||||
|
|
||||||
if (WINGsConfiguration.mouseWheelDown==WINGsConfiguration.mouseWheelUp) {
|
if (WINGsConfiguration.mouseWheelDown == WINGsConfiguration.mouseWheelUp) {
|
||||||
WINGsConfiguration.mouseWheelUp = Button4;
|
WINGsConfiguration.mouseWheelUp = Button4;
|
||||||
WINGsConfiguration.mouseWheelDown = Button5;
|
WINGsConfiguration.mouseWheelDown = Button5;
|
||||||
}
|
}
|
||||||
|
|
||||||
WINGsConfiguration.defaultFontSize =
|
WINGsConfiguration.defaultFontSize = WMGetUDIntegerForKey(defaults, "DefaultFontSize");
|
||||||
WMGetUDIntegerForKey(defaults, "DefaultFontSize");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!WINGsConfiguration.systemFont) {
|
if (!WINGsConfiguration.systemFont) {
|
||||||
WINGsConfiguration.systemFont = SYSTEM_FONT;
|
WINGsConfiguration.systemFont = SYSTEM_FONT;
|
||||||
}
|
}
|
||||||
if (!WINGsConfiguration.boldSystemFont) {
|
if (!WINGsConfiguration.boldSystemFont) {
|
||||||
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
||||||
}
|
}
|
||||||
if (WINGsConfiguration.defaultFontSize == 0) {
|
if (WINGsConfiguration.defaultFontSize == 0) {
|
||||||
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
|
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
|
||||||
}
|
}
|
||||||
if (!WINGsConfiguration.floppyPath) {
|
if (!aaIsSet) {
|
||||||
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
WINGsConfiguration.antialiasedText = True;
|
||||||
}
|
}
|
||||||
if (WINGsConfiguration.doubleClickDelay == 0) {
|
if (!WINGsConfiguration.floppyPath) {
|
||||||
WINGsConfiguration.doubleClickDelay = 250;
|
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
||||||
}
|
}
|
||||||
if (WINGsConfiguration.mouseWheelUp == 0) {
|
if (WINGsConfiguration.doubleClickDelay == 0) {
|
||||||
WINGsConfiguration.mouseWheelUp = Button4;
|
WINGsConfiguration.doubleClickDelay = 250;
|
||||||
}
|
}
|
||||||
if (WINGsConfiguration.mouseWheelDown == 0) {
|
if (WINGsConfiguration.mouseWheelUp == 0) {
|
||||||
WINGsConfiguration.mouseWheelDown = Button5;
|
WINGsConfiguration.mouseWheelUp = Button4;
|
||||||
}
|
}
|
||||||
|
if (WINGsConfiguration.mouseWheelDown == 0) {
|
||||||
|
WINGsConfiguration.mouseWheelDown = Button5;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned W_getconf_mouseWheelUp(void)
|
||||||
|
{
|
||||||
|
return WINGsConfiguration.mouseWheelUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned W_getconf_mouseWheelDown(void)
|
||||||
|
{
|
||||||
|
return WINGsConfiguration.mouseWheelDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
void W_setconf_doubleClickDelay(int value)
|
||||||
|
{
|
||||||
|
WINGsConfiguration.doubleClickDelay = value;
|
||||||
|
}
|
||||||
|
|||||||
1053
WINGs/connection.c
1053
WINGs/connection.c
File diff suppressed because it is too large
Load Diff
373
WINGs/data.c
373
WINGs/data.c
@@ -15,336 +15,275 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Data {
|
typedef struct W_Data {
|
||||||
unsigned length; /* How many bytes we have */
|
unsigned length; /* How many bytes we have */
|
||||||
unsigned capacity; /* How many bytes it can hold */
|
unsigned capacity; /* How many bytes it can hold */
|
||||||
unsigned growth; /* How much to grow */
|
unsigned growth; /* How much to grow */
|
||||||
void *bytes; /* Actual data */
|
void *bytes; /* Actual data */
|
||||||
unsigned retainCount;
|
unsigned retainCount;
|
||||||
WMFreeDataProc *destructor;
|
WMFreeDataProc *destructor;
|
||||||
int format; /* 0, 8, 16 or 32 */
|
int format; /* 0, 8, 16 or 32 */
|
||||||
} W_Data;
|
} W_Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Creating and destroying data objects */
|
/* Creating and destroying data objects */
|
||||||
|
|
||||||
WMData*
|
WMData *WMCreateDataWithCapacity(unsigned capacity)
|
||||||
WMCreateDataWithCapacity(unsigned capacity)
|
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
aData = (WMData*)wmalloc(sizeof(WMData));
|
aData = (WMData *) wmalloc(sizeof(WMData));
|
||||||
|
|
||||||
if (capacity>0)
|
if (capacity > 0)
|
||||||
aData->bytes = wmalloc(capacity);
|
aData->bytes = wmalloc(capacity);
|
||||||
else
|
else
|
||||||
aData->bytes = NULL;
|
aData->bytes = NULL;
|
||||||
|
|
||||||
aData->capacity = capacity;
|
aData->capacity = capacity;
|
||||||
aData->growth = capacity/2 > 0 ? capacity/2 : 1;
|
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
|
||||||
aData->length = 0;
|
aData->length = 0;
|
||||||
aData->retainCount = 1;
|
aData->retainCount = 1;
|
||||||
aData->format = 0;
|
aData->format = 0;
|
||||||
aData->destructor = wfree;
|
aData->destructor = wfree;
|
||||||
|
|
||||||
return aData;
|
return aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMCreateDataWithLength(unsigned length)
|
||||||
WMData*
|
|
||||||
WMCreateDataWithLength(unsigned length)
|
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
aData = WMCreateDataWithCapacity(length);
|
aData = WMCreateDataWithCapacity(length);
|
||||||
if (length>0) {
|
if (length > 0) {
|
||||||
memset(aData->bytes, 0, length);
|
aData->length = length;
|
||||||
aData->length = length;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return aData;
|
return aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMCreateDataWithBytes(const void *bytes, unsigned length)
|
||||||
WMData*
|
|
||||||
WMCreateDataWithBytes(void *bytes, unsigned length)
|
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
aData = WMCreateDataWithCapacity(length);
|
aData = WMCreateDataWithCapacity(length);
|
||||||
aData->length = length;
|
aData->length = length;
|
||||||
memcpy(aData->bytes, bytes, length);
|
memcpy(aData->bytes, bytes, length);
|
||||||
|
|
||||||
return aData;
|
return aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, WMFreeDataProc * destructor)
|
||||||
WMData*
|
|
||||||
WMCreateDataWithBytesNoCopy(void *bytes, unsigned length,
|
|
||||||
WMFreeDataProc *destructor)
|
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
aData = (WMData*)wmalloc(sizeof(WMData));
|
aData = (WMData *) wmalloc(sizeof(WMData));
|
||||||
aData->length = length;
|
aData->length = length;
|
||||||
aData->capacity = length;
|
aData->capacity = length;
|
||||||
aData->growth = length/2 > 0 ? length/2 : 1;
|
aData->growth = length / 2 > 0 ? length / 2 : 1;
|
||||||
aData->bytes = bytes;
|
aData->bytes = bytes;
|
||||||
aData->retainCount = 1;
|
aData->retainCount = 1;
|
||||||
aData->format = 0;
|
aData->format = 0;
|
||||||
aData->destructor = destructor;
|
aData->destructor = destructor;
|
||||||
|
|
||||||
return aData;
|
return aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMCreateDataWithData(WMData * aData)
|
||||||
WMData*
|
|
||||||
WMCreateDataWithData(WMData *aData)
|
|
||||||
{
|
{
|
||||||
WMData *newData;
|
WMData *newData;
|
||||||
|
|
||||||
if (aData->length > 0) {
|
if (aData->length > 0) {
|
||||||
newData = WMCreateDataWithBytes(aData->bytes, aData->length);
|
newData = WMCreateDataWithBytes(aData->bytes, aData->length);
|
||||||
} else {
|
} else {
|
||||||
newData = WMCreateDataWithCapacity(0);
|
newData = WMCreateDataWithCapacity(0);
|
||||||
}
|
}
|
||||||
newData->format = aData->format;
|
newData->format = aData->format;
|
||||||
|
|
||||||
return newData;
|
return newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMRetainData(WMData * aData)
|
||||||
WMData*
|
|
||||||
WMRetainData(WMData *aData)
|
|
||||||
{
|
{
|
||||||
aData->retainCount++;
|
aData->retainCount++;
|
||||||
return aData;
|
return aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMReleaseData(WMData * aData)
|
||||||
void
|
|
||||||
WMReleaseData(WMData *aData)
|
|
||||||
{
|
{
|
||||||
aData->retainCount--;
|
aData->retainCount--;
|
||||||
if (aData->retainCount > 0)
|
if (aData->retainCount > 0)
|
||||||
return;
|
return;
|
||||||
if (aData->bytes!=NULL && aData->destructor!=NULL) {
|
if (aData->bytes != NULL && aData->destructor != NULL) {
|
||||||
aData->destructor(aData->bytes);
|
aData->destructor(aData->bytes);
|
||||||
}
|
}
|
||||||
wfree(aData);
|
wfree(aData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Adjusting capacity */
|
/* Adjusting capacity */
|
||||||
|
|
||||||
void
|
void WMSetDataCapacity(WMData * aData, unsigned capacity)
|
||||||
WMSetDataCapacity(WMData *aData, unsigned capacity)
|
|
||||||
{
|
{
|
||||||
if (aData->capacity != capacity) {
|
if (aData->capacity != capacity) {
|
||||||
aData->bytes = wrealloc(aData->bytes, capacity);
|
aData->bytes = wrealloc(aData->bytes, capacity);
|
||||||
aData->capacity = capacity;
|
aData->capacity = capacity;
|
||||||
aData->growth = capacity/2 > 0 ? capacity/2 : 1;
|
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
|
||||||
}
|
}
|
||||||
if (aData->length > capacity) {
|
if (aData->length > capacity) {
|
||||||
aData->length = capacity;
|
aData->length = capacity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMSetDataLength(WMData * aData, unsigned length)
|
||||||
void
|
|
||||||
WMSetDataLength(WMData *aData, unsigned length)
|
|
||||||
{
|
{
|
||||||
if (length > aData->capacity) {
|
if (length > aData->capacity) {
|
||||||
WMSetDataCapacity(aData, length);
|
WMSetDataCapacity(aData, length);
|
||||||
}
|
}
|
||||||
if (length > aData->length) {
|
if (length > aData->length) {
|
||||||
memset((unsigned char*)aData->bytes + aData->length, 0,
|
memset((unsigned char *)aData->bytes + aData->length, 0, length - aData->length);
|
||||||
length - aData->length);
|
}
|
||||||
}
|
aData->length = length;
|
||||||
aData->length = length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMSetDataFormat(WMData * aData, unsigned format)
|
||||||
void
|
|
||||||
WMSetDataFormat(WMData *aData, unsigned format)
|
|
||||||
{
|
{
|
||||||
aData->format = format;
|
aData->format = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMIncreaseDataLengthBy(WMData * aData, unsigned extraLength)
|
||||||
void
|
|
||||||
WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength)
|
|
||||||
{
|
{
|
||||||
WMSetDataLength(aData, aData->length + extraLength);
|
WMSetDataLength(aData, aData->length + extraLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Accessing data */
|
/* Accessing data */
|
||||||
|
|
||||||
const void*
|
const void *WMDataBytes(WMData * aData)
|
||||||
WMDataBytes(WMData *aData)
|
|
||||||
{
|
{
|
||||||
return aData->bytes;
|
return aData->bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMGetDataBytes(WMData * aData, void *buffer)
|
||||||
void
|
|
||||||
WMGetDataBytes(WMData *aData, void *buffer)
|
|
||||||
{
|
{
|
||||||
wassertr(aData->length > 0);
|
wassertr(aData->length > 0);
|
||||||
|
|
||||||
memcpy(buffer, aData->bytes, aData->length);
|
memcpy(buffer, aData->bytes, aData->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned WMGetDataFormat(WMData * aData)
|
||||||
unsigned
|
|
||||||
WMGetDataFormat(WMData *aData)
|
|
||||||
{
|
{
|
||||||
return aData->format;
|
return aData->format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMGetDataBytesWithLength(WMData * aData, void *buffer, unsigned length)
|
||||||
void
|
|
||||||
WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length)
|
|
||||||
{
|
{
|
||||||
wassertr(aData->length > 0);
|
wassertr(aData->length > 0);
|
||||||
wassertr(length <= aData->length);
|
wassertr(length <= aData->length);
|
||||||
|
|
||||||
memcpy(buffer, aData->bytes, length);
|
memcpy(buffer, aData->bytes, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMGetDataBytesWithRange(WMData * aData, void *buffer, WMRange aRange)
|
||||||
void
|
|
||||||
WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange)
|
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length - aRange.position);
|
||||||
|
|
||||||
memcpy(buffer, (unsigned char*)aData->bytes + aRange.position,
|
memcpy(buffer, (unsigned char *)aData->bytes + aRange.position, aRange.count);
|
||||||
aRange.count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMData *WMGetSubdataWithRange(WMData * aData, WMRange aRange)
|
||||||
WMData*
|
|
||||||
WMGetSubdataWithRange(WMData *aData, WMRange aRange)
|
|
||||||
{
|
{
|
||||||
void *buffer;
|
void *buffer;
|
||||||
WMData *newData;
|
WMData *newData;
|
||||||
|
|
||||||
if (aRange.count <= 0)
|
if (aRange.count <= 0)
|
||||||
return WMCreateDataWithCapacity(0);
|
return WMCreateDataWithCapacity(0);
|
||||||
|
|
||||||
buffer = wmalloc(aRange.count);
|
buffer = wmalloc(aRange.count);
|
||||||
WMGetDataBytesWithRange(aData, buffer, aRange);
|
WMGetDataBytesWithRange(aData, buffer, aRange);
|
||||||
newData = WMCreateDataWithBytesNoCopy(buffer, aRange.count, wfree);
|
newData = WMCreateDataWithBytesNoCopy(buffer, aRange.count, wfree);
|
||||||
newData->format = aData->format;
|
newData->format = aData->format;
|
||||||
|
|
||||||
return newData;
|
return newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Testing data */
|
/* Testing data */
|
||||||
|
|
||||||
Bool
|
Bool WMIsDataEqualToData(WMData * aData, WMData * anotherData)
|
||||||
WMIsDataEqualToData(WMData *aData, WMData *anotherData)
|
|
||||||
{
|
{
|
||||||
if (aData->length != anotherData->length)
|
if (aData->length != anotherData->length)
|
||||||
return False;
|
return False;
|
||||||
else if (!aData->bytes && !anotherData->bytes) /* both are empty */
|
else if (!aData->bytes && !anotherData->bytes) /* both are empty */
|
||||||
return True;
|
return True;
|
||||||
else if (!aData->bytes || !anotherData->bytes) /* one of them is empty */
|
else if (!aData->bytes || !anotherData->bytes) /* one of them is empty */
|
||||||
return False;
|
return False;
|
||||||
return (memcmp(aData->bytes, anotherData->bytes, aData->length)==0);
|
return (memcmp(aData->bytes, anotherData->bytes, aData->length) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned WMGetDataLength(WMData * aData)
|
||||||
unsigned
|
|
||||||
WMGetDataLength(WMData *aData)
|
|
||||||
{
|
{
|
||||||
return aData->length;
|
return aData->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Adding data */
|
/* Adding data */
|
||||||
void
|
void WMAppendDataBytes(WMData * aData, const void *bytes, unsigned length)
|
||||||
WMAppendDataBytes(WMData *aData, void *bytes, unsigned length)
|
|
||||||
{
|
{
|
||||||
unsigned oldLength = aData->length;
|
unsigned oldLength = aData->length;
|
||||||
unsigned newLength = oldLength + length;
|
unsigned newLength = oldLength + length;
|
||||||
|
|
||||||
if (newLength > aData->capacity) {
|
if (newLength > aData->capacity) {
|
||||||
unsigned nextCapacity = aData->capacity + aData->growth;
|
unsigned nextCapacity = aData->capacity + aData->growth;
|
||||||
unsigned nextGrowth = aData->capacity ? aData->capacity : 1;
|
unsigned nextGrowth = aData->capacity ? aData->capacity : 1;
|
||||||
|
|
||||||
while (nextCapacity < newLength) {
|
while (nextCapacity < newLength) {
|
||||||
unsigned tmp = nextCapacity + nextGrowth;
|
unsigned tmp = nextCapacity + nextGrowth;
|
||||||
|
|
||||||
nextGrowth = nextCapacity;
|
nextGrowth = nextCapacity;
|
||||||
nextCapacity = tmp;
|
nextCapacity = tmp;
|
||||||
}
|
}
|
||||||
WMSetDataCapacity(aData, nextCapacity);
|
WMSetDataCapacity(aData, nextCapacity);
|
||||||
aData->growth = nextGrowth;
|
aData->growth = nextGrowth;
|
||||||
}
|
}
|
||||||
memcpy((unsigned char*)aData->bytes + oldLength, bytes, length);
|
memcpy((unsigned char *)aData->bytes + oldLength, bytes, length);
|
||||||
aData->length = newLength;
|
aData->length = newLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMAppendData(WMData * aData, WMData * anotherData)
|
||||||
void
|
|
||||||
WMAppendData(WMData *aData, WMData *anotherData)
|
|
||||||
{
|
{
|
||||||
if (anotherData->length > 0)
|
if (anotherData->length > 0)
|
||||||
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
|
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Modifying data */
|
/* Modifying data */
|
||||||
|
|
||||||
void
|
void WMReplaceDataBytesInRange(WMData * aData, WMRange aRange, const void *bytes)
|
||||||
WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes)
|
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length - aRange.position);
|
||||||
|
|
||||||
memcpy((unsigned char*)aData->bytes + aRange.position, bytes, aRange.count);
|
memcpy((unsigned char *)aData->bytes + aRange.position, bytes, aRange.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMResetDataBytesInRange(WMData * aData, WMRange aRange)
|
||||||
void
|
|
||||||
WMResetDataBytesInRange(WMData *aData, WMRange aRange)
|
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length - aRange.position);
|
||||||
|
|
||||||
memset((unsigned char*)aData->bytes + aRange.position, 0, aRange.count);
|
memset((unsigned char *)aData->bytes + aRange.position, 0, aRange.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMSetData(WMData * aData, WMData * anotherData)
|
||||||
void
|
|
||||||
WMSetData(WMData *aData, WMData *anotherData)
|
|
||||||
{
|
{
|
||||||
unsigned length = anotherData->length;
|
unsigned length = anotherData->length;
|
||||||
|
|
||||||
WMSetDataCapacity(aData, length);
|
WMSetDataCapacity(aData, length);
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
memcpy(aData->bytes, anotherData->bytes, length);
|
memcpy(aData->bytes, anotherData->bytes, length);
|
||||||
aData->length = length;
|
aData->length = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Storing data */
|
/* Storing data */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,290 +1,258 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "WINGsP.h"
|
#include "WINGsP.h"
|
||||||
|
|
||||||
#define XDND_SOURCE_VERSION(dragInfo) dragInfo->protocolVersion
|
#define XDND_SOURCE_VERSION(dragInfo) dragInfo->protocolVersion
|
||||||
#define XDND_DEST_INFO(dragInfo) dragInfo->destInfo
|
#define XDND_DEST_INFO(dragInfo) dragInfo->destInfo
|
||||||
#define XDND_DEST_VIEW(dragInfo) dragInfo->destInfo->destView
|
#define XDND_DEST_VIEW(dragInfo) dragInfo->destInfo->destView
|
||||||
|
|
||||||
|
|
||||||
static Bool _WindowExists;
|
static Bool _WindowExists;
|
||||||
|
|
||||||
|
Atom W_OperationToAction(WMScreen * scr, WMDragOperationType operation)
|
||||||
Atom
|
|
||||||
W_OperationToAction(WMScreen *scr, WMDragOperationType operation)
|
|
||||||
{
|
{
|
||||||
switch (operation) {
|
switch (operation) {
|
||||||
case WDOperationNone:
|
case WDOperationNone:
|
||||||
return None;
|
return None;
|
||||||
|
|
||||||
case WDOperationCopy:
|
case WDOperationCopy:
|
||||||
return scr->xdndActionCopy;
|
return scr->xdndActionCopy;
|
||||||
|
|
||||||
case WDOperationMove:
|
case WDOperationMove:
|
||||||
return scr->xdndActionMove;
|
return scr->xdndActionMove;
|
||||||
|
|
||||||
case WDOperationLink:
|
case WDOperationLink:
|
||||||
return scr->xdndActionLink;
|
return scr->xdndActionLink;
|
||||||
|
|
||||||
case WDOperationAsk:
|
case WDOperationAsk:
|
||||||
return scr->xdndActionAsk;
|
return scr->xdndActionAsk;
|
||||||
|
|
||||||
case WDOperationPrivate:
|
case WDOperationPrivate:
|
||||||
return scr->xdndActionPrivate;
|
return scr->xdndActionPrivate;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMDragOperationType W_ActionToOperation(WMScreen * scr, Atom action)
|
||||||
WMDragOperationType
|
|
||||||
W_ActionToOperation(WMScreen *scr, Atom action)
|
|
||||||
{
|
{
|
||||||
if (action == scr->xdndActionCopy) {
|
if (action == scr->xdndActionCopy) {
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
|
|
||||||
} else if (action == scr->xdndActionMove) {
|
} else if (action == scr->xdndActionMove) {
|
||||||
return WDOperationMove;
|
return WDOperationMove;
|
||||||
|
|
||||||
} else if (action == scr->xdndActionLink) {
|
} else if (action == scr->xdndActionLink) {
|
||||||
return WDOperationLink;
|
return WDOperationLink;
|
||||||
|
|
||||||
} else if (action == scr->xdndActionAsk) {
|
} else if (action == scr->xdndActionAsk) {
|
||||||
return WDOperationAsk;
|
return WDOperationAsk;
|
||||||
|
|
||||||
} else if (action == scr->xdndActionPrivate) {
|
} else if (action == scr->xdndActionPrivate) {
|
||||||
return WDOperationPrivate;
|
return WDOperationPrivate;
|
||||||
|
|
||||||
} else if (action == None) {
|
} else if (action == None) {
|
||||||
|
|
||||||
return WDOperationNone;
|
return WDOperationNone;
|
||||||
} else {
|
} else {
|
||||||
char *tmp = XGetAtomName(scr->display, action);
|
char *tmp = XGetAtomName(scr->display, action);
|
||||||
|
|
||||||
wwarning("unknown XDND action %s ", tmp);
|
wwarning("unknown XDND action %s ", tmp);
|
||||||
XFree(tmp);
|
XFree(tmp);
|
||||||
|
|
||||||
return WDOperationCopy;
|
return WDOperationCopy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void freeDragOperationItem(void *item)
|
||||||
static void
|
|
||||||
freeDragOperationItem(void* item)
|
|
||||||
{
|
{
|
||||||
wfree(item);
|
wfree(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
WMArray*
|
WMArray *WMCreateDragOperationArray(int initialSize)
|
||||||
WMCreateDragOperationArray(int initialSize)
|
|
||||||
{
|
{
|
||||||
return WMCreateArrayWithDestructor(initialSize, freeDragOperationItem);
|
return WMCreateArrayWithDestructor(initialSize, freeDragOperationItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMDragOperationItem *WMCreateDragOperationItem(WMDragOperationType type, char *text)
|
||||||
WMDragOperationItem*
|
|
||||||
WMCreateDragOperationItem(WMDragOperationType type, char* text)
|
|
||||||
{
|
{
|
||||||
W_DragOperationItem *result = wmalloc(sizeof(W_DragOperationItem));
|
W_DragOperationItem *result = wmalloc(sizeof(W_DragOperationItem));
|
||||||
|
|
||||||
result->type = type;
|
result->type = type;
|
||||||
result->text = text;
|
result->text = text;
|
||||||
|
|
||||||
return (WMDragOperationItem*) result;
|
return (WMDragOperationItem *) result;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMDragOperationType
|
WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem * item)
|
||||||
WMGetDragOperationItemType(WMDragOperationItem* item)
|
|
||||||
{
|
{
|
||||||
return ((W_DragOperationItem*)item)->type;
|
return ((W_DragOperationItem *) item)->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *WMGetDragOperationItemText(WMDragOperationItem * item)
|
||||||
char*
|
|
||||||
WMGetDragOperationItemText(WMDragOperationItem* item)
|
|
||||||
{
|
{
|
||||||
return ((W_DragOperationItem*)item)->text;
|
return ((W_DragOperationItem *) item)->text;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int handleNoWindowXError(Display * dpy, XErrorEvent * errEvt)
|
||||||
handleNoWindowXError(Display *dpy, XErrorEvent *errEvt)
|
|
||||||
{
|
{
|
||||||
if (errEvt->error_code == BadWindow
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|| errEvt->error_code == BadDrawable) {
|
(void) dpy;
|
||||||
_WindowExists = False;
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
return errEvt->error_code;
|
if (errEvt->error_code == BadWindow || errEvt->error_code == BadDrawable) {
|
||||||
|
_WindowExists = False;
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
return errEvt->error_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool windowExists(Display * dpy, Window win)
|
||||||
static Bool
|
|
||||||
windowExists(Display *dpy, Window win)
|
|
||||||
{
|
{
|
||||||
void* previousErrorHandler;
|
void *previousErrorHandler;
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
||||||
XSynchronize(dpy, True);
|
XSynchronize(dpy, True);
|
||||||
previousErrorHandler = XSetErrorHandler(handleNoWindowXError);
|
previousErrorHandler = XSetErrorHandler(handleNoWindowXError);
|
||||||
_WindowExists = True;
|
_WindowExists = True;
|
||||||
|
|
||||||
/* can generate BadDrawable or BadWindow */
|
/* can generate BadDrawable or BadWindow */
|
||||||
XGetWindowAttributes(dpy, win, &attr);
|
XGetWindowAttributes(dpy, win, &attr);
|
||||||
|
|
||||||
XSetErrorHandler(previousErrorHandler);
|
XSetErrorHandler(previousErrorHandler);
|
||||||
XSynchronize(dpy, False);
|
XSynchronize(dpy, False);
|
||||||
return _WindowExists;
|
return _WindowExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
W_SendDnDClientMessage(Display *dpy, Window win, Atom message,
|
W_SendDnDClientMessage(Display * dpy, Window win, Atom message,
|
||||||
unsigned long data0,
|
unsigned long data0,
|
||||||
unsigned long data1,
|
unsigned long data1, unsigned long data2, unsigned long data3, unsigned long data4)
|
||||||
unsigned long data2,
|
|
||||||
unsigned long data3,
|
|
||||||
unsigned long data4)
|
|
||||||
{
|
{
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
#ifdef XDND_DEBUG
|
#ifdef XDND_DEBUG
|
||||||
char* msgName = XGetAtomName(dpy, message);
|
char *msgName = XGetAtomName(dpy, message);
|
||||||
|
|
||||||
printf("sending message %s ... ", msgName);
|
printf("sending message %s ... ", msgName);
|
||||||
XFree(msgName);
|
XFree(msgName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (! windowExists(dpy, win)) {
|
if (!windowExists(dpy, win)) {
|
||||||
wwarning("xdnd message target %d does no longer exist.", win);
|
wwarning("xdnd message target %lu does no longer exist.", win);
|
||||||
return False; /* message not sent */
|
return False; /* message not sent */
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.type = ClientMessage;
|
ev.type = ClientMessage;
|
||||||
ev.xclient.message_type = message;
|
ev.xclient.message_type = message;
|
||||||
ev.xclient.format = 32;
|
ev.xclient.format = 32;
|
||||||
ev.xclient.window = win;
|
ev.xclient.window = win;
|
||||||
ev.xclient.data.l[0] = data0;
|
ev.xclient.data.l[0] = data0;
|
||||||
ev.xclient.data.l[1] = data1;
|
ev.xclient.data.l[1] = data1;
|
||||||
ev.xclient.data.l[2] = data2;
|
ev.xclient.data.l[2] = data2;
|
||||||
ev.xclient.data.l[3] = data3;
|
ev.xclient.data.l[3] = data3;
|
||||||
ev.xclient.data.l[4] = data4;
|
ev.xclient.data.l[4] = data4;
|
||||||
|
|
||||||
|
XSendEvent(dpy, win, False, 0, &ev);
|
||||||
XSendEvent(dpy, win, False, 0, &ev);
|
XFlush(dpy);
|
||||||
XFlush(dpy);
|
|
||||||
|
|
||||||
#ifdef XDND_DEBUG
|
#ifdef XDND_DEBUG
|
||||||
printf("sent\n");
|
printf("sent\n");
|
||||||
#endif
|
#endif
|
||||||
return True; /* message sent */
|
return True; /* message sent */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleLeaveMessage(WMDraggingInfo * info)
|
||||||
static void
|
|
||||||
handleLeaveMessage(WMDraggingInfo *info)
|
|
||||||
{
|
{
|
||||||
if (XDND_DEST_INFO(info) != NULL) {
|
if (XDND_DEST_INFO(info) != NULL) {
|
||||||
/* XDND_DEST_VIEW is never NULL (it's the xdnd aware view) */
|
/* XDND_DEST_VIEW is never NULL (it's the xdnd aware view) */
|
||||||
wassertr(XDND_DEST_VIEW(info) != NULL);
|
wassertr(XDND_DEST_VIEW(info) != NULL);
|
||||||
if (XDND_DEST_VIEW(info)->dragDestinationProcs != NULL) {
|
if (XDND_DEST_VIEW(info)->dragDestinationProcs != NULL) {
|
||||||
XDND_DEST_VIEW(info)->dragDestinationProcs->concludeDragOperation(
|
XDND_DEST_VIEW(info)->dragDestinationProcs->concludeDragOperation(XDND_DEST_VIEW(info));
|
||||||
XDND_DEST_VIEW(info));
|
}
|
||||||
}
|
W_DragDestinationInfoClear(info);
|
||||||
W_DragDestinationInfoClear(info);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_HandleDNDClientMessage(WMView * toplevel, XClientMessageEvent * event)
|
||||||
void
|
|
||||||
W_HandleDNDClientMessage(WMView *toplevel, XClientMessageEvent *event)
|
|
||||||
{
|
{
|
||||||
WMScreen *scr = W_VIEW_SCREEN(toplevel);
|
WMScreen *scr = W_VIEW_SCREEN(toplevel);
|
||||||
WMDraggingInfo *info = &scr->dragInfo;
|
WMDraggingInfo *info = &scr->dragInfo;
|
||||||
Atom messageType = event->message_type;
|
Atom messageType = event->message_type;
|
||||||
|
|
||||||
#ifdef XDND_DEBUG
|
#ifdef XDND_DEBUG
|
||||||
{
|
{
|
||||||
char* msgTypeName = XGetAtomName(scr->display, messageType);
|
char *msgTypeName = XGetAtomName(scr->display, messageType);
|
||||||
|
|
||||||
if (msgTypeName != NULL)
|
if (msgTypeName != NULL)
|
||||||
printf("event type = %s\n", msgTypeName);
|
printf("event type = %s\n", msgTypeName);
|
||||||
else
|
else
|
||||||
printf("pb with event type !\n");
|
printf("pb with event type !\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Messages from destination to source */
|
||||||
|
if (messageType == scr->xdndStatusAtom || messageType == scr->xdndFinishedAtom) {
|
||||||
|
W_DragSourceStopTimer();
|
||||||
|
W_DragSourceStateHandler(info, event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Messages from destination to source */
|
/* Messages from source to destination */
|
||||||
if (messageType == scr->xdndStatusAtom
|
if (messageType == scr->xdndEnterAtom) {
|
||||||
|| messageType == scr->xdndFinishedAtom) {
|
Bool positionSent = (XDND_DEST_INFO(info) != NULL);
|
||||||
W_DragSourceStopTimer();
|
|
||||||
W_DragSourceStateHandler(info, event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Messages from source to destination */
|
W_DragDestinationStopTimer();
|
||||||
if (messageType == scr->xdndEnterAtom) {
|
W_DragDestinationStoreEnterMsgInfo(info, toplevel, event);
|
||||||
Bool positionSent = (XDND_DEST_INFO(info) != NULL);
|
|
||||||
|
|
||||||
W_DragDestinationStopTimer();
|
/* Xdnd version 3 and up are not compatible with version 1 or 2 */
|
||||||
W_DragDestinationStoreEnterMsgInfo(info, toplevel, event);
|
if (XDND_SOURCE_VERSION(info) > 2) {
|
||||||
|
|
||||||
/* Xdnd version 3 and up are not compatible with version 1 or 2 */
|
if (positionSent) {
|
||||||
if (XDND_SOURCE_VERSION(info) > 2) {
|
/* xdndPosition previously received on xdnd aware view */
|
||||||
|
W_DragDestinationStateHandler(info, event);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
W_DragDestinationStartTimer(info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wwarning("received dnd enter msg with unsupported version %i", XDND_SOURCE_VERSION(info));
|
||||||
|
W_DragDestinationCancelDropOnEnter(toplevel, info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (positionSent) {
|
if (messageType == scr->xdndPositionAtom) {
|
||||||
/* xdndPosition previously received on xdnd aware view */
|
W_DragDestinationStopTimer();
|
||||||
W_DragDestinationStateHandler(info, event);
|
W_DragDestinationStorePositionMsgInfo(info, toplevel, event);
|
||||||
return;
|
W_DragDestinationStateHandler(info, event);
|
||||||
} else {
|
return;
|
||||||
W_DragDestinationStartTimer(info);
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
wwarning("received dnd enter msg with unsupported version %i",
|
|
||||||
XDND_SOURCE_VERSION(info));
|
|
||||||
W_DragDestinationCancelDropOnEnter(toplevel, info);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (messageType == scr->xdndPositionAtom) {
|
if (messageType == scr->xdndSelectionAtom || messageType == scr->xdndDropAtom) {
|
||||||
W_DragDestinationStopTimer();
|
W_DragDestinationStopTimer();
|
||||||
W_DragDestinationStorePositionMsgInfo(info, toplevel, event);
|
W_DragDestinationStateHandler(info, event);
|
||||||
W_DragDestinationStateHandler(info, event);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (messageType == scr->xdndSelectionAtom
|
if (messageType == scr->xdndLeaveAtom) {
|
||||||
|| messageType == scr->xdndDropAtom) {
|
/* conclude drop operation, and clear dragging info */
|
||||||
W_DragDestinationStopTimer();
|
W_DragDestinationStopTimer();
|
||||||
W_DragDestinationStateHandler(info, event);
|
handleLeaveMessage(info);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (messageType == scr->xdndLeaveAtom) {
|
|
||||||
/* conclude drop operation, and clear dragging info */
|
|
||||||
W_DragDestinationStopTimer();
|
|
||||||
handleLeaveMessage(info);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* called in destroyView (wview.c) */
|
/* called in destroyView (wview.c) */
|
||||||
void
|
void W_FreeViewXdndPart(WMView * view)
|
||||||
W_FreeViewXdndPart(WMView *view)
|
|
||||||
{
|
{
|
||||||
WMUnregisterViewDraggedTypes(view);
|
WMUnregisterViewDraggedTypes(view);
|
||||||
|
|
||||||
if (view->dragSourceProcs)
|
if (view->dragSourceProcs)
|
||||||
wfree(view->dragSourceProcs);
|
wfree(view->dragSourceProcs);
|
||||||
|
|
||||||
if (view->dragDestinationProcs)
|
if (view->dragDestinationProcs)
|
||||||
wfree(view->dragDestinationProcs);
|
wfree(view->dragDestinationProcs);
|
||||||
|
|
||||||
if (view->dragImage)
|
if (view->dragImage)
|
||||||
WMReleasePixmap(view->dragImage);
|
WMReleasePixmap(view->dragImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
1664
WINGs/dragsource.c
1664
WINGs/dragsource.c
File diff suppressed because it is too large
Load Diff
271
WINGs/error.c
271
WINGs/error.c
@@ -15,188 +15,133 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
extern char *_WINGS_progname;
|
#include <WUtil.h>
|
||||||
|
#include <WINGsP.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
|
static Bool syslog_initialized = False;
|
||||||
|
|
||||||
|
|
||||||
#define MAXLINE 1024
|
static void syslog_open(const char *prog_name)
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* Returns the system error message associated with error code 'errnum'
|
|
||||||
*********************************************************************/
|
|
||||||
char*
|
|
||||||
wstrerror(int errnum)
|
|
||||||
{
|
{
|
||||||
#if defined(HAVE_STRERROR)
|
int options;
|
||||||
return strerror(errnum);
|
|
||||||
#elif !defined(HAVE_STRERROR) && defined(BSD)
|
|
||||||
extern int errno, sys_nerr;
|
|
||||||
# ifndef __DECC
|
|
||||||
extern char *sys_errlist[];
|
|
||||||
# endif
|
|
||||||
static char buf[] = "Unknown error 12345678901234567890";
|
|
||||||
|
|
||||||
if (errno < sys_nerr)
|
if (!prog_name)
|
||||||
return sys_errlist[errnum];
|
prog_name = "WINGs";
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), _("Unknown error %d"), errnum);
|
options = LOG_PID;
|
||||||
return buf;
|
openlog(prog_name, options, LOG_DAEMON);
|
||||||
#else /* no strerror() and no sys_errlist[] */
|
syslog_initialized = True;
|
||||||
static char buf[] = "Error 12345678901234567890";
|
}
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), _("Error %d"), errnum);
|
static void syslog_message(int prio, const char *prog_name, const char *msg)
|
||||||
return buf;
|
{
|
||||||
|
if (!syslog_initialized)
|
||||||
|
syslog_open(prog_name);
|
||||||
|
|
||||||
|
//jump over the program name cause syslog is already displaying it
|
||||||
|
syslog(prio, "%s", msg + strlen(prog_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
void w_syslog_close(void)
|
||||||
|
{
|
||||||
|
if (syslog_initialized) {
|
||||||
|
closelog();
|
||||||
|
syslog_initialized = False;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
|
void __wmessage(const char *func, const char *file, int line, int type, const char *msg, ...)
|
||||||
/*********************************************************************
|
|
||||||
* Prints a message with variable arguments
|
|
||||||
*
|
|
||||||
* msg - message to print with optional formatting
|
|
||||||
* ... - arguments to use on formatting
|
|
||||||
*********************************************************************/
|
|
||||||
void
|
|
||||||
wmessage(const char *msg, ...)
|
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char buf[MAXLINE];
|
char *buf;
|
||||||
|
static int linemax = 0;
|
||||||
|
int truncated = 0;
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
int syslog_priority = LOG_INFO;
|
||||||
|
#endif
|
||||||
|
|
||||||
va_start(args, msg);
|
if (linemax == 0) {
|
||||||
|
#ifdef HAVE_SYSCONF
|
||||||
|
linemax = sysconf(_SC_LINE_MAX);
|
||||||
|
if (linemax == -1) {
|
||||||
|
/* I'd like to know of this ever fires */
|
||||||
|
fprintf(stderr, "%s %d: sysconf(_SC_LINE_MAX) returned error\n",
|
||||||
|
__FILE__, __LINE__);
|
||||||
|
linemax = 512;
|
||||||
|
}
|
||||||
|
#else /* !HAVE_SYSCONF */
|
||||||
|
fprintf(stderr, "%s %d: Your system does not have sysconf(3); "
|
||||||
|
"let wmaker-dev@windowmaker.org know.\n", __FILE__, __LINE__);
|
||||||
|
linemax = 512;
|
||||||
|
#endif /* HAVE_SYSCONF */
|
||||||
|
}
|
||||||
|
|
||||||
vsnprintf(buf, MAXLINE-3, msg, args);
|
buf = wmalloc(linemax);
|
||||||
strcat(buf,"\n");
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_WINGS_progname ? _WINGS_progname : "WINGs", stderr);
|
|
||||||
fputs(": ",stderr);
|
|
||||||
fputs(buf, stderr);
|
|
||||||
fflush(stdout);
|
|
||||||
fflush(stderr);
|
|
||||||
|
|
||||||
va_end(args);
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* message format: <wings_progname>(function(file:line): <type?>: <message>"\n" */
|
||||||
|
strncat(buf, _WINGS_progname ? _WINGS_progname : "WINGs", linemax - 1);
|
||||||
|
snprintf(buf + strlen(buf), linemax - strlen(buf), "(%s(%s:%d))", func, file, line);
|
||||||
|
strncat(buf, ": ", linemax - 1 - strlen(buf));
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case WMESSAGE_TYPE_FATAL:
|
||||||
|
strncat(buf, _("fatal: "), linemax - 1 - strlen(buf));
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
syslog_priority = LOG_CRIT;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case WMESSAGE_TYPE_ERROR:
|
||||||
|
strncat(buf, _("error: "), linemax - 1 - strlen(buf));
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
syslog_priority = LOG_ERR;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case WMESSAGE_TYPE_WARNING:
|
||||||
|
strncat(buf, _("warning: "), linemax - 1 - strlen(buf));
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
syslog_priority = LOG_WARNING;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case WMESSAGE_TYPE_MESSAGE:
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
default: /* should not happen, but doesn't hurt either */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
va_start(args, msg);
|
||||||
|
if (vsnprintf(buf + strlen(buf), linemax - strlen(buf), msg, args) >= linemax - strlen(buf))
|
||||||
|
truncated = 1;
|
||||||
|
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
fputs(buf, stderr);
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
syslog_message(syslog_priority, _WINGS_progname ? _WINGS_progname : "WINGs", buf);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (truncated)
|
||||||
|
fputs("*** message truncated ***", stderr);
|
||||||
|
|
||||||
|
fputs("\n", stderr);
|
||||||
|
|
||||||
|
wfree(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* Prints a warning message with variable arguments
|
|
||||||
*
|
|
||||||
* msg - message to print with optional formatting
|
|
||||||
* ... - arguments to use on formatting
|
|
||||||
*********************************************************************/
|
|
||||||
void
|
|
||||||
wwarning(const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[MAXLINE];
|
|
||||||
|
|
||||||
va_start(args, msg);
|
|
||||||
|
|
||||||
vsnprintf(buf, MAXLINE-3, msg, args);
|
|
||||||
strcat(buf,"\n");
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_WINGS_progname ? _WINGS_progname : "WINGs", stderr);
|
|
||||||
fputs(_(" warning: "),stderr);
|
|
||||||
fputs(buf, stderr);
|
|
||||||
fflush(stdout);
|
|
||||||
fflush(stderr);
|
|
||||||
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* Prints a fatal error message with variable arguments and terminates
|
|
||||||
*
|
|
||||||
* msg - message to print with optional formatting
|
|
||||||
* ... - arguments to use on formatting
|
|
||||||
**************************************************************************/
|
|
||||||
void
|
|
||||||
wfatal(const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[MAXLINE];
|
|
||||||
|
|
||||||
va_start(args, msg);
|
|
||||||
|
|
||||||
vsnprintf(buf, MAXLINE-3, msg, args);
|
|
||||||
strcat(buf,"\n");
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_WINGS_progname ? _WINGS_progname : "WINGs", stderr);
|
|
||||||
fputs(_(" fatal error: "),stderr);
|
|
||||||
fputs(buf, stderr);
|
|
||||||
fflush(stdout);
|
|
||||||
fflush(stderr);
|
|
||||||
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* Prints a system error message with variable arguments
|
|
||||||
*
|
|
||||||
* msg - message to print with optional formatting
|
|
||||||
* ... - arguments to use on formatting
|
|
||||||
*********************************************************************/
|
|
||||||
void
|
|
||||||
wsyserror(const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[MAXLINE];
|
|
||||||
int error=errno;
|
|
||||||
|
|
||||||
va_start(args, msg);
|
|
||||||
vsnprintf(buf, MAXLINE-3, msg, args);
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_WINGS_progname ? _WINGS_progname : "WINGs", stderr);
|
|
||||||
fputs(_(" error: "), stderr);
|
|
||||||
fputs(buf, stderr);
|
|
||||||
fputs(": ", stderr);
|
|
||||||
fputs(wstrerror(error), stderr);
|
|
||||||
fputs("\n", stderr);
|
|
||||||
fflush(stderr);
|
|
||||||
fflush(stdout);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* Prints a system error message with variable arguments, being given
|
|
||||||
* the error code.
|
|
||||||
*
|
|
||||||
* error - the error code foe which to print the message
|
|
||||||
* msg - message to print with optional formatting
|
|
||||||
* ... - arguments to use on formatting
|
|
||||||
*********************************************************************/
|
|
||||||
void
|
|
||||||
wsyserrorwithcode(int error, const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[MAXLINE];
|
|
||||||
|
|
||||||
va_start(args, msg);
|
|
||||||
vsnprintf(buf, MAXLINE-3, msg, args);
|
|
||||||
fflush(stdout);
|
|
||||||
fputs(_WINGS_progname ? _WINGS_progname : "WINGs", stderr);
|
|
||||||
fputs(_(" error: "), stderr);
|
|
||||||
fputs(buf, stderr);
|
|
||||||
fputs(": ", stderr);
|
|
||||||
fputs(wstrerror(error), stderr);
|
|
||||||
fputs("\n", stderr);
|
|
||||||
fflush(stderr);
|
|
||||||
fflush(stdout);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
36
WINGs/error.h
Normal file
36
WINGs/error.h
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/* WUtil / error.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Window Maker Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WUTIL_ERROR_H
|
||||||
|
#define WUTIL_ERROR_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is not part of WUtil public API
|
||||||
|
*
|
||||||
|
* It defines internal things for the error message display functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
/* Function to cleanly close the syslog stuff, called by wutil_shutdown from user side */
|
||||||
|
void w_syslog_close(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* WUTIL_ERROR_H */
|
||||||
640
WINGs/findfile.c
640
WINGs/findfile.c
@@ -15,14 +15,17 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -34,154 +37,199 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
char*
|
char *wgethomedir()
|
||||||
wgethomedir()
|
|
||||||
{
|
{
|
||||||
char *home = getenv("HOME");
|
static char *home = NULL;
|
||||||
struct passwd *user;
|
char *tmp;
|
||||||
|
struct passwd *user;
|
||||||
|
|
||||||
if (home)
|
if (home)
|
||||||
return home;
|
return home;
|
||||||
|
|
||||||
user = getpwuid(getuid());
|
#ifdef HAVE_SECURE_GETENV
|
||||||
if (!user) {
|
tmp = secure_getenv("HOME");
|
||||||
wsyserror(_("could not get password entry for UID %i"), getuid());
|
#else
|
||||||
return "/";
|
tmp = getenv("HOME");
|
||||||
}
|
#endif
|
||||||
if (!user->pw_dir) {
|
if (tmp) {
|
||||||
return "/";
|
home = wstrdup(tmp);
|
||||||
} else {
|
return home;
|
||||||
return user->pw_dir;
|
}
|
||||||
}
|
|
||||||
|
user = getpwuid(getuid());
|
||||||
|
if (!user) {
|
||||||
|
werror(_("could not get password entry for UID %i"), getuid());
|
||||||
|
home = "/";
|
||||||
|
return home;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!user->pw_dir)
|
||||||
|
home = "/";
|
||||||
|
else
|
||||||
|
home = wstrdup(user->pw_dir);
|
||||||
|
|
||||||
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
static char*
|
* Return the home directory for the specified used
|
||||||
getuserhomedir(char *username)
|
*
|
||||||
|
* If user not found, returns NULL, otherwise always returns a path that is
|
||||||
|
* statically stored.
|
||||||
|
*
|
||||||
|
* Please note you must use the path before any other call to 'getpw*' or it
|
||||||
|
* may be erased. This is a design choice to avoid duplication considering
|
||||||
|
* the use case for this function.
|
||||||
|
*/
|
||||||
|
static const char *getuserhomedir(const char *username)
|
||||||
{
|
{
|
||||||
struct passwd *user;
|
static const char default_home[] = "/";
|
||||||
|
struct passwd *user;
|
||||||
|
|
||||||
|
user = getpwnam(username);
|
||||||
|
if (!user) {
|
||||||
|
werror(_("could not get password entry for user %s"), username);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (!user->pw_dir)
|
||||||
|
return default_home;
|
||||||
|
else
|
||||||
|
return user->pw_dir;
|
||||||
|
|
||||||
user = getpwnam(username);
|
|
||||||
if (!user) {
|
|
||||||
wsyserror(_("could not get password entry for user %s"), username);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (!user->pw_dir) {
|
|
||||||
return "/";
|
|
||||||
} else {
|
|
||||||
return user->pw_dir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *wexpandpath(const char *path)
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
wexpandpath(char *path)
|
|
||||||
{
|
{
|
||||||
char buffer2[PATH_MAX+2];
|
const char *origpath = path;
|
||||||
char buffer[PATH_MAX+2];
|
char buffer2[PATH_MAX + 2];
|
||||||
int i;
|
char buffer[PATH_MAX + 2];
|
||||||
|
int i;
|
||||||
|
|
||||||
memset(buffer, 0, PATH_MAX+2);
|
memset(buffer, 0, PATH_MAX + 2);
|
||||||
|
|
||||||
if (*path=='~') {
|
if (*path == '~') {
|
||||||
char *home;
|
const char *home;
|
||||||
|
|
||||||
path++;
|
path++;
|
||||||
if (*path=='/' || *path==0) {
|
if (*path == '/' || *path == 0) {
|
||||||
home = wgethomedir();
|
home = wgethomedir();
|
||||||
strcat(buffer, home);
|
if (strlen(home) > PATH_MAX ||
|
||||||
} else {
|
wstrlcpy(buffer, home, sizeof(buffer)) >= sizeof(buffer))
|
||||||
int j;
|
goto error;
|
||||||
j = 0;
|
} else {
|
||||||
while (*path!=0 && *path!='/') {
|
int j;
|
||||||
buffer2[j++] = *path;
|
j = 0;
|
||||||
buffer2[j] = 0;
|
while (*path != 0 && *path != '/') {
|
||||||
path++;
|
if (j > PATH_MAX)
|
||||||
}
|
goto error;
|
||||||
home = getuserhomedir(buffer2);
|
buffer2[j++] = *path;
|
||||||
if (!home)
|
buffer2[j] = 0;
|
||||||
return NULL;
|
path++;
|
||||||
strcat(buffer, home);
|
}
|
||||||
}
|
home = getuserhomedir(buffer2);
|
||||||
}
|
if (!home || wstrlcat(buffer, home, sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
i = strlen(buffer);
|
i = strlen(buffer);
|
||||||
|
|
||||||
while (*path!=0) {
|
while (*path != 0 && i <= PATH_MAX) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
if (*path=='$') {
|
if (*path == '$') {
|
||||||
int j = 0;
|
int j;
|
||||||
path++;
|
|
||||||
/* expand $(HOME) or $HOME style environment variables */
|
|
||||||
if (*path=='(') {
|
|
||||||
path++;
|
|
||||||
while (*path!=0 && *path!=')') {
|
|
||||||
buffer2[j++] = *(path++);
|
|
||||||
buffer2[j] = 0;
|
|
||||||
}
|
|
||||||
if (*path==')')
|
|
||||||
path++;
|
|
||||||
tmp = getenv(buffer2);
|
|
||||||
if (!tmp) {
|
|
||||||
buffer[i] = 0;
|
|
||||||
strcat(buffer, "$(");
|
|
||||||
strcat(buffer, buffer2);
|
|
||||||
strcat(buffer, ")");
|
|
||||||
i += strlen(buffer2)+3;
|
|
||||||
} else {
|
|
||||||
strcat(buffer, tmp);
|
|
||||||
i += strlen(tmp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (*path!=0 && *path!='/') {
|
|
||||||
buffer2[j++] = *(path++);
|
|
||||||
buffer2[j] = 0;
|
|
||||||
}
|
|
||||||
tmp = getenv(buffer2);
|
|
||||||
if (!tmp) {
|
|
||||||
strcat(buffer, "$");
|
|
||||||
strcat(buffer, buffer2);
|
|
||||||
i += strlen(buffer2)+1;
|
|
||||||
} else {
|
|
||||||
strcat(buffer, tmp);
|
|
||||||
i += strlen(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
buffer[i++] = *path;
|
|
||||||
path++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return wstrdup(buffer);
|
path++;
|
||||||
|
/* expand $(HOME) or $HOME style environment variables */
|
||||||
|
if (*path == '(') {
|
||||||
|
path++;
|
||||||
|
j = 0;
|
||||||
|
while (*path != 0 && *path != ')') {
|
||||||
|
if (j > PATH_MAX)
|
||||||
|
goto error;
|
||||||
|
buffer2[j++] = *(path++);
|
||||||
|
}
|
||||||
|
buffer2[j] = 0;
|
||||||
|
if (*path == ')') {
|
||||||
|
path++;
|
||||||
|
tmp = getenv(buffer2);
|
||||||
|
} else {
|
||||||
|
tmp = NULL;
|
||||||
|
}
|
||||||
|
if (!tmp) {
|
||||||
|
if ((i += strlen(buffer2) + 2) > PATH_MAX)
|
||||||
|
goto error;
|
||||||
|
buffer[i] = 0;
|
||||||
|
if (wstrlcat(buffer, "$(", sizeof(buffer)) >= sizeof(buffer) ||
|
||||||
|
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
if (*(path-1)==')') {
|
||||||
|
if (++i > PATH_MAX ||
|
||||||
|
wstrlcat(buffer, ")", sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((i += strlen(tmp)) > PATH_MAX ||
|
||||||
|
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
j = 0;
|
||||||
|
while (*path != 0 && *path != '/') {
|
||||||
|
if (j > PATH_MAX)
|
||||||
|
goto error;
|
||||||
|
buffer2[j++] = *(path++);
|
||||||
|
}
|
||||||
|
buffer2[j] = 0;
|
||||||
|
tmp = getenv(buffer2);
|
||||||
|
if (!tmp) {
|
||||||
|
if ((i += strlen(buffer2) + 1) > PATH_MAX ||
|
||||||
|
wstrlcat(buffer, "$", sizeof(buffer)) >= sizeof(buffer) ||
|
||||||
|
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
} else {
|
||||||
|
if ((i += strlen(tmp)) > PATH_MAX ||
|
||||||
|
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
buffer[i++] = *path;
|
||||||
|
path++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*path!=0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
return wstrdup(buffer);
|
||||||
|
|
||||||
|
error:
|
||||||
|
errno = ENAMETOOLONG;
|
||||||
|
werror(_("could not expand %s"), origpath);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* return address of next char != tok or end of string whichever comes first */
|
/* return address of next char != tok or end of string whichever comes first */
|
||||||
static char*
|
static const char *skipchar(const char *string, char tok)
|
||||||
skipchar(char *string, char tok)
|
|
||||||
{
|
{
|
||||||
while(*string!=0 && *string==tok)
|
while (*string != 0 && *string == tok)
|
||||||
string++;
|
string++;
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* return address of next char == tok or end of string whichever comes first */
|
/* return address of next char == tok or end of string whichever comes first */
|
||||||
static char*
|
static const char *nextchar(const char *string, char tok)
|
||||||
nextchar(char *string, char tok)
|
|
||||||
{
|
{
|
||||||
while(*string!=0 && *string!=tok)
|
while (*string != 0 && *string != tok)
|
||||||
string++;
|
string++;
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
* findfile--
|
* findfile--
|
||||||
@@ -197,173 +245,237 @@ nextchar(char *string, char tok)
|
|||||||
*
|
*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
char*
|
char *wfindfile(const char *paths, const char *file)
|
||||||
wfindfile(char *paths, char *file)
|
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
char *tmp, *tmp2;
|
const char *tmp, *tmp2;
|
||||||
int len, flen;
|
int len, flen;
|
||||||
char *fullpath;
|
char *fullpath;
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (*file=='/' || *file=='~' || *file=='$' || !paths || *paths==0) {
|
if (*file == '/' || *file == '~' || *file == '$' || !paths || *paths == 0) {
|
||||||
if (access(file, F_OK)<0) {
|
if (access(file, F_OK) < 0) {
|
||||||
fullpath = wexpandpath(file);
|
fullpath = wexpandpath(file);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (access(fullpath, F_OK)<0) {
|
if (access(fullpath, F_OK) < 0) {
|
||||||
wfree(fullpath);
|
wfree(fullpath);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return wstrdup(file);
|
return wstrdup(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flen = strlen(file);
|
flen = strlen(file);
|
||||||
tmp = paths;
|
tmp = paths;
|
||||||
while (*tmp) {
|
while (*tmp) {
|
||||||
tmp = skipchar(tmp, ':');
|
tmp = skipchar(tmp, ':');
|
||||||
if (*tmp==0)
|
if (*tmp == 0)
|
||||||
break;
|
break;
|
||||||
tmp2 = nextchar(tmp, ':');
|
tmp2 = nextchar(tmp, ':');
|
||||||
len = tmp2 - tmp;
|
len = tmp2 - tmp;
|
||||||
path = wmalloc(len+flen+2);
|
path = wmalloc(len + flen + 2);
|
||||||
path = memcpy(path, tmp, len);
|
path = memcpy(path, tmp, len);
|
||||||
path[len]=0;
|
path[len] = 0;
|
||||||
if (path[len-1] != '/')
|
if (path[len - 1] != '/' &&
|
||||||
strcat(path, "/");
|
wstrlcat(path, "/", len + flen + 2) >= len + flen + 2) {
|
||||||
strcat(path, file);
|
wfree(path);
|
||||||
fullpath = wexpandpath(path);
|
return NULL;
|
||||||
wfree(path);
|
}
|
||||||
if (fullpath) {
|
|
||||||
if (access(fullpath, F_OK)==0) {
|
|
||||||
return fullpath;
|
|
||||||
}
|
|
||||||
wfree(fullpath);
|
|
||||||
}
|
|
||||||
tmp = tmp2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
if (wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
|
||||||
|
wfree(path);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
fullpath = wexpandpath(path);
|
||||||
|
wfree(path);
|
||||||
|
|
||||||
|
if (fullpath) {
|
||||||
|
if (access(fullpath, F_OK) == 0) {
|
||||||
|
return fullpath;
|
||||||
|
}
|
||||||
|
wfree(fullpath);
|
||||||
|
}
|
||||||
|
tmp = tmp2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *wfindfileinlist(char *const *path_list, const char *file)
|
||||||
char*
|
|
||||||
wfindfileinlist(char **path_list, char *file)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *path;
|
char *path;
|
||||||
int len, flen;
|
int len, flen;
|
||||||
char *fullpath;
|
char *fullpath;
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (*file=='/' || *file=='~' || !path_list) {
|
if (*file == '/' || *file == '~' || !path_list) {
|
||||||
if (access(file, F_OK)<0) {
|
if (access(file, F_OK) < 0) {
|
||||||
fullpath = wexpandpath(file);
|
fullpath = wexpandpath(file);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (access(fullpath, F_OK)<0) {
|
if (access(fullpath, F_OK) < 0) {
|
||||||
wfree(fullpath);
|
wfree(fullpath);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return wstrdup(file);
|
return wstrdup(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flen = strlen(file);
|
flen = strlen(file);
|
||||||
for (i=0; path_list[i]!=NULL; i++) {
|
for (i = 0; path_list[i] != NULL; i++) {
|
||||||
len = strlen(path_list[i]);
|
len = strlen(path_list[i]);
|
||||||
path = wmalloc(len+flen+2);
|
path = wmalloc(len + flen + 2);
|
||||||
path = memcpy(path, path_list[i], len);
|
path = memcpy(path, path_list[i], len);
|
||||||
path[len]=0;
|
path[len] = 0;
|
||||||
strcat(path, "/");
|
if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 ||
|
||||||
strcat(path, file);
|
wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
|
||||||
/* expand tilde */
|
wfree(path);
|
||||||
fullpath = wexpandpath(path);
|
return NULL;
|
||||||
wfree(path);
|
}
|
||||||
if (fullpath) {
|
/* expand tilde */
|
||||||
/* check if file exists */
|
fullpath = wexpandpath(path);
|
||||||
if (access(fullpath, F_OK)==0) {
|
wfree(path);
|
||||||
return fullpath;
|
if (fullpath) {
|
||||||
}
|
/* check if file exists */
|
||||||
wfree(fullpath);
|
if (access(fullpath, F_OK) == 0) {
|
||||||
}
|
return fullpath;
|
||||||
}
|
}
|
||||||
return NULL;
|
wfree(fullpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *wfindfileinarray(WMPropList *array, const char *file)
|
||||||
|
|
||||||
char*
|
|
||||||
wfindfileinarray(WMPropList *array, char *file)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *path;
|
char *path;
|
||||||
int len, flen;
|
int len, flen;
|
||||||
char *fullpath;
|
char *fullpath;
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (*file=='/' || *file=='~' || !array) {
|
if (*file == '/' || *file == '~' || !array) {
|
||||||
if (access(file, F_OK)<0) {
|
if (access(file, F_OK) < 0) {
|
||||||
fullpath = wexpandpath(file);
|
fullpath = wexpandpath(file);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (access(fullpath, F_OK)<0) {
|
if (access(fullpath, F_OK) < 0) {
|
||||||
wfree(fullpath);
|
wfree(fullpath);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
return fullpath;
|
return fullpath;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return wstrdup(file);
|
return wstrdup(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flen = strlen(file);
|
flen = strlen(file);
|
||||||
for (i=0; i<WMGetPropListItemCount(array); i++) {
|
for (i = 0; i < WMGetPropListItemCount(array); i++) {
|
||||||
WMPropList *prop;
|
WMPropList *prop;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
prop = WMGetFromPLArray(array, i);
|
prop = WMGetFromPLArray(array, i);
|
||||||
if (!prop)
|
if (!prop)
|
||||||
continue;
|
continue;
|
||||||
p = WMGetFromPLString(prop);
|
p = WMGetFromPLString(prop);
|
||||||
|
|
||||||
len = strlen(p);
|
len = strlen(p);
|
||||||
path = wmalloc(len+flen+2);
|
path = wmalloc(len + flen + 2);
|
||||||
path = memcpy(path, p, len);
|
path = memcpy(path, p, len);
|
||||||
path[len]=0;
|
path[len] = 0;
|
||||||
strcat(path, "/");
|
if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 ||
|
||||||
strcat(path, file);
|
wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
|
||||||
/* expand tilde */
|
wfree(path);
|
||||||
fullpath = wexpandpath(path);
|
return NULL;
|
||||||
wfree(path);
|
}
|
||||||
if (fullpath) {
|
/* expand tilde */
|
||||||
/* check if file exists */
|
fullpath = wexpandpath(path);
|
||||||
if (access(fullpath, F_OK)==0) {
|
wfree(path);
|
||||||
return fullpath;
|
if (fullpath) {
|
||||||
}
|
/* check if file exists */
|
||||||
wfree(fullpath);
|
if (access(fullpath, F_OK) == 0) {
|
||||||
}
|
return fullpath;
|
||||||
}
|
}
|
||||||
return NULL;
|
wfree(fullpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wcopy_file(const char *dir, const char *src_file, const char *dest_file)
|
||||||
|
{
|
||||||
|
FILE *src, *dst;
|
||||||
|
size_t nread, nwritten;
|
||||||
|
char *dstpath;
|
||||||
|
struct stat st;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
/* only to a directory */
|
||||||
|
if (stat(dir, &st) != 0 || !S_ISDIR(st.st_mode))
|
||||||
|
return -1;
|
||||||
|
/* only copy files */
|
||||||
|
if (stat(src_file, &st) != 0 || !S_ISREG(st.st_mode))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
do {
|
||||||
|
src = fopen(src_file, "rb");
|
||||||
|
} while ((src == NULL) && (errno == EINTR));
|
||||||
|
if (src == NULL) {
|
||||||
|
werror(_("Could not open input file \"%s\""), src_file);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
dstpath = wstrconcat(dir, dest_file);
|
||||||
|
do {
|
||||||
|
dst = fopen(dstpath, "wb");
|
||||||
|
} while ((dst == NULL) && (errno == EINTR));
|
||||||
|
if (dst == NULL) {
|
||||||
|
werror(_("Could not create target file \"%s\""), dstpath);
|
||||||
|
wfree(dstpath);
|
||||||
|
fclose(src);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
nread = fread(buf, 1, sizeof(buf), src);
|
||||||
|
if (ferror(src))
|
||||||
|
break;
|
||||||
|
|
||||||
|
nwritten = fwrite(buf, 1, nread, dst);
|
||||||
|
if (ferror(dst) || feof(src) || nread != nwritten)
|
||||||
|
break;
|
||||||
|
|
||||||
|
} while (1);
|
||||||
|
|
||||||
|
if (ferror(src) || ferror(dst))
|
||||||
|
unlink(dstpath);
|
||||||
|
|
||||||
|
fclose(src);
|
||||||
|
fchmod(fileno(dst), st.st_mode);
|
||||||
|
fsync(fileno(dst));
|
||||||
|
if (fclose(dst))
|
||||||
|
wwarning("error occured during fclose(\"%s\")", dstpath);
|
||||||
|
wfree(dstpath);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
31
WINGs/get-wings-flags.in
Normal file
31
WINGs/get-wings-flags.in
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
WCFLAGS="${inc_search_path}"
|
||||||
|
WLFLAGS="${lib_search_path}"
|
||||||
|
WLIBS="-lWINGs -lWUtil -lwraster ${GFXLIBS} ${XFTLIBS} ${XLIBS} -lm ${INTLIBS}"
|
||||||
|
|
||||||
|
usage="Usage: get-wings-flags [--cflags] [--ldflags] [--libs]"
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo "${usage}" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case $1 in
|
||||||
|
--cflags)
|
||||||
|
echo $WCFLAGS
|
||||||
|
;;
|
||||||
|
--ldflags|--lflags)
|
||||||
|
echo $WLFLAGS
|
||||||
|
;;
|
||||||
|
--libs)
|
||||||
|
echo $WLIBS
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "${usage}" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
31
WINGs/get-wutil-flags.in
Normal file
31
WINGs/get-wutil-flags.in
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
WCFLAGS="-I${includedir}"
|
||||||
|
WLFLAGS="-L${libdir}"
|
||||||
|
WLIBS="-lWUtil ${INTLIBS}"
|
||||||
|
|
||||||
|
usage="Usage: get-wutil-flags [--cflags] [--ldflags] [--libs]"
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo "${usage}" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case $1 in
|
||||||
|
--cflags)
|
||||||
|
echo $WCFLAGS
|
||||||
|
;;
|
||||||
|
--ldflags|--lflags)
|
||||||
|
echo $WLFLAGS
|
||||||
|
;;
|
||||||
|
--libs)
|
||||||
|
echo $WLIBS
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "${usage}" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
755
WINGs/handlers.c
755
WINGs/handlers.c
@@ -21,47 +21,38 @@
|
|||||||
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
|
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct TimerHandler {
|
typedef struct TimerHandler {
|
||||||
WMCallback *callback; /* procedure to call */
|
WMCallback *callback; /* procedure to call */
|
||||||
struct timeval when; /* when to call the callback */
|
struct timeval when; /* when to call the callback */
|
||||||
void *clientData;
|
void *clientData;
|
||||||
struct TimerHandler *next;
|
struct TimerHandler *next;
|
||||||
int nextDelay; /* 0 if it's one-shot */
|
int nextDelay; /* 0 if it's one-shot */
|
||||||
} TimerHandler;
|
} TimerHandler;
|
||||||
|
|
||||||
|
|
||||||
typedef struct IdleHandler {
|
typedef struct IdleHandler {
|
||||||
WMCallback *callback;
|
WMCallback *callback;
|
||||||
void *clientData;
|
void *clientData;
|
||||||
} IdleHandler;
|
} IdleHandler;
|
||||||
|
|
||||||
|
|
||||||
typedef struct InputHandler {
|
typedef struct InputHandler {
|
||||||
WMInputProc *callback;
|
WMInputProc *callback;
|
||||||
void *clientData;
|
void *clientData;
|
||||||
int fd;
|
int fd;
|
||||||
int mask;
|
int mask;
|
||||||
} InputHandler;
|
} InputHandler;
|
||||||
|
|
||||||
|
|
||||||
/* queue of timer event handlers */
|
/* queue of timer event handlers */
|
||||||
static TimerHandler *timerHandler=NULL;
|
static TimerHandler *timerHandler = NULL;
|
||||||
|
|
||||||
static WMArray *idleHandler=NULL;
|
static WMArray *idleHandler = NULL;
|
||||||
|
|
||||||
static WMArray *inputHandler=NULL;
|
static WMArray *inputHandler = NULL;
|
||||||
|
|
||||||
#define timerPending() (timerHandler)
|
#define timerPending() (timerHandler)
|
||||||
|
|
||||||
|
static void rightNow(struct timeval *tv)
|
||||||
|
|
||||||
static void
|
|
||||||
rightNow(struct timeval *tv)
|
|
||||||
{
|
{
|
||||||
X_GETTIMEOFDAY(tv);
|
X_GETTIMEOFDAY(tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is t1 after t2 ? */
|
/* is t1 after t2 ? */
|
||||||
@@ -73,308 +64,277 @@ rightNow(struct timeval *tv)
|
|||||||
|
|
||||||
#define SET_ZERO(tv) tv.tv_sec = 0, tv.tv_usec = 0
|
#define SET_ZERO(tv) tv.tv_sec = 0, tv.tv_usec = 0
|
||||||
|
|
||||||
static void
|
static void addmillisecs(struct timeval *tv, int milliseconds)
|
||||||
addmillisecs(struct timeval *tv, int milliseconds)
|
|
||||||
{
|
{
|
||||||
tv->tv_usec += milliseconds*1000;
|
tv->tv_usec += milliseconds * 1000;
|
||||||
|
|
||||||
tv->tv_sec += tv->tv_usec/1000000;
|
tv->tv_sec += tv->tv_usec / 1000000;
|
||||||
tv->tv_usec = tv->tv_usec%1000000;
|
tv->tv_usec = tv->tv_usec % 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void enqueueTimerHandler(TimerHandler * handler)
|
||||||
static void
|
|
||||||
enqueueTimerHandler(TimerHandler *handler)
|
|
||||||
{
|
{
|
||||||
TimerHandler *tmp;
|
TimerHandler *tmp;
|
||||||
|
|
||||||
/* insert callback in queue, sorted by time left */
|
/* insert callback in queue, sorted by time left */
|
||||||
if (!timerHandler || !IS_AFTER(handler->when, timerHandler->when)) {
|
if (!timerHandler || !IS_AFTER(handler->when, timerHandler->when)) {
|
||||||
/* first in the queue */
|
/* first in the queue */
|
||||||
handler->next = timerHandler;
|
handler->next = timerHandler;
|
||||||
timerHandler = handler;
|
timerHandler = handler;
|
||||||
} else {
|
} else {
|
||||||
tmp = timerHandler;
|
tmp = timerHandler;
|
||||||
while (tmp->next && IS_AFTER(handler->when, tmp->next->when)) {
|
while (tmp->next && IS_AFTER(handler->when, tmp->next->when)) {
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
handler->next = tmp->next;
|
handler->next = tmp->next;
|
||||||
tmp->next = handler;
|
tmp->next = handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void delayUntilNextTimerEvent(struct timeval *delay)
|
||||||
static void
|
|
||||||
delayUntilNextTimerEvent(struct timeval *delay)
|
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
TimerHandler *handler;
|
TimerHandler *handler;
|
||||||
|
|
||||||
handler = timerHandler;
|
handler = timerHandler;
|
||||||
while (handler && IS_ZERO(handler->when)) handler = handler->next;
|
while (handler && IS_ZERO(handler->when))
|
||||||
|
handler = handler->next;
|
||||||
|
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
/* The return value of this function is only valid if there _are_
|
/* The return value of this function is only valid if there _are_
|
||||||
timers active. */
|
timers active. */
|
||||||
delay->tv_sec = 0;
|
delay->tv_sec = 0;
|
||||||
delay->tv_usec = 0;
|
delay->tv_usec = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rightNow(&now);
|
rightNow(&now);
|
||||||
if (IS_AFTER(now, handler->when)) {
|
if (IS_AFTER(now, handler->when)) {
|
||||||
delay->tv_sec = 0;
|
delay->tv_sec = 0;
|
||||||
delay->tv_usec = 0;
|
delay->tv_usec = 0;
|
||||||
} else {
|
} else {
|
||||||
delay->tv_sec = handler->when.tv_sec - now.tv_sec;
|
delay->tv_sec = handler->when.tv_sec - now.tv_sec;
|
||||||
delay->tv_usec = handler->when.tv_usec - now.tv_usec;
|
delay->tv_usec = handler->when.tv_usec - now.tv_usec;
|
||||||
if (delay->tv_usec < 0) {
|
if (delay->tv_usec < 0) {
|
||||||
delay->tv_usec += 1000000;
|
delay->tv_usec += 1000000;
|
||||||
delay->tv_sec--;
|
delay->tv_sec--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback * callback, void *cdata)
|
||||||
WMHandlerID
|
|
||||||
WMAddTimerHandler(int milliseconds, WMCallback *callback, void *cdata)
|
|
||||||
{
|
{
|
||||||
TimerHandler *handler;
|
TimerHandler *handler;
|
||||||
|
|
||||||
handler = malloc(sizeof(TimerHandler));
|
handler = malloc(sizeof(TimerHandler));
|
||||||
if (!handler)
|
if (!handler)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
rightNow(&handler->when);
|
rightNow(&handler->when);
|
||||||
addmillisecs(&handler->when, milliseconds);
|
addmillisecs(&handler->when, milliseconds);
|
||||||
handler->callback = callback;
|
handler->callback = callback;
|
||||||
handler->clientData = cdata;
|
handler->clientData = cdata;
|
||||||
handler->nextDelay = 0;
|
handler->nextDelay = 0;
|
||||||
|
|
||||||
enqueueTimerHandler(handler);
|
enqueueTimerHandler(handler);
|
||||||
|
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHandlerID WMAddPersistentTimerHandler(int milliseconds, WMCallback * callback, void *cdata)
|
||||||
WMHandlerID
|
|
||||||
WMAddPersistentTimerHandler(int milliseconds, WMCallback *callback, void *cdata)
|
|
||||||
{
|
{
|
||||||
TimerHandler *handler = WMAddTimerHandler(milliseconds, callback, cdata);
|
TimerHandler *handler = WMAddTimerHandler(milliseconds, callback, cdata);
|
||||||
|
|
||||||
if (handler != NULL)
|
if (handler != NULL)
|
||||||
handler->nextDelay = milliseconds;
|
handler->nextDelay = milliseconds;
|
||||||
|
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMDeleteTimerWithClientData(void *cdata)
|
||||||
|
|
||||||
void
|
|
||||||
WMDeleteTimerWithClientData(void *cdata)
|
|
||||||
{
|
{
|
||||||
TimerHandler *handler, *tmp;
|
TimerHandler *handler, *tmp;
|
||||||
|
|
||||||
if (!cdata || !timerHandler)
|
if (!cdata || !timerHandler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tmp = timerHandler;
|
tmp = timerHandler;
|
||||||
if (tmp->clientData==cdata) {
|
if (tmp->clientData == cdata) {
|
||||||
tmp->nextDelay = 0;
|
tmp->nextDelay = 0;
|
||||||
if (!IS_ZERO(tmp->when)) {
|
if (!IS_ZERO(tmp->when)) {
|
||||||
timerHandler = tmp->next;
|
timerHandler = tmp->next;
|
||||||
wfree(tmp);
|
wfree(tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (tmp->next) {
|
while (tmp->next) {
|
||||||
if (tmp->next->clientData==cdata) {
|
if (tmp->next->clientData == cdata) {
|
||||||
handler = tmp->next;
|
handler = tmp->next;
|
||||||
handler->nextDelay = 0;
|
handler->nextDelay = 0;
|
||||||
if (IS_ZERO(handler->when))
|
if (IS_ZERO(handler->when))
|
||||||
break;
|
break;
|
||||||
tmp->next = handler->next;
|
tmp->next = handler->next;
|
||||||
wfree(handler);
|
wfree(handler);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMDeleteTimerHandler(WMHandlerID handlerID)
|
||||||
|
|
||||||
void
|
|
||||||
WMDeleteTimerHandler(WMHandlerID handlerID)
|
|
||||||
{
|
{
|
||||||
TimerHandler *tmp, *handler=(TimerHandler*)handlerID;
|
TimerHandler *tmp, *handler = (TimerHandler *) handlerID;
|
||||||
|
|
||||||
if (!handler || !timerHandler)
|
if (!handler || !timerHandler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tmp = timerHandler;
|
tmp = timerHandler;
|
||||||
|
|
||||||
handler->nextDelay = 0;
|
handler->nextDelay = 0;
|
||||||
|
|
||||||
if (IS_ZERO(handler->when))
|
if (IS_ZERO(handler->when))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tmp==handler) {
|
if (tmp == handler) {
|
||||||
timerHandler = handler->next;
|
timerHandler = handler->next;
|
||||||
wfree(handler);
|
wfree(handler);
|
||||||
} else {
|
} else {
|
||||||
while (tmp->next) {
|
while (tmp->next) {
|
||||||
if (tmp->next==handler) {
|
if (tmp->next == handler) {
|
||||||
tmp->next=handler->next;
|
tmp->next = handler->next;
|
||||||
wfree(handler);
|
wfree(handler);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHandlerID WMAddIdleHandler(WMCallback * callback, void *cdata)
|
||||||
|
|
||||||
WMHandlerID
|
|
||||||
WMAddIdleHandler(WMCallback *callback, void *cdata)
|
|
||||||
{
|
{
|
||||||
IdleHandler *handler;
|
IdleHandler *handler;
|
||||||
|
|
||||||
handler = malloc(sizeof(IdleHandler));
|
handler = malloc(sizeof(IdleHandler));
|
||||||
if (!handler)
|
if (!handler)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
handler->callback = callback;
|
handler->callback = callback;
|
||||||
handler->clientData = cdata;
|
handler->clientData = cdata;
|
||||||
/* add handler at end of queue */
|
/* add handler at end of queue */
|
||||||
if (!idleHandler) {
|
if (!idleHandler) {
|
||||||
idleHandler = WMCreateArrayWithDestructor(16, wfree);
|
idleHandler = WMCreateArrayWithDestructor(16, wfree);
|
||||||
}
|
}
|
||||||
WMAddToArray(idleHandler, handler);
|
WMAddToArray(idleHandler, handler);
|
||||||
|
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMDeleteIdleHandler(WMHandlerID handlerID)
|
||||||
void
|
|
||||||
WMDeleteIdleHandler(WMHandlerID handlerID)
|
|
||||||
{
|
{
|
||||||
IdleHandler *handler = (IdleHandler*)handlerID;
|
IdleHandler *handler = (IdleHandler *) handlerID;
|
||||||
|
|
||||||
if (!handler || !idleHandler)
|
if (!handler || !idleHandler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WMRemoveFromArray(idleHandler, handler);
|
WMRemoveFromArray(idleHandler, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc * proc, void *clientData)
|
||||||
|
|
||||||
WMHandlerID
|
|
||||||
WMAddInputHandler(int fd, int condition, WMInputProc *proc, void *clientData)
|
|
||||||
{
|
{
|
||||||
InputHandler *handler;
|
InputHandler *handler;
|
||||||
|
|
||||||
handler = wmalloc(sizeof(InputHandler));
|
handler = wmalloc(sizeof(InputHandler));
|
||||||
|
|
||||||
handler->fd = fd;
|
handler->fd = fd;
|
||||||
handler->mask = condition;
|
handler->mask = condition;
|
||||||
handler->callback = proc;
|
handler->callback = proc;
|
||||||
handler->clientData = clientData;
|
handler->clientData = clientData;
|
||||||
|
|
||||||
if (!inputHandler)
|
if (!inputHandler)
|
||||||
inputHandler = WMCreateArrayWithDestructor(16, wfree);
|
inputHandler = WMCreateArrayWithDestructor(16, wfree);
|
||||||
WMAddToArray(inputHandler, handler);
|
WMAddToArray(inputHandler, handler);
|
||||||
|
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMDeleteInputHandler(WMHandlerID handlerID)
|
||||||
|
|
||||||
void
|
|
||||||
WMDeleteInputHandler(WMHandlerID handlerID)
|
|
||||||
{
|
{
|
||||||
InputHandler *handler = (InputHandler*)handlerID;
|
InputHandler *handler = (InputHandler *) handlerID;
|
||||||
|
|
||||||
if (!handler || !inputHandler)
|
if (!handler || !inputHandler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WMRemoveFromArray(inputHandler, handler);
|
WMRemoveFromArray(inputHandler, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool W_CheckIdleHandlers(void)
|
||||||
Bool
|
|
||||||
W_CheckIdleHandlers(void)
|
|
||||||
{
|
{
|
||||||
IdleHandler *handler;
|
IdleHandler *handler;
|
||||||
WMArray *handlerCopy;
|
WMArray *handlerCopy;
|
||||||
WMArrayIterator iter;
|
WMArrayIterator iter;
|
||||||
|
|
||||||
if (!idleHandler || WMGetArrayItemCount(idleHandler)==0) {
|
if (!idleHandler || WMGetArrayItemCount(idleHandler) == 0) {
|
||||||
W_FlushIdleNotificationQueue();
|
W_FlushIdleNotificationQueue();
|
||||||
/* make sure an observer in queue didn't added an idle handler */
|
/* make sure an observer in queue didn't added an idle handler */
|
||||||
return (idleHandler!=NULL && WMGetArrayItemCount(idleHandler)>0);
|
return (idleHandler != NULL && WMGetArrayItemCount(idleHandler) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
handlerCopy = WMDuplicateArray(idleHandler);
|
handlerCopy = WMDuplicateArray(idleHandler);
|
||||||
|
|
||||||
WM_ITERATE_ARRAY(handlerCopy, handler, iter) {
|
WM_ITERATE_ARRAY(handlerCopy, handler, iter) {
|
||||||
/* check if the handler still exist or was removed by a callback */
|
/* check if the handler still exist or was removed by a callback */
|
||||||
if (WMGetFirstInArray(idleHandler, handler) == WANotFound)
|
if (WMGetFirstInArray(idleHandler, handler) == WANotFound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(*handler->callback)(handler->clientData);
|
(*handler->callback) (handler->clientData);
|
||||||
WMDeleteIdleHandler(handler);
|
WMDeleteIdleHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
WMFreeArray(handlerCopy);
|
WMFreeArray(handlerCopy);
|
||||||
|
|
||||||
W_FlushIdleNotificationQueue();
|
W_FlushIdleNotificationQueue();
|
||||||
|
|
||||||
/* this is not necesarrily False, because one handler can re-add itself */
|
/* this is not necesarrily False, because one handler can re-add itself */
|
||||||
return (WMGetArrayItemCount(idleHandler)>0);
|
return (WMGetArrayItemCount(idleHandler) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_CheckTimerHandlers(void)
|
||||||
|
|
||||||
void
|
|
||||||
W_CheckTimerHandlers(void)
|
|
||||||
{
|
{
|
||||||
TimerHandler *handler;
|
TimerHandler *handler;
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
||||||
if (!timerHandler) {
|
if (!timerHandler) {
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rightNow(&now);
|
rightNow(&now);
|
||||||
|
|
||||||
handler = timerHandler;
|
handler = timerHandler;
|
||||||
while (handler && IS_AFTER(now, handler->when)) {
|
while (handler && IS_AFTER(now, handler->when)) {
|
||||||
if (!IS_ZERO(handler->when)) {
|
if (!IS_ZERO(handler->when)) {
|
||||||
SET_ZERO(handler->when);
|
SET_ZERO(handler->when);
|
||||||
(*handler->callback)(handler->clientData);
|
(*handler->callback) (handler->clientData);
|
||||||
}
|
}
|
||||||
handler = handler->next;
|
handler = handler->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (timerHandler && IS_ZERO(timerHandler->when)) {
|
while (timerHandler && IS_ZERO(timerHandler->when)) {
|
||||||
handler = timerHandler;
|
handler = timerHandler;
|
||||||
timerHandler = timerHandler->next;
|
timerHandler = timerHandler->next;
|
||||||
|
|
||||||
if (handler->nextDelay > 0) {
|
if (handler->nextDelay > 0) {
|
||||||
handler->when = now;
|
handler->when = now;
|
||||||
addmillisecs(&handler->when, handler->nextDelay);
|
addmillisecs(&handler->when, handler->nextDelay);
|
||||||
enqueueTimerHandler(handler);
|
enqueueTimerHandler(handler);
|
||||||
} else {
|
} else {
|
||||||
wfree(handler);
|
wfree(handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This functions will handle input events on all registered file descriptors.
|
* This functions will handle input events on all registered file descriptors.
|
||||||
* Input:
|
* Input:
|
||||||
@@ -409,205 +369,198 @@ W_CheckTimerHandlers(void)
|
|||||||
* inputfd = -1
|
* inputfd = -1
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Bool
|
Bool W_HandleInputEvents(Bool waitForInput, int inputfd)
|
||||||
W_HandleInputEvents(Bool waitForInput, int inputfd)
|
|
||||||
{
|
{
|
||||||
#if defined(HAVE_POLL) && defined(HAVE_POLL_H) && !defined(HAVE_SELECT)
|
#if defined(HAVE_POLL) && defined(HAVE_POLL_H) && !defined(HAVE_SELECT)
|
||||||
struct poll fd *fds;
|
struct poll fd *fds;
|
||||||
InputHandler *handler;
|
InputHandler *handler;
|
||||||
int count, timeout, nfds, i, extrafd;
|
int count, timeout, nfds, i, extrafd;
|
||||||
|
|
||||||
extrafd = (inputfd < 0) ? 0 : 1;
|
extrafd = (inputfd < 0) ? 0 : 1;
|
||||||
|
|
||||||
if (inputHandler)
|
if (inputHandler)
|
||||||
nfds = WMGetArrayItemCount(inputHandler);
|
nfds = WMGetArrayItemCount(inputHandler);
|
||||||
else
|
else
|
||||||
nfds = 0;
|
nfds = 0;
|
||||||
|
|
||||||
if (!extrafd && nfds==0) {
|
if (!extrafd && nfds == 0) {
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
fds = wmalloc((nfds+extrafd) * sizeof(struct pollfd));
|
fds = wmalloc((nfds + extrafd) * sizeof(struct pollfd));
|
||||||
if (extrafd) {
|
if (extrafd) {
|
||||||
/* put this to the end of array to avoid using ranges from 1 to nfds+1 */
|
/* put this to the end of array to avoid using ranges from 1 to nfds+1 */
|
||||||
fds[nfds].fd = inputfd;
|
fds[nfds].fd = inputfd;
|
||||||
fds[nfds].events = POLLIN;
|
fds[nfds].events = POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use WM_ITERATE_ARRAY() here */
|
/* use WM_ITERATE_ARRAY() here */
|
||||||
for (i = 0; i<nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
handler = WMGetFromArray(inputHandler, i);
|
handler = WMGetFromArray(inputHandler, i);
|
||||||
fds[i].fd = handler->fd;
|
fds[i].fd = handler->fd;
|
||||||
fds[i].events = 0;
|
fds[i].events = 0;
|
||||||
if (handler->mask & WIReadMask)
|
if (handler->mask & WIReadMask)
|
||||||
fds[i].events |= POLLIN;
|
fds[i].events |= POLLIN;
|
||||||
|
|
||||||
if (handler->mask & WIWriteMask)
|
if (handler->mask & WIWriteMask)
|
||||||
fds[i].events |= POLLOUT;
|
fds[i].events |= POLLOUT;
|
||||||
|
|
||||||
#if 0 /* FIXME */
|
#if 0 /* FIXME */
|
||||||
if (handler->mask & WIExceptMask)
|
if (handler->mask & WIExceptMask)
|
||||||
FD_SET(handler->fd, &eset);
|
FD_SET(handler->fd, &eset);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the timeout to the estimated time until the
|
* Setup the timeout to the estimated time until the
|
||||||
* next timer expires.
|
* next timer expires.
|
||||||
*/
|
*/
|
||||||
if (!waitForInput) {
|
if (!waitForInput) {
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
} else if (timerPending()) {
|
} else if (timerPending()) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
delayUntilNextTimerEvent(&tv);
|
delayUntilNextTimerEvent(&tv);
|
||||||
timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||||
} else {
|
} else {
|
||||||
timeout = -1;
|
timeout = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
count = poll(fds, nfds+extrafd, timeout);
|
count = poll(fds, nfds + extrafd, timeout);
|
||||||
|
|
||||||
if (count>0 && nfds>0) {
|
if (count > 0 && nfds > 0) {
|
||||||
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
||||||
int mask;
|
int mask;
|
||||||
|
|
||||||
/* use WM_ITERATE_ARRAY() here */
|
/* use WM_ITERATE_ARRAY() here */
|
||||||
for (i=0; i<nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
handler = WMGetFromArray(handlerCopy, i);
|
handler = WMGetFromArray(handlerCopy, i);
|
||||||
/* check if the handler still exist or was removed by a callback */
|
/* check if the handler still exist or was removed by a callback */
|
||||||
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
|
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|
||||||
if ((handler->mask & WIReadMask) &&
|
if ((handler->mask & WIReadMask) &&
|
||||||
(fds[i].revents & (POLLIN|POLLRDNORM|POLLRDBAND|POLLPRI)))
|
(fds[i].revents & (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)))
|
||||||
mask |= WIReadMask;
|
mask |= WIReadMask;
|
||||||
|
|
||||||
if ((handler->mask & WIWriteMask) &&
|
if ((handler->mask & WIWriteMask) && (fds[i].revents & (POLLOUT | POLLWRBAND)))
|
||||||
(fds[i].revents & (POLLOUT | POLLWRBAND)))
|
mask |= WIWriteMask;
|
||||||
mask |= WIWriteMask;
|
|
||||||
|
|
||||||
if ((handler->mask & WIExceptMask) &&
|
if ((handler->mask & WIExceptMask) && (fds[i].revents & (POLLHUP | POLLNVAL | POLLERR)))
|
||||||
(fds[i].revents & (POLLHUP | POLLNVAL | POLLERR)))
|
mask |= WIExceptMask;
|
||||||
mask |= WIExceptMask;
|
|
||||||
|
|
||||||
if (mask!=0 && handler->callback) {
|
if (mask != 0 && handler->callback) {
|
||||||
(*handler->callback)(handler->fd, mask,
|
(*handler->callback) (handler->fd, mask, handler->clientData);
|
||||||
handler->clientData);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
WMFreeArray(handlerCopy);
|
WMFreeArray(handlerCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
wfree(fds);
|
wfree(fds);
|
||||||
|
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
|
|
||||||
return (count > 0);
|
return (count > 0);
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SELECT
|
#ifdef HAVE_SELECT
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
struct timeval *timeoutPtr;
|
struct timeval *timeoutPtr;
|
||||||
fd_set rset, wset, eset;
|
fd_set rset, wset, eset;
|
||||||
int maxfd, nfds, i;
|
int maxfd, nfds, i;
|
||||||
int count;
|
int count;
|
||||||
InputHandler *handler;
|
InputHandler *handler;
|
||||||
|
|
||||||
if (inputHandler)
|
if (inputHandler)
|
||||||
nfds = WMGetArrayItemCount(inputHandler);
|
nfds = WMGetArrayItemCount(inputHandler);
|
||||||
else
|
else
|
||||||
nfds = 0;
|
nfds = 0;
|
||||||
|
|
||||||
if (inputfd<0 && nfds==0) {
|
if (inputfd < 0 && nfds == 0) {
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_ZERO(&rset);
|
FD_ZERO(&rset);
|
||||||
FD_ZERO(&wset);
|
FD_ZERO(&wset);
|
||||||
FD_ZERO(&eset);
|
FD_ZERO(&eset);
|
||||||
|
|
||||||
if (inputfd < 0) {
|
if (inputfd < 0) {
|
||||||
maxfd = 0;
|
maxfd = 0;
|
||||||
} else {
|
} else {
|
||||||
FD_SET(inputfd, &rset);
|
FD_SET(inputfd, &rset);
|
||||||
maxfd = inputfd;
|
maxfd = inputfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use WM_ITERATE_ARRAY() here */
|
/* use WM_ITERATE_ARRAY() here */
|
||||||
for (i=0; i<nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
handler = WMGetFromArray(inputHandler, i);
|
handler = WMGetFromArray(inputHandler, i);
|
||||||
if (handler->mask & WIReadMask)
|
if (handler->mask & WIReadMask)
|
||||||
FD_SET(handler->fd, &rset);
|
FD_SET(handler->fd, &rset);
|
||||||
|
|
||||||
if (handler->mask & WIWriteMask)
|
if (handler->mask & WIWriteMask)
|
||||||
FD_SET(handler->fd, &wset);
|
FD_SET(handler->fd, &wset);
|
||||||
|
|
||||||
if (handler->mask & WIExceptMask)
|
if (handler->mask & WIExceptMask)
|
||||||
FD_SET(handler->fd, &eset);
|
FD_SET(handler->fd, &eset);
|
||||||
|
|
||||||
if (maxfd < handler->fd)
|
if (maxfd < handler->fd)
|
||||||
maxfd = handler->fd;
|
maxfd = handler->fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the timeout to the estimated time until the
|
* Setup the timeout to the estimated time until the
|
||||||
* next timer expires.
|
* next timer expires.
|
||||||
*/
|
*/
|
||||||
if (!waitForInput) {
|
if (!waitForInput) {
|
||||||
SET_ZERO(timeout);
|
SET_ZERO(timeout);
|
||||||
timeoutPtr = &timeout;
|
timeoutPtr = &timeout;
|
||||||
} else if (timerPending()) {
|
} else if (timerPending()) {
|
||||||
delayUntilNextTimerEvent(&timeout);
|
delayUntilNextTimerEvent(&timeout);
|
||||||
timeoutPtr = &timeout;
|
timeoutPtr = &timeout;
|
||||||
} else {
|
} else {
|
||||||
timeoutPtr = (struct timeval*)0;
|
timeoutPtr = (struct timeval *)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
count = select(1 + maxfd, &rset, &wset, &eset, timeoutPtr);
|
count = select(1 + maxfd, &rset, &wset, &eset, timeoutPtr);
|
||||||
|
|
||||||
if (count>0 && nfds>0) {
|
if (count > 0 && nfds > 0) {
|
||||||
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
||||||
int mask;
|
int mask;
|
||||||
|
|
||||||
/* use WM_ITERATE_ARRAY() here */
|
/* use WM_ITERATE_ARRAY() here */
|
||||||
for (i=0; i<nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
handler = WMGetFromArray(handlerCopy, i);
|
handler = WMGetFromArray(handlerCopy, i);
|
||||||
/* check if the handler still exist or was removed by a callback */
|
/* check if the handler still exist or was removed by a callback */
|
||||||
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
|
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|
||||||
if ((handler->mask & WIReadMask) && FD_ISSET(handler->fd, &rset))
|
if ((handler->mask & WIReadMask) && FD_ISSET(handler->fd, &rset))
|
||||||
mask |= WIReadMask;
|
mask |= WIReadMask;
|
||||||
|
|
||||||
if ((handler->mask & WIWriteMask) && FD_ISSET(handler->fd, &wset))
|
if ((handler->mask & WIWriteMask) && FD_ISSET(handler->fd, &wset))
|
||||||
mask |= WIWriteMask;
|
mask |= WIWriteMask;
|
||||||
|
|
||||||
if ((handler->mask & WIExceptMask) && FD_ISSET(handler->fd, &eset))
|
if ((handler->mask & WIExceptMask) && FD_ISSET(handler->fd, &eset))
|
||||||
mask |= WIExceptMask;
|
mask |= WIExceptMask;
|
||||||
|
|
||||||
if (mask!=0 && handler->callback) {
|
if (mask != 0 && handler->callback) {
|
||||||
(*handler->callback)(handler->fd, mask,
|
(*handler->callback) (handler->fd, mask, handler->clientData);
|
||||||
handler->clientData);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
WMFreeArray(handlerCopy);
|
WMFreeArray(handlerCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
W_FlushASAPNotificationQueue();
|
W_FlushASAPNotificationQueue();
|
||||||
|
|
||||||
return (count > 0);
|
return (count > 0);
|
||||||
#else /* not HAVE_SELECT, not HAVE_POLL */
|
#else /* not HAVE_SELECT, not HAVE_POLL */
|
||||||
# error Neither select nor poll. You lose.
|
# error Neither select nor poll. You lose.
|
||||||
#endif /* HAVE_SELECT */
|
#endif /* HAVE_SELECT */
|
||||||
#endif /* HAVE_POLL */
|
#endif /* HAVE_POLL */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -7,39 +7,25 @@
|
|||||||
|
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define INITIAL_CAPACITY 23
|
#define INITIAL_CAPACITY 23
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
|
||||||
# define INLINE inline
|
|
||||||
#else
|
|
||||||
# define INLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct HashItem {
|
typedef struct HashItem {
|
||||||
const void *key;
|
const void *key;
|
||||||
const void *data;
|
const void *data;
|
||||||
|
|
||||||
struct HashItem *next; /* collided item list */
|
struct HashItem *next; /* collided item list */
|
||||||
} HashItem;
|
} HashItem;
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_HashTable {
|
typedef struct W_HashTable {
|
||||||
WMHashTableCallbacks callbacks;
|
WMHashTableCallbacks callbacks;
|
||||||
|
|
||||||
unsigned itemCount;
|
unsigned itemCount;
|
||||||
unsigned size; /* table size */
|
unsigned size; /* table size */
|
||||||
|
|
||||||
HashItem **table;
|
HashItem **table;
|
||||||
} HashTable;
|
} HashTable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define HASH(table, key) (((table)->callbacks.hash ? \
|
#define HASH(table, key) (((table)->callbacks.hash ? \
|
||||||
(*(table)->callbacks.hash)(key) : hashPtr(key)) % (table)->size)
|
(*(table)->callbacks.hash)(key) : hashPtr(key)) % (table)->size)
|
||||||
|
|
||||||
@@ -49,452 +35,400 @@ typedef struct W_HashTable {
|
|||||||
#define RELKEY(table, key) if ((table)->callbacks.releaseKey) \
|
#define RELKEY(table, key) if ((table)->callbacks.releaseKey) \
|
||||||
(*(table)->callbacks.releaseKey)(key)
|
(*(table)->callbacks.releaseKey)(key)
|
||||||
|
|
||||||
|
static inline unsigned hashString(const void *param)
|
||||||
|
|
||||||
|
|
||||||
static INLINE unsigned
|
|
||||||
hashString(const char *key)
|
|
||||||
{
|
{
|
||||||
unsigned ret = 0;
|
const char *key = param;
|
||||||
unsigned ctr = 0;
|
unsigned ret = 0;
|
||||||
|
unsigned ctr = 0;
|
||||||
|
|
||||||
while (*key) {
|
while (*key) {
|
||||||
ret ^= *(char*)key++ << ctr;
|
ret ^= *key++ << ctr;
|
||||||
ctr = (ctr + 1) % sizeof (char *);
|
ctr = (ctr + 1) % sizeof(char *);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned hashPtr(const void *key)
|
||||||
|
|
||||||
static INLINE unsigned
|
|
||||||
hashPtr(const void *key)
|
|
||||||
{
|
{
|
||||||
return ((size_t)key / sizeof(char*));
|
return ((size_t) key / sizeof(char *));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rellocateItem(WMHashTable * table, HashItem * item)
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
rellocateItem(WMHashTable *table, HashItem *item)
|
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
|
|
||||||
h = HASH(table, item->key);
|
h = HASH(table, item->key);
|
||||||
|
|
||||||
item->next = table->table[h];
|
item->next = table->table[h];
|
||||||
table->table[h] = item;
|
table->table[h] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rebuildTable(WMHashTable * table)
|
||||||
static void
|
|
||||||
rebuildTable(WMHashTable *table)
|
|
||||||
{
|
{
|
||||||
HashItem *next;
|
HashItem *next;
|
||||||
HashItem **oldArray;
|
HashItem **oldArray;
|
||||||
int i;
|
int i;
|
||||||
int oldSize;
|
int oldSize;
|
||||||
int newSize;
|
int newSize;
|
||||||
|
|
||||||
oldArray = table->table;
|
oldArray = table->table;
|
||||||
oldSize = table->size;
|
oldSize = table->size;
|
||||||
|
|
||||||
newSize = table->size*2;
|
newSize = table->size * 2;
|
||||||
|
|
||||||
table->table = wmalloc(sizeof(char*)*newSize);
|
table->table = wmalloc(sizeof(char *) * newSize);
|
||||||
memset(table->table, 0, sizeof(char*)*newSize);
|
table->size = newSize;
|
||||||
table->size = newSize;
|
|
||||||
|
|
||||||
for (i = 0; i < oldSize; i++) {
|
for (i = 0; i < oldSize; i++) {
|
||||||
while (oldArray[i]!=NULL) {
|
while (oldArray[i] != NULL) {
|
||||||
next = oldArray[i]->next;
|
next = oldArray[i]->next;
|
||||||
rellocateItem(table, oldArray[i]);
|
rellocateItem(table, oldArray[i]);
|
||||||
oldArray[i] = next;
|
oldArray[i] = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wfree(oldArray);
|
wfree(oldArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHashTable *WMCreateHashTable(const WMHashTableCallbacks callbacks)
|
||||||
|
|
||||||
WMHashTable*
|
|
||||||
WMCreateHashTable(WMHashTableCallbacks callbacks)
|
|
||||||
{
|
{
|
||||||
HashTable *table;
|
HashTable *table;
|
||||||
|
|
||||||
table = wmalloc(sizeof(HashTable));
|
table = wmalloc(sizeof(HashTable));
|
||||||
memset(table, 0, sizeof(HashTable));
|
|
||||||
|
|
||||||
table->callbacks = callbacks;
|
table->callbacks = callbacks;
|
||||||
|
|
||||||
table->size = INITIAL_CAPACITY;
|
table->size = INITIAL_CAPACITY;
|
||||||
|
|
||||||
table->table = wmalloc(sizeof(HashItem*)*table->size);
|
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
||||||
memset(table->table, 0, sizeof(HashItem*)*table->size);
|
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMResetHashTable(WMHashTable * table)
|
||||||
void
|
|
||||||
WMResetHashTable(WMHashTable *table)
|
|
||||||
{
|
{
|
||||||
HashItem *item, *tmp;
|
HashItem *item, *tmp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < table->size; i++) {
|
for (i = 0; i < table->size; i++) {
|
||||||
item = table->table[i];
|
item = table->table[i];
|
||||||
while (item) {
|
while (item) {
|
||||||
tmp = item->next;
|
tmp = item->next;
|
||||||
RELKEY(table, item->key);
|
RELKEY(table, item->key);
|
||||||
wfree(item);
|
wfree(item);
|
||||||
item = tmp;
|
item = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table->itemCount = 0;
|
table->itemCount = 0;
|
||||||
|
|
||||||
if (table->size > INITIAL_CAPACITY) {
|
if (table->size > INITIAL_CAPACITY) {
|
||||||
wfree(table->table);
|
wfree(table->table);
|
||||||
table->size = INITIAL_CAPACITY;
|
table->size = INITIAL_CAPACITY;
|
||||||
table->table = wmalloc(sizeof(HashItem*)*table->size);
|
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
||||||
}
|
} else {
|
||||||
memset(table->table, 0, sizeof(HashItem*)*table->size);
|
memset(table->table, 0, sizeof(HashItem *) * table->size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMFreeHashTable(WMHashTable * table)
|
||||||
void
|
|
||||||
WMFreeHashTable(WMHashTable *table)
|
|
||||||
{
|
{
|
||||||
HashItem *item, *tmp;
|
HashItem *item, *tmp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < table->size; i++) {
|
for (i = 0; i < table->size; i++) {
|
||||||
item = table->table[i];
|
item = table->table[i];
|
||||||
while (item) {
|
while (item) {
|
||||||
tmp = item->next;
|
tmp = item->next;
|
||||||
RELKEY(table, item->key);
|
RELKEY(table, item->key);
|
||||||
wfree(item);
|
wfree(item);
|
||||||
item = tmp;
|
item = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wfree(table->table);
|
wfree(table->table);
|
||||||
wfree(table);
|
wfree(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned WMCountHashTable(WMHashTable * table)
|
||||||
unsigned
|
|
||||||
WMCountHashTable(WMHashTable *table)
|
|
||||||
{
|
{
|
||||||
return table->itemCount;
|
return table->itemCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMHashGet(WMHashTable * table, const void *key)
|
||||||
void*
|
|
||||||
WMHashGet(WMHashTable *table, const void *key)
|
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
HashItem *item;
|
HashItem *item;
|
||||||
|
|
||||||
h = HASH(table, key);
|
h = HASH(table, key);
|
||||||
item = table->table[h];
|
item = table->table[h];
|
||||||
|
|
||||||
if (table->callbacks.keyIsEqual) {
|
if (table->callbacks.keyIsEqual) {
|
||||||
while (item) {
|
while (item) {
|
||||||
if ((*table->callbacks.keyIsEqual)(key, item->key)) {
|
if ((*table->callbacks.keyIsEqual) (key, item->key)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (item) {
|
while (item) {
|
||||||
if (key == item->key) {
|
if (key == item->key) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item)
|
if (item)
|
||||||
return (void*)item->data;
|
return (void *)item->data;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool WMHashGetItemAndKey(WMHashTable * table, const void *key, void **retItem, void **retKey)
|
||||||
Bool
|
|
||||||
WMHashGetItemAndKey(WMHashTable *table, const void *key,
|
|
||||||
void **retItem, void **retKey)
|
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
HashItem *item;
|
HashItem *item;
|
||||||
|
|
||||||
h = HASH(table, key);
|
h = HASH(table, key);
|
||||||
item = table->table[h];
|
item = table->table[h];
|
||||||
|
|
||||||
if (table->callbacks.keyIsEqual) {
|
if (table->callbacks.keyIsEqual) {
|
||||||
while (item) {
|
while (item) {
|
||||||
if ((*table->callbacks.keyIsEqual)(key, item->key)) {
|
if ((*table->callbacks.keyIsEqual) (key, item->key)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (item) {
|
while (item) {
|
||||||
if (key == item->key) {
|
if (key == item->key) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item) {
|
if (item) {
|
||||||
if (retKey)
|
if (retKey)
|
||||||
*retKey = (void*)item->key;
|
*retKey = (void *)item->key;
|
||||||
if (retItem)
|
if (retItem)
|
||||||
*retItem = (void*)item->data;
|
*retItem = (void *)item->data;
|
||||||
return True;
|
return True;
|
||||||
} else {
|
} else {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMHashInsert(WMHashTable * table, const void *key, const void *data)
|
||||||
|
|
||||||
void*
|
|
||||||
WMHashInsert(WMHashTable *table, const void *key, const void *data)
|
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
HashItem *item;
|
HashItem *item;
|
||||||
int replacing = 0;
|
int replacing = 0;
|
||||||
|
|
||||||
h = HASH(table, key);
|
h = HASH(table, key);
|
||||||
/* look for the entry */
|
/* look for the entry */
|
||||||
item = table->table[h];
|
item = table->table[h];
|
||||||
if (table->callbacks.keyIsEqual) {
|
if (table->callbacks.keyIsEqual) {
|
||||||
while (item) {
|
while (item) {
|
||||||
if ((*table->callbacks.keyIsEqual)(key, item->key)) {
|
if ((*table->callbacks.keyIsEqual) (key, item->key)) {
|
||||||
replacing = 1;
|
replacing = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (item) {
|
while (item) {
|
||||||
if (key == item->key) {
|
if (key == item->key) {
|
||||||
replacing = 1;
|
replacing = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
item = item->next;
|
item = item->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replacing) {
|
if (replacing) {
|
||||||
const void *old;
|
const void *old;
|
||||||
|
|
||||||
old = item->data;
|
old = item->data;
|
||||||
item->data = data;
|
item->data = data;
|
||||||
RELKEY(table, item->key);
|
RELKEY(table, item->key);
|
||||||
item->key = DUPKEY(table, key);
|
item->key = DUPKEY(table, key);
|
||||||
|
|
||||||
return (void*)old;
|
return (void *)old;
|
||||||
} else {
|
} else {
|
||||||
HashItem *nitem;
|
HashItem *nitem;
|
||||||
|
|
||||||
nitem = wmalloc(sizeof(HashItem));
|
nitem = wmalloc(sizeof(HashItem));
|
||||||
nitem->key = DUPKEY(table, key);
|
nitem->key = DUPKEY(table, key);
|
||||||
nitem->data = data;
|
nitem->data = data;
|
||||||
nitem->next = table->table[h];
|
nitem->next = table->table[h];
|
||||||
table->table[h] = nitem;
|
table->table[h] = nitem;
|
||||||
|
|
||||||
table->itemCount++;
|
table->itemCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OPTIMIZE: put this in an idle handler.*/
|
/* OPTIMIZE: put this in an idle handler. */
|
||||||
if (table->itemCount > table->size) {
|
if (table->itemCount > table->size) {
|
||||||
#ifdef DEBUG0
|
#ifdef DEBUG0
|
||||||
printf("rebuilding hash table...\n");
|
printf("rebuilding hash table...\n");
|
||||||
#endif
|
#endif
|
||||||
rebuildTable(table);
|
rebuildTable(table);
|
||||||
#ifdef DEBUG0
|
#ifdef DEBUG0
|
||||||
printf("finished rebuild.\n");
|
printf("finished rebuild.\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HashItem *deleteFromList(HashTable * table, HashItem * item, const void *key)
|
||||||
static HashItem*
|
|
||||||
deleteFromList(HashTable *table, HashItem *item, const void *key)
|
|
||||||
{
|
{
|
||||||
HashItem *next;
|
HashItem *next;
|
||||||
|
|
||||||
if (item==NULL)
|
if (item == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((table->callbacks.keyIsEqual
|
if ((table->callbacks.keyIsEqual && (*table->callbacks.keyIsEqual) (key, item->key))
|
||||||
&& (*table->callbacks.keyIsEqual)(key, item->key))
|
|| (!table->callbacks.keyIsEqual && key == item->key)) {
|
||||||
|| (!table->callbacks.keyIsEqual && key==item->key)) {
|
|
||||||
|
|
||||||
next = item->next;
|
next = item->next;
|
||||||
RELKEY(table, item->key);
|
RELKEY(table, item->key);
|
||||||
wfree(item);
|
wfree(item);
|
||||||
|
|
||||||
table->itemCount--;
|
table->itemCount--;
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->next = deleteFromList(table, item->next, key);
|
item->next = deleteFromList(table, item->next, key);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMHashRemove(WMHashTable * table, const void *key)
|
||||||
void
|
|
||||||
WMHashRemove(WMHashTable *table, const void *key)
|
|
||||||
{
|
{
|
||||||
unsigned h;
|
unsigned h;
|
||||||
|
|
||||||
h = HASH(table, key);
|
h = HASH(table, key);
|
||||||
|
|
||||||
table->table[h] = deleteFromList(table, table->table[h], key);
|
table->table[h] = deleteFromList(table, table->table[h], key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMHashEnumerator WMEnumerateHashTable(WMHashTable * table)
|
||||||
WMHashEnumerator
|
|
||||||
WMEnumerateHashTable(WMHashTable *table)
|
|
||||||
{
|
{
|
||||||
WMHashEnumerator enumerator;
|
WMHashEnumerator enumerator;
|
||||||
|
|
||||||
enumerator.table = table;
|
enumerator.table = table;
|
||||||
enumerator.index = 0;
|
enumerator.index = 0;
|
||||||
enumerator.nextItem = table->table[0];
|
enumerator.nextItem = table->table[0];
|
||||||
|
|
||||||
return enumerator;
|
return enumerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMNextHashEnumeratorItem(WMHashEnumerator * enumerator)
|
||||||
|
|
||||||
void*
|
|
||||||
WMNextHashEnumeratorItem(WMHashEnumerator *enumerator)
|
|
||||||
{
|
{
|
||||||
const void *data = NULL;
|
const void *data = NULL;
|
||||||
|
|
||||||
/* this assumes the table doesn't change between
|
/* this assumes the table doesn't change between
|
||||||
* WMEnumerateHashTable() and WMNextHashEnumeratorItem() calls */
|
* WMEnumerateHashTable() and WMNextHashEnumeratorItem() calls */
|
||||||
|
|
||||||
if (enumerator->nextItem==NULL) {
|
if (enumerator->nextItem == NULL) {
|
||||||
HashTable *table = enumerator->table;
|
HashTable *table = enumerator->table;
|
||||||
while (++enumerator->index < table->size) {
|
while (++enumerator->index < table->size) {
|
||||||
if (table->table[enumerator->index]!=NULL) {
|
if (table->table[enumerator->index] != NULL) {
|
||||||
enumerator->nextItem = table->table[enumerator->index];
|
enumerator->nextItem = table->table[enumerator->index];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enumerator->nextItem) {
|
if (enumerator->nextItem) {
|
||||||
data = ((HashItem*)enumerator->nextItem)->data;
|
data = ((HashItem *) enumerator->nextItem)->data;
|
||||||
enumerator->nextItem = ((HashItem*)enumerator->nextItem)->next;
|
enumerator->nextItem = ((HashItem *) enumerator->nextItem)->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (void*)data;
|
return (void *)data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMNextHashEnumeratorKey(WMHashEnumerator * enumerator)
|
||||||
void*
|
|
||||||
WMNextHashEnumeratorKey(WMHashEnumerator *enumerator)
|
|
||||||
{
|
{
|
||||||
const void *key = NULL;
|
const void *key = NULL;
|
||||||
|
|
||||||
/* this assumes the table doesn't change between
|
/* this assumes the table doesn't change between
|
||||||
* WMEnumerateHashTable() and WMNextHashEnumeratorKey() calls */
|
* WMEnumerateHashTable() and WMNextHashEnumeratorKey() calls */
|
||||||
|
|
||||||
if (enumerator->nextItem==NULL) {
|
if (enumerator->nextItem == NULL) {
|
||||||
HashTable *table = enumerator->table;
|
HashTable *table = enumerator->table;
|
||||||
while (++enumerator->index < table->size) {
|
while (++enumerator->index < table->size) {
|
||||||
if (table->table[enumerator->index]!=NULL) {
|
if (table->table[enumerator->index] != NULL) {
|
||||||
enumerator->nextItem = table->table[enumerator->index];
|
enumerator->nextItem = table->table[enumerator->index];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enumerator->nextItem) {
|
if (enumerator->nextItem) {
|
||||||
key = ((HashItem*)enumerator->nextItem)->key;
|
key = ((HashItem *) enumerator->nextItem)->key;
|
||||||
enumerator->nextItem = ((HashItem*)enumerator->nextItem)->next;
|
enumerator->nextItem = ((HashItem *) enumerator->nextItem)->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (void*)key;
|
return (void *)key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool WMNextHashEnumeratorItemAndKey(WMHashEnumerator * enumerator, void **item, void **key)
|
||||||
Bool
|
|
||||||
WMNextHashEnumeratorItemAndKey(WMHashEnumerator *enumerator,
|
|
||||||
void **item, void **key)
|
|
||||||
{
|
{
|
||||||
/* this assumes the table doesn't change between
|
/* this assumes the table doesn't change between
|
||||||
* WMEnumerateHashTable() and WMNextHashEnumeratorItemAndKey() calls */
|
* WMEnumerateHashTable() and WMNextHashEnumeratorItemAndKey() calls */
|
||||||
|
|
||||||
if (enumerator->nextItem==NULL) {
|
if (enumerator->nextItem == NULL) {
|
||||||
HashTable *table = enumerator->table;
|
HashTable *table = enumerator->table;
|
||||||
while (++enumerator->index < table->size) {
|
while (++enumerator->index < table->size) {
|
||||||
if (table->table[enumerator->index]!=NULL) {
|
if (table->table[enumerator->index] != NULL) {
|
||||||
enumerator->nextItem = table->table[enumerator->index];
|
enumerator->nextItem = table->table[enumerator->index];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enumerator->nextItem) {
|
if (enumerator->nextItem) {
|
||||||
if (item)
|
if (item)
|
||||||
*item = (void*)((HashItem*)enumerator->nextItem)->data;
|
*item = (void *)((HashItem *) enumerator->nextItem)->data;
|
||||||
if (key)
|
if (key)
|
||||||
*key = (void*)((HashItem*)enumerator->nextItem)->key;
|
*key = (void *)((HashItem *) enumerator->nextItem)->key;
|
||||||
enumerator->nextItem = ((HashItem*)enumerator->nextItem)->next;
|
enumerator->nextItem = ((HashItem *) enumerator->nextItem)->next;
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool compareStrings(const void *param1, const void *param2)
|
||||||
static Bool
|
|
||||||
compareStrings(const char *key1, const char *key2)
|
|
||||||
{
|
{
|
||||||
return strcmp(key1, key2)==0;
|
const char *key1 = param1;
|
||||||
|
const char *key2 = param2;
|
||||||
|
|
||||||
|
return strcmp(key1, key2) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef void *(*retainFunc) (const void *);
|
||||||
typedef unsigned (*hashFunc)(const void*);
|
typedef void (*releaseFunc) (const void *);
|
||||||
typedef Bool (*isEqualFunc)(const void*, const void*);
|
|
||||||
typedef void* (*retainFunc)(const void*);
|
|
||||||
typedef void (*releaseFunc)(const void*);
|
|
||||||
|
|
||||||
|
|
||||||
const WMHashTableCallbacks WMIntHashCallbacks = {
|
const WMHashTableCallbacks WMIntHashCallbacks = {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const WMHashTableCallbacks WMStringHashCallbacks = {
|
const WMHashTableCallbacks WMStringHashCallbacks = {
|
||||||
(hashFunc)hashString,
|
hashString,
|
||||||
(isEqualFunc)compareStrings,
|
compareStrings,
|
||||||
(retainFunc)wstrdup,
|
(retainFunc) wstrdup,
|
||||||
(releaseFunc)wfree
|
(releaseFunc) wfree
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const WMHashTableCallbacks WMStringPointerHashCallbacks = {
|
const WMHashTableCallbacks WMStringPointerHashCallbacks = {
|
||||||
(hashFunc)hashString,
|
hashString,
|
||||||
(isEqualFunc)compareStrings,
|
compareStrings,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
310
WINGs/host.c
310
WINGs/host.c
@@ -1,310 +0,0 @@
|
|||||||
/*
|
|
||||||
* WINGs WMHost function library
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2003 Dan Pascu
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "wconfig.h"
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
|
|
||||||
#include "WUtil.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* For Solaris */
|
|
||||||
#ifndef INADDR_NONE
|
|
||||||
# define INADDR_NONE (-1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Max hostname length (RFC 1123) */
|
|
||||||
#define W_MAXHOSTNAMELEN 255
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Host {
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
WMArray *names;
|
|
||||||
WMArray *addresses;
|
|
||||||
|
|
||||||
int refCount;
|
|
||||||
} W_Host;
|
|
||||||
|
|
||||||
|
|
||||||
static WMHashTable *hostCache = NULL;
|
|
||||||
|
|
||||||
static Bool hostCacheEnabled = True;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static WMHost*
|
|
||||||
getHostFromCache(char *name)
|
|
||||||
{
|
|
||||||
if (!hostCache)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return WMHashGet(hostCache, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static WMHost*
|
|
||||||
getHostWithHostEntry(struct hostent *host, char *name)
|
|
||||||
{
|
|
||||||
WMHost *hPtr;
|
|
||||||
struct in_addr in;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
hPtr = (WMHost*)wmalloc(sizeof(WMHost));
|
|
||||||
memset(hPtr, 0, sizeof(WMHost));
|
|
||||||
|
|
||||||
hPtr->names = WMCreateArrayWithDestructor(1, wfree);
|
|
||||||
hPtr->addresses = WMCreateArrayWithDestructor(1, wfree);
|
|
||||||
|
|
||||||
WMAddToArray(hPtr->names, wstrdup(host->h_name));
|
|
||||||
|
|
||||||
for (i=0; host->h_aliases[i]!=NULL; i++) {
|
|
||||||
WMAddToArray(hPtr->names, wstrdup(host->h_aliases[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i=0; host->h_addr_list[i]!=NULL; i++) {
|
|
||||||
memcpy((void*)&in.s_addr, (const void*)host->h_addr_list[i],
|
|
||||||
host->h_length);
|
|
||||||
WMAddToArray(hPtr->addresses, wstrdup(inet_ntoa(in)));
|
|
||||||
}
|
|
||||||
|
|
||||||
hPtr->refCount = 1;
|
|
||||||
|
|
||||||
if (hostCacheEnabled) {
|
|
||||||
if (!hostCache)
|
|
||||||
hostCache = WMCreateHashTable(WMStringPointerHashCallbacks);
|
|
||||||
hPtr->name = wstrdup(name);
|
|
||||||
wassertr(WMHashInsert(hostCache, hPtr->name, hPtr)==NULL);
|
|
||||||
hPtr->refCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMHost*
|
|
||||||
WMGetCurrentHost()
|
|
||||||
{
|
|
||||||
char name[W_MAXHOSTNAMELEN+1];
|
|
||||||
|
|
||||||
if (gethostname(name, W_MAXHOSTNAMELEN) < 0) {
|
|
||||||
wsyserror(_("Cannot get current host name"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
name[W_MAXHOSTNAMELEN] = 0;
|
|
||||||
|
|
||||||
return WMGetHostWithName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMHost*
|
|
||||||
WMGetHostWithName(char *name)
|
|
||||||
{
|
|
||||||
struct hostent *host;
|
|
||||||
WMHost *hPtr;
|
|
||||||
|
|
||||||
wassertrv(name!=NULL, NULL);
|
|
||||||
|
|
||||||
if (hostCacheEnabled) {
|
|
||||||
if ((hPtr = getHostFromCache(name)) != NULL) {
|
|
||||||
WMRetainHost(hPtr);
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
host = gethostbyname(name);
|
|
||||||
if (host == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
hPtr = getHostWithHostEntry(host, name);
|
|
||||||
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMHost*
|
|
||||||
WMGetHostWithAddress(char *address)
|
|
||||||
{
|
|
||||||
struct hostent *host;
|
|
||||||
struct in_addr in;
|
|
||||||
WMHost *hPtr;
|
|
||||||
|
|
||||||
wassertrv(address!=NULL, NULL);
|
|
||||||
|
|
||||||
if (hostCacheEnabled) {
|
|
||||||
if ((hPtr = getHostFromCache(address)) != NULL) {
|
|
||||||
WMRetainHost(hPtr);
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef HAVE_INET_ATON
|
|
||||||
if ((in.s_addr = inet_addr(address)) == INADDR_NONE)
|
|
||||||
return NULL;
|
|
||||||
#else
|
|
||||||
if (inet_aton(address, &in) == 0)
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
host = gethostbyaddr((char*)&in, sizeof(in), AF_INET);
|
|
||||||
if (host == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
hPtr = getHostWithHostEntry(host, address);
|
|
||||||
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMHost*
|
|
||||||
WMRetainHost(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
hPtr->refCount++;
|
|
||||||
return hPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
WMReleaseHost(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
hPtr->refCount--;
|
|
||||||
|
|
||||||
if (hPtr->refCount > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
WMFreeArray(hPtr->names);
|
|
||||||
WMFreeArray(hPtr->addresses);
|
|
||||||
|
|
||||||
if (hPtr->name) {
|
|
||||||
WMHashRemove(hostCache, hPtr->name);
|
|
||||||
wfree(hPtr->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
wfree(hPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
WMSetHostCacheEnabled(Bool flag)
|
|
||||||
{
|
|
||||||
hostCacheEnabled = ((flag==0) ? 0 : 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Bool
|
|
||||||
WMIsHostCacheEnabled()
|
|
||||||
{
|
|
||||||
return hostCacheEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
WMFlushHostCache()
|
|
||||||
{
|
|
||||||
if (hostCache && WMCountHashTable(hostCache)>0) {
|
|
||||||
WMArray *hostArray = WMCreateArray(WMCountHashTable(hostCache));
|
|
||||||
WMHashEnumerator enumer = WMEnumerateHashTable(hostCache);
|
|
||||||
WMHost *hPtr;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
while ((hPtr = WMNextHashEnumeratorItem(&enumer))) {
|
|
||||||
/* we can't release the host here, because we can't change the
|
|
||||||
* hash while using the enumerator functions. */
|
|
||||||
WMAddToArray(hostArray, hPtr);
|
|
||||||
}
|
|
||||||
for (i=0; i<WMGetArrayItemCount(hostArray); i++)
|
|
||||||
WMReleaseHost(WMGetFromArray(hostArray, i));
|
|
||||||
WMFreeArray(hostArray);
|
|
||||||
WMResetHashTable(hostCache);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
matchAddress(void *item, void *cdata)
|
|
||||||
{
|
|
||||||
return (strcmp((char*) item, (char*) cdata)==0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Bool
|
|
||||||
WMIsHostEqualToHost(WMHost* hPtr, WMHost* aPtr)
|
|
||||||
{
|
|
||||||
char *adr;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
wassertrv(hPtr!=NULL && aPtr!=NULL, False);
|
|
||||||
|
|
||||||
if (hPtr == aPtr)
|
|
||||||
return True;
|
|
||||||
|
|
||||||
for (i=0; i<WMGetArrayItemCount(aPtr->addresses); i++) {
|
|
||||||
adr = WMGetFromArray(aPtr->addresses, i);
|
|
||||||
if (WMFindInArray(hPtr->addresses, matchAddress, adr) != WANotFound) {
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
WMGetHostName(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
return (WMGetArrayItemCount(hPtr->names) > 0 ?
|
|
||||||
WMGetFromArray(hPtr->names, 0) : NULL);
|
|
||||||
/*return WMGetFromArray(hPtr->names, 0);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMArray*
|
|
||||||
WMGetHostNames(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
return hPtr->names;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
WMGetHostAddress(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
return (WMGetArrayItemCount(hPtr->addresses) > 0 ?
|
|
||||||
WMGetFromArray(hPtr->addresses, 0) : NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WMArray*
|
|
||||||
WMGetHostAddresses(WMHost *hPtr)
|
|
||||||
{
|
|
||||||
return hPtr->addresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
|
|
||||||
#include "WINGsP.h"
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
InitI18n(Display *dpy)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
282
WINGs/memory.c
282
WINGs/memory.c
@@ -15,10 +15,10 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
@@ -30,10 +30,17 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifdef TEST_WITH_GC
|
#ifdef HAVE_STDNORETURN
|
||||||
#include <gc/gc.h>
|
#include <stdnoreturn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BOEHM_GC
|
||||||
|
#ifndef GC_DEBUG
|
||||||
|
#define GC_DEBUG
|
||||||
|
#endif /* !GC_DEBUG */
|
||||||
|
#include <gc/gc.h>
|
||||||
|
#endif /* USE_BOEHM_GC */
|
||||||
|
|
||||||
#ifndef False
|
#ifndef False
|
||||||
# define False 0
|
# define False 0
|
||||||
#endif
|
#endif
|
||||||
@@ -41,194 +48,175 @@
|
|||||||
# define True 1
|
# define True 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void defaultHandler(int bla)
|
||||||
static void
|
|
||||||
defaultHandler(int bla)
|
|
||||||
{
|
{
|
||||||
if (bla)
|
if (bla)
|
||||||
kill(getpid(), SIGABRT);
|
kill(getpid(), SIGABRT);
|
||||||
else
|
else
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static waborthandler *aborthandler = defaultHandler;
|
||||||
|
|
||||||
static waborthandler *aborthandler = (waborthandler*)defaultHandler;
|
static inline noreturn void wAbort(int bla)
|
||||||
|
|
||||||
#define wAbort(a) (*aborthandler)(a)
|
|
||||||
|
|
||||||
|
|
||||||
waborthandler*
|
|
||||||
wsetabort(waborthandler *handler)
|
|
||||||
{
|
{
|
||||||
waborthandler *old = aborthandler;
|
(*aborthandler)(bla);
|
||||||
|
exit(-1);
|
||||||
aborthandler = handler;
|
|
||||||
|
|
||||||
return old;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
waborthandler *wsetabort(waborthandler * handler)
|
||||||
|
{
|
||||||
|
waborthandler *old = aborthandler;
|
||||||
|
|
||||||
|
aborthandler = handler;
|
||||||
|
|
||||||
static int Aborting=0; /* if we're in the middle of an emergency exit */
|
return old;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Aborting = 0; /* if we're in the middle of an emergency exit */
|
||||||
|
|
||||||
static WMHashTable *table = NULL;
|
static WMHashTable *table = NULL;
|
||||||
|
|
||||||
|
void *wmalloc(size_t size)
|
||||||
void*
|
|
||||||
wmalloc(size_t size)
|
|
||||||
{
|
{
|
||||||
void *tmp;
|
void *tmp;
|
||||||
|
|
||||||
assert(size > 0);
|
assert(size > 0);
|
||||||
|
|
||||||
#ifdef TEST_WITH_GC
|
#ifdef USE_BOEHM_GC
|
||||||
tmp = GC_malloc(size);
|
tmp = GC_MALLOC(size);
|
||||||
#else
|
#else
|
||||||
tmp = malloc(size);
|
tmp = malloc(size);
|
||||||
#endif
|
#endif
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
wwarning("malloc() failed. Retrying after 2s.");
|
wwarning("malloc() failed. Retrying after 2s.");
|
||||||
sleep(2);
|
sleep(2);
|
||||||
#ifdef TEST_WITH_GC
|
#ifdef USE_BOEHM_GC
|
||||||
tmp = GC_malloc(size);
|
tmp = GC_MALLOC(size);
|
||||||
#else
|
#else
|
||||||
tmp = malloc(size);
|
tmp = malloc(size);
|
||||||
#endif
|
#endif
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
if (Aborting) {
|
if (Aborting) {
|
||||||
fputs("Really Bad Error: recursive malloc() failure.", stderr);
|
fputs("Really Bad Error: recursive malloc() failure.", stderr);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else {
|
} else {
|
||||||
wfatal("virtual memory exhausted");
|
wfatal("virtual memory exhausted");
|
||||||
Aborting=1;
|
Aborting = 1;
|
||||||
wAbort(False);
|
wAbort(False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tmp;
|
memset(tmp, 0, size);
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *wrealloc(void *ptr, size_t newsize)
|
||||||
void*
|
|
||||||
wmalloc0(size_t size)
|
|
||||||
{
|
{
|
||||||
void *ptr= wmalloc(size);
|
void *nptr;
|
||||||
if (!ptr)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memset(ptr, 0, size);
|
if (!ptr) {
|
||||||
|
nptr = wmalloc(newsize);
|
||||||
return ptr;
|
} else if (newsize == 0) {
|
||||||
|
wfree(ptr);
|
||||||
|
nptr = NULL;
|
||||||
|
} else {
|
||||||
|
#ifdef USE_BOEHM_GC
|
||||||
|
nptr = GC_REALLOC(ptr, newsize);
|
||||||
|
#else
|
||||||
|
nptr = realloc(ptr, newsize);
|
||||||
|
#endif
|
||||||
|
if (nptr == NULL) {
|
||||||
|
wwarning("realloc() failed. Retrying after 2s.");
|
||||||
|
sleep(2);
|
||||||
|
#ifdef USE_BOEHM_GC
|
||||||
|
nptr = GC_REALLOC(ptr, newsize);
|
||||||
|
#else
|
||||||
|
nptr = realloc(ptr, newsize);
|
||||||
|
#endif
|
||||||
|
if (nptr == NULL) {
|
||||||
|
if (Aborting) {
|
||||||
|
fputs("Really Bad Error: recursive realloc() failure.", stderr);
|
||||||
|
exit(-1);
|
||||||
|
} else {
|
||||||
|
wfatal("virtual memory exhausted");
|
||||||
|
Aborting = 1;
|
||||||
|
wAbort(False);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *wretain(void *ptr)
|
||||||
void*
|
|
||||||
wrealloc(void *ptr, size_t newsize)
|
|
||||||
{
|
{
|
||||||
void *nptr;
|
int *refcount;
|
||||||
|
|
||||||
if (!ptr) {
|
if (!table) {
|
||||||
nptr = wmalloc(newsize);
|
table = WMCreateHashTable(WMIntHashCallbacks);
|
||||||
} else if (newsize==0) {
|
}
|
||||||
wfree(ptr);
|
|
||||||
nptr = NULL;
|
|
||||||
} else {
|
|
||||||
#ifdef TEST_WITH_GC
|
|
||||||
nptr = GC_realloc(ptr, newsize);
|
|
||||||
#else
|
|
||||||
nptr = realloc(ptr, newsize);
|
|
||||||
#endif
|
|
||||||
if (nptr==NULL) {
|
|
||||||
wwarning("realloc() failed. Retrying after 2s.");
|
|
||||||
sleep(2);
|
|
||||||
#ifdef TEST_WITH_GC
|
|
||||||
nptr = GC_realloc(ptr, newsize);
|
|
||||||
#else
|
|
||||||
nptr = realloc(ptr, newsize);
|
|
||||||
#endif
|
|
||||||
if (nptr == NULL) {
|
|
||||||
if (Aborting) {
|
|
||||||
fputs("Really Bad Error: recursive realloc() failure.",
|
|
||||||
stderr);
|
|
||||||
exit(-1);
|
|
||||||
} else {
|
|
||||||
wfatal("virtual memory exhausted");
|
|
||||||
Aborting=1;
|
|
||||||
wAbort(False);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
refcount = WMHashGet(table, ptr);
|
||||||
void*
|
if (!refcount) {
|
||||||
wretain(void *ptr)
|
refcount = wmalloc(sizeof(int));
|
||||||
{
|
*refcount = 1;
|
||||||
int *refcount;
|
WMHashInsert(table, ptr, refcount);
|
||||||
|
|
||||||
if (!table) {
|
|
||||||
table = WMCreateHashTable(WMIntHashCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
refcount = WMHashGet(table, ptr);
|
|
||||||
if (!refcount) {
|
|
||||||
refcount = wmalloc(sizeof(int));
|
|
||||||
*refcount = 1;
|
|
||||||
WMHashInsert(table, ptr, refcount);
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("== %i (%p)\n", *refcount, ptr);
|
printf("== %i (%p)\n", *refcount, ptr);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
(*refcount)++;
|
(*refcount)++;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("+ %i (%p)\n", *refcount, ptr);
|
printf("+ %i (%p)\n", *refcount, ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wfree(void *ptr)
|
||||||
|
|
||||||
void
|
|
||||||
wfree(void *ptr)
|
|
||||||
{
|
{
|
||||||
#ifdef TEST_WITH_GC
|
if (ptr)
|
||||||
GC_free(ptr);
|
#ifdef USE_BOEHM_GC
|
||||||
|
/* This should eventually be removed, once the criss-cross
|
||||||
|
* of wmalloc()d memory being free()d, malloc()d memory being
|
||||||
|
* wfree()d, various misuses of calling wfree() on objects
|
||||||
|
* allocated by libc malloc() and calling libc free() on
|
||||||
|
* objects allocated by Boehm GC (think external libraries)
|
||||||
|
* is cleaned up.
|
||||||
|
*/
|
||||||
|
if (GC_base(ptr) != 0)
|
||||||
|
GC_FREE(ptr);
|
||||||
|
else
|
||||||
|
free(ptr);
|
||||||
#else
|
#else
|
||||||
free(ptr);
|
free(ptr);
|
||||||
#endif
|
#endif
|
||||||
|
ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wrelease(void *ptr)
|
||||||
|
|
||||||
void
|
|
||||||
wrelease(void *ptr)
|
|
||||||
{
|
{
|
||||||
int *refcount;
|
int *refcount;
|
||||||
|
|
||||||
refcount = WMHashGet(table, ptr);
|
refcount = WMHashGet(table, ptr);
|
||||||
if (!refcount) {
|
if (!refcount) {
|
||||||
wwarning("trying to release unexisting data %p", ptr);
|
wwarning("trying to release unexisting data %p", ptr);
|
||||||
} else {
|
} else {
|
||||||
(*refcount)--;
|
(*refcount)--;
|
||||||
if (*refcount < 1) {
|
if (*refcount < 1) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("RELEASING %p\n", ptr);
|
printf("RELEASING %p\n", ptr);
|
||||||
#endif
|
#endif
|
||||||
WMHashRemove(table, ptr);
|
WMHashRemove(table, ptr);
|
||||||
wfree(refcount);
|
wfree(refcount);
|
||||||
wfree(ptr);
|
wfree(ptr);
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
else {
|
else {
|
||||||
printf("- %i (%p)\n", *refcount, ptr);
|
printf("- %i (%p)\n", *refcount, ptr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
652
WINGs/menuparser.c
Normal file
652
WINGs/menuparser.c
Normal file
@@ -0,0 +1,652 @@
|
|||||||
|
/*
|
||||||
|
* Window Maker window manager
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012 Christophe Curis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
#include "wconfig.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include <WINGs/WUtil.h>
|
||||||
|
|
||||||
|
#include "menuparser.h"
|
||||||
|
|
||||||
|
static WMenuParser menu_parser_create_new(const char *file_name, void *file,
|
||||||
|
const char *include_default_paths);
|
||||||
|
static char *menu_parser_isolate_token(WMenuParser parser);
|
||||||
|
static void menu_parser_get_directive(WMenuParser parser);
|
||||||
|
static Bool menu_parser_include_file(WMenuParser parser);
|
||||||
|
static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists);
|
||||||
|
static void menu_parser_condition_else(WMenuParser parser);
|
||||||
|
static void menu_parser_condition_end(WMenuParser parser);
|
||||||
|
|
||||||
|
|
||||||
|
/* Constructor and Destructor for the Menu Parser object */
|
||||||
|
WMenuParser WMenuParserCreate(const char *file_name, void *file,
|
||||||
|
const char *include_default_paths)
|
||||||
|
{
|
||||||
|
WMenuParser parser;
|
||||||
|
|
||||||
|
parser = menu_parser_create_new(file_name, file, include_default_paths);
|
||||||
|
menu_parser_register_preset_macros(parser);
|
||||||
|
return parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WMenuParserDelete(WMenuParser parser)
|
||||||
|
{
|
||||||
|
if (parser->include_file) {
|
||||||
|
/* Trick: the top parser's data are not wmalloc'd, we point on the
|
||||||
|
* provided data so we do not wfree it; however for include files
|
||||||
|
* we did wmalloc them.
|
||||||
|
* This code should not be used as the wfree is done when we reach
|
||||||
|
* the end of an include file; however this may not happen when an
|
||||||
|
* early exit occurs (typically when 'readMenuFile' does not find
|
||||||
|
* its expected command). */
|
||||||
|
fclose(parser->include_file->file_handle);
|
||||||
|
wfree((char *) parser->include_file->file_name);
|
||||||
|
WMenuParserDelete(parser->include_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser->macros)
|
||||||
|
menu_parser_free_macros(parser);
|
||||||
|
|
||||||
|
wfree(parser);
|
||||||
|
}
|
||||||
|
|
||||||
|
static WMenuParser menu_parser_create_new(const char *file_name, void *file,
|
||||||
|
const char *include_default_paths)
|
||||||
|
{
|
||||||
|
WMenuParser parser;
|
||||||
|
|
||||||
|
parser = wmalloc(sizeof(*parser));
|
||||||
|
parser->include_default_paths = include_default_paths;
|
||||||
|
parser->file_name = file_name;
|
||||||
|
parser->file_handle = file;
|
||||||
|
parser->rd = parser->line_buffer;
|
||||||
|
|
||||||
|
return parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* To report helpfull messages to user */
|
||||||
|
const char *WMenuParserGetFilename(WMenuParser parser)
|
||||||
|
{
|
||||||
|
return parser->file_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WMenuParserError(WMenuParser parser, const char *msg, ...)
|
||||||
|
{
|
||||||
|
char buf[MAXLINE];
|
||||||
|
va_list args;
|
||||||
|
WMenuParser parent;
|
||||||
|
|
||||||
|
while (parser->include_file)
|
||||||
|
parser = parser->include_file;
|
||||||
|
|
||||||
|
va_start(args, msg);
|
||||||
|
vsnprintf(buf, sizeof(buf), msg, args);
|
||||||
|
va_end(args);
|
||||||
|
__wmessage("WMenuParser", parser->file_name, parser->line_number,
|
||||||
|
WMESSAGE_TYPE_WARNING, "%s", buf);
|
||||||
|
|
||||||
|
for (parent = parser->parent_file; parent != NULL; parent = parent->parent_file)
|
||||||
|
__wmessage("WMenuParser", parser->file_name, parser->line_number,
|
||||||
|
WMESSAGE_TYPE_WARNING, _(" included from file \"%s\" at line %d"),
|
||||||
|
parent->file_name, parent->line_number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read one line from file and split content
|
||||||
|
* The function returns False when the end of file is reached */
|
||||||
|
Bool WMenuParserGetLine(WMenuParser top_parser, char **title, char **command,
|
||||||
|
char **parameter, char **shortcut)
|
||||||
|
{
|
||||||
|
WMenuParser cur_parser;
|
||||||
|
enum { GET_TITLE, GET_COMMAND, GET_PARAMETERS, GET_SHORTCUT } scanmode;
|
||||||
|
char *token, *params = NULL;
|
||||||
|
char lineparam[MAXLINE];
|
||||||
|
|
||||||
|
lineparam[0] = '\0';
|
||||||
|
*title = NULL;
|
||||||
|
*command = NULL;
|
||||||
|
*parameter = NULL;
|
||||||
|
*shortcut = NULL;
|
||||||
|
scanmode = GET_TITLE;
|
||||||
|
|
||||||
|
read_next_line_with_filechange:
|
||||||
|
cur_parser = top_parser;
|
||||||
|
while (cur_parser->include_file)
|
||||||
|
cur_parser = cur_parser->include_file;
|
||||||
|
|
||||||
|
read_next_line:
|
||||||
|
if (fgets(cur_parser->line_buffer, sizeof(cur_parser->line_buffer), cur_parser->file_handle) == NULL) {
|
||||||
|
if (cur_parser->cond.depth > 0) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < cur_parser->cond.depth; i++)
|
||||||
|
WMenuParserError(cur_parser, _("missing #endif to match #%s at line %d"),
|
||||||
|
cur_parser->cond.stack[i].name, cur_parser->cond.stack[i].line);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cur_parser->parent_file == NULL)
|
||||||
|
/* Not inside an included file -> we have reached the end */
|
||||||
|
return False;
|
||||||
|
|
||||||
|
/* We have only reached the end of an included file -> go back to calling file */
|
||||||
|
fclose(cur_parser->file_handle);
|
||||||
|
wfree((char *) cur_parser->file_name);
|
||||||
|
cur_parser = cur_parser->parent_file;
|
||||||
|
wfree(cur_parser->include_file);
|
||||||
|
cur_parser->include_file = NULL;
|
||||||
|
goto read_next_line_with_filechange;
|
||||||
|
}
|
||||||
|
|
||||||
|
cur_parser->line_number++;
|
||||||
|
cur_parser->rd = cur_parser->line_buffer;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(cur_parser)) {
|
||||||
|
/* We reached the end of line */
|
||||||
|
if (scanmode == GET_TITLE)
|
||||||
|
goto read_next_line; /* Empty line -> skip */
|
||||||
|
else
|
||||||
|
break; /* Finished reading current line -> return it to caller */
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((scanmode == GET_TITLE) && (*cur_parser->rd == '#')) {
|
||||||
|
cur_parser->rd++;
|
||||||
|
menu_parser_get_directive(cur_parser);
|
||||||
|
goto read_next_line_with_filechange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cur_parser->cond.stack[0].skip)
|
||||||
|
goto read_next_line;
|
||||||
|
|
||||||
|
/* Found a word */
|
||||||
|
token = menu_parser_isolate_token(cur_parser);
|
||||||
|
switch (scanmode) {
|
||||||
|
case GET_TITLE:
|
||||||
|
*title = token;
|
||||||
|
scanmode = GET_COMMAND;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GET_COMMAND:
|
||||||
|
if (strcmp(token, "SHORTCUT") == 0) {
|
||||||
|
scanmode = GET_SHORTCUT;
|
||||||
|
wfree(token);
|
||||||
|
} else {
|
||||||
|
*command = token;
|
||||||
|
scanmode = GET_PARAMETERS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GET_SHORTCUT:
|
||||||
|
if (*shortcut != NULL) {
|
||||||
|
WMenuParserError(top_parser, _("multiple SHORTCUT definition not valid") );
|
||||||
|
wfree(*shortcut);
|
||||||
|
}
|
||||||
|
*shortcut = token;
|
||||||
|
scanmode = GET_COMMAND;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GET_PARAMETERS:
|
||||||
|
{
|
||||||
|
char *src;
|
||||||
|
|
||||||
|
if (params == NULL) {
|
||||||
|
params = lineparam;
|
||||||
|
} else {
|
||||||
|
if ((params - lineparam) < sizeof(lineparam) - 1)
|
||||||
|
*params++ = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
src = token;
|
||||||
|
while ((params - lineparam) < sizeof(lineparam) - 1)
|
||||||
|
if ( (*params = *src++) == '\0')
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
params++;
|
||||||
|
wfree(token);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params != NULL) {
|
||||||
|
lineparam[sizeof(lineparam) - 1] = '\0';
|
||||||
|
*parameter = wstrdup(lineparam);
|
||||||
|
}
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return False when there's nothing left on the line,
|
||||||
|
otherwise increment parser's pointer to next token */
|
||||||
|
Bool menu_parser_skip_spaces_and_comments(WMenuParser parser)
|
||||||
|
{
|
||||||
|
for (;;) {
|
||||||
|
while (isspace(*parser->rd))
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
if (*parser->rd == '\0') {
|
||||||
|
return False; /* Found the end of current line */
|
||||||
|
} else if ((parser->rd[0] == '\\') &&
|
||||||
|
(parser->rd[1] == '\n') &&
|
||||||
|
(parser->rd[2] == '\0')) {
|
||||||
|
/* Means that the current line is expected to be continued on next line */
|
||||||
|
if (fgets(parser->line_buffer, sizeof(parser->line_buffer), parser->file_handle) == NULL) {
|
||||||
|
WMenuParserError(parser, _("premature end of file while expecting a new line after '\\'") );
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
parser->line_number++;
|
||||||
|
parser->rd = parser->line_buffer;
|
||||||
|
|
||||||
|
} else if (parser->rd[0] == '/') {
|
||||||
|
if (parser->rd[1] == '/') /* Single line C comment */
|
||||||
|
return False; /* Won't find anything more on this line */
|
||||||
|
|
||||||
|
if (parser->rd[1] == '*') {
|
||||||
|
int start_line;
|
||||||
|
|
||||||
|
start_line = parser->line_number;
|
||||||
|
parser->rd += 2;
|
||||||
|
for (;;) {
|
||||||
|
/* Search end-of-comment marker */
|
||||||
|
while (*parser->rd != '\0') {
|
||||||
|
if ((parser->rd[0] == '*') && (parser->rd[1] == '/'))
|
||||||
|
goto found_end_of_comment;
|
||||||
|
|
||||||
|
parser->rd++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Marker not found -> load next line */
|
||||||
|
if (fgets(parser->line_buffer, sizeof(parser->line_buffer), parser->file_handle) == NULL) {
|
||||||
|
WMenuParserError(parser, _("reached end of file while searching '*/' for comment started at line %d"), start_line);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
parser->line_number++;
|
||||||
|
parser->rd = parser->line_buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
found_end_of_comment:
|
||||||
|
parser->rd += 2; /* Skip closing mark */
|
||||||
|
continue; /* Because there may be spaces after the comment */
|
||||||
|
}
|
||||||
|
|
||||||
|
return True; /* the '/' was not a comment, treat it as user data */
|
||||||
|
} else {
|
||||||
|
return True; /* Found some data */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* read a token (non-spaces suite of characters)
|
||||||
|
* the result is wmalloc's, so it needs to be free'd */
|
||||||
|
static char *menu_parser_isolate_token(WMenuParser parser)
|
||||||
|
{
|
||||||
|
char buffer_token[sizeof(parser->line_buffer)];
|
||||||
|
char *token;
|
||||||
|
int limit = MAX_NESTED_MACROS;
|
||||||
|
|
||||||
|
token = buffer_token;
|
||||||
|
|
||||||
|
restart_token_split:
|
||||||
|
|
||||||
|
while (*parser->rd != '\0')
|
||||||
|
if (isspace(*parser->rd)) {
|
||||||
|
break;
|
||||||
|
|
||||||
|
} else if ((parser->rd[0] == '/') &&
|
||||||
|
((parser->rd[1] == '*') || (parser->rd[1] == '/'))) {
|
||||||
|
break;
|
||||||
|
|
||||||
|
} else if (parser->rd[0] == '\\') {
|
||||||
|
if ((parser->rd[1] == '\n') || (parser->rd[1] == '\0'))
|
||||||
|
break;
|
||||||
|
|
||||||
|
parser->rd++;
|
||||||
|
*token++ = *parser->rd++;
|
||||||
|
|
||||||
|
} else if (*parser->rd == '"' ) {
|
||||||
|
char ch;
|
||||||
|
|
||||||
|
/* Double-quoted string deserve special processing because macros are not expanded
|
||||||
|
inside. We also remove the double quotes. */
|
||||||
|
parser->rd++;
|
||||||
|
while ((*parser->rd != '\0') && (*parser->rd != '\n')) {
|
||||||
|
ch = *parser->rd++;
|
||||||
|
if (ch == '\\') {
|
||||||
|
if ((*parser->rd == '\0') || (*parser->rd == '\n'))
|
||||||
|
break;
|
||||||
|
*token++ = *parser->rd++;
|
||||||
|
} else if (ch == '"')
|
||||||
|
goto found_end_dquote;
|
||||||
|
else
|
||||||
|
*token++ = ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
WMenuParserError(parser, _("missing closing double-quote before end-of-line") );
|
||||||
|
|
||||||
|
found_end_dquote:
|
||||||
|
;
|
||||||
|
|
||||||
|
} else if (*parser->rd == '\'') {
|
||||||
|
char ch;
|
||||||
|
|
||||||
|
/* Simple-quoted string deserve special processing because we keep their content
|
||||||
|
as-is, including the quotes and the \-escaped text */
|
||||||
|
*token++ = *parser->rd++;
|
||||||
|
while ((*parser->rd != '\0') && (*parser->rd != '\n')) {
|
||||||
|
ch = *parser->rd++;
|
||||||
|
*token++ = ch;
|
||||||
|
if (ch == '\'')
|
||||||
|
goto found_end_squote;
|
||||||
|
}
|
||||||
|
|
||||||
|
WMenuParserError(parser, _("missing closing simple-quote before end-of-line") );
|
||||||
|
|
||||||
|
found_end_squote:
|
||||||
|
;
|
||||||
|
|
||||||
|
} else if (isnamechr(*parser->rd)) {
|
||||||
|
WParserMacro *macro;
|
||||||
|
|
||||||
|
macro = menu_parser_find_macro(parser, parser->rd);
|
||||||
|
if (macro != NULL) {
|
||||||
|
/* The expansion is done inside the parser's buffer
|
||||||
|
this is needed to allow sub macro calls */
|
||||||
|
menu_parser_expand_macro(parser, macro);
|
||||||
|
|
||||||
|
/* Restart parsing to allow expansion of sub macro calls */
|
||||||
|
if (limit-- > 0)
|
||||||
|
goto restart_token_split;
|
||||||
|
|
||||||
|
WMenuParserError(parser, _("too many nested macro expansion, breaking loop") );
|
||||||
|
|
||||||
|
while (isnamechr(*parser->rd))
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
while (isnamechr(*parser->rd))
|
||||||
|
*token++ = *parser->rd++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*token++ = *parser->rd++;
|
||||||
|
}
|
||||||
|
|
||||||
|
*token++ = '\0';
|
||||||
|
token = wmalloc(token - buffer_token);
|
||||||
|
strcpy(token, buffer_token);
|
||||||
|
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Processing of special # directives */
|
||||||
|
static void menu_parser_get_directive(WMenuParser parser)
|
||||||
|
{
|
||||||
|
char *command;
|
||||||
|
|
||||||
|
/* Isolate the command */
|
||||||
|
while (isspace(*parser->rd))
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
command = parser->rd;
|
||||||
|
while (*parser->rd)
|
||||||
|
if (isspace(*parser->rd)) {
|
||||||
|
*parser->rd++ = '\0';
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
parser->rd++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(command, "include") == 0) {
|
||||||
|
if (!menu_parser_include_file(parser))
|
||||||
|
return;
|
||||||
|
|
||||||
|
} else if (strcmp(command, "define") == 0) {
|
||||||
|
menu_parser_define_macro(parser);
|
||||||
|
|
||||||
|
} else if (strcmp(command, "ifdef") == 0) {
|
||||||
|
menu_parser_condition_ifmacro(parser, 1);
|
||||||
|
|
||||||
|
} else if (strcmp(command, "ifndef") == 0) {
|
||||||
|
menu_parser_condition_ifmacro(parser, 0);
|
||||||
|
|
||||||
|
} else if (strcmp(command, "else") == 0) {
|
||||||
|
menu_parser_condition_else(parser);
|
||||||
|
|
||||||
|
} else if (strcmp(command, "endif") == 0) {
|
||||||
|
menu_parser_condition_end(parser);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
WMenuParserError(parser, _("unknow directive '#%s'"), command);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menu_parser_skip_spaces_and_comments(parser))
|
||||||
|
WMenuParserError(parser, _("extra text after '#' command is ignored: \"%.16s...\""),
|
||||||
|
parser->rd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Extract the file name, search for it in known directories
|
||||||
|
* and create a sub-parser to handle it.
|
||||||
|
* Returns False if the file could not be found */
|
||||||
|
static Bool menu_parser_include_file(WMenuParser parser)
|
||||||
|
{
|
||||||
|
char buffer[MAXLINE];
|
||||||
|
char *req_filename, *fullfilename, *p;
|
||||||
|
char eot;
|
||||||
|
FILE *fh;
|
||||||
|
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(parser)) {
|
||||||
|
WMenuParserError(parser, _("no file name found for #include") );
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (*parser->rd++) {
|
||||||
|
case '<':
|
||||||
|
eot = '>';
|
||||||
|
break;
|
||||||
|
case '"':
|
||||||
|
eot = '"';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WMenuParserError(parser, _("file name must be enclosed in brackets or double-quotes for #define") );
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
req_filename = parser->rd;
|
||||||
|
while (*parser->rd) {
|
||||||
|
if (*parser->rd == eot) {
|
||||||
|
*parser->rd++ = '\0';
|
||||||
|
goto found_end_define_fname;
|
||||||
|
} else {
|
||||||
|
parser->rd++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WMenuParserError(parser, _("missing closing '%c' in filename specification"), eot);
|
||||||
|
return False;
|
||||||
|
|
||||||
|
found_end_define_fname:
|
||||||
|
/* If we're inside a #if sequence, we abort now, but not sooner in
|
||||||
|
* order to keep the syntax check */
|
||||||
|
if (parser->cond.stack[0].skip)
|
||||||
|
return False;
|
||||||
|
|
||||||
|
{ /* Check we are not nesting too many includes */
|
||||||
|
WMenuParser p;
|
||||||
|
int count;
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
for (p = parser; p->parent_file; p = p->parent_file)
|
||||||
|
count++;
|
||||||
|
|
||||||
|
if (count > MAX_NESTED_INCLUDES) {
|
||||||
|
WMenuParserError(parser, _("too many nested includes") );
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Absolute paths */
|
||||||
|
fullfilename = req_filename;
|
||||||
|
if (req_filename[0] != '/') {
|
||||||
|
/* Search first in the same directory as the current file */
|
||||||
|
p = strrchr(parser->file_name, '/');
|
||||||
|
if (p != NULL) {
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = p - parser->file_name + 1;
|
||||||
|
if (len > sizeof(buffer) - 1)
|
||||||
|
len = sizeof(buffer) - 1;
|
||||||
|
|
||||||
|
strncpy(buffer, parser->file_name, len);
|
||||||
|
strncpy(buffer+len, req_filename, sizeof(buffer) - len - 1);
|
||||||
|
buffer[sizeof(buffer) - 1] = '\0';
|
||||||
|
fullfilename = buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fh = fopen(fullfilename, "rb");
|
||||||
|
|
||||||
|
/* Not found? Search in wmaker's known places */
|
||||||
|
if (fh == NULL) {
|
||||||
|
if (req_filename[0] != '/') {
|
||||||
|
const char *src;
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
fullfilename = buffer;
|
||||||
|
src = parser->include_default_paths;
|
||||||
|
while (*src != '\0') {
|
||||||
|
idx = 0;
|
||||||
|
if (*src == '~') {
|
||||||
|
char *home = wgethomedir();
|
||||||
|
while (*home != '\0') {
|
||||||
|
if (idx < sizeof(buffer) - 2)
|
||||||
|
buffer[idx++] = *home;
|
||||||
|
home++;
|
||||||
|
}
|
||||||
|
src++;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((*src != '\0') && (*src != ':')) {
|
||||||
|
if (idx < sizeof(buffer) - 2)
|
||||||
|
buffer[idx++] = *src;
|
||||||
|
src++;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer[idx++] = '/';
|
||||||
|
for (p = req_filename; *p != '\0'; p++)
|
||||||
|
if (idx < sizeof(buffer) - 1)
|
||||||
|
buffer[idx++] = *p;
|
||||||
|
buffer[idx] = '\0';
|
||||||
|
|
||||||
|
fh = fopen(fullfilename, "rb");
|
||||||
|
if (fh != NULL)
|
||||||
|
goto found_valid_file;
|
||||||
|
|
||||||
|
if (*src == ':')
|
||||||
|
src++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WMenuParserError(parser, _("could not find file \"%s\" for include"), req_filename);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Found the file, make it our new source */
|
||||||
|
found_valid_file:
|
||||||
|
parser->include_file = menu_parser_create_new(wstrdup(req_filename), fh, parser->include_default_paths);
|
||||||
|
parser->include_file->parent_file = parser;
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check wether a macro exists or not, and marks the parser to ignore the
|
||||||
|
* following data accordingly */
|
||||||
|
static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists)
|
||||||
|
{
|
||||||
|
WParserMacro *macro;
|
||||||
|
int idx;
|
||||||
|
const char *cmd_name, *macro_name;
|
||||||
|
|
||||||
|
cmd_name = check_exists?"ifdef":"ifndef";
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(parser)) {
|
||||||
|
WMenuParserError(parser, _("missing macro name argument to #%s"), cmd_name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* jump to end of provided name for later checks that no extra stuff is following */
|
||||||
|
macro_name = parser->rd;
|
||||||
|
while (isnamechr(*parser->rd))
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
/* Add this condition to the stack of conditions */
|
||||||
|
if (parser->cond.depth >= wlengthof(parser->cond.stack)) {
|
||||||
|
WMenuParserError(parser, _("too many nested #if sequences") );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (idx = parser->cond.depth - 1; idx >= 0; idx--)
|
||||||
|
parser->cond.stack[idx + 1] = parser->cond.stack[idx];
|
||||||
|
|
||||||
|
parser->cond.depth++;
|
||||||
|
|
||||||
|
if (parser->cond.stack[1].skip) {
|
||||||
|
parser->cond.stack[0].skip = True;
|
||||||
|
} else {
|
||||||
|
macro = menu_parser_find_macro(parser, macro_name);
|
||||||
|
parser->cond.stack[0].skip =
|
||||||
|
((check_exists) && (macro == NULL)) ||
|
||||||
|
((!check_exists) && (macro != NULL)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(parser->cond.stack[0].name, cmd_name);
|
||||||
|
parser->cond.stack[0].line = parser->line_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Swap the 'data ignore' flag because a #else condition was found */
|
||||||
|
static void menu_parser_condition_else(WMenuParser parser)
|
||||||
|
{
|
||||||
|
if (parser->cond.depth <= 0) {
|
||||||
|
WMenuParserError(parser, _("found #%s but have no matching #if"), "else" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((parser->cond.depth > 1) && (parser->cond.stack[1].skip))
|
||||||
|
/* The containing #if is false, so we continue skipping anyway */
|
||||||
|
parser->cond.stack[0].skip = True;
|
||||||
|
else
|
||||||
|
parser->cond.stack[0].skip = !parser->cond.stack[0].skip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Closes the current conditional, removing it from the stack */
|
||||||
|
static void menu_parser_condition_end(WMenuParser parser)
|
||||||
|
{
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
if (parser->cond.depth <= 0) {
|
||||||
|
WMenuParserError(parser, _("found #%s but have no matching #if"), "endif" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (--parser->cond.depth > 0)
|
||||||
|
for (idx = 0; idx < parser->cond.depth; idx++)
|
||||||
|
parser->cond.stack[idx] = parser->cond.stack[idx + 1];
|
||||||
|
else
|
||||||
|
parser->cond.stack[0].skip = False;
|
||||||
|
}
|
||||||
86
WINGs/menuparser.h
Normal file
86
WINGs/menuparser.h
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/* menuparser.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012 Christophe Curis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MENUPARSER_H_INCLUDED
|
||||||
|
#define _MENUPARSER_H_INCLUDED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is not part of WINGs public API
|
||||||
|
*
|
||||||
|
* It defines internal things for the Menu Parser, the public API is
|
||||||
|
* located in WINGs/WUtil.h as usual
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MAXLINE 1024
|
||||||
|
#define MAX_NESTED_INCLUDES 16 // To avoid infinite includes case
|
||||||
|
#define MAX_NESTED_MACROS 24 // To avoid infinite loop inside macro expansions
|
||||||
|
#define MAX_MACRO_ARG_COUNT 32 // Limited by design
|
||||||
|
|
||||||
|
typedef struct w_parser_macro WParserMacro;
|
||||||
|
|
||||||
|
typedef void WParserMacroFunction(WParserMacro *this, WMenuParser parser);
|
||||||
|
|
||||||
|
struct w_menu_parser {
|
||||||
|
WMenuParser include_file;
|
||||||
|
WMenuParser parent_file;
|
||||||
|
const char *include_default_paths;
|
||||||
|
const char *file_name;
|
||||||
|
FILE *file_handle;
|
||||||
|
int line_number;
|
||||||
|
WParserMacro *macros;
|
||||||
|
struct {
|
||||||
|
/* Conditional text parsing is implemented using a stack of the
|
||||||
|
skip states for each nested #if */
|
||||||
|
int depth;
|
||||||
|
struct {
|
||||||
|
Bool skip;
|
||||||
|
char name[8];
|
||||||
|
int line;
|
||||||
|
} stack[32];
|
||||||
|
} cond;
|
||||||
|
char *rd;
|
||||||
|
char line_buffer[MAXLINE];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct w_parser_macro {
|
||||||
|
WParserMacro *next;
|
||||||
|
char name[64];
|
||||||
|
WParserMacroFunction *function;
|
||||||
|
int arg_count;
|
||||||
|
#ifdef DEBUG
|
||||||
|
int usage_count;
|
||||||
|
#endif
|
||||||
|
unsigned char value[MAXLINE * 4];
|
||||||
|
};
|
||||||
|
|
||||||
|
Bool menu_parser_skip_spaces_and_comments(WMenuParser parser);
|
||||||
|
|
||||||
|
void menu_parser_register_preset_macros(WMenuParser parser);
|
||||||
|
|
||||||
|
void menu_parser_define_macro(WMenuParser parser);
|
||||||
|
|
||||||
|
void menu_parser_free_macros(WMenuParser parser);
|
||||||
|
|
||||||
|
WParserMacro *menu_parser_find_macro(WMenuParser parser, const char *name);
|
||||||
|
|
||||||
|
void menu_parser_expand_macro(WMenuParser parser, WParserMacro *macro);
|
||||||
|
|
||||||
|
int isnamechr(char ch); // Check if char is valid character for a macro name
|
||||||
|
|
||||||
|
#endif /* _MENUPARSER_H_INCLUDED */
|
||||||
719
WINGs/menuparser_macros.c
Normal file
719
WINGs/menuparser_macros.c
Normal file
@@ -0,0 +1,719 @@
|
|||||||
|
/*
|
||||||
|
* Window Maker window manager
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012 Christophe Curis
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
#include "wconfig.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
|
#include <WINGs/WUtil.h>
|
||||||
|
|
||||||
|
#include "menuparser.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
This file contains the functions related to macros:
|
||||||
|
- parse a macro being defined
|
||||||
|
- handle single macro expansion
|
||||||
|
- pre-defined parser's macros
|
||||||
|
|
||||||
|
Some design notes for macro internal storage:
|
||||||
|
|
||||||
|
arg_count is -1 when the macro does not take arguments
|
||||||
|
but 0 when no args but still using parenthesis. The
|
||||||
|
difference is explained in GNU cpp's documentation:
|
||||||
|
http://gcc.gnu.org/onlinedocs/cpp/Function_002dlike-Macros.html
|
||||||
|
|
||||||
|
the value is stored for fast expansion; here is an
|
||||||
|
example of the storage format used:
|
||||||
|
#define EXAMPLE(a, b) "text:" a and b!
|
||||||
|
will be stored in macro->value[] as:
|
||||||
|
0x0000: 0x00 0x07 (strlen(part 1))
|
||||||
|
0x0002: '"', 't', 'e', 'x', 't', ':', '"' (first part)
|
||||||
|
0x0009: 0x00 (part 2, id=0 for replacement by 1st parameter 'a')
|
||||||
|
0x000A: 0x00 0x03 (strlen(part 3))
|
||||||
|
0x000C: 'a', 'n', 'd' (part 3)
|
||||||
|
0x000F: 0x01 (part 4, id=1 for replacement by 2nd parameter 'b')
|
||||||
|
0x0010: 0x00 0x01 (strlen(part 5))
|
||||||
|
0x0012: '!' (part 5)
|
||||||
|
0x0013: 0xFF (end of macro)
|
||||||
|
This structure allows to store any number and combination
|
||||||
|
of text/parameter and still provide very fast generation
|
||||||
|
at macro replacement time.
|
||||||
|
|
||||||
|
Predefined macros are using a call-back function mechanism
|
||||||
|
to generate the value on-demand. This value is generated
|
||||||
|
in the 'value' buffer of the structure.
|
||||||
|
Most of these call-backs will actually cache the value:
|
||||||
|
they generate it on the first use (inside a parser,
|
||||||
|
not globally) and reuse that value on next call(s).
|
||||||
|
|
||||||
|
Because none of these macros take parameters, the call-back
|
||||||
|
mechanism does not include passing of user arguments; the
|
||||||
|
complex storage mechanism for argument replacement being
|
||||||
|
not necessary the macro->value parameter is used as a
|
||||||
|
plain C string to be copied, this fact being recognised
|
||||||
|
by macro->function being non-null. It was chosen that the
|
||||||
|
call-back function would not have the possibility to fail.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static Bool menu_parser_read_macro_def(WMenuParser parser, WParserMacro *macro, char **argname);
|
||||||
|
|
||||||
|
static Bool menu_parser_read_macro_args(WMenuParser parser, WParserMacro *macro,
|
||||||
|
char *array[], char *buffer, ssize_t buffer_size);
|
||||||
|
|
||||||
|
/* Free all used memory associated with parser's macros */
|
||||||
|
void menu_parser_free_macros(WMenuParser parser)
|
||||||
|
{
|
||||||
|
WParserMacro *macro, *mnext;
|
||||||
|
#ifdef DEBUG
|
||||||
|
unsigned char *rd;
|
||||||
|
unsigned int size;
|
||||||
|
unsigned int count;
|
||||||
|
|
||||||
|
/* if we were compiled with debugging, we take the opportunity that we
|
||||||
|
parse the list of macros, for memory release, to print all the
|
||||||
|
definitions */
|
||||||
|
printf(__FILE__ ": Macros defined while parsing \"%s\"\n", parser->file_name);
|
||||||
|
count = 0;
|
||||||
|
#endif
|
||||||
|
for (macro = parser->macros; macro != NULL; macro = mnext) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf(" %s", macro->name);
|
||||||
|
if (macro->arg_count >= 0)
|
||||||
|
printf("(args=%d)", macro->arg_count);
|
||||||
|
printf(" = ");
|
||||||
|
|
||||||
|
if (macro->function != NULL) {
|
||||||
|
macro->function(macro, parser);
|
||||||
|
printf("function:\"%s\"", macro->value);
|
||||||
|
} else {
|
||||||
|
rd = macro->value;
|
||||||
|
for (;;) {
|
||||||
|
putchar('"');
|
||||||
|
size = (*rd++) << 8;
|
||||||
|
size |= *rd++;
|
||||||
|
while (size-- > 0) putchar(*rd++);
|
||||||
|
putchar('"');
|
||||||
|
if (*rd == 0xFF) break;
|
||||||
|
printf(" #%d ", (*rd++) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf(", used %d times\n", macro->usage_count);
|
||||||
|
count++;
|
||||||
|
#endif
|
||||||
|
mnext = macro->next;
|
||||||
|
wfree(macro);
|
||||||
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf(__FILE__ ": %d macros\n", count);
|
||||||
|
#endif
|
||||||
|
parser->macros = NULL; // Security
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check wether the specified character is valid for a name (macro, parameter) or not */
|
||||||
|
int isnamechr(char ch)
|
||||||
|
{
|
||||||
|
static const int table[256] = {
|
||||||
|
[0] = 0, // In case we'd fall on buggy compiler, to avoid crash
|
||||||
|
// C99: 6.7.8.21 -> non specified values are initialised to 0
|
||||||
|
['0'] = 1, ['1'] = 1, ['2'] = 1, ['3'] = 1, ['4'] = 1,
|
||||||
|
['5'] = 1, ['6'] = 1, ['7'] = 1, ['8'] = 1, ['9'] = 1,
|
||||||
|
['A'] = 1, ['B'] = 1, ['C'] = 1, ['D'] = 1, ['E'] = 1, ['F'] = 1,
|
||||||
|
['G'] = 1, ['H'] = 1, ['I'] = 1, ['J'] = 1, ['K'] = 1, ['L'] = 1,
|
||||||
|
['M'] = 1, ['N'] = 1, ['O'] = 1, ['P'] = 1, ['Q'] = 1, ['R'] = 1,
|
||||||
|
['S'] = 1, ['T'] = 1, ['U'] = 1, ['V'] = 1, ['W'] = 1, ['X'] = 1,
|
||||||
|
['Y'] = 1, ['Z'] = 1,
|
||||||
|
['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, ['e'] = 1, ['f'] = 1,
|
||||||
|
['g'] = 1, ['h'] = 1, ['i'] = 1, ['j'] = 1, ['k'] = 1, ['l'] = 1,
|
||||||
|
['m'] = 1, ['n'] = 1, ['o'] = 1, ['p'] = 1, ['q'] = 1, ['r'] = 1,
|
||||||
|
['s'] = 1, ['t'] = 1, ['u'] = 1, ['v'] = 1, ['w'] = 1, ['x'] = 1,
|
||||||
|
['y'] = 1, ['z'] = 1,
|
||||||
|
['_'] = 1
|
||||||
|
// We refuse any UTF-8 coded character, or accents in ISO-xxx codepages
|
||||||
|
};
|
||||||
|
return table[0x00FF & (unsigned)ch ];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Parse the definition of the macro and add it to the top-most parser's list */
|
||||||
|
void menu_parser_define_macro(WMenuParser parser)
|
||||||
|
{
|
||||||
|
WParserMacro *macro;
|
||||||
|
int idx;
|
||||||
|
char arg_names_buf[MAXLINE];
|
||||||
|
char *arg_name[MAX_MACRO_ARG_COUNT];
|
||||||
|
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(parser)) {
|
||||||
|
WMenuParserError(parser, _("no macro name found for #define") );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
macro = wmalloc(sizeof(*macro));
|
||||||
|
|
||||||
|
/* Isolate name of macro */
|
||||||
|
idx = 0;
|
||||||
|
while (isnamechr(*parser->rd)) {
|
||||||
|
if (idx < sizeof(macro->name) - 1)
|
||||||
|
macro->name[idx++] = *parser->rd;
|
||||||
|
parser->rd++;
|
||||||
|
}
|
||||||
|
// macro->name[idx] = '\0'; -> Already present because wmalloc filled struct with 0s
|
||||||
|
|
||||||
|
/* Build list of expected arguments */
|
||||||
|
if (*parser->rd == '(') {
|
||||||
|
parser->rd++;
|
||||||
|
idx = 0;
|
||||||
|
for (;;) {
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(parser)) {
|
||||||
|
arglist_error_premature_eol:
|
||||||
|
WMenuParserError(parser, _("premature end of file while reading arg-list for macro \"%s\""), macro->name);
|
||||||
|
wfree(macro);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (*parser->rd == ')') break;
|
||||||
|
|
||||||
|
if (macro->arg_count >= wlengthof(arg_name)) {
|
||||||
|
WMenuParserError(parser, _("too many parameters for macro \"%s\" definition"), macro->name);
|
||||||
|
wfree(macro);
|
||||||
|
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isnamechr(*parser->rd)) {
|
||||||
|
arg_name[macro->arg_count++] = arg_names_buf + idx;
|
||||||
|
do {
|
||||||
|
if (idx < sizeof(arg_names_buf) - 1)
|
||||||
|
arg_names_buf[idx++] = *parser->rd;
|
||||||
|
parser->rd++;
|
||||||
|
} while (isnamechr(*parser->rd));
|
||||||
|
arg_names_buf[idx] = '\0';
|
||||||
|
if (idx < sizeof(arg_names_buf) - 1) idx++;
|
||||||
|
} else {
|
||||||
|
WMenuParserError(parser, _("invalid characted '%c' in arg-list for macro \"%s\" while expecting parameter name"),
|
||||||
|
*parser->rd, macro->name);
|
||||||
|
wfree(macro);
|
||||||
|
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!menu_parser_skip_spaces_and_comments(parser))
|
||||||
|
goto arglist_error_premature_eol;
|
||||||
|
if (*parser->rd == ')') break;
|
||||||
|
|
||||||
|
if (*parser->rd != ',') {
|
||||||
|
WMenuParserError(parser, _("invalid characted '%c' in arg-list for macro \"%s\" while expecting ',' or ')'"),
|
||||||
|
*parser->rd, macro->name);
|
||||||
|
wfree(macro);
|
||||||
|
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parser->rd++;
|
||||||
|
}
|
||||||
|
parser->rd++; // skip the closing ')'
|
||||||
|
} else
|
||||||
|
macro->arg_count = -1; // Means no parenthesis at all to expect
|
||||||
|
|
||||||
|
/* If we're inside a #if sequence, we abort now, but not sooner in
|
||||||
|
order to keep the syntax check */
|
||||||
|
if (parser->cond.stack[0].skip) {
|
||||||
|
wfree(macro);
|
||||||
|
*parser->rd = '\0'; // Ignore macro content
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the macro's definition */
|
||||||
|
menu_parser_skip_spaces_and_comments(parser);
|
||||||
|
if (!menu_parser_read_macro_def(parser, macro, arg_name)) {
|
||||||
|
wfree(macro);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the macro in the Root parser */
|
||||||
|
while (parser->parent_file != NULL)
|
||||||
|
parser = parser->parent_file;
|
||||||
|
|
||||||
|
/* Check that the macro was not already defined */
|
||||||
|
if (menu_parser_find_macro(parser, macro->name) != NULL) {
|
||||||
|
WMenuParserError(parser, _("macro \"%s\" already defined, ignoring redefinition"),
|
||||||
|
macro->name);
|
||||||
|
wfree(macro);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Append at beginning of list */
|
||||||
|
macro->next = parser->macros;
|
||||||
|
parser->macros = macro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if the current word in the parser matches a macro */
|
||||||
|
WParserMacro *menu_parser_find_macro(WMenuParser parser, const char *name)
|
||||||
|
{
|
||||||
|
const char *ref, *cmp;
|
||||||
|
WParserMacro *macro;
|
||||||
|
|
||||||
|
while (parser->parent_file != NULL)
|
||||||
|
parser = parser->parent_file;
|
||||||
|
for (macro = parser->macros; macro != NULL; macro = macro->next) {
|
||||||
|
ref = macro->name;
|
||||||
|
cmp = name;
|
||||||
|
while (*ref != '\0')
|
||||||
|
if (*ref++ != *cmp++)
|
||||||
|
goto check_next_macro;
|
||||||
|
if (isnamechr(*cmp))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return macro;
|
||||||
|
check_next_macro: ;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* look to see if the next word matches the name of one of the parameter
|
||||||
|
names for a macro definition
|
||||||
|
This function is internal to the macro definition function as this is
|
||||||
|
where the analysis is done */
|
||||||
|
static inline char *mp_is_parameter(char *parse, const char *param) {
|
||||||
|
while (*param)
|
||||||
|
if (*parse++ != *param++)
|
||||||
|
return NULL;
|
||||||
|
if (isnamechr(*parse))
|
||||||
|
return NULL;
|
||||||
|
return parse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read the content definition part of a #define construct (the part after the optional
|
||||||
|
argument list) and store it in the prepared format for quick expansion
|
||||||
|
|
||||||
|
There is no need to keep track of the names of the parameters, so they are stored in
|
||||||
|
a temporary storage for the time of the macro parsing. */
|
||||||
|
static Bool menu_parser_read_macro_def(WMenuParser parser, WParserMacro *macro, char **arg)
|
||||||
|
{
|
||||||
|
unsigned char *wr_size;
|
||||||
|
unsigned char *wr;
|
||||||
|
unsigned int size_data;
|
||||||
|
unsigned int size_max;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
wr_size = macro->value;
|
||||||
|
size_data = 0;
|
||||||
|
wr = wr_size + 2;
|
||||||
|
size_max = sizeof(macro->value) - (wr - macro->value) - 3;
|
||||||
|
while (menu_parser_skip_spaces_and_comments(parser)) {
|
||||||
|
if (isnamechr(*parser->rd)) {
|
||||||
|
char *next_rd;
|
||||||
|
|
||||||
|
/* Is the current word a parameter to replace? */
|
||||||
|
for (i = 0; i < macro->arg_count; i++) {
|
||||||
|
next_rd = mp_is_parameter(parser->rd, arg[i]);
|
||||||
|
if (next_rd != NULL) {
|
||||||
|
if (wr + 4 >= macro->value + sizeof(macro->value))
|
||||||
|
goto error_too_much_data;
|
||||||
|
wr_size[0] = (size_data >> 8) & 0xFF;
|
||||||
|
wr_size[1] = size_data & 0xFF;
|
||||||
|
*wr++ = i;
|
||||||
|
wr_size = wr;
|
||||||
|
wr += 2;
|
||||||
|
parser->rd = next_rd;
|
||||||
|
*wr++ = ' ';
|
||||||
|
size_data = 1;
|
||||||
|
size_max = sizeof(macro->value) - (wr - macro->value) - 3;
|
||||||
|
goto next_loop; // Because we can't 'break' this loop and 'continue'
|
||||||
|
// the outer one in a clean and easy way
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Not parameter name -> copy as-is */
|
||||||
|
do {
|
||||||
|
*wr++ = *parser->rd++;
|
||||||
|
if (++size_data >= size_max) {
|
||||||
|
error_too_much_data:
|
||||||
|
WMenuParserError(parser, _("more content than supported for the macro \"%s\""),
|
||||||
|
macro->name);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
} while (isnamechr(*parser->rd));
|
||||||
|
if (isspace(*parser->rd)) {
|
||||||
|
*wr++ = ' ';
|
||||||
|
if (++size_data >= size_max)
|
||||||
|
goto error_too_much_data;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Some uninterresting characters, copy as-is */
|
||||||
|
while (*parser->rd != '\0') {
|
||||||
|
if (isnamechr(*parser->rd)) break; // handle in next loop
|
||||||
|
if (parser->rd[0] == '/')
|
||||||
|
if ((parser->rd[1] == '*') || (parser->rd[1] == '/'))
|
||||||
|
break; // Comments are handled by std function
|
||||||
|
if ((parser->rd[0] == '\\') &&
|
||||||
|
(parser->rd[1] == '\n') &&
|
||||||
|
(parser->rd[2] == '\0'))
|
||||||
|
break; // Long-lines are handled by std function
|
||||||
|
*wr++ = *parser->rd++;
|
||||||
|
if (++size_data >= size_max)
|
||||||
|
goto error_too_much_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
next_loop:
|
||||||
|
;
|
||||||
|
}
|
||||||
|
wr_size[0] = (size_data >> 8) & 0xFF;
|
||||||
|
wr_size[1] = size_data & 0xFF;
|
||||||
|
*wr = 0xFF;
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When a macro is being used in the file, this function will generate the
|
||||||
|
expanded value for the macro in the parser's work line.
|
||||||
|
It blindly supposes that the data generated in macro->value is valid */
|
||||||
|
void menu_parser_expand_macro(WMenuParser parser, WParserMacro *macro)
|
||||||
|
{
|
||||||
|
char save_buf[sizeof(parser->line_buffer)];
|
||||||
|
char arg_values_buf[MAXLINE];
|
||||||
|
char *arg_value[MAX_MACRO_ARG_COUNT];
|
||||||
|
char *src, *dst;
|
||||||
|
unsigned char *rd;
|
||||||
|
unsigned int size;
|
||||||
|
int i, space_left;
|
||||||
|
|
||||||
|
/* Skip the name of the macro, this was not done by caller */
|
||||||
|
for (i = 0; macro->name[i] != '\0'; i++)
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
if (macro->arg_count >= 0) {
|
||||||
|
menu_parser_skip_spaces_and_comments(parser);
|
||||||
|
if (!menu_parser_read_macro_args(parser, macro, arg_value, arg_values_buf, sizeof(arg_values_buf)))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
macro->usage_count++;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Save the remaining data from current line as we will overwrite the
|
||||||
|
current line's workspace with the expanded macro, so we can re-append
|
||||||
|
it afterwards */
|
||||||
|
dst = save_buf;
|
||||||
|
while ((*dst++ = *parser->rd++) != '\0') ;
|
||||||
|
|
||||||
|
/* Generate expanded macro */
|
||||||
|
dst = parser->line_buffer;
|
||||||
|
parser->rd = dst;
|
||||||
|
space_left = sizeof(parser->line_buffer) - 1;
|
||||||
|
if (macro->function != NULL) {
|
||||||
|
/* Parser's pre-defined macros actually proposes a function call to
|
||||||
|
generate dynamic value for the expansion of the macro. In this case
|
||||||
|
it is generated as a C string in the macro->value and used directly */
|
||||||
|
macro->function(macro, parser);
|
||||||
|
rd = macro->value;
|
||||||
|
while (--space_left > 0)
|
||||||
|
if ((*dst = *rd++) == '\0')
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
dst++;
|
||||||
|
} else {
|
||||||
|
rd = macro->value;
|
||||||
|
for (;;) {
|
||||||
|
size = (*rd++) << 8;
|
||||||
|
size |= *rd++;
|
||||||
|
while (size-- > 0) {
|
||||||
|
*dst = *rd++;
|
||||||
|
if (--space_left > 0) dst++;
|
||||||
|
}
|
||||||
|
if (*rd == 0xFF) break;
|
||||||
|
src = arg_value[*rd++];
|
||||||
|
while (*src) {
|
||||||
|
*dst = *src++;
|
||||||
|
if (--space_left > 0) dst++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Copy finished -> Re-append the text that was following the macro */
|
||||||
|
src = save_buf;
|
||||||
|
while (--space_left > 0)
|
||||||
|
if ((*dst++ = *src++) == '\0')
|
||||||
|
break;
|
||||||
|
*dst = '\0';
|
||||||
|
|
||||||
|
if (space_left <= 0)
|
||||||
|
WMenuParserError(parser, _("expansion for macro \"%s\" too big, line truncated"),
|
||||||
|
macro->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When reading a macro to be expanded (not being defined), that takes arguments,
|
||||||
|
this function parses the arguments being provided */
|
||||||
|
static Bool menu_parser_read_macro_args(WMenuParser parser, WParserMacro *macro,
|
||||||
|
char *array[], char *buffer, ssize_t buffer_size)
|
||||||
|
{
|
||||||
|
int arg;
|
||||||
|
|
||||||
|
if (*parser->rd != '(') {
|
||||||
|
WMenuParserError(parser, _("macro \"%s\" needs parenthesis for arguments"),
|
||||||
|
macro->name);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
parser->rd++;
|
||||||
|
|
||||||
|
buffer_size--; // Room for final '\0'
|
||||||
|
menu_parser_skip_spaces_and_comments(parser);
|
||||||
|
arg = 0;
|
||||||
|
for (;;) {
|
||||||
|
int paren_count;
|
||||||
|
|
||||||
|
array[arg] = buffer;
|
||||||
|
paren_count = 0;
|
||||||
|
while (*parser->rd != '\0') {
|
||||||
|
|
||||||
|
if (*parser->rd == '(')
|
||||||
|
paren_count++;
|
||||||
|
|
||||||
|
if (paren_count <= 0)
|
||||||
|
if ((*parser->rd == ',') ||
|
||||||
|
(*parser->rd == ')') ) break;
|
||||||
|
|
||||||
|
if ((*parser->rd == '"') || (*parser->rd == '\'')) {
|
||||||
|
char eot = *parser->rd++;
|
||||||
|
if (buffer_size-- > 0) *buffer++ = eot;
|
||||||
|
while (*parser->rd) {
|
||||||
|
if ((*buffer = *parser->rd++) == eot)
|
||||||
|
goto found_end_of_string;
|
||||||
|
if (buffer_size-- > 0) buffer++;
|
||||||
|
}
|
||||||
|
WMenuParserError(parser, _("missing closing quote or double-quote before end-of-line") );
|
||||||
|
return False;
|
||||||
|
found_end_of_string:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isspace(*parser->rd)) {
|
||||||
|
if (buffer_size-- > 0) *buffer++ = ' ';
|
||||||
|
menu_parser_skip_spaces_and_comments(parser);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
*buffer = *parser->rd++;
|
||||||
|
if (buffer_size-- > 0) buffer++;
|
||||||
|
}
|
||||||
|
*buffer = '\0';
|
||||||
|
if (buffer_size-- > 0) buffer++;
|
||||||
|
|
||||||
|
arg++;
|
||||||
|
|
||||||
|
if (*parser->rd == ',') {
|
||||||
|
parser->rd++;
|
||||||
|
if (arg >= macro->arg_count) {
|
||||||
|
WMenuParserError(parser, _("too many arguments for macro \"%s\", expected only %d"),
|
||||||
|
macro->name, macro->arg_count);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (*parser->rd != ')') {
|
||||||
|
WMenuParserError(parser, _("premature end of line while searching for arguments to macro \"%s\""),
|
||||||
|
macro->name);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
parser->rd++;
|
||||||
|
if (arg < macro->arg_count) {
|
||||||
|
WMenuParserError(parser, _("not enough arguments for macro \"%s\", expected %d but got only %d"),
|
||||||
|
macro->name, macro->arg_count, arg);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
if (buffer_size < 0)
|
||||||
|
WMenuParserError(parser, _("too much data in parameter list of macro \"%s\", truncated"),
|
||||||
|
macro->name);
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Definition of pre-defined macros */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
void WMenuParserRegisterSimpleMacro(WMenuParser parser, const char *name, const char *value)
|
||||||
|
{
|
||||||
|
WParserMacro *macro;
|
||||||
|
size_t len;
|
||||||
|
unsigned char *wr;
|
||||||
|
|
||||||
|
macro = wmalloc(sizeof(*macro));
|
||||||
|
strncpy(macro->name, name, sizeof(macro->name)-1);
|
||||||
|
macro->arg_count = -1;
|
||||||
|
len = strlen(value);
|
||||||
|
if (len > sizeof(macro->value) - 3) {
|
||||||
|
wwarning(_("size of value for macro '%s' is too big, truncated"), name);
|
||||||
|
len = sizeof(macro->value) - 3;
|
||||||
|
}
|
||||||
|
macro->value[0] = (len >> 8) & 0xFF;
|
||||||
|
macro->value[1] = len & 0xFF;
|
||||||
|
wr = ¯o->value[2];
|
||||||
|
while (len-- > 0)
|
||||||
|
*wr++ = *value++;
|
||||||
|
*wr = 0xFF;
|
||||||
|
macro->next = parser->macros;
|
||||||
|
parser->macros = macro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Name of the originally loaded file (before #includes) */
|
||||||
|
static void mpm_base_file(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
unsigned char *src, *dst;
|
||||||
|
|
||||||
|
if (this->value[0] != '\0') return; // Value already evaluated, re-use previous
|
||||||
|
|
||||||
|
while (parser->parent_file != NULL)
|
||||||
|
parser = parser->parent_file;
|
||||||
|
|
||||||
|
dst = this->value;
|
||||||
|
src = (unsigned char *) parser->file_name;
|
||||||
|
*dst++ = '\"';
|
||||||
|
while (*src != '\0')
|
||||||
|
if (dst < this->value + sizeof(this->value) - 2)
|
||||||
|
*dst++ = *src++;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
*dst++ = '\"';
|
||||||
|
*dst = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Number of #include currently nested */
|
||||||
|
static void mpm_include_level(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
int level = 0;
|
||||||
|
while (parser->parent_file != NULL) {
|
||||||
|
parser = parser->parent_file;
|
||||||
|
level++;
|
||||||
|
}
|
||||||
|
snprintf((char *) this->value, sizeof(this->value), "%d", level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Name of current file */
|
||||||
|
static void mpm_current_file(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
unsigned char *src, *dst;
|
||||||
|
|
||||||
|
dst = this->value;
|
||||||
|
src = (unsigned char *) parser->file_name;
|
||||||
|
*dst++ = '\"';
|
||||||
|
while (*src != '\0')
|
||||||
|
if (dst < this->value + sizeof(this->value) - 2)
|
||||||
|
*dst++ = *src++;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
*dst++ = '\"';
|
||||||
|
*dst = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Number of current line */
|
||||||
|
static void mpm_current_line(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
snprintf((char *) this->value, sizeof(this->value), "%d", parser->line_number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Name of host on which we are running, not necessarily displaying */
|
||||||
|
static void mpm_get_hostname(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
char *h;
|
||||||
|
|
||||||
|
if (this->value[0] != '\0') return; // Value already evaluated, re-use previous
|
||||||
|
|
||||||
|
h = getenv("HOSTNAME");
|
||||||
|
if (h == NULL) {
|
||||||
|
h = getenv("HOST");
|
||||||
|
if (h == NULL) {
|
||||||
|
if (gethostname((char *) this->value, sizeof(this->value) ) != 0) {
|
||||||
|
WMenuParserError(parser, _("could not determine %s"), "HOSTNAME");
|
||||||
|
this->value[0] = '?';
|
||||||
|
this->value[1] = '?';
|
||||||
|
this->value[2] = '?';
|
||||||
|
this->value[3] = '\0';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wstrlcpy((char *) this->value, h, sizeof(this->value) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Name of the current user */
|
||||||
|
static void mpm_get_user_name(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
char *user;
|
||||||
|
|
||||||
|
if (this->value[0] != '\0') return; // Value already evaluated, re-use previous
|
||||||
|
|
||||||
|
user = getlogin();
|
||||||
|
if (user == NULL) {
|
||||||
|
struct passwd *pw_user;
|
||||||
|
|
||||||
|
pw_user = getpwuid(getuid());
|
||||||
|
if (pw_user == NULL) {
|
||||||
|
error_no_username:
|
||||||
|
WMenuParserError(parser, _("could not determine %s"), "USER" );
|
||||||
|
/* Fall back on numeric id - better than nothing */
|
||||||
|
snprintf((char *) this->value, sizeof(this->value), "%d", getuid() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
user = pw_user->pw_name;
|
||||||
|
if (user == NULL) goto error_no_username;
|
||||||
|
}
|
||||||
|
wstrlcpy((char *) this->value, user, sizeof(this->value) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Number id of the user under which we are running */
|
||||||
|
static void mpm_get_user_id(WParserMacro *this, WMenuParser parser)
|
||||||
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) parser;
|
||||||
|
|
||||||
|
if (this->value[0] != '\0') return; // Already evaluated, re-use previous
|
||||||
|
snprintf((char *) this->value, sizeof(this->value), "%d", getuid() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Small helper to automate creation of one pre-defined macro in the parser */
|
||||||
|
static void w_create_macro(WMenuParser parser, const char *name, WParserMacroFunction *handler)
|
||||||
|
{
|
||||||
|
WParserMacro *macro;
|
||||||
|
|
||||||
|
macro = wmalloc(sizeof(*macro));
|
||||||
|
strcpy(macro->name, name);
|
||||||
|
macro->function = handler;
|
||||||
|
macro->arg_count = -1;
|
||||||
|
macro->next = parser->macros;
|
||||||
|
parser->macros = macro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Register all the pre-defined macros in the parser *****/
|
||||||
|
void menu_parser_register_preset_macros(WMenuParser parser)
|
||||||
|
{
|
||||||
|
/* Defined by CPP: common predefined macros (GNU C extension) */
|
||||||
|
w_create_macro(parser, "__BASE_FILE__", mpm_base_file);
|
||||||
|
w_create_macro(parser, "__INCLUDE_LEVEL__", mpm_include_level);
|
||||||
|
|
||||||
|
/* Defined by CPP: standard predefined macros */
|
||||||
|
w_create_macro(parser, "__FILE__", mpm_current_file);
|
||||||
|
w_create_macro(parser, "__LINE__", mpm_current_line);
|
||||||
|
// w_create_macro(parser, "__DATE__", NULL); [will be implemented only per user request]
|
||||||
|
// w_create_macro(parser, "__TIME__", NULL); [will be implemented only per user request]
|
||||||
|
|
||||||
|
/* Historically defined by WindowMaker */
|
||||||
|
w_create_macro(parser, "HOST", mpm_get_hostname);
|
||||||
|
w_create_macro(parser, "UID", mpm_get_user_id);
|
||||||
|
w_create_macro(parser, "USER", mpm_get_user_name);
|
||||||
|
}
|
||||||
43
WINGs/misc.c
43
WINGs/misc.c
@@ -1,18 +1,45 @@
|
|||||||
|
/* WUtil / misc.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2001 Dan Pascu
|
||||||
|
* Copyright (c) 2014 Window Maker Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
/* Miscelaneous helper functions */
|
/* Miscelaneous helper functions */
|
||||||
|
|
||||||
#include "WINGsP.h"
|
#include <WUtil.h>
|
||||||
|
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
WMRange
|
WMRange wmkrange(int start, int count)
|
||||||
wmkrange(int start, int count)
|
|
||||||
{
|
{
|
||||||
WMRange range;
|
WMRange range;
|
||||||
|
|
||||||
range.position = start;
|
range.position = start;
|
||||||
range.count = count;
|
range.count = count;
|
||||||
|
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wutil_shutdown - cleanup in WUtil when user program wants to exit
|
||||||
|
*/
|
||||||
|
void wutil_shutdown(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_SYSLOG
|
||||||
|
w_syslog_close();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,539 +5,478 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
#include "WINGsP.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_Notification {
|
typedef struct W_Notification {
|
||||||
const char *name;
|
const char *name;
|
||||||
void *object;
|
void *object;
|
||||||
void *clientData;
|
void *clientData;
|
||||||
int refCount;
|
int refCount;
|
||||||
} Notification;
|
} Notification;
|
||||||
|
|
||||||
|
|
||||||
extern void W_FlushASAPNotificationQueue();
|
const char *WMGetNotificationName(WMNotification * notification)
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
WMGetNotificationName(WMNotification *notification)
|
|
||||||
{
|
{
|
||||||
return notification->name;
|
return notification->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMGetNotificationObject(WMNotification * notification)
|
||||||
void*
|
|
||||||
WMGetNotificationObject(WMNotification *notification)
|
|
||||||
{
|
{
|
||||||
return notification->object;
|
return notification->object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *WMGetNotificationClientData(WMNotification * notification)
|
||||||
void*
|
|
||||||
WMGetNotificationClientData(WMNotification *notification)
|
|
||||||
{
|
{
|
||||||
return notification->clientData;
|
return notification->clientData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMNotification *WMCreateNotification(const char *name, void *object, void *clientData)
|
||||||
WMNotification*
|
|
||||||
WMCreateNotification(const char *name, void *object, void *clientData)
|
|
||||||
{
|
{
|
||||||
Notification *nPtr;
|
Notification *nPtr;
|
||||||
|
|
||||||
nPtr = wmalloc(sizeof(Notification));
|
nPtr = wmalloc(sizeof(Notification));
|
||||||
|
nPtr->name = name;
|
||||||
|
nPtr->object = object;
|
||||||
|
nPtr->clientData = clientData;
|
||||||
|
nPtr->refCount = 1;
|
||||||
|
|
||||||
nPtr->name = name;
|
return nPtr;
|
||||||
nPtr->object = object;
|
|
||||||
nPtr->clientData = clientData;
|
|
||||||
|
|
||||||
nPtr->refCount = 1;
|
|
||||||
|
|
||||||
return nPtr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMReleaseNotification(WMNotification * notification)
|
||||||
void
|
|
||||||
WMReleaseNotification(WMNotification *notification)
|
|
||||||
{
|
{
|
||||||
notification->refCount--;
|
notification->refCount--;
|
||||||
|
|
||||||
if (notification->refCount < 1) {
|
if (notification->refCount < 1) {
|
||||||
wfree(notification);
|
wfree(notification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMNotification *WMRetainNotification(WMNotification * notification)
|
||||||
WMNotification*
|
|
||||||
WMRetainNotification(WMNotification *notification)
|
|
||||||
{
|
{
|
||||||
notification->refCount++;
|
notification->refCount++;
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************** Notification Center *****************/
|
/***************** Notification Center *****************/
|
||||||
|
|
||||||
typedef struct NotificationObserver {
|
typedef struct NotificationObserver {
|
||||||
WMNotificationObserverAction *observerAction;
|
WMNotificationObserverAction *observerAction;
|
||||||
void *observer;
|
void *observer;
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
void *object;
|
void *object;
|
||||||
|
|
||||||
struct NotificationObserver *prev; /* for tables */
|
struct NotificationObserver *prev; /* for tables */
|
||||||
struct NotificationObserver *next;
|
struct NotificationObserver *next;
|
||||||
struct NotificationObserver *nextAction; /* for observerTable */
|
struct NotificationObserver *nextAction; /* for observerTable */
|
||||||
} NotificationObserver;
|
} NotificationObserver;
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_NotificationCenter {
|
typedef struct W_NotificationCenter {
|
||||||
WMHashTable *nameTable; /* names -> observer lists */
|
WMHashTable *nameTable; /* names -> observer lists */
|
||||||
WMHashTable *objectTable; /* object -> observer lists */
|
WMHashTable *objectTable; /* object -> observer lists */
|
||||||
NotificationObserver *nilList; /* obervers that catch everything */
|
NotificationObserver *nilList; /* obervers that catch everything */
|
||||||
|
|
||||||
WMHashTable *observerTable; /* observer -> NotificationObserver */
|
WMHashTable *observerTable; /* observer -> NotificationObserver */
|
||||||
} NotificationCenter;
|
} NotificationCenter;
|
||||||
|
|
||||||
|
|
||||||
/* default (and only) center */
|
/* default (and only) center */
|
||||||
static NotificationCenter *notificationCenter = NULL;
|
static NotificationCenter *notificationCenter = NULL;
|
||||||
|
|
||||||
|
void W_InitNotificationCenter(void)
|
||||||
void
|
|
||||||
W_InitNotificationCenter(void)
|
|
||||||
{
|
{
|
||||||
notificationCenter = wmalloc(sizeof(NotificationCenter));
|
notificationCenter = wmalloc(sizeof(NotificationCenter));
|
||||||
|
notificationCenter->nameTable = WMCreateHashTable(WMStringPointerHashCallbacks);
|
||||||
notificationCenter->nameTable = WMCreateHashTable(WMStringPointerHashCallbacks);
|
notificationCenter->objectTable = WMCreateHashTable(WMIntHashCallbacks);
|
||||||
notificationCenter->objectTable = WMCreateHashTable(WMIntHashCallbacks);
|
notificationCenter->nilList = NULL;
|
||||||
notificationCenter->nilList = NULL;
|
notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks);
|
||||||
|
|
||||||
notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_ReleaseNotificationCenter(void)
|
||||||
void
|
|
||||||
WMAddNotificationObserver(WMNotificationObserverAction *observerAction,
|
|
||||||
void *observer, const char *name, void *object)
|
|
||||||
{
|
{
|
||||||
NotificationObserver *oRec, *rec;
|
if (notificationCenter) {
|
||||||
|
if (notificationCenter->nameTable)
|
||||||
|
WMFreeHashTable(notificationCenter->nameTable);
|
||||||
|
if (notificationCenter->objectTable)
|
||||||
|
WMFreeHashTable(notificationCenter->objectTable);
|
||||||
|
if (notificationCenter->observerTable)
|
||||||
|
WMFreeHashTable(notificationCenter->observerTable);
|
||||||
|
|
||||||
oRec = wmalloc(sizeof(NotificationObserver));
|
wfree(notificationCenter);
|
||||||
oRec->observerAction = observerAction;
|
notificationCenter = NULL;
|
||||||
oRec->observer = observer;
|
}
|
||||||
oRec->name = name;
|
|
||||||
oRec->object = object;
|
|
||||||
oRec->next = NULL;
|
|
||||||
oRec->prev = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
/* put this action in the list of actions for this observer */
|
|
||||||
rec = (NotificationObserver*)WMHashInsert(notificationCenter->observerTable,
|
|
||||||
observer, oRec);
|
|
||||||
|
|
||||||
if (rec) {
|
|
||||||
/* if this is not the first action for the observer */
|
|
||||||
oRec->nextAction = rec;
|
|
||||||
} else {
|
|
||||||
oRec->nextAction = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!name && !object) {
|
|
||||||
/* catch-all */
|
|
||||||
oRec->next = notificationCenter->nilList;
|
|
||||||
if (notificationCenter->nilList) {
|
|
||||||
notificationCenter->nilList->prev = oRec;
|
|
||||||
}
|
|
||||||
notificationCenter->nilList = oRec;
|
|
||||||
} else if (!name) {
|
|
||||||
/* any message coming from object */
|
|
||||||
rec = (NotificationObserver*)WMHashInsert(notificationCenter->objectTable,
|
|
||||||
object, oRec);
|
|
||||||
oRec->next = rec;
|
|
||||||
if (rec) {
|
|
||||||
rec->prev = oRec;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* name && (object || !object) */
|
|
||||||
rec = (NotificationObserver*)WMHashInsert(notificationCenter->nameTable,
|
|
||||||
name, oRec);
|
|
||||||
oRec->next = rec;
|
|
||||||
if (rec) {
|
|
||||||
rec->prev = oRec;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMPostNotification(WMNotification *notification)
|
WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
|
||||||
|
void *observer, const char *name, void *object)
|
||||||
{
|
{
|
||||||
NotificationObserver *orec, *tmp;
|
NotificationObserver *oRec, *rec;
|
||||||
|
|
||||||
WMRetainNotification(notification);
|
oRec = wmalloc(sizeof(NotificationObserver));
|
||||||
|
oRec->observerAction = observerAction;
|
||||||
|
oRec->observer = observer;
|
||||||
|
oRec->name = name;
|
||||||
|
oRec->object = object;
|
||||||
|
oRec->next = NULL;
|
||||||
|
oRec->prev = NULL;
|
||||||
|
|
||||||
/* tell the observers that want to know about a particular message */
|
/* put this action in the list of actions for this observer */
|
||||||
orec = (NotificationObserver*)WMHashGet(notificationCenter->nameTable,
|
rec = (NotificationObserver *) WMHashInsert(notificationCenter->observerTable, observer, oRec);
|
||||||
notification->name);
|
|
||||||
|
|
||||||
while (orec) {
|
if (rec) {
|
||||||
tmp = orec->next;
|
/* if this is not the first action for the observer */
|
||||||
|
oRec->nextAction = rec;
|
||||||
|
} else {
|
||||||
|
oRec->nextAction = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!orec->object || !notification->object
|
if (!name && !object) {
|
||||||
|| orec->object == notification->object) {
|
/* catch-all */
|
||||||
/* tell the observer */
|
oRec->next = notificationCenter->nilList;
|
||||||
if (orec->observerAction) {
|
if (notificationCenter->nilList) {
|
||||||
(*orec->observerAction)(orec->observer, notification);
|
notificationCenter->nilList->prev = oRec;
|
||||||
}
|
}
|
||||||
}
|
notificationCenter->nilList = oRec;
|
||||||
|
} else if (!name) {
|
||||||
orec = tmp;
|
/* any message coming from object */
|
||||||
}
|
rec = (NotificationObserver *) WMHashInsert(notificationCenter->objectTable, object, oRec);
|
||||||
|
oRec->next = rec;
|
||||||
/* tell the observers that want to know about an object */
|
if (rec) {
|
||||||
orec = (NotificationObserver*)WMHashGet(notificationCenter->objectTable,
|
rec->prev = oRec;
|
||||||
notification->object);
|
}
|
||||||
|
} else {
|
||||||
while (orec) {
|
/* name && (object || !object) */
|
||||||
tmp = orec->next;
|
rec = (NotificationObserver *) WMHashInsert(notificationCenter->nameTable, name, oRec);
|
||||||
|
oRec->next = rec;
|
||||||
/* tell the observer */
|
if (rec) {
|
||||||
if (orec->observerAction) {
|
rec->prev = oRec;
|
||||||
(*orec->observerAction)(orec->observer, notification);
|
}
|
||||||
}
|
}
|
||||||
orec = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tell the catch all observers */
|
|
||||||
orec = notificationCenter->nilList;
|
|
||||||
while (orec) {
|
|
||||||
tmp = orec->next;
|
|
||||||
|
|
||||||
/* tell the observer */
|
|
||||||
if (orec->observerAction) {
|
|
||||||
(*orec->observerAction)(orec->observer, notification);
|
|
||||||
}
|
|
||||||
orec = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
WMReleaseNotification(notification);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMPostNotification(WMNotification * notification)
|
||||||
void
|
|
||||||
WMRemoveNotificationObserver(void *observer)
|
|
||||||
{
|
{
|
||||||
NotificationObserver *orec, *tmp, *rec;
|
NotificationObserver *orec, *tmp;
|
||||||
|
|
||||||
/* get the list of actions the observer is doing */
|
WMRetainNotification(notification);
|
||||||
orec = (NotificationObserver*)WMHashGet(notificationCenter->observerTable,
|
|
||||||
observer);
|
|
||||||
|
|
||||||
/*
|
/* tell the observers that want to know about a particular message */
|
||||||
* FOREACH orec IN actionlist for observer
|
orec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, notification->name);
|
||||||
* DO
|
|
||||||
* remove from respective lists/tables
|
|
||||||
* free
|
|
||||||
* END
|
|
||||||
*/
|
|
||||||
while (orec) {
|
|
||||||
tmp = orec->nextAction;
|
|
||||||
|
|
||||||
if (!orec->name && !orec->object) {
|
while (orec) {
|
||||||
/* catch-all */
|
tmp = orec->next;
|
||||||
if (notificationCenter->nilList==orec)
|
|
||||||
notificationCenter->nilList = orec->next;
|
|
||||||
} else if (!orec->name) {
|
|
||||||
/* any message coming from object */
|
|
||||||
rec = (NotificationObserver*)WMHashGet(notificationCenter->objectTable,
|
|
||||||
orec->object);
|
|
||||||
if (rec==orec) {
|
|
||||||
/* replace table entry */
|
|
||||||
if (orec->next) {
|
|
||||||
WMHashInsert(notificationCenter->objectTable, orec->object,
|
|
||||||
orec->next);
|
|
||||||
} else {
|
|
||||||
WMHashRemove(notificationCenter->objectTable, orec->object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* name && (object || !object) */
|
|
||||||
rec = (NotificationObserver*)WMHashGet(notificationCenter->nameTable,
|
|
||||||
orec->name);
|
|
||||||
if (rec==orec) {
|
|
||||||
/* replace table entry */
|
|
||||||
if (orec->next) {
|
|
||||||
WMHashInsert(notificationCenter->nameTable, orec->name,
|
|
||||||
orec->next);
|
|
||||||
} else {
|
|
||||||
WMHashRemove(notificationCenter->nameTable, orec->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (orec->prev)
|
|
||||||
orec->prev->next = orec->next;
|
|
||||||
if (orec->next)
|
|
||||||
orec->next->prev = orec->prev;
|
|
||||||
|
|
||||||
wfree(orec);
|
if (!orec->object || !notification->object || orec->object == notification->object) {
|
||||||
|
/* tell the observer */
|
||||||
|
if (orec->observerAction) {
|
||||||
|
(*orec->observerAction) (orec->observer, notification);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
orec = tmp;
|
orec = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMHashRemove(notificationCenter->observerTable, observer);
|
/* tell the observers that want to know about an object */
|
||||||
|
orec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, notification->object);
|
||||||
|
|
||||||
|
while (orec) {
|
||||||
|
tmp = orec->next;
|
||||||
|
|
||||||
|
/* tell the observer */
|
||||||
|
if (orec->observerAction) {
|
||||||
|
(*orec->observerAction) (orec->observer, notification);
|
||||||
|
}
|
||||||
|
orec = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* tell the catch all observers */
|
||||||
|
orec = notificationCenter->nilList;
|
||||||
|
while (orec) {
|
||||||
|
tmp = orec->next;
|
||||||
|
|
||||||
|
/* tell the observer */
|
||||||
|
if (orec->observerAction) {
|
||||||
|
(*orec->observerAction) (orec->observer, notification);
|
||||||
|
}
|
||||||
|
orec = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
WMReleaseNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMRemoveNotificationObserver(void *observer)
|
||||||
void
|
|
||||||
WMRemoveNotificationObserverWithName(void *observer, const char *name, void *object)
|
|
||||||
{
|
{
|
||||||
NotificationObserver *orec, *tmp, *rec;
|
NotificationObserver *orec, *tmp, *rec;
|
||||||
NotificationObserver *newList = NULL;
|
|
||||||
|
|
||||||
/* get the list of actions the observer is doing */
|
/* get the list of actions the observer is doing */
|
||||||
orec = (NotificationObserver*)WMHashGet(notificationCenter->observerTable, observer);
|
orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer);
|
||||||
|
|
||||||
WMHashRemove(notificationCenter->observerTable, observer);
|
/*
|
||||||
|
* FOREACH orec IN actionlist for observer
|
||||||
|
* DO
|
||||||
|
* remove from respective lists/tables
|
||||||
|
* free
|
||||||
|
* END
|
||||||
|
*/
|
||||||
|
while (orec) {
|
||||||
|
tmp = orec->nextAction;
|
||||||
|
|
||||||
/* rebuild the list of actions for the observer */
|
if (!orec->name && !orec->object) {
|
||||||
|
/* catch-all */
|
||||||
|
if (notificationCenter->nilList == orec)
|
||||||
|
notificationCenter->nilList = orec->next;
|
||||||
|
} else if (!orec->name) {
|
||||||
|
/* any message coming from object */
|
||||||
|
rec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, orec->object);
|
||||||
|
if (rec == orec) {
|
||||||
|
/* replace table entry */
|
||||||
|
if (orec->next) {
|
||||||
|
WMHashInsert(notificationCenter->objectTable, orec->object, orec->next);
|
||||||
|
} else {
|
||||||
|
WMHashRemove(notificationCenter->objectTable, orec->object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* name && (object || !object) */
|
||||||
|
rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, orec->name);
|
||||||
|
if (rec == orec) {
|
||||||
|
/* replace table entry */
|
||||||
|
if (orec->next) {
|
||||||
|
WMHashInsert(notificationCenter->nameTable, orec->name, orec->next);
|
||||||
|
} else {
|
||||||
|
WMHashRemove(notificationCenter->nameTable, orec->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (orec->prev)
|
||||||
|
orec->prev->next = orec->next;
|
||||||
|
if (orec->next)
|
||||||
|
orec->next->prev = orec->prev;
|
||||||
|
|
||||||
while (orec) {
|
wfree(orec);
|
||||||
tmp = orec->nextAction;
|
|
||||||
if (orec->name == name && orec->object == object) {
|
|
||||||
if (!name && !object) {
|
|
||||||
if (notificationCenter->nilList == orec)
|
|
||||||
notificationCenter->nilList = orec->next;
|
|
||||||
} else if (!name) {
|
|
||||||
rec = (NotificationObserver*)WMHashGet(notificationCenter->objectTable, orec->object);
|
|
||||||
if (rec==orec) {
|
|
||||||
assert(rec->prev==NULL);
|
|
||||||
/* replace table entry */
|
|
||||||
if (orec->next) {
|
|
||||||
WMHashInsert(notificationCenter->objectTable,
|
|
||||||
orec->object, orec->next);
|
|
||||||
} else {
|
|
||||||
WMHashRemove(notificationCenter->objectTable,
|
|
||||||
orec->object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rec = (NotificationObserver*)WMHashGet(notificationCenter->nameTable,
|
|
||||||
orec->name);
|
|
||||||
if (rec==orec) {
|
|
||||||
assert(rec->prev==NULL);
|
|
||||||
/* replace table entry */
|
|
||||||
if (orec->next) {
|
|
||||||
WMHashInsert(notificationCenter->nameTable,
|
|
||||||
orec->name, orec->next);
|
|
||||||
} else {
|
|
||||||
WMHashRemove(notificationCenter->nameTable,
|
|
||||||
orec->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (orec->prev)
|
orec = tmp;
|
||||||
orec->prev->next = orec->next;
|
}
|
||||||
if (orec->next)
|
|
||||||
orec->next->prev = orec->prev;
|
|
||||||
wfree(orec);
|
|
||||||
} else {
|
|
||||||
/* append this action in the new action list */
|
|
||||||
orec->nextAction = NULL;
|
|
||||||
if (!newList) {
|
|
||||||
newList = orec;
|
|
||||||
} else {
|
|
||||||
NotificationObserver *p;
|
|
||||||
|
|
||||||
p = newList;
|
WMHashRemove(notificationCenter->observerTable, observer);
|
||||||
while (p->nextAction) {
|
|
||||||
p = p->nextAction;
|
|
||||||
}
|
|
||||||
p->nextAction = orec;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
orec = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* reinsert the list to the table */
|
|
||||||
if (newList) {
|
|
||||||
WMHashInsert(notificationCenter->observerTable, observer, newList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMRemoveNotificationObserverWithName(void *observer, const char *name, void *object)
|
||||||
void
|
|
||||||
WMPostNotificationName(const char *name, void *object, void *clientData)
|
|
||||||
{
|
{
|
||||||
WMNotification *notification;
|
NotificationObserver *orec, *tmp, *rec;
|
||||||
|
NotificationObserver *newList = NULL;
|
||||||
|
|
||||||
notification = WMCreateNotification(name, object, clientData);
|
/* get the list of actions the observer is doing */
|
||||||
|
orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer);
|
||||||
|
|
||||||
WMPostNotification(notification);
|
WMHashRemove(notificationCenter->observerTable, observer);
|
||||||
|
|
||||||
WMReleaseNotification(notification);
|
/* rebuild the list of actions for the observer */
|
||||||
|
|
||||||
|
while (orec) {
|
||||||
|
tmp = orec->nextAction;
|
||||||
|
if (orec->name == name && orec->object == object) {
|
||||||
|
if (!name && !object) {
|
||||||
|
if (notificationCenter->nilList == orec)
|
||||||
|
notificationCenter->nilList = orec->next;
|
||||||
|
} else if (!name) {
|
||||||
|
rec =
|
||||||
|
(NotificationObserver *) WMHashGet(notificationCenter->objectTable,
|
||||||
|
orec->object);
|
||||||
|
if (rec == orec) {
|
||||||
|
assert(rec->prev == NULL);
|
||||||
|
/* replace table entry */
|
||||||
|
if (orec->next) {
|
||||||
|
WMHashInsert(notificationCenter->objectTable,
|
||||||
|
orec->object, orec->next);
|
||||||
|
} else {
|
||||||
|
WMHashRemove(notificationCenter->objectTable, orec->object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable,
|
||||||
|
orec->name);
|
||||||
|
if (rec == orec) {
|
||||||
|
assert(rec->prev == NULL);
|
||||||
|
/* replace table entry */
|
||||||
|
if (orec->next) {
|
||||||
|
WMHashInsert(notificationCenter->nameTable,
|
||||||
|
orec->name, orec->next);
|
||||||
|
} else {
|
||||||
|
WMHashRemove(notificationCenter->nameTable, orec->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orec->prev)
|
||||||
|
orec->prev->next = orec->next;
|
||||||
|
if (orec->next)
|
||||||
|
orec->next->prev = orec->prev;
|
||||||
|
wfree(orec);
|
||||||
|
} else {
|
||||||
|
/* append this action in the new action list */
|
||||||
|
orec->nextAction = NULL;
|
||||||
|
if (!newList) {
|
||||||
|
newList = orec;
|
||||||
|
} else {
|
||||||
|
NotificationObserver *p;
|
||||||
|
|
||||||
|
p = newList;
|
||||||
|
while (p->nextAction) {
|
||||||
|
p = p->nextAction;
|
||||||
|
}
|
||||||
|
p->nextAction = orec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orec = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reinsert the list to the table */
|
||||||
|
if (newList) {
|
||||||
|
WMHashInsert(notificationCenter->observerTable, observer, newList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMPostNotificationName(const char *name, void *object, void *clientData)
|
||||||
|
{
|
||||||
|
WMNotification *notification;
|
||||||
|
|
||||||
|
notification = WMCreateNotification(name, object, clientData);
|
||||||
|
|
||||||
|
WMPostNotification(notification);
|
||||||
|
|
||||||
|
WMReleaseNotification(notification);
|
||||||
|
}
|
||||||
|
|
||||||
/**************** Notification Queues ****************/
|
/**************** Notification Queues ****************/
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_NotificationQueue {
|
typedef struct W_NotificationQueue {
|
||||||
WMArray *asapQueue;
|
WMArray *asapQueue;
|
||||||
WMArray *idleQueue;
|
WMArray *idleQueue;
|
||||||
|
|
||||||
struct W_NotificationQueue *next;
|
struct W_NotificationQueue *next;
|
||||||
} NotificationQueue;
|
} NotificationQueue;
|
||||||
|
|
||||||
|
|
||||||
static WMNotificationQueue *notificationQueueList = NULL;
|
static WMNotificationQueue *notificationQueueList = NULL;
|
||||||
|
|
||||||
/* default queue */
|
/* default queue */
|
||||||
static WMNotificationQueue *notificationQueue = NULL;
|
static WMNotificationQueue *notificationQueue = NULL;
|
||||||
|
|
||||||
|
WMNotificationQueue *WMGetDefaultNotificationQueue(void)
|
||||||
WMNotificationQueue*
|
|
||||||
WMGetDefaultNotificationQueue(void)
|
|
||||||
{
|
{
|
||||||
if (!notificationQueue)
|
if (!notificationQueue)
|
||||||
notificationQueue = WMCreateNotificationQueue();
|
notificationQueue = WMCreateNotificationQueue();
|
||||||
|
|
||||||
return notificationQueue;
|
return notificationQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMNotificationQueue *WMCreateNotificationQueue(void)
|
||||||
WMNotificationQueue*
|
|
||||||
WMCreateNotificationQueue(void)
|
|
||||||
{
|
{
|
||||||
NotificationQueue *queue;
|
NotificationQueue *queue;
|
||||||
|
|
||||||
queue = wmalloc(sizeof(NotificationQueue));
|
queue = wmalloc(sizeof(NotificationQueue));
|
||||||
|
queue->asapQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
|
||||||
|
queue->idleQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
|
||||||
|
queue->next = notificationQueueList;
|
||||||
|
|
||||||
queue->asapQueue =
|
notificationQueueList = queue;
|
||||||
WMCreateArrayWithDestructor(8, (WMFreeDataProc*)WMReleaseNotification);
|
|
||||||
queue->idleQueue =
|
|
||||||
WMCreateArrayWithDestructor(8, (WMFreeDataProc*)WMReleaseNotification);
|
|
||||||
queue->next = notificationQueueList;
|
|
||||||
|
|
||||||
notificationQueueList = queue;
|
return queue;
|
||||||
|
|
||||||
return queue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMEnqueueNotification(WMNotificationQueue * queue, WMNotification * notification, WMPostingStyle postingStyle)
|
||||||
|
|
||||||
void
|
|
||||||
WMEnqueueNotification(WMNotificationQueue *queue, WMNotification *notification,
|
|
||||||
WMPostingStyle postingStyle)
|
|
||||||
{
|
{
|
||||||
WMEnqueueCoalesceNotification(queue, notification, postingStyle,
|
WMEnqueueCoalesceNotification(queue, notification, postingStyle, WNCOnName | WNCOnSender);
|
||||||
WNCOnName|WNCOnSender);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define NOTIF ((WMNotification*)cdata)
|
#define NOTIF ((WMNotification*)cdata)
|
||||||
#define ITEM ((WMNotification*)item)
|
#define ITEM ((WMNotification*)item)
|
||||||
|
|
||||||
static int
|
static int matchSenderAndName(const void *item, const void *cdata)
|
||||||
matchSenderAndName(void *item, void *cdata)
|
|
||||||
{
|
{
|
||||||
return (NOTIF->object==ITEM->object && strcmp(NOTIF->name, ITEM->name)==0);
|
return (NOTIF->object == ITEM->object && strcmp(NOTIF->name, ITEM->name) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int matchSender(const void *item, const void *cdata)
|
||||||
static int
|
|
||||||
matchSender(void *item, void *cdata)
|
|
||||||
{
|
{
|
||||||
return (NOTIF->object == ITEM->object);
|
return (NOTIF->object == ITEM->object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int matchName(const void *item, const void *cdata)
|
||||||
static int
|
|
||||||
matchName(void *item, void *cdata)
|
|
||||||
{
|
{
|
||||||
return (strcmp(NOTIF->name, ITEM->name)==0);
|
return (strcmp(NOTIF->name, ITEM->name) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef NOTIF
|
#undef NOTIF
|
||||||
#undef ITEM
|
#undef ITEM
|
||||||
|
|
||||||
|
void WMDequeueNotificationMatching(WMNotificationQueue * queue, WMNotification * notification, unsigned mask)
|
||||||
void
|
|
||||||
WMDequeueNotificationMatching(WMNotificationQueue *queue,
|
|
||||||
WMNotification *notification, unsigned mask)
|
|
||||||
{
|
{
|
||||||
WMMatchDataProc *matchFunc;
|
WMMatchDataProc *matchFunc;
|
||||||
|
|
||||||
if ((mask & WNCOnName) && (mask & WNCOnSender))
|
if ((mask & WNCOnName) && (mask & WNCOnSender))
|
||||||
matchFunc = matchSenderAndName;
|
matchFunc = matchSenderAndName;
|
||||||
else if (mask & WNCOnName)
|
else if (mask & WNCOnName)
|
||||||
matchFunc = matchName;
|
matchFunc = matchName;
|
||||||
else if (mask & WNCOnSender)
|
else if (mask & WNCOnSender)
|
||||||
matchFunc = matchSender;
|
matchFunc = matchSender;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WMRemoveFromArrayMatching(queue->asapQueue, matchFunc, notification);
|
WMRemoveFromArrayMatching(queue->asapQueue, matchFunc, notification);
|
||||||
WMRemoveFromArrayMatching(queue->idleQueue, matchFunc, notification);
|
WMRemoveFromArrayMatching(queue->idleQueue, matchFunc, notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
|
WMEnqueueCoalesceNotification(WMNotificationQueue * queue,
|
||||||
WMNotification *notification,
|
WMNotification * notification, WMPostingStyle postingStyle, unsigned coalesceMask)
|
||||||
WMPostingStyle postingStyle,
|
|
||||||
unsigned coalesceMask)
|
|
||||||
{
|
{
|
||||||
if (coalesceMask != WNCNone)
|
if (coalesceMask != WNCNone)
|
||||||
WMDequeueNotificationMatching(queue, notification, coalesceMask);
|
WMDequeueNotificationMatching(queue, notification, coalesceMask);
|
||||||
|
|
||||||
switch (postingStyle) {
|
switch (postingStyle) {
|
||||||
case WMPostNow:
|
case WMPostNow:
|
||||||
WMPostNotification(notification);
|
WMPostNotification(notification);
|
||||||
WMReleaseNotification(notification);
|
WMReleaseNotification(notification);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WMPostASAP:
|
case WMPostASAP:
|
||||||
WMAddToArray(queue->asapQueue, notification);
|
WMAddToArray(queue->asapQueue, notification);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WMPostWhenIdle:
|
case WMPostWhenIdle:
|
||||||
WMAddToArray(queue->idleQueue, notification);
|
WMAddToArray(queue->idleQueue, notification);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_FlushASAPNotificationQueue(void)
|
||||||
void
|
|
||||||
W_FlushASAPNotificationQueue()
|
|
||||||
{
|
{
|
||||||
WMNotificationQueue *queue = notificationQueueList;
|
WMNotificationQueue *queue = notificationQueueList;
|
||||||
|
|
||||||
while (queue) {
|
while (queue) {
|
||||||
while (WMGetArrayItemCount(queue->asapQueue)) {
|
while (WMGetArrayItemCount(queue->asapQueue)) {
|
||||||
WMPostNotification(WMGetFromArray(queue->asapQueue, 0));
|
WMPostNotification(WMGetFromArray(queue->asapQueue, 0));
|
||||||
WMDeleteFromArray(queue->asapQueue, 0);
|
WMDeleteFromArray(queue->asapQueue, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
queue = queue->next;
|
queue = queue->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void W_FlushIdleNotificationQueue(void)
|
||||||
void
|
|
||||||
W_FlushIdleNotificationQueue()
|
|
||||||
{
|
{
|
||||||
WMNotificationQueue *queue = notificationQueueList;
|
WMNotificationQueue *queue = notificationQueueList;
|
||||||
|
|
||||||
while (queue) {
|
while (queue) {
|
||||||
while (WMGetArrayItemCount(queue->idleQueue)) {
|
while (WMGetArrayItemCount(queue->idleQueue)) {
|
||||||
WMPostNotification(WMGetFromArray(queue->idleQueue, 0));
|
WMPostNotification(WMGetFromArray(queue->idleQueue, 0));
|
||||||
WMDeleteFromArray(queue->idleQueue, 0);
|
WMDeleteFromArray(queue->idleQueue, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
queue = queue->next;
|
queue = queue->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
Makefile Makefile.in
|
|
||||||
.psrc .inslog2 tca.map tca.log pchdir *.rpt
|
|
||||||
*.pot
|
|
||||||
*.mo
|
|
||||||
@@ -4,22 +4,20 @@ CATALOGS = @WINGSMOFILES@
|
|||||||
|
|
||||||
CLEANFILES = $(CATALOGS) WINGs.pot
|
CLEANFILES = $(CATALOGS) WINGs.pot
|
||||||
|
|
||||||
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po sk.po
|
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po hu.po nl.po sk.po
|
||||||
|
|
||||||
POTFILES = \
|
POTFILES = \
|
||||||
$(top_builddir)/WINGs/connection.c \
|
$(top_srcdir)/WINGs/error.c \
|
||||||
$(top_builddir)/WINGs/error.c \
|
$(top_srcdir)/WINGs/findfile.c \
|
||||||
$(top_builddir)/WINGs/findfile.c \
|
$(top_srcdir)/WINGs/proplist.c \
|
||||||
$(top_builddir)/WINGs/host.c \
|
$(top_srcdir)/WINGs/userdefaults.c \
|
||||||
$(top_builddir)/WINGs/proplist.c \
|
$(top_srcdir)/WINGs/wcolor.c \
|
||||||
$(top_builddir)/WINGs/userdefaults.c \
|
$(top_srcdir)/WINGs/wcolorpanel.c \
|
||||||
$(top_builddir)/WINGs/wcolor.c \
|
$(top_srcdir)/WINGs/wfilepanel.c \
|
||||||
$(top_builddir)/WINGs/wcolorpanel.c \
|
$(top_srcdir)/WINGs/wfont.c \
|
||||||
$(top_builddir)/WINGs/wfilepanel.c \
|
$(top_srcdir)/WINGs/wfontpanel.c \
|
||||||
$(top_builddir)/WINGs/wfont.c \
|
$(top_srcdir)/WINGs/widgets.c \
|
||||||
$(top_builddir)/WINGs/wfontpanel.c \
|
$(top_srcdir)/WINGs/wruler.c
|
||||||
$(top_builddir)/WINGs/widgets.c \
|
|
||||||
$(top_builddir)/WINGs/wruler.c
|
|
||||||
|
|
||||||
SUFFIXES = .po .mo
|
SUFFIXES = .po .mo
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ fr.po French Emmanuel Benoit <tseeker@neptune.fr>
|
|||||||
Antoine Hulin <antoine@origan.fdn.org>
|
Antoine Hulin <antoine@origan.fdn.org>
|
||||||
sk.po Slovak Jan 'judas' Tomka <judas@linux.sk>
|
sk.po Slovak Jan 'judas' Tomka <judas@linux.sk>
|
||||||
bg.po Bulgarian Anton Zinoviev <zinoviev@debian.org>
|
bg.po Bulgarian Anton Zinoviev <zinoviev@debian.org>
|
||||||
|
nl.po Dutch Alwin <translations@ziggo.nl>
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|||||||
@@ -29,16 +29,16 @@ msgid "Error %d"
|
|||||||
msgstr "Грешка %d"
|
msgstr "Грешка %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:110
|
#: ../../WINGs/error.c:110
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr "внимание: "
|
msgstr "внимание: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:137
|
#: ../../WINGs/error.c:137
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr " критична грешка: "
|
msgstr "критична грешка: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr " грешка: "
|
msgstr "грешка: "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:48
|
#: ../../WINGs/findfile.c:48
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
@@ -34,16 +34,16 @@ msgid "Error %d"
|
|||||||
msgstr "Error %d"
|
msgstr "Error %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:110
|
#: ../../WINGs/error.c:110
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr ": atenció: "
|
msgstr "atenció: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:137
|
#: ../../WINGs/error.c:137
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr ": error fatal: "
|
msgstr "error fatal: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr ": error: "
|
msgstr "error: "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:48
|
#: ../../WINGs/findfile.c:48
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
@@ -68,16 +68,16 @@ msgid "Error %d"
|
|||||||
msgstr "Chyba %d"
|
msgstr "Chyba %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:112
|
#: ../../WINGs/error.c:112
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr " varovíní: "
|
msgstr "varovíní: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:139
|
#: ../../WINGs/error.c:139
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr " fatální chyba: "
|
msgstr "fatální chyba: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:165 ../../WINGs/error.c:194
|
#: ../../WINGs/error.c:165 ../../WINGs/error.c:194
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr " chyba: "
|
msgstr "chyba: "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:50
|
#: ../../WINGs/findfile.c:50
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ msgid "Error %d"
|
|||||||
msgstr "Fehler %d"
|
msgstr "Fehler %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:110
|
#: ../../WINGs/error.c:110
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr " Warnung: "
|
msgstr "warnung: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:137
|
#: ../../WINGs/error.c:137
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr " fataler Fehler: "
|
msgstr "fataler Fehler: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr " Fehler: "
|
msgstr "fehler: "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:48
|
#: ../../WINGs/findfile.c:48
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
@@ -30,16 +30,16 @@ msgid "Error %d"
|
|||||||
msgstr "Erreur %d"
|
msgstr "Erreur %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:110
|
#: ../../WINGs/error.c:110
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr " Avertissement : "
|
msgstr "avertissement : "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:137
|
#: ../../WINGs/error.c:137
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr " erreur fatale : "
|
msgstr "erreur fatale : "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr " erreur : "
|
msgstr "erreur : "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:48
|
#: ../../WINGs/findfile.c:48
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
606
WINGs/po/hu.po
Normal file
606
WINGs/po/hu.po
Normal file
@@ -0,0 +1,606 @@
|
|||||||
|
# Hungarian Translation for WINGs
|
||||||
|
# Copyright (C)2014 BALATON Zoltan
|
||||||
|
# This file is distributed under the same license as WINGs.
|
||||||
|
# BALATON Zoltán <balaton@eik.bme.hu>, 2014
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Window Maker 0.95.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2014-02-18 00:14+0100\n"
|
||||||
|
"PO-Revision-Date: 2014-02-18 00:25+0100\n"
|
||||||
|
"Last-Translator: BALATON Zoltán <balaton@eik.bme.hu>\n"
|
||||||
|
"Language-Team: Hungarian\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/error.c:117
|
||||||
|
msgid "fatal: "
|
||||||
|
msgstr "végzetes hiba: "
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/error.c:124
|
||||||
|
msgid "error: "
|
||||||
|
msgstr "hiba: "
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/error.c:131
|
||||||
|
msgid "warning: "
|
||||||
|
msgstr "figyelmeztetés: "
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/findfile.c:58
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get password entry for UID %i"
|
||||||
|
msgstr "nem találtam jelszó bejegyzést a %i felhasználó azonosítóhoz"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/findfile.c:87
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get password entry for user %s"
|
||||||
|
msgstr "nem találtam jelszó bejegyzést a \"%s\" nevű felhasználóhoz"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/findfile.c:203
|
||||||
|
#, c-format
|
||||||
|
msgid "could not expand %s"
|
||||||
|
msgstr "nem tudtam értelmezni: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/findfile.c:435
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not open %s"
|
||||||
|
msgstr "Nem sikerült megnyitni ezt: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/findfile.c:442
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create %s"
|
||||||
|
msgstr "Nem sikerült létrehozni ezt: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:78
|
||||||
|
#, c-format
|
||||||
|
msgid "syntax error in %s %s, line %i: %s"
|
||||||
|
msgstr "formai hiba ebben: %s %s, %i. sor: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:134
|
||||||
|
msgid "Only string or data is supported for a proplist dictionary key"
|
||||||
|
msgstr "proplist szótár kulcsa csak karakterlánc vagy adat típusú lehet"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:167
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:217
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:382
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:458
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1048
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1098
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1245
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1313
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1418
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1462
|
||||||
|
msgid "Used proplist functions on non-WMPropLists objects"
|
||||||
|
msgstr "proplist függvényt próbáltál használni nem WMPropList objektumon"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:635
|
||||||
|
msgid "unterminated PropList string"
|
||||||
|
msgstr "befejezetlen PropList karakterlánc"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:673
|
||||||
|
msgid "unterminated PropList data"
|
||||||
|
msgstr "befejezetlen PropList adat"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:681
|
||||||
|
msgid "unterminated PropList data (missing hexdigit)"
|
||||||
|
msgstr "befejezetlen PropList adat (hiányzó hexa számjegy)"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:693
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:698
|
||||||
|
msgid "non hexdigit character in PropList data"
|
||||||
|
msgstr "nem hexa számjegy karakter PropList adaton belül"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:730
|
||||||
|
msgid "unterminated PropList array"
|
||||||
|
msgstr "befejezetlen PropList tömb"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:738
|
||||||
|
msgid "missing or unterminated PropList array"
|
||||||
|
msgstr "hiányzó vagy befejezetlen PropList tömb"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:748
|
||||||
|
msgid "could not get PropList array element"
|
||||||
|
msgstr "nem találom a PropList tömb elemét"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:775
|
||||||
|
msgid "unterminated PropList dictionary"
|
||||||
|
msgstr "befejezetlen PropList szótár"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:792
|
||||||
|
msgid "missing PropList dictionary key"
|
||||||
|
msgstr "hiányzó PropList szótár kulcs"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:794
|
||||||
|
msgid "missing PropList dictionary entry key or unterminated dictionary"
|
||||||
|
msgstr "hiányzó PropList szótár kulcs vagy befejezetlen szótár"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:802
|
||||||
|
msgid "error parsing PropList dictionary key"
|
||||||
|
msgstr "hiba a PropList szótár kulcs értelmezése közben"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:810
|
||||||
|
msgid "missing = in PropList dictionary entry"
|
||||||
|
msgstr "hiányzó = a PropList szótár elemben"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:818
|
||||||
|
msgid "error parsing PropList dictionary entry value"
|
||||||
|
msgstr "hiba a PropList szótár elem értékenek értelmezése közben"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:826
|
||||||
|
msgid "missing ; in PropList dictionary entry"
|
||||||
|
msgstr "hiányzó ; a PropList szótár elemben"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:885
|
||||||
|
msgid "was expecting a string, data, array or dictionary. If it's a string, try enclosing it with \"."
|
||||||
|
msgstr "karakterlánc, adat, tömb vagy szótár típusra számítottam. Ha karakterláncot adtál meg, próbáld idézőjelbe tenni!"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:888
|
||||||
|
msgid "Comments are not allowed inside WindowMaker owned domain files."
|
||||||
|
msgstr "A Window Maker fájljaiban nem engedélyezettek a megjegyzések."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1482
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1547
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1604
|
||||||
|
msgid "extra data after end of property list"
|
||||||
|
msgstr "extra adat a proplist vége után"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1522
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get size for file '%s'"
|
||||||
|
msgstr "nem tudtam lekérdezni a következő fájl méretet: '%s'"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1530
|
||||||
|
#, c-format
|
||||||
|
msgid "error reading from file '%s'"
|
||||||
|
msgstr "nem tudtam beolvasni a következő fájlt: '%s'"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1575
|
||||||
|
#, c-format
|
||||||
|
msgid "%s:could not open menu file"
|
||||||
|
msgstr "%s: nem tudtam megnyitni a menü fájlt"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1642
|
||||||
|
#, c-format
|
||||||
|
msgid "mkstemp (%s) failed"
|
||||||
|
msgstr "mkstemp (%s) hibát adott"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1653
|
||||||
|
#, c-format
|
||||||
|
msgid "mktemp (%s) failed"
|
||||||
|
msgstr "mktemp (%s) hibát adott"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1660
|
||||||
|
#, c-format
|
||||||
|
msgid "open (%s) failed"
|
||||||
|
msgstr "open (%s) hibát adott"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1667
|
||||||
|
#, c-format
|
||||||
|
msgid "writing to file: %s failed"
|
||||||
|
msgstr "hiba a következő fájl írásakor: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1676
|
||||||
|
#, c-format
|
||||||
|
msgid "fclose (%s) failed"
|
||||||
|
msgstr "fclose (%s) hibát adott"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1684
|
||||||
|
#, c-format
|
||||||
|
msgid "rename ('%s' to '%s') failed"
|
||||||
|
msgstr "rename ('%s'-ről '%s'-re) hibát adott"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/proplist.c:1755
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create component %s"
|
||||||
|
msgstr "Nem sikerült létrehozni a %s elemet"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/userdefaults.c:65
|
||||||
|
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
|
||||||
|
msgstr "A GNUSTEP_USER_ROOT változó be van állítva, de rossz értékre. Nem használom"
|
||||||
|
|
||||||
|
#. something happened with the file. just overwrite it
|
||||||
|
#: ../../../wmaker-crm/WINGs/userdefaults.c:196
|
||||||
|
#: ../../../wmaker-crm/WINGs/userdefaults.c:211
|
||||||
|
#, c-format
|
||||||
|
msgid "cannot read domain from file '%s' when syncing"
|
||||||
|
msgstr "szinkronizálás közben nem tudtam a tartományt kiolvasni a '%s' fájlból"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:204
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:214
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:250
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:288
|
||||||
|
#, c-format
|
||||||
|
msgid "could not allocate %s color"
|
||||||
|
msgstr "nem sikerült lefoglalni ezt a színt: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:204
|
||||||
|
msgid "white"
|
||||||
|
msgstr "fehér"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:214
|
||||||
|
msgid "black"
|
||||||
|
msgstr "fekete"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:250
|
||||||
|
msgid "gray"
|
||||||
|
msgstr "szürke"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolor.c:288
|
||||||
|
msgid "dark gray"
|
||||||
|
msgstr "sötétszürke"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:383
|
||||||
|
msgid "Colors"
|
||||||
|
msgstr "Színek"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:558
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2624
|
||||||
|
msgid "Brightness"
|
||||||
|
msgstr "Világosság"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:560
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:634
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:665
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:696
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:754
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:785
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:817
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:850
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1988
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2626
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2660
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2694
|
||||||
|
msgid "Color Panel: Could not allocate memory"
|
||||||
|
msgstr "Szín panel: nem sikerült a memória foglalás"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:632
|
||||||
|
msgid "Red"
|
||||||
|
msgstr "Piros"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:663
|
||||||
|
msgid "Green"
|
||||||
|
msgstr "Zöld"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:694
|
||||||
|
msgid "Blue"
|
||||||
|
msgstr "Kék"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:752
|
||||||
|
msgid "Cyan"
|
||||||
|
msgstr "Türkiz"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:783
|
||||||
|
msgid "Magenta"
|
||||||
|
msgstr "Lila"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:815
|
||||||
|
msgid "Yellow"
|
||||||
|
msgstr "Sárga"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:848
|
||||||
|
msgid "Black"
|
||||||
|
msgstr "Fekete"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:923
|
||||||
|
msgid "Spectrum"
|
||||||
|
msgstr "Spektrum"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:949
|
||||||
|
msgid "Palette"
|
||||||
|
msgstr "Paletta"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:954
|
||||||
|
msgid "New from File..."
|
||||||
|
msgstr "Új, fájlból..."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:955
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1000
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1015
|
||||||
|
msgid "Rename..."
|
||||||
|
msgstr "Átnevez..."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:956
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1001
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1016
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3086
|
||||||
|
msgid "Remove"
|
||||||
|
msgstr "Töröl"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:957
|
||||||
|
msgid "Copy"
|
||||||
|
msgstr "Másol"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:958
|
||||||
|
msgid "New from Clipboard"
|
||||||
|
msgstr "Új, vágólapról"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:977
|
||||||
|
msgid "X11-Colors"
|
||||||
|
msgstr "X11 színek"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:994
|
||||||
|
msgid "Color"
|
||||||
|
msgstr "Szín"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:999
|
||||||
|
msgid "Add..."
|
||||||
|
msgstr "Hozzáad..."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1009
|
||||||
|
msgid "List"
|
||||||
|
msgstr "Lista"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1014
|
||||||
|
msgid "New..."
|
||||||
|
msgstr "Új..."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1142
|
||||||
|
#, c-format
|
||||||
|
msgid "Color Panel: Could not create directory %s needed to store configurations"
|
||||||
|
msgstr "Szín panel: Nem sikerült a beállítások tárolásához szükséges könyvtárat létrehozni: %s"
|
||||||
|
|
||||||
|
#. Delete the file, it doesn't belong here
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1148
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2979
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2983
|
||||||
|
msgid "File Error"
|
||||||
|
msgstr "Fájl hiba"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1149
|
||||||
|
msgid "Could not create ColorPanel configuration directory"
|
||||||
|
msgstr "Nem sikerült létrehozni a Szín panel beállítás könyvtárát"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1150
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2980
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2985
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3010
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:227
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:596
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:611
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:712
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:890
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:534
|
||||||
|
msgid "OK"
|
||||||
|
msgstr "OK"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1156
|
||||||
|
msgid "Color Panel: Could not find file"
|
||||||
|
msgstr "Szín panel: nem találom a fájlt"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1352
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1413
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:1473
|
||||||
|
msgid "Color Panel: X failed request"
|
||||||
|
msgstr "Szín panel: hibás X kérés"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2658
|
||||||
|
msgid "Saturation"
|
||||||
|
msgstr "Telítettség"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2692
|
||||||
|
msgid "Hue"
|
||||||
|
msgstr "Árnyalat"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2918
|
||||||
|
msgid "Open Palette"
|
||||||
|
msgstr "Paletta megnyitás"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2980
|
||||||
|
msgid "Invalid file format !"
|
||||||
|
msgstr "Érvénytelen fájl formátum!"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2982
|
||||||
|
#, c-format
|
||||||
|
msgid "can't remove file %s"
|
||||||
|
msgstr "nem sikerült törölni a következő fált: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:2984
|
||||||
|
msgid "Couldn't remove file from Configuration Directory !"
|
||||||
|
msgstr "Nem sikerült törölni a fájlt a beállítás könyvtárból!"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3009
|
||||||
|
msgid "Rename"
|
||||||
|
msgstr "Átnevez"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3009
|
||||||
|
msgid "Rename palette to:"
|
||||||
|
msgstr "Paletta átnevezése erre:"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3010
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:236
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:611
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:712
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Mégsem"
|
||||||
|
|
||||||
|
#. Careful, this palette exists already
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3026
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:712
|
||||||
|
msgid "Warning"
|
||||||
|
msgstr "Figyelem!"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3027
|
||||||
|
msgid ""
|
||||||
|
"Palette already exists !\n"
|
||||||
|
"\n"
|
||||||
|
"Overwrite ?"
|
||||||
|
msgstr ""
|
||||||
|
"Ez a paletta már létezik!\n"
|
||||||
|
"\n"
|
||||||
|
"Felülírjam?"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3027
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3086
|
||||||
|
msgid "No"
|
||||||
|
msgstr "Nem"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3027
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3086
|
||||||
|
msgid "Yes"
|
||||||
|
msgstr "Igen"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3058
|
||||||
|
#, c-format
|
||||||
|
msgid "Couldn't rename palette %s to %s"
|
||||||
|
msgstr "Nem sikerült a paletta átnevezése %s-ről %s-re"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3081
|
||||||
|
msgid "This will permanently remove the palette "
|
||||||
|
msgstr "Ez véglegesen törli a következő palettát: "
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3083
|
||||||
|
msgid ""
|
||||||
|
".\n"
|
||||||
|
"\n"
|
||||||
|
"Are you sure you want to remove this palette ?"
|
||||||
|
msgstr ""
|
||||||
|
".\n"
|
||||||
|
"\n"
|
||||||
|
"Biztosan törölni akarod ezt a palettát?"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3105
|
||||||
|
#, c-format
|
||||||
|
msgid "Couldn't remove palette %s"
|
||||||
|
msgstr "Nem sikerült törölni ezt a palettát: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wcolorpanel.c:3395
|
||||||
|
msgid "Color Panel: Color unspecified"
|
||||||
|
msgstr "Szín panel: nincs megadva szín"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:216
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Név: "
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:306
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:364
|
||||||
|
msgid "Open"
|
||||||
|
msgstr "Megnyit"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:322
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:370
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Ment"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:506
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not open directory %s\n"
|
||||||
|
msgstr "WINGs: nem tudom megnyitni a következő könyvtárat: %s\n"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:526
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not stat %s\n"
|
||||||
|
msgstr "WINGs: nem tudom lekérdezni a következő fájl adatait: %s\n"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:596
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:890
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:533
|
||||||
|
msgid "Error"
|
||||||
|
msgstr "Hiba"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:610
|
||||||
|
msgid "Create Directory"
|
||||||
|
msgstr "Új könyvtár"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:611
|
||||||
|
msgid "Enter directory name"
|
||||||
|
msgstr "Könyvtár neve"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:639
|
||||||
|
#, c-format
|
||||||
|
msgid "Can not create %s: %s"
|
||||||
|
msgstr "Nem sikerült létrehozni: %s: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:702
|
||||||
|
#, c-format
|
||||||
|
msgid "Can not find %s: %s"
|
||||||
|
msgstr "Nem találom: %s: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:708
|
||||||
|
#, c-format
|
||||||
|
msgid "Delete %s %s?"
|
||||||
|
msgstr "Töröljem a következő %s: \"%s\"?"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:709
|
||||||
|
msgid "directory"
|
||||||
|
msgstr "könyvtárat"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:709
|
||||||
|
msgid "file"
|
||||||
|
msgstr "fájlt"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:716
|
||||||
|
#, c-format
|
||||||
|
msgid "Removing %s failed: %s"
|
||||||
|
msgstr "Hiba \"%s\" törlésekor: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:749
|
||||||
|
#, c-format
|
||||||
|
msgid "An error occured browsing '%s'."
|
||||||
|
msgstr "Hiba történt a '%s' olvasásakor."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:752
|
||||||
|
#, c-format
|
||||||
|
msgid "'%s' is not a directory."
|
||||||
|
msgstr "Nem könyvtár: '%s'."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfilepanel.c:890
|
||||||
|
msgid "File does not exist."
|
||||||
|
msgstr "Nem létező fájl."
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfont.c:37
|
||||||
|
#, c-format
|
||||||
|
msgid "invalid font: %s. Trying '%s'"
|
||||||
|
msgstr "érvénytelen betűtípus: %s. Ezt próbálom helyette: '%s'"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfont.c:227 ../../../wmaker-crm/WINGs/wfont.c:245
|
||||||
|
#, c-format
|
||||||
|
msgid "could not load font: %s."
|
||||||
|
msgstr "nem tudtam betölteni ezt a betűtípust: %s."
|
||||||
|
|
||||||
|
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:186
|
||||||
|
msgid "Font Panel"
|
||||||
|
msgstr "Betűtípus panel"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:222
|
||||||
|
msgid "The quick brown fox jumps over the lazy dog"
|
||||||
|
msgstr "Árvíztűrő tükörfúrógép"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:228
|
||||||
|
msgid "Family"
|
||||||
|
msgstr "Típuscsalád"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:239
|
||||||
|
msgid "Typeface"
|
||||||
|
msgstr "Betűtípus"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:250
|
||||||
|
msgid "Size"
|
||||||
|
msgstr "Méret"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:269
|
||||||
|
msgid "Set"
|
||||||
|
msgstr "Beállít"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:275
|
||||||
|
msgid "Revert"
|
||||||
|
msgstr "Elvet"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wfontpanel.c:534
|
||||||
|
msgid "Could not init font config library\n"
|
||||||
|
msgstr "Nem sikerült inicializálni a betűtípus konfigurációs könyvtárat\n"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/widgets.c:389
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not load widget images file: %s"
|
||||||
|
msgstr "WINGs: nem tudtam betölteni a következő fájlt: %s"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/widgets.c:724
|
||||||
|
msgid "could not load any fonts. Make sure your font installation and locale settings are correct."
|
||||||
|
msgstr "egyetlen betűtípust sem tudtam betölteni. Ellenőrizd a telepítést és a nemzetközi beállítások helyességét!"
|
||||||
|
|
||||||
|
#: ../../../wmaker-crm/WINGs/wruler.c:175
|
||||||
|
msgid "0 inches"
|
||||||
|
msgstr "0 hüvelyk"
|
||||||
581
WINGs/po/nl.po
Normal file
581
WINGs/po/nl.po
Normal file
@@ -0,0 +1,581 @@
|
|||||||
|
# New translation into Dutch for Window Maker
|
||||||
|
# Copyright (C) 2014 Window Maker Developers Team
|
||||||
|
# This file is distributed under the same license as the windowmaker package.
|
||||||
|
# Original by Alwin <translations@ziggo.nl>, 2014.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: wmaker-0.95.5-473-gb431dcc3\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2014-06-20 10:55+0200\n"
|
||||||
|
"PO-Revision-Date: 2014-06-20 00:00+0200\n"
|
||||||
|
"Last-Translator: Alwin <translations@ziggo.nl>\n"
|
||||||
|
"Language-Team: Dutch\n"
|
||||||
|
"Language: nl\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: ../../WINGs/error.c:106
|
||||||
|
msgid "fatal: "
|
||||||
|
msgstr "onherstelbaar: "
|
||||||
|
|
||||||
|
#: ../../WINGs/error.c:112
|
||||||
|
msgid "error: "
|
||||||
|
msgstr "fout: "
|
||||||
|
|
||||||
|
#: ../../WINGs/error.c:118
|
||||||
|
msgid "warning: "
|
||||||
|
msgstr "waarschuwing: "
|
||||||
|
|
||||||
|
#: ../../WINGs/findfile.c:61
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get password entry for UID %i"
|
||||||
|
msgstr "kon accountgegevens voor UID %i niet krijgen"
|
||||||
|
|
||||||
|
#: ../../WINGs/findfile.c:91
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get password entry for user %s"
|
||||||
|
msgstr "kon accountgegevens voor gebruiker %s niet krijgen"
|
||||||
|
|
||||||
|
#: ../../WINGs/findfile.c:210
|
||||||
|
#, c-format
|
||||||
|
msgid "could not expand %s"
|
||||||
|
msgstr "kon %s niet uitwerken"
|
||||||
|
|
||||||
|
#: ../../WINGs/findfile.c:444
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not open input file \"%s\""
|
||||||
|
msgstr "Kon invoerbestand \"%s\" niet openen"
|
||||||
|
|
||||||
|
#: ../../WINGs/findfile.c:453
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create target file \"%s\""
|
||||||
|
msgstr "Kon doelbestand \"%s\" niet aanmaken"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:78
|
||||||
|
#, c-format
|
||||||
|
msgid "syntax error in %s %s, line %i: %s"
|
||||||
|
msgstr "syntaxfout in %s %s, regel %i: %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:134
|
||||||
|
msgid "Only string or data is supported for a proplist dictionary key"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:167 ../../WINGs/proplist.c:217
|
||||||
|
#: ../../WINGs/proplist.c:382 ../../WINGs/proplist.c:458
|
||||||
|
#: ../../WINGs/proplist.c:1048 ../../WINGs/proplist.c:1098
|
||||||
|
#: ../../WINGs/proplist.c:1245 ../../WINGs/proplist.c:1313
|
||||||
|
#: ../../WINGs/proplist.c:1418 ../../WINGs/proplist.c:1462
|
||||||
|
msgid "Used proplist functions on non-WMPropLists objects"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:635
|
||||||
|
msgid "unterminated PropList string"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:673
|
||||||
|
msgid "unterminated PropList data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:681
|
||||||
|
msgid "unterminated PropList data (missing hexdigit)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:693 ../../WINGs/proplist.c:698
|
||||||
|
msgid "non hexdigit character in PropList data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:730
|
||||||
|
msgid "unterminated PropList array"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:738
|
||||||
|
msgid "missing or unterminated PropList array"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:748
|
||||||
|
msgid "could not get PropList array element"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:775
|
||||||
|
msgid "unterminated PropList dictionary"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:792
|
||||||
|
msgid "missing PropList dictionary key"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
# Geen chocola van te maken. ;-)
|
||||||
|
#: ../../WINGs/proplist.c:794
|
||||||
|
msgid "missing PropList dictionary entry key or unterminated dictionary"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:802
|
||||||
|
msgid "error parsing PropList dictionary key"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:810
|
||||||
|
msgid "missing = in PropList dictionary entry"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:818
|
||||||
|
msgid "error parsing PropList dictionary entry value"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:826
|
||||||
|
msgid "missing ; in PropList dictionary entry"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:885
|
||||||
|
msgid ""
|
||||||
|
"was expecting a string, data, array or dictionary. If it's a string, try "
|
||||||
|
"enclosing it with \"."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:888
|
||||||
|
msgid "Comments are not allowed inside WindowMaker owned domain files."
|
||||||
|
msgstr "Commentaar is niet toegestaan binnen domeinbestanden van WindowMaker."
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1482 ../../WINGs/proplist.c:1547
|
||||||
|
#: ../../WINGs/proplist.c:1604
|
||||||
|
msgid "extra data after end of property list"
|
||||||
|
msgstr "extra data na einde van 'property list'"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1522
|
||||||
|
#, c-format
|
||||||
|
msgid "could not get size for file '%s'"
|
||||||
|
msgstr "kon grootte voor bestand '%s' niet krijgen"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1530
|
||||||
|
#, c-format
|
||||||
|
msgid "error reading from file '%s'"
|
||||||
|
msgstr "fout bij lezen uit bestand '%s'"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1575
|
||||||
|
#, c-format
|
||||||
|
msgid "%s:could not open menu file"
|
||||||
|
msgstr "%s:kon menubestand niet openen"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1642
|
||||||
|
#, c-format
|
||||||
|
msgid "mkstemp (%s) failed"
|
||||||
|
msgstr "aanmaken uniek tijdelijk bestand (%s) mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1653
|
||||||
|
#, c-format
|
||||||
|
msgid "mktemp (%s) failed"
|
||||||
|
msgstr "aanmaken tijdelijk bestand (%s) mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1660
|
||||||
|
#, c-format
|
||||||
|
msgid "open (%s) failed"
|
||||||
|
msgstr "openen (%s) mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1667
|
||||||
|
#, c-format
|
||||||
|
msgid "writing to file: %s failed"
|
||||||
|
msgstr "schrijven naar bestand: %s mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1676
|
||||||
|
#, c-format
|
||||||
|
msgid "fclose (%s) failed"
|
||||||
|
msgstr "afsluiten stream (%s) mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1684
|
||||||
|
#, c-format
|
||||||
|
msgid "rename ('%s' to '%s') failed"
|
||||||
|
msgstr "hernoemen ('%s' naar '%s') mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/proplist.c:1755
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create component %s"
|
||||||
|
msgstr "Kon component %s niet aanmaken"
|
||||||
|
|
||||||
|
#: ../../WINGs/userdefaults.c:72
|
||||||
|
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
|
||||||
|
msgstr ""
|
||||||
|
"variabele GNUSTEP_USER_ROOT, gedefinieerd met ongeldig pad, niet gebruikt"
|
||||||
|
|
||||||
|
#. something happened with the file. just overwrite it
|
||||||
|
#: ../../WINGs/userdefaults.c:210 ../../WINGs/userdefaults.c:225
|
||||||
|
#, c-format
|
||||||
|
msgid "cannot read domain from file '%s' when syncing"
|
||||||
|
msgstr "kan domein niet lezen uit bestand '%s' bij synchroniseren"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolor.c:204 ../../WINGs/wcolor.c:214 ../../WINGs/wcolor.c:250
|
||||||
|
#: ../../WINGs/wcolor.c:288
|
||||||
|
#, c-format
|
||||||
|
msgid "could not allocate %s color"
|
||||||
|
msgstr "kon kleur %s niet toewijzen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolor.c:204
|
||||||
|
msgid "white"
|
||||||
|
msgstr "wit"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolor.c:214
|
||||||
|
msgid "black"
|
||||||
|
msgstr "zwart"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolor.c:250
|
||||||
|
msgid "gray"
|
||||||
|
msgstr "grijs"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolor.c:288
|
||||||
|
msgid "dark gray"
|
||||||
|
msgstr "donkergrijs"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:399
|
||||||
|
msgid "Colors"
|
||||||
|
msgstr "Kleuren"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:574 ../../WINGs/wcolorpanel.c:2726
|
||||||
|
msgid "Brightness"
|
||||||
|
msgstr "Helderheid"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:576 ../../WINGs/wcolorpanel.c:650
|
||||||
|
#: ../../WINGs/wcolorpanel.c:681 ../../WINGs/wcolorpanel.c:712
|
||||||
|
#: ../../WINGs/wcolorpanel.c:787 ../../WINGs/wcolorpanel.c:818
|
||||||
|
#: ../../WINGs/wcolorpanel.c:850 ../../WINGs/wcolorpanel.c:883
|
||||||
|
#: ../../WINGs/wcolorpanel.c:2022 ../../WINGs/wcolorpanel.c:2728
|
||||||
|
#: ../../WINGs/wcolorpanel.c:2762 ../../WINGs/wcolorpanel.c:2796
|
||||||
|
msgid "Color Panel: Could not allocate memory"
|
||||||
|
msgstr "Kleurenpaneel: Kon geen geheugen toewijzen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:648
|
||||||
|
msgid "Red"
|
||||||
|
msgstr "Rood"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:679
|
||||||
|
msgid "Green"
|
||||||
|
msgstr "Groen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:710
|
||||||
|
msgid "Blue"
|
||||||
|
msgstr "Blauw"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:785
|
||||||
|
msgid "Cyan"
|
||||||
|
msgstr "Cyaan"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:816
|
||||||
|
msgid "Magenta"
|
||||||
|
msgstr "Magenta"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:848
|
||||||
|
msgid "Yellow"
|
||||||
|
msgstr "Geel"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:881
|
||||||
|
msgid "Black"
|
||||||
|
msgstr "Zwart"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:956
|
||||||
|
msgid "Spectrum"
|
||||||
|
msgstr "Spectrum"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:982
|
||||||
|
msgid "Palette"
|
||||||
|
msgstr "Palet"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:987
|
||||||
|
msgid "New from File..."
|
||||||
|
msgstr "Nieuw uit bestand..."
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:988 ../../WINGs/wcolorpanel.c:1033
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1048
|
||||||
|
msgid "Rename..."
|
||||||
|
msgstr "Hernoemen..."
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:989 ../../WINGs/wcolorpanel.c:1034
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1049 ../../WINGs/wcolorpanel.c:3188
|
||||||
|
msgid "Remove"
|
||||||
|
msgstr "Verwijderen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:990
|
||||||
|
msgid "Copy"
|
||||||
|
msgstr "Kopiëren"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:991
|
||||||
|
msgid "New from Clipboard"
|
||||||
|
msgstr "Nieuw van klembord"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1010
|
||||||
|
msgid "X11-Colors"
|
||||||
|
msgstr "X11-kleuren"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1027
|
||||||
|
msgid "Color"
|
||||||
|
msgstr "Kleur"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1032
|
||||||
|
msgid "Add..."
|
||||||
|
msgstr "Toevoegen..."
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1042
|
||||||
|
msgid "List"
|
||||||
|
msgstr "Lijst"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1047
|
||||||
|
msgid "New..."
|
||||||
|
msgstr "Nieuw..."
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1176
|
||||||
|
#, c-format
|
||||||
|
msgid ""
|
||||||
|
"Color Panel: Could not create directory %s needed to store configurations"
|
||||||
|
msgstr ""
|
||||||
|
"Kleurenpaneel: Kon map %s, nodig om instellingen op te slaan, niet aanmaken"
|
||||||
|
|
||||||
|
#. Delete the file, it doesn't belong here
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1182 ../../WINGs/wcolorpanel.c:3081
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3085
|
||||||
|
msgid "File Error"
|
||||||
|
msgstr "Bestandsfout"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1183
|
||||||
|
msgid "Could not create ColorPanel configuration directory"
|
||||||
|
msgstr "Kon instellingenmap Kleurenpaneel niet aanmaken"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1184 ../../WINGs/wcolorpanel.c:3082
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3087 ../../WINGs/wcolorpanel.c:3112
|
||||||
|
#: ../../WINGs/wfilepanel.c:227 ../../WINGs/wfilepanel.c:596
|
||||||
|
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
|
||||||
|
#: ../../WINGs/wfilepanel.c:883 ../../WINGs/wfontpanel.c:534
|
||||||
|
msgid "OK"
|
||||||
|
msgstr "OK"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1190
|
||||||
|
msgid "Color Panel: Could not find file"
|
||||||
|
msgstr "Kleurenpaneel: Kon bestand niet vinden"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1386 ../../WINGs/wcolorpanel.c:1447
|
||||||
|
#: ../../WINGs/wcolorpanel.c:1507
|
||||||
|
msgid "Color Panel: X failed request"
|
||||||
|
msgstr "Kleurenpaneel: X-aanvraag mislukt"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:2760
|
||||||
|
msgid "Saturation"
|
||||||
|
msgstr "Verzadiging"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:2794
|
||||||
|
msgid "Hue"
|
||||||
|
msgstr "Tint"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3020
|
||||||
|
msgid "Open Palette"
|
||||||
|
msgstr "Open palet"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3082
|
||||||
|
msgid "Invalid file format !"
|
||||||
|
msgstr "Ongeldige bestandsvorm!"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3084
|
||||||
|
#, c-format
|
||||||
|
msgid "can't remove file %s"
|
||||||
|
msgstr "kan bestand %s niet verwijderen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3086
|
||||||
|
msgid "Couldn't remove file from Configuration Directory !"
|
||||||
|
msgstr "Kon bestand niet verwijderen uit instellingenmap!"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3111
|
||||||
|
msgid "Rename"
|
||||||
|
msgstr "Hernoemen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3111
|
||||||
|
msgid "Rename palette to:"
|
||||||
|
msgstr "Hernoem palet naar:"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3112 ../../WINGs/wfilepanel.c:236
|
||||||
|
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annuleren"
|
||||||
|
|
||||||
|
#. Careful, this palette exists already
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3128 ../../WINGs/wfilepanel.c:715
|
||||||
|
msgid "Warning"
|
||||||
|
msgstr "Waarschuwing"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3129
|
||||||
|
msgid ""
|
||||||
|
"Palette already exists !\n"
|
||||||
|
"\n"
|
||||||
|
"Overwrite ?"
|
||||||
|
msgstr ""
|
||||||
|
"Palet bestaat al!\n"
|
||||||
|
"\n"
|
||||||
|
"Overschrijven?"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3129 ../../WINGs/wcolorpanel.c:3188
|
||||||
|
msgid "No"
|
||||||
|
msgstr "Nee"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3129 ../../WINGs/wcolorpanel.c:3188
|
||||||
|
msgid "Yes"
|
||||||
|
msgstr "Ja"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3160
|
||||||
|
#, c-format
|
||||||
|
msgid "Couldn't rename palette %s to %s"
|
||||||
|
msgstr "Kon palet %s niet hernoemen naar %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3183
|
||||||
|
msgid "This will permanently remove the palette "
|
||||||
|
msgstr "Dit zal 't palet "
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3185
|
||||||
|
msgid ""
|
||||||
|
".\n"
|
||||||
|
"\n"
|
||||||
|
"Are you sure you want to remove this palette ?"
|
||||||
|
msgstr ""
|
||||||
|
" definitief verwijderen.\n"
|
||||||
|
"\n"
|
||||||
|
"Weet u zeker dat u dit palet wilt verwijderen?"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3207
|
||||||
|
#, c-format
|
||||||
|
msgid "Couldn't remove palette %s"
|
||||||
|
msgstr "Kon palet %s niet verwijderen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wcolorpanel.c:3497
|
||||||
|
msgid "Color Panel: Color unspecified"
|
||||||
|
msgstr "Kleurenpaneel: Kleur niet opgegeven"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:216
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Naam:"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:306 ../../WINGs/wfilepanel.c:364
|
||||||
|
msgid "Open"
|
||||||
|
msgstr "Openen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:322 ../../WINGs/wfilepanel.c:370
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Opslaan"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:506
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not open directory %s\n"
|
||||||
|
msgstr "WINGs: kon map %s niet openen\n"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:526
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not stat %s\n"
|
||||||
|
msgstr "WINGs: kon status %s niet vaststellen\n"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:596 ../../WINGs/wfilepanel.c:883
|
||||||
|
#: ../../WINGs/wfontpanel.c:533
|
||||||
|
msgid "Error"
|
||||||
|
msgstr "Fout"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:610
|
||||||
|
msgid "Create Directory"
|
||||||
|
msgstr "Map aanmaken"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:611
|
||||||
|
msgid "Enter directory name"
|
||||||
|
msgstr "Voer mapnaam in"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:639
|
||||||
|
#, c-format
|
||||||
|
msgid "Can not create %s: %s"
|
||||||
|
msgstr "Kan %s niet aanmaken: %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:705
|
||||||
|
#, c-format
|
||||||
|
msgid "Can not find %s: %s"
|
||||||
|
msgstr "Kan %s niet vinden: %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:711
|
||||||
|
#, c-format
|
||||||
|
msgid "Delete %s %s?"
|
||||||
|
msgstr "%s %s verwijderen?"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:712
|
||||||
|
msgid "directory"
|
||||||
|
msgstr "Map"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:712
|
||||||
|
msgid "file"
|
||||||
|
msgstr "Bestand"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:719
|
||||||
|
#, c-format
|
||||||
|
msgid "Removing %s failed: %s"
|
||||||
|
msgstr "Verwijderen %s mislukt: %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:751
|
||||||
|
#, c-format
|
||||||
|
msgid "An error occured browsing '%s'."
|
||||||
|
msgstr "'n Fout trad op bij bladeren door '%s'."
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:754
|
||||||
|
#, c-format
|
||||||
|
msgid "'%s' is not a directory."
|
||||||
|
msgstr "'%s' is geen map."
|
||||||
|
|
||||||
|
#: ../../WINGs/wfilepanel.c:883
|
||||||
|
msgid "File does not exist."
|
||||||
|
msgstr "Bestand bestaat niet."
|
||||||
|
|
||||||
|
#: ../../WINGs/wfont.c:37
|
||||||
|
#, c-format
|
||||||
|
msgid "invalid font: %s. Trying '%s'"
|
||||||
|
msgstr "ongeldig lettertype: %s. Probeert '%s'"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfont.c:227 ../../WINGs/wfont.c:245
|
||||||
|
#, c-format
|
||||||
|
msgid "could not load font: %s."
|
||||||
|
msgstr "kon lettertype niet laden: %s."
|
||||||
|
|
||||||
|
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
|
||||||
|
#: ../../WINGs/wfontpanel.c:186
|
||||||
|
msgid "Font Panel"
|
||||||
|
msgstr "Lettertypen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:222
|
||||||
|
msgid "The quick brown fox jumps over the lazy dog"
|
||||||
|
msgstr "De snelle bruine vos springt over de luie hond"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:228
|
||||||
|
msgid "Family"
|
||||||
|
msgstr "Familie"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:239
|
||||||
|
msgid "Typeface"
|
||||||
|
msgstr "Lettertype"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:250
|
||||||
|
msgid "Size"
|
||||||
|
msgstr "Grootte"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:269
|
||||||
|
msgid "Set"
|
||||||
|
msgstr "Instellen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:275
|
||||||
|
msgid "Revert"
|
||||||
|
msgstr "Herstellen"
|
||||||
|
|
||||||
|
#: ../../WINGs/wfontpanel.c:534
|
||||||
|
msgid "Could not init font config library\n"
|
||||||
|
msgstr "Kon bibliotheek 'lettertype instellen' niet initialiseren\n"
|
||||||
|
|
||||||
|
#: ../../WINGs/widgets.c:389
|
||||||
|
#, c-format
|
||||||
|
msgid "WINGs: could not load widget images file: %s"
|
||||||
|
msgstr "WINGs: kon afbeeldingenbestand besturingselementen niet laden: %s"
|
||||||
|
|
||||||
|
#: ../../WINGs/widgets.c:724
|
||||||
|
msgid ""
|
||||||
|
"could not load any fonts. Make sure your font installation and locale "
|
||||||
|
"settings are correct."
|
||||||
|
msgstr ""
|
||||||
|
"kon geen lettertypen laden. Zorg ervoor dat uw geïnstalleerde lettertypen en "
|
||||||
|
"lokalisatie-instellingen juist zijn."
|
||||||
|
|
||||||
|
#: ../../WINGs/wruler.c:175
|
||||||
|
msgid "0 inches"
|
||||||
|
msgstr "0 inch"
|
||||||
@@ -39,16 +39,16 @@ msgid "Error %d"
|
|||||||
msgstr "Chyba %d"
|
msgstr "Chyba %d"
|
||||||
|
|
||||||
#: ../../WINGs/error.c:110
|
#: ../../WINGs/error.c:110
|
||||||
msgid " warning: "
|
msgid "warning: "
|
||||||
msgstr " varovanie: "
|
msgstr "varovanie: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:137
|
#: ../../WINGs/error.c:137
|
||||||
msgid " fatal error: "
|
msgid "fatal: "
|
||||||
msgstr " fatálna chyba: "
|
msgstr "fatálna chyba: "
|
||||||
|
|
||||||
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
|
||||||
msgid " error: "
|
msgid "error: "
|
||||||
msgstr " chyba: "
|
msgstr "chyba: "
|
||||||
|
|
||||||
#: ../../WINGs/findfile.c:48
|
#: ../../WINGs/findfile.c:48
|
||||||
#, c-format
|
#, c-format
|
||||||
|
|||||||
2765
WINGs/proplist.c
2765
WINGs/proplist.c
File diff suppressed because it is too large
Load Diff
241
WINGs/puzzle.c
241
WINGs/puzzle.c
@@ -1,241 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <WINGs.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_SIZE 10*10
|
|
||||||
|
|
||||||
|
|
||||||
WMWindow *win;
|
|
||||||
WMButton *Button[MAX_SIZE];
|
|
||||||
char Map[MAX_SIZE];
|
|
||||||
int Size = 4;
|
|
||||||
int MoveCount;
|
|
||||||
|
|
||||||
#define MAP(x,y) Map[(x)+(y)*Size]
|
|
||||||
|
|
||||||
int WinSize = 120;
|
|
||||||
|
|
||||||
|
|
||||||
Bool CheckWin(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < Size*Size-1; i++) {
|
|
||||||
if (Map[i] != i)
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MoveButton(int button, int x, int y)
|
|
||||||
{
|
|
||||||
WMMoveWidget(Button[button], x*(WinSize/Size), y*(WinSize/Size));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Bool SlideButton(int button)
|
|
||||||
{
|
|
||||||
int x, y, done = 0;
|
|
||||||
|
|
||||||
/* locate the button */
|
|
||||||
for (y = 0; y < Size; y++) {
|
|
||||||
for (x = 0; x < Size; x++) {
|
|
||||||
if (MAP(x,y) == button) {
|
|
||||||
done = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (done)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (x > 0 && MAP(x-1, y) < 0) {
|
|
||||||
MAP(x,y) = -1;
|
|
||||||
MoveButton(button, x-1, y);
|
|
||||||
MAP(x-1,y) = button;
|
|
||||||
} else if (x < Size-1 && MAP(x+1, y) < 0) {
|
|
||||||
MAP(x,y) = -1;
|
|
||||||
MoveButton(button, x+1, y);
|
|
||||||
MAP(x+1,y) = button;
|
|
||||||
} else if (y > 0 && MAP(x, y-1) < 0) {
|
|
||||||
MAP(x,y) = -1;
|
|
||||||
MoveButton(button, x, y-1);
|
|
||||||
MAP(x,y-1) = button;
|
|
||||||
} else if (y < Size-1 && MAP(x, y+1) < 0) {
|
|
||||||
MAP(x,y) = -1;
|
|
||||||
MoveButton(button, x, y+1);
|
|
||||||
MAP(x,y+1) = button;
|
|
||||||
} else {
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define SWAP(a,b) {int tmp; tmp=a; a=b; b=tmp;}
|
|
||||||
|
|
||||||
void ResetGame(void)
|
|
||||||
{
|
|
||||||
int i, x, y, ox, oy;
|
|
||||||
|
|
||||||
|
|
||||||
MoveCount = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < Size*Size-1; i++) {
|
|
||||||
Map[i] = i;
|
|
||||||
}
|
|
||||||
Map[i] = -1;
|
|
||||||
ox = x = Size-1;
|
|
||||||
oy = y = Size-1;
|
|
||||||
for (i = 0; i < 5; i++) {
|
|
||||||
int ok;
|
|
||||||
ok = 1;
|
|
||||||
switch (rand()%4) {
|
|
||||||
case 0:
|
|
||||||
if (x > 0) x--; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (x < Size-1) x++; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (y > 0) y--; else ok = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if (y < Size-1) y++; else ok = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (ok) {
|
|
||||||
MoveButton(MAP(x,y), ox, oy);
|
|
||||||
|
|
||||||
SWAP(MAP(ox, oy), MAP(x, y));
|
|
||||||
|
|
||||||
while (XPending(WMScreenDisplay(WMWidgetScreen(win)))) {
|
|
||||||
XEvent ev;
|
|
||||||
WMNextEvent(WMScreenDisplay(WMWidgetScreen(win)), &ev);
|
|
||||||
WMHandleEvent(&ev);
|
|
||||||
}
|
|
||||||
ox = x;
|
|
||||||
oy = y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void buttonClick(WMWidget *w, void *ptr)
|
|
||||||
{
|
|
||||||
char buffer[300];
|
|
||||||
|
|
||||||
if (SlideButton((int)ptr)) {
|
|
||||||
MoveCount++;
|
|
||||||
|
|
||||||
if (CheckWin()) {
|
|
||||||
sprintf(buffer, "You finished the game in %i moves.", MoveCount);
|
|
||||||
|
|
||||||
if (WMRunAlertPanel(WMWidgetScreen(w), win, "You Won!", buffer,
|
|
||||||
"Wee!", "Gah! Lemme retry!", NULL) == WAPRDefault) {
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ResetGame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void resizeObserver(void *self, WMNotification *notif)
|
|
||||||
{
|
|
||||||
WMSize size = WMGetViewSize(WMWidgetView(win));
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
WinSize = size.width;
|
|
||||||
for (y = 0; y < Size; y++) {
|
|
||||||
for (x = 0; x < Size; x++) {
|
|
||||||
if (MAP(x,y) >= 0) {
|
|
||||||
WMResizeWidget(Button[(int)MAP(x,y)],
|
|
||||||
WinSize/Size, WinSize/Size);
|
|
||||||
WMMoveWidget(Button[(int)MAP(x,y)],
|
|
||||||
x*(WinSize/Size), y*(WinSize/Size));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
Display *dpy;
|
|
||||||
WMScreen *scr;
|
|
||||||
int x, y, i;
|
|
||||||
|
|
||||||
WMInitializeApplication("Puzzle", &argc, argv);
|
|
||||||
|
|
||||||
|
|
||||||
dpy = XOpenDisplay("");
|
|
||||||
if (!dpy) {
|
|
||||||
printf("could not open display\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
|
|
||||||
|
|
||||||
win = WMCreateWindow(scr, "puzzle");
|
|
||||||
WMResizeWidget(win, WinSize, WinSize);
|
|
||||||
WMSetWindowTitle(win, "zuPzel");
|
|
||||||
WMSetWindowMinSize(win, 80, 80);
|
|
||||||
WMSetWindowAspectRatio(win, 2, 2, 2, 2);
|
|
||||||
WMSetWindowResizeIncrements(win, Size, Size);
|
|
||||||
WMSetViewNotifySizeChanges(WMWidgetView(win), True);
|
|
||||||
WMAddNotificationObserver(resizeObserver, NULL,
|
|
||||||
WMViewSizeDidChangeNotification,
|
|
||||||
WMWidgetView(win));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i = y = 0; y < Size && i < Size*Size-1; y++) {
|
|
||||||
for (x = 0; x < Size && i < Size*Size-1; x++) {
|
|
||||||
char buf[32];
|
|
||||||
WMColor *color;
|
|
||||||
RColor col;
|
|
||||||
RHSVColor hsv;
|
|
||||||
|
|
||||||
hsv.hue = i*360/(Size*Size-1);
|
|
||||||
hsv.saturation = 120;
|
|
||||||
hsv.value = 200;
|
|
||||||
|
|
||||||
RHSVtoRGB(&hsv, &col);
|
|
||||||
|
|
||||||
color = WMCreateRGBColor(scr, col.red<<8, col.green<<8,
|
|
||||||
col.blue<<8, False);
|
|
||||||
|
|
||||||
MAP(x,y) = i;
|
|
||||||
Button[i] = WMCreateButton(win, WBTMomentaryLight);
|
|
||||||
WMSetWidgetBackgroundColor(Button[i], color);
|
|
||||||
WMReleaseColor(color);
|
|
||||||
WMSetButtonAction(Button[i], buttonClick, (void*)i);
|
|
||||||
WMResizeWidget(Button[i], WinSize/Size, WinSize/Size);
|
|
||||||
WMMoveWidget(Button[i], x*(WinSize/Size), y*(WinSize/Size));
|
|
||||||
sprintf(buf, "%i", i+1);
|
|
||||||
WMSetButtonText(Button[i], buf);
|
|
||||||
WMSetButtonTextAlignment(Button[i], WACenter);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WMMapSubwidgets(win);
|
|
||||||
WMMapWidget(win);
|
|
||||||
WMRealizeWidget(win);
|
|
||||||
|
|
||||||
ResetGame();
|
|
||||||
|
|
||||||
WMScreenMainLoop(scr);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
build
|
|
||||||
WINGs.c
|
|
||||||
wings.so
|
|
||||||
*.pyc
|
|
||||||
*.pyo
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
all: WINGs.c
|
|
||||||
python setup.py build
|
|
||||||
ln -sf `find build/ -name wings.so` .
|
|
||||||
|
|
||||||
install: WINGs.c
|
|
||||||
python setup.py install
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build dist WINGs.c *.o *~ *.so MANIFEST wings.py *.pyc *.pyo core
|
|
||||||
|
|
||||||
dist:
|
|
||||||
python setup.py sdist
|
|
||||||
|
|
||||||
WINGs.c: WINGs.i
|
|
||||||
swig -python -noproxy `get-wings-flags --cflags` -I.. -o WINGs.c WINGs.i
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
This is a python wrapper for the WINGs library, that can be used to write python
|
|
||||||
based programs with WINGs-based graphic interfaces.
|
|
||||||
|
|
||||||
This module in not built by default. To build it you need python2.1 or later
|
|
||||||
and swig-1.3.14 or later.
|
|
||||||
|
|
||||||
To build it, first compile and install WINGs. after that run 'make' in this
|
|
||||||
directory. 'make install' will install the python module into the python tree.
|
|
||||||
|
|
||||||
run test.py or WINGs.py for an example.
|
|
||||||
|
|
||||||
the code is not finished yet and may fail to work as expected in some cases.
|
|
||||||
|
|
||||||
Note: currently the module expects WINGs installed to build. it won't take
|
|
||||||
the WINGs libraries and header files from the source tree. You need to
|
|
||||||
install WINGs first. Even if an old version of WINGs is already installed,
|
|
||||||
you still need to install the newly built WINGs, else the python module will
|
|
||||||
be built against the old version.
|
|
||||||
|
|
||||||
@@ -1,699 +0,0 @@
|
|||||||
%module wings
|
|
||||||
%{
|
|
||||||
#include "WINGs/WINGsP.h"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include typemaps.i
|
|
||||||
|
|
||||||
// This tells SWIG to treat char ** as a special case
|
|
||||||
%typemap(python, in) char ** {
|
|
||||||
/* Check if is a list */
|
|
||||||
if (PyList_Check($input)) {
|
|
||||||
int size = PyList_Size($input);
|
|
||||||
int i = 0;
|
|
||||||
$1 = (char **) wmalloc((size+1)*sizeof(char *));
|
|
||||||
for (i = 0; i < size; i++) {
|
|
||||||
PyObject *o = PyList_GetItem($input, i);
|
|
||||||
if (PyString_Check(o))
|
|
||||||
$1[i] = PyString_AsString(PyList_GetItem($input, i));
|
|
||||||
else {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "list must contain strings");
|
|
||||||
wfree($1);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$1[i] = 0;
|
|
||||||
} else {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "not a list");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// This cleans up the char ** array we malloc-ed before the function call
|
|
||||||
%typemap(python, freearg) char ** {
|
|
||||||
wfree($1);
|
|
||||||
}
|
|
||||||
// This allows a C function to return a char ** as a Python list
|
|
||||||
%typemap(python, out) char ** {
|
|
||||||
int len,i;
|
|
||||||
len = 0;
|
|
||||||
while ($1[len]) len++;
|
|
||||||
$result = PyList_New(len);
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
PyList_SetItem($result, i, PyString_FromString($1[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now for some callbacks
|
|
||||||
%typemap(python, in) PyObject *pyacArgs {
|
|
||||||
if (PyTuple_Check($input)) {
|
|
||||||
if (PyTuple_Size($input) != 3) {
|
|
||||||
PyErr_SetString(PyExc_ValueError,
|
|
||||||
"wrong number of parameters in tuple. should be 3.");
|
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
PyObject *func = PyTuple_GetItem($input, 1);
|
|
||||||
if (func!=Py_None && !PyCallable_Check(func)) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,
|
|
||||||
"'action' needs to be a callable object!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "2nd argument not a tuple!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$1 = $input;
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(python, in) PyObject *pycArgs {
|
|
||||||
if (PyTuple_Check($input)) {
|
|
||||||
if (PyTuple_Size($input) != 2) {
|
|
||||||
PyErr_SetString(PyExc_ValueError,
|
|
||||||
"wrong number of parameters in tuple. should be 2.");
|
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
PyObject *func = PyTuple_GetItem($input, 0);
|
|
||||||
if (func!=Py_None && !PyCallable_Check(func)) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,
|
|
||||||
"'action' needs to be a callable object!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "2nd argument not a tuple!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$1 = $input;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type mapping for grabbing a FILE * from Python
|
|
||||||
%typemap(python, in) FILE * {
|
|
||||||
if (!PyFile_Check($input)) {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "Need a file!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$1 = PyFile_AsFile($input);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These are for free-ing the return of functions that need to be freed
|
|
||||||
* before returning control to python. */
|
|
||||||
%typemap(python, ret) char* WMGetTextFieldText { wfree($1); };
|
|
||||||
|
|
||||||
|
|
||||||
%include exception.i
|
|
||||||
|
|
||||||
%exception pyWMScreenMainLoop {
|
|
||||||
$function
|
|
||||||
if (PyErr_Occurred())
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
%exception pyWMRunModalLoop {
|
|
||||||
$function
|
|
||||||
if (PyErr_Occurred())
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
%{
|
|
||||||
static int mainLoopDone = 0;
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
%inline %{
|
|
||||||
WMScreen *pyWMOpenScreen(const char *display, int simpleapp)
|
|
||||||
{
|
|
||||||
Display *dpy = XOpenDisplay(display);
|
|
||||||
|
|
||||||
if (!dpy) {
|
|
||||||
wwarning("WINGs: could not open display %s", XDisplayName(display));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (simpleapp) {
|
|
||||||
return WMCreateSimpleApplicationScreen(dpy);
|
|
||||||
} else {
|
|
||||||
return WMCreateScreen(dpy, DefaultScreen(dpy));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMScreenMainLoop(WMScreen *scr)
|
|
||||||
{
|
|
||||||
XEvent event;
|
|
||||||
|
|
||||||
while (!PyErr_Occurred() && !mainLoopDone) {
|
|
||||||
WMNextEvent(((W_Screen*)scr)->display, &event);
|
|
||||||
WMHandleEvent(&event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMBreakScreenMainLoop(WMScreen *scr)
|
|
||||||
{
|
|
||||||
mainLoopDone = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMRunModalLoop(WMScreen *scr, WMView *view)
|
|
||||||
{
|
|
||||||
int oldModalLoop = scr->modalLoop;
|
|
||||||
WMView *oldModalView = scr->modalView;
|
|
||||||
|
|
||||||
scr->modalView = view;
|
|
||||||
|
|
||||||
scr->modalLoop = 1;
|
|
||||||
while (!PyErr_Occurred() && scr->modalLoop) {
|
|
||||||
XEvent event;
|
|
||||||
|
|
||||||
WMNextEvent(scr->display, &event);
|
|
||||||
WMHandleEvent(&event);
|
|
||||||
}
|
|
||||||
|
|
||||||
scr->modalView = oldModalView;
|
|
||||||
scr->modalLoop = oldModalLoop;
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
//%rename WMScreenMainLoop _WMScreenMainLoop;
|
|
||||||
//%rename(_WMScreenMainLoop) WMScreenMainLoop;
|
|
||||||
//%rename WMRunModalLoop _WMRunModalLoop;
|
|
||||||
|
|
||||||
|
|
||||||
%{
|
|
||||||
/* These functions match the prototypes of the normal C callback
|
|
||||||
* functions. However, we use the clientdata pointer for holding a
|
|
||||||
* reference to a Python tuple containing (object, funct, clientData).
|
|
||||||
*/
|
|
||||||
static void PythonWMActionCallback(WMWidget *widget, void *cdata)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
|
|
||||||
tuple = (PyObject*) cdata;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
func = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (func && func!=Py_None) {
|
|
||||||
pydata = PyTuple_GetItem(tuple, 2);
|
|
||||||
arglist = Py_BuildValue("(OO)", pyobj, pydata);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void PythonWMCallback(void *data)
|
|
||||||
{
|
|
||||||
PyObject *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
|
|
||||||
tuple = (PyObject*) data;
|
|
||||||
func = PyTuple_GetItem(tuple, 0);
|
|
||||||
if (func && func!=Py_None) {
|
|
||||||
pydata = PyTuple_GetItem(tuple, 1);
|
|
||||||
arglist = Py_BuildValue("(O)", pydata);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
pyTextFieldDidBeginEditing(WMTextFieldDelegate *self, WMNotification *notif)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
int action;
|
|
||||||
|
|
||||||
tuple = (PyObject*) self->data;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
delegate = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (delegate != Py_None) {
|
|
||||||
// should we call PyObject_HasAttrString()?? rather not and let
|
|
||||||
// python raise an exception because the object doesn't has the
|
|
||||||
// attribute
|
|
||||||
func = PyObject_GetAttrString(delegate, "didBeginEditing");
|
|
||||||
if (func!=NULL && func!=Py_None) {
|
|
||||||
pydata = PyObject_GetAttrString(delegate, "data");
|
|
||||||
if (!pydata) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
pydata = Py_None;
|
|
||||||
}
|
|
||||||
action = (int)WMGetNotificationClientData(notif);
|
|
||||||
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
Py_DECREF(pydata);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
Py_XDECREF(func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
pyTextFieldDidChange(WMTextFieldDelegate *self, WMNotification *notif)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
int action;
|
|
||||||
|
|
||||||
tuple = (PyObject*) self->data;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
delegate = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (delegate != Py_None) {
|
|
||||||
func = PyObject_GetAttrString(delegate, "didChange");
|
|
||||||
if (func!=NULL && func!=Py_None) {
|
|
||||||
pydata = PyObject_GetAttrString(delegate, "data");
|
|
||||||
if (!pydata) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
pydata = Py_None;
|
|
||||||
}
|
|
||||||
action = (int)WMGetNotificationClientData(notif);
|
|
||||||
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
Py_DECREF(pydata);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
Py_XDECREF(func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
pyTextFieldDidEndEditing(WMTextFieldDelegate *self, WMNotification *notif)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
int action;
|
|
||||||
|
|
||||||
tuple = (PyObject*) self->data;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
delegate = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (delegate != Py_None) {
|
|
||||||
func = PyObject_GetAttrString(delegate, "didEndEditing");
|
|
||||||
if (func!=NULL && func!=Py_None) {
|
|
||||||
pydata = PyObject_GetAttrString(delegate, "data");
|
|
||||||
if (!pydata) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
pydata = Py_None;
|
|
||||||
}
|
|
||||||
action = (int)WMGetNotificationClientData(notif);
|
|
||||||
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
Py_DECREF(pydata);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
Py_XDECREF(func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
pyTextFieldShouldBeginEditing(WMTextFieldDelegate *self, WMTextField *tPtr)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
Bool retval = False;
|
|
||||||
|
|
||||||
tuple = (PyObject*) self->data;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
delegate = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (delegate != Py_None) {
|
|
||||||
func = PyObject_GetAttrString(delegate, "shouldBeginEditing");
|
|
||||||
if (func!=NULL && func!=Py_None) {
|
|
||||||
pydata = PyObject_GetAttrString(delegate, "data");
|
|
||||||
if (!pydata) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
pydata = Py_None;
|
|
||||||
}
|
|
||||||
arglist = Py_BuildValue("(OO)", pyobj, pydata);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
if (result!=Py_None && PyInt_AsLong(result)!=0) {
|
|
||||||
retval = True;
|
|
||||||
}
|
|
||||||
Py_DECREF(pydata);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
Py_XDECREF(func);
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
pyTextFieldShouldEndEditing(WMTextFieldDelegate *self, WMTextField *tPtr)
|
|
||||||
{
|
|
||||||
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
|
|
||||||
Bool retval = False;
|
|
||||||
|
|
||||||
tuple = (PyObject*) self->data;
|
|
||||||
pyobj = PyTuple_GetItem(tuple, 0);
|
|
||||||
delegate = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (delegate != Py_None) {
|
|
||||||
func = PyObject_GetAttrString(delegate, "shouldEndEditing");
|
|
||||||
if (func!=NULL && func!=Py_None) {
|
|
||||||
pydata = PyObject_GetAttrString(delegate, "data");
|
|
||||||
if (!pydata) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
pydata = Py_None;
|
|
||||||
}
|
|
||||||
arglist = Py_BuildValue("(OO)", pyobj, pydata);
|
|
||||||
result = PyEval_CallObject(func, arglist);
|
|
||||||
if (result!=Py_None && PyInt_AsLong(result)!=0) {
|
|
||||||
retval = True;
|
|
||||||
}
|
|
||||||
Py_DECREF(pydata);
|
|
||||||
Py_DECREF(arglist);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
}
|
|
||||||
Py_XDECREF(func);
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
%inline %{
|
|
||||||
void pyWMSetWindowCloseAction(WMWindow *win, PyObject *pyacArgs) {
|
|
||||||
WMSetWindowCloseAction(win, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetButtonAction(WMButton *bPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetButtonAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetScrollerAction(WMScroller *sPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetScrollerAction(sPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetListAction(WMList *lPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetListAction(lPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetListDoubleAction(WMList *lPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetListDoubleAction(lPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetBrowserAction(WMBrowser *bPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetBrowserAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetBrowserDoubleAction(WMBrowser *bPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetBrowserDoubleAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetMenuItemAction(WMMenuItem *miPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetMenuItemAction(miPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetPopUpButtonAction(WMPopUpButton *pPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetPopUpButtonAction(pPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetSliderAction(WMSlider *sPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetSliderAction(sPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetRulerMoveAction(WMRuler *rPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetRulerMoveAction(rPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetRulerReleaseAction(WMRuler *rPtr, PyObject *pyacArgs) {
|
|
||||||
WMSetRulerReleaseAction(rPtr, PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMSetColorPanelAction(WMColorPanel *panel, PyObject *pyacArgs) {
|
|
||||||
WMSetColorPanelAction(panel, (WMAction2*)PythonWMActionCallback, (void*)pyacArgs);
|
|
||||||
Py_INCREF(pyacArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void* pyWMAddTimerHandler(int miliseconds, PyObject *pycArgs) {
|
|
||||||
Py_INCREF(pycArgs);
|
|
||||||
return (void*)WMAddTimerHandler(miliseconds, PythonWMCallback,
|
|
||||||
(void*)pycArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void* pyWMAddPersistentTimerHandler(int miliseconds, PyObject *pycArgs) {
|
|
||||||
Py_INCREF(pycArgs);
|
|
||||||
return (void*)WMAddPersistentTimerHandler(miliseconds, PythonWMCallback,
|
|
||||||
(void*)pycArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this doesn't work. we pass (func, data) as cdata at creation time, but
|
|
||||||
* only data at destruction, so it won't find it unless we change
|
|
||||||
* WMDeleteTimerWithClientData() to extract data from the tuple, and this
|
|
||||||
* requires access to the internals of WINGs
|
|
||||||
void pyWMDeleteTimerWithClientData(PyObject *pycData) {
|
|
||||||
WMDeleteTimerWithClientData((void*)pycData);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
void pyWMDeleteTimerHandler(void *handlerID) {
|
|
||||||
WMDeleteTimerHandler((WMHandlerID)handlerID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void* pyWMAddIdleHandler(PyObject *pycArgs) {
|
|
||||||
Py_INCREF(pycArgs);
|
|
||||||
return (void*)WMAddIdleHandler(PythonWMCallback, (void*)pycArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pyWMDeleteIdleHandler(void *handlerID) {
|
|
||||||
WMDeleteIdleHandler((WMHandlerID)handlerID);
|
|
||||||
}
|
|
||||||
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
%exception pyWMSetTextFieldDelegate {
|
|
||||||
$function
|
|
||||||
if (PyErr_Occurred()) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%inline %{
|
|
||||||
void pyWMSetTextFieldDelegate(WMTextField *tPtr, PyObject *txtArgs) {
|
|
||||||
WMTextFieldDelegate *td;
|
|
||||||
|
|
||||||
if (!txtArgs || !PyTuple_Check(txtArgs) || PyTuple_Size(txtArgs)!=2) {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "invalid setting of WMTextField "
|
|
||||||
"delegate. Should be '(self, delegate)'");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// how do I check if txtArgs[1] is an instance of WMTextFieldDelegate?
|
|
||||||
td = WMGetTextFieldDelegate(tPtr);
|
|
||||||
if (!td) {
|
|
||||||
td = (WMTextFieldDelegate*)wmalloc(sizeof(WMTextFieldDelegate));
|
|
||||||
td->didBeginEditing = pyTextFieldDidBeginEditing;
|
|
||||||
td->didChange = pyTextFieldDidChange;
|
|
||||||
td->didEndEditing = pyTextFieldDidEndEditing;
|
|
||||||
td->shouldBeginEditing = pyTextFieldShouldBeginEditing;
|
|
||||||
td->shouldEndEditing = pyTextFieldShouldEndEditing;
|
|
||||||
} else {
|
|
||||||
Py_XDECREF((PyObject*)td->data);
|
|
||||||
}
|
|
||||||
Py_INCREF(txtArgs);
|
|
||||||
td->data = txtArgs;
|
|
||||||
WMSetTextFieldDelegate(tPtr, td);
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
%inline %{
|
|
||||||
PyObject* pyWMGetTextFieldDelegate(WMTextField *tPtr) {
|
|
||||||
WMTextFieldDelegate *td;
|
|
||||||
PyObject *result, *tuple;
|
|
||||||
|
|
||||||
td = WMGetTextFieldDelegate(tPtr);
|
|
||||||
if (!td) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return Py_None;
|
|
||||||
}
|
|
||||||
|
|
||||||
tuple = (PyObject*)td->data;
|
|
||||||
if (!tuple || !PyTuple_Check(tuple) || PyTuple_Size(tuple)!=2) {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "invalid TextField delegate");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = PyTuple_GetItem(tuple, 1);
|
|
||||||
if (!result)
|
|
||||||
result = Py_None;
|
|
||||||
|
|
||||||
Py_INCREF(result);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
/* ignore structures we will not use */
|
|
||||||
%ignore ConnectionDelegate;
|
|
||||||
|
|
||||||
/* ignore functions we don't need */
|
|
||||||
// should we ignore vararg functions, or just convert them to functions with
|
|
||||||
// a fixed number of parameters?
|
|
||||||
%varargs(char*) wmessage;
|
|
||||||
//%ignore wmessage;
|
|
||||||
%ignore wwarning;
|
|
||||||
%ignore wfatal;
|
|
||||||
%ignore wsyserror;
|
|
||||||
%ignore wsyserrorwithcode;
|
|
||||||
%ignore WMCreatePLArray;
|
|
||||||
%ignore WMCreatePLDictionary;
|
|
||||||
|
|
||||||
%apply int *INPUT { int *argc };
|
|
||||||
|
|
||||||
#define Bool int
|
|
||||||
|
|
||||||
%include "WINGs/WUtil.h"
|
|
||||||
|
|
||||||
/* ignore structures we will not use */
|
|
||||||
|
|
||||||
/* ignore functions we don't need */
|
|
||||||
|
|
||||||
%include "WINGs/WINGs.h"
|
|
||||||
|
|
||||||
|
|
||||||
%{
|
|
||||||
void
|
|
||||||
WHandleEvents()
|
|
||||||
{
|
|
||||||
/* Check any expired timers */
|
|
||||||
W_CheckTimerHandlers();
|
|
||||||
|
|
||||||
/* Do idle and timer stuff while there are no input events */
|
|
||||||
/* Do not wait for input here. just peek to se if input is available */
|
|
||||||
while (!W_HandleInputEvents(False, -1) && W_CheckIdleHandlers()) {
|
|
||||||
/* dispatch timer events */
|
|
||||||
W_CheckTimerHandlers();
|
|
||||||
}
|
|
||||||
|
|
||||||
W_HandleInputEvents(True, -1);
|
|
||||||
|
|
||||||
/* Check any expired timers */
|
|
||||||
W_CheckTimerHandlers();
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
/* rewrite functions originally defined as macros */
|
|
||||||
%inline %{
|
|
||||||
#undef WMDuplicateArray
|
|
||||||
WMArray* WMDuplicateArray(WMArray* array) {
|
|
||||||
return WMCreateArrayWithArray(array);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMPushInArray
|
|
||||||
void WMPushInArray(WMArray *array, void *item) {
|
|
||||||
WMAddToArray(array, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMSetInArray
|
|
||||||
void* WMSetInArray(WMArray *array, int index, void *item) {
|
|
||||||
return WMReplaceInArray(array, index, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMRemoveFromArray
|
|
||||||
int WMRemoveFromArray(WMArray *array, void *item) {
|
|
||||||
return WMRemoveFromArrayMatching(array, NULL, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMGetFirstInArray
|
|
||||||
int WMGetFirstInArray(WMArray *array, void *item) {
|
|
||||||
return WMFindInArray(array, NULL, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateBag
|
|
||||||
WMBag* WMCreateBag(int size) {
|
|
||||||
return WMCreateTreeBag();
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateBagWithDestructor
|
|
||||||
WMBag* WMCreateBagWithDestructor(int size, WMFreeDataProc *destructor) {
|
|
||||||
return WMCreateTreeBagWithDestructor(destructor);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMSetInBag
|
|
||||||
void* WMSetInBag(WMBag *bag, int index, void *item) {
|
|
||||||
return WMReplaceInBag(bag, index, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMAddItemToTree
|
|
||||||
WMTreeNode* WMAddItemToTree(WMTreeNode *parent, void *item) {
|
|
||||||
return WMInsertItemInTree(parent, -1, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMAddNodeToTree
|
|
||||||
WMTreeNode* WMAddNodeToTree(WMTreeNode *parent, WMTreeNode *aNode) {
|
|
||||||
return WMInsertNodeInTree(parent, -1, aNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMGetFirstInTree
|
|
||||||
/* Returns first tree node that has data == cdata */
|
|
||||||
WMTreeNode* WMGetFirstInTree(WMTreeNode *aTree, void *cdata) {
|
|
||||||
return WMFindInTree(aTree, NULL, cdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMFlushConnection
|
|
||||||
int WMFlushConnection(WMConnection *cPtr) {
|
|
||||||
return WMSendConnectionData(cPtr, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMGetConnectionQueuedData
|
|
||||||
WMArray* WMGetConnectionQueuedData(WMConnection *cPtr) {
|
|
||||||
return WMGetConnectionUnsentData(cPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMWidgetClass
|
|
||||||
W_Class WMWidgetClass(WMWidget *widget) {
|
|
||||||
return (((W_WidgetType*)(widget))->widgetClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMWidgetView
|
|
||||||
WMView* WMWidgetView(WMWidget *widget) {
|
|
||||||
return (((W_WidgetType*)(widget))->view);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateCommandButton
|
|
||||||
WMButton* WMCreateCommandButton(WMWidget *parent) {
|
|
||||||
return WMCreateCustomButton(parent, WBBSpringLoadedMask|WBBPushInMask
|
|
||||||
|WBBPushLightMask|WBBPushChangeMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateRadioButton
|
|
||||||
WMButton* WMCreateRadioButton(WMWidget *parent) {
|
|
||||||
return WMCreateButton(parent, WBTRadio);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateSwitchButton
|
|
||||||
WMButton* WMCreateSwitchButton(WMWidget *parent) {
|
|
||||||
return WMCreateButton(parent, WBTSwitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMAddListItem
|
|
||||||
WMListItem* WMAddListItem(WMList *lPtr, char *text)
|
|
||||||
{
|
|
||||||
return WMInsertListItem(lPtr, -1, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMCreateText
|
|
||||||
WMText* WMCreateText(WMWidget *parent) {
|
|
||||||
return WMCreateTextForDocumentType(parent, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMRefreshText
|
|
||||||
void WMRefreshText(WMText *tPtr) {
|
|
||||||
return WMThawText(tPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef WMClearText
|
|
||||||
void WMClearText(WMText *tPtr) {
|
|
||||||
return WMAppendTextStream(tPtr, NULL);
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,643 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import wings
|
|
||||||
|
|
||||||
# Some useful constants
|
|
||||||
|
|
||||||
False = 0
|
|
||||||
True = 1
|
|
||||||
|
|
||||||
# check about None as action for buttonAction/windowCloseAction ...
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Exceptions
|
|
||||||
################################################################################
|
|
||||||
from exceptions import Exception, StandardError
|
|
||||||
|
|
||||||
class Error(StandardError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
del Exception, StandardError
|
|
||||||
|
|
||||||
class WMTimer:
|
|
||||||
def __init__(self, milliseconds, callback, cdata=None, persistent=False):
|
|
||||||
if persistent:
|
|
||||||
self._o = wings.pyWMAddPersistentTimerHandler(milliseconds, (callback, cdata))
|
|
||||||
else:
|
|
||||||
self._o = wings.pyWMAddTimerHandler(milliseconds, (callback, cdata))
|
|
||||||
self.__WMDeleteTimerHandler = wings.pyWMDeleteTimerHandler
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.__WMDeleteTimerHandler(self._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMPersistentTimer(WMTimer):
|
|
||||||
def __init__(self, milliseconds, callback, cdata=None):
|
|
||||||
WMTimer.__init__(self, milliseconds, callback, cdata, persistent=True)
|
|
||||||
|
|
||||||
|
|
||||||
class WMScreen:
|
|
||||||
__readonly = ('display', 'width', 'height', 'depth')
|
|
||||||
|
|
||||||
def __init__(self, appname, display="", simpleapp=False):
|
|
||||||
wings.WMInitializeApplication(appname, len(sys.argv), sys.argv)
|
|
||||||
self._o = wings.pyWMOpenScreen(display, simpleapp)
|
|
||||||
if not self._o:
|
|
||||||
raise Error, "Cannot open display %s" % display
|
|
||||||
self.__dict__['display'] = wings.WMScreenDisplay(self._o)
|
|
||||||
self.__dict__['width'] = wings.WMScreenWidth(self._o)
|
|
||||||
self.__dict__['height'] = wings.WMScreenHeight(self._o)
|
|
||||||
self.__dict__['depth'] = wings.WMScreenDepth(self._o)
|
|
||||||
|
|
||||||
def __setattr__(self, name ,value):
|
|
||||||
if name in self.__readonly:
|
|
||||||
#raise AttributeError, "'%s' is a read-only WMScreen attribute" % name
|
|
||||||
raise Error, "'%s' is a read-only WMScreen attribute" % name
|
|
||||||
self.__dict__[name] = value
|
|
||||||
|
|
||||||
def __delattr__(self, name):
|
|
||||||
if name in self.__readonly:
|
|
||||||
#raise AttributeError, "'%s' attribute cannot be deleted from WMScreen instance" % name
|
|
||||||
raise Error, "'%s' attribute cannot be deleted from WMScreen instance" % name
|
|
||||||
try:
|
|
||||||
del(self.__dict__[name])
|
|
||||||
except KeyError:
|
|
||||||
raise AttributeError, "%s instance has no attribute '%s'" % \
|
|
||||||
(self.__class__.__name__, name)
|
|
||||||
|
|
||||||
def mainLoop(self):
|
|
||||||
wings.pyWMScreenMainLoop(self._o)
|
|
||||||
|
|
||||||
def breakMainLoop(self):
|
|
||||||
wings.pyWMBreakScreenMainLoop(self._o)
|
|
||||||
|
|
||||||
def runModalLoop(self, view):
|
|
||||||
wings.pyWMRunModalLoop(self._o, view)
|
|
||||||
|
|
||||||
def breakModalLoop(self):
|
|
||||||
wings.WMBreakModalLoop(self._o)
|
|
||||||
|
|
||||||
def size(self):
|
|
||||||
return (self.width, self.height)
|
|
||||||
|
|
||||||
|
|
||||||
class WMView:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class WMWidget(WMView):
|
|
||||||
def __init__(self):
|
|
||||||
if self.__class__ == WMWidget:
|
|
||||||
raise Error, "a WMWidget can't be instantiated directly"
|
|
||||||
self._o = None
|
|
||||||
self.__WMDestroyWidget = wings.WMDestroyWidget
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
if self._o is not None:
|
|
||||||
self.__WMDestroyWidget(self._o)
|
|
||||||
|
|
||||||
def resize(self, width, height):
|
|
||||||
wings.WMResizeWidget(self._o, width, height)
|
|
||||||
|
|
||||||
def move(self, x, y):
|
|
||||||
wings.WMMoveWidget(self._o, x, y)
|
|
||||||
|
|
||||||
def realize(self):
|
|
||||||
wings.WMRealizeWidget(self._o)
|
|
||||||
|
|
||||||
def show(self):
|
|
||||||
wings.WMMapWidget(self._o)
|
|
||||||
|
|
||||||
def hide(self):
|
|
||||||
wings.WMUnmapWidget(self._o)
|
|
||||||
|
|
||||||
def redisplay(self):
|
|
||||||
wings.WMRedisplayWidget(self._o)
|
|
||||||
|
|
||||||
def width(self):
|
|
||||||
return wings.WMWidgetWidth(self._o)
|
|
||||||
|
|
||||||
def height(self):
|
|
||||||
return wings.WMWidgetHeight(self._o)
|
|
||||||
|
|
||||||
def screen(self):
|
|
||||||
return wings.WMWidgetScreen(self._o)
|
|
||||||
|
|
||||||
def view(self):
|
|
||||||
return wings.WMWidgetView(self._o)
|
|
||||||
|
|
||||||
def setFocusTo(self, other):
|
|
||||||
wings.WMSetFocusToWidget(other._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMWindow(WMWidget):
|
|
||||||
def __init__(self, screen, name, style=wings.WMTitledWindowMask
|
|
||||||
|wings.WMClosableWindowMask|wings.WMMiniaturizableWindowMask
|
|
||||||
|wings.WMResizableWindowMask):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateWindowWithStyle(screen._o, name, style)
|
|
||||||
|
|
||||||
def setMinSize(self, minWidth, minHeight):
|
|
||||||
wings.WMSetWindowMinSize(self._o, minWidth, minHeight)
|
|
||||||
|
|
||||||
def setMaxSize(self, maxWidth, maxHeight):
|
|
||||||
wings.WMSetWindowMaxSize(self._o, maxWidth, maxHeight)
|
|
||||||
|
|
||||||
def setInitialPosition(self, x, y):
|
|
||||||
wings.WMSetWindowInitialPosition(self._o, x, y)
|
|
||||||
|
|
||||||
def setTitle(self, title):
|
|
||||||
wings.WMSetWindowTitle(self._o, title)
|
|
||||||
|
|
||||||
def setCloseAction(self, action, data=None):
|
|
||||||
if action!=None and (not callable(action)):
|
|
||||||
raise Error, "action needs to be a callable object or None"
|
|
||||||
wings.pyWMSetWindowCloseAction(self._o, (self, action, data))
|
|
||||||
|
|
||||||
|
|
||||||
class WMPanel(WMWindow):
|
|
||||||
def __init__(self, owner, name, style=wings.WMTitledWindowMask
|
|
||||||
|wings.WMClosableWindowMask|wings.WMResizableWindowMask):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreatePanelWithStyleForWindow(owner._o, name, style)
|
|
||||||
|
|
||||||
class WMFrame(WMWidget):
|
|
||||||
def __init__(self, parent, title=None):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateFrame(parent._o)
|
|
||||||
self.setTitle(title)
|
|
||||||
|
|
||||||
def setRelief(self, relief):
|
|
||||||
wings.WMSetFrameRelief(self._o, relief)
|
|
||||||
|
|
||||||
def setTitle(self, title=""):
|
|
||||||
wings.WMSetFrameTitle(self._o, title)
|
|
||||||
|
|
||||||
def setTitlePosition(self, position):
|
|
||||||
wings.WMSetFrameTitlePosition(self._o, position)
|
|
||||||
|
|
||||||
class WMLabel(WMWidget):
|
|
||||||
def __init__(self, parent, text=None):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateLabel(parent._o)
|
|
||||||
self.setText(text)
|
|
||||||
|
|
||||||
def setWraps(self, flag):
|
|
||||||
# bool(flag) for python2.2
|
|
||||||
wings.WMSetLabelWraps(self._o, flag)
|
|
||||||
|
|
||||||
def setRelief(self, relief):
|
|
||||||
wings.WMSetLabelRelief(self._o, relief)
|
|
||||||
|
|
||||||
def setText(self, text=""):
|
|
||||||
wings.WMSetLabelText(self._o, text)
|
|
||||||
|
|
||||||
def setTextColor(self, color):
|
|
||||||
wings.WMSetLabelTextColor(self._o, color)
|
|
||||||
|
|
||||||
def setFont(self, font):
|
|
||||||
wings.WMSetLabelFont(self._o, font)
|
|
||||||
|
|
||||||
def setTextAlignment(self, alignment):
|
|
||||||
wings.WMSetLabelTextAlignment(self._o, alignment)
|
|
||||||
|
|
||||||
def setImage(self, image):
|
|
||||||
wings.WMSetLabelImage(self._o, image)
|
|
||||||
|
|
||||||
def setImagePosition(self, position):
|
|
||||||
wings.WMSetLabelImagePosition(self._o, position)
|
|
||||||
|
|
||||||
def text(self):
|
|
||||||
return wings.WMGetLabelText(self._o)
|
|
||||||
|
|
||||||
def font(self):
|
|
||||||
return wings.WMGetLabelFont(self._o)
|
|
||||||
|
|
||||||
def image(self):
|
|
||||||
return wings.WMGetLabelImage(self._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMBox(WMWidget):
|
|
||||||
def __init__(self, parent):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateBox(parent._o)
|
|
||||||
|
|
||||||
def setHorizontal(self, flag):
|
|
||||||
# bool(flag) for python2.2
|
|
||||||
wings.WMSetBoxHorizontal(self._o, flag)
|
|
||||||
|
|
||||||
def setBorderWidth(self, width):
|
|
||||||
wings.WMSetBoxBorderWidth(self._o, width)
|
|
||||||
|
|
||||||
def addSubview(self, view, expand, fill, minSize, maxSize, space):
|
|
||||||
wings.WMAddBoxSubview(self._o, view, expand, fill, minSize, maxSixe, space)
|
|
||||||
|
|
||||||
def addSubviewAtEnd(self, view, expand, fill, minSize, maxSize, space):
|
|
||||||
wings.WMAddBoxSubviewAtEnd(self._o, view, expand, fill, minSize, maxSixe, space)
|
|
||||||
|
|
||||||
def removeSubview(self, view):
|
|
||||||
wings.WMRemoveBoxSubview(self._o, view)
|
|
||||||
|
|
||||||
|
|
||||||
class WMButton(WMWidget): # not for user instantiation
|
|
||||||
def __init__(self, parent):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
if self.__class__ == WMButton:
|
|
||||||
raise Error, "a WMButton can't be instantiated directly"
|
|
||||||
|
|
||||||
|
|
||||||
def setText(self, text=""):
|
|
||||||
wings.WMSetButtonText(self._o, text)
|
|
||||||
|
|
||||||
def setAction(self, action, data=None):
|
|
||||||
if action!=None and (not callable(action)):
|
|
||||||
raise Error, "action needs to be a callable object or None"
|
|
||||||
wings.pyWMSetButtonAction(self._o, (self, action, data))
|
|
||||||
|
|
||||||
def performClick(self):
|
|
||||||
wings.WMPerformButtonClick(self._o)
|
|
||||||
|
|
||||||
def setEnabled(self, flag):
|
|
||||||
# bool(flag) for python2.2
|
|
||||||
wings.WMSetButtonEnabled(self._o, flag)
|
|
||||||
|
|
||||||
def isEnabled(self):
|
|
||||||
return wings.WMGetButtonEnabled(self._o)
|
|
||||||
|
|
||||||
def setImageDimsWhenDisabled(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetButtonImageDimsWhenDisabled(self._o, flag)
|
|
||||||
|
|
||||||
def setImage(self, image):
|
|
||||||
wings.WMSetButtonImage(self_.o, image)
|
|
||||||
|
|
||||||
def setAlternateImage(self, image):
|
|
||||||
wings.WMSetButtonAltImage(self._o, image)
|
|
||||||
|
|
||||||
def setImagePosition(self, position):
|
|
||||||
wings.WMSetButtonImagePosition(self._o, position)
|
|
||||||
|
|
||||||
def setImageDefault(self):
|
|
||||||
wings.WMSetButtonImageDefault(self._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMCommandButton(WMButton):
|
|
||||||
def __init__(self, parent):
|
|
||||||
WMButton.__init__(self, parent)
|
|
||||||
self._o = wings.WMCreateCommandButton(parent._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMSwitchButton(WMButton):
|
|
||||||
def __init__(self, parent):
|
|
||||||
WMButton.__init__(self, parent)
|
|
||||||
self._o = wings.WMCreateSwitchButton(parent._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMRadioButton(WMButton):
|
|
||||||
def __init__(self, parent, group=None):
|
|
||||||
WMButton.__init__(self, parent)
|
|
||||||
self._o = wings.WMCreateRadioButton(parent._o)
|
|
||||||
if group:
|
|
||||||
wings.WMGroupButtons(group._o, self._o)
|
|
||||||
|
|
||||||
|
|
||||||
class WMListItem:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class WMList(WMWidget):
|
|
||||||
def __init__(self, parent):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateList(parent._o)
|
|
||||||
|
|
||||||
def allowEmptySelection(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetListAllowEmptySelection(self._o, flag)
|
|
||||||
|
|
||||||
def allowMultipleSelection(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetListAllowMultipleSelection(self._o, flag)
|
|
||||||
|
|
||||||
def addItem(self, item):
|
|
||||||
wings.WMAddListItem(self._o, item)
|
|
||||||
|
|
||||||
def insertItem(self, row, item):
|
|
||||||
wings.WMInsertListItem(self._o, row, item)
|
|
||||||
|
|
||||||
def sortItems(self):
|
|
||||||
wings.WMSortListItems(self._o)
|
|
||||||
|
|
||||||
def rowWithTitle(self, title):
|
|
||||||
return wings.WMFindRowOfListItemWithTitle(self._o, title)
|
|
||||||
|
|
||||||
def selectedItemRow(self):
|
|
||||||
return wings.WMGetListSelectedItemRow(self._o)
|
|
||||||
|
|
||||||
def selectedItem(self):
|
|
||||||
return wings.WMGetListSelectedItem(self._o)
|
|
||||||
|
|
||||||
def removeItem(self, index):
|
|
||||||
wings.WMRemoveListItem(self._o, index)
|
|
||||||
|
|
||||||
def selectItem(self, index):
|
|
||||||
wings.WMSelectListItem(self._o, index)
|
|
||||||
|
|
||||||
def unselectItem(self, index):
|
|
||||||
wings.WMUnselectListItem(self._o, index)
|
|
||||||
|
|
||||||
|
|
||||||
class WMTextFieldDelegate:
|
|
||||||
__callbacks = ('didBeginEditing', 'didChange', 'didEndEditing',
|
|
||||||
'shouldBeginEditing', 'shouldEndEditing')
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.__dict__['data'] = None
|
|
||||||
self.__dict__['didBeginEditing'] = None
|
|
||||||
self.__dict__['didChange'] = None
|
|
||||||
self.__dict__['didEndEditing'] = None
|
|
||||||
self.__dict__['shouldBeginEditing'] = None
|
|
||||||
self.__dict__['shouldEndEditing'] = None
|
|
||||||
|
|
||||||
def __setattr__(self, name ,value):
|
|
||||||
if name in self.__callbacks and value!=None and (not callable(value)):
|
|
||||||
#raise AttributeError, "%s.%s needs to be a callable object or None" % (self.__class__.__name__, name)
|
|
||||||
raise Error, "%s.%s needs to be a callable object or None" % (self.__class__.__name__, name)
|
|
||||||
else:
|
|
||||||
self.__dict__[name] = value
|
|
||||||
|
|
||||||
|
|
||||||
class WMTextField(WMWidget):
|
|
||||||
def __init__(self, parent, text=""):
|
|
||||||
WMWidget.__init__(self)
|
|
||||||
self._o = wings.WMCreateTextField(parent._o)
|
|
||||||
wings.WMSetTextFieldText(self._o, text)
|
|
||||||
|
|
||||||
def setDelegate(self, delegate):
|
|
||||||
if delegate.__class__ != WMTextFieldDelegate:
|
|
||||||
raise Error, "textfield delegate must be of type 'WMTextFieldDelegate'"
|
|
||||||
wings.pyWMSetTextFieldDelegate(self._o, (self, delegate))
|
|
||||||
|
|
||||||
def delegate(self):
|
|
||||||
return wings.pyWMGetTextFieldDelegate(self._o)
|
|
||||||
|
|
||||||
def text(self):
|
|
||||||
return wings.WMGetTextFieldText(self._o)
|
|
||||||
|
|
||||||
def setEditable(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetTextFieldEditable(self._o, flag)
|
|
||||||
|
|
||||||
def setBordered(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetTextFieldBordered(self._o, flag)
|
|
||||||
|
|
||||||
def setBeveled(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetTextFieldBeveled(self._o, flag)
|
|
||||||
|
|
||||||
def setSecure(self, flag):
|
|
||||||
# bool(flag)
|
|
||||||
wings.WMSetTextFieldSecure(self._o, flag)
|
|
||||||
|
|
||||||
def setCursorPosition(self, position):
|
|
||||||
wings.WMSetTextFieldCursorPosition(self._o, position)
|
|
||||||
|
|
||||||
def setNextText(self, next):
|
|
||||||
wings.WMSetTextFieldNextTextField(self._o, next._o)
|
|
||||||
|
|
||||||
def setPreviousText(self, previous):
|
|
||||||
wings.WMSetTextFieldPrevTextField(self._o, previous._o)
|
|
||||||
|
|
||||||
def setTextAlignment(self, alignment):
|
|
||||||
wings.WMSetTextFieldAlignment(self._o, alignment)
|
|
||||||
|
|
||||||
def isEditable(self):
|
|
||||||
return wings.WMGetTextFieldEditable(self._o)
|
|
||||||
|
|
||||||
def insertText(self, text, position):
|
|
||||||
wings.WMInsertTextFieldText(self._o, text, position)
|
|
||||||
|
|
||||||
def deleteText(self, start, count):
|
|
||||||
wings.WMDeleteTextFieldRange(self._o, wings.wmkrange(start, count))
|
|
||||||
|
|
||||||
def selectText(self, start, count):
|
|
||||||
wings.WMSelectTextFieldRange(self._o, wings.wmkrange(start, count))
|
|
||||||
|
|
||||||
def setFont(self, font):
|
|
||||||
wings.WMSetTextFieldFont(self._o, font)
|
|
||||||
|
|
||||||
def font(self):
|
|
||||||
return wings.WMGetTextFieldFont(self._o)
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# wrap the WINGs constants so we don't need wings.constant_name
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# WMWindow title style
|
|
||||||
WMTitledWindowMask = wings.WMTitledWindowMask
|
|
||||||
WMClosableWindowMask = wings.WMClosableWindowMask
|
|
||||||
WMMiniaturizableWindowMask = wings.WMMiniaturizableWindowMask
|
|
||||||
WMResizableWindowMask = wings.WMResizableWindowMask
|
|
||||||
|
|
||||||
# WMFrame title positions
|
|
||||||
WTPNoTitle = wings.WTPNoTitle
|
|
||||||
WTPAboveTop = wings.WTPAboveTop
|
|
||||||
WTPAtTop = wings.WTPAtTop
|
|
||||||
WTPBelowTop = wings.WTPBelowTop
|
|
||||||
WTPAboveBottom = wings.WTPAboveBottom
|
|
||||||
WTPAtBottom = wings.WTPAtBottom
|
|
||||||
WTPBelowBottom = wings.WTPBelowBottom
|
|
||||||
|
|
||||||
# Alingments
|
|
||||||
WALeft = wings.WALeft
|
|
||||||
WACenter = wings.WACenter
|
|
||||||
WARight = wings.WARight
|
|
||||||
WAJustified = wings.WAJustified # not valid for textfields
|
|
||||||
|
|
||||||
# Image positions
|
|
||||||
WIPNoImage = wings.WIPNoImage
|
|
||||||
WIPImageOnly = wings.WIPImageOnly
|
|
||||||
WIPLeft = wings.WIPLeft
|
|
||||||
WIPRight = wings.WIPRight
|
|
||||||
WIPBelow = wings.WIPBelow
|
|
||||||
WIPAbove = wings.WIPAbove
|
|
||||||
WIPOverlaps = wings.WIPOverlaps
|
|
||||||
|
|
||||||
# Relief types
|
|
||||||
WRFlat = wings.WRFlat
|
|
||||||
WRSimple = wings.WRSimple
|
|
||||||
WRRaised = wings.WRRaised
|
|
||||||
WRSunken = wings.WRSunken
|
|
||||||
WRGroove = wings.WRGroove
|
|
||||||
WRRidge = wings.WRRidge
|
|
||||||
WRPushed = wings.WRPushed
|
|
||||||
|
|
||||||
|
|
||||||
# TextField events
|
|
||||||
WMReturnTextMovement = wings.WMReturnTextMovement
|
|
||||||
WMEscapeTextMovement = wings.WMEscapeTextMovement
|
|
||||||
WMIllegalTextMovement = wings.WMIllegalTextMovement
|
|
||||||
WMTabTextMovement = wings.WMTabTextMovement
|
|
||||||
WMBacktabTextMovement = wings.WMBacktabTextMovement
|
|
||||||
WMLeftTextMovement = wings.WMLeftTextMovement
|
|
||||||
WMRightTextMovement = wings.WMRightTextMovement
|
|
||||||
WMUpTextMovement = wings.WMUpTextMovement
|
|
||||||
WMDownTextMovement = wings.WMDownTextMovement
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
def quit(obj, data):
|
|
||||||
#sys.exit()
|
|
||||||
scr.breakMainLoop()
|
|
||||||
|
|
||||||
def click(btn, list):
|
|
||||||
print win.width(), win.height()
|
|
||||||
print list.selectedItemRow()
|
|
||||||
win2.show()
|
|
||||||
scr.runModalLoop(win2.view())
|
|
||||||
print txt2.text()
|
|
||||||
|
|
||||||
def sayhi(btn, data):
|
|
||||||
print "hi"
|
|
||||||
|
|
||||||
def breakLoop(btn, data):
|
|
||||||
#sys.exit()
|
|
||||||
scr.breakModalLoop()
|
|
||||||
win2.hide()
|
|
||||||
|
|
||||||
def dc(object, data, action):
|
|
||||||
print "didChange:", object, data, action
|
|
||||||
|
|
||||||
def dbe(object, data, action):
|
|
||||||
print "didBeginEditing:", object, data, action
|
|
||||||
|
|
||||||
def dee(object, data, action):
|
|
||||||
if action == wings.WMReturnTextMovement:
|
|
||||||
if object == txt:
|
|
||||||
object.setFocusTo(txt2)
|
|
||||||
else:
|
|
||||||
object.setFocusTo(txt)
|
|
||||||
print "didEndEditing:", object, data, action, object.text()
|
|
||||||
|
|
||||||
def tcb(one):
|
|
||||||
old = list.selectedItemRow()
|
|
||||||
list.selectItem(list.index)
|
|
||||||
list.unselectItem(old)
|
|
||||||
list.index = (list.index+1) % 3
|
|
||||||
#print one
|
|
||||||
|
|
||||||
scr = WMScreen("foobar")
|
|
||||||
win = WMWindow(scr, "aWindow")
|
|
||||||
win.setCloseAction(quit)
|
|
||||||
win.setTitle("test window")
|
|
||||||
win.resize(400, 180)
|
|
||||||
win.setInitialPosition((scr.width-win.width())/2, (scr.height-win.height())/2)
|
|
||||||
|
|
||||||
btn = WMCommandButton(win)
|
|
||||||
btn.setText("Click Me")
|
|
||||||
btn.resize(100, 25)
|
|
||||||
btn.move(20, 20)
|
|
||||||
btn.show()
|
|
||||||
|
|
||||||
sw = WMSwitchButton(win)
|
|
||||||
sw.setText("Some option")
|
|
||||||
sw.resize(100, 25)
|
|
||||||
sw.move(20, 50)
|
|
||||||
sw.show()
|
|
||||||
|
|
||||||
radios = []
|
|
||||||
r = None
|
|
||||||
j = 0
|
|
||||||
for i in ["One", "Two", "Four"]:
|
|
||||||
r = WMRadioButton(win, r)
|
|
||||||
radios.append(r)
|
|
||||||
r.show()
|
|
||||||
r.setText(i)
|
|
||||||
r.move(20, 70+j*25)
|
|
||||||
r.resize(100, 25)
|
|
||||||
j=j+1
|
|
||||||
|
|
||||||
sw.setAction(sayhi)
|
|
||||||
|
|
||||||
list = WMList(win)
|
|
||||||
list.resize(100,100)
|
|
||||||
list.move(130, 20)
|
|
||||||
list.addItem("one")
|
|
||||||
list.addItem("two")
|
|
||||||
list.addItem("three")
|
|
||||||
list.allowMultipleSelection(1)
|
|
||||||
list.show()
|
|
||||||
list.index = 0
|
|
||||||
|
|
||||||
txtdel = WMTextFieldDelegate()
|
|
||||||
txtdel.data = 'mydata'
|
|
||||||
txtdel.didBeginEditing = dbe
|
|
||||||
txtdel.didEndEditing = dee
|
|
||||||
txtdel.didChange = dc
|
|
||||||
|
|
||||||
txt = WMTextField(win, "abc")
|
|
||||||
txt.resize(95, 20)
|
|
||||||
txt.move(295, 20)
|
|
||||||
txt.setDelegate(txtdel)
|
|
||||||
txt.show()
|
|
||||||
txt2 = WMTextField(win, "01234567890")
|
|
||||||
txt2.resize(95, 20)
|
|
||||||
txt2.move(295, 45)
|
|
||||||
txt2.setDelegate(txtdel)
|
|
||||||
txt2.show()
|
|
||||||
|
|
||||||
txt.setNextText(txt2)
|
|
||||||
txt2.setNextText(txt)
|
|
||||||
|
|
||||||
label = WMLabel(win, "Text1:")
|
|
||||||
label.setTextAlignment(WARight)
|
|
||||||
label.move(240, 20)
|
|
||||||
label.resize(55, 20)
|
|
||||||
label.show()
|
|
||||||
|
|
||||||
label2 = WMLabel(win, "mytext2:")
|
|
||||||
label2.setTextAlignment(WARight)
|
|
||||||
label2.move(240, 45)
|
|
||||||
label2.resize(55, 20)
|
|
||||||
label2.show()
|
|
||||||
|
|
||||||
btn.setAction(click, list)
|
|
||||||
|
|
||||||
frame = WMFrame(win, "My Frame")
|
|
||||||
frame.resize(150, 50)
|
|
||||||
frame.move(240, 70)
|
|
||||||
#frame.setRelief(WRPushed)
|
|
||||||
frame.show()
|
|
||||||
|
|
||||||
ebtn = WMCommandButton(win)
|
|
||||||
ebtn.setText("Exit")
|
|
||||||
ebtn.resize(100, 25)
|
|
||||||
ebtn.move(290, 147)
|
|
||||||
ebtn.setAction(quit)
|
|
||||||
ebtn.show()
|
|
||||||
|
|
||||||
win.realize()
|
|
||||||
win.show()
|
|
||||||
|
|
||||||
timer = WMPersistentTimer(1000, tcb, win)
|
|
||||||
#del(timer)
|
|
||||||
#timer.delete()
|
|
||||||
|
|
||||||
win2 = WMPanel(win, "anotherWindow", WMTitledWindowMask)
|
|
||||||
win2.setTitle("transient test window")
|
|
||||||
win2.resize(150, 50)
|
|
||||||
win2.setInitialPosition((scr.width-win2.width())/2, (scr.height-win2.height())/2)
|
|
||||||
|
|
||||||
btn7 = WMCommandButton(win2)
|
|
||||||
btn7.setText("Dismiss")
|
|
||||||
btn7.resize(100, 25)
|
|
||||||
btn7.move(27, 10)
|
|
||||||
btn7.show()
|
|
||||||
btn7.setAction(breakLoop)
|
|
||||||
|
|
||||||
win2.realize()
|
|
||||||
|
|
||||||
scr.mainLoop()
|
|
||||||
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""Setup script for the WINGs module distribution."""
|
|
||||||
|
|
||||||
import os, sys
|
|
||||||
from distutils.core import setup
|
|
||||||
from distutils.extension import Extension
|
|
||||||
|
|
||||||
## Get the include dirs
|
|
||||||
wings = os.popen("get-wings-flags --cflags", "r")
|
|
||||||
flags = wings.read().split()
|
|
||||||
include_dirs = [x[2:] for x in flags]
|
|
||||||
#include_dirs += [".."]
|
|
||||||
wings.close()
|
|
||||||
|
|
||||||
## Get the library dirs
|
|
||||||
wings = os.popen("get-wings-flags --ldflags", "r")
|
|
||||||
flags = wings.read().split()
|
|
||||||
library_dirs = [x[2:] for x in flags]
|
|
||||||
#library_dirs += [".."]
|
|
||||||
wings.close()
|
|
||||||
|
|
||||||
## Get the libraries
|
|
||||||
wings = os.popen("get-wings-flags --libs", "r")
|
|
||||||
flags = wings.read().split()
|
|
||||||
libraries = [x[2:] for x in flags]
|
|
||||||
wings.close()
|
|
||||||
|
|
||||||
runtime_library_dirs = []
|
|
||||||
extra_objects = []
|
|
||||||
extra_compile_args = ['-Wno-strict-prototypes', '-Wno-unused']
|
|
||||||
|
|
||||||
long_description = \
|
|
||||||
"""Python interface to the WINGs library
|
|
||||||
|
|
||||||
Python WINGs is an interface to WINGs, a small widget set with the
|
|
||||||
N*XTSTEP look and feel. It's API is inspired in OpenStep and it's
|
|
||||||
implementation borrows some ideas from Tk. It has a reasonable set of
|
|
||||||
widgets, sufficient for building small applications (like a CDPlayer
|
|
||||||
or hacking something like rxvt). It also has other functions that are
|
|
||||||
usefull for applications, like a User Defaults alike configuration
|
|
||||||
manager and a notification system.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
setup (# Distribution meta-data
|
|
||||||
name = "Python-WINGs",
|
|
||||||
version = "0.81.0",
|
|
||||||
description = "A python interface to WINGs",
|
|
||||||
long_description=long_description,
|
|
||||||
author = "Dan Pascu",
|
|
||||||
author_email = "dan@windowmaker.info",
|
|
||||||
license = "GPL",
|
|
||||||
platforms = "ALL",
|
|
||||||
url = "http://windowmaker.info/",
|
|
||||||
|
|
||||||
# Description of the modules and packages in the distribution
|
|
||||||
|
|
||||||
py_modules = ["WINGs"],
|
|
||||||
|
|
||||||
ext_modules = [Extension(
|
|
||||||
name='wings',
|
|
||||||
sources=['WINGs.c'],
|
|
||||||
include_dirs=include_dirs,
|
|
||||||
library_dirs=library_dirs,
|
|
||||||
runtime_library_dirs=runtime_library_dirs,
|
|
||||||
libraries=libraries,
|
|
||||||
extra_objects=extra_objects,
|
|
||||||
extra_compile_args=extra_compile_args,
|
|
||||||
)],
|
|
||||||
)
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user