Make code more indented but logic less odd.
catseye
12 years ago
64 | 64 | # This can be pre-set by the calling code |
65 | 65 | # by modifying %Console::Virtual::setup. |
66 | 66 | |
67 | if (defined $setup{input}) | |
67 | if (not defined $setup{input}) | |
68 | 68 | { |
69 | } | |
70 | elsif ($found_curses) | |
71 | { | |
72 | $setup{input} = 'Curses'; | |
73 | } | |
74 | elsif ($^O eq 'MSWin32') | |
75 | { | |
76 | $setup{input} = 'Win32'; | |
77 | } | |
78 | elsif ($found_term_screen) | |
79 | { | |
80 | $setup{input} = 'Screen'; | |
81 | } | |
82 | elsif ($found_posix) | |
83 | { | |
84 | $setup{input} = 'POSIX'; | |
85 | } else | |
86 | { | |
87 | warn "Warning! Raw input probably not available on this '$^O' system.\n"; | |
88 | $setup{input} = 'Teletype'; | |
69 | if ($found_curses) | |
70 | { | |
71 | $setup{input} = 'Curses'; | |
72 | } | |
73 | elsif ($^O eq 'MSWin32') | |
74 | { | |
75 | $setup{input} = 'Win32'; | |
76 | } | |
77 | elsif ($found_term_screen) | |
78 | { | |
79 | $setup{input} = 'Screen'; | |
80 | } | |
81 | elsif ($found_posix) | |
82 | { | |
83 | $setup{input} = 'POSIX'; | |
84 | } else | |
85 | { | |
86 | warn "Warning! Raw input probably not available on this '$^O' system.\n"; | |
87 | $setup{input} = 'Teletype'; | |
88 | } | |
89 | 89 | } |
90 | 90 | require "Console/Input/$setup{input}.pm"; |
91 | 91 | |
93 | 93 | # This can be pre-set by the calling code |
94 | 94 | # by modifying %Console::Virtual::setup. |
95 | 95 | |
96 | if (defined $setup{display}) | |
96 | if (not defined $setup{display}) | |
97 | 97 | { |
98 | } | |
99 | elsif ($found_curses) | |
100 | { | |
101 | $setup{display} = 'Curses'; | |
102 | } | |
103 | elsif ($^O eq 'MSWin32') | |
104 | { | |
105 | $setup{display} = 'Win32'; | |
106 | } | |
107 | elsif ($found_term_screen) | |
108 | { | |
109 | $setup{display} = 'Screen'; | |
110 | } | |
111 | elsif ($found_termcap) | |
112 | { | |
113 | $setup{display} = 'Tput'; | |
114 | } else | |
115 | { | |
116 | warn "Addressable screen must be emulated on this '$^O' system"; | |
117 | $setup{display} = 'Teletype'; | |
98 | if ($found_curses) | |
99 | { | |
100 | $setup{display} = 'Curses'; | |
101 | } | |
102 | elsif ($^O eq 'MSWin32') | |
103 | { | |
104 | $setup{display} = 'Win32'; | |
105 | } | |
106 | elsif ($found_term_screen) | |
107 | { | |
108 | $setup{display} = 'Screen'; | |
109 | } | |
110 | elsif ($found_termcap) | |
111 | { | |
112 | $setup{display} = 'Tput'; | |
113 | } else | |
114 | { | |
115 | warn "Addressable screen must be emulated on this '$^O' system"; | |
116 | $setup{display} = 'Teletype'; | |
117 | } | |
118 | 118 | } |
119 | 119 | require "Console/Display/$setup{display}.pm"; |
120 | 120 | |
123 | 123 | # This can be pre-set by the calling code |
124 | 124 | # by modifying %Console::Virtual::setup. |
125 | 125 | |
126 | if (defined $setup{color}) | |
126 | if (not defined $setup{color}) | |
127 | 127 | { |
128 | } | |
129 | elsif ($found_curses) | |
130 | { | |
131 | $setup{color} = 'Curses'; | |
132 | } | |
133 | elsif ($^O eq 'MSWin32') | |
134 | { | |
135 | $setup{color} = 'Win32'; | |
136 | } | |
137 | elsif ($found_term_screen) | |
138 | { | |
139 | # $setup{color} = 'Screen'; # TODO! needs to be written | |
140 | $setup{color} = 'ANSI16'; # not a very general solution | |
141 | } | |
142 | else | |
143 | { | |
144 | $setup{color} = 'Mono'; | |
128 | if ($found_curses) | |
129 | { | |
130 | $setup{color} = 'Curses'; | |
131 | } | |
132 | elsif ($^O eq 'MSWin32') | |
133 | { | |
134 | $setup{color} = 'Win32'; | |
135 | } | |
136 | elsif ($found_term_screen) | |
137 | { | |
138 | # $setup{color} = 'Screen'; # TODO! needs to be written | |
139 | $setup{color} = 'ANSI16'; # not a very general solution | |
140 | } | |
141 | else | |
142 | { | |
143 | $setup{color} = 'Mono'; | |
144 | } | |
145 | 145 | } |
146 | 146 | require "Console/Color/$setup{color}.pm"; |
147 | 147 | } |