summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-03 20:42:37 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-03 20:42:37 +0000
commite4654ee6cf3f0ecb6ac92f04397c18d23cf1fef5 (patch)
treebcbf669e0e55e0fdda9d52c364b5f8a12e70ba49 /src/lib/eeze
parent68188ac0c89407cb35a0f04f86ad44b0deb95bdb (diff)
efl/eeze: remove other traces of old libudev support.
SVN revision: 82101
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_udev_find.c12
-rw-r--r--src/lib/eeze/eeze_udev_syspath.c37
-rw-r--r--src/lib/eeze/eeze_udev_watch.c78
3 files changed, 2 insertions, 125 deletions
diff --git a/src/lib/eeze/eeze_udev_find.c b/src/lib/eeze/eeze_udev_find.c
index 3bd06ab5cf..5682a36faf 100644
--- a/src/lib/eeze/eeze_udev_find.c
+++ b/src/lib/eeze/eeze_udev_find.c
@@ -165,34 +165,22 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
165 165
166 case EEZE_UDEV_TYPE_KEYBOARD: 166 case EEZE_UDEV_TYPE_KEYBOARD:
167 udev_enumerate_add_match_subsystem(en, "input"); 167 udev_enumerate_add_match_subsystem(en, "input");
168#ifndef OLD_UDEV_RRRRRRRRRRRRRR
169 udev_enumerate_add_match_property(en, "ID_INPUT_KEYBOARD", "1"); 168 udev_enumerate_add_match_property(en, "ID_INPUT_KEYBOARD", "1");
170#else
171 udev_enumerate_add_match_property(en, "ID_CLASS", "kbd");
172#endif
173 break; 169 break;
174 170
175 case EEZE_UDEV_TYPE_MOUSE: 171 case EEZE_UDEV_TYPE_MOUSE:
176 udev_enumerate_add_match_subsystem(en, "input"); 172 udev_enumerate_add_match_subsystem(en, "input");
177#ifndef OLD_UDEV_RRRRRRRRRRRRRR
178 udev_enumerate_add_match_property(en, "ID_INPUT_MOUSE", "1"); 173 udev_enumerate_add_match_property(en, "ID_INPUT_MOUSE", "1");
179#else
180 udev_enumerate_add_match_property(en, "ID_CLASS", "mouse");
181#endif
182 break; 174 break;
183 175
184 case EEZE_UDEV_TYPE_TOUCHPAD: 176 case EEZE_UDEV_TYPE_TOUCHPAD:
185 udev_enumerate_add_match_subsystem(en, "input"); 177 udev_enumerate_add_match_subsystem(en, "input");
186#ifndef OLD_UDEV_RRRRRRRRRRRRRR
187 udev_enumerate_add_match_property(en, "ID_INPUT_TOUCHPAD", "1"); 178 udev_enumerate_add_match_property(en, "ID_INPUT_TOUCHPAD", "1");
188#endif
189 break; 179 break;
190 180
191 case EEZE_UDEV_TYPE_JOYSTICK: 181 case EEZE_UDEV_TYPE_JOYSTICK:
192 udev_enumerate_add_match_subsystem(en, "input"); 182 udev_enumerate_add_match_subsystem(en, "input");
193#ifndef OLD_UDEV_RRRRRRRRRRRRRR
194 udev_enumerate_add_match_property(en, "ID_INPUT_JOYSTICK", "1"); 183 udev_enumerate_add_match_property(en, "ID_INPUT_JOYSTICK", "1");
195#endif
196 break; 184 break;
197 185
198 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE: 186 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c
index df858e6c1e..0dcf097c02 100644
--- a/src/lib/eeze/eeze_udev_syspath.c
+++ b/src/lib/eeze/eeze_udev_syspath.c
@@ -155,24 +155,12 @@ eeze_udev_syspath_is_mouse(const char *syspath)
155 155
156 if (!(device = _new_device(syspath))) 156 if (!(device = _new_device(syspath)))
157 return EINA_FALSE; 157 return EINA_FALSE;
158#ifdef OLD_UDEV_RRRRRRRRRRRRRR
159 mouse = _walk_parents_test_attr(device, "bInterfaceProtocol", "02");
160 158
161 if (!mouse)
162 {
163 test = udev_device_get_property_value(device, "ID_CLASS");
164
165 if ((test) && (!strcmp(test, "mouse")))
166 mouse = EINA_TRUE;
167 }
168
169#else
170 test = udev_device_get_property_value(device, "ID_INPUT_MOUSE"); 159 test = udev_device_get_property_value(device, "ID_INPUT_MOUSE");
171 160
172 if (test && (test[0] == '1')) 161 if (test && (test[0] == '1'))
173 mouse = EINA_TRUE; 162 mouse = EINA_TRUE;
174 163
175#endif
176 udev_device_unref(device); 164 udev_device_unref(device);
177 return mouse; 165 return mouse;
178} 166}
@@ -189,24 +177,12 @@ eeze_udev_syspath_is_kbd(const char *syspath)
189 177
190 if (!(device = _new_device(syspath))) 178 if (!(device = _new_device(syspath)))
191 return EINA_FALSE; 179 return EINA_FALSE;
192#ifdef OLD_UDEV_RRRRRRRRRRRRRR
193 kbd = _walk_parents_test_attr(device, "bInterfaceProtocol", "01");
194
195 if (!kbd)
196 {
197 test = udev_device_get_property_value(device, "ID_CLASS");
198
199 if ((test) && (!strcmp(test, "kbd")))
200 kbd = EINA_TRUE;
201 }
202 180
203#else
204 test = udev_device_get_property_value(device, "ID_INPUT_KEYBOARD"); 181 test = udev_device_get_property_value(device, "ID_INPUT_KEYBOARD");
205 182
206 if (test && (test[0] == '1')) 183 if (test && (test[0] == '1'))
207 kbd = EINA_TRUE; 184 kbd = EINA_TRUE;
208 185
209#endif
210 udev_device_unref(device); 186 udev_device_unref(device);
211 return kbd; 187 return kbd;
212} 188}
@@ -216,22 +192,19 @@ eeze_udev_syspath_is_touchpad(const char *syspath)
216{ 192{
217 _udev_device *device = NULL; 193 _udev_device *device = NULL;
218 Eina_Bool touchpad = EINA_FALSE; 194 Eina_Bool touchpad = EINA_FALSE;
195 const char *test;
219 196
220 if (!syspath) 197 if (!syspath)
221 return EINA_FALSE; 198 return EINA_FALSE;
222 199
223 if (!(device = _new_device(syspath))) 200 if (!(device = _new_device(syspath)))
224 return EINA_FALSE; 201 return EINA_FALSE;
225#ifdef OLD_UDEV_RRRRRRRRRRRRRR 202
226 touchpad = _walk_parents_test_attr(device, "resolution", NULL);
227#else
228 const char *test;
229 test = udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"); 203 test = udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD");
230 204
231 if (test && (test[0] == '1')) 205 if (test && (test[0] == '1'))
232 touchpad = EINA_TRUE; 206 touchpad = EINA_TRUE;
233 207
234#endif
235 udev_device_unref(device); 208 udev_device_unref(device);
236 return touchpad; 209 return touchpad;
237} 210}
@@ -248,18 +221,12 @@ eeze_udev_syspath_is_joystick(const char *syspath)
248 221
249 if (!(device = _new_device(syspath))) 222 if (!(device = _new_device(syspath)))
250 return EINA_FALSE; 223 return EINA_FALSE;
251#ifdef OLD_UDEV_RRRRRRRRRRRRRR
252 test = udev_device_get_property_value(device, "ID_CLASS");
253 224
254 if ((test) && (!strcmp(test, "joystick")))
255 joystick = EINA_TRUE;
256#else
257 test = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"); 225 test = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK");
258 226
259 if (test && (test[0] == '1')) 227 if (test && (test[0] == '1'))
260 joystick = EINA_TRUE; 228 joystick = EINA_TRUE;
261 229
262#endif
263 udev_device_unref(device); 230 udev_device_unref(device);
264 return joystick; 231 return joystick;
265} 232}
diff --git a/src/lib/eeze/eeze_udev_watch.c b/src/lib/eeze/eeze_udev_watch.c
index 0083b818fc..6ff9e8587b 100644
--- a/src/lib/eeze/eeze_udev_watch.c
+++ b/src/lib/eeze/eeze_udev_watch.c
@@ -111,19 +111,6 @@ _get_syspath_from_watch(void *data,
111 switch (store->type) 111 switch (store->type)
112 { 112 {
113 case EEZE_UDEV_TYPE_KEYBOARD: 113 case EEZE_UDEV_TYPE_KEYBOARD:
114#ifdef OLD_UDEV_RRRRRRRRRRRRRR
115 if ((!(test = udev_device_get_subsystem(device)))
116 || (strcmp(test, "input")))
117 goto error;
118
119 test = udev_device_get_property_value(device, "ID_CLASS");
120
121 if ((_walk_parents_test_attr(device, "bInterfaceProtocol", "01"))
122 || ((test) && (!strcmp(test, "kbd"))))
123 break;
124
125 goto error;
126#endif
127 if ((!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD")) && 114 if ((!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD")) &&
128 (!udev_device_get_property_value(device, "ID_INPUT_KEY"))) 115 (!udev_device_get_property_value(device, "ID_INPUT_KEY")))
129 goto error; 116 goto error;
@@ -131,65 +118,24 @@ _get_syspath_from_watch(void *data,
131 break; 118 break;
132 119
133 case EEZE_UDEV_TYPE_MOUSE: 120 case EEZE_UDEV_TYPE_MOUSE:
134#ifdef OLD_UDEV_RRRRRRRRRRRRRR
135 if ((!(test = udev_device_get_subsystem(device)))
136 || (strcmp(test, "input")))
137 goto error;
138
139 test = udev_device_get_property_value(device, "ID_CLASS");
140
141 if ((_walk_parents_test_attr(device, "bInterfaceProtocol", "02"))
142 || ((test) && (!strcmp(test, "mouse"))))
143 break;
144
145 goto error;
146#endif
147
148 if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE")) 121 if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE"))
149 goto error; 122 goto error;
150 123
151 break; 124 break;
152 125
153 case EEZE_UDEV_TYPE_TOUCHPAD: 126 case EEZE_UDEV_TYPE_TOUCHPAD:
154#ifdef OLD_UDEV_RRRRRRRRRRRRRR
155 if ((!(test = udev_device_get_subsystem(device)))
156 || (strcmp(test, "input")))
157 goto error;
158
159 if (_walk_parents_test_attr(device, "resolution", NULL))
160 break;
161
162 goto error;
163#endif
164 if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD")) 127 if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"))
165 goto error; 128 goto error;
166 129
167 break; 130 break;
168 131
169 case EEZE_UDEV_TYPE_JOYSTICK: 132 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")) 133 if (!udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"))
183 goto error; 134 goto error;
184 135
185 break; 136 break;
186 137
187 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE: 138 case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
188#ifdef OLD_UDEV_RRRRRRRRRRRRRR
189 if ((!(test = udev_device_get_subsystem(device)))
190 || (strcmp(test, "block")))
191 goto error;
192#endif
193 if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) || 139 if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) ||
194 (strcmp("filesystem", test))) 140 (strcmp("filesystem", test)))
195 { 141 {
@@ -237,31 +183,16 @@ _get_syspath_from_watch(void *data,
237 break; 183 break;
238 184
239 case EEZE_UDEV_TYPE_POWER_AC: 185 case EEZE_UDEV_TYPE_POWER_AC:
240#ifdef OLD_UDEV_RRRRRRRRRRRRRR
241 if ((!(test = udev_device_get_subsystem(device)))
242 || (strcmp(test, "power_supply")))
243 goto error;
244#endif
245 test = udev_device_get_property_value(device, "POWER_SUPPLY_ONLINE"); 186 test = udev_device_get_property_value(device, "POWER_SUPPLY_ONLINE");
246 if (!test) goto error; 187 if (!test) goto error;
247 break; 188 break;
248 189
249 case EEZE_UDEV_TYPE_POWER_BAT: 190 case EEZE_UDEV_TYPE_POWER_BAT:
250#ifdef OLD_UDEV_RRRRRRRRRRRRRR
251 if ((!(test = udev_device_get_subsystem(device)))
252 || (strcmp(test, "power_supply")))
253 goto error;
254#endif
255 test = udev_device_get_property_value(device, "POWER_SUPPLY_PRESENT"); 191 test = udev_device_get_property_value(device, "POWER_SUPPLY_PRESENT");
256 if ((!test) || (strcmp(test, "1"))) goto error; 192 if ((!test) || (strcmp(test, "1"))) goto error;
257 break; 193 break;
258 194
259 case EEZE_UDEV_TYPE_NET: 195 case EEZE_UDEV_TYPE_NET:
260#ifdef OLD_UDEV_RRRRRRRRRRRRRR
261 if ((!(test = udev_device_get_subsystem(device)))
262 || (strcmp(test, "net")))
263 goto error;
264#endif
265 break; 196 break;
266 197
267 case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR: 198 case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
@@ -269,11 +200,6 @@ _get_syspath_from_watch(void *data,
269 Eina_Bool one, two; 200 Eina_Bool one, two;
270 const char *t; 201 const char *t;
271 202
272#ifdef OLD_UDEV_RRRRRRRRRRRRRR
273 if ((!(test = udev_device_get_subsystem(device)))
274 || (strcmp(test, "hwmon")))
275 goto error;
276#endif /* have to do stuff up here since we need info from the parent */
277 one = _walk_parents_test_attr(device, "temp1_input", NULL); 203 one = _walk_parents_test_attr(device, "temp1_input", NULL);
278 two = _walk_parents_test_attr(device, "temp2_input", NULL); 204 two = _walk_parents_test_attr(device, "temp2_input", NULL);
279 if ((!one) && (!two)) goto error; 205 if ((!one) && (!two)) goto error;
@@ -341,8 +267,6 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
341 if (!(mon = udev_monitor_new_from_netlink(udev, "udev"))) 267 if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
342 goto error; 268 goto error;
343 269
344#ifndef OLD_UDEV_RRRRRRRRRRRRRR
345
346 switch (type) 270 switch (type)
347 { 271 {
348 case EEZE_UDEV_TYPE_JOYSTICK: 272 case EEZE_UDEV_TYPE_JOYSTICK:
@@ -395,8 +319,6 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
395 break; 319 break;
396 } 320 }
397 321
398#endif
399
400 if (udev_monitor_enable_receiving(mon)) 322 if (udev_monitor_enable_receiving(mon))
401 goto error; 323 goto error;
402 324