• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

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

Revisión6375ad29a7896def9f16d3585679b12ecbd9274c (tree)
Tiempo2010-01-08 07:04:30
AutorTias Guns <tias@ulys...>
CommiterTias Guns

Log Message

add --fake option

Cambiar Resumen

Diferencia incremental

--- a/xinput_calibrator.cc
+++ b/xinput_calibrator.cc
@@ -959,10 +959,14 @@ CalibrationArea::CalibrationArea (int argc, char** argv)
959959 XFreeDeviceList(slist);
960960 XCloseDisplay(display);
961961
962- // override min/maxX/Y from command line ?
962+ // parse input, part 2
963+ bool fake = false;
964+ bool precalib = false;
963965 if (argc > 1) {
964966 for (int i=1; i!=argc; i++) {
967+ // Get pre-calibration ?
965968 if (strcmp("--precalib", argv[i]) == 0) {
969+ precalib = true;
966970 if (argc > i+1)
967971 min_x = atoi(argv[i+1]);
968972 if (argc > i+2)
@@ -972,12 +976,26 @@ CalibrationArea::CalibrationArea (int argc, char** argv)
972976 if (argc > i+4)
973977 max_y = atoi(argv[i+4]);
974978 }
979+
980+ // Fake calibratable device ?
981+ if (strcmp("--fake", argv[i]) == 0) {
982+ fake = true;
983+ }
975984 }
976985 }
977986
978987 if (found == 0) {
979- fprintf (stderr, "Error: No calibratable devices found.\n");
980- quit (1);
988+ if (fake) {
989+ // Fake a calibratable device
990+ drivername = "Fake_device";
991+ if (!precalib) {
992+ min_x = 0; max_x = 0;
993+ min_y = 0; max_y = 0;
994+ }
995+ } else {
996+ fprintf (stderr, "Error: No calibratable devices found.\n");
997+ exit(1);
998+ }
981999 }
9821000 if (found > 1)
9831001 printf ("Warning: multiples calibratable devices found, calibrating last one (%s)\n", drivername);