|
Lines 44-58
namespace WebCore {
a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec1
|
| 44 |
|
44 |
|
| 45 |
class GamepadDeviceGtk : public GamepadDeviceLinux { |
45 |
class GamepadDeviceGtk : public GamepadDeviceLinux { |
| 46 |
public: |
46 |
public: |
| 47 |
static PassOwnPtr<GamepadDeviceGtk> create(String deviceFile) |
47 |
explicit GamepadDeviceGtk(String deviceFile); |
| 48 |
{ |
|
|
| 49 |
return adoptPtr(new GamepadDeviceGtk(deviceFile)); |
| 50 |
} |
| 51 |
~GamepadDeviceGtk(); |
48 |
~GamepadDeviceGtk(); |
| 52 |
|
49 |
|
| 53 |
private: |
50 |
private: |
| 54 |
GamepadDeviceGtk(String deviceFile); |
|
|
| 55 |
|
| 56 |
static gboolean readCallback(GObject* pollableStream, gpointer data); |
51 |
static gboolean readCallback(GObject* pollableStream, gpointer data); |
| 57 |
GRefPtr<GInputStream> m_inputStream; |
52 |
GRefPtr<GInputStream> m_inputStream; |
| 58 |
GRefPtr<GSource> m_source; |
53 |
GRefPtr<GSource> m_source; |
|
Lines 98-104
gboolean GamepadDeviceGtk::readCallback(GObject* pollableStream, gpointer data)
a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec2
|
| 98 |
|
93 |
|
| 99 |
class GamepadsGtk { |
94 |
class GamepadsGtk { |
| 100 |
public: |
95 |
public: |
| 101 |
GamepadsGtk(unsigned length); |
96 |
explicit GamepadsGtk(unsigned length); |
| 102 |
|
97 |
|
| 103 |
void registerDevice(String deviceFile); |
98 |
void registerDevice(String deviceFile); |
| 104 |
void unregisterDevice(String deviceFile); |
99 |
void unregisterDevice(String deviceFile); |
|
Lines 145-151
void GamepadsGtk::registerDevice(String deviceFile)
a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec3
|
| 145 |
|
140 |
|
| 146 |
for (unsigned index = 0; index < m_slots.size(); index++) { |
141 |
for (unsigned index = 0; index < m_slots.size(); index++) { |
| 147 |
if (!m_slots[index]) { |
142 |
if (!m_slots[index]) { |
| 148 |
m_slots[index] = GamepadDeviceGtk::create(deviceFile); |
143 |
m_slots[index] = std::make_unique<GamepadDeviceGtk>(deviceFile); |
| 149 |
m_deviceMap.add(deviceFile, m_slots[index].get()); |
144 |
m_deviceMap.add(deviceFile, m_slots[index].get()); |
| 150 |
break; |
145 |
break; |
| 151 |
} |
146 |
} |