forked from enlightenment/efl
eeze/sensor: Setup all ecore event types in init.
We had some set up but not all. Do that and avoid the redo'ing in eeze_sensor test.
This commit is contained in:
parent
fdb479d060
commit
f7c055b0ce
|
@ -333,13 +333,45 @@ eeze_sensor_init(void)
|
||||||
if (!g_handle->modules) return EINA_FALSE;
|
if (!g_handle->modules) return EINA_FALSE;
|
||||||
|
|
||||||
/* Make sure we create new ecore event types before using them */
|
/* Make sure we create new ecore event types before using them */
|
||||||
EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new();
|
if (EEZE_SENSOR_EVENT_ACCELEROMETER == 0)
|
||||||
EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new();
|
|
||||||
EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new();
|
|
||||||
EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new();
|
|
||||||
EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new();
|
|
||||||
EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new();
|
EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_MAGNETIC == 0)
|
||||||
|
EEZE_SENSOR_EVENT_MAGNETIC = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_ORIENTATION == 0)
|
||||||
|
EEZE_SENSOR_EVENT_ORIENTATION = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_GYROSCOPE == 0)
|
||||||
|
EEZE_SENSOR_EVENT_GYROSCOPE = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_LIGHT == 0)
|
||||||
|
EEZE_SENSOR_EVENT_LIGHT = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_PROXIMITY == 0)
|
||||||
|
EEZE_SENSOR_EVENT_PROXIMITY = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_SNAP == 0)
|
||||||
|
EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_SHAKE == 0)
|
||||||
|
EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_DOUBLETAP == 0)
|
||||||
|
EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_PANNING == 0)
|
||||||
|
EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_FACEDOWN == 0)
|
||||||
|
EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_BAROMETER == 0)
|
||||||
|
EEZE_SENSOR_EVENT_BAROMETER = ecore_event_type_new();
|
||||||
|
|
||||||
|
if (EEZE_SENSOR_EVENT_TEMPERATURE == 0)
|
||||||
|
EEZE_SENSOR_EVENT_TEMPERATURE = ecore_event_type_new();
|
||||||
|
|
||||||
/* Core is ready so we can load the modules from disk now */
|
/* Core is ready so we can load the modules from disk now */
|
||||||
eeze_sensor_modules_load();
|
eeze_sensor_modules_load();
|
||||||
|
|
||||||
|
|
|
@ -524,9 +524,6 @@ START_TEST(eeze_test_sensor_async_read)
|
||||||
ret = eeze_init();
|
ret = eeze_init();
|
||||||
fail_if(ret != 1);
|
fail_if(ret != 1);
|
||||||
|
|
||||||
EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new();
|
|
||||||
fail_if(EEZE_SENSOR_EVENT_ACCELEROMETER < 1);
|
|
||||||
|
|
||||||
handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL);
|
handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL);
|
||||||
fail_if(handler == NULL);
|
fail_if(handler == NULL);
|
||||||
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
|
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
|
||||||
|
|
Loading…
Reference in New Issue