summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-29 08:18:12 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-06-29 08:18:12 +0000
commitcda0901ae0edf5f15c745a86b2f9da40ad5f801e (patch)
treeb662ef899fa5463d6586e291d14b448e565fcd3c /legacy
parentcbfb6d03a8f9a6f655a6f9b5900487dcd513e8b4 (diff)
patch from christophe.dumez@intel.com for joystick support
ticket #1100 SVN revision: 73027
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eeze/AUTHORS1
-rw-r--r--legacy/eeze/ChangeLog4
-rw-r--r--legacy/eeze/NEWS9
-rw-r--r--legacy/eeze/src/lib/Eeze.h15
-rw-r--r--legacy/eeze/src/lib/eeze_udev_find.c7
-rw-r--r--legacy/eeze/src/lib/eeze_udev_syspath.c28
-rw-r--r--legacy/eeze/src/lib/eeze_udev_watch.c25
7 files changed, 81 insertions, 8 deletions
diff --git a/legacy/eeze/AUTHORS b/legacy/eeze/AUTHORS
index 5307e338ae..96a45af0b3 100644
--- a/legacy/eeze/AUTHORS
+++ b/legacy/eeze/AUTHORS
@@ -1,3 +1,4 @@
1Mike Blumenkrantz (zmike/discomfitor) <michael.blumenkrantz@gmail.com> 1Mike Blumenkrantz (zmike/discomfitor) <michael.blumenkrantz@gmail.com>
2Cedric Bail <cedric@efl.so> 2Cedric Bail <cedric@efl.so>
3Mikael Sans <sans.mikael@gmail.com> 3Mikael Sans <sans.mikael@gmail.com>
4Christophe Dumez <christophe.dumez@intel.com>
diff --git a/legacy/eeze/ChangeLog b/legacy/eeze/ChangeLog
index 9a2be58d92..311cfa989a 100644
--- a/legacy/eeze/ChangeLog
+++ b/legacy/eeze/ChangeLog
@@ -96,3 +96,7 @@
962012-06-29 Mike Blumenkrantz 962012-06-29 Mike Blumenkrantz
97 97
98 * Fix crash in eeze_net_free() 98 * Fix crash in eeze_net_free()
99
1002012-06-29 Christophe Dumez (christophe.dumez@intel.com)
101
102 * Added joystick detection
diff --git a/legacy/eeze/NEWS b/legacy/eeze/NEWS
index 6e738904de..23d7195335 100644
--- a/legacy/eeze/NEWS
+++ b/legacy/eeze/NEWS
@@ -1,4 +1,11 @@
1Eeze 1.2.0 1Eeze 1.3.0
2
3Changes since Eeze 1.1.0:
4-------------------------
5
6Additions:
7
8 * Joystick support
2 9
3Changes since Eeze 1.1.0: 10Changes since Eeze 1.1.0:
4------------------------- 11-------------------------
diff --git a/legacy/eeze/src/lib/Eeze.h b/legacy/eeze/src/lib/Eeze.h
index dd9b8ba09e..e816655133 100644
--- a/legacy/eeze/src/lib/Eeze.h
+++ b/legacy/eeze/src/lib/Eeze.h
@@ -216,7 +216,11 @@ typedef enum
216 /** - WebCam */ 216 /** - WebCam */
217 EEZE_UDEV_TYPE_V4L, 217 EEZE_UDEV_TYPE_V4L,
218 /** - Bluetooth */ 218 /** - Bluetooth */
219 EEZE_UDEV_TYPE_BLUETOOTH 219 EEZE_UDEV_TYPE_BLUETOOTH,
220 /** - Joystick
221 * @since 1.3
222 */
223 EEZE_UDEV_TYPE_JOYSTICK
220} Eeze_Udev_Type; 224} Eeze_Udev_Type;
221/**@}*/ 225/**@}*/
222 226
@@ -456,6 +460,15 @@ EAPI Eina_Bool eeze_udev_syspath_is_kbd(const char *syspath);
456 * @return If true, the device is a touchpad 460 * @return If true, the device is a touchpad
457 */ 461 */
458EAPI Eina_Bool eeze_udev_syspath_is_touchpad(const char *syspath); 462EAPI Eina_Bool eeze_udev_syspath_is_touchpad(const char *syspath);
463
464/**
465 * Checks whether the device is a joystick.
466 *
467 * @param syspath The /sys/ path with or without the /sys/
468 * @return If true, the device is a joystick
469 * @since 1.3
470 */
471EAPI Eina_Bool eeze_udev_syspath_is_joystick(const char *syspath);
459 /** 472 /**
460 * @} 473 * @}
461 */ 474 */
diff --git a/legacy/eeze/src/lib/eeze_udev_find.c b/legacy/eeze/src/lib/eeze_udev_find.c
index bdd1037b4c..3bd06ab5cf 100644
--- a/legacy/eeze/src/lib/eeze_udev_find.c
+++ b/legacy/eeze/src/lib/eeze_udev_find.c
@@ -188,6 +188,13 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
188#endif 188#endif
189 break; 189 break;
190 190
191 case EEZE_UDEV_TYPE_JOYSTICK:
192 udev_enumerate_add_match_subsystem(en, "input");
193#ifndef OLD_UDEV_RRRRRRRRRRRRRR
194 udev_enumerate_add_match_property(en, "ID_INPUT_JOYSTICK", "1");
195#endif
196 break;
197
191 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE: 198 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
192 udev_enumerate_add_match_subsystem(en, "block"); 199 udev_enumerate_add_match_subsystem(en, "block");
193 udev_enumerate_add_match_property(en, "ID_FS_USAGE", "filesystem"); 200 udev_enumerate_add_match_property(en, "ID_FS_USAGE", "filesystem");
diff --git a/legacy/eeze/src/lib/eeze_udev_syspath.c b/legacy/eeze/src/lib/eeze_udev_syspath.c
index 55ba8438dc..df858e6c1e 100644
--- a/legacy/eeze/src/lib/eeze_udev_syspath.c
+++ b/legacy/eeze/src/lib/eeze_udev_syspath.c
@@ -236,6 +236,34 @@ eeze_udev_syspath_is_touchpad(const char *syspath)
236 return touchpad; 236 return touchpad;
237} 237}
238 238
239EAPI Eina_Bool
240eeze_udev_syspath_is_joystick(const char *syspath)
241{
242 _udev_device *device = NULL;
243 Eina_Bool joystick = EINA_FALSE;
244 const char *test;
245
246 if (!syspath)
247 return EINA_FALSE;
248
249 if (!(device = _new_device(syspath)))
250 return EINA_FALSE;
251#ifdef OLD_UDEV_RRRRRRRRRRRRRR
252 test = udev_device_get_property_value(device, "ID_CLASS");
253
254 if ((test) && (!strcmp(test, "joystick")))
255 joystick = EINA_TRUE;
256#else
257 test = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK");
258
259 if (test && (test[0] == '1'))
260 joystick = EINA_TRUE;
261
262#endif
263 udev_device_unref(device);
264 return joystick;
265}
266
239EAPI const char * 267EAPI const char *
240eeze_udev_devpath_get_syspath(const char *devpath) 268eeze_udev_devpath_get_syspath(const char *devpath)
241{ 269{
diff --git a/legacy/eeze/src/lib/eeze_udev_watch.c b/legacy/eeze/src/lib/eeze_udev_watch.c
index 5c23421d2e..b89e2d6dbe 100644
--- a/legacy/eeze/src/lib/eeze_udev_watch.c
+++ b/legacy/eeze/src/lib/eeze_udev_watch.c
@@ -166,6 +166,24 @@ _get_syspath_from_watch(void *data,
166 166
167 break; 167 break;
168 168
169 case EEZE_UDEV_TYPE_JOYSTICK:
170#ifdef OLD_UDEV_RRRRRRRRRRRRRR
171 if ((!(test = udev_device_get_subsystem(device)))
172 || (strcmp(test, "input")))
173 goto error;
174
175 test = udev_device_get_property_value(device, "ID_CLASS");
176
177 if ((test) && (!strcmp(test, "joystick")))
178 break;
179
180 goto error;
181#endif
182 if (!udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"))
183 goto error;
184
185 break;
186
169 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE: 187 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
170#ifdef OLD_UDEV_RRRRRRRRRRRRRR 188#ifdef OLD_UDEV_RRRRRRRRRRRRRR
171 if ((!(test = udev_device_get_subsystem(device))) 189 if ((!(test = udev_device_get_subsystem(device)))
@@ -319,14 +337,9 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
319 337
320 switch (type) 338 switch (type)
321 { 339 {
340 case EEZE_UDEV_TYPE_JOYSTICK:
322 case EEZE_UDEV_TYPE_KEYBOARD: 341 case EEZE_UDEV_TYPE_KEYBOARD:
323 udev_monitor_filter_add_match_subsystem_devtype(mon, "input", NULL);
324 break;
325
326 case EEZE_UDEV_TYPE_MOUSE: 342 case EEZE_UDEV_TYPE_MOUSE:
327 udev_monitor_filter_add_match_subsystem_devtype(mon, "input", NULL);
328 break;
329
330 case EEZE_UDEV_TYPE_TOUCHPAD: 343 case EEZE_UDEV_TYPE_TOUCHPAD:
331 udev_monitor_filter_add_match_subsystem_devtype(mon, "input", NULL); 344 udev_monitor_filter_add_match_subsystem_devtype(mon, "input", NULL);
332 break; 345 break;