Changeset View
Changeset View
Standalone View
Standalone View
effects/cube/cube.cpp
Context not available. | |||||
123 | void CubeEffect::reconfigure(ReconfigureFlags) | 123 | void CubeEffect::reconfigure(ReconfigureFlags) | ||
---|---|---|---|---|---|
124 | { | 124 | { | ||
125 | CubeConfig::self()->read(); | 125 | CubeConfig::self()->read(); | ||
126 | foreach (ElectricBorder border, borderActivate) { | 126 | for (ElectricBorder border : qAsConst(borderActivate)) { | ||
127 | effects->unreserveElectricBorder(border, this); | 127 | effects->unreserveElectricBorder(border, this); | ||
128 | } | 128 | } | ||
129 | foreach (ElectricBorder border, borderActivateCylinder) { | 129 | for (ElectricBorder border : qAsConst(borderActivateCylinder)) { | ||
130 | effects->unreserveElectricBorder(border, this); | 130 | effects->unreserveElectricBorder(border, this); | ||
131 | } | 131 | } | ||
132 | foreach (ElectricBorder border, borderActivateSphere) { | 132 | for (ElectricBorder border : qAsConst(borderActivateSphere)) { | ||
133 | effects->unreserveElectricBorder(border, this); | 133 | effects->unreserveElectricBorder(border, this); | ||
134 | } | 134 | } | ||
135 | borderActivate.clear(); | 135 | borderActivate.clear(); | ||
Context not available. | |||||
138 | QList<int> borderList = QList<int>(); | 138 | QList<int> borderList = QList<int>(); | ||
139 | borderList.append(int(ElectricNone)); | 139 | borderList.append(int(ElectricNone)); | ||
140 | borderList = CubeConfig::borderActivate(); | 140 | borderList = CubeConfig::borderActivate(); | ||
141 | foreach (int i, borderList) { | 141 | for (int i : qAsConst(borderList)) { | ||
142 | borderActivate.append(ElectricBorder(i)); | 142 | borderActivate.append(ElectricBorder(i)); | ||
143 | effects->reserveElectricBorder(ElectricBorder(i), this); | 143 | effects->reserveElectricBorder(ElectricBorder(i), this); | ||
144 | } | 144 | } | ||
145 | borderList.clear(); | 145 | borderList.clear(); | ||
146 | borderList.append(int(ElectricNone)); | 146 | borderList.append(int(ElectricNone)); | ||
147 | borderList = CubeConfig::borderActivateCylinder(); | 147 | borderList = CubeConfig::borderActivateCylinder(); | ||
148 | foreach (int i, borderList) { | 148 | for (int i : qAsConst(borderList)) { | ||
149 | borderActivateCylinder.append(ElectricBorder(i)); | 149 | borderActivateCylinder.append(ElectricBorder(i)); | ||
150 | effects->reserveElectricBorder(ElectricBorder(i), this); | 150 | effects->reserveElectricBorder(ElectricBorder(i), this); | ||
151 | } | 151 | } | ||
152 | borderList.clear(); | 152 | borderList.clear(); | ||
153 | borderList.append(int(ElectricNone)); | 153 | borderList.append(int(ElectricNone)); | ||
154 | borderList = CubeConfig::borderActivateSphere(); | 154 | borderList = CubeConfig::borderActivateSphere(); | ||
155 | foreach (int i, borderList) { | 155 | for (int i : qAsConst(borderList)) { | ||
156 | borderActivateSphere.append(ElectricBorder(i)); | 156 | borderActivateSphere.append(ElectricBorder(i)); | ||
157 | effects->reserveElectricBorder(ElectricBorder(i), this); | 157 | effects->reserveElectricBorder(ElectricBorder(i), this); | ||
158 | } | 158 | } | ||
Context not available. | |||||
1203 | if (w->isOnDesktop(prev_desktop) && (mask & PAINT_WINDOW_TRANSFORMED)) { | 1203 | if (w->isOnDesktop(prev_desktop) && (mask & PAINT_WINDOW_TRANSFORMED)) { | ||
1204 | QRect rect = effects->clientArea(FullArea, activeScreen, prev_desktop); | 1204 | QRect rect = effects->clientArea(FullArea, activeScreen, prev_desktop); | ||
1205 | WindowQuadList new_quads; | 1205 | WindowQuadList new_quads; | ||
1206 | foreach (const WindowQuad & quad, data.quads) { | 1206 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1207 | if (quad.right() > rect.width() - w->x()) { | 1207 | if (quad.right() > rect.width() - w->x()) { | ||
1208 | new_quads.append(quad); | 1208 | new_quads.append(quad); | ||
1209 | } | 1209 | } | ||
Context not available. | |||||
1214 | if (w->isOnDesktop(next_desktop) && (mask & PAINT_WINDOW_TRANSFORMED)) { | 1214 | if (w->isOnDesktop(next_desktop) && (mask & PAINT_WINDOW_TRANSFORMED)) { | ||
1215 | QRect rect = effects->clientArea(FullArea, activeScreen, next_desktop); | 1215 | QRect rect = effects->clientArea(FullArea, activeScreen, next_desktop); | ||
1216 | WindowQuadList new_quads; | 1216 | WindowQuadList new_quads; | ||
1217 | foreach (const WindowQuad & quad, data.quads) { | 1217 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1218 | if (w->x() + quad.right() <= rect.x()) { | 1218 | if (w->x() + quad.right() <= rect.x()) { | ||
1219 | new_quads.append(quad); | 1219 | new_quads.append(quad); | ||
1220 | } | 1220 | } | ||
Context not available. | |||||
1249 | 1249 | | |||
1250 | if (w->isOnDesktop(painting_desktop) && w->x() < rect.x()) { | 1250 | if (w->isOnDesktop(painting_desktop) && w->x() < rect.x()) { | ||
1251 | WindowQuadList new_quads; | 1251 | WindowQuadList new_quads; | ||
1252 | foreach (const WindowQuad & quad, data.quads) { | 1252 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1253 | if (quad.right() > -w->x()) { | 1253 | if (quad.right() > -w->x()) { | ||
1254 | new_quads.append(quad); | 1254 | new_quads.append(quad); | ||
1255 | } | 1255 | } | ||
Context not available. | |||||
1258 | } | 1258 | } | ||
1259 | if (w->isOnDesktop(painting_desktop) && w->x() + w->width() > rect.x() + rect.width()) { | 1259 | if (w->isOnDesktop(painting_desktop) && w->x() + w->width() > rect.x() + rect.width()) { | ||
1260 | WindowQuadList new_quads; | 1260 | WindowQuadList new_quads; | ||
1261 | foreach (const WindowQuad & quad, data.quads) { | 1261 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1262 | if (quad.right() <= rect.width() - w->x()) { | 1262 | if (quad.right() <= rect.width() - w->x()) { | ||
1263 | new_quads.append(quad); | 1263 | new_quads.append(quad); | ||
1264 | } | 1264 | } | ||
Context not available. | |||||
1267 | } | 1267 | } | ||
1268 | if (w->y() < rect.y()) { | 1268 | if (w->y() < rect.y()) { | ||
1269 | WindowQuadList new_quads; | 1269 | WindowQuadList new_quads; | ||
1270 | foreach (const WindowQuad & quad, data.quads) { | 1270 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1271 | if (quad.bottom() > -w->y()) { | 1271 | if (quad.bottom() > -w->y()) { | ||
1272 | new_quads.append(quad); | 1272 | new_quads.append(quad); | ||
1273 | } | 1273 | } | ||
Context not available. | |||||
1276 | } | 1276 | } | ||
1277 | if (w->y() + w->height() > rect.y() + rect.height()) { | 1277 | if (w->y() + w->height() > rect.y() + rect.height()) { | ||
1278 | WindowQuadList new_quads; | 1278 | WindowQuadList new_quads; | ||
1279 | foreach (const WindowQuad & quad, data.quads) { | 1279 | for (const WindowQuad & quad : qAsConst(data.quads)) { | ||
1280 | if (quad.bottom() <= rect.height() - w->y()) { | 1280 | if (quad.bottom() <= rect.height() - w->y()) { | ||
1281 | new_quads.append(quad); | 1281 | new_quads.append(quad); | ||
1282 | } | 1282 | } | ||
Context not available. | |||||
1350 | quadSize = 150.0f; | 1350 | quadSize = 150.0f; | ||
1351 | else | 1351 | else | ||
1352 | quadSize = 250.0f; | 1352 | quadSize = 250.0f; | ||
1353 | foreach (const QRect & paintRect, paint.rects()) { | 1353 | const QVector<QRect> rects = paint.rects(); | ||
1354 | for (const QRect & paintRect : rects) { | ||||
1354 | for (int i = 0; i <= (paintRect.height() / quadSize); i++) { | 1355 | for (int i = 0; i <= (paintRect.height() / quadSize); i++) { | ||
1355 | for (int j = 0; j <= (paintRect.width() / quadSize); j++) { | 1356 | for (int j = 0; j <= (paintRect.width() / quadSize); j++) { | ||
1356 | verts << qMin(paintRect.x() + (j + 1)*quadSize, (float)paintRect.x() + paintRect.width()) << paintRect.y() + i*quadSize; | 1357 | verts << qMin(paintRect.x() + (j + 1)*quadSize, (float)paintRect.x() + paintRect.width()) << paintRect.y() + i*quadSize; | ||
Context not available. | |||||
1692 | 1693 | | |||
1693 | void CubeEffect::setActive(bool active) | 1694 | void CubeEffect::setActive(bool active) | ||
1694 | { | 1695 | { | ||
1695 | foreach (CubeInsideEffect * inside, m_cubeInsideEffects) { | 1696 | for (CubeInsideEffect * inside : qAsConst(m_cubeInsideEffects)) { | ||
1696 | inside->setActive(true); | 1697 | inside->setActive(true); | ||
1697 | } | 1698 | } | ||
1698 | if (active) { | 1699 | if (active) { | ||
Context not available. |