Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.cpp
Context not available. | |||||
1064 | WindowQuadList WindowQuadList::splitAtX(double x) const | 1064 | WindowQuadList WindowQuadList::splitAtX(double x) const | ||
---|---|---|---|---|---|
1065 | { | 1065 | { | ||
1066 | WindowQuadList ret; | 1066 | WindowQuadList ret; | ||
1067 | foreach (const WindowQuad & quad, *this) { | 1067 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1068 | #ifndef NDEBUG | 1068 | #ifndef NDEBUG | ||
1069 | if (quad.isTransformed()) | 1069 | if (quad.isTransformed()) | ||
1070 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | 1070 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | ||
Context not available. | |||||
1096 | WindowQuadList WindowQuadList::splitAtY(double y) const | 1096 | WindowQuadList WindowQuadList::splitAtY(double y) const | ||
1097 | { | 1097 | { | ||
1098 | WindowQuadList ret; | 1098 | WindowQuadList ret; | ||
1099 | foreach (const WindowQuad & quad, *this) { | 1099 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1100 | #ifndef NDEBUG | 1100 | #ifndef NDEBUG | ||
1101 | if (quad.isTransformed()) | 1101 | if (quad.isTransformed()) | ||
1102 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | 1102 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | ||
Context not available. | |||||
1136 | double top = first().top(); | 1136 | double top = first().top(); | ||
1137 | double bottom = first().bottom(); | 1137 | double bottom = first().bottom(); | ||
1138 | 1138 | | |||
1139 | foreach (const WindowQuad &quad, *this) { | 1139 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1140 | #ifndef NDEBUG | 1140 | #ifndef NDEBUG | ||
1141 | if (quad.isTransformed()) | 1141 | if (quad.isTransformed()) | ||
1142 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | 1142 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | ||
Context not available. | |||||
1149 | 1149 | | |||
1150 | WindowQuadList ret; | 1150 | WindowQuadList ret; | ||
1151 | 1151 | | |||
1152 | foreach (const WindowQuad &quad, *this) { | 1152 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1153 | const double quadLeft = quad.left(); | 1153 | const double quadLeft = quad.left(); | ||
1154 | const double quadRight = quad.right(); | 1154 | const double quadRight = quad.right(); | ||
1155 | const double quadTop = quad.top(); | 1155 | const double quadTop = quad.top(); | ||
Context not available. | |||||
1187 | double top = first().top(); | 1187 | double top = first().top(); | ||
1188 | double bottom = first().bottom(); | 1188 | double bottom = first().bottom(); | ||
1189 | 1189 | | |||
1190 | foreach (const WindowQuad &quad, *this) { | 1190 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1191 | #ifndef NDEBUG | 1191 | #ifndef NDEBUG | ||
1192 | if (quad.isTransformed()) | 1192 | if (quad.isTransformed()) | ||
1193 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | 1193 | qFatal("Splitting quads is allowed only in pre-paint calls!"); | ||
Context not available. | |||||
1203 | 1203 | | |||
1204 | WindowQuadList ret; | 1204 | WindowQuadList ret; | ||
1205 | 1205 | | |||
1206 | foreach (const WindowQuad &quad, *this) { | 1206 | for (const WindowQuad &quad : qAsConst(*this)) { | ||
1207 | const double quadLeft = quad.left(); | 1207 | const double quadLeft = quad.left(); | ||
1208 | const double quadRight = quad.right(); | 1208 | const double quadRight = quad.right(); | ||
1209 | const double quadTop = quad.top(); | 1209 | const double quadTop = quad.top(); | ||
Context not available. | |||||
1389 | 1389 | | |||
1390 | WindowQuadList WindowQuadList::select(WindowQuadType type) const | 1390 | WindowQuadList WindowQuadList::select(WindowQuadType type) const | ||
1391 | { | 1391 | { | ||
1392 | foreach (const WindowQuad & q, *this) { | 1392 | for (const WindowQuad &q : qAsConst(*this)) { | ||
1393 | if (q.type() != type) { // something else than ones to select, make a copy and filter | 1393 | if (q.type() != type) { // something else than ones to select, make a copy and filter | ||
1394 | WindowQuadList ret; | 1394 | WindowQuadList ret; | ||
1395 | foreach (const WindowQuad & q, *this) { | 1395 | for (const WindowQuad &q : qAsConst(*this)) { | ||
1396 | if (q.type() == type) | 1396 | if (q.type() == type) | ||
1397 | ret.append(q); | 1397 | ret.append(q); | ||
1398 | } | 1398 | } | ||
Context not available. | |||||
1404 | 1404 | | |||
1405 | WindowQuadList WindowQuadList::filterOut(WindowQuadType type) const | 1405 | WindowQuadList WindowQuadList::filterOut(WindowQuadType type) const | ||
1406 | { | 1406 | { | ||
1407 | foreach (const WindowQuad & q, *this) { | 1407 | for (const WindowQuad &q : qAsConst(*this)) { | ||
1408 | if (q.type() == type) { // something to filter out, make a copy and filter | 1408 | if (q.type() == type) { // something to filter out, make a copy and filter | ||
1409 | WindowQuadList ret; | 1409 | WindowQuadList ret; | ||
1410 | foreach (const WindowQuad & q, *this) { | 1410 | for (const WindowQuad &q : qAsConst(*this)) { | ||
1411 | if (q.type() != type) | 1411 | if (q.type() != type) | ||
1412 | ret.append(q); | 1412 | ret.append(q); | ||
1413 | } | 1413 | } | ||
Context not available. | |||||
1419 | 1419 | | |||
1420 | bool WindowQuadList::smoothNeeded() const | 1420 | bool WindowQuadList::smoothNeeded() const | ||
1421 | { | 1421 | { | ||
1422 | foreach (const WindowQuad & q, *this) | 1422 | for (const WindowQuad &q : qAsConst(*this)) | ||
1423 | if (q.smoothNeeded()) | 1423 | if (q.smoothNeeded()) | ||
1424 | return true; | 1424 | return true; | ||
1425 | return false; | 1425 | return false; | ||
1426 | } | 1426 | } | ||
1427 | 1427 | | |||
1428 | bool WindowQuadList::isTransformed() const | 1428 | bool WindowQuadList::isTransformed() const | ||
1429 | { | 1429 | { | ||
1430 | foreach (const WindowQuad & q, *this) | 1430 | for (const WindowQuad &q : qAsConst(*this)) | ||
1431 | if (q.isTransformed()) | 1431 | if (q.isTransformed()) | ||
1432 | return true; | 1432 | return true; | ||
1433 | return false; | 1433 | return false; | ||
1434 | } | 1434 | } | ||
1435 | 1435 | | |||
Context not available. | |||||
1482 | assert(areas != nullptr); // can be called only with clip() == true | 1482 | assert(areas != nullptr); // can be called only with clip() == true | ||
1483 | const QSize &s = effects->virtualScreenSize(); | 1483 | const QSize &s = effects->virtualScreenSize(); | ||
1484 | QRegion ret = QRegion(0, 0, s.width(), s.height()); | 1484 | QRegion ret = QRegion(0, 0, s.width(), s.height()); | ||
1485 | foreach (const QRegion & r, *areas) | 1485 | for (const QRegion & r : qAsConst(*areas)) | ||
1486 | ret &= r; | 1486 | ret &= r; | ||
1487 | return ret; | 1487 | return ret; | ||
1488 | } | 1488 | } | ||
1489 | 1489 | | |||
Context not available. |