summaryrefslogtreecommitdiffstats
path: root/tderandr/libtderandr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tderandr/libtderandr.cc')
-rw-r--r--tderandr/libtderandr.cc41
1 files changed, 20 insertions, 21 deletions
diff --git a/tderandr/libtderandr.cc b/tderandr/libtderandr.cc
index eb7e96f9a..39e9c5b70 100644
--- a/tderandr/libtderandr.cc
+++ b/tderandr/libtderandr.cc
@@ -610,17 +610,16 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::loadDisplayConfiguration(TQString p
int KRandrSimpleAPI::getHardwareRotationFlags(SingleScreenData* screendata) {
int rotationFlags = 0;
- TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index);
- if (rotationDesired == ROTATION_0_DEGREES_STRING) {
+ if (screendata->current_rotation_index == ROTATION_0_DEGREES_INDEX) {
rotationFlags = rotationFlags | RandRScreen::Rotate0;
}
- else if (rotationDesired == ROTATION_90_DEGREES_STRING) {
+ else if (screendata->current_rotation_index == ROTATION_90_DEGREES_INDEX) {
rotationFlags = rotationFlags | RandRScreen::Rotate90;
}
- else if (rotationDesired == ROTATION_180_DEGREES_STRING) {
+ else if (screendata->current_rotation_index == ROTATION_180_DEGREES_INDEX) {
rotationFlags = rotationFlags | RandRScreen::Rotate180;
}
- else if (rotationDesired == ROTATION_270_DEGREES_STRING) {
+ else if (screendata->current_rotation_index == ROTATION_270_DEGREES_INDEX) {
rotationFlags = rotationFlags | RandRScreen::Rotate270;
}
if (screendata->has_x_flip) {
@@ -667,10 +666,10 @@ bool KRandrSimpleAPI::applyDisplayConfiguration(TQPtrList<SingleScreenData> scre
command.append(TQString(" --pos %1x%2").arg(screendata->absolute_x_position).arg(screendata->absolute_y_position));
command.append(TQString(" --refresh %1").arg(atoi((*screendata->refresh_rates.at(screendata->current_refresh_rate_index)).ascii())));
command.append(TQString(" --gamma %1:%2:%3").arg(screendata->gamma_red).arg(screendata->gamma_green).arg(screendata->gamma_blue));
- if (screendata->current_rotation_index == 0) command.append(" --rotate ").append("normal");
- if (screendata->current_rotation_index == 1) command.append(" --rotate ").append("left");
- if (screendata->current_rotation_index == 2) command.append(" --rotate ").append("inverted");
- if (screendata->current_rotation_index == 3) command.append(" --rotate ").append("right");
+ if (screendata->current_rotation_index == ROTATION_0_DEGREES_INDEX) command.append(" --rotate ").append("normal");
+ if (screendata->current_rotation_index == ROTATION_90_DEGREES_INDEX) command.append(" --rotate ").append("left");
+ if (screendata->current_rotation_index == ROTATION_180_DEGREES_INDEX) command.append(" --rotate ").append("inverted");
+ if (screendata->current_rotation_index == ROTATION_270_DEGREES_INDEX) command.append(" --rotate ").append("right");
if ((screendata->has_x_flip == 0) && (screendata->has_y_flip == 0)) command.append(" --reflect ").append("normal");
if ((screendata->has_x_flip == 1) && (screendata->has_y_flip == 0)) command.append(" --reflect ").append("x");
if ((screendata->has_x_flip == 0) && (screendata->has_y_flip == 1)) command.append(" --reflect ").append("y");
@@ -1308,30 +1307,30 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
// RandRScreen::ReflectX
// RandRScreen::ReflectY
- screendata->rotations.append(i18n(ROTATION_0_DEGREES_STRING));
- screendata->rotations.append(i18n(ROTATION_90_DEGREES_STRING));
- screendata->rotations.append(i18n(ROTATION_180_DEGREES_STRING));
- screendata->rotations.append(i18n(ROTATION_270_DEGREES_STRING));
+ screendata->rotations.append(i18n("0 degrees"));
+ screendata->rotations.append(i18n("90 degrees"));
+ screendata->rotations.append(i18n("180 degrees"));
+ screendata->rotations.append(i18n("270 degrees"));
screendata->supports_transformations = (cur_screen->rotations() != RandRScreen::Rotate0);
if (screendata->supports_transformations) {
screendata->current_orientation_mask = cur_screen->proposedRotation();
switch (screendata->current_orientation_mask & RandRScreen::RotateMask) {
case RandRScreen::Rotate0:
- screendata->current_rotation_index = 0;
+ screendata->current_rotation_index = ROTATION_0_DEGREES_INDEX;
break;
case RandRScreen::Rotate90:
- screendata->current_rotation_index = 1;
+ screendata->current_rotation_index = ROTATION_90_DEGREES_INDEX;
break;
case RandRScreen::Rotate180:
- screendata->current_rotation_index = 2;
+ screendata->current_rotation_index = ROTATION_180_DEGREES_INDEX;
break;
case RandRScreen::Rotate270:
- screendata->current_rotation_index = 3;
+ screendata->current_rotation_index = ROTATION_270_DEGREES_INDEX;
break;
default:
// Shouldn't hit this one
Q_ASSERT(screendata->current_orientation_mask & RandRScreen::RotateMask);
- screendata->current_rotation_index = 0;
+ screendata->current_rotation_index = ROTATION_0_DEGREES_INDEX;
break;
}
screendata->has_x_flip = (screendata->current_orientation_mask & RandRScreen::ReflectX);
@@ -1340,7 +1339,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
else {
screendata->has_x_flip = false;
screendata->has_y_flip = false;
- screendata->current_rotation_index = 0;
+ screendata->current_rotation_index = ROTATION_0_DEGREES_INDEX;
}
// Determine if this display is primary and/or extended
@@ -1413,7 +1412,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
screendata->gamma_green = 2.2;
screendata->gamma_blue = 2.2;
- screendata->current_rotation_index = 0;
+ screendata->current_rotation_index = ROTATION_0_DEGREES_INDEX;
screendata->current_orientation_mask = 0;
screendata->has_x_flip = false;
screendata->has_y_flip = false;
@@ -1455,7 +1454,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
screendata->gamma_green = 2.2;
screendata->gamma_blue = 2.2;
- screendata->current_rotation_index = 0;
+ screendata->current_rotation_index = ROTATION_0_DEGREES_INDEX;
screendata->current_orientation_mask = 0;
screendata->has_x_flip = false;
screendata->has_y_flip = false;