void GestureHandler::handleSingleTap(const IntPoint& position)
{
    Evas* evas = evas_object_evas_get(m_ewkView->evasObject());
    ASSERT(evas);

    // Send mouse move, down and up event to create fake click event.
    Evas_Event_Mouse_Move mouseMove;
    mouseMove.buttons = 0;
    mouseMove.prev.output.x = mouseMove.prev.canvas.x = position.x();
    mouseMove.prev.output.y = mouseMove.prev.canvas.y = position.y();
    mouseMove.cur.output.x = mouseMove.cur.canvas.x = position.x();
    mouseMove.cur.output.y = mouseMove.cur.canvas.y = position.y();
    mouseMove.data = 0;
    mouseMove.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
    mouseMove.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
    mouseMove.timestamp = ecore_loop_time_get();
    mouseMove.event_flags = EVAS_EVENT_FLAG_NONE;
    mouseMove.dev = 0;
    WKViewSendMouseMoveEvent(m_ewkView->wkView(), &mouseMove);

    Evas_Event_Mouse_Down mouseDown;
    mouseDown.button = 1;
    mouseDown.output.x = mouseDown.canvas.x = position.x();
    mouseDown.output.y = mouseDown.canvas.y = position.y();
    mouseDown.data = 0;
    mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
    mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
    mouseDown.flags = EVAS_BUTTON_NONE;
    mouseDown.timestamp = ecore_loop_time_get();
    mouseDown.event_flags = EVAS_EVENT_FLAG_NONE;
    mouseDown.dev = 0;
    WKViewSendMouseDownEvent(m_ewkView->wkView(), &mouseDown);

    Evas_Event_Mouse_Up mouseUp;
    mouseUp.button = 1;
    mouseUp.output.x = mouseUp.canvas.x = position.x();
    mouseUp.output.y = mouseUp.canvas.y = position.y();
    mouseUp.data = 0;
    mouseUp.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
    mouseUp.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
    mouseUp.flags = EVAS_BUTTON_NONE;
    mouseUp.timestamp = ecore_loop_time_get();
    mouseUp.event_flags = EVAS_EVENT_FLAG_NONE;
    mouseUp.dev = 0;
    WKViewSendMouseUpEvent(m_ewkView->wkView(), &mouseUp);
}
static void
_nav_refresh_cb(void *data, Evas_Object *obj, void *event_info)
{
   App_Data *ad = data;
   const Evas_Modifier *mods = evas_key_modifier_get(evas_object_evas_get(obj));

   if (evas_key_modifier_is_set(mods, "Shift"))
     elm_web_reload_full(ad->current_tab->web);
   else
     elm_web_reload(ad->current_tab->web);
}
void EventSenderProxy::sendTouchEvent(Ewk_Touch_Event_Type eventType)
{
    ASSERT(m_touchPoints);

    Evas_Object* ewkView = m_testController->mainWebView()->platformView();
    ewk_view_feed_touch_event(ewkView, eventType, m_touchPoints, evas_key_modifier_get(evas_object_evas_get(ewkView)));

    Eina_List* list;
    Eina_List* listNext;
    void* data;
    EINA_LIST_FOREACH_SAFE(m_touchPoints, list, listNext, data) {
         Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(data);
         ASSERT(touchPoint);

         if ((touchPoint->state == EVAS_TOUCH_POINT_UP) || (touchPoint->state == EVAS_TOUCH_POINT_CANCEL)) {
             delete touchPoint;
             m_touchPoints = eina_list_remove_list(m_touchPoints, list);
         } else
             touchPoint->state = EVAS_TOUCH_POINT_STILL;
     }
Esempio n. 4
0
      default:
        return "INVALID";
     }
}

static void
_on_keydown(void        *data EINA_UNUSED,
            Evas        *evas EINA_UNUSED,
            Evas_Object *o,
            void        *einfo)
{
   const Evas_Modifier *mods;
   Evas_Event_Key_Down *ev = einfo;

   mods = evas_key_modifier_get(evas_object_evas_get(o));

   if (evas_key_modifier_is_set(mods, "Shift") &&
       strcmp(ev->keyname, "h") == 0) /* print help */
     {
        fprintf(stdout, "commands are:\n"
                        "\tc - cycle aspect control on object\n"
                        "\th - change horizontal aspect component\n"
                        "\tv - change vertical aspect component\n"
                        "\ts - print current object's status\n"
                        "\tH - print help\n");
        return;
     }

   if (strcmp(ev->keyname, "s") == 0) /* get aspect status of the obj */
     {
Esempio n. 5
0
/* use the following commands to interact with this example - 'h' is
 * the key for help */
static void
_on_keydown(void        *data EINA_UNUSED,
            Evas        *evas EINA_UNUSED,
            Evas_Object *o EINA_UNUSED,
            void        *einfo)
{
   Evas_Event_Key_Down *ev = einfo;
   struct rect_data *r_data = NULL;
   const Evas_Modifier *mods;
   Evas_Object *rect = NULL;
   const char *name = NULL;

   mods = evas_key_modifier_get(evas);
   if (evas_key_modifier_is_set(mods, "Shift"))
     {
        rect = d.t_rect;
        r_data = &d.t_data;
        name = "top";
     }
   else if (evas_key_modifier_is_set(mods, "Control"))
     {
        rect = d.b_rect;
        r_data = &d.b_data;
        name = "bottom";
     }
   else if (strcmp(ev->key, "h") == 0) /* print help */
     {
        fprintf(stdout, commands);