~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libdevice/events/TouchDevice.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// 
2
 
//   Copyright (C) 2010, 2011 Free Software Foundation, Inc
 
2
//   Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc
3
3
// 
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());
82
82
        } else {
83
 
            log_error("No filespec specified for the touchscreen device.");
 
83
            log_error(_("No filespec specified for the touchscreen device."));
84
84
        }
85
85
    }
86
86
    
87
87
    _tsDev = ts_open(devname, 1);  //Open tslib non-blocking
88
88
    if (_tsDev == 0) {
89
 
        log_error("Could not open touchscreen %s: %s", devname, strerror(errno));
 
89
        log_error(_("Could not open touchscreen %s: %s"), devname,
 
90
                  strerror(errno));
90
91
        return false;
91
92
    }
92
93
    
93
94
    ts_config(_tsDev); 
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,
 
97
                  strerror(errno));
96
98
        return false;
97
99
    }
98
100
    
99
101
    _fd = ts_fd(_tsDev);
100
102
    
101
 
    log_debug("Using TSLIB on %s", devname);
 
103
    log_debug(_("Using TSLIB on %s"), devname);
102
104
    
103
105
    return true;
104
106
}
122
124
    if (n == 1) {
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);
129
136
        } else {
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
132
139
        }
133
140
    }
134
141
 
135
142
    return true;
136
143
}
137
144
 
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.
141
148
void
298
305
    int i = 0;
299
306
    while (touch[i].type != InputDevice::UNKNOWN) {
300
307
        int fd = 0;
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);
307
314
                i++;
308
315
                continue;