2
// Copyright (C) 2010, 2011 Free Software Foundation, Inc
2
// Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc
4
4
// This program is free software; you can redistribute it and/or modify
5
5
// it under the terms of the GNU General Public License as published by
80
80
if (!filespec.empty()) {
81
81
devname = const_cast<char *>(_filespec.c_str());
83
log_error("No filespec specified for the touchscreen device.");
83
log_error(_("No filespec specified for the touchscreen device."));
87
87
_tsDev = ts_open(devname, 1); //Open tslib non-blocking
89
log_error("Could not open touchscreen %s: %s", devname, strerror(errno));
89
log_error(_("Could not open touchscreen %s: %s"), devname,
94
95
if (ts_fd(_tsDev) < 0) {
95
log_error("Could not get touchscreen fd %s: %s", devname, strerror(errno));
96
log_error(_("Could not get touchscreen fd %s: %s"), devname,
99
101
_fd = ts_fd(_tsDev);
101
log_debug("Using TSLIB on %s", devname);
103
log_debug(_("Using TSLIB on %s"), devname);
123
125
if (event.pressure > 0) {
124
126
// the screen is touched
127
// FIXME: this is a bit of a temporary hack. The last two
128
// arguments are a range, so hardcoding them is safe for
129
// now. In the future more conversion may be done, making this
130
// then be incorrect.
125
131
boost::shared_array<int> coords =
126
MouseDevice::convertCoordinates(event.x, event.y, 800, 480);
127
log_debug("Touched x: %d, y: %d", event.x , event.y);
132
InputDevice::convertAbsCoords(event.x, event.y,
133
_screen_width, _screen_height);
134
log_debug(_("Touched x: %d, y: %d"), event.x , event.y);
128
135
addData(true, gnash::key::INVALID, 0, event.x, event.y);
130
137
addData(false, gnash::key::INVALID, 0, event.x, event.y);
131
log_debug("lifted x: %d y: %d", event.x, event.y); //debug
138
log_debug(_("lifted x: %d y: %d"), event.x, event.y); //debug
138
// FIXME: this currently is lacking thw swf program used to generate the
145
// FIXME: this currently is lacking the swf program used to generate the
139
146
// input data. Instead use the tslib utility 'ts_calibrate', as Gnash now
140
147
// has TSlib support.
299
306
while (touch[i].type != InputDevice::UNKNOWN) {
301
// log_debug("Checking for device %s...", touch[i].filespec);
308
// log_debug(_("Checking for device %s..."), touch[i].filespec);
302
309
if (stat(touch[i].filespec, &st) == 0) {
303
310
// Then see if we can open it
304
311
if ((fd = open(touch[i].filespec, O_RDWR)) < 0) {
305
log_error("You don't have the proper permissions to open %s",
312
log_error(_("You don't have the proper permissions to open %s"),
306
313
touch[i].filespec);