예제 #1
0
static Eina_Bool
_ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press press)
{
   Ecore_Input_Window *lookup;
   Evas_Button_Flags flags = EVAS_BUTTON_NONE;

   lookup = _ecore_event_window_match(e->event_window);
   if (!lookup) return ECORE_CALLBACK_RENEW;
   if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
   if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
   if (e->multi.device == 0)
     {
        ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
        if (press == ECORE_DOWN)
          evas_event_feed_mouse_down(lookup->evas, e->buttons, flags,
                                     e->timestamp, NULL);
        else
          evas_event_feed_mouse_up(lookup->evas, e->buttons, flags,
                                   e->timestamp, NULL);
     }
   else
     {
        if (press == ECORE_DOWN)
          {
             if (lookup->down_multi)
                lookup->down_multi(lookup->window, e->multi.device,
                                   e->x, e->y, e->multi.radius,
                                   e->multi.radius_x, e->multi.radius_y,
                                   e->multi.pressure, e->multi.angle,
                                   e->multi.x, e->multi.y, flags,
                                   e->timestamp);
             else
                evas_event_feed_multi_down(lookup->evas, e->multi.device,
                                           e->x, e->y, e->multi.radius,
                                           e->multi.radius_x, e->multi.radius_y,
                                           e->multi.pressure, e->multi.angle,
                                           e->multi.x, e->multi.y, flags,
                                           e->timestamp, NULL);
          }
        else
          {
             if (lookup->up_multi)
                lookup->up_multi(lookup->window, e->multi.device,
                                 e->x, e->y, e->multi.radius,
                                 e->multi.radius_x, e->multi.radius_y,
                                 e->multi.pressure, e->multi.angle,
                                 e->multi.x, e->multi.y, flags,
                                 e->timestamp);
             else
                evas_event_feed_multi_up(lookup->evas, e->multi.device,
                                         e->x, e->y, e->multi.radius,
                                         e->multi.radius_x, e->multi.radius_y,
                                         e->multi.pressure, e->multi.angle,
                                         e->multi.x, e->multi.y, flags,
                                         e->timestamp, NULL);
          }
     }
   return ECORE_CALLBACK_RENEW;
}
예제 #2
0
void EWK2UnitTestBase::multiUp(int id, int x, int y)
{
    evas_event_feed_multi_up(evas_object_evas_get(m_webView), id, x, y, 0, 0, 0, 0, 0, 0, 0, EVAS_BUTTON_NONE, 0, 0);
}
예제 #3
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;
}