summaryrefslogtreecommitdiffstats
path: root/drakconf32.png
blob: 19189610b2275cb9f18e8950ab441e45e0a7f87b (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 24 00 00 00 24 08 06 00 00 00 e1 00 98 .PNG........IHDR...$...$........
0020 98 00 00 00 04 67 41 4d 41 00 00 d6 d8 d4 4f 58 32 00 00 00 19 74 45 58 74 53 6f 66 74 77 61 72 .....gAMA.....OX2....tEXtSoftwar
0040 65 00 41 64 6f 62 65 20 49 6d 61 67 65 52 65 61 64 79 71 c9 65 3c 00 00 0a 0b 49 44 41 54 78 da e.Adobe.ImageReadyq.e<....IDATx.
0060 62 0c 0d 0d 3d 98 95 95 65 c7 00 05 ff ff c3 e8 ff 0c 20 08 12 f8 ff 1f c6 07 49 fc 83 f0 41 f0 b...=...e.................I...A.
0080 1f 58 00 22 87 84 ff c1 d4 83 d8 ff fe 01 31 9a 3c 90 bf ff c0 be 1b 4c 0c ff 3c 80 06 bc 9a 39 .X."..........1.<......L..<....9
00a0 73 e6 77 98 fd 00 01 c4 02 72 8c 83 83 03 c2 11 30 cb 20 0c 88 18 c8 50 b0 5b fe 81 1d 05 33 98 s.w......r......0......P.[....3.
00c0 01 c9 02 88 43 fe 81 1d f9 0f ee 90 7f 70 07 fd 03 ab fd c7 f0 f7 2f 44 ee ef bf bf 1a 47 0e ed ....C........p......../D.....G..
00e0 77 06 1a b7 17 88 1f c2 1c 04 10 40 4c c8 21 83 1c 3a 18 8e 81 86 10 aa 63 18 b0 3a 06 64 31 36 w..........@L.!..:......c..:.d16
0100 c7 40 d8 20 c7 40 d8 40 a0 09 c4 7c 0c 48 00 20 80 58 60 8c fb f7 ef 33 3c 7c f8 10 ac 01 e6 c2 .@...@.@...|.H...X`....3<|......
0120 ff 28 d1 05 61 c3 c4 41 00 1e 15 b0 68 fb c7 00 b1 18 1a 42 70 bd 60 31 88 7a 6e 1e 6e 06 75 75 .(..a..A....h......Bp.`1.zn.n.uu
0140 0d 98 19 2c c8 81 02 02 00 01 18 25 63 13 80 61 18 08 1e 71 a1 0d 5c 69 73 0d e5 65 5c 28 92 05 ...,.......%c..a...q..\is..e\(..
0160 09 29 62 48 95 83 ef ff 9e 7f 0a 8d 31 30 33 44 04 55 65 af b6 7f 50 55 64 ae 3b 49 44 e0 ee cc .)bH........103D.Ue...PUd.;ID...
0180 39 89 d3 f9 cb d1 1a bd 77 6a d5 2b f5 e5 12 40 2c 20 f1 0f 1f 3e 32 70 71 71 31 14 17 17 33 48 9.......wj.+...@,....>2pqq1...3H
01a0 4a 4a 82 1d f0 07 e4 80 5f bf c1 16 7f 06 5a fc fe fd 07 86 d7 6f de 30 3c 7b f6 9c e1 e1 03 60 JJ......_.....Z......o.0<{.....`
01c0 68 3e 78 c8 f0 f4 e9 63 06 71 de 1f 0c cf 3f b0 12 e5 20 09 a0 d9 20 07 7d fa f4 09 a7 83 00 02 h>x....c.q....?.........}.......
01e0 88 05 9e 66 a0 f4 9f 3f c0 50 00 e2 5f 3f 7f 31 7c fd f6 8d e1 c3 c7 8f 0c 6f df be 63 78 f9 e2 ...f...?.P.._?.1|........o..cx..
0200 25 c3 e3 27 8f 19 6e de b8 c1 70 fb e6 0d 86 ef df be 32 f0 70 fc 63 58 90 f3 8b 21 67 f6 3f 86 %..'..n...p.......2.p.cX...!g.?.
0220 db 2f d9 89 0e 29 58 9a c3 06 00 02 88 05 9e bd 81 00 14 25 3f 7e fc 64 f8 fe e3 3b d0 17 5f 18 ./...)X............%?~.d...;.._.
0240 de bd 7f cf f0 fa f5 6b 60 48 3c 63 b8 77 ef 2e c3 b5 2b 97 19 de bc 7a 09 f7 40 4d e0 17 06 76 .......k`H<c.w....+....z..@M...v
0260 cd 5c 06 49 81 a9 24 39 e8 2f 38 7d 61 0f 21 80 00 62 81 39 06 04 40 d1 f3 fe c3 07 70 14 be 79 .\.I..$9./8}a.!..b.9..@.....p..y
0280 fb 96 e1 c5 8b 17 0c 8f 1e 3d 62 b8 7e f5 2a c3 03 a0 83 7e fd fa 09 57 6b a7 fe 85 c1 d2 c5 9f .........=b.~.*....~...Wk.......
02a0 e1 2f af 12 83 aa f8 4f 86 43 37 79 48 0a 21 5c 0e 02 08 20 16 68 69 07 e6 80 a2 e7 3d d0 31 2f ./.....O.C7yH.!\.....hi.....=.1/
02c0 5f 81 42 e5 09 c3 9d db b7 19 38 bf 9e 66 08 53 7b c0 f0 5c 8c 95 e1 fc 43 4e 86 e7 1f 59 19 3e _.B.......8..f.S{..\....CN...Y.>
02e0 ff 60 66 c8 0d 16 63 f8 27 6a c3 c0 f8 eb 11 83 84 10 23 03 29 00 5c 94 e0 70 10 40 00 b1 80 8b .`f...c.'j........#.).\..p.@....
0300 41 48 99 00 0c 91 97 0c 1f 81 09 ee c1 83 07 c0 50 b9 c2 f0 e4 d1 43 06 31 60 a2 ad 8c b1 63 e0 AH..............P.....C.1`....c.
0320 34 e9 66 88 7d 77 9a 81 f1 e3 39 06 c6 9f 2f 18 fe 8a da 32 30 fc 7c 08 74 d0 7d 06 55 39 56 92 4.f.}w....9.../....20.|.t.}.U9V.
0340 1c f4 0f 4f 08 01 04 10 0b c8 31 ff 91 ca a2 5b b7 6e 31 dc ba 71 9d e1 db d7 2f 60 31 50 0e aa ...O......1....[.n1..q..../`1P..
0360 98 7c 81 61 42 dd 14 86 7f 32 b1 0c 0c ec 42 0c 8c bf 5f 30 30 fc 7a 02 74 cc 5d 06 a6 9f 37 19 .|.aB....2....B..._00.z.t.]...7.
0380 94 d5 b9 18 d6 94 bd 61 b8 70 f3 1f c3 b9 07 ec c0 e8 e3 65 f8 f2 83 09 b7 83 fe e1 76 10 40 00 .......a.p.........e........v.@.
03a0 b1 fc 87 47 18 03 c3 85 73 67 19 6e 03 1d f4 1f 2d 07 9c 7b c8 c5 30 75 e6 2a 86 ac 5c 3e 86 7f ...G....sg.n....-..{..0u.*..\>..
03c0 bc f2 c0 90 01 39 e6 36 03 13 10 33 fc fb c9 f0 9f 8d 83 41 4c 55 92 c1 4d 95 81 c1 fd c7 57 86 .....9.6...3.......ALU..M.....W.
03e0 aa ef ef 18 76 1c f9 c3 d0 b2 49 02 77 2e fb 87 3d 97 01 04 10 0b ac 02 05 81 4f 9f 3e c2 1d a3 ....v.....I.w...=.........O.>...
0400 ca f9 8d c1 4b f0 35 83 2a c7 57 06 23 de cf 40 47 00 05 7b ca 18 7e 48 ca 33 fc 15 e2 60 f8 a3 ....K.5.*.W.#..@G..{..~H.3...`..
0420 c2 c5 c0 2a 01 c4 2c 8c 0c 8c b0 24 f4 ef 2f 30 3a bf 32 ec 38 fa 8f 61 ee 21 61 3c 21 84 3b 97 ...*..,....$../0:.2.8..a.!a<!.;.
0440 01 04 10 0b ac de 82 01 90 43 f2 a5 1e 30 18 f1 7c c6 aa 81 e3 39 b0 1e 7c 0e 64 5c 65 60 f8 2a .........C...0..|....9..|.d\e`.*
0460 cc cb f0 d1 4c 81 81 43 96 97 81 f3 db 1b 86 9d 47 7e 33 cc 3d 28 48 b0 a0 c4 57 0e 01 04 10 38 ....L..C........G~3.=(H...W....8
0480 97 c1 dc e3 c8 f1 90 21 57 ed 32 42 56 58 81 81 c1 20 80 81 41 cd 9e 81 81 4b 80 81 e1 db 07 06 .......!W.2BVX......A....K......
04a0 86 5b 07 81 71 bb 81 81 e1 ed 03 06 ee b7 9f 19 b8 b7 5f 66 78 aa 23 cd 30 f5 2a 27 c3 86 f3 a2 .[..q............._fx.#.0.*'....
04c0 c0 d0 22 9c e3 f0 85 10 40 00 b1 fc 87 56 a4 b6 bf ce 32 f8 f3 9d 47 38 c4 b7 9e 81 c1 32 01 53 ..".....@....V....2...G8.....2.S
04e0 07 c8 81 61 fd 0c 0c c7 17 30 30 6c 6e 04 3b 4c fa ca 53 06 91 0f a2 c0 fa 8e 9f 81 19 58 5f 11 ...a.....00ln.;L..S..........X_.
0500 72 14 24 84 b0 3b 08 20 80 98 40 92 82 af 2e 30 f8 ff 3c 00 11 91 35 00 16 c1 e7 e1 8e f9 00 2c r.$..;....@....0..<...5........,
0520 28 27 4c 98 c0 10 18 18 c8 b0 60 c1 02 84 4e 90 3c 48 1d 48 3d 10 24 0b bc 66 d0 e5 78 87 33 b1 ('L.......`...N.<H.H=.$..f..x.3.
0540 a2 e7 32 5c ea 00 02 88 09 14 3a ba e7 fa 10 21 53 b4 1f 12 3d a0 5c 77 e1 02 83 81 be 1e c3 84 ..2\......:....!S...=.\w........
0560 be 2e 86 0d 1b 36 30 18 18 18 a0 ea 06 a9 03 a9 07 e9 03 82 26 e5 27 0c 3f 81 2d 01 42 8e 82 b5 .....60.............&.'.?.-.B...
0580 95 b0 01 80 00 62 12 7b 76 94 81 eb fb 2b 08 2f 61 3e dc 31 a0 90 09 f0 f7 63 e8 ae cf 63 78 f8 .....b.{v....+./a>.1.....c...cx.
05a0 f8 39 43 43 43 03 8a 83 40 f2 a0 02 14 ac 1e a4 0f 08 a4 39 7e 33 d8 f2 be 05 57 d0 b8 d2 08 a4 .9CCC...@..........9~3....W.....
05c0 60 c4 9d 86 00 02 88 49 f4 e9 31 44 e8 a8 39 c0 25 40 21 92 93 18 c8 70 f0 c8 71 30 bf be be 1e `......I..1D..9.%@!....p..q0....
05e0 2e 07 72 88 a2 a2 22 43 62 62 22 44 00 a4 0f 1a 4a 8e 42 9f 08 3a 08 5f 39 04 10 40 4c 7c 1f ef ..r..."Cbb"D....J.B..:._9..@L|..
0600 21 12 2b 12 00 b5 1e 75 55 24 18 e4 c5 21 95 e6 81 03 07 e0 72 20 87 fc ff fd 85 e1 c2 e9 83 a8 !.+....uU$...!......r...........
0620 89 1d 08 34 78 7e 82 db 52 f8 a2 ed 1f a2 09 8b 01 00 02 88 45 e0 cb 03 68 62 d6 47 91 e0 e7 e7 ...4x~..R...........E...hb.G....
0640 07 36 c2 ae 31 f8 58 2b 33 b4 f2 70 80 13 75 7f 7f 3f c3 c5 8b 17 19 b4 38 6f 31 bc 15 61 67 10 .6..1.X+3..p..u..?......8o1..ag.
0660 56 34 45 68 80 ea d7 e2 fd c5 f0 f9 f3 67 86 3f c0 96 25 0b 0b 0b 8a 99 a0 f4 a5 a4 ac cc c0 c9 V4Eh.........g.?..%.............
0680 c9 05 6c 6d 62 2f e7 00 02 88 05 97 2f 02 02 02 18 1c ac 9a 19 8e cd 4f 67 b8 b1 2c 91 a1 6c d2 ..lmb/....../..........Og..,..l.
06a0 76 86 3d 8b 2a 19 74 65 b9 18 e4 b4 f8 19 a6 6d 7f c6 30 bf 21 1e ab 5e 33 0b 4b 06 69 69 69 06 v.=.*.te.......m..0.!..^3.K.iii.
06c0 1e 1e 5e b4 2e 15 03 c3 b3 e7 2f 18 2c ed 14 19 2e 5f ba 80 55 2f 40 00 b1 bc e3 96 63 10 fa fa ..^......./.,...._..U/@.....c...
06e0 88 81 e1 f1 45 60 56 46 48 28 28 28 30 08 8a cb 31 3c 7e 78 8f c1 40 96 89 61 7a b6 2a c3 5f 60 ....E`VFH(((0...1<~x..@..az.*._`
0700 fb 79 d9 81 97 0c 99 d3 6f 33 24 24 24 80 31 1c 80 f4 03 c1 13 26 51 06 1d 3d 43 06 0d 4d 6d 06 .y......o3$$$.1......&Q..=C..Mm.
0720 21 21 61 78 f4 fd 45 a2 ff e2 c9 65 00 01 c4 f4 8e 5b 1e 5a b3 6e 40 91 68 6c 6c 64 b0 55 fc c3 !!ax..E....e.....[.Z.n@.hlld.U..
0740 60 20 f3 9f 41 3d 61 23 83 4c e2 69 06 ff 19 cc 0c 3b 5f 68 31 4c 98 3a 9b 61 fe fc f9 a8 26 41 `...A=a#.L.i.....;_h1L.:.a....&A
0760 f5 3f 65 14 63 60 65 65 03 17 8e 60 47 20 75 89 60 0e f9 07 16 c7 9e 86 00 02 88 e5 d8 17 e1 1f .?e.c`ee...`G.u.`...............
0780 2a c0 2a 0a 54 e2 32 dc 3a 00 ce 31 a0 f2 67 fd a2 89 0c 3b db ac 19 26 ad bd c8 f0 f0 d5 37 86 *.*.T.2.:..1..g....;...&......7.
07a0 f5 eb 97 82 a3 11 2b 00 e9 7b 0b 49 8b d7 d8 d4 19 d8 39 38 c0 3d 8c bf 20 c7 fc 45 0d 95 bf 50 ......+..{.I......98.=.....E...P
07c0 7c ef ee ad 2f bc 9c ec 7f 40 69 1c d9 28 80 00 62 b4 b0 b0 f0 da aa 75 76 b5 10 cb 6f 2e 50 d6 |.../....@i..(..b......uv...o.P.
07e0 fd 90 bb 9f c1 d1 2b 90 61 46 22 3f 83 8c c0 3f 06 ed ac e3 0c 86 a6 36 0c fb f7 ef c7 ee 18 50 ......+.aF"?...?.......6.......P
0800 fd d6 62 08 76 d0 d3 9f ac 0c be 97 74 18 f8 f8 f8 18 b8 b9 b9 c1 d5 08 36 00 6c 1a 3f 93 97 97 ..b.v.......t...........6.l.?...
0820 3f 2b 24 24 b4 1b c8 dd 0c ec 4a 3f 80 c9 01 04 10 b3 a7 a7 e7 1b 4e 60 6b 59 9d e9 a5 23 c3 f7 ?+$$......J?..........N`kY...#..
0840 0f 0c 2f f6 2e 04 ba 8b 83 c1 49 8f 97 21 7f e6 4d 86 33 b7 3f 83 1d 23 20 20 80 dd 31 7d 8e 40 ../.......I..!..M.3.?..#....1}.@
0860 1b 6e 80 b9 d5 4f b4 18 7e f3 49 33 48 48 48 30 7c fd fa 95 e1 e5 cb 97 c0 1e cb 5b 60 14 b2 3e .n...O..~.I3HHH0|..........[`..>
0880 02 b6 d7 1f 01 43 ea 12 b0 4f 77 4b 5c 5c fc 92 b0 b0 f0 11 a0 96 93 40 fc c8 d7 d7 f7 17 cc 48 .....C...OwK\\.........@.......H
08a0 80 00 62 01 c6 f5 87 cd 4c 66 33 65 ff bf 57 31 60 7c 14 a7 c0 fc 81 21 04 58 c6 3c 3d ff 8d 61 ..b.....Lf3e..W1`|.....!.X.<=..a
08c0 d9 c1 97 e0 12 1a 94 c0 31 00 52 e5 0a 02 d3 bf 9b 31 fc 94 d7 67 50 03 f6 ef 6e 03 db e2 f7 ee ........1.R......1...gP...n.....
08e0 dd 63 e0 e5 e5 65 60 63 63 03 75 2e 9f 6a 6a 6a ee 02 2a 03 b6 e8 18 3e 02 31 a8 39 fa 02 94 e4 .c...e`cc.u..jjj..*....>.1.9....
0900 80 f8 2b b2 b1 00 01 c4 08 ca 92 e9 e9 e9 a0 b0 95 8e ff 7f a0 c6 8a f1 56 2a bc 44 06 16 15 02 ..+.....................V*.D....
0920 0e 09 0c 02 66 fe 58 9b 1f 30 50 7b 47 86 61 dd 0b 3e 70 09 0d 02 20 87 a0 15 84 37 4c 4d 4d db ....f.X..0P{G.a..>p........7LMM.
0940 81 4c 50 a8 bc 01 e2 3f 50 fc 1b 18 5d 28 a9 1b 20 80 18 61 45 3c d0 51 a0 56 95 94 3d c3 b5 30 .LP....?P...](.....aE<.Q.V..=..0
0960 27 86 2b 79 12 0c 1f 64 08 d5 da 47 df b0 32 d4 5d e6 65 b8 fe 85 1d 14 2d 60 8c 2d dd 00 1d fa '.+y...d...G..2.].e.....-`.-....
0980 c1 c5 c5 a5 0c c8 dc 0a 74 c0 33 7c 66 02 04 10 23 72 9d 03 74 14 a8 a0 14 05 15 b8 6f cf ef de ........t.3|f...#r..t.......o...
09a0 10 24 f5 95 47 0d d8 82 34 e1 fb 02 57 73 fa 23 37 c3 cd 6f 9c 0c 9b df 08 31 dc f9 c9 03 8e 12 .$..G...4...Ws.#7..o.....1......
09c0 4e 4e 4e f0 b8 00 a8 64 c6 d6 16 7a ff fe fd 0b 2d 2d ad 5e 20 73 1d d0 41 f7 f0 39 08 20 80 18 NNN....d...z....--.^.s..A..9....
09e0 d1 2b 41 a0 a3 40 dd 05 6e a0 af 8c 7e fe fc e9 03 4c 84 3a 40 36 2f 30 d8 d9 81 6a 99 81 16 fe .+A..@..n...~....L.:@6/0...j....
0a00 65 62 62 fa 09 0c 89 6f c0 10 f9 04 c4 9f 81 f8 1b 90 ff 9b 01 a5 31 8c 9a fc 81 18 d4 14 3d 08 ebb....o..............1.......=.
0a20 74 d0 73 7c 0e 02 08 20 46 5c b5 32 d0 61 3c 40 47 c8 02 b1 24 10 73 01 85 d8 a1 43 27 a0 72 e3 t.s|....F\.2.a<@G...$.s....C'.r.
0a40 27 d0 51 df 81 f8 0b 10 ff 42 2f 4b b0 80 3f d0 c4 fc 1a e8 a0 9f f8 14 02 04 10 23 be 66 c2 40 '.Q......B/K..?............#.f.@
0a60 00 80 00 03 00 b1 2d 71 50 cc 0e f6 2b 00 00 00 00 49 45 4e 44 ae 42 60 82 ......-qP...+....IEND.B`.
id='n467' href='#n467'>467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568
package mygtk2;

use diagnostics;
use strict;
use feature 'state';

our @ISA = qw(Exporter);
our @EXPORT = qw(gtknew gtkset gtkadd gtkval_register gtkval_modify);

use c;
use log;
use common;

use Gtk2;

sub init() {
    !check_for_xserver() and print("Cannot be run in console mode.\n"), c::_exit(0);
    $::one_message_has_been_translated and warn("N() was called from $::one_message_has_been_translated BEFORE gtk2 initialisation, replace it with a N_() AND a translate() later.\n"), c::_exit(1);

    Gtk2->init;
    Locale::gettext::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', if_(!$::isInstall, 'libDrakX-standalone'),
        if_($::isRestore, 'draksnapshot'), if_($::isInstall, 'urpmi'),
        'drakx-net', 'drakx-kbd-mouse-x11', # shared translation
          @::textdomains;
    Gtk2->croak_execeptions;
}
init() unless $::no_ugtk_init;
Gtk2->croak_execeptions if $::isInstall;



sub gtknew {
    my $class = shift;
    if (@_ % 2 != 0) {
	internal_error("gtknew $class: bad options @_");
    }
    if (my $r = find { ref $_->[0] } group_by2(@_)) {
	internal_error("gtknew $class: $r should be a string in @_");
    }
    my %opts = @_;
    _gtk(undef, $class, 'gtknew', \%opts);
}

sub gtkset {
    my $w = shift;
    my $class = ref($w);
    if (@_ % 2 != 0) {
	internal_error("gtkset $class: bad options @_");
    }
    if (my $r = find { ref $_->[0] } group_by2(@_)) {
	internal_error("gtkset $class: $r should be a string in @_");
    }
    my %opts = @_;

    $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk2)::// or internal_error("gtkset unknown class $class");
    
    _gtk($w, $class, 'gtkset', \%opts);
}

sub gtkadd {
    my $w = shift;
    my $class = ref($w);
    if (@_ % 2 != 0) {
	internal_error("gtkadd $class: bad options @_");
    }
    if (my $r = find { ref $_->[0] } group_by2(@_)) {
	internal_error("gtkadd $class: $r should be a string in @_");
    }
    my %opts = @_;
    $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk2)::// or internal_error("gtkadd unknown class $class");
    
    _gtk($w, $class, 'gtkadd', \%opts);
}


my %refs;

sub gtkval_register {
    my ($w, $ref, $sub) = @_;
    push @{$w->{_ref}}, $ref;
    $w->signal_connect(destroy => sub { 
	@{$refs{$ref}} = grep { $_->[1] != $w } @{$refs{$ref}};
	delete $refs{$ref} if !@{$refs{$ref}};
    });
    push @{$refs{$ref}}, [ $sub, $w ];
}
sub gtkval_modify {
    my ($ref, $val, @to_skip) = @_;
    my $prev = '' . $ref;
    $$ref = $val;
    if ($prev ne '' . $ref) {
	internal_error();
    }
    foreach (@{$refs{$ref} || []}) {	
	my ($f, @para) = @$_;
	$f->(@para) if !member($f, @to_skip);
    }
}

my $global_tooltips;

sub _gtk {
    my ($w, $class, $action, $opts) = @_;

    if (my $f = $mygtk2::{"_gtk__$class"}) {
	$w = $f->($w, $opts, $class, $action);
    } else {
	internal_error("$action $class: unknown class");
    }

    $w->set_size_request(delete $opts->{width} || -1, delete $opts->{height} || -1) if exists $opts->{width} || exists $opts->{height};
    if (my $position = delete $opts->{position}) {
	$w->move($position->[0], $position->[1]);
    }
    $w->set_name(delete $opts->{widget_name}) if exists $opts->{widget_name};
    $w->can_focus(delete $opts->{can_focus}) if exists $opts->{can_focus};
    $w->can_default(delete $opts->{can_default}) if exists $opts->{can_default};
    $w->grab_focus if delete $opts->{grab_focus};
    $w->set_padding(@{delete $opts->{padding}}) if exists $opts->{padding};
    $w->set_sensitive(delete $opts->{sensitive}) if exists $opts->{sensitive};
    $w->signal_connect(expose_event => delete $opts->{expose_event}) if exists $opts->{expose_event};
    $w->signal_connect(realize => delete $opts->{realize}) if exists $opts->{realize};
    (delete $opts->{size_group})->add_widget($w) if $opts->{size_group};
    if (my $tip = delete $opts->{tip}) {
	$global_tooltips ||= Gtk2::Tooltips->new;
	$global_tooltips->set_tip($w, $tip);
    }

    #- WARNING: hide_ref and show_ref are not effective until you gtkval_modify the ref
    if (my $hide_ref = delete $opts->{hide_ref}) {
	gtkval_register($w, $hide_ref, sub { $$hide_ref ? $w->hide : $w->show });
    } elsif (my $show_ref = delete $opts->{show_ref}) {
	gtkval_register($w, $show_ref, sub { $$show_ref ? $w->show : $w->hide });
    }

    if (my $sensitive_ref = delete $opts->{sensitive_ref}) {
	my $set = sub { $w->set_sensitive($$sensitive_ref) };
	gtkval_register($w, $sensitive_ref, $set);
	$set->();
    }

    if (%$opts && !$opts->{allow_unknown_options}) {
	internal_error("$action $class: unknown option(s) " . join(', ', keys %$opts));
    }
    $w;
}

sub _gtk__Install_Button {
    my ($w, $opts, $_class) = @_;
    $opts->{child} = gtknew('HBox', spacing => 5, 
                             children_tight => [
                                 # FIXME: not RTL compliant (lang::text_direction_rtl() ? ...)
                                 gtknew('Image', file => 'advanced_expander'),
                                 gtknew('Label', text => delete $opts->{text}),
                             ],
                         );
    $opts->{relief} = 'none';
    _gtk__Button($w, $opts, 'Button');
}

sub _gtk__Button       { &_gtk_any_Button }
sub _gtk__ToggleButton { &_gtk_any_Button }
sub _gtk__CheckButton  { &_gtk_any_Button }
sub _gtk__RadioButton  { &_gtk_any_Button }
sub _gtk_any_Button {
    my ($w, $opts, $class) = @_;

    if (!$w) {
        my @radio_options;
        if ($class eq 'RadioButton') {
            @radio_options = delete $opts->{group};
	}
	$w = $opts->{child} ? "Gtk2::$class"->new(@radio_options) :
	  delete $opts->{mnemonic} ? "Gtk2::$class"->new_with_mnemonic(@radio_options, delete $opts->{text} || '') :
	    $opts->{text} ? "Gtk2::$class"->new_with_label(@radio_options, delete $opts->{text} || '') :
           "Gtk2::$class"->new(@radio_options);

	$w->{format} = delete $opts->{format} if exists $opts->{format};
    }

    if (my $widget = delete $opts->{child}) {
	$w->add($widget);
	$widget->show;
    }
    $w->set_image(delete $opts->{image}) if exists $opts->{image};
    $w->set_relief(delete $opts->{relief}) if exists $opts->{relief};

    if (my $text_ref = delete $opts->{text_ref}) {
	my $set = sub {
	    eval { $w->set_label(may_apply($w->{format}, $$text_ref)) };
	};
	gtkval_register($w, $text_ref, $set);
	$set->();
    } elsif (exists $opts->{text}) {
	$w->set_label(delete $opts->{text});
    } elsif (exists $opts->{stock}) {
	$w->set_label(delete $opts->{stock});
	$w->set_use_stock(1);
    }

    if ($class eq 'Button') {
	$w->signal_connect(clicked => delete $opts->{clicked}) if exists $opts->{clicked};
    } else {
	if (my $active_ref = delete $opts->{active_ref}) {
	    my $set = sub { $w->set_active($$active_ref) };
	    $w->signal_connect(toggled => sub {
		gtkval_modify($active_ref, $w->get_active, $set);
	    });
	    gtkval_register($w, $active_ref, $set);
	    gtkval_register($w, $active_ref, delete $opts->{toggled}) if exists $opts->{toggled};
	    $set->();
	} else {
	    $w->set_active(delete $opts->{active}) if exists $opts->{active};
	    $w->signal_connect(toggled => delete $opts->{toggled}) if exists $opts->{toggled};
	}
    }
    $w;
}

sub _gtk__CheckMenuItem {
    my ($w, $opts, $class) = @_;

    if (!$w) {
	add2hash_($opts, { mnemonic => 1 });

	$w = $opts->{image} || !exists $opts->{text} ? "Gtk2::$class"->new :
	  delete $opts->{mnemonic} ? "Gtk2::$class"->new_with_label(delete $opts->{text}) :
	    "Gtk2::$class"->new_with_mnemonic(delete $opts->{text});
    }

    $w->set_active(delete $opts->{active}) if exists $opts->{active};
    $w->signal_connect(toggled => delete $opts->{toggled}) if exists $opts->{toggled};
    $w;
}

sub _gtk__SpinButton {
    my ($w, $opts) = @_;

    if (!$w) {
	$opts->{adjustment} ||= do {
	    add2hash_($opts, { step_increment => 1, page_increment => 5, page_size => 1, value => delete $opts->{lower} });
	    Gtk2::Adjustment->new(delete $opts->{value}, delete $opts->{lower}, delete $opts->{upper}, delete $opts->{step_increment}, delete $opts->{page_increment}, delete $opts->{page_size});
	};
	$w = Gtk2::SpinButton->new(delete $opts->{adjustment}, delete $opts->{climb_rate} || 0, delete $opts->{digits} || 0);
    }

    $w->signal_connect(value_changed => delete $opts->{value_changed}) if exists $opts->{value_changed};
    $w;
}

sub _gtk__HScale {
    my ($w, $opts) = @_;

    if (!$w) {
	$opts->{adjustment} ||= do {
	    add2hash_($opts, { step_increment => 1, page_increment => 5, page_size => 1 });
	    add2hash_($opts, { value => $opts->{lower} }) if !exists $opts->{value};
	    Gtk2::Adjustment->new(delete $opts->{value}, delete $opts->{lower}, (delete $opts->{upper}) + 1, delete $opts->{step_increment}, delete $opts->{page_increment}, delete $opts->{page_size});
	};
	$w = Gtk2::HScale->new(delete $opts->{adjustment});
    }

    $w->set_digits(delete $opts->{digits}) if exists $opts->{digits};
    if (my $value_ref = delete $opts->{value_ref}) {
	my $set = sub { $w->set_value($$value_ref) };
	gtkval_register($w, $value_ref, $set);
	$set->();
	$w->signal_connect(value_changed => sub {
		gtkval_modify($value_ref, $w->get_value, $set);
	});
    }
    $w->signal_connect(value_changed => delete $opts->{value_changed}) if exists $opts->{value_changed};
    $w;
}

sub _gtk__ProgressBar {
    my ($w, $opts) = @_;

    if (!$w) {
	$w = Gtk2::ProgressBar->new;
    }

    if (my $fraction_ref = delete $opts->{fraction_ref}) {
	my $set = sub { $w->set_fraction($$fraction_ref) };
	gtkval_register($w, $fraction_ref, $set);
	$set->();
    } elsif (exists $opts->{fraction}) {
	$w->set_fraction(delete $opts->{fraction});
    }

    $w;
}

sub _gtk__VSeparator { &_gtk_any_simple }
sub _gtk__HSeparator { &_gtk_any_simple }
sub _gtk__Calendar   { &_gtk_any_simple }

sub _gtk__DrawingArea {
    my ($w, $_opts) = @_;

    if (!$w) {
	$w = Gtk2::DrawingArea->new;
    }
    $w;
}

sub _gtk__Pixbuf {
    my ($w, $opts) = @_;

    if (!$w) {
	my $name = delete $opts->{file} or internal_error("missing file");
	my $file = _find_imgfile($name) or internal_error("cannot find image $name");
	if (my $size = delete $opts->{size}) {
	    $w = Gtk2::Gdk::Pixbuf->new_from_file_at_scale($file, $size, $size, 1);
	} else {
	    $w = Gtk2::Gdk::Pixbuf->new_from_file($file);
	}
        $w = $w->flip(1) if delete $opts->{flip};
    }
    $w;
}

# Image_using_pixmap is rendered using DITHER_MAX which is much better on 16bpp displays
sub _gtk__Image_using_pixmap { &_gtk__Image }
# Image_using_pixbuf is rendered using DITHER_MAX & transparency which is much better on 16bpp displays
sub _gtk__Image_using_pixbuf { &_gtk__Image }
sub _gtk__Image {
    my ($w, $opts, $class) = @_;

    if (!$w) {
	$w = Gtk2::Image->new;
	$w->{format} = delete $opts->{format} if exists $opts->{format};
        
        $w->set_from_stock(delete $opts->{stock}, 'button') if exists $opts->{stock};

        $w->{options} = { flip => delete $opts->{flip} };

        $w->{set_from_file} = $class =~ /using_pixmap/ ? sub { 
            my ($w, $file) = @_;
            my $pixmap = mygtk2::pixmap_from_pixbuf($w, gtknew('Pixbuf', file => $file));
	    $w->set_from_pixmap($pixmap, undef);
        } : $class =~ /using_pixbuf/ ? sub { 
            my ($w, $file) = @_;
            my $pixbuf = _pixbuf_render_alpha(gtknew('Pixbuf', file => $file, %{$w->{options}}), 255);
            my ($width, $height) = ($pixbuf->get_width, $pixbuf->get_height);
            $w->set_size_request($width, $height);
            $w->{pixbuf} = $pixbuf;
            $w->signal_connect(expose_event => sub {
                                   my (undef, $event) = @_;
                                   if (!$w->{x}) {
                                       my $alloc = $w->allocation;
                                       $w->{x} = $alloc->x;
                                       $w->{y} = $alloc->y;
                                   }
                                   # workaround Gtk+ bug: in installer, first event is not complete and rectables are bogus:
                                   if ($::isInstall) {
                                       $pixbuf->render_to_drawable($w->window, $w->style->fg_gc('normal'),
                                                                   0, 0, $w->{x}, $w->{y}, $width, $height, 'max', 0, 0);
                                       return;
                                   }
                                   foreach my $rect ($event->region->get_rectangles) {
                                       my @values = $rect->values;
                                       $pixbuf->render_to_drawable($w->window, $w->style->fg_gc('normal'),
                                                               @values[0..1], $w->{x}+$values[0], $w->{y}+$values[1], @values[2..3], 'max', 0, 0);
				   }
                               });
        } : sub { 
            my ($w, $file, $o_size) = @_;
            my $pixbuf = gtknew('Pixbuf', file => $file, if_($o_size, size => $o_size), %{$w->{options}});
            $w->set_from_pixbuf($pixbuf);
        };
    }

    if (my $name = delete $opts->{file}) {
	my $file = _find_imgfile(may_apply($w->{format}, $name)) or internal_error("cannot find image $name");
	$w->{set_from_file}->($w, $file, delete $opts->{size});
    } elsif (my $file_ref = delete $opts->{file_ref}) {
	my $set = sub {
	    my $file = _find_imgfile(may_apply($w->{format}, $$file_ref)) or internal_error("cannot find image $$file_ref");
	    $w->{set_from_file}->($w, $file, delete $opts->{size});
	};
	gtkval_register($w, $file_ref, $set);
	$set->() if $$file_ref;
    }
    $w;
}

sub _gtk__WrappedLabel {
    my ($w, $opts) = @_;
    
    $opts->{line_wrap} = 1 if !defined $opts->{line_wrap};
    _gtk__Label($w, $opts);
}

our $left_padding = 20;

sub _gtk__Label_Left {
    my ($w, $opts) = @_;
    $opts->{alignment} ||= [ 0, 0 ];
    $opts->{padding} ||= [ $left_padding, 0 ];
    _gtk__WrappedLabel($w, $opts);
}

sub _gtk__Label_Right {
    my ($w, $opts) = @_;
    $opts->{alignment} ||= [ 1, 0.5 ];
    _gtk__Label($w, $opts);
}


sub _gtk__Label {
    my ($w, $opts) = @_;

    if ($w) {
	$w->set_text(delete $opts->{text}) if exists $opts->{text};
    } else {
	$w = exists $opts->{text} ? Gtk2::Label->new(delete $opts->{text}) : Gtk2::Label->new;
	$w->set_selectable(delete $opts->{selectable}) if exists $opts->{selectable};
	$w->set_ellipsize(delete $opts->{ellipsize}) if exists $opts->{ellipsize};
	$w->set_justify(delete $opts->{justify}) if exists $opts->{justify};
	$w->set_line_wrap(delete $opts->{line_wrap}) if exists $opts->{line_wrap};
	$w->set_alignment(@{delete $opts->{alignment}}) if exists $opts->{alignment};
	$w->modify_font(Gtk2::Pango::FontDescription->from_string(delete $opts->{font})) if exists $opts->{font};
    }

    if (my $text_ref = delete $opts->{text_ref}) {
	my $set = sub { $w->set_text($$text_ref) };
	gtkval_register($w, $text_ref, $set);
	$set->();
    }

    if (my $t = delete $opts->{text_markup}) {
	$w->set_markup($t);
	if ($w->get_text eq '') {
	    log::l("invalid markup in $t. not using the markup");
	    $w->set_text($t);
	}
    }
    $w;
}


sub _gtk__Alignment {
    my ($w, $_opts) = @_;

    if (!$w) {
	$w = Gtk2::Alignment->new(0, 0, 0, 0);
    }
    $w;
}


sub title1_to_markup {
    my ($label) = @_;
    if ($::isInstall) {
        my $font = lang::l2pango_font($::o->{locale}{lang});
        if (my ($font_size) = $font =~ /(\d+)/) {
            $font_size++;
            $font =~ s/\d+/$font_size/;
        }
        qq(<span foreground="#5A8AD6" font="$font">$label</span>);
    } else {
        qq(<b><big>$label</big></b>);
  }
}

sub _gtk__Install_Title {
    my ($w, $opts) = @_;
    local $opts->{widget_name} = 'Banner';
    $opts->{text} = uc($opts->{text}) if $::isInstall;
    gtknew('HBox', widget_name => 'Banner', children => [
        0, gtknew('Label', padding => [ 6, 0 ]),
        1, gtknew('VBox', widget_name => 'Banner', children_tight => [
            _gtk__Title2($w, $opts),
            if_($::isInstall, Gtk2::HSeparator->new),
        ]),
        0, gtknew('Label', padding => [ 6, 0 ]),
    ]);
}

sub _gtk__Title1 {
    my ($w, $opts) = @_;
    $opts ||= {};
    $opts->{text_markup} = title1_to_markup(delete($opts->{label})) if $opts->{label};
    _gtk__WrappedLabel($w, $opts);
}

sub _gtk__Title2 {
    my ($w, $opts) = @_;
    $opts ||= {};
    $opts->{alignment} = [ 0, 0 ];
    _gtk__Title1($w, $opts);
}

sub _gtk__Sexy_IconEntry {
    my ($w, $opts) = @_;

    require Gtk2::Sexy;
    if (!$w) {
	$w = Gtk2::Sexy::IconEntry->new;
	$w->set_editable(delete $opts->{editable}) if exists $opts->{editable};
    }

    $w->add_clear_button if delete $opts->{clear_button};
    if (my $icon = delete $opts->{primary_icon}) {
        $w->set_icon('primary', $icon);
        $w->set_icon_highlight('primary', $icon);
    }
    if (my $icon = delete $opts->{secondary_icon}) {
        $w->set_icon('secondary', $icon);
        $w->set_icon_highlight('secondary', $icon);
    }

    $w->signal_connect('icon-released' => delete $opts->{'icon-released'}) if exists $opts->{'icon-released'};
    $w->signal_connect('icon-pressed' => delete $opts->{'icon-pressed'}) if exists $opts->{'icon-pressed'};

    _gtk__Entry($w, $opts);
}

sub _gtk__Entry {
    my ($w, $opts) = @_;

    if (!$w) {
	$w = Gtk2::Entry->new;
	$w->set_editable(delete $opts->{editable}) if exists $opts->{editable};
    }

    if (my $icon = delete $opts->{primary_icon}) {
        $w->set_icon_from_stock('primary', $icon);
        #$w->set_icon_highlight('primary', $icon);
    }
    if (my $icon = delete $opts->{secondary_icon}) {
        $w->set_icon_from_stock('secondary', $icon);
        #$w->set_icon_highlight('secondary', $icon);
    }

    $w->signal_connect('icon-release' => delete $opts->{'icon-release'}) if exists $opts->{'icon-release'};
    $w->signal_connect('icon-press' => delete $opts->{'icon-press'}) if exists $opts->{'icon-press'};

    $w->set_text(delete $opts->{text}) if exists $opts->{text};
    $w->signal_connect(key_press_event => delete $opts->{key_press_event}) if exists $opts->{key_press_event};

    if (my $text_ref = delete $opts->{text_ref}) {
	my $set = sub { $w->set_text($$text_ref) };
	gtkval_register($w, $text_ref, $set);
	$set->();
	$w->signal_connect(changed => sub {
		gtkval_modify($text_ref, $w->get_text, $set);
	});
    }

    $w;
}

sub _gtk__WeaknessCheckEntry {
    my ($w, $opts) = @_;

    if (!$w) {
	$w = _gtk__Entry($w, $opts);
    }

    $w->signal_connect('changed' => sub {
	require authentication;
	my $password_weakness = authentication::compute_password_weakness($w->get_text);
	$w->set_icon_from_pixbuf('GTK_ENTRY_ICON_SECONDARY', _get_weakness_icon($password_weakness));
	$w->set_icon_tooltip_text('GTK_ENTRY_ICON_SECONDARY', _get_weakness_tooltip($password_weakness));
    });

    $w;
}

sub _gtk__TextView {
    my ($w, $opts, $_class, $action) = @_;
	
    if (!$w) {
	$w = Gtk2::TextView->new;
	$w->set_editable(delete $opts->{editable}) if exists $opts->{editable};
	$w->set_wrap_mode(delete $opts->{wrap_mode}) if exists $opts->{wrap_mode};
	$w->set_cursor_visible(delete $opts->{cursor_visible}) if exists $opts->{cursor_visible};
    }

    _text_insert($w, delete $opts->{text}, append => $action eq 'gtkadd') if exists $opts->{text};
    $w;
}

sub _gtk__WebKit_View {
    my ($w, $opts, $_class, $_action) = @_;
    if (!$w) {
        $w = Gtk2::WebKit::WebView->new;
    }

    # disable contextual menu:
    if (delete $opts->{no_popup_menu}) {
        $w->signal_connect('populate-popup' => sub {
                               my (undef, $menu) = @_;
                               $menu->destroy if $menu;
                               1;
                           });
    }

    $w;
}

sub _gtk__ComboBox {
    my ($w, $opts, $_class, $action) = @_;

    if (!$w) {
	$w = Gtk2::ComboBox->new_text;
	$w->{format} = delete $opts->{format} if exists $opts->{format};

    }
    my $set_list = sub {
	$w->{formatted_list} = $w->{format} ? [ map { $w->{format}($_) } @{$w->{list}} ] : $w->{list};
	$w->get_model->clear;
	$w->{strings} = $w->{formatted_list};  # used by Gtk2::ComboBox wrappers such as get_text() in ugtk2
	$w->append_text($_) foreach @{$w->{formatted_list}};
    };
    if (my $list_ref = delete $opts->{list_ref}) {
	!$opts->{list} or internal_error("both list and list_ref");
	my $set = sub {
	    $w->{list} = $$list_ref;
	    $set_list->();
	};
	gtkval_register($w, $list_ref, $set);
	$set->();
    } elsif (exists $opts->{list}) {
	$w->{list} = delete $opts->{list};
	$set_list->();
    }

    if ($action eq 'gtknew') {
	if (my $text_ref = delete $opts->{text_ref}) {
	    my $set = sub {
		my $val = may_apply($w->{format}, $$text_ref);
		eval { $w->set_active(find_index { $_ eq $val } @{$w->{formatted_list}}) };
	    };
	    $w->signal_connect(changed => sub {
		gtkval_modify($text_ref, $w->{list}[$w->get_active], $set);
	    });
	    gtkval_register($w, $text_ref, $set);
	    gtkval_register($w, $text_ref, delete $opts->{changed}) if exists $opts->{changed};
	    $set->();
	} else {
	    my $val = delete $opts->{text};
	    eval { $w->set_active(find_index { $_ eq $val } @{$w->{formatted_list}}) } if defined $val;
	    $w->signal_connect(changed => delete $opts->{changed}) if exists $opts->{changed};
	}
    }
    $w;
}

sub _gtk__ScrolledWindow {
    my ($w, $opts, $_class, $action) = @_;
	
    if (!$w) {
	$w = Gtk2::ScrolledWindow->new(undef, undef);
	$w->set_policy(delete $opts->{h_policy} || 'automatic', delete $opts->{v_policy} || 'automatic');
    }

    my $faked_w = $w;

    if (my $child = delete $opts->{child}) {
	if (member(ref($child), qw(Gtk2::Layout Gtk2::Html2::View  Gtk2::SimpleList Gtk2::SourceView::View Gtk2::Text Gtk2::TextView Gtk2::TreeView Gtk2::WebKit::WebView))) {
	    $w->add($child);
	} else {
	    $w->add_with_viewport($child);
	}
	$child->set_focus_vadjustment($w->get_vadjustment) if $child->can('set_focus_vadjustment');
	$child->set_left_margin(6) if ref($child) =~ /Gtk2::TextView/ && $child->get_left_margin <= 6;
	$child->show;

	$w->child->set_shadow_type(delete $opts->{shadow_type}) if exists $opts->{shadow_type};

	if (ref($child) eq 'Gtk2::TextView' && delete $opts->{to_bottom}) {
	    $child->{to_bottom} = _allow_scroll_TextView_to_bottom($w, $child);
	}

	if (!delete $opts->{no_shadow} && $action eq 'gtknew' && ref($child) =~ /Gtk2::(Html2|SimpleList|TextView|TreeView|WebKit::WebView)/) {
	    $faked_w = gtknew('Frame', shadow_type => 'in', child => $w);
	}
    }
    $faked_w;
}

sub _gtk__Frame {
    my ($w, $opts) = @_;

    if ($w) {
	$w->set_label(delete $opts->{text}) if exists $opts->{text};
    } else {
	$w = Gtk2::Frame->new(delete $opts->{text});
	$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
	$w->set_shadow_type(delete $opts->{shadow_type}) if exists $opts->{shadow_type};
    }

    if (my $child = delete $opts->{child}) {
	$w->add($child);
	$child->show;
    }
    $w;
}

sub _gtk__Expander {
    my ($w, $opts) = @_;

    if ($w) {
	$w->set_label(delete $opts->{text}) if exists $opts->{text};
    } else {
	$w = Gtk2::Expander->new(delete $opts->{text});
    }

    $w->signal_connect(activate => delete $opts->{activate}) if exists $opts->{activate};

    if (my $child = delete $opts->{child}) {
	$w->add($child);
	$child->show;
    }
    $w;
}



sub _gtk__MDV_Notebook {
    my ($w, $opts, $_class, $_action) = @_;
    if (!$w) {
        import_style_ressources();

        my ($layout, $selection_arrow, $selection_bar);
        my $parent_window = delete $opts->{parent_window} || root_window();
        my $root_height = first($parent_window->get_size);
        my $suffix = $root_height == 800 && !$::isStandalone ? '_600' : '_768';
        # the white square is a little bit above the actual left sidepanel:
        my $offset = 20;
        my $is_flip_needed = text_direction_rtl();
        my $filler = gtknew('Image', file => 'left-background-filler.png');
        my $filler_height = $filler->get_pixbuf->get_height;
        my $left_background = gtknew('Image_using_pixbuf', file => 'left-background.png');
        my $lf_height = $left_background->{pixbuf}->get_height;
        my @right_background = $::isInstall ? 
          gtknew('Image', file => "right-white-background_left_part$suffix", flip => $is_flip_needed)
            : map {
                gtknew('Image', file => "right-white-background_left_part-$_", flip => $is_flip_needed);
            } 1, 2, 2, 3;
        my $width1 = $left_background->{pixbuf}->get_width;
        my $total_width = $width1 + $right_background[0]->get_pixbuf->get_width;
        my $arrow_x = text_direction_rtl() ? $offset/2 - 4 : $width1 - $offset - 3;
        $w = gtknew('HBox', spacing => 0, children => [
            0, $layout = gtknew('Layout', width => $total_width - $offset, children => [ #Layout Fixed
                # stacking order is important for "Z-buffer":
                [ $left_background, 0, 0 ],
                if_($suffix ne '_600',
                   [ $filler, 0, $lf_height ],
                   [ gtknew('Image', file => 'left-background-filler.png'), 0, $lf_height + $filler_height ],
                   [ gtknew('Image', file => 'left-background-filler.png'), 0, $lf_height + $filler_height*2 ],
                ),
                [ $selection_bar = gtknew('Image', file => 'rollover.png'), 0, 0 ], # arbitrary vertical position
                ($opts->{children} ? @{ delete $opts->{children} } : ()),
                [ my $box = gtknew('VBox', spacing => 0, height => -1, children => [
                    0, $right_background[0],
                    if_(!$::isInstall,
                        1, $right_background[1],
                        1, $right_background[2], # enought up to to XYZx1280 resolution
                        0, $right_background[3],
                    ),
                ]), (text_direction_rtl() ? 0 : $width1 - $offset), 0 ],
                # stack on top (vertical position is arbitrary):
                [ $selection_arrow = gtknew('Image', file => 'steps_on', flip => $is_flip_needed), $arrow_x, 0, ],
            ]),
            1, delete $opts->{right_child} || 
              gtknew('Image_using_pixbuf', file => "right-white-background_right_part$suffix", flip => $is_flip_needed),
        ]);

        $w->signal_connect('size-allocate' => sub {
                               my (undef, $requisition) = @_;
                               state $width ||= $right_background[0]->get_pixbuf->get_width;
                               $box->set_size_request($width, $requisition->height);
                           });
        $_->set_property('no-show-all', 1) foreach $selection_bar, $selection_arrow;
        bless($w, 'Gtk2::MDV_Notebook');
        add2hash($w, {
            arrow_x         => $arrow_x,
            layout          => $layout,
            selection_arrow => $selection_arrow,
            selection_bar   =>$selection_bar,
        });
    }
    $w;
}


sub _gtk__Fixed {
    my ($w, $opts, $_class, $_action) = @_;
	
    if (!$w) {
	$w = Gtk2::Fixed->new;
	$w->set_has_window(delete $opts->{has_window}) if exists $opts->{has_window};
        _gtknew_handle_layout_children($w, $opts);
    }
    $w;
}

sub _gtk__Layout {
    my ($w, $opts, $_class, $_action) = @_;
	
    if (!$w) {
	$w = Gtk2::Layout->new;
        _gtknew_handle_layout_children($w, $opts);
    }
    $w;
}

sub _gtknew_handle_layout_children {
    my ($w, $opts) = @_;
        $opts->{children} ||= [];
        push @{$opts->{children}}, [ delete $opts->{child}, delete $opts->{x}, delete $opts->{y} ] if exists $opts->{child};
        foreach (@{$opts->{children}}) {
            $w->put(@$_);
        }
        delete $opts->{children};

        if ($opts->{pixbuf_file}) {
            my $pixbuf = if_($opts->{pixbuf_file}, gtknew('Pixbuf', file => delete $opts->{pixbuf_file}));
            $w->signal_connect(
                realize => sub {
                    ugtk2::set_back_pixbuf($w, $pixbuf);
                });
        }
}


sub _gtk__Window { &_gtk_any_Window }
sub _gtk__Dialog { &_gtk_any_Window }
sub _gtk__Plug   { &_gtk_any_Window }
sub _gtk_any_Window {
    my ($w, $opts, $class) = @_;

    if (!$w) {
	if ($class eq 'Window') {
	    $w = "Gtk2::$class"->new(delete $opts->{type} || 'toplevel');
	} elsif ($class eq 'Plug') {
	    $opts->{socket_id} or internal_error("cannot create a Plug without a socket_id");
	    $w = "Gtk2::$class"->new(delete $opts->{socket_id});
	} elsif ($class eq 'FileChooserDialog') {
            my $action = delete $opts->{action} || internal_error("missing action for FileChooser");
            $w = Gtk2::FileChooserDialog->new(delete $opts->{title}, delete $opts->{transient_for} || $::main_window,
                                              $action, N("Cancel") => 'cancel', delete $opts->{button1} || N("Ok") => 'ok',
                                          );
	} else {
	    $w = "Gtk2::$class"->new;
	}

	if ($::isInstall || $::set_dialog_hint) {
	    $w->set_type_hint('dialog'); # for matchbox window manager
	}

	$w->set_modal(delete $opts->{modal}) if exists $opts->{modal};
	$opts->{transient_for} ||= $::main_window if $::main_window;
	$w->set_modal(1) if exists $opts->{transient_for};
	$w->set_transient_for(delete $opts->{transient_for}) if exists $opts->{transient_for};
	$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
	$w->set_shadow_type(delete $opts->{shadow_type}) if exists $opts->{shadow_type};
	$w->set_position(delete $opts->{position_policy}) if exists $opts->{position_policy};
	$w->set_default_size(delete $opts->{default_width} || -1, delete $opts->{default_height} || -1) if exists $opts->{default_width} || exists $opts->{default_height};
	my $icon_no_error = $opts->{icon_no_error};
	if (my $name = delete $opts->{icon} || delete $opts->{icon_no_error}) {
	    if (my $f = _find_imgfile($name)) {
		$w->set_icon(gtknew('Pixbuf', file => $f));
	    } elsif (!$icon_no_error) {
		internal_error("cannot find $name");
	    }
	}
    }
    $w->set_title(delete $opts->{title}) if exists $opts->{title};

    if (my $child = delete $opts->{child}) {
	$w->add($child);
	$child->show;
    }
    $w;
}

my $previous_popped_and_reuse_window;

sub destroy_previous_popped_and_reuse_window() {
    $previous_popped_and_reuse_window or return;

    $previous_popped_and_reuse_window->destroy;
    $previous_popped_and_reuse_window = undef;
}

sub _gtk__MagicWindow {
    my ($w, $opts) = @_;

    my $pop_it = delete $opts->{pop_it} || !$::isWizard && !$::isEmbedded || $::WizardTable && do {
	#- do not take into account the wizard banner
        # FIXME!!!
	any { !$_->isa('Gtk2::DrawingArea') && $_->visible } $::WizardTable->get_children;
    };

    my $pop_and_reuse = delete $opts->{pop_and_reuse} && $pop_it;
    my $sub_child = delete $opts->{child};
    my $provided_banner = delete $opts->{banner};

    if ($pop_it && $provided_banner) {
	$sub_child = gtknew('VBox', children => [ 0, $provided_banner, if_($sub_child, 1, $sub_child) ]);
    } else {
	$sub_child ||= gtknew('VBox');
    }
    if (!$pop_and_reuse) {
	destroy_previous_popped_and_reuse_window();
    }

    if ($previous_popped_and_reuse_window && $pop_and_reuse) {
	$w = $previous_popped_and_reuse_window;
	$w->remove($w->child);

	gtkadd($w, child => $sub_child);
	%$opts = ();
    } elsif ($pop_it) {
	$opts->{child} = $sub_child;

	$w = _create_Window($opts, '');
	$previous_popped_and_reuse_window = $w if $pop_and_reuse;
    } else {
	if (!$::WizardWindow) {

	    my $banner;
	    if (!$::isEmbedded && !$::isInstall && $::Wizard_title) {
		if (_find_imgfile($opts->{icon_no_error})) {
		    $banner = Gtk2::Banner->new($opts->{icon_no_error}, $::Wizard_title);
		} else { 
		    log::l("ERROR: missing wizard banner $opts->{icon_no_error}");
		}
	    }
	    $::WizardTable = gtknew('VBox', if_($banner, children_tight => [ $banner ]));

	    if ($::isEmbedded) {
		add2hash($opts, {
		    socket_id => $::XID,
		    child => $::WizardTable,
		});
		delete $opts->{no_Window_Manager};
		$::Plug = $::WizardWindow = _gtk(undef, 'Plug', 'gtknew', $opts);
		sync($::WizardWindow);
	    } else {
		add2hash($opts, {
		    child => $::WizardTable,
		});
		$::WizardWindow = _create_Window($opts, 'special_center');
	    }
	} else {
	    %$opts = ();
	}

	set_main_window_size($::WizardWindow);

	$w = $::WizardWindow;
     
	gtkadd($::WizardTable, children_tight => [ $provided_banner ]) if $provided_banner;
	gtkadd($::WizardTable, children_loose => [ $sub_child ]);
    }
    bless { 
	real_window => $w, 
	child => $sub_child, pop_it => $pop_it, pop_and_reuse => $pop_and_reuse,
	if_($provided_banner, banner => $provided_banner),
    }, 'mygtk2::MagicWindow';
}

# A standard About dialog. Used with:
# my $w = gtknew('AboutDialog', ...);
# $w->show_all;
# $w->run;
sub _gtk__AboutDialog {
    my ($w, $opts) = @_;

    if (!$w) {
        $w = Gtk2::AboutDialog->new;
        $w->signal_connect(response => sub { $_[0]->destroy });
        $w->set_program_name(delete $opts->{name}) if exists $opts->{name};
        $w->set_version(delete $opts->{version}) if exists $opts->{version};
        $w->set_icon(gtknew('Pixbuf', file => delete $opts->{icon})) if exists $opts->{icon};
        $w->set_logo(gtknew('Pixbuf', file => delete $opts->{logo})) if exists $opts->{logo};
        $w->set_copyright(delete $opts->{copyright}) if exists $opts->{copyright};
        $w->set_url_hook(sub {
            my (undef, $url) = @_;
            run_program::raw({ detach => 1 }, 'www-browser', $url);
        });
        $w->set_email_hook(sub {
            my (undef, $url) = @_;
            run_program::raw({ detach => 1 }, 'www-browser', $url);
        });

        if (my $url = delete $opts->{website}) {
            $url =~ s/^https:/http:/; # Gtk2::About doesn't like "https://..." like URLs
            $w->set_website($url);
        }
        $w->set_license(delete $opts->{license}) if exists $opts->{license};
        $w->set_wrap_license(delete $opts->{wrap_license}) if exists $opts->{wrap_license};
        $w->set_comments(delete $opts->{comments}) if exists $opts->{comments};
        $w->set_website_label(delete $opts->{website_label}) if exists $opts->{website_label};
        $w->set_authors(delete $opts->{authors}) if exists $opts->{authors};
        $w->set_documenters(delete $opts->{documenters}) if exists $opts->{documenters};
        $w->set_translator_credits(delete $opts->{translator_credits}) if exists $opts->{translator_credits};
        $w->set_artists(delete $opts->{artists}) if exists $opts->{artists};
        $w->set_modal(delete $opts->{modal}) if exists $opts->{modal};
        $w->set_transient_for(delete $opts->{transient_for}) if exists $opts->{transient_for};
        $w->set_position(delete $opts->{position_policy}) if exists $opts->{position_policy};
    }
    $w;
}

sub _gtk__FileSelection {
    my ($w, $opts) = @_;

    if (!$w) {
	$w = Gtk2::FileSelection->new(delete $opts->{title} || '');
	gtkset($w->ok_button, %{delete $opts->{ok_button}}) if exists $opts->{ok_button};
	gtkset($w->cancel_button, %{delete $opts->{cancel_button}}) if exists $opts->{cancel_button};
    }
    $w;
}

sub _gtk__FileChooserDialog    { &_gtk_any_Window }

sub _gtk__FileChooser {
    my ($w, $opts) = @_;

    #- no nice way to have a {file_ref} on a FileChooser since selection_changed only works for browsing, not file/folder creation

    if (!$w) {
	my $action = delete $opts->{action} || internal_error("missing action for FileChooser");
	$w = Gtk2::FileChooserWidget->new($action);

	my $file = $opts->{file} && delete $opts->{file};

	if (my $dir = delete $opts->{directory} || $file && dirname($file)) {
	    $w->set_current_folder($dir);
	}
	if ($file) {
	    if ($action =~ /save|create/) {
		$w->set_current_name(basename($file));
	    } else {
		$w->set_filename($file);
	    }
	}
    }
    $w;
}

sub _gtk__VPaned { &_gtk_any_Paned }
sub _gtk__HPaned { &_gtk_any_Paned }
sub _gtk_any_Paned {
    my ($w, $opts, $class, $action) = @_;

    if (!$w) {
	$w = "Gtk2::$class"->new;
	$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
        $w->set_position(delete $opts->{position}) if exists $opts->{position};
    } elsif ($action eq 'gtkset') {
	$_->destroy foreach $w->get_children;
    }

    foreach my $opt (qw(resize1 shrink1 resize2 shrink2)) {
        $opts->{$opt} = 1 if !defined $opts->{$opt};
    }
    $w->pack1(delete $opts->{child1}, delete $opts->{resize1}, delete $opts->{shrink1});
    $w->pack2(delete $opts->{child2}, delete $opts->{resize2}, delete $opts->{shrink2});
    $w;
}

sub _gtk__VBox { &_gtk_any_Box }
sub _gtk__HBox { &_gtk_any_Box }
sub _gtk_any_Box {
    my ($w, $opts, $class, $action) = @_;

    if (!$w) {
	$w = "Gtk2::$class"->new;
	$w->set_homogeneous(delete $opts->{homogenous}) if exists $opts->{homogenous};
	$w->set_spacing(delete $opts->{spacing}) if exists $opts->{spacing};
	$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
    } elsif ($action eq 'gtkset') {
	$_->destroy foreach $w->get_children;
    }

    _gtknew_handle_children($w, $opts);
    $w;
}

sub _gtk__VButtonBox { &_gtk_any_ButtonBox }
sub _gtk__HButtonBox { &_gtk_any_ButtonBox }
sub _gtk_any_ButtonBox {
    my ($w, $opts, $class, $action) = @_;

    if (!$w) {
	$w = "Gtk2::$class"->new;
	$w->set_homogeneous(delete $opts->{homogenous}) if exists $opts->{homogenous};
	$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
	$w->set_spacing(delete $opts->{spacing}) if exists $opts->{spacing};
	$w->set_layout(delete $opts->{layout} || 'spread');
    } elsif ($action eq 'gtkset') {
	$_->destroy foreach $w->get_children;
    }

    _gtknew_handle_children($w, $opts);
    $w;
}

sub _gtk__Notebook {
    my ($w, $opts) = @_;

    if (!$w) {
	$w = Gtk2::Notebook->new;
	$w->set_property('show-tabs', delete $opts->{show_tabs}) if exists $opts->{show_tabs};
	$w->set_property('show-border', delete $opts->{show_border}) if exists $opts->{show_border};
    }

    if (exists $opts->{children}) {
	foreach (group_by2(@{delete $opts->{children}})) {
	    my ($title, $page) = @$_;
	    $w->append_page($page, $title);
	    $page->show;
	    $title->show;
	}
    }
    $w;
}

sub _gtk__Table {
    my ($w, $opts) = @_;

    if (!$w) {
	add2hash_($opts, { xpadding => 5, ypadding => 0, border_width => $::isInstall ? 3 : 10 });

	$w = Gtk2::Table->new(0, 0, delete $opts->{homogeneous} || 0);
	$w->set_col_spacings(delete $opts->{col_spacings} || 0);
	$w->set_row_spacings(delete $opts->{row_spacings} || 0);
	$w->set_border_width(delete $opts->{border_width});
	$w->{$_} = delete $opts->{$_} foreach 'xpadding', 'ypadding', 'mcc';
    }

    each_index {
	my ($i, $l) = ($::i, $_);
	each_index {
	    my $j = $::i;
	    if ($_) {
		ref $_ or $_ = Gtk2::WrappedLabel->new($_);
                $w->attach($_, $j, $j + 1, $i, $i + 1,
                           $j != $#$l && !$w->{mcc} ?
			     ('fill', 'fill', $w->{xpadding}, $w->{ypadding}) :
                               (['expand', 'fill'], ref($_) eq 'Gtk2::ScrolledWindow' || $_->get_data('must_grow') ?
                                 ['expand', 'fill'] : [], 0, 0));
		$_->show;
	    }
	} @$l;
    } @{delete $opts->{children} || []};

    $w;
}

sub _gtk_any_simple {
    my ($w, $_opts, $class) = @_;

    $w ||= "Gtk2::$class"->new;
}

sub _gtknew_handle_children {
    my ($w, $opts) = @_;

    my @child = exists $opts->{children_tight} ? map { [ 0, $_ ] } @{delete $opts->{children_tight}} :
                exists $opts->{children_loose} ? map { [ 1, $_ ] } @{delete $opts->{children_loose}} :
	        exists $opts->{children} ? group_by2(@{delete $opts->{children}}) : 
		exists $opts->{children_centered} ? 
		  ([ 1, gtknew('VBox') ], (map { [ 0, $_ ] } @{delete $opts->{children_centered}}), [ 1, gtknew('VBox') ]) :
		  ();

    my $padding = delete $opts->{padding};

    foreach (@child) {
	my ($fill, $child) = @$_;
	$fill eq '0' || $fill eq '1' || $fill eq 'fill' || $fill eq 'expand' or internal_error("odd {children} parameter must be 0 or 1 (got $fill)");
	ref $child or $child = Gtk2::WrappedLabel->new($child);
	my $expand = $fill && $fill ne 'fill' ? 1 : 0;
	$w->pack_start($child, $expand, $fill, $padding || 0);
	$child->show;
    }
}

#- this magic function redirects method calls:
#- * default is to redirect them to the {child}
#- * if the {child} doesn't handle the method, we try with the {real_window}
#-   (eg : add_accel_group set_position set_default_size
#- * a few methods are handled specially
my %for_real_window = map { $_ => 1 } qw(show_all size_request);
sub mygtk2::MagicWindow::AUTOLOAD {
    my ($w, @args) = @_;

    my ($meth) = $mygtk2::MagicWindow::AUTOLOAD =~ /mygtk2::MagicWindow::(.*)/;

    my ($s1, @s2) = $meth eq 'show'
              ? ('real_window', 'banner', 'child') :
            $meth eq 'destroy' || $meth eq 'hide' ?
	      ($w->{pop_it} ? 'real_window' : ('child', 'banner')) :
            $meth eq 'get' && $args[0] eq 'window-position' ||
	    $for_real_window{$meth} ||
            !$w->{child}->can($meth)
	      ? 'real_window'
	      : 'child';

#-    warn "mygtk2::MagicWindow::$meth", first($w =~ /HASH(.*)/), " on $s1 @s2 (@args)\n";

    $w->{$_} && $w->{$_}->$meth(@args) foreach @s2;
    $w->{$s1}->$meth(@args);
}

sub _create_Window {
    my ($opts, $special_center) = @_;

    my $no_Window_Manager = exists $opts->{no_Window_Manager} ? delete $opts->{no_Window_Manager} : !$::isStandalone;

    add2hash($opts, {
	if_(!$::isInstall && !$::isWizard, border_width => 5),

	#- policy: during install, we need a special code to handle the weird centering, see below
	position_policy => $special_center ? 'none' : 
	  $no_Window_Manager ? 'center-always' : 'center-on-parent',

	if_($::isInstall, position => [
	    $::stepswidth + ($::o->{windowwidth} - $::real_windowwidth) / 2, 
	    ($::o->{windowheight} - $::real_windowheight) / 2,
	]),
    });
    my $w = _gtk(undef, 'Window', 'gtknew', $opts);

    #- when the window is closed using the window manager "X" button (or alt-f4)
    $w->signal_connect(delete_event => sub { 
	if ($::isWizard) {
	    $w->destroy; 
	    die 'wizcancel';
	} else { 
	    if (Gtk2->main_level) {
                Gtk2->main_quit;
	    } else {
                # block window deletion if not in main loop (eg: while starting the GUI)
                return 1;
	    }
	} 
    });

    if ($::isInstall && !$::isStandalone) {
	require install::gtk; #- for perl_checker
	install::gtk::handle_unsafe_mouse($::o, $w);
	$w->signal_connect(key_press_event => \&install::gtk::special_shortcuts);

	#- force center at a weird position, this can't be handled by position_policy
	#- because center-* really are window manager hints for centering, whereas we want
	#- to center the main window in the right part of the screen
	my ($wi, $he);
	$w->signal_connect(size_allocate => sub {
	    my (undef, $event) = @_;
	    my @w_size = $event->values;

	    # ignore bogus sizing events:
	    return if $w_size[2] < 5;