aboutsummaryrefslogtreecommitdiff
path: root/src/ScreenPlacement.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-05-23 10:25:47 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-05-23 10:25:47 (GMT)
commitfbcdd34b223174a28ff712b7d03e56339fa2fe07 (patch)
treeda036effaeeb5ba7788f4b0403151aa864e9d16d /src/ScreenPlacement.cc
parentff9c68e247704bd1522ea7a2055b7fa4b2b0c568 (diff)
downloadfluxbox-fbcdd34b223174a28ff712b7d03e56339fa2fe07.zip
fluxbox-fbcdd34b223174a28ff712b7d03e56339fa2fe07.tar.bz2
mostly cosmetic fixes, mainly discovered by 'clang --analyze'
reordering of Resource-related stuff was because of "error: explicit specialization of 'getString' after instantiation" complaints.
Diffstat (limited to 'src/ScreenPlacement.cc')
-rw-r--r--src/ScreenPlacement.cc61
1 files changed, 31 insertions, 30 deletions
diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
index a617956..3e0c377 100644
--- a/src/ScreenPlacement.cc
+++ b/src/ScreenPlacement.cc
@@ -132,24 +132,6 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
132 132
133////////////////////// Placement Resources 133////////////////////// Placement Resources
134namespace FbTk { 134namespace FbTk {
135
136template <>
137void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char *str) {
138 if (strcasecmp("RowSmartPlacement", str) == 0)
139 *(*this) = ScreenPlacement::ROWSMARTPLACEMENT;
140 else if (strcasecmp("ColSmartPlacement", str) == 0)
141 *(*this) = ScreenPlacement::COLSMARTPLACEMENT;
142 else if (strcasecmp("RowMinOverlapPlacement", str) == 0)
143 *(*this) = ScreenPlacement::ROWMINOVERLAPPLACEMENT;
144 else if (strcasecmp("ColMinOverlapPlacement", str) == 0)
145 *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
146 else if (strcasecmp("UnderMousePlacement", str) == 0)
147 *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
148 else if (strcasecmp("CascadePlacement", str) == 0)
149 *(*this) = ScreenPlacement::CASCADEPLACEMENT;
150 else
151 setDefaultValue();
152}
153 135
154template <> 136template <>
155std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const { 137std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const {
@@ -172,16 +154,24 @@ std::string FbTk::Resource<ScreenPlacement::PlacementPolicy>::getString() const
172} 154}
173 155
174template <> 156template <>
175void FbTk::Resource<ScreenPlacement::RowDirection>::setFromString(const char *str) { 157void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char *str) {
176 if (strcasecmp("LeftToRight", str) == 0) 158 if (strcasecmp("RowSmartPlacement", str) == 0)
177 *(*this) = ScreenPlacement::LEFTRIGHT; 159 *(*this) = ScreenPlacement::ROWSMARTPLACEMENT;
178 else if (strcasecmp("RightToLeft", str) == 0) 160 else if (strcasecmp("ColSmartPlacement", str) == 0)
179 *(*this) = ScreenPlacement::RIGHTLEFT; 161 *(*this) = ScreenPlacement::COLSMARTPLACEMENT;
162 else if (strcasecmp("RowMinOverlapPlacement", str) == 0)
163 *(*this) = ScreenPlacement::ROWMINOVERLAPPLACEMENT;
164 else if (strcasecmp("ColMinOverlapPlacement", str) == 0)
165 *(*this) = ScreenPlacement::COLMINOVERLAPPLACEMENT;
166 else if (strcasecmp("UnderMousePlacement", str) == 0)
167 *(*this) = ScreenPlacement::UNDERMOUSEPLACEMENT;
168 else if (strcasecmp("CascadePlacement", str) == 0)
169 *(*this) = ScreenPlacement::CASCADEPLACEMENT;
180 else 170 else
181 setDefaultValue(); 171 setDefaultValue();
182
183} 172}
184 173
174
185template <> 175template <>
186std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const { 176std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const {
187 switch (*(*this)) { 177 switch (*(*this)) {
@@ -196,14 +186,13 @@ std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const {
196 186
197 187
198template <> 188template <>
199void FbTk::Resource<ScreenPlacement::ColumnDirection>::setFromString(const char *str) { 189void FbTk::Resource<ScreenPlacement::RowDirection>::setFromString(const char *str) {
200 if (strcasecmp("TopToBottom", str) == 0) 190 if (strcasecmp("LeftToRight", str) == 0)
201 *(*this) = ScreenPlacement::TOPBOTTOM; 191 *(*this) = ScreenPlacement::LEFTRIGHT;
202 else if (strcasecmp("BottomToTop", str) == 0) 192 else if (strcasecmp("RightToLeft", str) == 0)
203 *(*this) = ScreenPlacement::BOTTOMTOP; 193 *(*this) = ScreenPlacement::RIGHTLEFT;
204 else 194 else
205 setDefaultValue(); 195 setDefaultValue();
206
207} 196}
208 197
209template <> 198template <>
@@ -217,4 +206,16 @@ std::string FbTk::Resource<ScreenPlacement::ColumnDirection>::getString() const
217 206
218 return "TopToBottom"; 207 return "TopToBottom";
219} 208}
209
210
211template <>
212void FbTk::Resource<ScreenPlacement::ColumnDirection>::setFromString(const char *str) {
213 if (strcasecmp("TopToBottom", str) == 0)
214 *(*this) = ScreenPlacement::TOPBOTTOM;
215 else if (strcasecmp("BottomToTop", str) == 0)
216 *(*this) = ScreenPlacement::BOTTOMTOP;
217 else
218 setDefaultValue();
219}
220
220} // end namespace FbTk 221} // end namespace FbTk