コード例 #1
0
ファイル: photo_slideshow_view.c プロジェクト: naguirre/enna
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);
    }

}
コード例 #2
0
ファイル: eail_photocam.c プロジェクト: patrykka/eail
/**
 * @brief ZoomOut action callback
 *
 * @param action an AtkAction
 * @param data data passed to callback
 * @return TRUE on success, FALSE otherwise
 */
static gboolean
_eail_photocam_action_zoom_out(AtkAction *action, void *data)
{
   Evas_Object *widget;
   double zoom_level;

   g_return_val_if_fail(EAIL_IS_PHOTOCAM(action), FALSE);
   widget = eail_widget_get_widget(EAIL_WIDGET(action));
   if (!widget) return FALSE;

   zoom_level = elm_photocam_zoom_get(widget) + EAIL_PHOTOCAM_ZOOM_STEP;
   elm_photocam_zoom_set(widget, zoom_level);

   return TRUE;
}
コード例 #3
0
static void
_zoom(void *data, Evas_Object *obj, void *event_info)
{
   double z = elm_slider_value_get(obj) * 8;
   elm_photocam_zoom_set(data, z);
}