Skip to content

Commit

Permalink
Merge pull request #58 from austriancoder/master
Browse files Browse the repository at this point in the history
Some small fixes
  • Loading branch information
tias committed Feb 13, 2014
2 parents c8ba270 + 602a04e commit 76ab69c
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/calibrator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected:
bool along_axis(int xy, int x0, int y0);

/// Apply new calibration, implementation dependent
virtual bool finish_data(const XYinfo new_axys) =0;
virtual bool finish_data(const XYinfo &new_axys) =0;

/// Check whether the given name is a sysfs device name
bool is_sysfs_name(const char* name);
Expand Down
6 changes: 3 additions & 3 deletions src/calibrator/Evdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ bool CalibratorEvdev::finish(int width, int height)
}

// Activate calibrated data and output it
bool CalibratorEvdev::finish_data(const XYinfo new_axys)
bool CalibratorEvdev::finish_data(const XYinfo &new_axys)
{
bool success = true;

Expand Down Expand Up @@ -336,7 +336,7 @@ bool CalibratorEvdev::set_invert_xy(const int invert_x, const int invert_y)
arr_cmd[0] = invert_x;
arr_cmd[1] = invert_y;

int ret = xinput_do_set_int_prop("Evdev Axis Inversion", display, 8, 2, arr_cmd);
bool ret = xinput_do_set_int_prop("Evdev Axis Inversion", display, 8, 2, arr_cmd);

if (verbose) {
if (ret == true)
Expand All @@ -359,7 +359,7 @@ bool CalibratorEvdev::set_calibration(const XYinfo new_axys)
arr_cmd[2] = new_axys.y.min;
arr_cmd[3] = new_axys.y.max;

int ret = xinput_do_set_int_prop("Evdev Axis Calibration", display, 32, 4, arr_cmd);
bool ret = xinput_do_set_int_prop("Evdev Axis Calibration", display, 32, 4, arr_cmd);

if (verbose) {
if (ret == true)
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/Evdev.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CalibratorEvdev: public Calibrator

/// calculate and apply the calibration
virtual bool finish(int width, int height);
virtual bool finish_data(const XYinfo new_axys);
virtual bool finish_data(const XYinfo &new_axys);

bool set_swapxy(const int swap_xy);
bool set_invert_xy(const int invert_x, const int invert_y);
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/EvdevTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CalibratorEvdevTester::CalibratorEvdevTester(const char* const device_name0, con
//printf("Starting test driver\n");
}

bool CalibratorEvdevTester::finish_data(const XYinfo axis)
bool CalibratorEvdevTester::finish_data(const XYinfo &axis)
{
new_axis = axis;

Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/EvdevTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CalibratorEvdevTester: public CalibratorTesterInterface, public Calibrator
const int thr_misclick=0, const int thr_doubleclick=0,
const OutputType output_type=OUTYPE_AUTO, const char* geometry=0);

virtual bool finish_data(const XYinfo new_axis);
virtual bool finish_data(const XYinfo &new_axis);

// emulate the driver processing the coordinates in 'raw'
virtual XYinfo emulate_driver(const XYinfo& raw, bool useNewAxis, const XYinfo& screen, const XYinfo& device);
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CalibratorTester::CalibratorTester(const char* const device_name0, const XYinfo&
//printf("Starting test driver\n");
}

bool CalibratorTester::finish_data(const XYinfo axis)
bool CalibratorTester::finish_data(const XYinfo &axis)
{
new_axis = axis;

Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/Tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CalibratorTester: public CalibratorTesterInterface, public Calibrator
const int thr_misclick=0, const int thr_doubleclick=0,
const OutputType output_type=OUTYPE_AUTO, const char* geometry=0);

virtual bool finish_data(const XYinfo new_axis);
virtual bool finish_data(const XYinfo &new_axis);

// emulate the driver processing the coordinates in 'raw'
virtual XYinfo emulate_driver(const XYinfo& raw,
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/Usbtouchscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CalibratorUsbtouchscreen::~CalibratorUsbtouchscreen()
write_bool_parameter (p_swap_xy, val_swap_xy);
}

bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys)
bool CalibratorUsbtouchscreen::finish_data(const XYinfo &new_axys)
{
if (output_type != OUTYPE_AUTO) {
fprintf(stderr, "ERROR: Usbtouchscreen Calibrator does not support the supplied --output-type\n");
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/Usbtouchscreen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CalibratorUsbtouchscreen: public Calibrator
const bool use_timeout=false, const char* output_filename = 0);
virtual ~CalibratorUsbtouchscreen();

virtual bool finish_data(const XYinfo new_axys);
virtual bool finish_data(const XYinfo &new_axys);

protected:
// Globals for kernel parameters from startup.
Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/XorgPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CalibratorXorgPrint::CalibratorXorgPrint(const char* const device_name0, const X
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");
}

bool CalibratorXorgPrint::finish_data(const XYinfo new_axys)
bool CalibratorXorgPrint::finish_data(const XYinfo &new_axys)
{
bool success = true;

Expand Down
2 changes: 1 addition & 1 deletion src/calibrator/XorgPrint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CalibratorXorgPrint: public Calibrator
const OutputType output_type=OUTYPE_AUTO, const char* geometry=0,
const bool use_timeout=false, const char* output_filename = 0);

virtual bool finish_data(const XYinfo new_axys);
virtual bool finish_data(const XYinfo &new_axys);

protected:
bool output_xorgconfd(const XYinfo new_axys);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/gtkmm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CalibrationArea : public Gtk::DrawingArea
public:
CalibrationArea(Calibrator* w);

protected:
private:
// Data
Calibrator* calibrator;
double X[4], Y[4];
Expand Down
12 changes: 3 additions & 9 deletions src/gui/x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,12 @@ void GuiCalibratorX11::redraw()
}
}

bool GuiCalibratorX11::on_expose_event()
void GuiCalibratorX11::on_expose_event()
{
redraw();

return true;
}

bool GuiCalibratorX11::on_timer_signal()
void GuiCalibratorX11::on_timer_signal()
{
// Update clock
if(calibrator->get_use_timeout()) {
Expand All @@ -295,11 +293,9 @@ bool GuiCalibratorX11::on_timer_signal()
clock_radius-clock_line_width, clock_radius-clock_line_width,
90*64, ((double)time_elapsed/(double)max_time) * -360 * 64);
}

return true;
}

