ecore: use eina_file_direct_ls (faster, better, cleaner).
SVN revision: 67085
This commit is contained in:
parent
25c6251caa
commit
8885e90cda
|
@ -185,31 +185,26 @@ _ecore_evas_fb_render(Ecore_Evas *ee)
|
||||||
static int
|
static int
|
||||||
_ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
|
Eina_File_Direct_Info *info;
|
||||||
|
Eina_Iterator *ls;
|
||||||
Ecore_Fb_Input_Device *device;
|
Ecore_Fb_Input_Device *device;
|
||||||
Ecore_Fb_Input_Device_Cap caps;
|
Ecore_Fb_Input_Device_Cap caps;
|
||||||
int mouse_handled = 0;
|
int mouse_handled = 0;
|
||||||
|
|
||||||
DIR *input_dir;
|
|
||||||
struct dirent *input_entry;
|
|
||||||
|
|
||||||
_ecore_evas_init_count++;
|
_ecore_evas_init_count++;
|
||||||
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
||||||
|
|
||||||
ecore_event_evas_init();
|
ecore_event_evas_init();
|
||||||
|
|
||||||
/* register all input devices */
|
/* register all input devices */
|
||||||
input_dir = opendir("/dev/input/");
|
ls = eina_file_direct_ls("/dev/input/");
|
||||||
if (!input_dir) return _ecore_evas_init_count;
|
|
||||||
|
|
||||||
while ((input_entry = readdir(input_dir)))
|
EINA_ITERATOR_FOREACH(ls, info)
|
||||||
{
|
{
|
||||||
char device_path[256];
|
if (strncmp(info->path + info->name_start, "event", 5) != 0)
|
||||||
|
|
||||||
if (strncmp(input_entry->d_name, "event", 5) != 0)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf(device_path, 256, "/dev/input/%s", input_entry->d_name);
|
if (!(device = ecore_fb_input_device_open(info->path)))
|
||||||
if (!(device = ecore_fb_input_device_open(device_path)))
|
|
||||||
continue;
|
continue;
|
||||||
ecore_fb_input_device_window_set(device, ee);
|
ecore_fb_input_device_window_set(device, ee);
|
||||||
|
|
||||||
|
@ -241,7 +236,7 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
||||||
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(input_dir);
|
eina_iterator_free(ls);
|
||||||
|
|
||||||
if (!mouse_handled)
|
if (!mouse_handled)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue