summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2011-10-27 15:57:14 +0000
committerChristopher Michael <cpmichael1@comcast.net>2011-10-27 15:57:14 +0000
commit96557ccea1f52876d90848222d2b4fb1e4a4fa32 (patch)
tree5ab8c54e8cd7e89d9f6f98777d12514f18147f23 /legacy
parentc91bdfc4dff7db036699f98db5a02f8ae679bf11 (diff)
Elementary: Fix uninitialized variables warnings. Fix case formatting.
SVN revision: 64437
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_gesture_layer.c142
1 files changed, 71 insertions, 71 deletions
diff --git a/legacy/elementary/src/lib/elm_gesture_layer.c b/legacy/elementary/src/lib/elm_gesture_layer.c
index 5f30581e8c..0c5ba5e1d1 100644
--- a/legacy/elementary/src/lib/elm_gesture_layer.c
+++ b/legacy/elementary/src/lib/elm_gesture_layer.c
@@ -1409,8 +1409,8 @@ _compute_taps_center(Long_Tap_Type *st,
1409 */ 1409 */
1410static void 1410static void
1411_n_long_tap_test(Evas_Object *obj, Pointer_Event *pe, 1411_n_long_tap_test(Evas_Object *obj, Pointer_Event *pe,
1412 void *event_info, Evas_Callback_Type event_type, 1412 void *event_info, Evas_Callback_Type event_type,
1413 Elm_Gesture_Types g_type) 1413 Elm_Gesture_Types g_type)
1414{ /* Here we fill Recent_Taps struct and fire-up click/tap timers */ 1414{ /* Here we fill Recent_Taps struct and fire-up click/tap timers */
1415 Widget_Data *wd = elm_widget_data_get(obj); 1415 Widget_Data *wd = elm_widget_data_get(obj);
1416 if (!wd) return; 1416 if (!wd) return;
@@ -1433,91 +1433,91 @@ _n_long_tap_test(Evas_Object *obj, Pointer_Event *pe,
1433 { 1433 {
1434 case EVAS_CALLBACK_MULTI_DOWN: 1434 case EVAS_CALLBACK_MULTI_DOWN:
1435 case EVAS_CALLBACK_MOUSE_DOWN: 1435 case EVAS_CALLBACK_MOUSE_DOWN:
1436 st->touched = _add_touched_device(st->touched, pe); 1436 st->touched = _add_touched_device(st->touched, pe);
1437 st->info.n = eina_list_count(st->touched); 1437 st->info.n = eina_list_count(st->touched);
1438 if (st->info.n > st->max_touched) 1438 if (st->info.n > st->max_touched)
1439 st->max_touched = st->info.n; 1439 st->max_touched = st->info.n;
1440 else 1440 else
1441 { /* User removed finger from touch, then put back - ABORT */ 1441 { /* User removed finger from touch, then put back - ABORT */
1442 if ((gesture->state == ELM_GESTURE_STATE_START) || 1442 if ((gesture->state == ELM_GESTURE_STATE_START) ||
1443 (gesture->state == ELM_GESTURE_STATE_MOVE)) 1443 (gesture->state == ELM_GESTURE_STATE_MOVE))
1444 { 1444 {
1445 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_ABORT, 1445 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_ABORT,
1446 &st->info, EINA_FALSE); 1446 &st->info, EINA_FALSE);
1447 consume_event(wd, event_info, event_type, ev_flag); 1447 consume_event(wd, event_info, event_type, ev_flag);
1448 } 1448 }
1449 } 1449 }
1450 1450
1451 if ((pe->device == 0) && (eina_list_count(st->touched) == 1)) 1451 if ((pe->device == 0) && (eina_list_count(st->touched) == 1))
1452 { /* This is the first mouse down we got */ 1452 { /* This is the first mouse down we got */
1453 st->info.timestamp = pe->timestamp; 1453 st->info.timestamp = pe->timestamp;
1454 1454
1455 /* To test long tap */ 1455 /* To test long tap */
1456 /* When this timer expires, gesture STARTED */ 1456 /* When this timer expires, gesture STARTED */
1457 if (!st->timeout) 1457 if (!st->timeout)
1458 st->timeout = ecore_timer_add(wd->long_tap_start_timeout, 1458 st->timeout = ecore_timer_add(wd->long_tap_start_timeout,
1459 _long_tap_timeout, gesture); 1459 _long_tap_timeout, gesture);
1460 } 1460 }
1461 1461
1462 consume_event(wd, event_info, event_type, ev_flag); 1462 consume_event(wd, event_info, event_type, ev_flag);
1463 _compute_taps_center(st, &st->info.x, &st->info.y, pe); 1463 _compute_taps_center(st, &st->info.x, &st->info.y, pe);
1464 st->center_x = st->info.x; 1464 st->center_x = st->info.x;
1465 st->center_y = st->info.y; 1465 st->center_y = st->info.y;
1466 break; 1466 break;
1467 1467
1468 case EVAS_CALLBACK_MULTI_UP: 1468 case EVAS_CALLBACK_MULTI_UP:
1469 case EVAS_CALLBACK_MOUSE_UP: 1469 case EVAS_CALLBACK_MOUSE_UP:
1470 st->touched = _remove_touched_device(st->touched, pe); 1470 st->touched = _remove_touched_device(st->touched, pe);
1471 _compute_taps_center(st, &st->center_x, &st->center_y, pe); 1471 _compute_taps_center(st, &st->center_x, &st->center_y, pe);
1472 if (st->info.n && 1472 if (st->info.n &&
1473 ((gesture->state == ELM_GESTURE_STATE_START) || 1473 ((gesture->state == ELM_GESTURE_STATE_START) ||
1474 (gesture->state == ELM_GESTURE_STATE_MOVE))) 1474 (gesture->state == ELM_GESTURE_STATE_MOVE)))
1475 { /* Report END only for gesture that STARTed */ 1475 { /* Report END only for gesture that STARTed */
1476 if (eina_list_count(st->touched) == 0) 1476 if (eina_list_count(st->touched) == 0)
1477 { /* Report END only at last release event */ 1477 { /* Report END only at last release event */
1478 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_END, 1478 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_END,
1479 &st->info, EINA_FALSE); 1479 &st->info, EINA_FALSE);
1480 consume_event(wd, event_info, event_type, ev_flag); 1480 consume_event(wd, event_info, event_type, ev_flag);
1481 } 1481 }
1482 } 1482 }
1483 else 1483 else
1484 { /* Stop test, user lifts finger before long-start */ 1484 { /* Stop test, user lifts finger before long-start */
1485 if (st->timeout) ecore_timer_del(st->timeout); 1485 if (st->timeout) ecore_timer_del(st->timeout);
1486 st->timeout = NULL; 1486 st->timeout = NULL;
1487 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_ABORT, 1487 ev_flag =_set_state(gesture, ELM_GESTURE_STATE_ABORT,
1488 &st->info, EINA_FALSE); 1488 &st->info, EINA_FALSE);
1489 consume_event(wd, event_info, event_type, ev_flag); 1489 consume_event(wd, event_info, event_type, ev_flag);
1490 } 1490 }
1491 1491
1492 break; 1492 break;
1493 1493
1494 case EVAS_CALLBACK_MULTI_MOVE: 1494 case EVAS_CALLBACK_MULTI_MOVE:
1495 case EVAS_CALLBACK_MOUSE_MOVE: 1495 case EVAS_CALLBACK_MOUSE_MOVE:
1496 if(st->info.n && 1496 if(st->info.n &&
1497 ((gesture->state == ELM_GESTURE_STATE_START) || 1497 ((gesture->state == ELM_GESTURE_STATE_START) ||
1498 (gesture->state == ELM_GESTURE_STATE_MOVE))) 1498 (gesture->state == ELM_GESTURE_STATE_MOVE)))
1499 { /* Report MOVE only if STARTED */ 1499 { /* Report MOVE only if STARTED */
1500 Evas_Coord x; 1500 Evas_Coord x = 0;
1501 Evas_Coord y; 1501 Evas_Coord y = 0;
1502 Elm_Gesture_State state_to_report = ELM_GESTURE_STATE_MOVE; 1502 Elm_Gesture_State state_to_report = ELM_GESTURE_STATE_MOVE;
1503 1503
1504 _compute_taps_center(st, &x, &y, pe); 1504 _compute_taps_center(st, &x, &y, pe);
1505 /* ABORT if user moved fingers out of tap area */ 1505 /* ABORT if user moved fingers out of tap area */
1506#if defined(DEBUG_GESTURE_LAYER) 1506#if defined(DEBUG_GESTURE_LAYER)
1507 printf("%s x,y=(%d,%d) st->info.x,st->info.y=(%d,%d)\n",__func__,x,y,st->info.x,st->info.y); 1507 printf("%s x,y=(%d,%d) st->info.x,st->info.y=(%d,%d)\n",__func__,x,y,st->info.x,st->info.y);
1508#endif 1508#endif
1509 if (!_inside(x, y, st->center_x, st->center_y)) 1509 if (!_inside(x, y, st->center_x, st->center_y))
1510 state_to_report = ELM_GESTURE_STATE_ABORT; 1510 state_to_report = ELM_GESTURE_STATE_ABORT;
1511 1511
1512 /* Report MOVE if gesture started */ 1512 /* Report MOVE if gesture started */
1513 ev_flag = _set_state(gesture, state_to_report, 1513 ev_flag = _set_state(gesture, state_to_report,
1514 &st->info, EINA_TRUE); 1514 &st->info, EINA_TRUE);
1515 consume_event(wd, event_info, event_type, ev_flag); 1515 consume_event(wd, event_info, event_type, ev_flag);
1516 } 1516 }
1517 break; 1517 break;
1518 1518
1519 default: 1519 default:
1520 return; 1520 return;
1521 } 1521 }
1522} 1522}
1523 1523