bool GuiCalibratorX11::on_button_press_event(XEvent event)
void GuiCalibratorX11::on_button_press_event(XEvent event)
{
// Clear window, maybe a bit overdone, but easiest for me atm.
// (goal is to clear possible message and other clicks)
Expand Down Expand Up @@ -329,8 +325,6 @@ bool GuiCalibratorX11::on_button_press_event(XEvent event)

// Force a redraw
redraw();

return true;
}

void GuiCalibratorX11::draw_message(const char* msg)
Expand Down
9 changes: 4 additions & 5 deletions src/gui/x11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GuiCalibratorX11
static void make_instance(Calibrator* w);
static void give_timer_signal();

protected:
private:
GuiCalibratorX11(Calibrator* w);
~GuiCalibratorX11();

Expand Down Expand Up @@ -63,16 +63,15 @@ class GuiCalibratorX11
unsigned long pixel[NUM_COLORS];

// Signal handlers
bool on_timer_signal();
bool on_expose_event();
bool on_button_press_event(XEvent event);
void on_timer_signal();
void on_expose_event();
void on_button_press_event(XEvent event);

// Helper functions
void set_display_size(int width, int height);
void redraw();
void draw_message(const char* msg);

private:
static GuiCalibratorX11* instance;
};

Expand Down
2 changes: 2 additions & 0 deletions src/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,6 @@ int main() {

printf("\n");
} // loop over calibrators

delete calib;
}

0 comments on commit 76ab69c

Please sign in to comment.