5 # Created on 01/12/03 by Dan Espen (dane):
7 # This test script is designed to be driven with FvwmCommandS:
8 # All the functionality related to windowshading is tested,
9 # based on my reading of the man page.
13 # xterm is chosen because it doesn't like being resized by pixel
14 my $CMD1="xterm -geometry 10x5+0+0 -T $W1 -n $W1 -e sleep 1000";
15 # xv is OK being resized to almost any size
16 # Note that some copies of xv put <unregistered> after the name
17 # so wildcards are used the the commands that match the window name.
18 my $CMD2="xv -geometry 400x400+200+0 -name $W2";
20 # Just in case, set default conditions:
23 # Create some windows to windowshade:
36 sleep 1; # give windows time to appear
38 if ( "$ARGV[0]" ne "debug" ) {
39 &ShadeDir
("",""); # defaults to titlebar direction
40 &ShadeDir
("West","W");
42 &ShadeDir
("South","S");
43 &ShadeDir
("East","E");
44 &ShadeDir
("North","N");
46 &ShadeDir
("NorthEast","NE");
47 &ShadeDir
("SouthEast","SE");
48 &ShadeDir
("NorthWest","NW");
49 &ShadeDir
("SouthWest","SW");
51 &SetStyle
("TitleAtBottom");
52 &ShadeDir
("South","S");
53 &ShadeDir
("East","E");
54 &ShadeDir
("North","N");
56 &SetStyle
("TitleAtRight");
57 # Just go for the default:
60 &SetStyle
("TitleAtLeft");
61 # Just go for the default:
65 &ShadeDir
("",""); # This goes up
66 &ShadeDir
("West","W");
67 &ShadeDir
("South","S");
68 &ShadeDir
("East","E");
69 &ShadeDir
("North","N");
72 &SetStyle
("TitleAtTop,Title");
73 &ShadeDir
("South","S","stay");
74 &ShadeDir
("ShadeAgain North","ShadeAgain N","stay");
75 &ShadeDir
("ShadeAgain East","ShadeAgain E","stay");
76 &ShadeDir
("ShadeAgain West","ShadeAgain W");
79 &SetStyle
("WindowShadeSteps 1p");
80 &ShadeDir
("South","S");
81 &ShadeDir
("North","N");
82 &ShadeDir
("East","E");
83 &ShadeDir
("West","W");
84 &SetStyle
("WindowShadeSteps 0");
86 print "WindowShadeShrinks\n";
87 &SetStyle
("WindowShadeSteps 2p"); # Need some steps to see anything
88 &SetStyle
("WindowShadeShrinks");
89 &ShadeDir
("South","S");
90 &ShadeDir
("North","N");
91 &ShadeDir
("East","E");
92 &ShadeDir
("West","W");
94 # I just kept moving this down as I added tests...
96 print "Debug switch set, bypassing some tests\n";
99 print "WindowBusy/AlwaysLazy/Lazy\n";
100 &SetStyle
("WindowShadeSteps 10"); # Need some steps to see anything
101 &SetStyle
("WindowShadeBusy");
102 &ShadeDir
("South","S");
103 &ShadeDir
("North","NW");
104 &SetStyle
("WindowShadeAlwaysLazy");
105 &ShadeDir
("South","S");
106 &ShadeDir
("North","NW");
107 &SetStyle
("WindowShadeLazy");
108 &ShadeDir
("South","S");
109 &ShadeDir
("North","NW");
113 print "Close both windows\n";
114 `FvwmCommand "Next ($W1*) Close"`;
115 `FvwmCommand "Next ($W2*) Close"`;
119 # When I wrote this I used fork because I thought I might
120 # have to resort to killing the windows.
121 # This would do the job:
122 #kill (9, $child2,$child1);
126 # Set styles, both windows:
129 print "Style set to $style\n";
130 `FvwmCommand "Style $W1* $style"`;
131 `FvwmCommand "Style $W2* $style"`;
134 # Shade both windows, pause, then unshade
136 my ($dir,$dirshort,$stay)=@_;
137 print "Shade $dir both windows\n";
138 `FvwmCommand "Next ($W1*) WindowShade $dir"`;
139 `FvwmCommand "Next ($W2*) WindowShade $dirshort"`;
142 if ( "$stay" ne "stay") {
148 # Unshade both windows:
150 print "UnShade both windows\n";
151 `FvwmCommand "Next ($W1*) WindowShade"`;
152 `FvwmCommand "Next ($W2*) WindowShade"`;
156 # Reset Styles back to "starting condition":
158 &SetStyle
("TitleAtTop,Title,BorderWidth 6,HandleWidth 6");
159 &SetStyle
("WindowShadeSteps 0,WindowShadeScrolls");
160 &SetStyle
("WindowShadeLazy");