コード例 #1
0
ファイル: shell.c プロジェクト: playya/Enlightenment
void
shell_unzoom(int x, int y)
{
    Evas_Coord              ex, ey, ew, eh;

    if (!drawing)
        return;
    evas_output_viewport_get(shell->evas, &ex, &ey, &ew, &eh);

    lock_data();
    y = eh + ey - y;

    drawing->old.x = drawing->x;
    drawing->old.y = drawing->y;
    drawing->old.scale = drawing->scale;

    drawing->x -= x / drawing->scale;
    drawing->y -= y / drawing->scale;
    drawing->scale /= 1.25;
    drawing->x += x / drawing->scale;
    drawing->y += y / drawing->scale;

    append_undo_double((void *)(&(drawing->x)), drawing->old.x,
                       drawing->x, 1, OBJ_DRAWING, NULL);
    append_undo_double((void *)(&(drawing->y)), drawing->old.y,
                       drawing->y, 0, 0, NULL);
    append_undo_double((void *)(&(drawing->scale)), drawing->old.scale,
                       drawing->scale, 0, 0, NULL);

    unlock_data();
    drawing_sync();
}
コード例 #2
0
void eyelight_viewer_slideshow_start(Eyelight_Viewer* pres,int select)
{
    Evas_Object *o;
    int w_win, h_win;
    const char* data;

    evas_output_viewport_get(pres->evas, NULL, NULL, &w_win, &h_win);

    pres->state = EYELIGHT_VIEWER_STATE_SLIDESHOW;
    pres->slideshow_current = select;

    o = edje_object_add(pres->evas);
    pres->slideshow_background = o;
    if(edje_object_file_set(o, pres->theme, "eyelight/slideshow") ==  0)
        WARN("eyelight_viewer_slideshow_start(), edje_object_file_set() erreur!");

    data = edje_object_data_get(o, "nb_slides");
    pres->slideshow_nb_slides = atoi(data);
    evas_object_show(o);
    evas_object_resize(o, pres->current_size_w, pres->current_size_h);
    edje_object_scale_set(o, pres->current_scale);
    evas_object_smart_member_add(o, pres->smart_obj);
    evas_object_move(o, pres->current_pos_x, pres->current_pos_y);
    evas_object_clip_set(o, pres->current_clip);

    edje_object_signal_callback_add(o,"slideshow,slide,next","eyelight",_eyelight_viewer_slideshow_next_cb,pres);
    edje_object_signal_callback_add(o,"slideshow,slide,previous","eyelight",_eyelight_viewer_slideshow_previous_cb,pres);
    edje_object_signal_callback_add(o,"slideshow,next,end","eyelight",_eyelight_viewer_slideshow_next_end_cb,pres);
    edje_object_signal_callback_add(o,"slideshow,previous,end","eyelight",_eyelight_viewer_slideshow_previous_end_cb,pres);

    _eyelight_viewer_slideshow_slides_load(pres);
    edje_object_signal_emit(pres->slideshow_background,
           "show","eyelight");
}
コード例 #3
0
static void
main_resize(Ecore_Evas *ee)
{
   Evas_Coord w, h;

   evas_output_viewport_get(ecore_evas_get(ee), NULL, NULL, &w, &h);
   bg_resize(w, h);
}
コード例 #4
0
Rect EvasCanvas::viewport() const
{
    int x;
    int y;
    int width;
    int height;
    evas_output_viewport_get( o, &x, &y, &width, &height );
    return Rect( x, y, width, height );
}
コード例 #5
0
ファイル: edvi_evas_test.c プロジェクト: Limsik/e17
static void
app_resize(Ecore_Evas *ee)
{
   Evas_Coord w, h;
   Evas *evas;

   evas = ecore_evas_get(ee);
   evas_output_viewport_get(evas, NULL, NULL, &w, &h);
/*    bg_resize(w, h); */
}
コード例 #6
0
ファイル: fade.c プロジェクト: barbieri/barbieri-playground
static void
resize_cb(Ecore_Evas *ee)
{
    app_t *app;
    Evas_Coord w, h;

    app = ecore_evas_data_get(ee, "app");
    evas_output_viewport_get(app->evas, NULL, NULL, &w, &h);
    evas_object_resize(app->edje_main, w, h);
}
コード例 #7
0
ファイル: elation_media.c プロジェクト: playya/Enlightenment
static void
resize(Elation_Module *em)
{
   Elation_Module_Private *pr;
   Evas_Coord w, h;
   
   pr = em->data;
   evas_output_viewport_get(em->info->evas, NULL, NULL, &w, &h);
   
   evas_object_move(pr->overlay, 0, 0);
   evas_object_resize(pr->overlay, w, h);
}
コード例 #8
0
static void
_eval(Evas_Object *obj)
{
   Evas_Coord x, y, w, h, cvx, cvy, cvw, cvh;
   Widget_Data *wd = elm_widget_data_get(obj);
   if (!wd) return;

   evas_event_freeze(evas_object_evas_get(obj));
   evas_object_geometry_get(obj, &x, &y, &w, &h);
   if (w < 1) w = 1;
   if (h < 1) h = 1;
   evas_output_viewport_get(evas_object_evas_get(obj),
                            &cvx, &cvy, &cvw, &cvh);
   if ((cvw < 1) || (cvh < 1)) return;
   // need some fuzz value thats beyond the current viewport
   // for now just make it the viewport * 3 in size (so 1 vp in each direction)
   /*
   cvx -= cvw;
   cvy -= cvh;
   cvw *= 3;
   cvh *= 3;
    */
   if (ELM_RECTS_INTERSECT(x, y, w, h, cvx, cvy, cvw, cvh))
     {
        if (!wd->content)
          {
//             DBG("                 + %i %i %ix%i <> %i %i %ix%i", x, y, w, h, cvx, cvy, cvw, cvh);
             evas_object_smart_callback_call(obj, SIG_REALIZE, NULL);
             if (wd->content)
               {
                  if (evas_object_smart_data_get(wd->content))
                     evas_object_smart_calculate(wd->content);
               }
             wd->last_calc_count =
                evas_smart_objects_calculate_count_get(evas_object_evas_get(obj));
          }
     }
   else
     {
        if (wd->content)
          {
             if (wd->last_calc_count !=
                evas_smart_objects_calculate_count_get(evas_object_evas_get(obj)))
                evas_object_smart_callback_call(obj, SIG_UNREALIZE, NULL);
          }
     }
   evas_event_thaw(evas_object_evas_get(obj));
   evas_event_thaw_eval(evas_object_evas_get(obj));
}
コード例 #9
0
ファイル: shell.c プロジェクト: playya/Enlightenment
static void
bg_mouse_down(void *data, Evas *_e, Evas_Object *_o, void *event_info)
{
    Drawing            *d;
    double              x, y, _x, _y;
    Evas_Coord          ex, ey, ew, eh;
    int                 shift_state, ctrl_state;
    int 		_b;
    Evas_Event_Mouse_Down * em = (Evas_Event_Mouse_Down*) event_info;

    if (!shell)
        return;
    if (!shell->evas)
        return;

    _b = em->button;
    shift_state = evas_key_modifier_is_set(em->modifiers, "Shift"); 
    ctrl_state = evas_key_modifier_is_set(em->modifiers, "Control");

    evas_output_viewport_get(shell->evas, &ex, &ey, &ew, &eh);
    d = drawing;
    if (!d)
        return;
    _x = em->canvas.x;
    _y = em->canvas.y;

    if (!ctrl_state && (_b == 1))
      {
          x = _x / d->scale - d->x;
          y = -(_y - eh - ey) / d->scale - d->y;
          gra_pre_draw_mouse_click(x, y);
      }

    if (!shift_state && !ctrl_state && (_b == 3))
      {
          menu_box_show(DUP("context.menu"), (double)_x + 1, (double)_y + 1, 1);
      }

    if (_b == 2)
        shell_drag_start(_x, _y);
    if (ctrl_state && (_b == 1))
        shell_zoom(_x, _y);
    if (ctrl_state && (_b == 3))
        shell_unzoom(_x, _y);     
}
コード例 #10
0
ファイル: shell.c プロジェクト: playya/Enlightenment
	static void
