summaryrefslogtreecommitdiff
path: root/legacy/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2012-09-19 13:36:17 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2012-09-19 13:36:17 +0000
commita36ed3dc828a8acb5a9b8b02220b69439f5302df (patch)
tree44a264e3b5925dfb9dcf87869aba12f326abc6e5 /legacy/eeze
parentccde4dce02462fc15181f124cb2600fcb587e0a4 (diff)
eeze/sensor: Adjust tizen module to API changes.
SVN revision: 76866
Diffstat (limited to 'legacy/eeze')
-rw-r--r--legacy/eeze/src/modules/eeze_sensor_tizen.c49
1 files changed, 34 insertions, 15 deletions
diff --git a/legacy/eeze/src/modules/eeze_sensor_tizen.c b/legacy/eeze/src/modules/eeze_sensor_tizen.c
index 5134d4c7d4..d7c9383c0d 100644
--- a/legacy/eeze/src/modules/eeze_sensor_tizen.c
+++ b/legacy/eeze/src/modules/eeze_sensor_tizen.c
@@ -9,6 +9,7 @@
9#include <stdbool.h> 9#include <stdbool.h>
10 10
11#include <Eina.h> 11#include <Eina.h>
12#include <Ecore.h>
12#include <Eeze_Sensor.h> 13#include <Eeze_Sensor.h>
13#include "eeze_sensor_private.h" 14#include "eeze_sensor_private.h"
14 15
@@ -446,17 +447,35 @@ panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
446void 447void
447facedown_read_cb(unsigned long long timestamp, void *user_data) 448facedown_read_cb(unsigned long long timestamp, void *user_data)
448{ 449{
450 Eeze_Sensor_Obj *obj = NULL;
451
449 sensor_motion_facedown_unset_cb(sensor_handle); 452 sensor_motion_facedown_unset_cb(sensor_handle);
453
454 obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_MOTION_FACEDOWN);
455 if (obj == NULL)
456 {
457 ERR("No matching sensor object found in list.");
458 return;
459 }
450 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL); 460 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL);
451 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_MOTION_TYPE_FACEDOWN)); 461 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_FACEDOWN));
452} 462}
453 463
454void 464void
455doubletap_read_cb(unsigned long long timestamp, void *user_data) 465doubletap_read_cb(unsigned long long timestamp, void *user_data)
456{ 466{
467 Eeze_Sensor_Obj *obj = NULL;
468
457 sensor_motion_doubletap_unset_cb(sensor_handle); 469 sensor_motion_doubletap_unset_cb(sensor_handle);
470
471 obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP);
472 if (obj == NULL)
473 {
474 ERR("No matching sensor object found in list.");
475 return;
476 }
458 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL); 477 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL);
459 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_MOTION_TYPE_DOUBLETAP)); 478 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP));
460} 479}
461 480
462Eina_Bool 481Eina_Bool
@@ -478,7 +497,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
478 return EINA_FALSE; 497 return EINA_FALSE;
479 } 498 }
480 499
481 sensor_start(handle->sensor_handle, type); 500 sensor_start(sensor_handle, type);
482 obj = eeze_sensor_obj_get(sensor_type); 501 obj = eeze_sensor_obj_get(sensor_type);
483 if (obj == NULL) 502 if (obj == NULL)
484 { 503 {
@@ -554,44 +573,44 @@ eeze_sensor_tizen_cb_set(Eeze_Sensor *handle, Eeze_Sensor_Type sensor_type, void
554 573
555 handle->cb_function = cb_function; 574 handle->cb_function = cb_function;
556 575
557 sensor_start(handle->sensor_handle, type); 576 sensor_start(sensor_handle, type);
558 577
559 switch (type) 578 switch (type)
560 { 579 {
561 case SENSOR_ACCELEROMETER: 580 case SENSOR_ACCELEROMETER:
562 sensor_accelerometer_set_cb(handle->sensor_handle, 0, accelerometer_cb, handle); 581 sensor_accelerometer_set_cb(sensor_handle, 0, accelerometer_cb, handle);
563 break; 582 break;
564 583
565 case SENSOR_MAGNETIC: 584 case SENSOR_MAGNETIC:
566 sensor_magnetic_set_cb(handle->sensor_handle, 0, magnetic_cb, handle); 585 sensor_magnetic_set_cb(sensor_handle, 0, magnetic_cb, handle);
567 break; 586 break;
568 587
569 case SENSOR_ORIENTATION: 588 case SENSOR_ORIENTATION:
570 sensor_orientation_set_cb(handle->sensor_handle, 0, orientation_cb, handle); 589 sensor_orientation_set_cb(sensor_handle, 0, orientation_cb, handle);
571 break; 590 break;
572 591
573 case SENSOR_GYROSCOPE: 592 case SENSOR_GYROSCOPE:
574 sensor_gyroscope_set_cb(handle->sensor_handle, 0, gyroscope_cb, handle); 593 sensor_gyroscope_set_cb(sensor_handle, 0, gyroscope_cb, handle);
575 break; 594 break;
576 595
577 case SENSOR_LIGHT: 596 case SENSOR_LIGHT:
578 sensor_light_set_cb(handle->sensor_handle, 0, light_cb, handle); 597 sensor_light_set_cb(sensor_handle, 0, light_cb, handle);
579 break; 598 break;
580 599
581 case SENSOR_PROXIMITY: 600 case SENSOR_PROXIMITY:
582 sensor_proximity_set_cb(handle->sensor_handle, 0, proximity_cb, handle); 601 sensor_proximity_set_cb(sensor_handle, 0, proximity_cb, handle);
583 break; 602 break;
584 603
585 case SENSOR_MOTION_SNAP: 604 case SENSOR_MOTION_SNAP:
586 sensor_motion_snap_set_cb(handle->sensor_handle, snap_cb, handle); 605 sensor_motion_snap_set_cb(sensor_handle, snap_cb, handle);
587 break; 606 break;
588 607
589 case SENSOR_MOTION_SHAKE: 608 case SENSOR_MOTION_SHAKE:
590 sensor_motion_shake_set_cb(handle->sensor_handle, shake_cb, handle); 609 sensor_motion_shake_set_cb(sensor_handle, shake_cb, handle);
591 break; 610 break;
592 611
593 case SENSOR_MOTION_PANNING: 612 case SENSOR_MOTION_PANNING:
594 sensor_motion_panning_set_cb(handle->sensor_handle, panning_cb, handle); 613 sensor_motion_panning_set_cb(sensor_handle, panning_cb, handle);
595 break; 614 break;
596 615
597 default: 616 default:
@@ -718,8 +737,8 @@ eeze_sensor_tizen_init(void)
718 /* FIXME add other motion events in here */ 737 /* FIXME add other motion events in here */
719 sensor_start(sensor_handle, SENSOR_MOTION_FACEDOWN); 738 sensor_start(sensor_handle, SENSOR_MOTION_FACEDOWN);
720 sensor_start(sensor_handle, SENSOR_MOTION_DOUBLETAP); 739 sensor_start(sensor_handle, SENSOR_MOTION_DOUBLETAP);
721 sensor_motion_doubletap_set_cb(sensor_handle, doubletap_cb, handle); 740 sensor_motion_doubletap_set_cb(sensor_handle, doubletap_cb, NULL);
722 sensor_motion_facedown_set_cb(sensor_handle, facedown_cb, handle); 741 sensor_motion_facedown_set_cb(sensor_handle, facedown_cb, NULL);
723 742
724 return EINA_TRUE; 743 return EINA_TRUE;
725} 744}