• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

A generic touchscreen calibration program for X.Org


Commit MetaInfo

Révision76ab69cd863a70bb941e8d8ea5b7f5bd20b36705 (tree)
l'heure2014-02-14 07:10:12
AuteurTias Guns <tias@ulys...>
CommiterTias Guns

Message de Log

Merge pull request #58 from austriancoder/master

Some small fixes

Change Summary

Modification

--- a/src/calibrator.hh
+++ b/src/calibrator.hh
@@ -193,7 +193,7 @@ protected:
193193 bool along_axis(int xy, int x0, int y0);
194194
195195 /// Apply new calibration, implementation dependent
196- virtual bool finish_data(const XYinfo new_axys) =0;
196+ virtual bool finish_data(const XYinfo &new_axys) =0;
197197
198198 /// Check whether the given name is a sysfs device name
199199 bool is_sysfs_name(const char* name);
--- a/src/calibrator/Evdev.cpp
+++ b/src/calibrator/Evdev.cpp
@@ -258,7 +258,7 @@ bool CalibratorEvdev::finish(int width, int height)
258258 }
259259
260260 // Activate calibrated data and output it
261-bool CalibratorEvdev::finish_data(const XYinfo new_axys)
261+bool CalibratorEvdev::finish_data(const XYinfo &new_axys)
262262 {
263263 bool success = true;
264264
@@ -336,7 +336,7 @@ bool CalibratorEvdev::set_invert_xy(const int invert_x, const int invert_y)
336336 arr_cmd[0] = invert_x;
337337 arr_cmd[1] = invert_y;
338338
339- int ret = xinput_do_set_int_prop("Evdev Axis Inversion", display, 8, 2, arr_cmd);
339+ bool ret = xinput_do_set_int_prop("Evdev Axis Inversion", display, 8, 2, arr_cmd);
340340
341341 if (verbose) {
342342 if (ret == true)
@@ -359,7 +359,7 @@ bool CalibratorEvdev::set_calibration(const XYinfo new_axys)
359359 arr_cmd[2] = new_axys.y.min;
360360 arr_cmd[3] = new_axys.y.max;
361361
362- int ret = xinput_do_set_int_prop("Evdev Axis Calibration", display, 32, 4, arr_cmd);
362+ bool ret = xinput_do_set_int_prop("Evdev Axis Calibration", display, 32, 4, arr_cmd);
363363
364364 if (verbose) {
365365 if (ret == true)
--- a/src/calibrator/Evdev.hpp
+++ b/src/calibrator/Evdev.hpp
@@ -64,7 +64,7 @@ public:
6464
6565 /// calculate and apply the calibration
6666 virtual bool finish(int width, int height);
67- virtual bool finish_data(const XYinfo new_axys);
67+ virtual bool finish_data(const XYinfo &new_axys);
6868
6969 bool set_swapxy(const int swap_xy);
7070 bool set_invert_xy(const int invert_x, const int invert_y);
--- a/src/calibrator/EvdevTester.cpp
+++ b/src/calibrator/EvdevTester.cpp
@@ -31,7 +31,7 @@ CalibratorEvdevTester::CalibratorEvdevTester(const char* const device_name0, con
3131 //printf("Starting test driver\n");
3232 }
3333
34-bool CalibratorEvdevTester::finish_data(const XYinfo axis)
34+bool CalibratorEvdevTester::finish_data(const XYinfo &axis)
3535 {
3636 new_axis = axis;
3737
--- a/src/calibrator/EvdevTester.hpp
+++ b/src/calibrator/EvdevTester.hpp
@@ -41,7 +41,7 @@ public:
4141 const int thr_misclick=0, const int thr_doubleclick=0,
4242 const OutputType output_type=OUTYPE_AUTO, const char* geometry=0);
4343
44- virtual bool finish_data(const XYinfo new_axis);
44+ virtual bool finish_data(const XYinfo &new_axis);
4545
4646 // emulate the driver processing the coordinates in 'raw'
4747 virtual XYinfo emulate_driver(const XYinfo& raw, bool useNewAxis, const XYinfo& screen, const XYinfo& device);
--- a/src/calibrator/Tester.cpp
+++ b/src/calibrator/Tester.cpp
@@ -30,7 +30,7 @@ CalibratorTester::CalibratorTester(const char* const device_name0, const XYinfo&
3030 //printf("Starting test driver\n");
3131 }
3232
33-bool CalibratorTester::finish_data(const XYinfo axis)
33+bool CalibratorTester::finish_data(const XYinfo &axis)
3434 {
3535 new_axis = axis;
3636
--- a/src/calibrator/Tester.hpp
+++ b/src/calibrator/Tester.hpp
@@ -40,7 +40,7 @@ public:
4040 const int thr_misclick=0, const int thr_doubleclick=0,
4141 const OutputType output_type=OUTYPE_AUTO, const char* geometry=0);
4242
43- virtual bool finish_data(const XYinfo new_axis);
43+ virtual bool finish_data(const XYinfo &new_axis);
4444
4545 // emulate the driver processing the coordinates in 'raw'
4646 virtual XYinfo emulate_driver(const XYinfo& raw,
--- a/src/calibrator/Usbtouchscreen.cpp
+++ b/src/calibrator/Usbtouchscreen.cpp
@@ -77,7 +77,7 @@ CalibratorUsbtouchscreen::~CalibratorUsbtouchscreen()
7777 write_bool_parameter (p_swap_xy, val_swap_xy);
7878 }
7979
80-bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys)
80+bool CalibratorUsbtouchscreen::finish_data(const XYinfo &new_axys)
8181 {
8282 if (output_type != OUTYPE_AUTO) {
8383 fprintf(stderr, "ERROR: Usbtouchscreen Calibrator does not support the supplied --output-type\n");
--- a/src/calibrator/Usbtouchscreen.hpp
+++ b/src/calibrator/Usbtouchscreen.hpp
@@ -38,7 +38,7 @@ public:
3838 const bool use_timeout=false, const char* output_filename = 0);
3939 virtual ~CalibratorUsbtouchscreen();
4040
41- virtual bool finish_data(const XYinfo new_axys);
41+ virtual bool finish_data(const XYinfo &new_axys);
4242
4343 protected:
4444 // Globals for kernel parameters from startup.
--- a/src/calibrator/XorgPrint.cpp
+++ b/src/calibrator/XorgPrint.cpp
@@ -33,7 +33,7 @@ CalibratorXorgPrint::CalibratorXorgPrint(const char* const device_name0, const X
3333 printf("\tIf these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL).\n");
3434 }
3535
36-bool CalibratorXorgPrint::finish_data(const XYinfo new_axys)
36+bool CalibratorXorgPrint::finish_data(const XYinfo &new_axys)
3737 {
3838 bool success = true;
3939
--- a/src/calibrator/XorgPrint.hpp
+++ b/src/calibrator/XorgPrint.hpp
@@ -37,7 +37,7 @@ public:
3737 const OutputType output_type=OUTYPE_AUTO, const char* geometry=0,
3838 const bool use_timeout=false, const char* output_filename = 0);
3939
40- virtual bool finish_data(const XYinfo new_axys);
40+ virtual bool finish_data(const XYinfo &new_axys);
4141
4242 protected:
4343 bool output_xorgconfd(const XYinfo new_axys);
--- a/src/gui/gtkmm.hpp
+++ b/src/gui/gtkmm.hpp
@@ -36,7 +36,7 @@ class CalibrationArea : public Gtk::DrawingArea
3636 public:
3737 CalibrationArea(Calibrator* w);
3838
39-protected:
39+private:
4040 // Data
4141 Calibrator* calibrator;
4242 double X[4], Y[4];
--- a/src/gui/x11.cpp
+++ b/src/gui/x11.cpp
@@ -270,14 +270,12 @@ void GuiCalibratorX11::redraw()
270270 }
271271 }
272272
273-bool GuiCalibratorX11::on_expose_event()
273+void GuiCalibratorX11::on_expose_event()
274274 {
275275 redraw();
276-
277- return true;
278276 }
279277
280-bool GuiCalibratorX11::on_timer_signal()
278+void GuiCalibratorX11::on_timer_signal()
281279 {
282280 // Update clock
283281 if(calibrator->get_use_timeout()) {
@@ -295,11 +293,9 @@ bool GuiCalibratorX11::on_timer_signal()
295293 clock_radius-clock_line_width, clock_radius-clock_line_width,
296294 90*64, ((double)time_elapsed/(double)max_time) * -360 * 64);
297295 }
298-
299- return true;
300296 }
301297
302-bool GuiCalibratorX11::on_button_press_event(XEvent event)
298+void GuiCalibratorX11::on_button_press_event(XEvent event)
303299 {
304300 // Clear window, maybe a bit overdone, but easiest for me atm.
305301 // (goal is to clear possible message and other clicks)
@@ -329,8 +325,6 @@ bool GuiCalibratorX11::on_button_press_event(XEvent event)
329325
330326 // Force a redraw
331327 redraw();
332-
333- return true;
334328 }
335329
336330 void GuiCalibratorX11::draw_message(const char* msg)
--- a/src/gui/x11.hpp
+++ b/src/gui/x11.hpp
@@ -35,7 +35,7 @@ public:
3535 static void make_instance(Calibrator* w);
3636 static void give_timer_signal();
3737
38-protected:
38+private:
3939 GuiCalibratorX11(Calibrator* w);
4040 ~GuiCalibratorX11();
4141
@@ -63,16 +63,15 @@ protected:
6363 unsigned long pixel[NUM_COLORS];
6464
6565 // Signal handlers
66- bool on_timer_signal();
67- bool on_expose_event();
68- bool on_button_press_event(XEvent event);
66+ void on_timer_signal();
67+ void on_expose_event();
68+ void on_button_press_event(XEvent event);
6969
7070 // Helper functions
7171 void set_display_size(int width, int height);
7272 void redraw();
7373 void draw_message(const char* msg);
7474
75-private:
7675 static GuiCalibratorX11* instance;
7776 };
7877
--- a/src/tester.cpp
+++ b/src/tester.cpp
@@ -117,4 +117,6 @@ int main() {
117117
118118 printf("\n");
119119 } // loop over calibrators
120+
121+ delete calib;
120122 }