engy_resize(Ecore_Evas * ee)
{
	Evas_Coord w, h;
	
	if (!shell->evas)
		return;
	
	evas_output_viewport_get(shell->evas, NULL, NULL, &w, &h);

	shell->w = (int)w;
	shell->h = (int)h;
	evas_object_resize(shell->o_bg, shell->w, shell->h);

        cl_configure(w,h);
        log_configure();
        info_configure();
        panel_configure();
        gui_put_string(DUP("_zoom_in|_zoom_out"));
}
コード例 #11
0
static void
display_help(Evas *e)
{
    Evas_Textblock_Style *style;
    int h_win, w_win;

    evas_output_viewport_get(e, NULL, NULL, &w_win, &h_win);

    help_background = evas_object_rectangle_add(e);
    help_text_cmd = evas_object_textblock_add(e);
    help_text_desc = evas_object_textblock_add(e);

    style =  evas_textblock_style_new();
    evas_font_path_append(e,PACKAGE_DATA_DIR"/viewer");
    evas_textblock_style_set(style,"DEFAULT='font=DejaVuSans-Bold font_size=20 align=left color=#000000 wrap=word style=soft_outline outline_color=#3779cb'"
                             "NewLine= '+\n'");

    evas_object_resize(help_text_cmd, w_win,h_win);
    evas_object_move(help_text_cmd,200,140);
    evas_object_show(help_text_cmd);

    evas_object_textblock_style_set(help_text_cmd,style);
    evas_object_textblock_text_markup_set(help_text_cmd,help_msg_cmd);

    evas_object_resize(help_text_desc, w_win,h_win);
    evas_object_move(help_text_desc,450,140);
    evas_object_show(help_text_desc);

    evas_object_textblock_style_set(help_text_desc,style);
    evas_object_textblock_text_markup_set(help_text_desc,help_msg_desc);



    evas_object_show(help_background);
    evas_object_color_set(help_background, 0, 0, 0, 200);
    evas_object_resize(help_background, w_win,h_win);
    evas_object_move(help_background,0,0);

    is_help = 1;
}
コード例 #12
0
void eyelight_viewer_tableofcontents_start(Eyelight_Viewer* pres,int select)
{
    Evas_Object *o;
    int w_win, h_win;
    const char* data;

    evas_output_viewport_get(pres->evas, NULL, NULL, &w_win, &h_win);

    pres->state = EYELIGHT_VIEWER_STATE_TABLEOFCONTENTS;
    pres->tableofcontents_current = select;

    o = edje_object_add(pres->evas);
    pres->tableofcontents_background = o;
    if(edje_object_file_set(o, pres->theme, "eyelight/tableofcontents") ==  0)
    {
        WARN("table of contents is not supported by the theme");
        return ;
    }

    data = edje_object_data_get(o, "nb_slides");
    pres->tableofcontents_nb_slides = atoi(data);
    evas_object_show(o);
    evas_object_resize(o, pres->current_size_w, pres->current_size_h);
    edje_object_scale_set(o, pres->current_scale);
    evas_object_move(o, pres->current_pos_x, pres->current_pos_y);
    evas_object_smart_member_add(o,pres->smart_obj);
    evas_object_clip_set(o, pres->current_clip);

    edje_object_signal_callback_add(o,"tableofcontents,slide,next","eyelight",_eyelight_viewer_tableofcontents_next_cb,pres);
    edje_object_signal_callback_add(o,"tableofcontents,slide,previous","eyelight",_eyelight_viewer_tableofcontents_previous_cb,pres);
    edje_object_signal_callback_add(o,"tableofcontents,next,end","eyelight",_eyelight_viewer_tableofcontents_next_end_cb,pres);
    edje_object_signal_callback_add(o,"tableofcontents,previous,end","eyelight",_eyelight_viewer_tableofcontents_previous_end_cb,pres);

    _eyelight_viewer_tableofcontents_slides_load(pres);

    edje_object_signal_emit(pres->tableofcontents_background,
           "show","eyelight");
}
コード例 #13
0
ファイル: shell.c プロジェクト: playya/Enlightenment
static void
bg_mouse_move(void *data, Evas *_e, Evas_Object *_o, void * event_info)
{
    Drawing            *d;
    Evas_Coord              x, y;
    Evas_Coord              ex, ey, ew, eh;
    Evas_Coord		_x, _y;

    Evas_Event_Mouse_Move *em = (Evas_Event_Mouse_Move*) event_info;

    _x = em->cur.canvas.x;
    _y = em->cur.canvas.y;
    magnet_mouse_move(_x, _y);
    info_sync_mouse();

    evas_output_viewport_get(shell->evas, &ex, &ey, &ew, &eh);
    d = drawing;
    if (!d)
        return;
    x = _x / d->scale - d->x;
    y = -(_y - eh - ey) / d->scale - d->y;
    shell_drag(em->cur.output.x, em->cur.output.y);
    gra_pre_draw_mouse_move(x, y);
}