• 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ão268bbc43cd3e1e05311248f3f1d104859639117d (tree)
Hora2011-06-14 18:52:25
AutorTias Guns <tias@ulys...>
CommiterTias Guns

Mensagem de Log

add manpage and gui_gtkmm support for --geometry

Mudança Sumário

Diff

--- a/man/xinput_calibrator.1
+++ b/man/xinput_calibrator.1
@@ -59,6 +59,10 @@ type of config to ouput (auto=automatically detect, default: auto)
5959 Emulate a fake driver (for testing purposes)
6060 .br
6161 Useful to test the calibrator without applying the values, and possibly even without having a touchscreen.
62+.PP
63+.TP 8
64+.B \-\-geometry \fIwidth\fPx\fIheight\fP
65+Manually provide the geometry (width and height) for the calibration window.
6266 .SH "USAGE"
6367 Run xinput_calibrator in a terminal, as it prints out the calibration values and instructions on standard output.
6468 .PP
--- a/src/gui/gui_gtkmm.cpp
+++ b/src/gui/gui_gtkmm.cpp
@@ -85,7 +85,20 @@ CalibrationArea::CalibrationArea(Calibrator* calibrator0)
8585 add_events(Gdk::KEY_PRESS_MASK | Gdk::BUTTON_PRESS_MASK);
8686 set_flags(Gtk::CAN_FOCUS);
8787
88- set_display_size(get_width(), get_height());
88+ // parse geometry string
89+ const char* geo = calibrator->get_geometry();
90+ if (geo != NULL) {
91+ int gw,gh;
92+ int res = sscanf(geo,"%dx%d",&gw,&gh);
93+ if (res != 2) {
94+ fprintf(stderr,"Warning: error parsing geometry string - using defaults.\n");
95+ geo = NULL;
96+ } else {
97+ set_display_size( gw, gh );
98+ }
99+ }
100+ if (geo == NULL)
101+ set_display_size(get_width(), get_height());
89102
90103 // Setup timer for animation
91104 sigc::slot<bool> slot = sigc::mem_fun(*this, &CalibrationArea::on_timer_signal);
@@ -110,9 +123,10 @@ void CalibrationArea::set_display_size(int width, int height) {
110123
111124 bool CalibrationArea::on_expose_event(GdkEventExpose *event)
112125 {
113- // check that screensize did not change
114- if (display_width != get_width() ||
115- display_height != get_height()) {
126+ // check that screensize did not change (if no manually specified geometry)
127+ if (calibrator->get_geometry() == NULL &&
128+ (display_width != get_width() ||
129+ display_height != get_height()) ) {
116130 set_display_size(get_width(), get_height());
117131 }
118132