static int _elitaire_card_drop_cb(void * data) { Elitaire_Card_Job * job; Evas_Object * card = NULL; Evas_Coord x, y, w, d; Evas_Coord image_x, image_y; Elitaire_Card * eli_card; job = (Elitaire_Card_Job *) data; card = job->card; eli_card = (Elitaire_Card *) evas_object_smart_data_get(card); evas_object_geometry_get(card, &x, &y, &w, NULL); evas_object_geometry_get(eli_card->image, &image_x, &image_y, NULL, NULL); d = (Evas_Coord) (VELOCITY(eli_card->eli) / eli_card->eli->frame_rate); image_x += d; image_y += d; if (image_x >= x || image_y >= y) { /* Job now ends */ evas_object_move(eli_card->image, x, y); if (eli_card->next_card) { Evas_Coord dy; dy = elitaire_card_offset_get(eli_card->eli); evas_object_move(eli_card->next_card, x, y + dy); } _elitaire_card_shadow_off(card); elitaire_stack_layer_reinit(eli_card->eli, eli_card->pcard); elitaire_job_del(eli_card->jobs, data); return 0; } evas_object_move(eli_card->image, image_x, image_y); if (eli_card->next_card) { Evas_Coord dy; dy = elitaire_card_offset_get(eli_card->eli); evas_object_move(eli_card->next_card, image_x, image_y + dy); } return 1; }
static int _elitaire_card_drag_cb(void * data) { Elitaire_Card_Job * job; Elitaire_Card * eli_card; Evas_Coord x, y, w, d; Evas_Coord image_x, image_y; Evas_Object * card = NULL; job = (Elitaire_Card_Job *) data; card = job->card; eli_card = (Elitaire_Card *) evas_object_smart_data_get(card); evas_object_geometry_get(eli_card->shadow, &x, &y, &w, NULL); evas_object_geometry_get(eli_card->image, &image_x, &image_y, NULL, NULL); d = (Evas_Coord) (VELOCITY(eli_card->eli) / (eli_card->eli->frame_rate * 2)); image_x -= d; image_y -= d; if (abs(x - image_x) >= w / 10) { /* Job now ends */ evas_object_move(eli_card->image, x - w / 10, y - w / 10); if (eli_card->next_card) { Evas_Coord dy; dy = elitaire_card_offset_get(eli_card->eli); evas_object_move(eli_card->next_card, x - w / 10, y - w / 10 + dy); } elitaire_job_del(eli_card->jobs, data); return 0; } evas_object_move(eli_card->image, image_x, image_y); if (eli_card->next_card) { Evas_Coord dy; dy = elitaire_card_offset_get(eli_card->eli); evas_object_move(eli_card->next_card, image_x, image_y + dy); } return 1; }
static void _on_resize(void *data, Evas *e, Evas_Object *obj, void *event) { Evas_Coord x, y, w, h; GameData *game = data; evas_object_geometry_get(game->layout, &x, &y, &w, &h); game_resize(game, w, h); printf("W:: %d, H:: %d\n", w, h); }
void ScreenSuspendView::ResizeCb() { Evas_Coord w, h; evas_object_geometry_get(parent, NULL, NULL, &w, &h); Resize(w, h); Move(0, 0); }
void HPanEntry(Evas *e, Evas_Object *obj,const char *startval) { hpanentrybox=init_entrybox(e,"Hor. Panning Inc.",startval,3,hpan_entryhandler,obj); int x,y,w,h; evas_object_geometry_get(hpanentrybox,&x,&y,&w,&h); evas_object_move(hpanentrybox,(int)(((double)get_win_width()-w)/2.0),(int)(((double)get_win_height()-h)/2.0)); }
void ApplicationMain::Resize() { Evas_Coord w, h; evas_object_geometry_get(window, NULL, NULL, &w, &h); evas_object_resize(layout, w, h); evas_object_move(layout, 0, 0); }
void BottomTrimEntry(Evas *e, Evas_Object *obj,const char *startval) { bottomtrimentrybox=init_entrybox(e,"Bottom Trimming.",startval,3,bottomtrim_entryhandler,obj); int x,y,w,h; evas_object_geometry_get(bottomtrimentrybox,&x,&y,&w,&h); evas_object_move(bottomtrimentrybox,(int)(((double)get_win_width()-w)/2.0),(int)(((double)get_win_height()-h)/2.0)); }
void ZoomEntry(Evas *e, Evas_Object *obj,const char *startval) { zoomentrybox=init_entrybox(e,"Zoom Inc.",startval,3,zoom_entryhandler,obj); int x,y,w,h; evas_object_geometry_get(zoomentrybox,&x,&y,&w,&h); evas_object_move(zoomentrybox,(int)(((double)get_win_width()-w)/2.0),(int)(((double)get_win_height()-h)/2.0)); }
static void _walle_wall_cb_resize(void *data, Evas *e, Evas_Object *obj, void *einfo) { Walle *walle = data; Evas_Coord ow, oh; evas_object_geometry_get(walle->o_scroll, NULL, NULL, &ow, &oh); evas_object_size_hint_min_set(walle->o_wall, ow, oh); }
Rect Object::getGeometry() const { int x; int y; int width; int height; evas_object_geometry_get( o, &x, &y, &width, &height ); return Rect( x, y, width, height ); }
const Size Object::getSize() const { int x; int y; int width; int height; evas_object_geometry_get( o, &x, &y, &width, &height ); return Size( x, y ); }
/** * Gets the geometry of the cursor of the editable object * * @param editable an editable object * @param cx the x of the cursor * @param cy the y of the cursor * @param cw the width of the cursor * @param ch the height of the cursor */ EAPI void e_editable_cursor_geometry_get(Evas_Object *editable, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) { E_Editable_Smart_Data *sd; if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return; evas_object_geometry_get(sd->cursor_object, cx, cy, cw, ch); }
static void cone_clicked_cb(void *data, Evas_Object *obj, void *event_info) { view_sys *p_sys = data; cone_animation *anim = p_sys->p_anim; int y, h; evas_object_geometry_get(anim->obj, NULL, &y, NULL, &h); if (anim->initial_y < 0) anim->initial_y = y; evas_object_geometry_get(anim->container, NULL, NULL, NULL, &anim->container_height); anim->anim_begin_y = y; anim->anim_end_y = anim->container_height + h; ecore_animator_timeline_add(2, cone_do_drop, p_sys); }
/* Progressbar: width_get() */ static int _progress_bar_width_get(Etk_Tree_Model *model, void *cell_data, Evas_Object *cell_objects[ETK_TREE_MAX_OBJECTS_PER_MODEL]) { int w; if (!cell_objects[0]) return 0; evas_object_geometry_get(cell_objects[0], NULL, NULL, &w, NULL); return w; }
static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x,y,w,h; if (!wd) return; if (!wd->parent) return; evas_object_geometry_get(wd->parent, &x, &y, &w, &h); evas_object_move(obj, x, y); evas_object_resize(obj, w, h); }
static void _cube_update(Evas_Object *win, Cube *c) { Evas_Coord w, h; evas_object_geometry_get(win, NULL, NULL, &w, &h); _cube_pos(c, (w / 2), (h / 2), 512, rotx, roty, rotz, (w / 2) + cxo, (h / 2) + cyo, z0v, focv); }
/* returns with and height for this part. * * depending on the value of the use_alternate_font_metrics flag, it will * either use evas_object_geometry_get() or the _advance_get() functions. * * The latter is useful if you want to make sure that width and height * are the same value for the same number of characters in the text. * This usually only makes sense for monospaced fonts. * * In future changes to this file, you probably should use this wrapper * function everywhere instead of calling evas_object_geometry_get() * directly. */ static inline void part_get_geometry(Edje_Real_Part *rp, Evas_Coord *w, Evas_Coord *h) { if (!rp->part->use_alternate_font_metrics) evas_object_geometry_get(rp->object, NULL, NULL, w, h); else { if (w) *w = evas_object_text_horiz_advance_get(rp->object); if (h) *h = evas_object_text_vert_advance_get(rp->object); } }
void GotoPageEntry(Evas *e, Evas_Object *obj) { char *tempstr; asprintf(&tempstr,"Page? (%d/%d)",get_cur_page()+1,get_num_pages()); gotopageentrybox=init_entrybox(e,tempstr,"",4,goto_page_entryhandler,obj); free(tempstr); int x,y,w,h; evas_object_geometry_get(gotopageentrybox,&x,&y,&w,&h); evas_object_move(gotopageentrybox,(int)(((double)get_win_width()-w)/2.0),(int)(((double)get_win_height()-h)/2.0)); }
PREFIX value ml_evas_object_geometry_get(value v_obj) { Evas_Coord x, y, w, h; evas_object_geometry_get((Evas_Object*) v_obj, &x, &y, &w, &h); value v = caml_alloc(4, 0); Store_field(v, 0, Val_int(x)); Store_field(v, 1, Val_int(y)); Store_field(v, 2, Val_int(w)); Store_field(v, 3, Val_int(h)); return v; }
static void _smart_slider_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) { Evas_Coord ow, oh; evas_object_geometry_get(o, NULL, NULL, &ow, &oh); if( (ow == w) && (oh == h) ) return; evas_object_smart_changed(o); }
/* Moves the editable object */ static void _e_editable_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y) { E_Editable_Smart_Data *sd; Evas_Coord prev_x, prev_y; Evas_Coord ox, oy; if ((!object) || (!(sd = evas_object_smart_data_get(object)))) return; evas_object_geometry_get(object, &prev_x, &prev_y, NULL, NULL); evas_object_move(sd->clip_object, x, y); evas_object_move(sd->event_object, x, y); evas_object_geometry_get(sd->text_object, &ox, &oy, NULL, NULL); evas_object_move(sd->text_object, ox + (x - prev_x), oy + (y - prev_y)); evas_object_geometry_get(sd->cursor_object, &ox, &oy, NULL, NULL); evas_object_move(sd->cursor_object, ox + (x - prev_x), oy + (y - prev_y)); evas_object_geometry_get(sd->selection_object, &ox, &oy, NULL, NULL); evas_object_move(sd->selection_object, ox + (x - prev_x), oy + (y - prev_y)); }
/* Updates the position of the text object according to the position of the * cursor (we make sure the cursor is visible) */ static void _e_editable_text_position_update(Evas_Object *editable, Evas_Coord real_w) { E_Editable_Smart_Data *sd; Evas_Coord ox, oy, ow; Evas_Coord tx, ty, tw; Evas_Coord cx, cy, cw; Evas_Coord sx, sy; Evas_Coord offset_x = 0; if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return; evas_object_geometry_get(editable, &ox, &oy, &ow, NULL); if (real_w >= 0) ow = real_w; evas_object_geometry_get(sd->text_object, &tx, &ty, &tw, NULL); evas_object_geometry_get(sd->cursor_object, &cx, &cy, &cw, NULL); evas_object_geometry_get(sd->selection_object, &sx, &sy, NULL, NULL); if (tw <= ow) offset_x = ox - tx; else if (cx < (ox + E_EDITABLE_CURSOR_MARGIN)) offset_x = ox + E_EDITABLE_CURSOR_MARGIN - cx; else if ((cx + cw + E_EDITABLE_CURSOR_MARGIN) > (ox + ow)) offset_x = (ox + ow) - (cx + cw + E_EDITABLE_CURSOR_MARGIN); if (tw > ow) { if ((tx + offset_x) > ox) offset_x = ox - tx; else if ((tx + tw + offset_x) < (ox + ow)) offset_x = (ox + ow) - (tx + tw); } if (offset_x != 0) { evas_object_move(sd->text_object, tx + offset_x, ty); evas_object_move(sd->cursor_object, cx + offset_x, cy); evas_object_move(sd->selection_object, sx + offset_x, sy); } }
static void _sizing_eval(Evas_Object *obj) { Evas_Coord x, y, w, h; ELM_NOTIFY_DATA_GET(obj, sd); if (!sd->parent) return; evas_object_geometry_get(sd->parent, &x, &y, &w, &h); evas_object_move(obj, x, y); evas_object_resize(obj, w, h); }
static void _evas_smart_frame_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) { Evas_Coord ow, oh; evas_object_geometry_get(o, NULL, NULL, &ow, &oh); if ((ow == w) && (oh == h)) return; /* this will trigger recalculation */ evas_object_smart_changed(o); }
/* Edje: width_get() */ static int _edje_width_get(Etk_Tree_Model * model, void *cell_data, Evas_Object * cell_objects[ETK_TREE_MAX_OBJECTS_PER_MODEL]) { Etk_Tree_Model_Edje *edje_model; int w; if (!(edje_model = (Etk_Tree_Model_Edje *) model) || !cell_objects[0]) return 0; evas_object_geometry_get(cell_objects[0], NULL, NULL, &w, NULL); return w; }
static void _walle_picture_cb_resize(void *data, Evas *e, Evas_Object *obj, void *einfo) { Evas_Object *o_pict; Evas_Coord width; Evas_Coord height; o_pict = (Evas_Object *)data; width = 0; height = 0; /* callback when a picture is resized */ evas_object_geometry_get(o_pict, NULL, NULL, &width, &height); evas_object_image_fill_set(o_pict, 0, 0, width, height); }
static void bg_down_cb (void *data, Evas * evas, Evas_Object * obj, void *event_info) { Evas_Event_Mouse_Down *event = event_info; Evas_Object *cont = data; Evas_Coord x, w; evas_object_geometry_get (obj, &x, NULL, &w, NULL); if (event->canvas.x < x + w / 2) esmart_container_scroll_start (cont, -1); else esmart_container_scroll_start (cont, 1); }
static void _smart_slider_smart_calculate(Evas_Object *o) { smart_slider_t *priv = evas_object_smart_data_get(o); Evas_Coord x, y, w, h; evas_object_geometry_get(o, &x, &y, &w, &h); evas_object_resize(priv->theme, w, h); evas_object_move(priv->theme, x, y); _smart_slider_value_flush(o); }
unsigned int read_texture(Evas_Object *parent, const char *filename) { unsigned int gltex_object; int w, h; int surface_w, surface_h; evas_object_geometry_get(parent, NULL, NULL, &surface_w, &surface_h); Evas_Object* inline_buffer = elm_win_add(parent,"Img Read",ELM_WIN_INLINED_IMAGE); evas_object_move(inline_buffer, 0, 0); evas_object_resize(inline_buffer, surface_w, surface_h); evas_object_show(inline_buffer); Evas* canvas = evas_object_evas_get(inline_buffer); Evas_Object* image = evas_object_image_add(canvas); char path[200]; sprintf(path, "%s%s", app_get_resource_path(), filename); evas_object_image_file_set(image, path, NULL); evas_object_image_size_get(image, &w, &h); evas_object_image_fill_set(image, 0, 0, w, h); evas_object_image_filled_set(image, EINA_TRUE); evas_object_resize(image, w, h); evas_object_show(image); elm_win_render(inline_buffer); GLubyte* pixels; pixels = (GLubyte*) evas_object_image_data_get(image, EINA_FALSE); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &gltex_object); glBindTexture(GL_TEXTURE_2D, gltex_object); glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, w, h, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pixels); glGenerateMipmap(GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glBindTexture(GL_TEXTURE_2D, 0); evas_object_del(inline_buffer); return gltex_object; }
static void _e_toolbar_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { E_Toolbar_Smart_Data *sd; Evas_Coord x, y; if ((!obj) || !(sd = evas_object_smart_data_get(obj))) return; evas_object_geometry_get(obj, &x, &y, NULL, NULL); evas_object_move(sd->o_base, x, y + ((h - sd->h) * sd->valign)); evas_object_resize(sd->o_base, w, h); sd->w = w; sd->h = h; }