[gnome-control-center] wacom: s/axys/axis/
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wacom: s/axys/axis/
- Date: Tue, 10 Jan 2012 19:25:38 +0000 (UTC)
commit 7b82472645f7f9aa46b66f034413f39deb391c99
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jan 10 19:19:24 2012 +0000
wacom: s/axys/axis/
panels/wacom/calibrator/calibrator.c | 36 ++++++++--------
panels/wacom/calibrator/calibrator.h | 6 +-
panels/wacom/calibrator/gui_gtk.c | 20 ++++----
panels/wacom/calibrator/gui_gtk.h | 2 +-
panels/wacom/calibrator/main.c | 80 +++++++++++++++++-----------------
panels/wacom/calibrator/main.h | 6 +-
panels/wacom/cc-wacom-page.c | 20 ++++----
7 files changed, 85 insertions(+), 85 deletions(-)
---
diff --git a/panels/wacom/calibrator/calibrator.c b/panels/wacom/calibrator/calibrator.c
index 2d9f73f..45fdf3c 100644
--- a/panels/wacom/calibrator/calibrator.c
+++ b/panels/wacom/calibrator/calibrator.c
@@ -122,7 +122,7 @@ gboolean
finish (struct Calib *c,
int width,
int height,
- XYinfo *new_axys,
+ XYinfo *new_axis,
gboolean *swap)
{
gboolean swap_xy;
@@ -130,7 +130,7 @@ finish (struct Calib *c,
float scale_y;
int delta_x;
int delta_y;
- XYinfo axys = {-1, -1, -1, -1};
+ XYinfo axis = {-1, -1, -1, -1};
if (c->num_clicks != 4)
return FALSE;
@@ -144,32 +144,32 @@ finish (struct Calib *c,
}
/* Compute min/max coordinates. */
- /* These are scaled using the values of old_axys */
- scale_x = (c->old_axys.x_max - c->old_axys.x_min)/(float)width;
- axys.x_min = ((c->clicked_x[UL] + c->clicked_x[LL]) * scale_x/2) + c->old_axys.x_min;
- axys.x_max = ((c->clicked_x[UR] + c->clicked_x[LR]) * scale_x/2) + c->old_axys.x_min;
- scale_y = (c->old_axys.y_max - c->old_axys.y_min)/(float)height;
- axys.y_min = ((c->clicked_y[UL] + c->clicked_y[UR]) * scale_y/2) + c->old_axys.y_min;
- axys.y_max = ((c->clicked_y[LL] + c->clicked_y[LR]) * scale_y/2) + c->old_axys.y_min;
+ /* These are scaled using the values of old_axis */
+ scale_x = (c->old_axis.x_max - c->old_axis.x_min)/(float)width;
+ axis.x_min = ((c->clicked_x[UL] + c->clicked_x[LL]) * scale_x/2) + c->old_axis.x_min;
+ axis.x_max = ((c->clicked_x[UR] + c->clicked_x[LR]) * scale_x/2) + c->old_axis.x_min;
+ scale_y = (c->old_axis.y_max - c->old_axis.y_min)/(float)height;
+ axis.y_min = ((c->clicked_y[UL] + c->clicked_y[UR]) * scale_y/2) + c->old_axis.y_min;
+ axis.y_max = ((c->clicked_y[LL] + c->clicked_y[LR]) * scale_y/2) + c->old_axis.y_min;
/* Add/subtract the offset that comes from not having the points in the
* corners (using the same coordinate system they are currently in)
*/
- delta_x = (axys.x_max - axys.x_min) / (float)(NUM_BLOCKS - 2);
- axys.x_min -= delta_x;
- axys.x_max += delta_x;
- delta_y = (axys.y_max - axys.y_min) / (float)(NUM_BLOCKS - 2);
- axys.y_min -= delta_y;
- axys.y_max += delta_y;
+ delta_x = (axis.x_max - axis.x_min) / (float)(NUM_BLOCKS - 2);
+ axis.x_min -= delta_x;
+ axis.x_max += delta_x;
+ delta_y = (axis.y_max - axis.y_min) / (float)(NUM_BLOCKS - 2);
+ axis.y_min -= delta_y;
+ axis.y_max += delta_y;
/* If x and y has to be swapped we also have to swap the parameters */
if (swap_xy)
{
- SWAP(axys.x_min, axys.y_max);
- SWAP(axys.y_min, axys.x_max);
+ SWAP(axis.x_min, axis.y_max);
+ SWAP(axis.y_min, axis.x_max);
}
- *new_axys = axys;
+ *new_axis = axis;
*swap = swap_xy;
return TRUE;
diff --git a/panels/wacom/calibrator/calibrator.h b/panels/wacom/calibrator/calibrator.h
index 4924547..4241366 100644
--- a/panels/wacom/calibrator/calibrator.h
+++ b/panels/wacom/calibrator/calibrator.h
@@ -74,8 +74,8 @@ typedef struct
struct Calib
{
- /* original axys values */
- XYinfo old_axys;
+ /* original axis values */
+ XYinfo old_axis;
/* nr of clicks registered */
int num_clicks;
@@ -109,7 +109,7 @@ gboolean along_axis (struct Calib *c,
gboolean finish (struct Calib *c,
int width,
int height,
- XYinfo *new_axys,
+ XYinfo *new_axis,
gboolean *swap);
#endif /* _calibrator_h */
diff --git a/panels/wacom/calibrator/gui_gtk.c b/panels/wacom/calibrator/gui_gtk.c
index 79662f2..4e28bca 100644
--- a/panels/wacom/calibrator/gui_gtk.c
+++ b/panels/wacom/calibrator/gui_gtk.c
@@ -358,17 +358,17 @@ CalibrationArea_(struct Calib *c)
*/
gboolean
run_gui(struct Calib *c,
- XYinfo *new_axys,
+ XYinfo *new_axis,
gboolean *swap)
{
gboolean success;
struct CalibArea *calib_area = CalibrationArea_(c);
printf("Current calibration: %d, %d, %d, %d\n",
- c->old_axys.x_min,
- c->old_axys.y_min,
- c->old_axys.x_max,
- c->old_axys.y_max);
+ c->old_axis.x_min,
+ c->old_axis.y_min,
+ c->old_axis.x_max,
+ c->old_axis.y_max);
GdkScreen *screen = gdk_screen_get_default();
GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -393,13 +393,13 @@ run_gui(struct Calib *c,
gtk_main();
printf("gtk_main returned!\n");
- success = finish(calib_area->calibrator, calib_area->display_width, calib_area->display_height, new_axys, swap);
+ success = finish(calib_area->calibrator, calib_area->display_width, calib_area->display_height, new_axis, swap);
printf("Final calibration: %d, %d, %d, %d\n",
- new_axys->x_min,
- new_axys->y_min,
- new_axys->x_max,
- new_axys->y_max);
+ new_axis->x_min,
+ new_axis->y_min,
+ new_axis->x_max,
+ new_axis->y_max);
return success;
}
diff --git a/panels/wacom/calibrator/gui_gtk.h b/panels/wacom/calibrator/gui_gtk.h
index 1d0e7b4..bcad1a3 100644
--- a/panels/wacom/calibrator/gui_gtk.h
+++ b/panels/wacom/calibrator/gui_gtk.h
@@ -41,7 +41,7 @@ struct CalibArea
};
gboolean run_gui (struct Calib *c,
- XYinfo *new_axys,
+ XYinfo *new_axis,
gboolean *swap);
#endif /* _gui_gtk_h */
diff --git a/panels/wacom/calibrator/main.c b/panels/wacom/calibrator/main.c
index 69baa99..1420db2 100644
--- a/panels/wacom/calibrator/main.c
+++ b/panels/wacom/calibrator/main.c
@@ -39,7 +39,7 @@
* the data of the device is returned in the last 3 function parameters
*/
int find_device(const char* pre_device, gboolean verbose, gboolean list_devices,
- XID* device_id, const char** device_name, XYinfo* device_axys)
+ XID* device_id, const char** device_name, XYinfo* device_axis)
{
gboolean pre_device_is_id = TRUE;
int found = 0;
@@ -127,10 +127,10 @@ int find_device(const char* pre_device, gboolean verbose, gboolean list_devices,
found++;
*device_id = list->id;
*device_name = g_strdup(list->name);
- device_axys->x_min = ax[0].min_value;
- device_axys->x_max = ax[0].max_value;
- device_axys->y_min = ax[1].min_value;
- device_axys->y_max = ax[1].max_value;
+ device_axis->x_min = ax[0].min_value;
+ device_axis->x_max = ax[0].max_value;
+ device_axis->y_min = ax[1].min_value;
+ device_axis->y_max = ax[1].max_value;
if (list_devices)
printf("Device \"%s\" id=%i\n", *device_name, (int)*device_id);
@@ -173,7 +173,7 @@ struct Calib* main_common(int argc, char** argv)
gboolean list_devices = FALSE;
gboolean fake = FALSE;
gboolean precalib = FALSE;
- XYinfo pre_axys = {-1, -1, -1, -1};
+ XYinfo pre_axis = {-1, -1, -1, -1};
const char* pre_device = NULL;
const char* geometry = NULL;
unsigned thr_misclick = 15;
@@ -217,13 +217,13 @@ struct Calib* main_common(int argc, char** argv)
if (strcmp("--precalib", argv[i]) == 0) {
precalib = TRUE;
if (argc > i+1)
- pre_axys.x_min = atoi(argv[++i]);
+ pre_axis.x_min = atoi(argv[++i]);
if (argc > i+1)
- pre_axys.x_max = atoi(argv[++i]);
+ pre_axis.x_max = atoi(argv[++i]);
if (argc > i+1)
- pre_axys.y_min = atoi(argv[++i]);
+ pre_axis.y_min = atoi(argv[++i]);
if (argc > i+1)
- pre_axys.y_max = atoi(argv[++i]);
+ pre_axis.y_max = atoi(argv[++i]);
} else
/* Get mis-click threshold ? */
@@ -261,21 +261,21 @@ struct Calib* main_common(int argc, char** argv)
/* Choose the device to calibrate */
XID device_id = (XID) -1;
const char* device_name = NULL;
- XYinfo device_axys = {-1, -1, -1, -1};
+ XYinfo device_axis = {-1, -1, -1, -1};
if (fake) {
/* Fake a calibratable device */
device_name = "Fake_device";
- device_axys.x_min=0;
- device_axys.x_max=1000;
- device_axys.y_min=0;
- device_axys.y_max=1000;
+ device_axis.x_min=0;
+ device_axis.x_max=1000;
+ device_axis.y_min=0;
+ device_axis.y_max=1000;
if (verbose) {
printf("DEBUG: Faking device: %s\n", device_name);
}
} else {
/* Find the right device */
- int nr_found = find_device(pre_device, verbose, list_devices, &device_id, &device_name, &device_axys);
+ int nr_found = find_device(pre_device, verbose, list_devices, &device_id, &device_name, &device_axis);
if (list_devices) {
/* printed the list in find_device */
@@ -302,44 +302,44 @@ struct Calib* main_common(int argc, char** argv)
/* override min/max XY from command line ? */
if (precalib) {
- if (pre_axys.x_min != -1)
- device_axys.x_min = pre_axys.x_min;
- if (pre_axys.x_max != -1)
- device_axys.x_max = pre_axys.x_max;
- if (pre_axys.y_min != -1)
- device_axys.y_min = pre_axys.y_min;
- if (pre_axys.y_max != -1)
- device_axys.y_max = pre_axys.y_max;
+ if (pre_axis.x_min != -1)
+ device_axis.x_min = pre_axis.x_min;
+ if (pre_axis.x_max != -1)
+ device_axis.x_max = pre_axis.x_max;
+ if (pre_axis.y_min != -1)
+ device_axis.y_min = pre_axis.y_min;
+ if (pre_axis.y_max != -1)
+ device_axis.y_max = pre_axis.y_max;
if (verbose) {
printf("DEBUG: Setting precalibration: %i, %i, %i, %i\n",
- device_axys.x_min, device_axys.x_max,
- device_axys.y_min, device_axys.y_max);
+ device_axis.x_min, device_axis.x_max,
+ device_axis.y_min, device_axis.y_max);
}
}
/* lastly, presume a standard Xorg driver (evtouch, mutouch, ...) */
- return CalibratorXorgPrint(device_name, &device_axys,
+ return CalibratorXorgPrint(device_name, &device_axis,
verbose, thr_misclick, thr_doubleclick, geometry);
}
-struct Calib* CalibratorXorgPrint(const char* const device_name0, const XYinfo *axys0, const gboolean verbose0, const int thr_misclick, const int thr_doubleclick, const char* geometry)
+struct Calib* CalibratorXorgPrint(const char* const device_name0, const XYinfo *axis0, const gboolean verbose0, const int thr_misclick, const int thr_doubleclick, const char* geometry)
{
struct Calib* c = (struct Calib*)calloc(1, sizeof(struct Calib));
- c->old_axys = *axys0;
+ c->old_axis = *axis0;
c->threshold_misclick = thr_misclick;
c->threshold_doubleclick = thr_doubleclick;
c->geometry = geometry;
printf("Calibrating standard Xorg driver \"%s\"\n", device_name0);
printf("\tcurrent calibration values: min_x=%d, max_x=%d and min_y=%d, max_y=%d\n",
- c->old_axys.x_min, c->old_axys.x_max, c->old_axys.y_min, c->old_axys.y_max);
+ c->old_axis.x_min, c->old_axis.x_max, c->old_axis.y_min, c->old_axis.y_max);
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");
return c;
}
-gboolean finish_data(struct Calib* c, const XYinfo new_axys, int swap_xy)
+gboolean finish_data(struct Calib* c, const XYinfo new_axis, int swap_xy)
{
gboolean success = TRUE;
@@ -348,12 +348,12 @@ gboolean finish_data(struct Calib* c, const XYinfo new_axys, int swap_xy)
int new_swap_xy = swap_xy;
printf("\n\n--> Making the calibration permanent <--\n");
- success &= output_xorgconfd(c, new_axys, swap_xy, new_swap_xy);
+ success &= output_xorgconfd(c, new_axis, swap_xy, new_swap_xy);
return success;
}
-gboolean output_xorgconfd(struct Calib* c, const XYinfo new_axys, int swap_xy, int new_swap_xy)
+gboolean output_xorgconfd(struct Calib* c, const XYinfo new_axis, int swap_xy, int new_swap_xy)
{
const char* sysfs_name = "!!Name_Of_TouchScreen!!";
@@ -362,10 +362,10 @@ gboolean output_xorgconfd(struct Calib* c, const XYinfo new_axys, int swap_xy, i
printf("Section \"InputClass\"\n");
printf(" Identifier \"calibration\"\n");
printf(" MatchProduct \"%s\"\n", sysfs_name);
- printf(" Option \"MinX\" \"%d\"\n", new_axys.x_min);
- printf(" Option \"MaxX\" \"%d\"\n", new_axys.x_max);
- printf(" Option \"MinY\" \"%d\"\n", new_axys.y_min);
- printf(" Option \"MaxY\" \"%d\"\n", new_axys.y_max);
+ printf(" Option \"MinX\" \"%d\"\n", new_axis.x_min);
+ printf(" Option \"MaxX\" \"%d\"\n", new_axis.x_max);
+ printf(" Option \"MinY\" \"%d\"\n", new_axis.y_min);
+ printf(" Option \"MaxY\" \"%d\"\n", new_axis.y_max);
if (swap_xy != 0)
printf(" Option \"SwapXY\" \"%d\" # unless it was already set to 1\n", new_swap_xy);
printf("EndSection\n");
@@ -376,7 +376,7 @@ gboolean output_xorgconfd(struct Calib* c, const XYinfo new_axys, int swap_xy, i
int main(int argc, char** argv)
{
int success = 0;
- XYinfo axys;
+ XYinfo axis;
gboolean swap_xy;
struct Calib* calibrator = main_common(argc, argv);
@@ -384,9 +384,9 @@ int main(int argc, char** argv)
/* GTK setup */
gtk_init(&argc, &argv);
- success = run_gui(calibrator, &axys, &swap_xy);
+ success = run_gui(calibrator, &axis, &swap_xy);
if (success)
- success = finish_data(calibrator, axys, swap_xy);
+ success = finish_data(calibrator, axis, swap_xy);
if (!success) {
/* TODO, in GUI ? */
diff --git a/panels/wacom/calibrator/main.h b/panels/wacom/calibrator/main.h
index 805d863..8dc60d3 100644
--- a/panels/wacom/calibrator/main.h
+++ b/panels/wacom/calibrator/main.h
@@ -33,12 +33,12 @@ static void usage(char* cmd, unsigned thr_misclick);
struct Calib* main_common(int argc, char** argv);
-struct Calib* CalibratorXorgPrint(const char* const device_name, const XYinfo *axys,
+struct Calib* CalibratorXorgPrint(const char* const device_name, const XYinfo *axis,
const gboolean verbose, const int thr_misclick, const int thr_doubleclick,
const char* geometry);
-gboolean finish_data(struct Calib*, const XYinfo new_axys, int swap_xy);
-gboolean output_xorgconfd(struct Calib*, const XYinfo new_axys, int swap_xy, int new_swap_xy);
+gboolean finish_data(struct Calib*, const XYinfo new_axis, int swap_xy);
+gboolean output_xorgconfd(struct Calib*, const XYinfo new_axis, int swap_xy, int new_swap_xy);
int main(int argc, char** argv);
diff --git a/panels/wacom/cc-wacom-page.c b/panels/wacom/cc-wacom-page.c
index dbda6ea..82dcead 100644
--- a/panels/wacom/cc-wacom-page.c
+++ b/panels/wacom/cc-wacom-page.c
@@ -159,7 +159,7 @@ run_calibration (gint *cal,
gsize ncal)
{
gboolean success = FALSE;
- XYinfo axys;
+ XYinfo axis;
gboolean swap_xy;
struct Calib calibrator;
@@ -172,25 +172,25 @@ run_calibration (gint *cal,
calibrator.threshold_misclick = 15;
calibrator.threshold_doubleclick = 7;
calibrator.geometry = NULL;
- calibrator.old_axys.x_min = cal[0];
- calibrator.old_axys.y_min = cal[1];
- calibrator.old_axys.x_max = cal[2];
- calibrator.old_axys.y_max = cal[3];
+ calibrator.old_axis.x_min = cal[0];
+ calibrator.old_axis.y_min = cal[1];
+ calibrator.old_axis.x_max = cal[2];
+ calibrator.old_axis.y_max = cal[3];
/* !!NOTE!! This call blocks on the calibration
* !!NOTE!! process. It will be several seconds
* !!NOTE!! before this returns.
*/
- if(run_gui(&calibrator, &axys, &swap_xy))
+ if(run_gui(&calibrator, &axis, &swap_xy))
success = TRUE;
quit_calibration:
if (success)
{
- cal[0] = axys.x_min;
- cal[1] = axys.y_min;
- cal[2] = axys.x_max;
- cal[3] = axys.y_max;
+ cal[0] = axis.x_min;
+ cal[1] = axis.y_min;
+ cal[2] = axis.x_max;
+ cal[3] = axis.y_max;
}
return success;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]