void EWK2UnitTestBase::multiMove(int id, int x, int y)
{
    evas_event_feed_multi_move(evas_object_evas_get(m_webView), id, x, y, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Example #2
0
static Eina_Bool
tsuite_feed_event(void *data)
{
   static Ecore_Timer *tmr = NULL;
   Timer_Data *td = data;
   time_t evt_time;
   if (!td)
     return ECORE_CALLBACK_CANCEL;

   Variant_st *v = eina_list_data_get(td->current_event);
   switch(tsuite_event_mapping_type_get(v->t.type))
     {
      case TSUITE_EVENT_MOUSE_IN:
           {
              mouse_in_mouse_out *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_in timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_mouse_in(eina_list_nth(evas_list, t->n_evas),
                       time(NULL), NULL);
              break;
           }
      case TSUITE_EVENT_MOUSE_OUT:
           {
              mouse_in_mouse_out *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_out timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
              evas_event_feed_mouse_out(eina_list_nth(evas_list, t->n_evas),
                    time(NULL), NULL);
              break;
           }
      case TSUITE_EVENT_MOUSE_DOWN:
           {
              mouse_down_mouse_up *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_down timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_mouse_down(eina_list_nth(evas_list, t->n_evas),
                    t->b, t->flags, time(NULL),
                    NULL);

              break;
           }
      case TSUITE_EVENT_MOUSE_UP:
           {
              mouse_down_mouse_up *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
              evas_event_feed_mouse_up(eina_list_nth(evas_list, t->n_evas),
                    t->b, t->flags, time(NULL),
                    NULL);

              break;
           }
      case TSUITE_EVENT_MOUSE_MOVE:
           {
              mouse_move *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_move (x,y)=(%d,%d) timestamp=<%u> t->n_evas=<%d>\n", __func__, t->x, t->y, t->timestamp,t->n_evas);
#endif
              evas_event_feed_mouse_move(eina_list_nth(evas_list, t->n_evas),
                    t->x, t->y, time(NULL), NULL);
              break;
           }
      case TSUITE_EVENT_MOUSE_WHEEL:
           {
              mouse_wheel *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_mouse_wheel timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_mouse_wheel(eina_list_nth(evas_list, t->n_evas),
                    t->direction, t->z,
                    time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_MULTI_DOWN:
           {
              multi_event *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_multi_down timestamp=<%u>, t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
              evas_event_feed_multi_down(eina_list_nth(evas_list, t->n_evas),
                    t->d, t->x, t->y, t->rad,
                    t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
                    t->flags, time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_MULTI_UP:
           {
              multi_event *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_multi_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
              evas_event_feed_multi_up(eina_list_nth(evas_list, t->n_evas),
                    t->d, t->x, t->y, t->rad,
                    t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
                    t->flags, time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_MULTI_MOVE:
           {
              multi_move *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_multi_move timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_multi_move(eina_list_nth(evas_list, t->n_evas),
                    t->d, t->x, t->y, t->rad,
                    t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
                    time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_KEY_DOWN:
           {
              key_down_key_up *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_key_down timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_key_down(eina_list_nth(evas_list, t->n_evas),
                    t->keyname, t->key, t->string,
                    t->compose, time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_KEY_UP:
           {
              key_down_key_up *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s evas_event_feed_key_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              evas_event_feed_key_up(eina_list_nth(evas_list, t->n_evas),
                    t->keyname, t->key, t->string,
                    t->compose, time(NULL), NULL);

              break;
           }
      case TSUITE_EVENT_TAKE_SHOT:
           {
              take_screenshot *t = v->data;
              evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
              printf("%s take shot  timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
              tsuite_shot_do(NULL,
                    eina_list_nth(evas_list, t->n_evas)); /* Serial name based on test-name */
              break;
           }
      default: /* All non-input events are not handeled */
         evt_time = td->recent_event_time;
         break;
     }

   double timer_time;
   td->current_event = eina_list_next(td->current_event);

   if (!td->current_event)
     {  /* Finished reading all events */
        elm_exit();
        return ECORE_CALLBACK_CANCEL;
     }

   td->recent_event_time = evt_time;

   unsigned int current_event_time = evt_time_get(evt_time, eina_list_data_get(td->current_event));

   if (current_event_time < td->recent_event_time) /* Could happen with refeed event */
     current_event_time = td->recent_event_time;

#ifdef DEBUG_TSUITE
   printf("%s td->recent_event_time=<%u> current_event_time=<%u>\n", __func__, td->recent_event_time, current_event_time);
#endif
   timer_time = (current_event_time - td->recent_event_time) / 1000.0;

   if (!td->recent_event_time)
     timer_time = 0.0;

#ifdef DEBUG_TSUITE
   printf("%s timer_time=<%f>\n", __func__, timer_time);
#endif
   tmr = ecore_timer_add(timer_time, tsuite_feed_event, td);

   return ECORE_CALLBACK_CANCEL;
}