Ejemplo n.º 1
0
static void
_mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
    Smart_Data *sd = data;
    Evas_Object *photocam;
    Elm_Object_Item *item;
    Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info;
    double zoom;

    //unset the mouse wheel
    ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;

    item = elm_slideshow_item_current_get(sd->slideshow);
    if(!item) return ;
    photocam = elm_slideshow_item_object_get(item);

    zoom = elm_photocam_zoom_get(photocam);

    if (ev->z > 0)
        zoom *= 1.1;
    else
        zoom /= 1.1;


    if (zoom < 10 && zoom > 0.1)
    {
        elm_photocam_zoom_mode_set(photocam, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
        elm_photocam_zoom_set(photocam, zoom);
    }

}
Ejemplo n.º 2
0
static int
_rotate(void *data)
{
    Smart_Data *sd = data;
    double t = ecore_loop_time_get() - sd->start;
    Evas_Coord x, y, w, h;
    double p, deg = 0.0;
    Evas_Map *map;
    Evas_Object *photocam;
    Elm_Slideshow_Item *item;

    item = elm_slideshow_item_current_get(sd->slideshow);
    if(!item) return 1;
    photocam = elm_slideshow_item_object_get(item);

    if (!sd->animator) return 0;
    t = t / ROTATION_DURATION;
    if (t > 1.0) t = 1.0;

    evas_object_geometry_get(photocam, &x, &y, &w, &h);
    map = evas_map_new(4);
    evas_map_smooth_set(map, 0);

    if (photocam)
        evas_map_util_points_populate_from_object_full(map, photocam, 0);

    x += (w / 2);
    y += (h / 2);

    p = 1.0 - t;
    p = 1.0 - (p * p);

    if (sd->mode)
        deg = 90.0 * p + sd->state * 90;
    else
        deg = - ((3 - sd->state) * 90.0) - (90.0 * p);

    evas_map_util_3d_rotate(map, 0.0, 0.0, deg, x, y, 0);

    evas_object_map_set(photocam, map);
    evas_object_map_enable_set(photocam, 1);
    evas_map_free(map);

    if (t >= 1.0)
    {
        sd->animator = NULL;
        return 0;
    }
    return 1;
}
Ejemplo n.º 3
0
/**
 * @brief Implementation of is_child_selected from AtkSelection
 *
 * @param selection EailSlideshow instace
 * @param i index of selection
 *
 * @return TRUE if object is selected FALSE otherwise
 */
static gboolean
eail_slideshow_is_child_selected(AtkSelection *selection, gint i)
{
   Evas_Object *widget;
   Elm_Object_Item *it, *current;

   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), FALSE);

   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
   if (!widget) return FALSE;

   current = elm_slideshow_item_current_get(widget);
   it = elm_slideshow_item_nth_get(widget, i);

   return (it == current);
}
Ejemplo n.º 4
0
/**
 * @brief Implementation ref_selecton from AtkSelection
 *
 * @param selection EailSlideshow instance
 * @param i index of selection
 *
 * @returns selected AtkObject
 */
static AtkObject*
eail_slideshow_ref_selection(AtkSelection *selection, gint i)
{
   Evas_Object *widget, *it_widget;
   Elm_Object_Item *it;

   g_return_val_if_fail(EAIL_IS_SLIDESHOW(selection), NULL);
   g_return_val_if_fail(i == 0, NULL);

   widget = eail_widget_get_widget(EAIL_WIDGET(selection));
   it = elm_slideshow_item_current_get(widget);

   it_widget = elm_slideshow_item_object_get(it);

   return eail_factory_get_accessible(it_widget);
}