• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A generic touchscreen calibration program for X.Org


Commit MetaInfo

Révisione2a4c063f106fbd6e6921f751b6064f71e607ac2 (tree)
l'heure2010-08-16 06:52:23
AuteurTias Guns <tias@ulys...>
CommiterTias Guns

Message de Log

swap_xy, better document the difference between detecting the need to swap it, and the new swap_xy value

Change Summary

Modification

--- a/src/calibrator/calibratorEvdev.cpp
+++ b/src/calibrator/calibratorEvdev.cpp
@@ -179,8 +179,8 @@ bool CalibratorEvdev::finish_data(const XYinfo new_axys, int swap_xy)
179179 {
180180 bool success = true;
181181
182- // swap x and y: check if we need to swap with: if (swap_xy)
183- // value to swap too is inverse of previous swap value: in new_swap_xy
182+ // swap x and y axis, indicated by swap_xy
183+ // new value is old value (could have been 0 or 1) swapped:
184184 int new_swap_xy = 1 - old_swap_xy;
185185
186186 printf("\nDoing dynamic recalibration:\n");
--- a/src/calibrator/calibratorXorgPrint.cpp
+++ b/src/calibrator/calibratorXorgPrint.cpp
@@ -44,6 +44,10 @@ CalibratorXorgPrint::CalibratorXorgPrint(const char* const device_name0, const X
4444
4545 bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
4646 {
47+ // we suppose the previous 'swap_xy' value was 0
48+ // (unfortunately there is no way to verify this (yet))
49+ int new_swap_xy = swap_xy;
50+
4751 // TODO: detect which are applicable at runtime/in the makefile ?
4852 printf("\n\n== Applying the calibration ==\n");
4953 printf("There are multiple ways to do this: the tranditional way (xorg.conf), the new way (xorg.conf.d snippet) and the soon deprecated way (HAL policy):\n");
@@ -59,7 +63,7 @@ bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
5963 printf("\tOption\t\"MaxY\"\t\t\"%d\"\n",
6064 new_axys.y_max);
6165 if (swap_xy != 0)
62- printf("\tOption\t\"SwapXY\"\t\"%d\" # unless it was already set to 1\n", swap_xy);
66+ printf("\tOption\t\"SwapXY\"\t\"%d\" # unless it was already set to 1\n", new_swap_xy);
6367
6468 // xorg.conf.d snippet
6569 printf("\nxorg.conf.d snippet (RECOMMENDED): copy the snippet below into /etc/X11/xorg.conf.d/99-calibration.conf\n");
@@ -71,7 +75,7 @@ bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
7175 printf(" Option \"MinY\" \"%d\"\n", new_axys.y_min);
7276 printf(" Option \"MaxY\" \"%d\"\n", new_axys.y_max);
7377 if (swap_xy != 0)
74- printf(" Option \"SwapXY\" \"%d\" # unless it was already set to 1\n", swap_xy);
78+ printf(" Option \"SwapXY\" \"%d\" # unless it was already set to 1\n", new_swap_xy);
7579 printf("EndSection\n");
7680
7781 // HAL policy output
@@ -83,7 +87,7 @@ bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
8387 \t <merge key=\"input.x11_options.maxy\" type=\"string\">%d</merge>\n"
8488 , new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max);
8589 if (swap_xy != 0)
86- printf("\t <merge key=\"input.x11_options.swapxy\" type=\"string\">%d</merge>\n", swap_xy);
90+ printf("\t <merge key=\"input.x11_options.swapxy\" type=\"string\">%d</merge>\n", new_swap_xy);
8791 printf("\t</match>\n");
8892
8993 return true;