• 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

Revisãoac29e2e67ee58cc2ef82d4ebeadc4048c3939d4a (tree)
Hora2010-09-13 00:25:18
AutorTias Guns <tias@ulys...>
CommiterTias Guns

Mensagem de Log

add hal output for evdev (not used by auto, not recommended)

only use on old systems lacking xorg.conf.d support but with a
recent evdev

Mudança Sumário

Diff

--- a/src/calibrator/calibratorEvdev.cpp
+++ b/src/calibrator/calibratorEvdev.cpp
@@ -63,6 +63,7 @@ public:
6363 int xinput_do_set_prop(Display *display, Atom type, int format, int argc, char* argv[]);
6464 protected:
6565 bool output_xorgconfd(const XYinfo new_axys, int swap_xy, int new_swap_xy);
66+ bool output_hal(const XYinfo new_axys, int swap_xy, int new_swap_xy);
6667 bool output_xinput(const XYinfo new_axys, int swap_xy, int new_swap_xy);
6768 };
6869
@@ -231,6 +232,9 @@ bool CalibratorEvdev::finish_data(const XYinfo new_axys, int swap_xy)
231232 case OUTYPE_XORGCONFD:
232233 success &= output_xorgconfd(new_axys, swap_xy, new_swap_xy);
233234 break;
235+ case OUTYPE_HAL:
236+ success &= output_hal(new_axys, swap_xy, new_swap_xy);
237+ break;
234238 case OUTYPE_XINPUT:
235239 success &= output_xinput(new_axys, swap_xy, new_swap_xy);
236240 break;
@@ -482,6 +486,28 @@ bool CalibratorEvdev::output_xorgconfd(const XYinfo new_axys, int swap_xy, int n
482486 return true;
483487 }
484488
489+bool CalibratorEvdev::output_hal(const XYinfo new_axys, int swap_xy, int new_swap_xy)
490+{
491+ const char* sysfs_name = get_sysfs_name();
492+ bool not_sysfs_name = (sysfs_name == NULL);
493+ if (not_sysfs_name)
494+ sysfs_name = "!!Name_Of_TouchScreen!!";
495+
496+ // HAL policy output
497+ printf(" copy the policy below into '/etc/hal/fdi/policy/touchscreen.fdi'\n\
498+<match key=\"info.product\" contains=\"%s\">\n\
499+ <merge key=\"input.x11_options.calibration\" type=\"string\">%d %d %d %d</merge>\n"
500+ , sysfs_name, new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max);
501+ if (swap_xy != 0)
502+ printf(" <merge key=\"input.x11_options.swapaxes\" type=\"string\">%d</merge>\n", new_swap_xy);
503+ printf("</match>\n");
504+
505+ if (not_sysfs_name)
506+ printf("\nChange '%s' to your device's name in the config above.\n", sysfs_name);
507+
508+ return true;
509+}
510+
485511 bool CalibratorEvdev::output_xinput(const XYinfo new_axys, int swap_xy, int new_swap_xy)
486512 {
487513 // create startup script