Ejemplo n.º 1
0
static void
_mouse_down_cb(void *data,
               const Efl_Event *event)
{
   Efl_Input_Pointer *ev = event->info;
   Eo *obj = data;
   EFL_UI_PAGER_DATA_GET(obj, pd);
   Eina_Position2D pos;

   if (efl_input_pointer_button_get(ev) != 1) return;
   if (efl_input_event_flags_get(ev) & EFL_INPUT_FLAGS_PROCESSED) return;

   if (pd->cnt == 0) return;

   efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _mouse_up_animation, pd);
   efl_event_callback_del(obj, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, pd);

   pd->move_started = EINA_FALSE;

   pos = efl_input_pointer_position_get(ev);
   pd->mouse_x = pos.x - pd->x;
   pd->mouse_y = pos.y - pd->y;

   pd->down.enabled = EINA_TRUE;
   pd->down.x = pd->mouse_x;
   pd->down.y = pd->mouse_y;
   pd->down.page = pd->curr.page;
   pd->down.pos = pd->curr.pos;
}
Ejemplo n.º 2
0
static void
_file_hide(void *data, const Efl_Event *event)
{
   View_Common *common = data;
   Efm_File *file = event->info;

   efl_event_callback_del(file, EFL_EVENT_DEL, _file_del, data);

   _file_remove(common, file);
}
Ejemplo n.º 3
0
static void
_efl_net_server_ssl_client_event_closed(void *data, const Efl_Event *event)
{
   Eo *server = data;
   Eo *client = event->object;

   efl_event_callback_del(client, EFL_IO_CLOSER_EVENT_CLOSED, _efl_net_server_ssl_client_event_closed, server);
   if (efl_parent_get(client) == server)
     efl_parent_set(client, NULL);

   /* do NOT change count as we're using the underlying server's count */
   //efl_net_server_clients_count_set(server, efl_net_server_clients_count_get(server) - 1);
}
Ejemplo n.º 4
0
static void
_mouse_up_animation(void *data, const Efl_Event *event)
{
   Efl_Ui_Pager_Data *pd = data;
   double p = ecore_loop_time_get() - pd->mouse_up_time;

   if (p >= 1.0) p = 1.0;
   p = ecore_animator_pos_map(p, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);

   if (pd->curr.pos < 0.0)
     {
        if (pd->curr.pos > -0.5)
          pd->curr.pos = pd->curr.pos * (1 - p);
        else
          pd->curr.pos = (-1) - (-1 - pd->curr.pos) * (1 - p);
     }
   else
     {
        if (pd->curr.pos < 0.5)
          pd->curr.pos = pd->curr.pos * (1 - p);
        else
          pd->curr.pos = 1 - (1 - pd->curr.pos) * (1 - p);
     }

   if (EINA_DBL_EQ(pd->curr.pos, 1.0))
     {
        efl_page_transition_curr_page_change(pd->transition, 1);
        pd->curr.page = (pd->curr.page + 1 + pd->cnt) % pd->cnt;
        pd->curr.pos = 0.0;
     }
   else if (EINA_DBL_EQ(pd->curr.pos, -1.0))
     {
        efl_page_transition_curr_page_change(pd->transition, -1);
        pd->curr.page = (pd->curr.page - 1 + pd->cnt) % pd->cnt;
        pd->curr.pos = 0.0;
     }

   _efl_ui_pager_update(pd);

   if (EINA_DBL_EQ(p, 1.0))
     efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK,
                            _mouse_up_animation, pd);
}
Ejemplo n.º 5
0
static void
_page_set_animation(void *data, const Efl_Event *event)
{
   Efl_Ui_Pager_Data *pd = data;
   double p = ecore_loop_time_get() - pd->change.start_time;
   double d, temp_pos;
   int temp_page;

   if (p >= 1.0) p = 1.0;
   p = ecore_animator_pos_map(p, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);

   d = pd->change.src + pd->change.delta * p;
   temp_page = d;
   temp_pos = d - temp_page;

   if ((temp_page < pd->curr.page) && (fabs(pd->curr.page - d) < 1.0))
     {
        temp_page += 1;
        temp_pos -= 1.0;
     }

   if (pd->curr.page != temp_page)
     {
        if (pd->change.delta < 0)
          efl_page_transition_curr_page_change(pd->transition, -1);
        else
          efl_page_transition_curr_page_change(pd->transition, 1);
        temp_pos = 0.0;
     }

   pd->curr.page = temp_page;
   pd->curr.pos = temp_pos;

   ERR("page %d pos %lf", pd->curr.page, pd->curr.pos);

   _efl_ui_pager_update(pd);

   if (EINA_DBL_EQ(p, 1.0))
     efl_event_callback_del(event->object, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK,
                            _page_set_animation, pd);
}